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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from controller using MODBUS

Thanks very much for your help guys, Carl is away at the moment but we'll try these out over the next few days and update you on how we get on next week.

0 Kudos
Message 11 of 15
(837 Views)

I find talking to modbus easy but decoding the registers can be tricky, lots of bit minipulation.

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

Thanks Dennis.  I figured there was a better way to do it.  The LabVIEW help for Floating-Point numbers says it all.

0 Kudos
Message 13 of 15
(827 Views)

Hi,

 

Thanks for the advice above. I thought that I had it all figured out, however, it seems that is not the case.

 

How do I separate the two register values to feed them into the above blocks to convert them into a float value? Or is there a way that i can define which register index goes to each input of the conversion to a float blocks?

 

I have a register with the two values in. I can't figure out how to do any of the following so that I can feed the two separate register values into the blocks to convert them into a float value.

I tried to:

a) parse the register

b) put the register into an array for parsing

c) use two registers, one for the Hi and one for the Lo value, which could then be feed into the blocks for conversion to a float. I have tried to do this below, but as soon as I try to create two registers the code does not work.

 

As you can see I'm still learning labview. Any help would be appreciated.

 

Untitled.jpg

 

Untitled.jpg

 

 

 

 

0 Kudos
Message 14 of 15
(802 Views)

Please Ignore the above post, I realized my own stupidity during a break. I have got it all sorted out.

 

Attached is a method of reading 2 channels from a controller using modbus. The channel settings and modbus parameters will need to be changed depending on application.

I hope that this helps others out. Thank you to those who helped me out.

0 Kudos
Message 15 of 15
(795 Views)