LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Correctly Modbus Holding Register From LabVIEW I/O Server

Hi all I'm using the I/O Server function of LabView 2019, where I connect through Modbus Slave Labview. To understand LabVIEW acts as Slave and C# acts as Master and I pass from false to true some labview bool correctly. But now I needed to export double values from LabVIEW to C# and I created three variables 40001,40002,40003 as shown in the attachment. However, from C# and from ModScan32 the values instead of being 5.0 are 4.59e-40 and I can't figure out where I'm wrong.

Download All
0 Kudos
Message 1 of 5
(921 Views)

If you are refering to the number indicators, you need to change how it's presented, right click on the indicator and change the Display format as Floating Point, the way you mentioned it's as Scientific.

 

LVNinja_0-1687440958990.png    

LVNinja_1-1687441085935.png

 

 

 

 

 

0 Kudos
Message 2 of 5
(896 Views)

Thanks for the answer anyway in the indicator I see the double value correctly and I pass it in write mode to the variable (Voltage,Current,Time). It's when I go to ModScan32 or C# that I read values like 4.59e-40 while maybe something else is written.

Download All
0 Kudos
Message 3 of 5
(891 Views)

Remember that float values are on 2 registre addresses!  (2x 16bit values) 

And that float values in Modbus are singles in LabVIEW 

0 Kudos
Message 4 of 5
(885 Views)

You're right in fact ModScan32 should show me the correct value with the conversion done. So I think I did something wrong in LabVIEW

0 Kudos
Message 5 of 5
(882 Views)