LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best way to read data sources in parallel

Hi,
I'm looking for conceptual help as I start a project. I am trying to figure out the best way to get data from several sources at different timings and deliver them to a main vi.

I have 4 systems, which each work well on their own (OK, one doesn't work yet, but let's assume that can be fixed:)

One system reads from 2 pH meters on serial ports. The meters are slow to respond, so it takes about 2 minutes to read 4 channels of data. I save these data to a file every 10 minutes

One system reads from a CO2 meter on the USB port. It reads the data every second, and does some averaging. Every 2-10 minutes, it saves the average to a file and then sends a command to the parallel port to switch the input to the meter.

The third system reads from 6 valves, each on a serial port. These also take time, probably several minutes to poll all 6. These data will also be saved to a file.

The 4th system reads a bank of temperature probes on the USB port. These get polled every few seconds and saved to a file every few minutes.

Now that these individual routines are working, I am trying to create a front end that will display all the data in one place and allow me to set all the parameters from a single place. I would also like the possibility of using the data from one source at another place (for instance, having the output of the temperature probes sent to the pH meters to adjust their calibration). At this point, I get confused as to the best way to proceed.

It seems like if I just want to read the data from each source, I could simply put all 4 routines together in a single vi (oh, what a mess that would be to read). Maybe I should start this way?

However, if I want to have any communication between the different data sources, it seems like I will either need to use queues or VI server. I sort of envision a vi that lets me configure the various ports and the file operations and then can turn on monitoring of any or all of the various inputs. Each of them will do their thing at their own time and the main routine will simply display whatever data they deliver whenever they have new data. Fortunately, nothing is particularly time-critical, nor does it need to run fast.

My questions: Am I correct in how I'm thinking about getting this to work?   Is there a clear choice between queues or vi server? I've looked at several examples of each, but without having done something like this before, it is hard for me to tell which is better.

Thanks for any suggestions.

mike



0 Kudos
Message 1 of 5
(3,368 Views)

Hi Mike,

I think that you are on the right track with your thinking process. You might be able to implement this using queues. I'm not exactly sure how you would do it with VI server since it is just a set of functions that allows you to dynamically control front panel objects, VIs, and the LabVIEW environment. However, there are some great resources available with using queues for this type of application. I'm including the link to another discussion forum that had a very similar question to yours. There is a good example of using queues within this forum post. Also, there is a great example in NI Developer Zone about using queues and some other good ones in the NI Example Finder (just search 'queues' and you should get a few results). I hope this helps!

 

Carla

National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,345 Views)
Carla,
 
Can you save it to LV 8.5 & post back here?
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 3 of 5
(3,334 Views)

Hi Partha,

Here is the file saved for version 8.5.

National Instruments
Applications Engineer
0 Kudos
Message 4 of 5
(3,319 Views)
Thank you, Carla.
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 5 of 5
(3,302 Views)