READ_VAR with Somachine problem

  • Thread starter stefano sormanni
  • Start date
S

Thread Starter

stefano sormanni

Hello everybody,
I've a little (or great) problem when I'm trying to read data from a slave Modbus . I send the call from a Combo SoMachine by COM1, and the slave respond correctly (I've monitored the RS485 line) but in the array buffer I see only 5 word instead 40, like the buffer (array[0..40]of word) cannot receive all data. I don't think its a problem of serial line because I send the call every sec.
Plus I don't understand the meaning of ADR(buffer_array).

have somebody had a similar problem?
Have you any suggestion to give me?

Regards
 
http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf

Quote (Page 48 Error Response):

"If the server receives the request without a communication error, but cannot handle it
(for example, if the request is to read a non–existent output or register), the server
will return an exception response informing the client of the nature of the error." End Quote

and the exception response will be 5 bytes:
Address
Function + 0x80
Error Code
CRC
CRC
 
Hello harvard,

no I'm not in this case because I monitored the RS485 line and I see that the slave replies correctly. Only the buffer receive 5 of 40 data, and don't understand the reason.

Thanks anyway for your reply
 
L

Lynn August Linse

Sounds like a FIFO problem in your receive device.

If you are using windows, one 'common' failure I see is that your code looks for say 5 bytes using a 'give-me-N-bytes' function. (I don't remember the exact term). Then if you use a 'wait-for-more-data' function ... if the data is ALREADY in the serial buffer you'll NEVER be notified by windows since no new data has arrived. The fact that 35 bytes waits in the buffer does not match the 'wait-for-more-data' condition.

Early 2000's versions of Rockwell RSLinx even suffered this problem, although they finally fixed it.
 
Top