NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

List possible sequences

How would I go about creating a list of possible sequences (tests)?  I will have a 2 level directory (test heading is one level with specific tests under it) and each directory should only have one sequence.  I would like to programmatically go through this directory tree and display the sequences as possible tests.  I would then like to have them all be selected and have the user de-select anything that they don't want tested.  It should then run all of the selected sequences.
 
I am pretty good with LabVIEW and know how to load the tree and make the selections, what I am not sure about is how to then load and run the selected sequences.  Any ideas?
 
Thanks,
Bob Young
 
0 Kudos
Message 1 of 16
(6,106 Views)

Hello Bob,

 

Once you have a path to a sequence file, you can use the TestStand API to load the sequence file and execute a sequence in that file. If you are new to using the TestStand API, I recommend referring to the TestStand API Reference Help in the TestStand Help and specifically to the “Using TestStand API Objects” help topic. The methods you will use to load and execute a sequence are:

 

Engine.GetSequenceFileEx to load the sequence file;

Engine.NewExecution to execute a sequence in the loaded sequence file; and

Engine.ReleaseSequenceFileEx to unload the sequence file once the execution is complete.

 

You will want to refer to the corresponding help topics for details on the expected parameters for these methods.

 

You can invoke methods of the TestStand Engine from within your LabVIEW VI using invoke nodes. To get a reference to the TestStand Engine in your VI, there are a couple of options. If the VI you are using is being called from TestStand, you can pass the SequenceContext to the VI and use a property node to get a reference to the Engine from the SequenceContext. If the VI is running on its own, you can use an Automation Refnum and Automation Open to open a reference to the TestStand Engine. If you use Automation Open, be sure to use Close Reference to close the reference to the Engine after invoking the ReleaseSequenceFileEx method.

 

Regards,

 

Eric

Message 2 of 16
(6,081 Views)

Eric,

Thanks.  That is exactly what I was looking for.  I have lots of experience with LabVIEW but only a little experience with TestStand.  I have created lots of sequences but I haven't gone any deeper than that so far.  This will be a good chance to delve into the API. 

Thanks again for showing me the right direction.

Bob Young

 

0 Kudos
Message 3 of 16
(6,072 Views)

You are welcome! This does sound like a good opportunity to dive into the TestStand API. Once you begin to get familiar with it, I think you will be pleased at the power you have when using the API.

I am glad I could help.

Regards,

Eric

0 Kudos
Message 4 of 16
(6,061 Views)

Hi Bob (and Eric),

I am having more or less the same necessity posted by you Bob but unfortunately, I am new to labview and teststand. So, if you may post some examples extracted from your application where I can pull out knowledge to solve this matter I will be grateful with you.

Thanks

JLM

0 Kudos
Message 5 of 16
(5,812 Views)
Hey JLM,

I have written you a small example in LabVIEW that might help you get started.  The example looks at a given directory on your computer and executes all sequence files inside of it (not including subdirectories).  Modify the example as your needs see fit, but hopefully this will get you started.

Note that in this example, no process model is used for execution (simply runs the sequence).
Thanks,

Andy McRorie
NI R&D
Message 6 of 16
(5,783 Views)
Hi Andy,
do you know? Your example has already given me a lot of implementation solutions that I am wotking on right now.
 
Thanks a lot.
 
Andy, just one more question. How may I select the directory immediatelly after I give the password? Let me explain better. I used your example to load into a combo all sequences from one directory but it happens before I give the password. What I would like to do is to give before the "login" (user and password) and then allow the user to select (by clicking buttons) the directory from which to load al sequences.
 
JLM
0 Kudos
Message 7 of 16
(5,755 Views)
Hey Jose Luis,

First of all, I forgot to give a disclaimer on the previous example.  In the example, I directly open an Engine reference which probably would not be the best architecture if creating an application entirely from LabVIEW (that is, without sending the engine in as a parameter).  The Application Manager control is intended to take care of additional configurations that are sometimes necessary with regards to opening an engine and closing it.  The loop in the example would be pretty much the same; the way that the example creates/closes the engine could be better done with the Application Manager.  For examples of using the App Manager, please refer to the operator interfaces that ship with TestStand (<TestStand>\OperatorInterfaces\NI\Simple\LabVIEW).

In answer to your follow-up question, I need a little bit of clarification.  Are you talking about TestStand's login/logout procedure?  Which password are you referring to?
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 8 of 16
(5,738 Views)

Hi Andy,

don't worry about your example, I've just took what was useful for me from that. In fact I am using an Operator Interface, the LV simple OI one. When I open it, it requires the Login&Password (needed in my application) and then, I would like to allow the user to select from which directory (dir_00 or dir_01 or dir_02, etc.) he has to work running the test sequences. In the attached vi, I would use (if possible) the slider to select the dir to work on.

 

Thanks

 

JLM

0 Kudos
Message 9 of 16
(5,734 Views)
Jose Luis,

I think getting into too much detail with the LabVIEW way of doing things here, this might be better asked on the LabVIEW forums.

That being said, it sounds like you want to add a slider control to your user interface with three values (representing three working directories) and use the selected directory to populate your sequence file list.

If this is the case, to my knowledge, a slider control can only be used to represent numeric values.  That being said, what you could do is have 0-2 as your scale (with the scale hidden) and use free labels to actually represent your different working directories.  If you want this control to respond to these change events during execution (that is, after the program has already started), then you would need to use an event structure to re-populate that combo box.  If you use a numeric slide, you can translate values into different working directories with case structures and possibly enumerated variables.

Again, I think you might get a more detailed or better ideas on the LabVIEW forums.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 10 of 16
(5,721 Views)