This example demonstrates how to use a software timing source for a Timed Loop and a software trigger to control the execution of the loop.
In LabVIEW Real-Time, Timed Loops allow you to prioritize tasks and use external timing sources. In some instances, it may be necessary to execute a Timed Loop iteration programmatically. You can create a software-triggered timing source using the Create Timing Source VI in the Timed Structures palette (Programming»Structures»Timed Structures).
LabVIEW Base Development System 2012 (or compatible)
LabVIEW Real-Time Module 2012 (or compatible)
No hardware is necessary to use this example VI
Steps to Implement or Execute Code
Download and open the attached VI
Set the Timed Loop Iterations per Trigger
Run the VI
Every time you click on the Fire Software Trigger button, the Timed Loop will increment the number of loop iterations
Stop the VI
Additional Information or References
When using the Stop Timed Structure VI, the Timed Loop will iterate one more time. Use the Wakeup Reason data node set to Aborted to configure a case structure for handling this instance.
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.