NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ConnectCommand for running a sequence using single pass

I'm looking at the TestStand 2017 Operator Interface examples, specifically the C# version (i.e. Program Files (x86)\National Instruments\TestStand 2017\UserInterfaces\Simple\CSharp). The example shows command buttons setup for "Test UUTs", "Single Pass" and "Run <selected sequence>". How would I go about setting up a ConnectCommand to "Run <selected sequence> using Single Pass" ?
I'm not seeing an obvious way to implement that. 

 

Thanks,

Michael

0 Kudos
Message 1 of 11
(1,310 Views)

Running a client sequence file using an entry point (single pass / test uuts ) of a NI process model (sequential/parallel batch) always run MainSequence of the client sequence file.


Run <selected sequence> does not invoke any process model.

0 Kudos
Message 2 of 11
(1,278 Views)

Yes, I understand that's the way the example is currently set up.

 

My question is, how do I change the logic so that the "Run <selected sequence>" button uses the Single Pass process model? That ability is available in the standard TestStand sequence editor menu, so I assume there must be a way to implement that functionality in the example. My MainSequence has a number of subsequences, and I'd like the selected subsequence to be run in Single Pass.

0 Kudos
Message 3 of 11
(1,255 Views)

@mostrowski wrote:

Yes, I understand that's the way the example is currently set up.

 

My question is, how do I change the logic so that the "Run <selected sequence>" button uses the Single Pass process model? That ability is available in the standard TestStand sequence editor menu, so I assume there must be a way to implement that functionality in the example. My MainSequence has a number of subsequences, and I'd like the selected subsequence to be run in Single Pass.


Also in SeqEdit, Run <selected sequence> never uses an entry point (like Single Pass) to a process model.

0 Kudos
Message 4 of 11
(1,236 Views)

I believe the only way to do this is to ConnectCommand to Run Selected Steps using > Single Pass

 

eejallen_0-1699894893109.png

 

  • CommandKind_RunSelectedStepsUsingEntryPoints_Set–(Value: 143) Specifies a set of CommandKind_RunEntryPointOnSelectedSteps commands that contains a command to run the selected steps with each applicable Execution entry point.
0 Kudos
Message 5 of 11
(1,218 Views)

I have to partly rectify what I have written:

 

using the TestStand API directly, you can start start a new execution using an EntryPoint for an arbitrary Sequence 

 

Oli_Wachno_0-1699950420800.png

 

0 Kudos
Message 6 of 11
(1,201 Views)

Thanks ee-jallen, using the CommandKind_RunSelectedStepsUsingEntryPoints_Set command seems to work, but only if steps of the selected subsequence are also selected. Unfortunately selecting a subsequence in the Simple OI Example doesn't also automatically select all the subsequence's steps, so I'm now trying to figure out how to make that happen. Steps are not displayed in the Simple OI Example, and I wouldn't want them to be, so I need to somehow programmatically select all the subsequence's steps. (I temporarily added a steps UI, manually selected steps, and the subsequence could then be run using CommandKind_RunSelectedStepsUsingEntryPoints_Set)

0 Kudos
Message 7 of 11
(1,186 Views)

If a Sequence Call step is selected and Run Selected Step using Single Pass, the sequence is executed, and all of its steps will run.  I use the Full Feature Custom UI, so I'm not sure why you don't get the same with the Simple UI

0 Kudos
Message 8 of 11
(1,174 Views)

Yes, I agree the default Simple OI functionality seems to differ a bit. 

 

When I'm using the TestStand Sequence Editor to execute a subsequence using Single Pass, it's steps are automatically selected. Also, the MainSequence 'Setup' and 'Cleanup' groups are run. When using the Simple OI to execute a subsequence using Single Pass the steps are not automatically selected, and the MainSequence 'Setup' and 'Cleanup' are not run. Yet the Single Pass report is still generated.

 

0 Kudos
Message 9 of 11
(1,170 Views)

The Setup and Cleanup are being executed if you run via the Process Model (Single Pass).  They are not being displayed because in the Simple OI example  has turned it off or if tracing is turned off or tracing is fast then you'll likely not see it as it flashes on the screen.

 

eejallen_0-1699985490653.png

 

To easily prove this; set the StepGroupModes view settings of the View Managers to show all groups.

Are you using C# example.  Put these before axApplicationMgr.Start();

 

 

// show all step groups at once in the execution sequence view
axExecutionViewMgr.StepGroupMode = StepGroupModes.StepGroupMode_AllGroups;
// show all step groups at once in the file sequence view
axSequenceFileViewMgr.StepGroupMode = StepGroupModes.StepGroupMode_AllGroups;

axApplicationMgr.Start();	// start up the TestStand User Interface Components. this also logs in the user

 

Also, you can force the single view to switch back and forth while idle and running by adding this at the beginning of MainForm_Load(...) with:

 

axApplicationMgr.StartExecution += AxApplicationMgr_StartExecution;
axApplicationMgr.EndExecution += AxApplicationMgr_EndExecution;

 

and then the event handlers look like this:

 

private void AxApplicationMgr_EndExecution(object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_EndExecutionEvent e)
{
    axSequenceFileViewMgr.ConnectSequenceView(axSequenceView);
}

private void AxApplicationMgr_StartExecution(object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_StartExecutionEvent e)
{
    axExecutionViewMgr.ConnectExecutionView(axSequenceView, ExecutionViewOptions.ExecutionViewConnection_NoOptions);
}

Please also note, that the default behavior for the Sequential Single Pass entry point is that the UUT serial number prompt will not be displayed.

 

0 Kudos
Message 10 of 11
(1,155 Views)