Example Code

Changing the Color of Steps in a TestStand Sequence

Code and Documents

Attachment

Download All

In TestStand, you can programmatically set the color using the instructions below. This can be useful if you want certain steps to stand out from the sequence. In this example, any step with the label "Warning" will be changed to have a red font

     1. Open the a sequence.

     2. Right click a step.

     3. Select Step List Configurations » Edit Step List Configurations...

     4. Select the configuration you would like to edit and select Edit...

StepText3.png

     5. Click the Fonts and Colors tab

     6. Insert an expression in the Step Text Color expression box. A conditional statement works pretty well here and follows this format: Condition?<use this if true>:<use this if false>

StepText2.png

NOTE: There are many more variables under the Step container that can be used. In this example, the Step,Name variable is used. Additionally, the text color can be more easily represented in the hexadecimal form of 0x00bbggrr where the letters represent the intensity of blue, green, and red on the hex scale from 0-F.

7. Click OK in both dialog boxes to return to the sequence editor. The steps will now be colored appropriately

StepTest4.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.