I am developing a system that measures the CO2 concentration of 12 vessels over a 14 day test using one gas analyzer. Each vessel has its own measurement file where the data is stored, and data is only written to them when that vessel is selected. That part runs successfully. However, I would like to the plot all the data acquired so far for each vessel as the 14-day test runs. How can I write to the measurement files and plot the entire data set acquired simultaneously?
I have attached my program below.
Thanks for the reply. Are you saying I need to completely redo my entire program? I'm still pretty new to LabVIEW. So, I'm not even sure where to begin with the producer/consumer template. Could you explain how I could use this template to do the following:
1) Cycle 12 Solenoid Valves on/off individually and control the length of time they are open
2) Acquire an analog signal from a Flow Sensor and Gas Analyzer
3) Write the data acquired to a dedicated file (one file for each valve)
4) Only write the data to each file when its corressponding valve is selected
5) Take measurements from 3 RTDs and send out a control signal, +10V, that will turn on a pump if temp gets too low
6) Write temperature data from RTDs to one file
7) Display trend data for each data file as the test executes.
😎 Allow user to pause/stop the test to perform periodic maintenance during the 14-day test.
I would recommend that you do. Your application isn't modular at all which will definitely lead to problems later on when debugging your application. Also, if you were to acquire data really fast, then your hardware buffer will overflow while your loop is working on other tasks. Giving this responsibility to other loops will help you avoid errors.
Look closer at the producer/consumer design pattern and you will notice that there is a queue buffer which transmits data from the producer loop to the consumer loop.
The way you will design your application is that there will be a producer loop that is responsible for acquiring data (the analog signal from flow sensor and gas analyzer). You can have a consumer loop that is responsible for file i/o. You will place the acquired data into the queue and the consumer loop which is subscribed to that queue will read the data and write to file. You can control the selection of valves using action engines (functional global variables).
This may turn out to be really confusing to do all at the same time. I would recommend that you start one step at a time, post your VIs here and we can help you along the way.
Okay, I finally found an example of a producer/consumer VI that acquires an analog voltage, and I understand most of the VI. However, I am not sure of the purpose of the array that is connected to the element data type terminal of the obtain queue function and has the time stamp, a constant, and another array inside of it. Could you explain what the element data type terminal is and what the array is for? I've looked at the data file it creates and there is no time stamp and only the voltages acquired from the DAQ board.
I've attached the VI to this post as well as a screenshot with the array in question.