Overview
This example illustrates how to acquire data and then playback the data at a variable speed (with relation to the acquisition speed) with the option to pause the playback.
Description
The example was created to illustrate how to add additional channels to the original example Acquire and Playback Data at Variable Speed with Option to Pause. The original example functions by inserting chunks of waveforms from a DAQmx Read VI into an array in one loop and then passing that array to a second loop which iterates thru the array and outputs the waveform chunk to a Waveform Chart. The changes made to the original example consist or parsing the array of waveform data and appending each waveform read to itself. This data is then passed through the start playback frame and into the playback loop. The speed is adjusted by modifying the value wired to the Wait function in the second loop.
Requirements
Steps to Implement or Execute Code
1. Download the attached folder to your computer
2. Open the VI " Acquire Data Playback 2012 NIVerified.vi"
3. Steps to Complete
1) Specify the appropriate analog input channels, sample rate, and sample mode.
2) Run the VI.
3) Click the START ACQUISITION button to start acquiring data.
4) Click the STOP ACQUISITION button to stop acquiring data.
5) Set the speed you wish to playback the data (you can also change this during playback).
6) Click the START PLAYBACK button.
7) Click the PAUSE PLAYBACK/RESUME PLAYBACK to pause and resume the playback at any point.
😎 Click the STOP PLAYBACK button to stop the playback before the data playback completes on its own.
4. Steps to Add Another Channel
1) Increase the size of the Index Array VI in the data aquisition loop and add an index value.
2) Make a copy of the waveform shown outlined in red in the block diagram image below.
3) Expand the Merge Signals VI to include the amount of extra channels you are adding.
4) Be sure to pass each additional waveform through the center sequence structure.
Additional Information or References
VI Block Diagram
Front Panel
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.