LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Library - Where is my data?

Hi Again,

I am using the Modbus Library to access a RedLion Controller that is setup as a Modbus Slave.

I am fairly confident that I know the settings for the RedLion Controller (I was able to access the register values using Modscan). The problem I am having however is I don't know where to find my data in Labview. I have looked at the block diagrams and I can seem to find where I would get my values.

I am trying to collect real time data from 56 pressure transducers, so all I need to do is read the holding registers (i think that is what they are called). Once I am able to find this data in the block diagram I then want to write it to a file with a time stamp, and display the values on graphs so that I can watch the change in values in real time.

Any advice on where to find this in the Modbus Library would be appreciated. I am fairly new to LabView and data acquisition so it is quite possible that I am missing something simple.

Cheers
0 Kudos
Message 1 of 6
(3,156 Views)
I forgot to mention that I am connecting via ethernet so using Modbus TCP.
0 Kudos
Message 2 of 6
(3,155 Views)

I'm not a huge fan of the way NI's Modbus library is built, but I have used it a couple of times. If memory serves, it uses a single VI to read data. There should even be a couple of examples in the LLB (called something like "TCP master example") which show how to use it.

Essentially, the VI outputs a cluster which has a 1D U16 array as one of its elements. When you ask for the holding registers, that array should have the values. You can get them by wiring the cluster to an unbundle by name primitive.

To learn more about LabVIEW, I suggest you try looking at some of these tutorials.


___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(3,146 Views)
Huzzah! It seems as though the 'infinite number of monkeys' thing applies to me.

I seem to incrementally be getting there, but still am in need of help.

Please see the attached image.

The VI is reading the values from the registers (verified by double checking the values with ModScan) as seen in the front panel. The indicator in the top right allows me to cycle through the different registers (or sensors in my case).
However, these values do not include decimal places (likely not a big deal since I can divide by an appropriate value once I get my hands on each individual value, which is my next problem).

I tried 'unbundle by name' with no luck. How do I get each value on its own so I can work with it???

My ultimate goal is to be able to write the values (56 sensors) to a single file with a time stamp (approximate sample rate of 1Hz), as well as, graphically display the values in real time.

Once again. Any direction with regards to this would be greatly appreciated.

Cheers




0 Kudos
Message 4 of 6
(3,132 Views)

The values don't have fractional data because they're integers. As for the rest, you should really look at those tutorials, or you'll just have more questions. Learning to work with LabVIEW is considerably easier than learning to work with other languages, but you still need to do it.

To help you, you can also look at some of the example found in the example finder (Help>>Find Examples).

The concepts you want to be looking at in your case would be arrays, files, and loops. Just as a pointer, leave the TCP Open primitive outside the loop, or you'll have a memory leak.


___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(3,128 Views)
Will do. Thanks for all the help TST.
0 Kudos
Message 6 of 6
(3,119 Views)