How Do I Programmatically Disable an Entry Point in TestStand?

Updated Mar 21, 2024

Reported In

Software

  • TestStand

Issue Details

I am currently using one of the simple user interfaces provided by TestStand for my project. This interface fulfills all the project requirements, except for one significant exception: it allows multiple concurrent executions via the “Test UUTs” entry point. I am interested in learning how to programmatically disable an Entry Point during runtime to prevent simultaneous executions.

Solution

The sequences of “Test UUTs” and other entry points have a property named “Entry Point Enabled Expression”, as highlighted in the following image:
 
image.png

According to the Model Tab - Sequence Properties Dialog Box section of the TestStand API Reference, this property is a Boolean expression that TestStand evaluates to decide whether to enable the menu item for the entry point. If the expression evaluates to False, TestStand dims the entry point in the menu. If the expression is empty, the entry point appears in the menu. The default value of this property is True.
 
A straightforward method to modify its value and enable or disable the entry point during runtime is to use one of the expressions below in the MainSequence:
 
RunState.Caller.RunState.Sequence.RTS.EPEnabledExpr=True //Enables Entry Point
RunState.Caller.RunState.Sequence.RTS.EPEnabledExpr=False //Disables Entry Point

The following image shows an example of how these expressions can be integrated into the MainSequence:
 
image.png

Additional Information

It’s important to note that if the Entry Point is disabled, the corresponding button will appear grayed out in the TestStand Sequence Editor. However, in other user interfaces like the LabVIEW Simple UI, its appearance won’t change.