LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU - Is it always necessary to convert 2*16bit to 32bit?

Solved!
Go to solution

I have spent alot of time on the forums trying to solve this problem and as of yet I have been unable to 

fix it. 

 

I am reading from a Carlo Gavazzi DC Modbus sensor (Programming Manual Attached) and have been 

getting a mixture of correct and incorrect values when reading from the device. 

 

I am using the Labview Modbus library which reads 16Bit individual registers by default and this has 

generally been fine unless any negative values are involved.My method of accessing each register is merely

a loop using the Example2_VI and iterating though the required registers. 

 

I am mainly interested in the following values

 

Address::Parameter::Register Value::Expected Value

0::Voltage::476:: 47.6V (This is correct)

1::Voltage::0::

4::Current::65446::A couple of (negative) amps at most! not 6500A/89A

5::Current::65535::

 

The negative values only occur when the system (Generator) isn't running. When it is actually running 

the 16Bit current values can range from 40A to 250A but they are all incorrect by a factor of at least 10-20%.

 

I have tried to use the example vi to combine the current values in some way to return something meaningful but 

every time it just keeps saying NaN (Not a number I assume) so I'm wondering if I have to do some sort of calculation

before I feed them into the type casting??

 

 

0 Kudos
Message 1 of 4
(6,098 Views)
Solution
Accepted by topic author shanephelan
Message 2 of 4
(6,076 Views)

Hi Wayne, 

 

That fix worked perfectly!!!   It has also solved a related problem somewhere else too!!

 

Thanks a million. 

 

Much Apreciated!

 

 

Message 3 of 4
(6,057 Views)

Glad I could help.  Welcome to the NI Forums.

0 Kudos
Message 4 of 4
(6,049 Views)