10-13-2008 03:01 PM
You are definitley missing a byte at the end. Whether it is a timeout issue, or the device failing to return all of the bytes, I'm not sure.
You get a 1h, which is the slave address.
Then you get 3h and 12h. That is the command code for read holding registers, and 12 bytes (which is 6 16 bit registers). All is good.
Then you get 12 zeroes. I assume all 6 16-bit registers are zero.
Then you get 93h 70h on a successful read. That is your CRC-16 checksum. On your error read, you only get the 93h. Your last byte of 70h has been dropped.
I don't know why you wouldn't be getting some sort of error from the Modbus drivers when this happens, or that you would be getting 5 valid readings as you stated in your earlier messges.
10-14-2008 01:55 PM
D Reck,
Thanks for posting the screenshots as requested. They have been helpful. Do you mind posting your code as well?
10-15-2008 06:15 AM
Attached is a simple modbus master VI, along with my NI Modbus library. The library has one small modification to the MB Serial Master Query so that it displays the bytes sent and bytes received, otherwise it should be unmodified.
Dan
10-15-2008 05:14 PM