Solution
There are a number of ways to approach this acquisition and logging task. We will be exploring one of the numerous ways.
Below are steps to acquire and log you are using LabVIEW 2016 or later. A VI Snippet is attached at the bottom showing all the steps:
- Create a timed loop for your data acquisition.
- Inside the timed loop, create a Real-Time Stream Writer Endpoint. Connect your trigger (boolean) to the element valid? input terminal.
- Create a while loop for data logging.
- Inside the while loop, create a Real-Time Stream Reader Endpoint.
- Inside the while loop, create a case structure that will only write to the log file if the element valid? output terminal is True.
Note: this image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the File onto your LabVIEW diagram.