LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from controller using MODBUS

HI,

 

I have a Honeywell UDA2182 controller and am trying to read 2 data channels from it using Labview 2010 SP1 (running on XP with the VISA and MODBUS libraries installed). The PC is connected to the controller via a RS485 - USB converter.

 

I have used the 2 attached VI's which I downloaded off the web and get a reading. However the reading is 16385 for the PH probe (should be 2.02) and 17316 for the ORP probe (should be 328 mv). If the conditions of the probes are changed then the values increase or decrease respectively in what appears to be a reasonable manner.

 

I am using the modbus RTU format to read the registers and believe that the controller is set correctly and labview parameters are set correctly.

 

Is the register some how encrypted? And if so how do I decrypt it?

 

I have done some research and it seems that the value might be encrypted, however it is not in hex or binary format.

 

Any other MODBUS examples which read the values from the controller would also be appreciated.

 

Please bear in mind that I have no experience with MODBUS and am no wizard with labview so clear and simple responses would be greatly appreciated.

 

 

Download All
0 Kudos
Message 1 of 15
(4,007 Views)

I would start by reading this. 

 

One thing to remember is that in order to read a FLOAT value, you have to read 2 registers.  The values from those two registers can then be used to figure out the float value.

0 Kudos
Message 2 of 15
(4,003 Views)

I have read the controller manual as you suggest, however, I have not found anything to help. The information I need may be in there, I just don't know what information I'm missing.

 

From the manual it seems that the register value should be a float, which it is. However, it is not the value shown on the controller screen. I have, what I believe to be the correct controller and Labview modbus settings. 

 

 

0 Kudos
Message 3 of 15
(3,991 Views)

What value/register are you trying to read from the controller?

0 Kudos
Message 4 of 15
(3,989 Views)

Usully th registers ar not "encripted" but could requre a tansformaion to mreal values.  This should be doccumented in the device communication handbook.  Common issues can envolve using multipliers revesingendian order or switching between number systems such as I16 vs U16. Remember all data is resented frmobu as U16 eve if it i not meant to be a U16 when ued.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 15
(3,979 Views)

I am trying to read PV1 and PV2 (page 31), 30001 and 30003.

 

I think i have the two parts of the register but don't understand what to do with these to get the value which i see on the controler sceen.

0 Kudos
Message 6 of 15
(3,977 Views)

As Paul has indicated each register returns a U16.  The manual describes how to take the 2 U16's and derive the float value.  Your controller has a communication setting called Word Swap.  Can you tell me what it is set to?  This determine how some of the data is manipulated.

 

Can you read PV1 ( registers 30001 and 30002 ) and tell me what the two U16's are returned and what the expected float is ?

0 Kudos
Message 7 of 15
(3,975 Views)

Hi,

 

Thanks for your help. I think it is starting to make some sense now.

 

The word swap is set to yes = big endian

 

Register......I16.....U16.....Expected float value

30001.......16388....16388............2.08

30002......-15296....62072

30003.......17316....17316............328

30004.......18414....16726

0 Kudos
Message 8 of 15
(3,970 Views)

Here is a quick attempt at combining the two U16's into a float per the manual.  Might be able to optimize further but I wanted you to see all the steps.

 

0 Kudos
Message 9 of 15
(3,956 Views)

Try this:

 

 

Message 10 of 15
(3,949 Views)