Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus 32 bit signed data member

Solved!
Go to solution

i need to read and write some data member in 32 bit integer signed format <sd4xxxx> modbus address

 

in my modbus device this format is [for example] low word 44097 - hi word 44098

 

for example if the value of address 44097 is 1 and 44098 is 0 the value of sd44097 is 1

(1) + (2^16 x 0) = (1) + (65536 x 0)  = 1

but lookout interprets this data like (2^16 x 1) + (0) = (65536 x 1) + (0)  = 65536

 

in modbus object advanced options you could check the modicon option for floating value, but i don't find similar setting for duble precision signed integer and don't find any solution

 

does anyone know a solution ?

thank you

 

               B_N_
0 Kudos
Message 1 of 7
(8,786 Views)

Hi B_N_

 

When I use 32bit registers I do this:

If the 2 registers are 44097 and 44098, I write to and read from F44097. Lookout then knows that you are dealing with a 32 bit float and arranges the data in the registers accordingly.

 

You don't need to use the advanced settings in modbus, "F" does all that for you, at least in my setups.

Hope that works in yours.

 

Roger 

0 Kudos
Message 2 of 7
(8,774 Views)
Solution
Accepted by topic author B_N_

If you use Lookout 6.1, follow this KB to create a modbus.ini file.

http://digital.ni.com/public.nsf/allkb/2E64D5CF87CA6A1086256BB30070DC1A?OpenDocument

Input

ReverseByteOrder=1

It will work on SD as you want.

 

But if you use 6.0 or lower version, I don't know a way to do it. I'm not sure if the F will work. You may use the expression to calculate the value.

Ryan Shi
National Instruments
Message 3 of 7
(8,752 Views)

perfect !

 

is the complet list of modbus.ini parameter availlable ?

               B_N_
0 Kudos
Message 4 of 7
(8,738 Views)
I think that KB describes all the modbus parameters. I will add the reversebyteorder to it.
Ryan Shi
National Instruments
0 Kudos
Message 5 of 7
(8,723 Views)

Hi,

Does this applies to LabVIEW 8.5 as well?

i'm also tyring to communicate with a device that has Floating-Point paired-register.

the addresses it's using are 20249 & 20250.

does it means i map these addresses in LabVIEW by F200249, then i should be able to get the Float value?

 

WF

0 Kudos
Message 6 of 7
(8,406 Views)

Fxxx reads two adjacent addresses and combine them to a float value.

Ryan Shi
National Instruments
0 Kudos
Message 7 of 7
(8,403 Views)