NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to allow user to select a sequence

The RUN_SEQUENCE control on the simple OI comes very close to what I want to do, and I'm trying to come up with the best way to optimize it.

 

What it does is allow the selection of any sequence in the current sequence file.

 

My current sequence file includes some sequences that 1) should always be run, or 2) should only be run when called by other sequences that pass the proper parameters, or 3) are callbacks. Those are sequences I don't want those to be "selectable" to be run independently.

 

Here is what I want to do:

  1. limit the selection of sequences to only the major test steps testing one component, such as "test speaker" or "test pumps".
  2. force the execution to perform the same setup as for "Run UUTs" so that the required connection with the UUT gets established.
  3. report that this was a troubleshooting test, not a valid production test.

So basically I want to allow the operator to either "Run UUTs" in production mode, or "Run UUTs" for one UUT and one component (assuming that there is some problem with that UUT and we want to verify that the rework on it actually fixed the problem before running it through the entire test again).

 

It seems like the most straightforward way would be to hide the sequences that aren't "major test steps". How would I do that, and if that meant a separate file, how would that affect my fileglobals that I use to load custom types? 

 

Is there some way other than hiding the sequences, such as marking some "selectable"?

Message 1 of 5
(3,481 Views)

Hi Gizmogal,

 

One way to accomplish what you would like to do is to pragmatically create a new sequence file with the steps that had the status of failed. You could use the engine callback SequencefilePoststepfailure to copy all of the failed steps in the new file. You should also be able to copy any file globals that you need into the new file. I hope that this helps.

 

Regards,

 

Perry S.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,438 Views)

Hm, I'm not sure how that addresses my problem... I am not talking about failed steps here, but limiting the number of selections the operator can make prior to testing.

0 Kudos
Message 3 of 5
(3,390 Views)

You could try testing the selected step and see if exceeds a set number of steps, such as

 

Locals.size=RunState.InitialSelection.SelectedSteps.GetNumElements()

 

 

Regards
Ray Farmer
0 Kudos
Message 4 of 5
(3,385 Views)

I may not have explained myself well here.

 

I want to only allow the operator to select sequences that are set up to be able to run independently. I don't want the callbacks and initialization sequences to show up in the list the operator can choose from.

 

The way I figured out how to do it is a little tricky, and I think I may have found a bug.

This is what I did:

For the sequences I do not want to be selectable, I setPropFlags_Hidden to true. (Sequence Properties...Advanced...Flags, check the box).

This immediately hides the sequence. In order to see all hidden sequences to edit them, set Configure->Station Options...Preferences->Show Hidden Properties.

I wanted to set this up automatically for the sequence file, so I added a SequenceFileLoad callback to set ThisContext.RunState.Engine.StationOptions.ShowHiddenProperties = False, and a SequenceFileUnload callback to set it back to true.

The bug I think I found:

This solution works when I open the sequence file in the editor, but not when I use the simple operator interface. The simple operator interface will show the hidden sequences, but only the unhidden sequences show up in the RUN_SEQUENCE control. If I make sure the station is configured not to show hidden properties BEFORE I run the simple operator interface, then the hidden sequences are indeed hidden in the Sequences list (except, because I hid MainSequence, the first list entry shows up blank until I select one of the unhidden sequences).

 

(see also

http://forums.ni.com/t5/NI-TestStand/Ignore-a-Sequence-in-a-SequenceCall/m-p/1754984/highlight/false...)

 

 

0 Kudos
Message 5 of 5
(3,355 Views)