To download NI software, including the products shown below, visit ni.com/downloads.
This example demonstrates how to use the Datalogging and Supervisory Control (DSC) functions to create user events for shared variables.
This project demonstrates how to read shared variables with an event based architecture. The project includes a library of shared variables. Once deployed, these variables are updated from the "Change Shared Variable Value.vi". Each variable is bound to a front panel control.
When an update occurs, the event structure inside of the "Value Change Event for Shared Variables.vi" will fire and the value will be changed inside of an indicator for each shared variable. The event structure also keeps track of a timestamp for each update.
This method is perfect for creating a very efficient architecture that will not require constant polling of the shared variables within the application. It is also very efficient for large numbers of variables since it uses an array of variable constants to register for value change events.
Steps to Implement or Execute Code
Additional Information or References
In order to use this example, you must have LabVIEW DSC module. The value change user events can only be created with this module installed. This example was created and used in the "All You Need To Know About Shared Variables" presentation.
**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.