Passing Arguments to a New Execution
Downloads
Filename: passargstonewexecution.zip
Requirements: View
- String
- Number
- Custom container - Contains a boolean and a number. The custom container type is defined in the CalledSequence.seq file and is named CustomContainer.
The arguments passed to the new execution must be of the same type and in the same order as the parameters defined in the called sequence. In contrast, the name of the passed argument is irrelevant.
There are the following two ways to call a new execution.
- Method 1 -- Using the Sequence Call Step
This capability was added to the Sequence Call step in TestStand 2.0. When you specify the module of the Sequence Call step you can set the value of the Multithreading and Remote Execution control to Run Sequence in a New Execution. Clicking the Settings button allows you to configure the execution to not use a process model. By doing this, passing arguments to the new execution is the same process as passing arguments to a subsequence.
- Method 2 -- Using the NewExecution Method
The more complicated way to call a new execution is to use the NewExecution method of the TestStand API. Using the NewExecution method is more complicated because it does not have menu driven configuration like the Sequence Call step. There is not a good reason to use this method of starting a new execution from within a sequence; however, it is necessary to use this method when you start a new execution from within a code module or from within the code of your operator interface. Whenever you pass arguments using the NewExecution method, you must package the parameters and subproperties within a container. The subproperties must be of the same type and be in the same order as those in the called sequence. This packaging occurs in last three implementations that follow.
There are the following four different ways to pass parameters to a new execution included in this example:
- NewExecutionWithSeqCall.seq -- A new execution is started from within the sequence using a Sequence Call step. This is the easiest means of starting a new execution and passing it parameters; however, this implementation is not available in TestStand 1.0.
- NewExecutionWithTSAPI.seq -- A new execution is started from within the sequence using the NewExecution method, which is called using an ActiveX Automation Adapter step.
- SimpleCVIOperatorInterfacePassingArguments -- A modified version of the simple LabWindows/CVI Operator Interface that passes arguments to the MainSequence of the CalledSequence.seq file, which is executed using the NewExecution method. A new function, CreateSequenceParamPropObj, was added to the operator interface code. This function creates the object containing the parameters, which is then passed to the NewExecution method. For this to work correctly, load the CalledSequence.seq file.
- SimpleLVOperatorInterfacePassingArguments -- Modified components of the simple LabVIEW Operator Interface pass arguments to the CalledSequence.seq file, which is executed using the NewExecution method. Rather than include the entire Simple LabVIEW Operator Interface in this example, you should replace the vi,
NOTE: When you load TestStand - Start Execution.vi it may not find the subVI TestStand - Close Report Reference.vi. This subVI is
Requirements
Filename: passargstonewexecution.zip
Software Requirements
Application Software: NI TestStand Development System 2.0, LabWindows/CVI Full Development System 5.0.1, LabVIEW Full Development System 5.1
Language(s): LabVIEW, C
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
