Snags of an Aircable industrial interfacing via Modbus protocols with an energy meter

13 views
Skip to first unread message

Anisio

unread,
May 7, 2008, 9:07:07 AM5/7/08
to AIRcable(tm), anisio...@gmail.com
Hi folks,
We are trying to connect an Aircable industrial with an energy meter
that uses Modbus protocol via a RS484 (we are using an adapter RS232-
RS484 to interface with the Aircable industrial).
Unfortunately the communication is not reliable and many data is being
lost.
After wrestling with a plug and play cable replacement we realized
that:
The Modbus protocol has a restriction of 1.5 char spacing between
frames in a Modbus msg.
One solution would be to write a Basic code and run it in the Aircable
module, but there are restrictions too:
1. A modbus command is 80 chars or bytes long and the Basic line code
is minited to 32 bytes.
2. A string msg could be assembled and transmitted but the Modbus
command has null char \x00 in the middle and the current version of
Aircable basic uses the null char to flag the end of a string!
The type of string we have to send is:
8 $20 = "\x12\x04\x00\xE1\x00\xA5"

We appreciate any help or hint.

thanks,
Anisio.

Vilas

unread,
May 7, 2008, 11:23:27 AM5/7/08
to AIRcable(tm)

Hello,
I had a similar problem of loosing data when communicating to an
instrument via rs232/rs485 [modbus].

> The Modbus protocol has a restriction of 1.5 char spacing between
> frames in a Modbus msg.

Modbus has in fact a restriction of 1.5char between two consecutive
chars in a frame and the time interval is limited to about 1.5ms in a
9600baud rate, which is a low limit for some instruments.
like the one I used from Kron.

> One solution would be to write a Basic code and run it in the Aircable
> module, but there are restrictions too:
One solution would be a function similar to the "CAPTURE" but instead
of reading a port, writing to that port directly from memory. Is that
possible?
The null char x\00 is a limitation to send a string via serial port,
since a Modbus command has lots of x\00 because of address numbers of
an address of 2 bytes.

> The type of string we have to send is:
> 8 $20 = "\x12\x04\x00\xE1\x00\xA5"

A typical message composed of hexadecimal numbers of a parameter
reading Modbus command is:
12 04 00 0E 00 02 12 AB

To code this using the Basic of Aircable requires extra chars like
"\x" which added to the remaing line commands exceeds the 32 bytes
limit of a line code.

Any hint to solve this problem would be great to me too!

Vilas.

Manuel Naranjo

unread,
May 14, 2008, 8:58:50 AM5/14/08
to airc...@googlegroups.com
Hi,

Sorry for the delay, I started with the stupid idea of marking mails for
replying later and then I always forget.


> One solution would be a function similar to the "CAPTURE" but instead
> of reading a port, writing to that port directly from memory. Is that
> possible?
> The null char x\00 is a limitation to send a string via serial port,
> since a Modbus command has lots of x\00 because of address numbers of
> an address of 2 bytes.
>

I have good news for you all, the next version of the OS will have a
function that will be able to dump to the ports the content from a file
in a binary way.


> A typical message composed of hexadecimal numbers of a parameter
> reading Modbus command is:
> 12 04 00 0E 00 02 12 AB
>
> To code this using the Basic of Aircable requires extra chars like
> "\x" which added to the remaing line commands exceeds the 32 bytes
> limit of a line code.
>

Actually the \x thing is not the big issue. The big issue is that \x00
is interpreted as end of line, so then everything after \x00 and \x00
itself will never be transmitted. The new function will solve this problem.


> Any hint to solve this problem would be great to me too!
>

Sorry... But not right now, AFAIK the new OS is going out soon, but
don't ask me how soon is that, that's not in my hands, I don't even know
the code for that.

Cheers,
Manuel

Reply all
Reply to author
Forward
0 new messages