To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Use this template to build a producer/consumer design pattern with events to produce queue items. Use this design pattern instead of the User Interface Event Handler pattern for user interfaces when you want to execute code asynchronously in response to an event without slowing the user interface responsiveness.
Description
This VI demonstrates the programming necessary for a single button to programmatically control two states. This VI also demonstrates the power of the event data node and how it can be utilized. This provides an alternative method for creating the same number of buttons as cases that you want to programmatically control. Depending upon the application this could provide a much more intuitive user experience compared to a program with many buttons with various functionalities. The cases in the case structure (consumer loop) are only designed to show how the program works. The code in these states can e replaced with the functionality the user wants to actively enable.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**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.