This VI works to display a lot of channels of data while acquiring it, doing some processing, and writing it all to file.
Sometimes, you are needing to display a lot of channels of data while acquiring it, doing some processing, and writing it all to file. To do it all smoothly is occasionally a bit of a challenge if you are new to LabVIEW. This is one way that multiple tasks can be acquired, different processing steps run, and different displays updated, all while logging to file.
This project is made up of a couple of producer/ consumer chains. The acquisition is done in one loop, processing done in a second loop, display in a third, and logging in a fourth.
It works a bit like this at a high level. A Queue is used to pass the raw data to the Analysis loop. That is used to make sure every value is passed. Then, things such as FFTs are computed. A copy of that data is given to an Notifier, so the display loop can grab and display the current data without having to worry about catching every value. Also, it comes at this point so things like FFTs can be displayed. Finally, a queue is also used to pass the processed data to a logging loop where it is written to TDMS format.
There are two important caveats. First is that an eye should be kept on the queue sizes. They should stay bounded, and not increase without limit. If that happens, the limit will be reached when LabVIEW runs out of RAM and your program crashes. If your processing is slower than your acquisition, then you should simpy keep an eye on the length of your test.
The second caveat is making sure the queues empty before aborting the program. That lets the second loop work through the backlog and not lose data before shutting down. That is the purpose of the two small loops on the right - they wait until the queue is empty before releasing them.
In the Processing section, any number of things could take place. Likewise in the Display. You could have Safe/Unsafe indicators that light up when a value crosses a threshold, for example. But anything that happens in this loop will happen less often and will also not get logged. You should also remember that this is post-processing data, so the displays will not be live if the Analysis Queue size is large.
LabVIEW 2012 or compatible
NI-DAQmx 9.5.5 or compatible
NI Multifunction DAQ Device
Steps to Implement or Execute Code
Configure the file name and save type.
Connect your hardware appropriately.
Run the VI.
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**