To download NI software, including the products shown below, visit ni.com/downloads.
Overview
The Status register vi lets you pass 32 TRUE/ FALSE states between sub vis. It is a simpe way to pass control from one vi to another or from one loop to another within a vi. Instead of having 32 global boolean variables you have only one sub vi.
Description
The Status register vi is a simple vi that holds a 32 bit unsigned value. You can instruct the vi to set or return any bit in the 32 bit value. You set a bit by calling the vi with a bit number (0 based) and a TRUE (set) or FALSE (clear) value. The bit value is returned as a TRUE or FALSE value. You can also read all bits as a singel 32 bit unsigned value.
The example includes a main vi and a sub vi. The main vi calls the sub vi at startup. The sub vi calls the Status register.vi periodically to check for instructions. When the user hits Start counter the main vi calles the Status register.vi instructing it to set bit 1 high. The status change is detected by the sub vi which will start counting.
You can expand the code by adding actions to the sub vi, e.g. let bit 2 reset the timer.
Requirements
Software:
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**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.