From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-17-2020 02:25 PM
I am trying to add bound variables to my modbus server from a device that has a data format I have never before. First the data is either 16 bit (single register) or a 32 bit (two register) each type can also be signed or unsigned. The data represents an integer part and a fractional part which is defined as a number of bits for each part. The manufacture supplies a "scaling factor" represented by 8.24, where the first 8 bits is the integer and the remaining 24 bits is the fractional part. Because my explanation may not be clear I have attached screen captures from the manual. Also I have attached how to get the real value using labview code.
However I would like to add this to my Modbus server (Labview DSC Module) and was wondering if there was a modbus function to deal with this type of data, Like a F400001 for floats or 300001.1 for individual bits.
I was hoping that there might be something directly from the modbus server I could just read the registrar and display a value directly from the modbus server.
Solved! Go to Solution.
07-17-2020 02:58 PM
07-17-2020 03:00 PM
I think what you'll have to do is read that as a 32 bit integer. Than do some math on it manipulating the bits to break them down into integer and fractional, then doing the math and combining the parts. Perhaps you can create a fixed point data type and try type casting the 32 bit integer into the FXP type. But that is speculation on my part. I haven't needed to mess with FXP types.
07-19-2020 11:34 AM - edited 07-19-2020 11:38 AM
08-04-2020 10:18 AM
thanks very much for the help