Setting 32-bit data in modbus device

A

Thread Starter

Anonymous

I am using NI modbus.llb vis to communicate with a control techniques AC drive system. I understand that modbus supports 16-bit data registers. But, I am writing data range from 40000 to 140000. When I use function code 6 with qty:1, my output to the device gets coerced into random numbers.

Any ideas how to solve the problem?
 
R
Hi, As per the MODBUS Standard the maximum data that can be passed on the bus is 65536. Even the protocol allows individual selection of 65536 data items. But your data is greater than that and u are giving the qty as 1. I dont think it is possible to transfer that much of data in one register on the bus. Because the bus length is of 0xFFFF bits. Try giving the qty as 2 and see.
 
L
Yes, as Ramachandra says you'll need to use function 16 and write your 32-bit as two consequtive 16-bit registers.

However, you also need to refer to your AC drive's documentation to see which 16-bit word should be the low register. Although Modbus tends to be called bigendian... the 984 PLC which "introduced" 32-bit math to the Modicon world stored the LOW word in the first register. Most likely NI can handle either case (low or high word first) as many small vendors take the Modbus "bigendian" to heart and move 32-bits as high word first.

Best regards
- Lynn August Linse, www.digi.com
Protocols over IP-network Blog http://iatips.com/blog
 
Top