To download NI software, including the products shown below, visit ni.com/downloads.
This example demonstrates the scope of LabVIEW functonal global variables when called from TestStand.
When calling LabVIEW code from TestStand which uses global variables, it is important to consider the scope of the variables to ensure that the code behaves as you intend. The term 'global variable' in this document includes any of the following:
The scope of a LabVIEW global variable is the current application instance of LabVIEW. Each process running LabVIEW code, such as the LabVIEW Development system or the TestStand process (which can load VIs in the LabVIEW Runtime Engine) have a separate set of application instances. Within each process, each LabVIEW project has a separate instance, as well as an additional instance for VIs not called within a project.
Because of this, the following settings must match for VI calls where a global is used to share data:
The attached example shows how the same global variable can store multiple distinct values when called in a different execution system or project context.
TestStand 2014 or Compatible
LabVIEW 2014 or Compatible
For more information on LabVIEW application instances, refer to How TestStand Interacts with Application Instances.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.