11-02-2006 11:38 AM
Khalid and Unclebump,
Thank you for your help, but I found that one of the modbus vi "MB Modbus Command to Data Unit.vi" is typecasting my data into U8 numbers.
If I typecast it to U16, the CRC-16 Vi cries.
I have found one register on my drive system that can take long integer, which I can point it back to my setpoint register. But now, it's the modbus vi that's coercing my 140000 into 8928.
Thanks,
11-02-2006 12:05 PM
Chokro,
This one register on your drive system, how does it take a long integer? Since all Modbus registers are 16-bit ones, it must be reading a combination of these to interpret it as a long integer, right? We have to find out how exactly it does this, so we can split the 140000 into 16-bit chunks, and write to the right registers.
Similarly, some devices support floating point numbers. But we still are limited by Modbus protocol to U16s. So, typically, the IEEE floating point notation is used to split the number into U16 chunks and written to multiple registers. The device then does the reverse -- reads these chunks and interprets the floating point number.
Regards,
-Khalid
11-03-2006 10:18 AM
Khalid,
I have got this app. note from the device vendor and it looks similar to what you were saying- write 16-bits in two registers and combine the MSW and LSW.
Attached is the note. Also, it requires 6 digit modbus addressing. Does labview support it? I tried putting a 6 digit starting address and it didn't work.
Any ideas?
Thanks,
11-03-2006 11:08 AM
Have you tried omitting the "4" and using the remaining 5 digits for the address? Normally, the "4" is not used in the actual Modbus message since the function code implies it's a Holding register. This might work, but am not sure what would happen for registers with 40xxxx, since LabVIEW will ignore the preceding 0s.
Also, don't forget to decrement the address you use by 1. E.g., for 412345, you should try 12344, since the actual data is at 0 whereas the register addressing starts at 40001.
Regards,
-Khalid
11-07-2006 01:44 PM