ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus write registers

I am succesfully using the Modbus Library vis to read some holding registers in a Honeywell UDC controller. However, I need to write to the set point registers

400107 and 400108 which is a floating point register. The Modbus vis only accept values in a high word and a low word, so how can I use these vis to write a value of 60.5, for example. In other words I need to know the equivalent of 60.5 in low and high words (16 bit).

 
When I read the registers I convert the high and low words to SGL precision, but I do not know how to do the reverse.
 
Any ideas??
0 Kudos
Message 1 of 5
(3,419 Views)
You can just use the split/join number functions and a type cast to convert back and forth.



Message Edited by Karissa on 08-03-2008 10:37 PM
_______________________________________
Systems Test Engineer
Certified LabVIEW Architect (CLA)
0 Kudos
Message 2 of 5
(3,407 Views)
Ok I just tried it and it works in LabVIEW 8.5 but not in LabVIEW 8.2, I think there was a bug in the Typecast function in the earlier LV versions.



_______________________________________
Systems Test Engineer
Certified LabVIEW Architect (CLA)
0 Kudos
Message 3 of 5
(3,401 Views)
Woops, it works in the older versions of LabVIEW if you change all the DBL data types to SGL.


_______________________________________
Systems Test Engineer
Certified LabVIEW Architect (CLA)
0 Kudos
Message 4 of 5
(3,387 Views)
    Thanks a lot for your suggestion... It works excellent..

Thanka a million
0 Kudos
Message 5 of 5
(3,362 Views)