Conditionally Writing Acquired Data based on A Condition

Updated Mar 6, 2018

Reported In

Software

  • LabVIEW

Issue Details

As a fail safe for a long running test, I want to periodically write data to an excel file. What is the best way to approach this in LabVIEW? 

Solution

Using a state machine design pattern would be a good approach to this issue. A general skeleton of how to approach this is having a case for the following events: 

1. Initialize: Forms DAQ tasks, starts a timing VI, etc.. From here go to a DAQmx read task. 
2. DAQmx Read: Read your data and display it, then direct to a state that checks for elapsed time (or another relevant condition)
3. Check Case: Check if a condition has been met (amount of elapsed time, certain voltage out of range, etc..). If true, go to a logging state, if false return to DAQmx read case. Repeat. 
4. Logging state: Takes time data/voltage/other data and writes to an external file for reliability. 
5. Shutdown: Once a stop button is pressed or a condition is met, direct to a shutdown state to close your DAQ tasks and any other open references. 
 

WAS THIS ARTICLE HELPFUL?

Not Helpful