To download NI software, including the products shown below, visit ni.com/downloads.
This example shows how the full featured UI example can be modified to prevent the user from accidentally executing an execution multiple times, in the case that it takes some time for the execution to start.
In order to manage the enabled state of the Entry Point and Run Sequence buttons, code is added to the startExecution and EndExecution event callbacks, which are executed when a TestStand execution starts or ends, respectively. Each callback provides a reference to the execution which triggered the event, which can be used to track what executions are running
Note: the legacy examples do not store a list of executions; the buttons are always disabled/enabled when the callback is executed.
Disable Entry Point Buttons (LabVIEW) - TS2019
TestStand 2019 or Compatible
LabVIEW 2020 or Compatible
Disable Entry Point Buttons (LabVIEW) - TS2016
TestStand 2016 or Compatible
LabVIEW 2015 or Compatible
LabVIEW Implementation
The callback VIs are registered in the Register Event Callbacks.vi:
C# Implementation
The callback methods are registered in the InitializeComponent using a delegate:
this.axApplicationMgr.StartExecution += new NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_StartExecutionEventHandler(this.axApplicationMgr_StartExecution);
this.axApplicationMgr.EndExecution += new NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_EndExecutionEventHandler(this.axApplicationMgr_StartExecution);
In the event handler methods, the button Enabled property is set to false in the StartExecution callback, and true in the endExecution callback.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Can you please share the same in Labwindows CVI
This does not work in TestStand for the first execution. Any execution after that works. But the first one disables it, and then something reenables it during execution. Sometimes it does it on its own, sometimes if you pause it after a few seconds it will reenable it (only the first time). Same behavior in 2019 or 2023 Q4.