NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you make a Sequence Call return Done?

This is my first time using TestStand, so please forgive my ignorance. 
 
Whenever I use a "Sequence Call", TestStand automatically makes the Status Expression:
(Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status
 
Since the sequence I'm calling isn't a test, I want the call to return either Done/Errored (and not Passed/Failed).  However I can't edit or delete this automatically created expression.
 
It would seem to me that a common practice would be to have the following sequences in a generic test:
 
Seq 1) Open connection to device
  For loop
Seq 2) Device Test 1
Seq 3) Device Test 2
  end loop
Seq 4) Close connection to device
 
Rather than
 
Seq 1) Open connection to device, Device Test 1, Close connection to device
Seq 2) Open connection to device, Device Test 2, Close connection to device
 
Is calling a sequence that doesn't perform a test go against some TestStand programming philosophy?
If not how do I edit/delete the Sequence Call Status Expression?
 
My desired goal is to have a report that lists the test case along with a pass or failed result along with the measurement. Right now I have this huge report that states I have passed steps that aren't tests.  What am I doing wrong?
 
 
0 Kudos
Message 1 of 4
(4,495 Views)
For an operation as simple as opening or closing a device connection you might consider calling a code module directly using an Action step rather than calling a sequence. Also you might want to open the device connection in setup and close it in cleanup so that if you terminate your sequence or an error occurs, the device connection will still be closed (Cleanup is always run on error or terminate, though the rest of the steps in Main are skipped).

Example:

Setup:
Step 1) Call to code module to open connection to device

Main:
Step 1) For Loop
Step 2) Call sequence for testing device 1
Step 3) Call sequence for testing device 2
Step 4) End For Loop

Cleanup:
Step 1) Call to code module to close connection to device

That said to get the behavior you want, you can make an Action step that calls a sequence. Here's how to do this:

1) Open the adapter configuration dialog via the Configure->Adapters menu item.
2) Uncheck hidden for the sequence adapter.
3) select the sequence adapter as the current adapter then insert an Action step.

You now have an action step that calls a sequence. By default its status will be "Done" and errors will still propagate to it.

Hope this helps,
-Doug
0 Kudos
Message 2 of 4
(4,492 Views)

Hey thatguy,

You're not doing anything wrong, it's just the way Sequences are designed by default. If you want to just change the sequences that don't 'test' anything, you'll need to change the properties of the step from a Sequence to an "Action" type Sequence. In TestStand 4.0 you can do this easily by selecting the step, and in the Step Settings Properties tab, under the General Section, select the Type and change it to "Action". If you're using versions before 4.0 (> 2.0 at least), you can do the same thing by getting opening the properties dialog for the step and changing it there. Let me know if you're using v2 or earlier.

And your philosophy of having non-test steps not say Pass is a sound one. especially since that's all they can ever say other than Error if you're not manipulating a status flag or the RunState.SequenceFailed flag.

This will cause the sequence to return a "Done" status, and you can edit the Status Expression as well.

To add Action and Test Sequences, you just select the Sequence Adapter Type, and add Action or Test sequences just like any other step type (LabVIEW, ActiveX/COM, etc). Unfortunately, it is hidden by default. To enable it, go to Configure >> Adapters... and in the dialog unhide it.

Hope this helps.

-Jack

 

Message 3 of 4
(4,472 Views)
Setting my sequence calls to actions seems to solves my issue.
Thank you to all those that responded.
 
Message 4 of 4
(4,451 Views)