Teststand User Manual Teststand Example Programs 2024-03!21!12!44!25
Teststand User Manual Teststand Example Programs 2024-03!21!12!44!25
User Manual
2024-03-21
TestStand User Manual
Contents
TestStand Example Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Examples for Built-In Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Database Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Flow Control Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
IVI Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Message Popup Step Type - Automatically Dismissing. . . . . . . . . . . . . . . . . . . . . 16
Message Popup Step Type - Get User Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Multiple Numeric Limit Test Step Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Multiple Numeric Limit Test Step Type - LabWindows/CVI. . . . . . . . . . . . . 20
Multiple Numeric Limit Test Step Type - LabVIEW. . . . . . . . . . . . . . . . . . . . . 22
Multiple Numeric Limit Test Step Type - LabVIEW NXG. . . . . . . . . . . . . . . . 24
Multiple Numeric Limit Test Step Type - .NET. . . . . . . . . . . . . . . . . . . . . . . . 27
Property Loader Step Type - Loading Limits from a Database. . . . . . . . . . . . . . . 29
Property Loader Step Type - Loading Limits from a File Containing Alias. . . . . 31
Property Loader Step Type - Loading Limits from a Microsoft Excel File. . . . . . 32
Property Loader Step Type - Loading Limits for Multiple Sequences. . . . . . . . . 34
Property Loader Step Type - Loading Limits from Multiple Sources. . . . . . . . . . 35
Property Loader Step Type - Loading Limits from Two Different Text Files. . . . 37
Statement Step Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Synchronization Step Types - Auto Schedule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Synchronization Step Types - Batch Synchronization. . . . . . . . . . . . . . . . . . . . . . 42
Synchronization Step Types - Lock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Synchronization Step Types - Notification and Wait. . . . . . . . . . . . . . . . . . . . . . . 46
Synchronization Step Types - Queue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Synchronization Step Types - Rendezvous and Semaphore. . . . . . . . . . . . . . . . 50
Examples for Custom Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Agilent VEE Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
ATLAS Step Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Edit ATLAS Call Dialog Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Error Codes and Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Java Step Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Edit Java Call Dialog Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Error Codes and Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2 ni.com
TestStand User Manual
© National Instruments 3
TestStand User Manual
4 ni.com
TestStand User Manual
© National Instruments 5
TestStand User Manual
6 ni.com
TestStand User Manual
© National Instruments 7
TestStand User Manual
8 ni.com
TestStand User Manual
Highlighted Features
Database step types
Major API
None
Prerequisites
(32-bit TestStand) You must have the Microsoft Jet 4.0 Object Linking and
Embedding Database (OLE DB) Provider installed. (64-bit TestStand) You must have
the Microsoft Access Database Engine 2010 Redistributable installed. Visit ni.com/
info and enter the Info Code 64TSaccdb to access the NI support article, Using
Microsoft Access Databases with 64-bit TestStand, for more information about
installing this provider.
© National Instruments 9
TestStand User Manual
f. The SQL Action - Set Values step, which is a Data Operation step, adds
data to the TEST_TABLE table and loops 10 times because the Goto step
that follows the SQL Action - Set Values step targets the Start Loop step,
which is a Label step, and specifies a post action and precondition that
starts and stops the loop.
g. The Start Loop 2 step starts a second loop that uses Data Operation
steps to obtain the values and strings written to the TEST_TABLE table.
h. The Cleanup step group contains Close SQL Statement and Close
Database steps.
2. Select Execute»Single Pass to run the sequence.
3. When execution completes, select Tools»Database Viewer to launch the
TestStand Database Viewer application.
4. Select File»Open, browse to <TestStand
Public>\Examples\Database\Access.mdb, and click OK.
5. Right-click the TEST_TABLE table and select View Data from the context
menu to display the data contained in the TEST_TABLE table.
Related concepts:
■ Databases and Tables
■ TestStand Directory Structure
■
Step Groups
10 ni.com
TestStand User Manual
Highlighted Features
Flow Control step types
Major API
None
Prerequisites
None
© National Instruments 11
TestStand User Manual
For
The For step executes a block of steps multiple times. The For Loop edit tab on the
Step Settings pane specifies that the For step begins with the Locals.index variable
set to 0. The loop continues until the value of the Locals.index variable is greater
than or equal to the value you specify. Each time the For step executes, the
Locals.index variable increments by 1. Therefore, the Beep at done determined by
loop index step in the For block executes the specified number of times and uses the
increasing index.
For Each
The For Each step behaves like the For step but iterates over every element in an
array rather than iterate depending on a specified condition. The
Locals.CurrentMembers variable is an array that specifies three elements, so the
steps in the For Each block execute three times. The current element that the loop is
iterating on is stored in the Locals.CurrentName property. This setting is specified in
the ForEach loop tab of the step settings of the For Each step.
Do While
The Do While step defines a block of steps that always execute at least once. The
DoWhile Loop edit tab on the Step Settings pane specifies an expression that the Do
While step evaluates after all the steps in the Do While block execute. If the
expression evaluates to True, the steps in the Do While block execute again. If the
expression evaluates to False, the sequence continues to the next step.
12 ni.com
TestStand User Manual
While
The While step defines a block of steps that execute when an expression specified
on the While Loop edit tab on the Step Settings pane evaluates to True. If the
expression evaluates to False, the sequence continues to the next step. The While
loop differs from the Do While loop because the While loop evaluates its expression
before each iteration and not after each iteration. Therefore, the steps in the While
block might never execute.
© National Instruments 13
TestStand User Manual
Control steps operate on blocks of steps demarcated with separate End steps, you
do not need to specify specific steps as branch destinations, so you can more easily
edit and rearrange steps because you do not need to update branch destinations.
You can use step properties, separate Flow Control steps, or both, depending on
which functionality best suites the requirements of an application.
Related concepts:
■
TestStand Directory Structure
Highlighted Features
■ IVI step types
■ NI Session Manager
Major API
None
Prerequisites
Complete the following steps to install the required software and IVI-compliant
instrument drivers.
14 ni.com
TestStand User Manual
1. Install the following additional components from the NI Device Driver DVD
that comes with TestStand:
a. NI Measurement & Automation Explorer (MAX)
b. IVI Compliance Package (ICP)
2. Refer to the Instrument Driver Network at ni.com/idnet to download and
install IVI-compliant instrument drivers for each of the IVI classes this example
uses. Search for the manufacturer or type of instrument you want to
download. Some basic IVI-compliant instrument drivers you can use with this
example include the following:
■ Dmm—hp34401a
■ Scope—tkds30xx
■ Fgen—hp33120a
■ Switch—age1442a
■ PowerSupply—hp66xxbc
In MAX, the driver installer automatically creates a driver session entry under
the Driver Sessions item and populates the software module information
under the Instrument Driver Software Module item in the Advanced
folder.
3. Complete the following steps to create a logical name for each instrument
driver.
a. In MAX, expand the IVI Drivers category to the left.
b. Right-click the Logical Names item in the configuration tree and select
Create New from the context menu.
c. Complete the configuration panel for the new logical name. Logical
names are case-sensitive.
© National Instruments 15
TestStand User Manual
Highlighted Features
■ Message Popup Timeout
■ Creating New Executions
16 ni.com
TestStand User Manual
Major API
Execution.Terminate
Prerequisites
None
4. After launching the dialog, the sequence simulates polling for a UUT. In a real
application, this section would typically call a code module which returns
once the condition is met
5. Once the condition is met, the Execution.Terminate method of the TestStand
API terminates the new execution, thereby dismissing the message popup.
Complete the following steps to run the example:
1. Select Execute»Single Pass to run the sequence.
2. Observe that the first message popup dismisses after three seconds.
© National Instruments 17
TestStand User Manual
3. Observe that the second message popup step dismisses once the Check for
UUT condition is met.
Related concepts:
■ TestStand Directory Structure
■
Executions
Highlighted Features
■ Case steps
■ Error handling
■ Message Popup steps
■ Preconditions
■ Select steps
Major API
None
18 ni.com
TestStand User Manual
Prerequisites
None
© National Instruments 19
TestStand User Manual
Purpose
This example demonstrates how to use a Multiple Numeric Limit Test step with a
LabWindows/CVI code module.
Highlighted Features
Multiple Numeric Limit Test steps
20 ni.com
TestStand User Manual
Major API
None
Prerequisites
You must have the LabWindows/CVI Run-Time Engine installed and you must
configure the LabWindows/CVI Adapter to execute steps in-process. If you want to
use the Execute Steps in an External Instance of CVI option, you must have the
LabWindows/CVI development environment installed.
© National Instruments 21
TestStand User Manual
■ The third step, Multiple Numeric Limit Test 3, uses the <None> Adapter and
therefore does not call a code module. The Data Source tab of the Step
Settings pane for this step shows that the step obtains measurement values
from local variables such as Locals.Voltage0, Locals.Voltage1, and so on
instead of from the Step.NumericArray property. The Statement steps in the
Setup step group use expressions to assign these variables.
■ The fourth step, Multiple Numeric Limit Test 4, is similar to the third step,
but demonstrates the new EQ+/- comparison type supported by TestStand
2016 and later. See the table below for more information about this step's
threshold values.
Purpose
This example demonstrates how to use a Multiple Numeric Limit Test step with a
LabVIEW code module.
22 ni.com
TestStand User Manual
Highlighted Features
Multiple Numeric Limit Test steps
Major API
None
Prerequisites
You must have the LabVIEW development system installed and you must configure
the LabVIEW Adapter to use the LabVIEW development system.
© National Instruments 23
TestStand User Manual
24 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use a Multiple Numeric Limit Test step with a
LabVIEW NXG code module.
Highlighted Features
Multiple Numeric Limit Test steps
Major API
None
Prerequisites
You must have the LabVIEW NXG development system installed and you must
configure the LabVIEW NXG Adapter to use the LabVIEW NXG development system.
© National Instruments 25
TestStand User Manual
Each step demonstrates a different way of using the Multiple Numeric Limit Test
step functionality.
■ The first step, Multiple Numeric Limit Test 1, calls a code module that inserts
the measurement values one element at a time into the Step.NumericArray
property. For example, the step inserts the value for the VOLTAGE 0
measurement in Step.NumericArray[0], inserts the value for the VOLTAGE 1
measurement in Step.NumericArray[1], and so on, as shown on the Data
Source tab of the Step Settings pane.
■ The second step, Multiple Numeric Limit Test 2, calls a code module that
writes a single numeric array to the Step.NumericArray property instead of
writing the four array elements individually.
■ The third step, Multiple Numeric Limit Test 3, uses the <None> Adapter and
therefore does not call a code module. The Data Source tab of the Step
Settings pane for this step shows that the step obtains measurement values
from local variables such as Locals.Voltage0, Locals.Voltage1, and so on
instead of from the Step.NumericArray property. The Statement steps in the
Setup step group use expressions to assign these variables.
■ The fourth step, Multiple Numeric Limit Test 4, is similar to the third step,
but demonstrates the EQ+/- comparison type supported by TestStand 2016
and later. See the table below for more information about this step's
threshold values.
26 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use a Multiple Numeric Limit Test step with
a .NET assembly code module.
Highlighted Features
Multiple Numeric Limit Test steps
Major API
None
Prerequisites
None
© National Instruments 27
TestStand User Manual
28 ni.com
TestStand User Manual
changes to the sequence file before executing the sequence or closing the sequence
file.
Related concepts:
■ TestStand Directory Structure
■
Step Groups
Highlighted Features
■ Database step types
■ Database Viewer Application
■ Property Loader steps
Major API
None
Prerequisites
TestStand loads the property values from the Access.mdb file located in the same
directory as the sequence file. (32-bit TestStand) You must have the Microsoft Jet 4.0
Object Linking and Embedding Database (OLE DB) Provider installed. (64-bit
TestStand) You must have the Microsoft Access Database Engine 2010
Redistributable installed. Visit ni.com/info and enter the Info Code 64TSaccdb to
© National Instruments 29
TestStand User Manual
access the NI support article, Using Microsoft Access Databases with 64-bit
TestStand, for more information about installing this provider.
30 ni.com
TestStand User Manual
e. Change the value of the LIMITS_LOW field for the video record from 71
to 60. Click the Submit button to submit the values to the database.
f. Close the Database Viewer application.
4. Select Execute»Single Pass to run the sequence again.
5. When execution completes, review the report on the Report pane. The report
indicates that the Video step passed because the test result is now within the
acceptable limits.
Related concepts:
■ TestStand Directory Structure
■ Step Groups
Highlighted Features
■ Property Loader steps
■ ReportOptions callback
Major API
None
© National Instruments 31
TestStand User Manual
Prerequisites
None
32 ni.com
TestStand User Manual
Highlighted Features
■ Property Loader steps
■ ReportOptions callback
Major API
None
Prerequisites
You must have Microsoft Excel installed.
© National Instruments 33
TestStand User Manual
2. When execution completes, review the report on the Report pane. The report
indicates that TestStand updated the limits of the steps based on the values in
the Excel file.
3. In the Limits.xls file, change the Flow Rate value from 1 to 1.1 and save the file.
4. Select Execute»Single Pass to run the sequence again.
5. When execution completes, review the report on the Report pane. The report
indicates that the results have changed because of the updated step limits.
Related concepts:
■ Programming with the TestStand API in LabWindows/CVI
■
TestStand Directory Structure
■ Step Groups
Highlighted Features
Property Loader steps
Major API
None
34 ni.com
TestStand User Manual
Prerequisites
None
© National Instruments 35
TestStand User Manual
Purpose
This example demonstrates using the Property Loader step type to load data from
multiple property loader sources. The example loads properties from GenericLimits
to load limits for Voltage and Temperature and loads properties from
SpeacializedLimits to override the limits for Voltage.
Highlighted Features
■ Property Loader steps
■ ReportOptions callback
Major API
None
Prerequisites
None
36 ni.com
TestStand User Manual
the voltage test. In this case, the file specified last in the source table will take
precedence.
Complete the following steps to run this example.
1. Select Execute»Single Pass to run the sequence.
2. When execution completes, review the report on the Report pane. Ensure that
the limits were changed based on the property loader step configuration.
Related concepts:
■ TestStand Directory Structure
© National Instruments 37
TestStand User Manual
Highlighted Features
■ Property Loader steps
■ ReportOptions callback
Major API
None
Prerequisites
None
38 ni.com
TestStand User Manual
Highlighted Features
Expressions
Major API
None
Prerequisites
None
© National Instruments 39
TestStand User Manual
40 ni.com
TestStand User Manual
Purpose
This example demonstrates the Auto Schedule and Use Auto Scheduled Resource
step types. These step types are used to dynamically determine the order in which a
UUT uses its required resources to minimize delays that occur while the UUT waits
for a resource to become available.
Highlighted Features
■ Auto Schedule step type
■ Use Auto Scheduled Resource step type
■ Batch process model
Major API
None
Prerequisites
None
© National Instruments 41
TestStand User Manual
at least one resource name is defined in the Resource Lock Alternatives list.
The UUT does not execute the test steps in this Use Auto Scheduled Resource
sub-block until it has exclusive access to the resources in this list.
3. Select each of the Use Auto Scheduled Resource steps to compare the settings
for the Resource Lock Alternatives. You can specify multiple resource lock
alternatives to indicate that the sub-block can execute if any of the
alternatives are available. To lock access to all of these resources before
executing the sub-block, use an array of lock names to specify that a section
must lock multiple resources. In this case, no locks are reserved unless all
resources are available.
Complete the following steps to run the example.
1. Select Execute»Single Pass to run the sequence.
2. A prompt appears that describes the Resource Usage Profiler, which is a tool
to monitor the status of synchronization objects in a test sequence. You can
use this tool to observe the execution order of test steps in a test sequence
with Auto Schedule steps. You can choose to launch the tool to view
additional details during the test.
3. As the test sequence executes, dialog boxes indicate the current status of the
tests. Notice that each UUT is only able to execute a Use Auto Scheduled
Resource sub-block if it is able to gain exclusive access to the required
resources.
4. Once execution completes, you can examine the test report for each UUT to
notice the order of execution. The Auto Schedule steps do not guarantee a
specific execution order for each test step. The order can vary among test
sockets and among executions. You can run the test sequence additional
times to compare the execution order among different test runs.
Related concepts:
■ TestStand Directory Structure
■ Batch Process Model
42 ni.com
TestStand User Manual
Purpose
This example demonstrates the Batch Synchronization step types and step settings
available when you use the Batch process model. Use Batch synchronization to
coordinate test operations among all test sockets in a batch and and to execute test
steps selectively, concurrently, or sequentially.
Highlighted Features
■ Batch Synchronization step type
■ Batch Synchronization step settings
■ Batch process model
Major API
None
Prerequisites
None
© National Instruments 43
TestStand User Manual
the One thread only option on the Synchronization pane of the step
settings, indicating that only a single test socket execute these steps during
execution. The two Voltage Response steps enable the Parallel option on the
Synchronization pane of the step settings, indicating that all test sockets
execute these steps concurrently.
3. On the Sequences pane, select the Temperature Tests sequence. This
sequence uses the Batch Synchronization step type to define a block of steps
that execute serially, meaning that only one socket executes each test at a
time but that all sockets execute both test steps. Execution does not continue
beyond the Batch Synchronization block until all sockets have completed the
block.
4. On the Sequences pane, select the Stress Tests sequence. This sequence
uses the Batch Synchronization step type to define blocks of steps that
execute in parallel. For each block, all test sockets concurrently execute the
test steps. Execution does not continue beyond the block until all sockets
have completed all test steps within the block.
5. On the Sequences pane, select the Current Tests sequence. The steps in this
sequence do not have any Batch Synchronization settings applied, meaning
that each test socket executes these steps as soon as the execution reaches
this sequence. It is not necessary to specify Batch Synchronization settings for
every step in a sequence file using the Batch process model.
Complete the following steps to run the example.
1. Select Execute»Single Pass to run the sequence.
2. As the test sequence executes, dialog boxes indicate the current status of the
tests. Notice that the tests execute concurrently, serially, or only on a single
socket according to the Batch Synchronization settings for each step.
Related concepts:
■ Batch Process Model
■ TestStand Directory Structure
44 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use the Lock synchronization step to restrict
execution flow in a sequence file that uses the Batch process model. When a lock is
active, only one thread at a time can access the steps the lock contains.
Highlighted Features
■ Batch process model
■ Lock step type
Major API
None
Prerequisites
None
© National Instruments 45
TestStand User Manual
■ The sequence uses Lock steps to ensure that only one test socket is
executing the single-threaded steps at a given time, which is useful in cases
where the step requires a shared resource, such as an instrument, that only
one step at a time can use.
■ In section one, the sequence first creates and then performs the lock
operation in the Create and Lock "Lock 1" step. Once one test socket calls
the Lock "Lock 1" step, all other test sockets wait at the step until the
original socket releases the lock in the Unlock "Lock 1" step.
■ In section three, for the Single-threaded Test 5 step, notice that the
Synchronization panel of the Properties tab of the Step Settings pane
contains a Use Lock to Allow Only One Thread at a Time to Execute
the Step option, which is enabled. This option applies a lock for the step
without the need for lock steps.
■ In section four, the Create Lock step stores the lock reference in a local
variable. The lock operation uses this variable to identify the lock, and
stores a reference to the lock operation in a second variable.
Complete the following steps to run this example.
1. Select the Execute menu and confirm that a checkmark appears next to the
Tracing Enabled option.
2. Select Execute»Single Pass to run the sequence. TestStand creates three
test sockets, and each test socket executes the MainSequence. The multi-
threaded steps execute simultaneously across all test sockets. Observe that
the locked code runs only on a single socket at any given time.
Related concepts:
■ Batch Process Model
■ TestStand Directory Structure
46 ni.com
TestStand User Manual
from another step before continuing the execution. A Notification step can send
messages between multiple test sockets and can optionally contain data.
Highlighted Features
■ Notification step type
■ Wait step type
Major API
None
Prerequisites
None
© National Instruments 47
TestStand User Manual
48 ni.com
TestStand User Manual
Highlighted Features
■ Batch process model
■ Queue step type
Major API
None
Prerequisites
None
© National Instruments 49
TestStand User Manual
b. Select the Enqueue One Element sequence, then select the Enqueue
Data step. On the Queue Settings edit tab, notice that the Enqueue
operation is selected. This step adds a new element, the value of the
Locals.EnqueueData variable, to the queue.
c. Select the Dequeue Data step. On the Queue Settings edit tab, notice
that the Dequeue operation is selected. This step removes an element
from the queue. If the queue is empty, the step waits until data is
available to dequeue, as shown in section two.
d. In section three, select the Get Status step. This step uses the Get
Status operation places the current contents of the queue into the
Locals.QueueStatus variable without modifying the state of the queue.
e. Select the Flush Queue step. On the Queue Settings edit tab, notice
that the Flush operation is selected. This step removes all data from the
queue. TestStand places the data in the location specified in the
Location to Store Array of Queue Elements control. In this case,
TestStand places the data in the Locals.FlushedQueue variable.
Complete the following steps to run this example.
1. Select Execute»Single Pass to run the sequence.
2. Read the text in each section popup message for information about the
behavior of that section.
Related concepts:
■ Batch Process Model
■ TestStand Directory Structure
■ Synchronization Step Types - Notification and Wait
50 ni.com
TestStand User Manual
■ A Rendezvous step will make a set number of threads wait until all threads
specified are at the same point and ready to proceed. Unlike batch
synchronization, rendezvous steps can be used to synchronize any TestStand
threads or executions, without requiring the batch process model.
■ A Semaphore step is similar to the Lock step in functionality, except that you
can specify any number of threads instead of just one.
Highlighted Features
■ Batch process model
■ Rendezvous step type
■ Semaphore step type
Major API
None
Prerequisites
None
© National Instruments 51
TestStand User Manual
52 ni.com
TestStand User Manual
Highlighted Features
Custom step types
Major API
N/A
Prerequisites
VEE Evaluation, Development, or Run-Time Environment version 6.0 or later.
Note (64-bit TestStand) 64-bit TestStand does not support Agilent VEE
step types.
© National Instruments 53
TestStand User Manual
54 ni.com
TestStand User Manual
You can select each input and output argument from the Argument control of the
Input section and the Output section, respectively, and set a corresponding
TestStand property path. The step uses the value of the property as input for input
arguments or receives the output value for output arguments.
The VEE step types also support debugging. You can step into a VEE user function
and use the VEE debug functionality to debug the user function.
This example includes VB_VEE_Action, VB_VEE_NumericLimitTest,
VB_VEE_PassFailTest, and VB_VEE_StringValueTest step types. The
VB_VEE_NumericLimitTest, VB_VEE_PassFailTest, and VB_VEE_StringValueTest step
types combine the functionality of the VB_VEE_Action step with the built-in Numeric
Limit Test, Pass Fail Test, and String Value Test step types, respectively, to call VEE
functions in addition to the functionality of the built-in steps. For example, the
VB_VEE_NumericLimitTest step returns a number from a VEE user function and
compares the number to numeric limits.
Related concepts:
■
TestStand Directory Structure
■
Custom Step Types
© National Instruments 55
TestStand User Manual
Highlighted Features
Custom step types
Major API
N/A
Prerequisites
TYX PAWS RTS 1.22 or later
56 ni.com
TestStand User Manual
© National Instruments 57
TestStand User Manual
58 ni.com
TestStand User Manual
box, in which you can specify the TPS the step executes and the parameters passed
between TestStand and the TPS.
You can then execute the sequence that contains the steps. The ATLAS custom step
type fails on an ATLAS step if any faults are reported when the TPS executes. The
ATLAS custom step type also propagates and reports any errors the TPS server
encounters to TestStand. If the TPS server encounters no errors or faults, the step
passes.
When TestStand first executes an ATLAS step, the ATLAS custom step type loads an
instance of the RTS, or attaches to an existing RTS if one already exists. TestStand
stores a reference to this instance as a temporary global variable in the TestStand
Engine. Future executions of the ATLAS custom step type use the same reference for
TPS executions. The engine releases the reference when it shuts down.
Limitations
The following are known limitations of the ATLAS custom step type:
■ The step type does not support passing TestStand arrays, containers, or
object references as parameters.
■ You can execute only one ATLAS step at a time for each local or remote
computer. The ATLAS steps are locked globally with respect to the name of the
local or remote computer. A sequence might contain multiple ATLAS steps
that pertain to the same local or remote computer, but the step executions are
sequential. You can execute ATLAS steps that pertain to different computers
simultaneously.
■ The TestStand Deployment Utility does not automatically copy and register
ActiveX servers. You must add ATLAS_StepType.dll to the list of deployment
files to deploy the ATLAS custom step type. When you deploy the step type,
you must register the NI ATLAS Step Type ActiveX server. Refer to the
© National Instruments 59
TestStand User Manual
60 ni.com
TestStand User Manual
Note
© National Instruments 61
TestStand User Manual
■ If you can specify the file path to the TPS using relative or absolute
paths, TestStand launches a File Not Found dialog box that contains
options for specifying the file location.
■ You must properly configure the DCOM settings for the PAWS Run-Time
Server (RTS) on both the host and remote computers for remote
execution to work. Refer to PAWS documentation for more information
about configuring the PAWS RTS for remote execution.
■ You must specify the name of the parameter value exactly as the TPS
and TPS server expect. The TPS server allows verification of parameter
names prior to execution. The ATLAS custom step type generates an
error if the parameter cannot be read or written.
■ TestStand updates properties referred in the Value Expression control
with the parameter values the TPS server passes after TestStand calls the
TPS server when executing an ATLAS step.
Related concepts:
■
ATLAS Step Type
■
Sequence Context
Error Codes and Descriptions
The following table lists possible error codes you might receive while using the
ATLAS step type example and the corresponding descriptions.
62 ni.com
TestStand User Manual
Related concepts:
■ ATLAS Step Type
■ Edit ATLAS Call Dialog Box
© National Instruments 63
TestStand User Manual
Highlighted Features
Custom step types
Major API
Engine.UnloadAllModules
Prerequisites
Java Runtime Environment (JRE) version 6 update 16, which you can download
from the Oracle website. The Java step types are likely compatible with earlier and
later versions of the JRE but have not been tested in JRE versions other than version
6 update 16.
Note You must install the JRE before you can build the accompanying
project.
The Java step types support the creation and cleanup of the Java virtual machine
(JVM) and the manipulation of objects that exist within the JVM through method
calls. The step types support the use of all Java primitive types and strings, which
you can use to pass data between TestStand and Java objects. The step types rely
on JavaCall.dll, which is a LabWindows/CVI library, for TestStand to interface with
Java. The library communicates with TestStand using an ActiveX interface and
communicates with Java through the JNI.
64 ni.com
TestStand User Manual
Java uses the JNI to call compiled code written in C/C++ and to access Java code
from C/C++. Refer to the Java Native Interface website for more information about
JNI technology.
When you open <TestStand Public>\Examples\Custom Step Types\Java Step
Types\Java Computer Motherboard Test.seq in the TestStand Sequence Editor, the
Java step types appear in the following groups on the Insertion Palette:
■ StartStop—Contains steps that start and destroy the JVM.
■ Methods—Contains steps that call a particular Java method in a specified
class.
■ Static Methods—Contains steps that call a particular static class method
in a specified class.
The CallStaticJavaMethod and CallJavaMethod steps consist of Numeric Limit Test,
String Value Test, Pass Fail Test, and Action steps.
Use a Java step type to call JavaCall.dll, which extracts information about the step
type from TestStand using ActiveX calls and then calls the appropriate method in
the JVM using the JNI. For example, use the CallJavaMethod step to call the
InvokeJavaMethod function JavaCall.dll, which calls the TestStand Engine to extract
the class, method, and parameter information and instantiate the class within the
existing JVM. The step identifies and calls the method with parameter values
retrieved from TestStand. The JavaCall.dll file then passes the return value back to
TestStand.
StartStop Steps
Use the StartJVM and DestroyJVM steps, located under the StartStop group on the
Insertion Palette, in pairs around other Java steps to call methods for the contained
steps. A typical sequence structure begins with a StartJVM step, which you place in
the Setup step group, followed by a number of Methods or Static Methods steps,
which you place in the Main step group. Place the DestroyJVM step in the Cleanup
step group.
Configure the StartJVM step to provide the class path, which is the path of the Java
classes to access. Select the StartJVM step in a sequence and click the Edit Java
Class Path Location button on the Step Settings pane to launch the Set Class Path
© National Instruments 65
TestStand User Manual
dialog box, in which you can specify the class path. You must include all Java classes
that are accessed in the path. If you leave the path empty, the JVM cannot locate the
user-written Java classes. Click Browse in the Set Class Path dialog box to launch
the Select Paths dialog box, in which you can add directories that contain the Java
classes to call.
66 ni.com
TestStand User Manual
Neither step type automatically calls the constructor of the class. The example
does contain a sample .
■ Because Java is case-sensitive, the class name and method names must use
the same case as the Java class file specifies.
Compatible Types
The following table shows how data types in TestStand are compatible with certain
data types in Java. The Java step types automatically handle the conversion
between types.
© National Instruments 67
TestStand User Manual
Limitations
The following are the known limitations of the Java step types:
■ The step types currently do not support Java reference types, such as arrays
and objects.
■ You cannot access the same instantiated object multiple times. Each time a
step calls a method on an object, a new object is created. Therefore, all states
must be maintained in class variables as static members.
■ The step types cannot directly call constructors. The example does contain a
sample .
■ The step types are not thread-safe. Do not use the step types with the
Parallel and Batch process models.
Known Issues
Because you cannot unload the JVM once you load it in a process without exiting the
process, the DestroyJVM step does not actually destroy the JVM. Instead, the
DestroyJVM step only detaches the current thread, which indicates that the JVM is
no longer referenced, so that the JVM can unload in future versions, if required.
Refer to the DestroyJavaVM API documentation on the Oracle website for more
information about this issue.
You cannot unload the JVM once you load it in a process, and you cannot unload
JavaCall.dll when you call the Engine.UnloadAllModules method of the TestStand
API. You can unload JavaCall.dll only by exiting the process by closing the sequence
editor or user interface. Once you load a Java class file, you must restart the process
by restarting the sequence editor or user interface to force the JVM to load any
changed or recompiled versions of the Java class.
You cannot change the class search path once TestStand loads the JVM. When
TestStand calls the StartJVM step with a given class path, you cannot change the
class search path by calling the StartJVM step again with a new class path. You can
change the class path only by exiting the process by closing the sequence editor or
user interface. You must set the required class paths in the first StartJVM step.
68 ni.com
TestStand User Manual
Note Always use a relative path for the Java class to load. If you
specify an absolute path, the Java virtual machine (JVM) cannot
locate the class name and you receive a -1000 Class Not Found error.
■ Java Method—The name of the method to call. Specify the name after you
select the Java class that contains the method.
■ Parameters—Contains the following options for creating and configuring
parameters to pass to the specified method:
© National Instruments 69
TestStand User Manual
70 ni.com
TestStand User Manual
Related concepts:
■ Java Step Types
■
Search Directories
Error Codes and Descriptions
The following table lists possible error codes you might receive while using the Java
step types example and the corresponding descriptions.
© National Instruments 71
TestStand User Manual
72 ni.com
TestStand User Manual
Related concepts:
■ Java Step Types
■
Edit Java Call Dialog Box
© National Instruments 73
TestStand User Manual
Purpose
You must complete the following tasks to add additional data to a report:
■ Configure the desired property to be logged as a result. Results are stored in
the Locals.ResultList array.
■ Configure the result to be added to the report. This is typically
accomplished by enabling the \IncludeInReport\ flag.
This example demonstrates the following approaches for adding custom data to a
report:
■ Using the UUT.AddtionalData container to add data to the report header
■ Using the API method Execution.AddExtraResult
■ Creating a custom property and setting the IncludeInReport flag
■ Creating a custom step type with custom properties in the Step.Result
container
■ Using the Additional Results step type or property setting
Highlighted Features
■ TestStand API
■ PreUUT Callback
■ Custom step types
Major API
■ Execution.AddExtraResult
■ PropertyObject.SetValString
■ PropertyObject.SetFlags
74 ni.com
TestStand User Manual
Prerequisites
None
© National Instruments 75
TestStand User Manual
Related concepts:
■ Storing Additional Information for UUTs and Test Stations in Process Models
■
TestStand Directory Structure
■ Custom Step Types
Highlighted Features
Generating a test report
Major API
None
Prerequisites
None
76 ni.com
TestStand User Manual
Note Before you run this example, click the Toggle Analyze File
Before Executing button on the Sequence Analyzer toolbar to specify
that you do not want the TestStand Sequence Analyzer to analyze the
sequence file before TestStand executes the sequence. If you leave
sequence analysis enabled and you run the sequence, TestStand returns
an error because the sequence file generates some variables dynamically
at run time. If you do encounter this error, you can select the Continue
Execution option to continue sequence execution.
© National Instruments 77
TestStand User Manual
Highlighted Features
Custom step types
Major API
None
Prerequisites
None
78 ni.com
TestStand User Manual
© National Instruments 79
TestStand User Manual
Highlighted Features
Path data type
Major API
None
Prerequisites
None
80 ni.com
TestStand User Manual
Related concepts:
■ TestStand Directory Structure
■
Path
Highlighted Features
■ NI_TDMSReference data type
■ Path data type
Major API
None
Prerequisites
None
© National Instruments 81
TestStand User Manual
3. When the execution completes, review the report, which contains links to the
TDMS file and the image. Text reports do not include hyperlinks.
4. Click the links to open the corresponding files. TestStand uses the default
application you specify for the file format to open the file when you click the
link in the report.
Related concepts:
■
NI_TDMSReference
■
Path
■ TestStand Directory Structure
Highlighted Features
Process model plug-in architecture
Major API
None
82 ni.com
TestStand User Manual
Prerequisites
You must have Microsoft Office Excel 2007 SP2 or later installed on the computer to a
basic step time report in Excel format and to run the executable to a .csv file to Excel
format. If Excel is not installed on the computer, this custom reporting plug-in
generates only a .csv file.
© National Instruments 83
TestStand User Manual
specify the directory in which to store the report and specify whether to
launch the report in Excel.
7. Click OK in the Basic Step Time Report Configuration dialog box and in the
Result Processing dialog box to return to the Sequence File window.
8. Execute the sequence file and view the reports.
Aggregating Basic Step Time Reports in Excel Format for Multiple UUTs
Complete the following steps to aggregate basic step time reports in Excel for
multiple UUTs. The value in the ID column of the Raw Data worksheet must be
unique across all the reports you want to aggregate.
1. Open the reports you want to combine in Excel.
2. In the main report file into which you want to aggregate all the data,
unprotect the Raw Data worksheet.
84 ni.com
TestStand User Manual
3. Complete the following steps for each report file you want to aggregate into
the main report file.
a. From the Raw Data worksheet, copy the rows that correspond to the
steps you want to include in the main report file.
b. Paste the data you copied into the Steps section of the Raw Data
worksheet of the main report file.
4. In the Raw Data worksheet of the main report file, click the Regenerate
Processed Data and Graphs button update and overwrite the existing data
and graphs in the Step, Sequence, and Sequence File worksheets.
HTML
TestStand displays the HTML report in the Report pane, and the HTML report links to
the .csv and Excel reports.
The HTML report includes the following information for each UUT in the report
header:
© National Instruments 85
TestStand User Manual
■ Station ID
■ Operator
■ UUT Part Number (if non-empty)
■ UUT Serial Number
■ Batch Serial Number (if using the Batch model)
■ TestSocket Index (if using the Batch or Parallel model)
■ Date
■ Time
■ Execution Time
■ UUT Result
■ TSR Filename (if using the TestStand Offline Results Processing Utility)
■ TSR ID (if using the TestStand Offline Results Processing Utility)
■ TSR File Closed (if using the TestStand Offline Results Processing Utility)
.csv
The .csv report includes the following information for each UUT in the report
header:
■ Station ID
■ Operator
■ UUT Part Number (if non-empty)
■ UUT Serial Number
■ Batch Serial Number (if using the Batch model)
■ TestSocket Index (if using the Batch or Parallel model)
■ Date
■
Time
■ Execution Time
■ UUT Result
■ CSV File Format Version
■ TSR Filename (if using the TestStand Offline Results Processing Utility)
86 ni.com
TestStand User Manual
© National Instruments 87
TestStand User Manual
Note The Sequence File, Sequence, and Parent ID columns are empty for
the MainSequence Callback step from process model files.
Excel
The Excel report includes the following information for each UUT in an Excel
workbook with the following worksheets:
■ Step—Contains the following processed data for the steps used to test the
UUT and graphs to show the average total time of the steps and the
cumulative total time of the steps. You can modify the data and graphs in this
worksheet.
■ Step Name
■ Step ID
■ Cumulative Total Time (of the step)
■ Cumulative Module Time (of the step)
■ Number of Execution
■ Average Total Time
■ Average Module Time
■ Max Total Time
■ Max Module Time
■ Min Total Time
■ Min Module Time
88 ni.com
TestStand User Manual
■ Sequence Name
■ Cumulative Total Time (of each Sequence Call step that calls the
sequence, including subsequence time)
■ Cumulative Total Time (of each Sequence Call step that calls the
sequence, excluding subsequence time)
■ Number of Times Sequence Call Steps Call into the Sequence
■ Average Total Time (excluding subsequence time)
■ Max Total Time (excluding subsequence time)
■ Min Total Time (excluding subsequence time)
■ Sequence File—Contains the following processed data for the sequence files
used to test the UUT and graphs to show the cumulative total time of the
sequence files and the percentage of total time for the sequence files. You can
modify the data and graphs in this worksheet.
■ Sequence Filename
■ Cumulative Total Time (of Sequence Call steps calling any sequence in the
sequence file)
■ Raw Data—Contains all the data from the .csv file in protected mode. Click
the Regenerate Processed Data and Graphs button to update and
overwrite the existing data and graphs in the Step, Sequence, and Sequence
File worksheets.
Related concepts:
■ TestStand Directory Structure
■ Process Model Plug-In Architecture
© National Instruments 89
TestStand User Manual
Purpose
This example demonstrates how to implement a result processing process model
plug-in using LabVIEW, LabWindows/CVI, and Microsoft Visual C#.
Highlighted Features
Process model plug-in architecture
Major API
N/A
Prerequisites
None
LabVIEW
Complete the following steps to build and use the LabVIEW version of this example.
1. Open the <TestStand Public>\Examples\Customizing Result Processing\Model
Plugin - Simple Text Report\LabVIEW\SimpleTextPlugin.lvproj file in LabVIEW.
2. Build the Build Simple Text Plugin build specification.
90 ni.com
TestStand User Manual
LabWindows/CVI
Complete the following steps to build and use the LabWindows/CVI version of this
example.
1. Open the <TestStand Public>Examples\Customizing Result Processing\Model
Plugin - Simple Text Report\CVI\SimpleTextReport.cws file in LabWindows/
CVI.
2. Select Build»Create Debuggable Dynamic Link Library.
3. Copy the <TestStand Public>\Examples\Customizing Result Processing\Model
Plugin - Simple Text Report\CVI\NI_SimpleTextReport_CVI.seq file to the
<TestStand Public>\Components\Models\ModelPlugins directory.
4. Confirm that the <TestStand
Public>\Components\Models\ModelPlugins\NI_SimpleTextReport_CVI\NI_SimpleTextRep
file exists and has been overwritten by the version you just built.
5. Add and enable an instance of the LabWindows/CVI simple text report process
model plug-in in the Result Processing dialog box.
Microsoft Visual C#
Complete the following steps to build and use the Microsoft Visual C# version of this
example.
1. Open and build the <TestStand Public>\Examples\Customizing Result
Processing\Model Plugin - Simple Text Report\DotNet\SimpleTextReport.sln
file.
© National Instruments 91
TestStand User Manual
92 ni.com
TestStand User Manual
Purpose
This example simulates the testing of a computer motherboard using test steps that
use the HTBasic Adapter. The example calls subsequences in the CPU Diagnostic
Sequence.seq and CPU Test Sequence.seq sequence files.
Highlighted Features
■ Preconditions
■ Sequence Call steps
■ Test step types
Major API
None
Prerequisites
The example contains sequence files designed to work with HTBasic 8.0.
When you use the demo version of HTBasic, you must configure the HTBasic
Adapter to use the HTBasic demo server. Select the Use HTBasic Runtime Server
option in the HTBasic Adapter Configuration dialog box and specify the path and
filename for HTBwin.exe.
Note (64-bit TestStand) 64-bit TestStand does not support the HTBasic
Adapter.
© National Instruments 93
TestStand User Manual
94 ni.com
TestStand User Manual
Purpose
This example simulates the testing of a computer motherboard using test steps that
use the LabWindows/CVI Adapter.
Highlighted Features
■ Flow Control step types
■ Preconditions
■ Sequence Call steps
■ Test step types
Major API
None
Prerequisites
You must have the LabWindows/CVI Run-Time Engine installed and you must
configure the LabWindows/CVI Adapter to execute steps in-process. If you want to
use the Execute Steps in an External Instance of CVI option, you must have the
LabWindows/CVI development environment installed.
Note In order to debug the example code module, you must first rebuild
the source files in the debug configuration within LabWindows/CVI.
© National Instruments 95
TestStand User Manual
1. On the Steps pane of the MainSequence, review the steps in the Setup step
group.
■ The Simulation Dialog step calls a DLL that launches a dialog box to
prompt you to select a test or tests you want to simulate to fail.
■ The Turn Vacuum Table On step, which is an Action step, simulates the
activation of a vacuum table. In the Cleanup step group, the Turn Vacuum
Table Off step deactivates the vacuum table.
2. On the Steps pane, review the steps in the Main step group.
■ The Powerup Test step, which is a Pass/Fail Test step, simulates a power-
up test, and the results of the step determine whether the following If/Else
structure continues testing or executes the Powerup Diagnostics step.
■ The CPU Test step, which is a Sequence Call step, calls the CPU Test
subsequence to simulate CPU tests.
■ The ROM Test, RAM Test, Video Test, and Keyboard Test steps simulate
tests, and if any test fails, the following If structure executes.
■ Each step in the If structure specifies a precondition expression that
executes the step only when the corresponding test step fails.
3. Select Execute»Single Pass to run the sequence.
4. In the Test Simulator dialog box, select the Power On test to fail.
5. When execution completes, review the report on the Report pane. The report
indicates that the test steps after the Powerup Test step did not execute, but
the Powerup Diagnostics step did execute.
6. Select Execute»Restart to run the sequence again.
7. In the Test Simulator dialog box, select any test other than the Power On test
to fail.
8. When execution completes, review the report. The report indicates that the
Powerup Test step passes and TestStand ran the remaining tests, and that
TestStand ran diagnostic steps for any failed test steps but skipped diagnostic
steps for any passed test steps.
Related concepts:
■ Programming with the TestStand API in LabWindows/CVI
96 ni.com
TestStand User Manual
Purpose
This example simulates the testing of a computer motherboard using test steps that
use the LabVIEW Adapter.
Highlighted Features
■ Flow Control step types
■ Preconditions
■ Sequence Call steps
■ Test step types
Major API
None
Prerequisites
None
© National Instruments 97
TestStand User Manual
the project and rebuild the source distribution in the build specifications
section.
98 ni.com
TestStand User Manual
8. When execution completes, review the report. The report indicates that the
Powerup Test step passes and TestStand ran the remaining tests, and that
TestStand ran diagnostic steps for any failed test steps but skipped diagnostic
steps for any passed test steps.
Related concepts:
■
Programming with the TestStand API in LabVIEW
■ TestStand Directory Structure
■
Step Groups
Computer Motherboard Test Sequence - LabVIEW NXG
Purpose
This example simulates the testing of a computer motherboard using test steps that
use the LabVIEW NXG Adapter.
Highlighted Features
■ Flow Control step types
■ Preconditions
■ Sequence Call steps
■ Test step types
Major API
None
Prerequisites
None
© National Instruments 99
TestStand User Manual
100 ni.com
TestStand User Manual
TestStand ran diagnostic steps for any failed test steps but skipped diagnostic
steps for any passed test steps.
Related concepts:
■ TestStand Directory Structure
■
Step Groups
Computer Motherboard Test Sequence - .NET
Purpose
This example simulates the testing of a computer motherboard using test steps that
use the .NET Adapter.
Highlighted Features
■ Flow Control step types
■ Preconditions
■ Sequence Call steps
■ Test step types
Major API
None
Prerequisites
None
1. On the Steps pane of the MainSequence, review the steps in the Setup step
group.
■ The Simulation Dialog step calls a .NET assembly that launches a dialog
box to prompt you to select a test or tests you want to simulate to fail.
■ The Turn Vacuum Table On step, which is an Action step, simulates the
activation of a vacuum table. In the Cleanup step group, the Turn Vacuum
Table Off step deactivates the vacuum table.
2. On the Steps pane, review the steps in the Main step group.
■ The Powerup Test step, which is a Pass/Fail Test step, simulates a power-
up test, and the results of the step determine whether the following If/Else
structure continues testing or executes the Powerup Diagnostics step.
■ The CPU Test step, which is a Sequence Call step, calls the CPU Test
subsequence to simulate CPU tests.
■ The ROM Test, RAM Test, Video Test, and Keyboard Test steps simulate
tests, and if any test fails, the following If structure executes.
■ Each step in the If structure specifies a precondition expression that
executes the step only when the corresponding test step fails.
3. Select Execute»Single Pass to run the sequence.
4. In the Test Simulator dialog box, select the Power On test to fail.
5. When execution completes, review the report on the Report pane. The report
indicates that the test steps after the Powerup Test step did not execute, but
the Powerup Diagnostics step did execute.
6. Select Execute»Restart to run the sequence again.
7. In the Test Simulator dialog box, select any test other than the Power On test
to fail.
8. When execution completes, review the report. The report indicates that the
Powerup Test step passes and TestStand ran the remaining tests, and that
TestStand ran diagnostic steps for any failed test steps but skipped diagnostic
steps for any passed test steps.
Related concepts:
■ TestStand Directory Structure
102 ni.com
TestStand User Manual
■ Step Groups
Computer Motherboard Test Sequence - Python
Purpose
This example simulates the testing of a computer motherboard using test steps that
use the Python Adapter.
Highlighted Features
■ Flow Control step types
■ Preconditions
■ Post Actions
■ Sequence Call steps
■ Test step types
Major API
None
Prerequisites
You must have the required version of CPython interpreter installed and added to
your PATH variable. You must update the Python version to use in the Python
Adapter Configuration dialog box before using the example.
1. On the Steps pane of the MainSequence sequence, review the steps in the
Setup step group.
■ The Simulation Dialog step calls a CVI DLL that launches a dialog box to
prompt you to select a test or tests you want to simulate to fail.
■ The Initialize Computer Test step, which is an Action step, creates an
instance of a Python class that stores the settings the user specifies in the
simulation dialog. TestStand uses the instance of the class to call class
functions which do the testing.
■ The Turn Vacuum Table On step, which is an Action step, simulates the
activation of a vacuum table. In the Cleanup step group, the Turn Vacuum
Table Off step deactivates the vacuum table.
2. On the Steps pane, review the steps in the Main step group.
■ The Powerup Test step, which is a Pass/Fail Test step, simulates a power-
up test, and the results of the step determine whether the following If/Else
structure continues testing or executes the Powerup Diagnostics step.
■ The CPU Test step, which is a Sequence Call step, calls the CPU Test
subsequence to simulate CPU tests.
■ The ROM Test, RAM Test, Video Test, and Keyboard Test steps simulate
tests, and if any test fails, the following If structure executes.
■ Each step in the If structure specifies a precondition expression that
executes the step only when the corresponding test step fails.
3. Select Execute»Single Pass to run the sequence.
4. In the Test Simulator dialog box, select the Power On test to fail.
5. When execution completes, review the report on the Report pane. The report
indicates that the test steps after the Powerup Test step did not execute, but
the Powerup Diagnostics step did execute.
6. Select Execute»Restart to run the sequence again.
7. In the Test Simulator dialog box, select any test other than the Power On test
to fail.
8. When execution completes, review the report. The report indicates that the
Powerup Test step passes and TestStand ran the remaining tests, and that
104 ni.com
TestStand User Manual
TestStand ran diagnostic steps for any failed test steps but skipped diagnostic
steps for any passed test steps.
Related concepts:
■ TestStand Directory Structure
■
Step Groups
Highlighted Features
■ Test step types
■ Flow Control step types
■ Report generation
Major API
None
Prerequisites
None
the project and rebuild the source distribution in the build specifications
section.
106 ni.com
TestStand User Manual
Highlighted Features
■ Batch process model
Major API
None
Prerequisites
None
108 ni.com
TestStand User Manual
Note The first time you execute this example, the auto-scheduled tests
might take longer to execute than the parallel tests due to components
specific to the example. In this case, running the example a second time
provides a more accurate representation of the performance differences.
Related concepts:
■
Parallel Process Model
■ Batch Process Model
■ TestStand Directory Structure
Highlighted Features
■ LabVIEW Adapter - Class Member Call
■ Dynamic Dispatch
Major API
None
Prerequisites
The LabVIEW 2012 Run-Time engine or LabVIEW 2012 or higher development system
is required to execute this example. Dynamic dispatch support in TestStand requires
LabVIEW 2012 or higher.
Note The Initialize, Read, and Close steps are configured using the
Class member call call type in order to call members of the Generic
DMM class. Based on the class selected previously, TestStand
dynamically selects the implementation of the class VI which
matches the class reference. This action allows the sequence to
behave differently based on the type of LabVIEW class reference
selected.
110 ni.com
TestStand User Manual
Highlighted Features
■ $(Platform) path macro
■ Separate Compiled Code from Source File LabVIEW option
■ Any CPU Visual Studio Build Configuration setting
Major API
Engine.Is64Bit property
Prerequisites
None
Note This example uses a LabVIEW NXG code module, which is only
supported in 64-bit TestStand. To ensure the sequence file with LabVIEW
NXG code modules can be used in 32-bit TestStand, load the LabVIEW NXG
code module dynamically and execute the step only if Engine.Is64Bit
returns true.
112 ni.com
TestStand User Manual
Related concepts:
■ TestStand Directory Structure
■
Using the $(Platform) Path Macro to Locate the Correct Code Module in
32-bit TestStand and 64-bit TestStand
■
Executing VIs with Separate Compiled Code
■
AnyCPU Assemblies in 32-bit TestStand and 64-bit TestStand
Purpose
This example demonstrates how to use LabVIEW to create a dialog box that is modal
to the TestStand main application window.
Highlighted Features
■ LabVIEW Adapter
■ Modal dialog boxes
Major API
None
Prerequisites
To run this example, you must have the LabVIEW development system installed.
Note The Modal Dialog palette VIs do not require the LabVIEW
development system. This requirement applies only to this example.
Purpose
This example demonstrates how to use LabVIEW NXG to create a dialog box that is
modal to the TestStand main application window.
114 ni.com
TestStand User Manual
Highlighted Features
■ LabVIEW NXG Adapter
■ Modal dialog boxes
Major API
None
Prerequisites
To run this example, you must have the LabVIEW NXG development system installed.
Note The Modal Dialog palette VIs do not require the LabVIEW NXG
development system. This requirement applies only to this example.
Review the code and execute the sequence file. When the dialog appears, try to
interact with the TestStand user interface. Observe that the TestStand user interface
is not responsive, and the dialog remains in front of the window. Click OK to dismiss
the dialog and observe that the TestStand user interface is again responsive.
Related concepts:
■
TestStand Directory Structure
■ Making Dialog Boxes Modal to TestStand
Launching a Modal Dialog - MFC
Purpose
This example demonstrates how to use C++ and the TestStand API to create a dialog
box that is modal to the TestStand main application window.
Highlighted Features
■ Modal dialog boxes
■ TestStand API
Major API
■ Engine.NotifyStartOfModalDialogEx
■ Engine.NotifyEndOfModalDialog
Prerequisites
C++ compiler
116 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use .NET and the TestStand API to create a
dialog box that is modal to the TestStand main application window.
Highlighted Features
■ Modal dialog boxes
■ TestStand API
Major API
■ Engine.NotifyStartOfModalDialogEx
■ Engine.NotifyEndOfModalDialog
Prerequisites
None
Highlighted Features
Sequence Call step
Major API
N/A
118 ni.com
TestStand User Manual
Prerequisites
None
Note When an MFC DLL launches a dialog box that contains an ActiveX
control and the DLL does not create a worker thread initialized as
apartment-threaded, you can call the DLL function from a TestStand
execution thread initialized as apartment-threaded. Use a Sequence Call
step to create a new thread and enable the Use Thread Apartment
setting in the Sequence Call Advanced Settings dialog box.
Related concepts:
■
TestStand Directory Structure
Highlighted Features
Callbacks
Major API
Step.CancelStepCallback
Prerequisites
None
120 ni.com
TestStand User Manual
Highlighted Features
Callbacks
Major API
Step.CancelStepCallback
Prerequisites
None
122 ni.com
TestStand User Manual
every time step is Error Suppressed because you clicked the Ignore Error
button when the step caused a run-time error.
Related concepts:
■
TestStand Directory Structure
■ Callback Sequences
■
Step Groups
Highlighted Features
■ Data types
■ LabVIEW Adapter
■ Local variables
Major API
None
Prerequisites
You do not need to have the LabVIEW development system installed to use this
example, but you must have the LabVIEW development system installed if you want
to review the source VIs.
124 ni.com
TestStand User Manual
Complete the following steps to use the Types window to review the data type
definition for a container.
1. In the Sequence File window, right-click the ContainerIn container on the
Variables pane and select View»Type Definition from the context menu to
launch the Types window.
2. Right-click the ClusterType data type and select Properties from the context
menu to launch the Type Properties dialog box. Because the sequence is using
a VI, you must enable cluster passing for the data type.
3. Click the Cluster Passing tab. Notice that the Allow Objects of This Type to be
Passed as LabVIEW Clusters option is enabled. The Cluster Item Label option
for each item matches the control labels in the VI.
4. Click OK to close the Type Properties dialog box.
Related concepts:
■ TestStand Directory Structure
■ Standard and Custom Data Types
■
Programming with the TestStand API in LabVIEW
■ Sequence Local Variables
Purpose
This example demonstrates how to pass a TestStand container as a C-style struct to
a function in a DLL. This example uses functions to pass the struct by both reference
and value. For a DLL function to change the value of a TestStand container, you must
pass the reference of the container to the function.
126 ni.com
TestStand User Manual
Note When you configure the container as a custom data type, be aware
of the byte-packing the DLL function uses.
Highlighted Features
■ Calling DLLs from TestStand
■ C/C++ DLL Adapter
■ Local variables
■ Data types
Major API
None
Prerequisites
C compiler or DLL
sPacked8In container, which specified default values before you executed the
sequence.
3. Click OK in the Get Results dialog box. TestStand launches another Get
Results dialog box that lists values loaded from the sPacked8In container. The
GetStructByRef2 step specifies a pre-expression that specifies a value of 0 for
each variable, and then the GetStructByRef2 step specifies new values for
each variable.
4. Click OK when TestStand informs you that the sequence passed.
5. Click Stop in the UUT Information dialog box to end the execution.
You can review the two Message Popup steps in the sequence to verify that the
sPacked8In container is displaying the variable values. The functions the DLL is
using are available in StructTest.cpp, located in the <TestStand
Public>\Examples\Fundamentals\Passing Structs to Code Modules\C directory.
To pass a TestStand container as a struct to a DLL, you must define the container as
a custom data type, and you must specify that objects of the data type can be
passed as structs.
Complete the following steps to use the Types window to review the data type
definition for a container.
1. In the Sequence File window, right-click the sPacked8In container on the
Variables pane and select View»Type Definition from the context menu to
launch the Types window.
2. Right-click the AllDataTypesPacked8 data type and select Properties from
the context menu to launch the Type Properties dialog box. Because the
sequence is using a DLL, you must enable C struct passing for the data type.
3. Click the C Struct Passing tab. Notice that the Allow Objects of This Type to be
Passed as Structs option is enabled. The Packing ring control specifies the 8
Byte Boundary option, which is the packing scheme the DLL uses.
4. Click OK to close the Type Properties dialog box.
5. In the Types window, expand the AllDataTypesPacked8 data type. You can
right-click each property and select Properties from the context menu to
launch the Type Properties dialog box for each property of the data type. You
can review each property to see how it is configured.
128 ni.com
TestStand User Manual
Related concepts:
■ TestStand Directory Structure
■
Calling DLLs from TestStand
■ Organizing Test Program Files with LabVIEW-Built Shared Libraries
■
Sequence Local Variables
■
Standard and Custom Data Types
Passing Structs to Code Modules - LabWindows/CVI
Purpose
This example demonstrates how to pass a TestStand container as a C-style struct to
a function in a LabWindows/CVI DLL. The container consists of several different data
types. For a DLL function to change the value of a TestStand container, you must
pass the reference of the container to the function.
Note When you configure the container as a custom data type, be aware
of the byte-packing the DLL function uses. The default packing scheme in
LabWindows/CVI can be either 1- or 8-byte, depending on the
compatibility mode.
Highlighted Features
■ LabWindows/CVI Adapter
■ Local variables
■ Data types
Major API
None
Prerequisites
You must have the LabWindows/CVI Run-Time Engine installed and you must
configure the LabWindows/CVI Adapter to execute steps in-process. If you want to
use the Execute Steps in an External Instance of CVI option, you must have the
LabWindows/CVI development environment installed.
130 ni.com
TestStand User Manual
Purpose
This example demonstrates how to pass a TestStand container as a LabVIEW cluster
to a LabVIEW VI. The container consists of several different data types. The VIs are
compiled into a DLL and called as functions.
Note VIs always use a 1-byte packing scheme when passing clusters as
parameters.
Highlighted Features
■ LabVIEW Adapter
■ Local variables
■ Data types
Major API
None
Prerequisites
You do not need to have the LabVIEW development system installed to use this
example, but you must have the LabVIEW development system installed if you want
to review the source VIs.
132 ni.com
TestStand User Manual
the values again to the StructIn container. The LabVIEW DLL handles both
operations. Before you run the sequence, the StructOut container contains values,
the StructIn container contains default values, the individual local variables
contains default values.
Complete the following steps to use this example.
1. Select Execute»Test UUTs to run the sequence.
2. Enter any serial number in the UUT Information dialog box and click OK.
TestStand launches a Results for Unbundle dialog box that lists values loaded
from the individual local variables, which specified default values before you
executed the sequence.
3. Click OK in the Results for Unbundle dialog box. TestStand launches another
Results for Unbundle dialog box that lists values loaded from the StructIn
container, which specified default values before you executed the sequence.
4. Click OK when TestStand informs you that the sequence passed.
5. Click Stop in the UUT Information dialog box to end the execution.
You can review the two Message Popup steps in the sequence to verify that the
appropriate sources are providing values. You can open LV DLL 1.vi and LV DLL 2.vi,
located in the <TestStand Public>\Examples\Fundamentals\Passing Structs to Code
Modules\LabVIEW DLL directory, to see how the data is being copied. The LV DLL 1.vi
uses an unbundle function to separate the values from the cluster, and the LV DLL
2.vi uses a bundle function to combine individual values into a single cluster. The
sequence is using LVStructTest.dll, into which LV DLL 1.vi and LV DLL 2.vi were built.
To pass a TestStand container as a struct to a DLL, you must define the container as
a custom data type, and you must specify that objects of the data type can be
passed as structs.
Complete the following steps to use the Types window to review the data type
definition for a container.
1. In the Sequence File window, right-click the StructIn container on the
Variables pane and select View»Type Definition from the context menu to
launch the Types window.
2. Right-click the DType1 data type and select Properties from the context
menu to launch the Type Properties dialog box. Because the sequence is using
a DLL, you must enable C struct passing for the data type.
3. Click the C Struct Passing tab. Notice that the Allow Objects of This Type to be
Passed as Structs option is enabled. The Packing ring control specifies the 8
Byte Boundary option, which is the packing scheme the DLL uses.
4. Click OK to close the Type Properties dialog box.
5. In the Types window, expand the DType1 data type. You can right-click each
property and select Properties from the context menu to launch the Type
Properties dialog box for each property of the data type. You can review each
property to see how it is configured.
Related concepts:
■
TestStand Directory Structure
■ Programming with the TestStand API in LabVIEW
■
Sequence Local Variables
■ Standard and Custom Data Types
Passing Structs to Code Modules - .NET
Purpose
This example demonstrates how to pass a TestStand container as a .NET struct to a
method in an assembly. This example uses functions to pass the struct by both
reference and value. For a method in an assembly to change the value of a
TestStand container, you must pass the reference of the container to the method.
Highlighted Features
■ .NET Adapter
134 ni.com
TestStand User Manual
■ Local variables
■ Data types
Major API
None
Prerequisites
None
Purpose
A TestStand execution cannot break until all threads within the execution have been
suspended. If one or more threads in the execution is running a code module, the
execution will not break until all code modules complete.
This example demonstrates two methods you can use to override this behavior:
■ The Thread.ExternallySuspended property, which if set to True, allows an
execution to be suspended even if the current thread is still executing a code
module. You can use this option to configure the execution pausing behavior
on a per code module basis.
■ The Allow Break While in Code Modules station option, which allows any
execution to be suspended even if one or more threads is still executing a
code module. This setting is located in the Execution tab of the Station
Options dialog. You can set this option at run-time, as shown in this example.
The example also demonstrates how you can poll the TestStand execution status
within a code module and respond when the execution pauses.
136 ni.com
TestStand User Manual
Highlighted Features
Debugging TestStand Executions
Major API
Thread.ExternallySuspended
Prerequisites
None
Purpose
A TestStand execution cannot break until all threads within the execution have been
suspended. If one or more threads in the execution is running a code module, the
execution will not break until all code modules complete.
This example demonstrates two methods you can use to override this behavior:
■ The Thread.ExternallySuspended property, which if set to True, allows an
execution to be suspended even if the current thread is still executing a code
module. You can use this option to configure the execution pausing behavior
on a per code module basis.
■ The Allow Break While in Code Modules station option, which allows any
execution to be suspended even if one or more threads is still executing a
code module. This setting is located in the Execution tab of the Station
Options dialog. You can set this option at run-time, as shown in this example.
The example also demonstrates how you can poll the TestStand execution status
within a code module and respond when the execution pauses.
Highlighted Features
Debugging TestStand Executions
Major API
Thread.ExternallySuspended
138 ni.com
TestStand User Manual
Prerequisites
You must have the LabVIEW development system installed and configure the
LabVIEW Adapter to use the LabVIEW development system.
Purpose
A TestStand execution cannot break until all threads within the execution have been
suspended. If one or more threads in the execution is running a code module, the
execution will not break until all code modules complete.
This example demonstrates two methods you can use to override this behavior:
Highlighted Features
Debugging TestStand Executions
Major API
Thread.ExternallySuspended
Prerequisites
None
140 ni.com
TestStand User Manual
Highlighted Features
■ Python Interpreter Session Management
Major API
None
Prerequisites
You must have required version of CPython interpreter installed and added to your
PATH variable. You must update the Python version to use in the Python adapter
configuration dialog before using the example.
142 ni.com
TestStand User Manual
Highlighted Features
■ Mapping of Python and TestStand types
Major API
None
Prerequisites
Complete the following steps to install the required software and configure
TestStand.
1. Install a supported version of the CPython interpreter and add it to your PATH
variable.
2. Install the following libraries for the version of Python you installed:
■ Python for Win32 (pywin32) extensions
■ NumPy module (required for the NumPy Array example)
3. In the Python Adapter Configuration dialog box, update the Python version
TestStand uses to execute Python code modules.
Note To run the example for Enums, you must use Python 3.6 or
higher.
Note The example simulates the testing of a UUT. The Model type, serial
number, ports and voltage values in the example are hypothetical. The
methods in the classes UUTInterface and UUTDatabase in the Python
module are template methods and do not interface with any hardware or
database.
Review the sequences and steps in this example. Select a subsequence in the
Sequences pane to view steps in the subsequence.
144 ni.com
TestStand User Manual
146 ni.com
TestStand User Manual
148 ni.com
TestStand User Manual
Working with Dispatch Dispatch Demonstrates passing The Main step group
TestStand objects and contains the following
COM objects Action steps:
implementing ■ The Pass
IDispatch between
Sequence
TestStand and the
Context as
Python module.
Parameter step
passes the
SequenceContext
object as a
parameter to the
Python code
module.
■ The Pass
Engine as
Parameter step
passes the
Engine property
as a parameter to
the Python code
module.
■ The Pass COM
Object as
Parameter step
passes the COM
object, whose
reference is held
in an object
reference
variable.
Working with Enum Enum Demonstrates passing The Main step group
enumerations between contains the following
TestStand and the Action steps:
Python module. ■ The Pass Enum
Color step passes
the TestStand
enum as a
Python enum
parameter with a
type of Enum to
the Python code
module.
■ The Pass Flag
Measurement
step passes the
TestStand enum
as a Python
enum parameter
with a type of
150 ni.com
TestStand User Manual
Related concepts:
■ TestStand Directory Structure
Highlighted Features
Sequence file translators
Major API
N/A
152 ni.com
TestStand User Manual
Prerequisites
Before you attempt to open a file in a custom format, you must install the example
translator DLL and support files to the appropriate directories in one of the
following ways:
■ Automatic Installation (recommended)—Open the
SetupExampleTranslators.seq example sequence file and run the
MainSequence to select the examples to set up.
■ Manual Installation—Complete the following steps to manually move the
translator DLL and support files:
1. Open the TextTranslator or XMLTranslator directory for one of the
examples in the <TestStand Public>\Examples\Fundamentals\Sequence
File Translators - Examples directory, and copy the translator DLL from
the selected directory to the <TestStand
Public>\Components\Translators directory.
2. Copy the NI_ExampleTranslatorTypes.ini type file from the <TestStand
Public>\Examples\Fundamentals\Sequence File Translators - Examples
directory to the <TestStand Public>\Components\TypePalettes
directory.
3. Copy the FrontPanel.uir and StepType.dll files from the <TestStand
Public>\Examples\Fundamentals\Sequence File Translators -
Examples\Common directory to the <TestStand
Public>\Components\StepTypes\Translators directory.
You must restart the TestStand Sequence Editor so that TestStand can load the
example translator DLL.
Note If you modify and rebuild an example translator DLL, you must copy
the DLL to the <TestStand Public>\Components\Translators directory and
restart TestStand to load the new DLL.
Related concepts:
■
Sequence File Translators
■ TestStand Directory Structure
Highlighted Features
■ Sequence Call step type
■ Call Stack pane
■ Threads pane
Major API
None
Prerequisites
None
154 ni.com
TestStand User Manual
Termination Monitor
Purpose
This example demonstrates the use of the Termination Monitor function in
LabWindows/CVI. The Termination Monitor allows a code module to stop executing
if TestStand attempts to terminate or abort the execution.
Highlighted Features
■ LabWindows/CVI Adapter
■ Termination Monitor
Major API
None
Prerequisites
None
156 ni.com
TestStand User Manual
did not call the Termination Monitor method, TestStand would be unable to
terminate or abort the execution.
To review the functions used in this example, open Termination Monitor Example.c
located at <TestStand Public>\Examples\Fundamentals\Termination
Monitor\CVI\Termination Monitor Example.c.
The TS_CancelDialogIfExecutionStops method is used to search for a request from
TestStand to stop the execution. This method automatically initiates a timer
callback, which will call the QuitUserInterface method if TestStand is attempting to
terminate or abort the execution.
Note that the TS_CancelDialogIfExecutionStops method requires the panel handle
of the onscreen dialog and the SequenceContext of the calling sequence as
parameters. This method also assumes that the calling code has control of the
dialog through a call to the RunUserInterface method.
Complete the following steps to run the example:
1. In TestStand, select Execute»Single Pass to run the sequence.
2. When the TerminationMonitorExample dialog appears, the sequence will
execute indefinitely.
3. On the Debug toolbar in TestStand, click the red Terminate button to
terminate the execution. Observe that the execution terminates successfully.
Related concepts:
■ TestStand Directory Structure
■
Programming with the TestStand API in LabWindows/CVI
■ Checking for Suspended or Stopped Execution within Code Modules
Termination Monitor - LabVIEW
Purpose
This example demonstrates the use of the Termination Monitor VIs in LabVIEW. The
Termination Monitor allows a code module to stop executing if TestStand attempts
to terminate or abort the execution.
Highlighted Features
■ LabVIEW Adapter
■ Termination Monitor
Major API
None
Prerequisites
To run this example, you must have the LabVIEW development system installed and
you must configure the LabVIEW Adapter to use the LabVIEW development system.
Note The Termination Monitor palette VIs to not require the LabVIEW
development system. This requirement applies only to this example.
158 ni.com
TestStand User Manual
Every 100 milliseconds, the TestStand - Get Termination Monitor Status VI is called
to determine whether TestStand is attempting to stop the execution. If so, the VI
exits.
Note that the Termination Monitor VIs require the SequenceContext of the calling
sequence. The SequenceContext is passed to the code module as a parameter.
Complete the following steps to run the example:
1. Select Execute»Single Pass to run the sequence.
2. When the TerminationMonitorExample VI front panel appears, the sequence
will execute indefinitely.
3. On the Debug toolbar in TestStand, click the red Terminate button to
terminate the execution. Observe that the execution terminates successfully.
Related concepts:
■ TestStand Directory Structure
■ Programming with the TestStand API in LabVIEW
■
Checking for Suspended or Stopped Execution within Code Modules
Termination Monitor - LabVIEW NXG
Purpose
This example demonstrates the use of the Termination Monitor in LabVIEW NXG. The
Termination Monitor allows a code module to stop executing if TestStand attempts
to terminate or abort the execution.
Highlighted Features
■ LabVIEW NXG Adapter
■ Termination Monitor
Major API
None
Prerequisites
To run this example, you must have the LabVIEW NXG development system installed.
Note The Termination Monitor palette VIs do not require the LabVIEW
NXG development system. This requirement applies only to this example.
160 ni.com
TestStand User Manual
Purpose
This example demonstrates the use of the Termination Monitor function in .NET. The
Termination Monitor allows a code module to stop executing if TestStand attempts
to terminate or abort the execution.
Highlighted Features
■ .NET Adapter
■ Termination Monitor
Major API
None
Prerequisites
None
162 ni.com
TestStand User Manual
Purpose
This example uses data streams to read from a comma separated value (csv) file and
to create a csv file.
Highlighted Features
■ TestStand Data Streams
Major API
■ TestStand Data Streams API
Prerequisites
You must have the LabVIEW Development System installed to execute this example.
Purpose
This example uses data streams to read from a comma separated value (csv) file and
to create a csv file.
Highlighted Features
■ TestStand Data Streams
Major API
■ TestStand Data Streams API
164 ni.com
TestStand User Manual
Highlighted Features
■ Sweep Loops
■ Data Streams
Major API
■ TestStand Data Streams API
Prerequisites
LabVIEW development system 16.0 or later
Highlighted Features
■ Sweep Loops
■ Data Streams
Major API
■ TestStand Data Streams API
Prerequisites
None
Highlighted Features
■ Sweep Loops
Major API
■ SetBreakSettings
Prerequisites
None
166 ni.com
TestStand User Manual
Purpose
This example shows how to use TestStand enumerations with CVI code modules.
Enumerations are defined as custom types and can be stored in the Sequence File or
Type Palettes.
Highlighted Features
■ Using Enumerations in TestStand
■ Range Checking:Strict and Loose Enumerations
■ Flags Enumerations and Bitwise OR Semantics
■ Using Enumerations with the TestStand Adapters
Major API
■ Val Function
■ Str Function
Prerequisites
None
168 ni.com
TestStand User Manual
4. Open the Types Window (Ctrl + t) and select Enums.seq to view the three
different enumeration definitions used in this example: Colors, Colors_Strict,
and Colors_Flag. Choose Edit Enumerations to view details of each type.
Related concepts:
■ TestStand Directory Structure
■
Using Enumerations in TestStand
■ Range Checking: Strict and Loose Enumerations
■ Flags Enumerations and Bitwise OR Semantics
■
Using Enumerations with the TestStand Adapters
Using TestStand Enumerations - LabVIEW
Purpose
This example shows how to use TestStand enumerations with LabVIEW code
modules. Enumerations are defined as custom types and can be stored in the
Sequence File or Type Palettes.
Highlighted Features
■ Using Enumerations in TestStand
■ Range Checking:Strict and Loose Enumerations
■ Flags Enumerations and Bitwise OR Semantics
■ Using Enumerations with the TestStand Adapters
Major API
■ PropertyObject.GetPropertyObject
■ SequenceFile.AsPropertyObjectFile
■ SequenceFile.AsPropertyObject
Prerequisites
None
170 ni.com
TestStand User Manual
Purpose
This example shows how to use TestStand enumerations with .NET code modules.
Enumerations are defined as custom types and can be stored in the Sequence File or
Type Palettes.
Highlighted Features
■ Using Enumerations in TestStand
■ Range Checking:Strict and Loose Enumerations
■ Flags Enumerations and Bitwise OR Semantics
■ Using Enumerations with the TestStand Adapters
Major API
■ Val Function
■ Str Function
Prerequisites
None
Complete the following steps to review the enumerations and steps in this example:
1. Open the Enum sequence from the Sequences pane. Select the Enum
Behavior step and review the step settings and parameter values for the step.
This code module allows the user to select a combination of RGB colors,
which are then stored in the Locals.Color Local variable.
2. Select the Display Enum Value step and review the Message Expression.
This expression uses the Str() and Val() functions to display the string and
formatted numeric representations of an enum value.
3. Repeat steps 1 and 2 for the Strict Enum and Flag Enum sequences.
4. Open the Types Window (Ctrl + t) and select Enums.seq to view the three
different enumeration definitions used in this example: Colors, Colors_Strict,
and Colors_Flag. Choose Edit Enumerations to view details of each type.
Related concepts:
■ TestStand Directory Structure
■
Using Enumerations in TestStand
■
Range Checking: Strict and Loose Enumerations
■ Flags Enumerations and Bitwise OR Semantics
■ Using Enumerations with the TestStand Adapters
172 ni.com
TestStand User Manual
Highlighted Features
TestStand step types
Major API
N/A
Prerequisites
You must install the HP34401a IVI instrument driver from the Instrument Driver
Network at ni.com/devzone/idnet before running this example.
Installation Issues
Step types might depend on files such as code modules, icon files, or string resource
files. For TestStand to locate these files, the files must reside in specific directories.
■ Code Module Files (.dll, .vi, and so on)—Place step type code module
files in a subdirectory you create in the <TestStand
Public>\Components\StepTypes directory. TestStand finds code modules you
place in this directory because the TestStand default search paths include all
directories under the <TestStand Public>\Components directory. Although
this example does not install its code module, HP34401aStepType.dll, to the
<TestStand Public>\Components directory, TestStand can find the step type
code module because the step type specifies a relative path from the
<TestStand Public>\Examples\Interfacing with Hardware\Instrument Control
Step Types - HP34401a directory.
■ Icon Files—Place icon files for step types in the <TestStand
Public>\Components\Icons directory. TestStand loads icons from this
directory and the <TestStand>\Components\Icons directory. TestStand installs
the icon for this example to <TestStand
Public>\Components\Icons\NI_Examples\Example_HP34401a.ico.
■ String Resource Files—Place string resource files you create in the
<TestStand
Public>\Components\Language\<language>\TestStandExamples.ini file.
The HP34401a_StepTypeExample.seq example sequence file contains the example
step type definition. You can store step type definitions you create in any sequence
file, and you can add a step type to a new or existing TestStand type palette file. You
can install a type palette file on another computer by placing the file in the
<TestStand Public>\Components\TypePalettes directory. You must prefix the
filenames of the type palettes you install with Install_. At startup, TestStand
searches the TypePalettes directory for type palette files with the Install_ prefix.
When TestStand finds a palette file to install and the base filename is not the same
174 ni.com
TestStand User Manual
as any existing palette file, TestStand removes the Install_ prefix and adds the
palette to the palette list. When TestStand finds a palette file to install and the base
filename is the same as an existing palette file, TestStand merges the types from the
Install_ prefixed file with the existing palette file and deletes the Install_ file.
176 ni.com
TestStand User Manual
"DEFAULT_NAME")If the step type does not need to account for the selected
language, you can enter a default step name in quotes, such as "HP34401a
Step".
■ Step Description Expression—The step description expression
determines the description that Description column on the Steps pane and
the Description control on the General panel of the Properties tab of the
Step Settings pane show for the step. The description expression can refer to
and show the values of step properties. You can use the ResStr expression
function in the description expression to specify a description that changes
depending on the selected language. The example step type uses a lengthy
expression to vary the description depending on the step configuration and
the selected language. If the step type description does not need to account
for the step configuration or the selected language, you can enter a fixed
description in quotes, such as "HP33401a DMM Instrument Control".
■ Menu Item Name—Use the Item Name Expression control on the
Menu tab of the Step Type Properties dialog box to specify the item name
expression for the step type. The expression determines the name of the
menu item in the Insert Step submenu that inserts an instance of the step
type into a sequence. You can use the ResStr expression function in the item
name expression to specify an item name that changes depending on the
selected language. The example step type specifies the following item name
expression: ResStr("HP34401_STEP_TYPE_EXAMPLE", "MENU_NAME")If the
menu item does not need to account for the selected language, you can
enter an item name in quotes, such as "HP34401a".
■ Other Items—Depending on the step type, you can also use the following
features. The example step type does not configure any other step type
settings.
■ Configure the default values of built-in properties, such as the run
options or loop options.
■ Use the Disable Properties tab of the Step Type Properties dialog box to
prevent users of the step type from editing the values of built-in properties
you select.
■ Specify code templates to assist the user in creating code modules that
you designed the step type to call.
178 ni.com
TestStand User Manual
InstrumentStudio
The <TestStand Public>\Examples\Interfacing with Hardware\InstrumentStudio
directory contains the following examples.
Related concepts:
■ TestStand Directory Structure
Measure Efficiency
Purpose
This example demonstrates how to use IO Configuration step types to communicate
with the instrument for measuring efficiency.
Highlighted Features
■ IO Configuration Step Types
■ Sweep Loop Step Type
Major API
None
Prerequisites
Complete the following steps before executing this example on 64-bit TestStand.
1. Install the following NI software:
■ LabVIEW (64-bit)
■ NI-DCPower
■ Measurement & Automation Explorer (MAX)
■ InstrumentStudio 2021 or later
■ MI Device Support for TestStand
Note
■ MAX and InstrumentStudio are included by default when you
install NI-DCPower.
■ MI Device Support for TestStand is included by default with NI-
DCPower only when TestStand is already installed. You can install
it separately with NI Package Manager once TestStand is installed.
180 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use IO Configuration step types to communicate
with the instrument for measuring quiescent current.
Highlighted Features
■ IO Configuration Step Types
■ Sweep Loop Step Type
Major API
None
Prerequisites
Complete the following steps before executing this example on 64-bit TestStand.
1. Install the following NI software:
■ LabVIEW (64-bit)
■ NI-DCPower
■ Measurement & Automation Explorer (MAX)
■ InstrumentStudio 2021 or later
■ MI Device Support for TestStand
Note
182 ni.com
TestStand User Manual
■ The Measure Current And Voltage step measures the current and voltage.
3. On the Steps pane, review the steps in the Cleanup step group.
■ The Close Sessions step closes the sessions which have been opened in
the current sequence.
4. Select Execute»Single Pass to run the sequence.
5. The voltage, current, efficiency values are logged to <TestStand
Public>\Examples\Interfacing with Hardware\InstrumentStudio\Quiescent
Current\output.csv.
Related concepts:
■ TestStand Directory Structure
■ Step Groups
Highlighted Features
■ Custom Step Types
184 ni.com
TestStand User Manual
Major API
None
Prerequisites
You must have Python 3.6 installed and added to your PATH variable.
■ The New NI-DMM Session step and the New NI-DCPower Session step
open two separate Python interpreter sessions for the respective devices.
5. On the Steps pane of the NI-DMM subsequence, review the steps in the Main
step group.
■ The Auto Schedule step, which is an Auto Schedule Synchronization step,
performs auto scheduling (avoids multiple access) of the steps within the
Use Auto Scheduled Resource block.
■ The Use Auto Scheduled Resource block, which is a Use Auto Scheduled
Resource Synchronization step, defines the set of steps that needs to be
considered for auto scheduling.
■ The Configure NI-DMM Session step, simulates the initialization of the NI-
DMM device session by setting the Range, Rate, number of Points to
measure and the measurement type properties in the NI-DMM device
session object.
■ The Get DMM Measurements step simulates the collecting of
measurement values from the NI-DMM device using the NI-DMM device
session object.
■ The Average DMM Measurements, which is a Numeric Limit Test step,
calculates the average of the measured values and validates it with a
defined test range.
■ The Results step, which is an Additional Results step, displays the
measurement values obtained from the NI-DMM session object.
6. On the Steps pane if the NI-SMU [DcPower] subsequence, review the steps in
the Main step group.
■ The Auto Schedule step, which is an Auto Schedule Synchronization step,
performs auto scheduling (avoids multiple access) of the steps within the
Use Auto Scheduled Resource block.
■ The Use Auto Scheduled Resource block, which is a Use Auto Scheduled
Resource Synchronization step, defines the set of steps that needs to be
considered for auto scheduling.
■ The Configure NI-DCPower Session step, simulates the initialization of the
NI-DCPower device session by setting the current and voltage Limits and
186 ni.com
TestStand User Manual
Session Manager
The <TestStand Public>\Examples\Interfacing with Hardware\Session Manager
directory contains the following examples.
Related concepts:
■ TestStand Directory Structure
■
Session Manager Support for 64-bit TestStand
Session Manager - LabWindows/CVI
Purpose
This example demonstrates how to use NI Session Manager to share named
instrument handles between LabWindows/CVI code modules. Refer to the NI
Session Manager Help. located in <Program Files>\National
Instruments\Shared\Session Manager, for more information about how to use
Session Manager.
Highlighted Features
■ IVI
■ NI Session Manager
Major API
None
Prerequisites
You must complete the following steps before you can run this example.
1. Ensure that you have the LabWindows/CVI Run-Time Engine installed and you
configure the LabWindows/CVI Adapter to execute steps in-process. If you
want to use the Execute Steps in an External Instance of CVI option, you
must have the LabWindows/CVI development environment installed.
188 ni.com
TestStand User Manual
2. Install the following software from the NI Device Driver DVD that comes with
TestStand:
■ Measurement & Automation Explorer (MAX)
■ IVI Compliance Package
3. Complete the following steps to download and install an IVI-compliant
instrument driver for the IVI DMM class that the example can use, such as
hp34401a.
a. Refer to the Instrument Driver Network at ni.com/idnet.
b. Search for the manufacturer or the type of instrument you want to
download. In MAX, the driver installer automatically creates a driver
session entry under the Driver Sessions item and populates the
software module information under the Instrument Driver Software
Module item in the Advanced folder.
4. Complete the following steps to create a logical name for the session.
a. In MAX, expand the IVI Drivers category.
b. Right-click the Logical Names item in the configuration tree and select
Create New from the context menu.
c. Complete the configuration panel for the new logical name,
"SampleDMM". Logical names are case-sensitive. In the Driver Session
control, specify the driver session you downloaded.
ensures that the session exists for the life of the sequence, each module uses the
same session and the instrument initializes and closes only once.
Related concepts:
■
TestStand Directory Structure
■
Session Manager Support for 64-bit TestStand
Session Manager - LabVIEW
Purpose
This example demonstrates how to use NI Session Manager to share named
instrument handles between LabVIEW code modules. Refer to the NI Session
Manager Help. located in <Program Files>\National Instruments\Shared\Session
Manager, for more information about how to use Session Manager.
Highlighted Features
■ IVI
■ NI Session Manager
Major API
None
190 ni.com
TestStand User Manual
Prerequisites
You must complete the following steps before you can run this example.
1. Ensure that you have the LabVIEW development system installed and you
configure the LabVIEW Adapter to use the LabVIEW development system.
2. Install the following software from the NI Device Driver DVD that comes with
TestStand:
■ Measurement & Automation Explorer (MAX)
■ IVI Compliance Package, including the LabVIEW Support portion of the IVI
Class Drivers
3. Complete the following steps to download and install an IVI-compliant
instrument driver for the IVI DMM class that the example can use, such as
hp34401a.
a. Refer to the Instrument Driver Network at ni.com/idnet.
b. Search for the manufacturer or the type of instrument you want to
download. In MAX, the driver installer automatically creates a driver
session entry under the Driver Sessions item and populates the
software module information under the Instrument Driver Software
Module item in the Advanced folder.
4. Complete the following steps to create a logical name for the session.
a. In MAX, expand the IVI Drivers category.
b. Right-click the Logical Names item in the configuration tree and select
Create New from the context menu.
c. Complete the configuration panel for the new logical name, which is
"SampleDMM". Logical names are case-sensitive. In the Driver Session
control, specify the driver session you downloaded.
session, Session Manager initializes the instrument session and the step stores the
reference in the DMM_Reference local variable so the session must continue to exist
until the sequence completes.
The remaining steps in the sequence call code modules. Each code module calls
Session Manager and obtains the instrument handle for the session the
Locals.logicalName local variable specifies. Because the Get DMM Session step
ensures that the session exists for the life of the sequence, each module uses the
same session and the instrument initializes and closes only once.
Related concepts:
■
TestStand Directory Structure
■ Effectively Using LabVIEW with TestStand
■
Session Manager Support for 64-bit TestStand
Switch Executive
Description
This example demonstrates how to use TestStand to integrate and perform
switching operations with NI Switch Executive.
Highlighted Features
■ NI Switch Executive integration
■ IVI Switch step type
■ Switching panel
192 ni.com
TestStand User Manual
Major API
None
Prerequisites
This example assumes you have installed a release or evaluation version of NI
Switch Executive. This example also assumes the SwitchExecutiveExample virtual
device exists and the SampleMatrix1 and SampleMatrix2 IVI logical names are
configured to run in simulation mode.
The virtual device is created when you install NI Switch Executive. If the device
and/or logical names have been removed, you can recover them by performing the
following steps:
1. Open the Windows command line and type cd <National Instruments>/switch
executive, where <National Instruments> is the NI directory, which is
C:\Program Files (x86)\National Instruments by default.
2. Enter the command SwitchExecutive s to recreate the virtual device and
logical names.
Characterization of a Transistor
Purpose
This example demonstrates how you can use the Sweep Loop step to characterize a
transistor.
Highlighted Features
■ Sweep Loop Step Type
Major API
None
Prerequisites
None
194 ni.com
TestStand User Manual
Purpose
This example demonstrates how to dynamically specify a client sequence file. This
example uses the Execution.ClientFile property to set the client sequence file of the
process model.
Highlighted Features
■ TestStand API
■ Process model plug-in architecture
Major API
■ Engine.GetSequenceFileEx
■ Execution.ClientFile
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
196 ni.com
TestStand User Manual
Related concepts:
■ TestStand Directory Structure
■
Process Model Plug-In Architecture
■ Execution Entry Points in the Sequential Process Model
Highlighted Features
Callbacks
Major API
None
Prerequisites
You must have the LabWindows/CVI Run-Time Engine installed and you must
configure the LabWindows/CVI Adapter to execute steps in-process. If you want to
use the Execute Steps in an External Instance of CVI option, you must have the
LabWindows/CVI development environment installed.
198 ni.com
TestStand User Manual
Highlighted Features
Parallel process model
Major API
None
Prerequisites
None
200 ni.com
TestStand User Manual
2. On the Steps pane, select the Change setting to not show dialog step,
which is a Statement step.
3. On the Step Settings pane, click the Expression edit tab. The Expression
control specifies an expression that disables the default UUT Information
dialog box for the Parallel process model.
4. On the Sequences pane, select the PreUUT callback sequence. This sequence
specifies two Action steps that use the C/C++ DLL Adapter and call a DLL that
returns screen size information TestStand uses to determine where the new
dialog boxes need to launch on the screen. The TestSocket Serial Num
Message Popup step, which is a Message Popup step, requests the serial
number for each test socket TestStand executes in parallel.
You can complete the following steps to re-enable the default UUT Information
dialog box.
1. On the Sequences pane, select the ModelOptions callback sequence.
2. On the Step Settings pane for the Change setting to not show dialog step, click
the Properties tab.
3. Click Run Options on the Properties tab to show the Run Options panel.
4. Select Skip from the Run Mode ring control.
5. Select Execute»Test UUTs to run the sequence. Click No when TestStand
prompts you to save changes to the sequence file. The default UUT
Information dialog box launches to prompt you to enter test socket serial
numbers.
6. Close the sequence file and do not save any changes.
Related concepts:
■ Model Callbacks in the Parallel Process Model
■ TestStand Directory Structure
■ Parallel Process Model
■
Organizing Test Program Files with LabVIEW-Built Shared Libraries
Purpose
This example demonstrates how to override the PreUUT callback to customize the
batch and test socket serial number entry and how to override the PostUUT callback
to customize the batch and test socket status report.
Highlighted Features
Batch process model
Major API
None
Prerequisites
None
202 ni.com
TestStand User Manual
■ Test sockets you have disabled, terminated, or aborted never call the
PreUUT and PostUUT callbacks. If you want to record information for the test
sockets, you must do so in the PreBatch and PostBatch callbacks.
Related concepts:
■
Model Callbacks in the Batch Process Model
■ TestStand Directory Structure
■ Batch Process Model
■
Overriding PreBatch and PostBatch Model Callbacks
Highlighted Features
Batch process model
Major API
None
Prerequisites
None
204 ni.com
TestStand User Manual
Purpose
This example shows how to create a TestStand user interface using only
LabWindows/CVI controls. The UI uses the TestStand UI manager controls to
manage the application.
Highlighted Features
TestStand User Interface API
Major API
■ ApplicationManager.GetCommand
■ Command.Execute
Prerequisites
You must have LabWindows/CVI installed to execute this example.
Purpose
This example shows how to create a TestStand user interface using only LabVIEW
controls. The UI uses the TestStand UI manager controls to manage the application.
Highlighted Features
TestStand User Interface API
206 ni.com
TestStand User Manual
Major API
■ ApplicationManager.GetCommand
■ Command.Execute
Prerequisites
You must have the LabVIEW Development System installed to execute this example.
Related concepts:
■ TestStand Directory Structure
■
TestStand API Overview
Building a TestStand UI with Native Controls - LabVIEW NXG
Purpose
This example shows how to create a TestStand user interface using only LabVIEW
NXG controls. The UI uses the TestStand UI manager controls to manage the
application.
Highlighted Features
TestStand User Interface API
Major API
■ ApplicationManager.GetCommand
■ Command.Execute
Prerequisites
You must have the LabVIEW NXG Development System installed to execute this
example.
208 ni.com
TestStand User Manual
2. Select the Initialize case. In this case, references to the manager controls and
the LabVIEW controls are stored in the UI data cluster, and this application is
set as the main TestStand window.
3. Select the Register Event Callbacks case. This case specifies callback VIs
that will execute when a TestStand event occurs. Refer to the in-line
comments for more information.
4. Select the Handle Events case. This case handles user interaction. Within
the event cases, the GetCommand and Command.Execute methods are called
to implement TestStand-specific functionality.
5. Select the Shutdown case. This case closes all references and closes the
panel.
Complete the following steps to run the example:
1. Click Run to start the user interface.
2. Select Open Sequence File to open a sequence file, then select Execute to
run it using the first entry point in the current process model.
3. Once the execution completes, the report file path is added to the table
control. This functionality is implemented in the EndExecution event callback.
Related concepts:
■ TestStand Directory Structure
■ TestStand API Overview
Building a TestStand UI with Native Controls - .NET
Purpose
This example shows how to create a TestStand user interface using only .NET
controls. The UI uses the TestStand UI manager controls to manage the application.
Highlighted Features
TestStand User Interface API
Major API
■ ApplicationManager.GetCommand
■ Command.Execute
Prerequisites
You must have Visual Studio installed to execute this example.
210 ni.com
TestStand User Manual
3. Once the execution completes, the report file path is added to the table
control. This functionality is implemented in the
axApplicationMgr_EndExecution event callback.
Related concepts:
■
TestStand Directory Structure
■ TestStand API Overview
Highlighted Features
TestStand User Interface Controls
Major API
UI Connection methods
Prerequisites
None
212 ni.com
TestStand User Manual
Purpose
This example provides a simplified user interface to demonstrate the architecture of
a TestStand user interface. The interface code demonstrates the following actions in
a TestStand interface:
■ Provide functionality to TestStand controls by connecting them to manager
controls
■ Register callbacks to execute when TestStand events occur
Highlighted Features
■ TestStand User Interface Controls
■ TestStand User Interface API
Major API
TestStand User Interface API
Prerequisites
You must have LabWindows/CVI installed to execute this example.
Purpose
This example provides a simplified user interface to demonstrate the architecture of
a TestStand user interface. The interface code demonstrates the following actions in
a TestStand interface:
■ Initialize the TestStand engine
■ Provide functionality to TestStand controls by connecting them to manager
controls
■ Register callbacks to execute when TestStand events occur
214 ni.com
TestStand User Manual
Highlighted Features
■ TestStand User Interface Controls
■ TestStand User Interface API
Major API
TestStand User Interface API
Prerequisites
You must have the LabVIEW Development System involved to execute this example.
Purpose
This example provides a simplified user interface to demonstrate the architecture of
a TestStand user interface. The interface code demonstrates the following actions in
a TestStand interface:
■ Initialize the TestStand engine
■ Provide functionality to TestStand controls by connecting them to manager
controls
■ Register callbacks to execute when TestStand events occur
■ Shut down TestStand
216 ni.com
TestStand User Manual
Highlighted Features
■ TestStand User Interface Controls
■ TestStand User Interface API
Major API
TestStand User Interface API
Prerequisites
You must have the LabVIEW NXG Development System installed to execute this
example.
4. Select the Register Event Callbacks case. This case specifies callback
nodes that will execute when a TestStand event occurs. Refer to the in-line
comments for more information.
5. Select the Handle Events case. This case handles LabVIEW NXG specific
events, such as closing the panel. Refer to the in-line comments for more
information.
6. Select the Shutdown case. This case closes all references and closes the
panel.
Related concepts:
■
TestStand Directory Structure
■ TestStand API Overview
Creating a Basic User Interface - .NET
Purpose
This example provides a simplified user interface to demonstrate the architecture of
a TestStand user interface. The interface code demonstrates the following actions in
a TestStand interface:
■ Provide functionality to TestStand controls by connecting them to manager
controls
■ Register callbacks to execute when TestStand events occur
Highlighted Features
■ TestStand User Interface Controls
■ TestStand User Interface API
218 ni.com
TestStand User Manual
Major API
TestStand User Interface API
Prerequisites
You must have Visual Studio installed to execute this example.
Handling UI Messages
Purpose
This example shows how you can use custom UI messages to communicate between
the client sequence file and the user interface.
■ Sending data from the sequence to the UI—The Sequence posts UI
messages containing a status string. The UI message handler reads the string
and updates a UI control with the data.
■ Sending data from the UI to the sequence—Before executing, the
sequence posts a message requesting the state of the "show dialogs" UI
setting. The UI message handler sets the Locals.ShowDialogs sequence
property using the TestStand API, based on the value specified in the UI.
Highlighted Features
■ User Interface Messages
220 ni.com
TestStand User Manual
Major API
Thread.PostUIMessageEx
Prerequisites
You must have LabWindows/CVI installed to execute this example.
with ID greater than 10000 is posted. These IDs are reserved for user-
generated messages.
3. Find the ApplicationMgr_OnUserMessage function. Notice that each UI
message is defined as a case in the switch block. These cases define how each
UI message is handled.
Complete the following steps to review how UI messages are posted from an
executing sequence:
1. Open the example sequence file <TestStand Public>\Examples\Modifying User
Interfaces\Handling UI Messages\UI Message Example.seq
2. Inspect the statement steps. Each of these steps posts a UI message using the
Thread.postUIMessageEx method.
Related concepts:
■ TestStand Directory Structure
■ User Interface Messages (UIMessages)
■ TestStand API Overview
Handling UI Messages - LabVIEW
Purpose
This example shows how you can use custom UI messages to communicate between
the client sequence file and the user interface.
■ Sending data from the sequence to the UI—The Sequence posts UI
messages containing a status string. The UI message handler reads the string
and updates a UI control with the data.
■ Sending data from the UI to the sequence—Before executing, the
sequence posts a message requesting the state of the "show dialogs" UI
setting. The UI message handler sets the Locals.ShowDialogs sequence
property using the TestStand API, based on the value specified in the UI.
222 ni.com
TestStand User Manual
this sequence file. While the sequence will run successfully in the
Sequence Editor or other user interfaces, the user messages posted will
have no effect.
Highlighted Features
■ User Interface Messages
■ TestStand User Interface controls
Major API
Thread.PostUIMessageEx
Prerequisites
You must have the LabVIEW Development System installed to view this example.
Purpose
This example shows how you can use custom UI messages to communicate between
the client sequence file and the user interface.
■ Sending data from the sequence to the UI—The Sequence posts UI
messages containing a status string. The UI message handler reads the string
and updates a UI control with the data.
224 ni.com
TestStand User Manual
Highlighted Features
■ User Interface Messages
■ TestStand User Interface controls
Major API
Thread.PostUIMessageEx
Prerequisites
You must have the LabVIEW NXG Development System installed to view this
example.
226 ni.com
TestStand User Manual
Purpose
This example shows how you can use custom UI messages to communicate between
the client sequence file and the user interface.
■ Sending data from the sequence to the UI—The Sequence posts UI
messages containing a status string. The UI message handler reads the string
and updates a UI control with the data.
■ Sending data from the UI to the sequence—Before executing, the
sequence posts a message requesting the state of the "show dialogs" UI
setting. The UI message handler sets the Locals.ShowDialogs sequence
property using the TestStand API, based on the value specified in the UI.
Highlighted Features
■ User Interface Messages
■ TestStand User Interface controls
Major API
Thread.PostUIMessageEx
Prerequisites
You must have Visual Studio installed to execute this example.
228 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use LabWindows/CVI to show step execution
progress and status in the TestStand Sequence Editor or Execution window.
Highlighted Features
■ LabWindows/CVI Adapter
■ Execution
Major API
■ SequenceContext
■ Thread
■ Thread.PostUIMessage
■ UIMessageCodes Enumeration
Prerequisites
None
230 ni.com
TestStand User Manual
Related concepts:
■ TestStand Directory Structure
■
Programming with the TestStand API in LabWindows/CVI
■ Executions
Updating the Status Bar Using UI Messages - LabVIEW
Purpose
This example demonstrates how to use LabVIEW to show step execution progress
and status in the TestStand Sequence Editor or Execution window.
Highlighted Features
■ LabVIEW Adapter
■ Execution
Major API
■ SequenceContext
■ Thread
■ Thread.PostUIMessage
■ UIMessageCodes Enumeration
Prerequisites
You must have the LabVIEW development system installed and you must configure
the LabVIEW Adapter to use the LabVIEW development system.
232 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use LabVIEW NXG to show step execution
progress and status in the TestStand Sequence Editor or Execution window.
Highlighted Features
■ LabVIEW Adapter
■ Execution
Major API
■ SequenceContext
■ Thread
■ Thread.PostUIMessage
■ UIMessageCodes Enumeration
Prerequisites
You must have the LabVIEW NXG development system installed and you must
configure the LabVIEW NXG Adapter to use the LabVIEW development system.
234 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use C++ to show step execution progress and
status in the TestStand Sequence Editor or Execution window.
Highlighted Features
■ C/C++ DLL Adapter
■ Execution
Major API
None
Prerequisites
None
236 ni.com
TestStand User Manual
Note AppWizard uses TODO: to indicate parts of the source code to which
you must add or that you must customize.
Related concepts:
■
TestStand Directory Structure
■ Organizing Test Program Files with LabVIEW-Built Shared Libraries
■ Executions
Updating the Status Bar Using UI Messages - .NET
Purpose
This example demonstrates how to show step execution progress and status in the
TestStand Sequence Editor or Execution window.
Highlighted Features
■ Execution
■ .NET Adapter
Major API
■ SequenceContext
■ Thread
■ Thread.PostUIMessage
■ UIMessageCodes Enumeration
Prerequisites
None
Highlighted Features
■ Execution Profiler
■ Synchronization step types
238 ni.com
TestStand User Manual
Major API
N/A
Prerequisites
None
6. For Auto Scheduled With Additional DMM, note that each UUT first uses any
instrument, as soon as one is available. It then uses the remaining type of
instrument as soon as one is available.
7. Note that each strategy completes in a shorter time than the previous
strategy.
8. Open the View menu in the profiler. To focus on the instrument usage only,
the example unchecked the following menu items when it launched the
profiler in its SequenceFileLoad sequence:
■ Show Blocked Threads
■ Show Code Modules»Step
■ Show Code Modules»Step Type
■ Show Code Modules»Load
■ Show Code Modules»Unload
■ Show Synchronization»Show Auto Scheduling
■ Show Synchronization»Show Batch Synchronization
■ Show Synchronization»Show Wait Operations
■ Show Steps
■ Show UUTs, Batches, and Lots
Toggle each menu item on and off to observe the additional data the profiler
displays when each item is on.
Complete the following steps to walk through the example:
1. Checkmark the following items in the View menu:
■ Show Blocked Threads
■ Show Synchronization»Show Auto Scheduling
■ Show Synchronization»Show Batch Synchronization
■ Show Synchronization»Show Wait Operations
■ Show UUTs, Batches, and Lots
2. Click Clear and complete the following steps:
240 ni.com
TestStand User Manual
e. Click the Clear button to remove the graph information and select
View»Show Blocked Threads to show the time that threads block
while waiting to acquire resources.
f. In the sequence editor, right-click the Auto Schedule step in the Main
step group of the MainSequence and select Run Selected Steps from
the context menu. In the profiler, notice that the graph now includes
rectangles labeled Auto Schedule ("Resource name"), which correspond
to Use Auto Scheduled Resource steps that define resource usage
sections in the sequence. The graph shows that the Use Auto Scheduled
Resource steps block the execution of their threads until the steps can
lock the resources that their section of the sequence requires. You can
hide the operations of the Auto Schedule and Use Auto Scheduled
Resource steps by unchecking View»Show Auto Scheduling. Notice
that for some threads, the Auto Schedule example reorders the use of
the DMM and scope resources to reduce the batch time to
approximately 18 seconds, because each DMM test takes a minimum of
4.5 seconds. In this example, the test time is now resource limited, and
any further improvements will require additional resources.
g. Click the Items tab to display the Items table.
h. Uncheck View»Show UUTs, Batches, and Lots.
i. Click the % Actual Time in Use column heading twice to sort the
percent values in descending order, as indicated by an inverted triangle
icon. The Auto Scheduled item has the highest % Actual Time in Use
value. However, this is only the name of the lock the example holds to
force the profiler to display the name of the strategy being used.
Ignoring that item, the DMM item now has the highest Percent Time in
Use value, which indicates that system performance might improve if
you add additional DMM resources.
j. Click the Clear button to remove the graph information and uncheck
View»Display Blocked Threads. Checkmark View»Show UUTs,
Batches, and Lots.
k. In the sequence editor, right-click the Parallel with Additional DMM step
in the Main step group of the MainSequence and select Run Selected
242 ni.com
TestStand User Manual
Steps from the context menu. In the profiler, notice that the additional
DMM reduces the value of the batch time to approximately 17 seconds.
Because the DMM test always precedes the scope test, the scope test
cannot execute in parallel until a thread completes its DMM test.
l. Click the Clear button to remove the graph information.
m. In the sequence editor, right-click the Auto Scheduled with Additional
DMM step in the Main step group of the MainSequence and select Run
Select Steps from the context menu. In the profiler, notice that the
batch time reduces to approximately 12 seconds, which is a substantial
improvement over the initial value of 30 seconds for the Sequential
strategy example, in which no parallel resource usage existed.
n. In the sequence editor, open and examine the Sequential, Parallel, Auto
Scheduled, Parallel with Additional DMM, and Auto Scheduled with
Additional DMM sequences to view how each sequence synchronizes
access to the DMM and scope resources. Notice that the DMM and scope
are represented by Wait steps. The example models tests that are
resource-bound instead of CPU-bound, and is an accurate model for
tests that must wait on instrument and I/O operations and for multi-
core systems in which the number of cores equals or exceeds the
number of UUTs. You can change the values of the
DMMSimulatedTestDuration and ScopeSimulatedTestDuration file
global variables to determine the effect of different resource speeds on
total throughput. The example contains a ModelOptions callback
sequence that sets the number of UUTs to four. You can edit the callback
sequence, or you can delete the sequence and select
Configure»Model Options to launch the Model Options dialog box
and modify the value of the Number of Test Sockets option to
experiment with the effect of changing the number of UUTs.
Related concepts:
■ TestStand Directory Structure
Purpose
This example demonstrates how to run code modules in parallel. This sequence
uses two Sequence Call steps that each call a subsequence in a new execution. Each
subsequence calls a LabWindows/CVI code module to display a panel, which is
updated by a loop in the MainSequence asynchronous from the original execution.
Highlighted Features
■ Sequence Call steps
■ Wait steps
Major API
None
Prerequisites
None
244 ni.com
TestStand User Manual
the Do not wait option. This sequence uses the Do not wait option and a
set of Wait steps at the end of the MainSequence to collect results from each
subsequence.
4. On the Steps pane, select the Wait on Panel 1 for Results step, which is a
Wait step.
5. On the Step Settings pane, click the Wait Settings edit tab. The Specify by
Sequence Call option specifies that the step waits for the Launch Display
Panel 1 sequence call to finish executing. Similarly, the Wait on Panel 2 for
Results step waits for the Launch Display Panel 2 sequence call to finish
executing.
6. On the Sequences pane, select the Display 1 sequence.
7. On the Steps pane, select the Display Panel 1 step, which is an Action step
that uses the LabWindows/CVI Adapter.
8. On the Step Settings pane, click the LabWindows/CVI Module tab. This step
calls a DLL that polls the Counter1 file global variable and displays the
content. Similarly, the Display Panel 2 step in the Display 2 sequence polls the
Counter2 file global variable and displays the content.
9. On the Sequences pane, select the MainSequence and select Execute»Single
Pass to run the sequence. TestStand begins three executions: one execution
updates the Counter1 and Counter2 variables, and the other executions polls
the values of the variables.
10. Click Stop for both Display Panel 1 and Display Panel 2. Scroll to the bottom
of the report, which displays results for the Display Panel 1 and Display Panel
2 steps under the Wait steps for each new execution. If the sequence did not
use Wait steps, TestStand would not log results for the steps run in new
executions.
Related concepts:
■ TestStand Directory Structure
■ Programming with the TestStand API in LabWindows/CVI
Purpose
This example demonstrates how to launch a parallel, independent sequence
execution with a Sequence Call step in conjunction with a Wait step so that the
execution results of the primary sequence are combined with the execution results
of the subsequence.
Alternatively, you can run the subsequence in the same execution as the primary
sequence. Review the report TestStand generates after either scenario to see the
difference in where the results are collected for the Sequence Call steps.
Highlighted Features
■ Sequence Call steps
■ Wait steps
Major API
None
Prerequisites
None
246 ni.com
TestStand User Manual
3. On the Steps pane, select the Sequential Call step, which is a Sequence Call
step.
4. On the Step Settings pane, click the Sequence Call Module tab. The
Execution Options ring control specifies the None option.
5. On the Steps pane, select the Wait step.
6. On the Step Settings pane, click the Wait Settings edit tab. The Specify by
Sequence Call option specifies that the step waits for the Parallel Call
sequence call to finish executing.
7. Select Execute»Single Pass to run the sequence.
8. Review the information in the dialog box that launches, and click the Run
DemoSequence in New Execution button. A dialog box launches for each
execution simultaneously. You may have to move or click OK in each dialog
box to see the others.
9. Click OK in each dialog box.
10. Review the report. The results for the Message Popup step from the
DemoSequence appears after the Wait step.
11. Select Execute»Restart to restart the MainSequence execution.
12. Review the information in the dialog box that launches, and click the Run
DemoSequence Sequentially button. Now, only one dialog box launches
at a time.
13. Click OK in each dialog box, and review the report. The Message Popup step
from the DemoSequence now appears after the Message Popup 2 step.
Related concepts:
■ TestStand Directory Structure
The Batch process model generates a batch report that summarizes the results for
the UUTs in the batch.
Highlighted Features
■ Batch process model
■ Batch Synchronization step
■ Flow Control steps
■ Synchronization panel
Major API
None
Prerequisites
None
248 ni.com
TestStand User Manual
in which you have only one set of testing equipment available for certain
procedures.
The Frequency Sweep step in the MainSequence does not specify any
synchronization options, and so all UUTs run this step in parallel.
Select Execute»Single Pass to run the sequence and review the behavior of the
batch execution. When the test completes, the sequence launches a dialog box that
displays the time required to perform the frequency test on all UUTs. The dialog box
divides the total time by the number of UUTs and displays the test time per UUT to
illustrate how you can increase throughput by testing UUTs in parallel.
Note
■ By default, a sequence file uses the Sequential process model, but you
can use the Station Model control on the Model tab of the Station
Options dialog box to specify that the Batch process model is the default
model for all sequence files.
■ You can use the Model Options dialog box to configure the number of
test sockets you want to use for the batch.
Related concepts:
■
Batch Process Model
■ TestStand Directory Structure
■
Sequential Process Model
Highlighted Features
Parallel process model
Major API
None
Prerequisites
None
250 ni.com
TestStand User Manual
station for UUT testing, but it needs to be performed only once before any
tests begin.
4. On the Sequences pane, select the Pulse Test sequence. This sequence
simulates a test that can execute on only one test socket at a time. In many
cases, a test station testing multiple UUTs in parallel must share resources
(such as hardware) between test sockets to ensure multiple sockets do not
attempt to access the resource at the same time.
5. Observe the Enter Locked Section step at the beginning of the sequence and
the Exit Locked Section step at the end of the sequence. These steps use the
Lock synchronization object in TestStand to ensure only one test socket
executes this sequence at a time.
Complete the following steps to run the example.
1. Select Execute»Test UUTs to run the sequence.
2. The Set Chamber Temperature dialog box indicates the simulated chamber
heating process. This code executes before any UUTs are tested.
3. The UUT Information dialog box displays once the chamber heating process is
complete. Use this dialog box to enter a serial number for the UUT and start or
stop the execution for each test socket.
4. Once testing has started on a test socket, dialog boxes indicate the status of
the tests. Observe that the Parallel model allows each UUT to start and stop
testing independently. However, the Lock steps in the Pulse Test sequence
cause that sequence to execute on only one test socket at a time. This
behavior demonstrates the ability to synchronize among test sockets when
using the Parallel model.
Related concepts:
■ Parallel Process Model
■ TestStand Directory Structure
Purpose
This example demonstrates how to use the TestStand API from an HTBasic code
module to access a one-dimensional array, two-dimensional array, and an array of
strings in TestStand.
Highlighted Features
■ HTBasic Adapter
■ TestStand API
Major API
■ PropertyObject.GetValNumberByOffset
■ PropertyObject.SetValNumberByOffset
■ PropertyObject.GetValStringByOffset
■ PropertyObject.SetValStringByOffset
Prerequisites
When you use the demo version of HTBasic, you must configure the HTBasic
Adapter to use the HTBasic demo server. Select the Use HTBasic Runtime Server
252 ni.com
TestStand User Manual
option in the HTBasic Adapter Configuration dialog box and specify the path and
filename for HTBwin.exe.
Note (64-bit TestStand) 64-bit TestStand does not support the HTBasic
Adapter.
3. On the Step Settings pane, review the settings for the Action step. The step
does not pass local variables to or return local variables from the subroutine.
4. Select Execute»Single Pass to run the sequence. Use the TestStand
debugging tools such as breakpoints, the Variables pane, and the Watch View
pane to monitor the local variables and verify that the HTBasic subroutines
populate the panes with data.
Related concepts:
■
TestStand Directory Structure
■
Debugging Executions
Accessing Arrays Using API - LabWindows/CVI
Purpose
This example demonstrates how to use the TestStand API from a LabWindows/CVI
DLL code module to access a one-dimensional array, two-dimensional array, and an
array of strings in TestStand.
Highlighted Features
■ LabWindows/CVI Adapter
■ TestStand API
Major API
■ PropertyObject.NewSubProperty
■ PropertyObject.GetValVariant
■ PropertyObject.SetValVariant
254 ni.com
TestStand User Manual
Prerequisites
You must have the LabWindows/CVI Run-Time Engine installed and you must
configure the LabWindows/CVI Adapter to execute steps in-process. If you want to
use the Execute Steps in an External Instance of CVI option, you must have the
LabWindows/CVI development environment installed.
Purpose
This example demonstrates how to use the TestStand API from a LabVIEW code
module to access a one-dimensional array, two-dimensional array, and an array of
strings in TestStand.
256 ni.com
TestStand User Manual
Highlighted Features
■ LabVIEW Adapter
■ TestStand API
Major API
■ PropertyObject.NewSubProperty
■ PropertyObject.SetValVariant
Prerequisites
You must have the LabVIEW development system installed and you must configure
the LabVIEW Adapter to use the LabVIEW development system.
Purpose
This example demonstrates how to use the TestStand API from a LabVIEW NXG code
module to access a one-dimensional array, two-dimensional array, and an array of
strings in TestStand.
Highlighted Features
■ LabVIEW NXG Adapter
■ TestStand API
258 ni.com
TestStand User Manual
Major API
■ PropertyObject.NewSubProperty
■ PropertyObject.SetValVariant
Prerequisites
You must have the LabVIEW NXG development system installed and you must
configure the LabVIEW NXG Adapter to use the LabVIEW NXG development system.
Purpose
This example demonstrates how to use the TestStand API from a Microsoft
Foundation Class (MFC) Library code module to access a one-dimensional array,
two-dimensional array, and an array of strings in TestStand.
Highlighted Features
■ C/C++ DLL Adapter
■ TestStand API
Major API
■ PropertyObject.NewSubProperty
■ PropertyObject.GetValVariant
260 ni.com
TestStand User Manual
■ PropertyObject.SetValVariant
Prerequisites
None
Note AppWizard uses TODO: to indicate parts of the source code to which
you must add or that you must customize.
Related concepts:
■ TestStand Directory Structure
■
Organizing Test Program Files with LabVIEW-Built Shared Libraries
Accessing Arrays Using API - .NET
Purpose
This example demonstrates how to use the TestStand API from a .NET assembly
code module to access a one-dimensional array, two-dimensional array, and an
array of strings in TestStand.
Highlighted Features
■ .NET Adapter
■ TestStand API
Major API
■ PropertyObject.NewSubProperty
■ PropertyObject.GetValVariant
■ PropertyObject.SetValVariant
262 ni.com
TestStand User Manual
Prerequisites
None
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-
in TestStand properties are defined by the TestStand API, and are available for any
object of a given class. Dynamic properties, also known as SubProperties, can vary
between objects of the same class.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetValNumber
■ PropertyObject.GetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
Prerequisites
None
264 ni.com
TestStand User Manual
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-
in TestStand properties are defined by the TestStand API, and are available for any
object of a given class. Dynamic properties, also known as SubProperties, can vary
between objects of the same class.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetValNumber
■ PropertyObject.GetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
Prerequisites
None
266 ni.com
TestStand User Manual
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-
in TestStand properties are defined by the TestStand API, and are available for any
object of a given class. Dynamic properties, also known as SubProperties, can vary
between objects of the same class.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetValNumber
■ PropertyObject.GetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
Prerequisites
None
268 ni.com
TestStand User Manual
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-
in TestStand properties are defined by the TestStand API, and are available for any
object of a given class. Dynamic properties, also known as SubProperties, can vary
between objects of the same class.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetValNumber
■ PropertyObject.GetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
Prerequisites
None
270 ni.com
TestStand User Manual
Note AppWizard uses TODO: to indicate parts of the source code to which
you must add or that you must customize.
Related concepts:
■
TestStand Directory Structure
Accessing Properties Using API - .NET
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-
in TestStand properties are defined by the TestStand API, and are available for any
object of a given class. Dynamic properties, also known as SubProperties, can vary
between objects of the same class.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetValNumber
■ PropertyObject.GetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
Prerequisites
None
272 ni.com
TestStand User Manual
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-
in TestStand properties are defined by the TestStand API, and are available for any
object of a given class. Dynamic properties, also known as SubProperties, can vary
between objects of the same class.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetValNumber
■ PropertyObject.GetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
Prerequisites
None
274 ni.com
TestStand User Manual
Purpose
This example demonstrates how to programmatically create and execute new test
sequences. This example uses an XML file to create new steps and insert them into a
new sequence. The example then saves and executes the new sequence file.
Highlighted Features
■ TestStand API
■ Flow Control steps
Major API
■ Engine.NewSequenceFile
■ Engine.NewStep
■ Sequence.InsertStep
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Execution.WaitForEndEx
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
276 ni.com
TestStand User Manual
2. When prompted, select the example XML file. The data in this file will be used
to create a new sequence file.
3. Notice that a new execution is created. This execution is running the
dynamically created sequence file.
4. Open the sample XML file located in <TestStand Public>\TestStand
API\Building a Sequence Using API\Common in a text editor. You can modify
this file to change the steps in the generated sequence file.
Related concepts:
■ TestStand Directory Structure
Building a Sequence Using API - .NET
Purpose
This example demonstrates how to programmatically create and execute new test
sequences. This example uses an XML file to create new steps and insert them into a
new sequence. The example then saves and executes the new sequence file.
Highlighted Features
■ TestStand API
■ Flow Control steps
Major API
■ Engine.NewSequenceFile
■ Engine.NewStep
■ Sequence.InsertStep
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Execution.WaitForEndEx
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
Purpose
This example demonstrates how to programmatically create and execute new test
sequences. This example uses an INI file to create new steps and insert them into a
new sequence. The example then saves and executes the new sequence file.
278 ni.com
TestStand User Manual
Highlighted Features
■ TestStand API
■ Flow Control steps
Major API
■ Engine.NewSequenceFile
■ Engine.NewStep
■ Sequence.InsertStep
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Execution.WaitForEndEx
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
Purpose
This example demonstrates how to programmatically create and execute new test
sequences. This example uses an XML file to create new steps and insert them into a
new sequence. The example then saves and executes the new sequence file.
Highlighted Features
■ TestStand API
■ Flow Control steps
Major API
■ Engine.NewSequenceFile
■ Engine.NewStep
■ Sequence.InsertStep
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Execution.WaitForEndEx
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
280 ni.com
TestStand User Manual
Highlighted Features
■ User management
Major API
■ Engine.GetUserGroup
■ Engine.NewUser
■ Engine.UserNameExists
■ Engine.UsersFile
■ PropertyObject.SetPropertyObjectByOffset
■ PropertyObject.SetValStringByOffset
■ UsersFile.UserList
Prerequisites
You must be logged into TestStand as a user with administrator privileges.
282 ni.com
TestStand User Manual
9. In the Select User dialog box, select the new user you created in step 4.
10. In the Save the Modified Users File dialog box, select whether you want to
save the changes made to the User file.
Related concepts:
■
TestStand Directory Structure
■ Managing Users
■ Privileges
Purpose
This example demonstrates how to use the TestStand API to create and assign
values to PropertyObjects. With the exception of the TestStand Engine, any object in
TestStand can be accessed as a PropertyObject. This arrangement allows the
methods demonstrated in this example to be used with many objects in TestStand,
including step properties and variables.
Highlighted Features
■ TestStand API
284 ni.com
TestStand User Manual
Major API
■ Engine.NewPropertyObject
■ PropertyObject.NewSubProperty
■ PropertyObject.InsertSubProperty
■ PropertyObject.SetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
■ PropertyObject.SetFlags
Prerequisites
Report generation should be enabled in order to see the result of adding a
PropertyObject to the Result container of a step.
Purpose
This example demonstrates how to use the TestStand API to create and assign
values to PropertyObjects. With the exception of the TestStand Engine, any object in
TestStand can be accessed as a PropertyObject. This arrangement allows the
286 ni.com
TestStand User Manual
Highlighted Features
■ TestStand API
Major API
■ Engine.NewPropertyObject
■ PropertyObject.NewSubProperty
■ PropertyObject.InsertSubProperty
■ PropertyObject.SetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
■ PropertyObject.SetFlags
Prerequisites
Report generation should be enabled in order to see the result of adding a
PropertyObject to the Result container of a step.
288 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use the TestStand API to create and assign
values to PropertyObjects. With the exception of the TestStand Engine, any object in
TestStand can be accessed as a PropertyObject. This arrangement allows the
methods demonstrated in this example to be used with many objects in TestStand,
including step properties and variables.
Highlighted Features
■ TestStand API
Major API
■ Engine.NewPropertyObject
■ PropertyObject.NewSubProperty
■ PropertyObject.InsertSubProperty
■ PropertyObject.SetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
■ PropertyObject.SetFlags
Prerequisites
Report generation should be enabled in order to see the result of adding a
PropertyObject to the Result container of a step.
290 ni.com
TestStand User Manual
4. On the Sequences pane, select the Create New Container sequence. This
sequence demonstrates a method of creating complex container structures
with the SetVal methods. The PropertyObject.NewSubProperty method is
used to create a container field for error data, which is a defined type in the
TestStand Types pane. Additionally, this sequence uses a
PropertyObject.NewSubProperty method call to create an array and assigns a
value to that array using the PropertyObject.SetValVariant method.
5. On the Sequences pane, select the Insert PropertyObject Into Step
Results sequence. This sequence creates a new PropertyObject and inserts it
into the step’s Result container. The PropertyObject.SetFlags TestStand API
method is used to mark this PropertyObject to be included in the report
generated after execution. This demonstrates a common use case for creating
new PropertyObjects in a test sequence.
Related concepts:
■
TestStand Directory Structure
Creating New Properties Using API - .NET
Purpose
This example demonstrates how to use the TestStand API to create and assign
values to PropertyObjects. With the exception of the TestStand Engine, any object in
TestStand can be accessed as a PropertyObject. This arrangement allows the
methods demonstrated in this example to be used with many objects in TestStand,
including step properties and variables.
Highlighted Features
■ TestStand API
Major API
■ Engine.NewPropertyObject
■ PropertyObject.NewSubProperty
■ PropertyObject.InsertSubProperty
■ PropertyObject.SetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
■ PropertyObject.SetFlags
Prerequisites
Report generation should be enabled in order to see the result of adding a
PropertyObject to the Result container of a step.
292 ni.com
TestStand User Manual
Purpose
This example demonstrates how to use the TestStand API to create and assign
values to PropertyObjects. With the exception of the TestStand Engine, any object in
TestStand can be accessed as a PropertyObject. This arrangement allows the
Highlighted Features
■ TestStand API
Major API
■ Engine.NewPropertyObject
■ PropertyObject.NewSubProperty
■ PropertyObject.InsertSubProperty
■ PropertyObject.SetValString
■ PropertyObject.SetValNumber
■ PropertyObject.SetValBoolean
■ PropertyObject.SetValVariant
■ PropertyObject.SetFlags
Prerequisites
Report generation should be enabled in order to see the result of adding a
PropertyObject to the Result container of a step.
294 ni.com
TestStand User Manual
Purpose
This example demonstrates various methods of calling a sequence using the
TestStand API.
Note If you are developing a TestStand user interface which must handle
TestStand UI messages, do not use the WaitForEndEx() method, since this
method does not process the UI messages while it waits for the execution
to complete. If you need to call this method from a user interface, you
must call this method from a non-UI thread.
Highlighted Features
■ TestStand API
296 ni.com
TestStand User Manual
Major API
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
Purpose
This example demonstrates various methods of calling a sequence using the
TestStand API.
Note If you are developing a TestStand user interface which must handle
TestStand UI messages, do not use the WaitForEndEx() method, since this
method does not process the UI messages while it waits for the execution
to complete. If you need to call this method from a user interface, you
must call this method from a non-UI thread.
298 ni.com
TestStand User Manual
Highlighted Features
■ TestStand API
Major API
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
300 ni.com
TestStand User Manual
Purpose
This example demonstrates various methods of calling a sequence using the
TestStand API.
Note If you are developing a TestStand user interface which must handle
TestStand UI messages, do not use the WaitForEndEx() method, since this
method does not process the UI messages while it waits for the execution
to complete. If you need to call this method from a user interface, you
must call this method from a non-UI thread.
Highlighted Features
■ TestStand API
Major API
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
302 ni.com
TestStand User Manual
2. As each section of code executes, the Message Popup from the target
sequence appears. Click OK on these dialog boxes to continue execution.
3. When the Execute With Sequence Parameters sequence executes, enter a
number and string in the Message Popups that appear. Notice that these
values are displayed in the final Message Popup.
Related concepts:
■ TestStand Directory Structure
Executing Sequences Using API - .NET
Purpose
This example demonstrates various methods of calling a sequence using the
TestStand API.
Note If you are developing a TestStand user interface which must handle
TestStand UI messages, do not use the WaitForEndEx() method, since this
method does not process the UI messages while it waits for the execution
to complete. If you need to call this method from a user interface, you
must call this method from a non-UI thread.
Highlighted Features
■ TestStand API
Major API
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
304 ni.com
TestStand User Manual
Purpose
This example demonstrates various methods of calling a sequence using the
TestStand API.
Note If you are developing a TestStand user interface which must handle
TestStand UI messages, do not use the WaitForEndEx() method, since this
method does not process the UI messages while it waits for the execution
to complete. If you need to call this method from a user interface, you
must call this method from a non-UI thread.
Highlighted Features
■ TestStand API
Major API
■ Engine.GetSequenceFileEx
■ Engine.NewExecution
■ Engine.ReleaseSequenceFileEx
Prerequisites
None
306 ni.com
TestStand User Manual
Purpose
This example demonstrates how to type cast TestStand objects in order to access
specific API properties and methods.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetPropertyObject
■ SequenceFile.AsPropertyObjectFile
■ SequenceFile.AsPropertyObject
Prerequisites
None
308 ni.com
TestStand User Manual
Purpose
This example demonstrates how to type cast TestStand objects in order to access
specific API properties and methods.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetPropertyObject
■ SequenceFile.AsPropertyObjectFile
■ SequenceFile.AsPropertyObject
Prerequisites
None
310 ni.com
TestStand User Manual
Purpose
This example demonstrates how to type cast TestStand objects in order to access
specific API properties and methods.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetPropertyObject
■ SequenceFile.AsPropertyObjectFile
■ SequenceFile.AsPropertyObject
Prerequisites
None
1. Open the Cast to More Generic Class sequence from the Sequences pane.
Select the Cast to More Generic Class step, then click Edit VI in the Module
tab of the Step Settings pane to open the code module. This step casts a
sequence file object to the more generic propertyObject and
PropertyObjectFile classes to access their properties and methods.
2. Open the Cast to More Specific Class sequence from the Sequences pane.
Select the Cast to More Specific Class step, then click Edit VI in the
Module tab of the Step Settings pane to open the code module. This step casts
a PropertyObject to more specific classes to access their properties and
methods.
Complete the following steps to run the example:
1. Select Execute»Run MainSequence to execute the sequence.
2. As the sequence executes, read the message popups for information about
the kinds of type casting available in the TestStand API.
Related concepts:
■ TestStand Directory Structure
■ Accessing Built-in Properties
■ Accessing Dynamic Properties
■
RunState Subproperties
Type Casting API Classes - .NET
Purpose
This example demonstrates how to type cast TestStand objects in order to access
specific API properties and methods.
312 ni.com
TestStand User Manual
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■ RunState Property
■ TestStand API
Major API
■ PropertyObject.GetPropertyObject
■ SequenceFile.AsPropertyObjectFile
■ SequenceFile.AsPropertyObject
Prerequisites
None
2. As the sequence executes, read the message popups for information about
the kinds of type casting available in the TestStand API.
Related concepts:
■ TestStand Directory Structure
■
Accessing Built-in Properties
■ Accessing Dynamic Properties
■ RunState Subproperties
Type Casting API Classes - TestStand Expressions
Purpose
This example demonstrates how to type cast TestStand objects in order to access
specific API properties and methods.
Highlighted Features
■ Built-In Properties
■ Dynamic Properties
■
RunState Property
■ TestStand API
Major API
■ PropertyObject.GetPropertyObject
■ SequenceFile.AsPropertyObjectFile
■ SequenceFile.AsPropertyObject
314 ni.com
TestStand User Manual
Prerequisites
None
Benchmarks
Purpose
This example performs a benchmark on each of the TestStand adapters.
Highlighted Features
■ Module adapters
■ Performance
Major API
None
Prerequisites
You must log into TestStand as a user with administrator privileges. To use the
LabVIEW benchmark portion of the example, you must have the LabVIEW
development system or LabVIEW Run-Time Engine (RTE) installed and you must
configure the LabVIEW Adapter to use the LabVIEW development system or LabVIEW
RTE.
316 ni.com
TestStand User Manual
is a configurable rule setting that users edit with a standard built-in dialog
box. This example demonstrates how to use rule settings to configure rules
and how to use analysis transitions to perform bookkeeping tasks.
■ CheckStepNameLength—This rule verifies that the analyzed step names
do not exceed a maximum length. The maximum length is a configurable rule
setting that users edit using a custom dialog box. This example demonstrates
how to use a rule configuration module to configure rules using a custom
dialog box and how to store and retrieve rule configuration data.
Each example rule contains source code for analysis modules and rule configuration
modules written in LabVIEW, LabWindows/CVI, Microsoft Visual C#, and Microsoft
Visual C++.
Highlighted Features
■ Analysis module
■ Analysis transitions
■ Rule configuration module
■ Rule settings
Major API
■ AnalysisContext
■ RuleConfiguration
■ RuleConfigurationContext
318 ni.com
TestStand User Manual
Prerequisites
You do not need any additional software to run the examples. You must have a
supported version of LabVIEW, LabWindows/CVI, or Microsoft Visual Studio installed
to modify and rebuild the modules.
Highlighted Features
■ Action step
■ ActiveX/COM Adapter
Major API
■ Engine.NewOutputMessage
■ OutputMessage.Post
Prerequisites
(LabVIEW) You must have the LabVIEW development system installed and you must
configure the LabVIEW Adapter to use the LabVIEW development system.
(LabWindows/CVI)You must have the LabWindows/CVI Run-Time Engine installed
and you must configure the LabWindows/CVI Adapter to execute steps in-process. If
you want to use the Execute Steps in an External Instance of CVI option, you
must have the LabWindows/CVI development environment installed.
320 ni.com
TestStand User Manual
Statement Step
The Statement step is the simplest way to generate output messages. Select the
Generate Output Message using a Statement step step and click the
Expression edit tab on the Step Settings pane, which describes the following
functionality for the Statement step:
■ The expression specifies a simple comparison to determine if the
RunState.LoopIndex value is a multiple of 10. If true, the modulus 10
operation evaluates to 0, and TestStand calls the OutputMessage function.
■ The parameters of the OutputMessage function accept a message and a
severity, and specify the font color and icon to display with the message.
ActiveX/COM Steps
The final step in the MainSequence is a Sequence Call step that calls the Using
ActiveX Adapter steps sequence. Select the Using ActiveX Adapter steps on the
Sequences pane to display the steps in the Using ActiveX Adapter steps sequence,
which describes the following functionality:
■ A For loop contains all the steps in the sequence. The If step specifies that
the steps execute during only every tenth iteration through the loop.
■ The New Output Message step creates the output message by calling the
Engine.NewOutputMessage method. This step also specifies the message text,
category, and severity and obtains a reference to the sequence context.
■ The Set Text Color step uses the Set Property option on the TextColor
property to change the message font color to cyan.
■ The Set Icon Name step specifies the icon to display next to the message.
■ The Post Output Message step invokes the OutputMessage.Post method to
display the output message on the Output pane. Simply creating the message
using the Engine.NewOutputMessage method is insufficient.
Related concepts:
■
TestStand Directory Structure
■ Sequence Context