NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a Sequence Context to a RunVIAsynchronously Test Step - Is this possible?

Config:

Windows XP SP2
TestStand 3.5
LabVIEW 7.1.1
NI-VISA 3.4.1

Background:

I'm using a LabVIEW Utility Step type, Run VI Asynchronously to run a VI which contains a LabVIEW System Exec command. The System Exec VI launches an SSH session to a Linux server using Putty's Plink command line interface. My TS sequence also lauches a client-side SSH session once the server is running.

The System Exec VI in both server and client cases is configured not to "wait until completion" - I'm watching two linux processes run concurrently and hence I don't know when the server-side test will complete.

The Problem(!):

1) I'd like to change the Plink command-line for each iterations of the test sequence. I have an array containing the  Plink command-lines. How can I pass an element of this array to a RunVIAsynchronously test step? I'm more familiar with the old Sequence Context method of passing handles, rather than the new TS 3.x method. How  is this achieved with RunVIAsynchronously test steps or does this just not make sense in the use case for this step?

2) If I wanted to terminate the RunVIAsynchronously test step thread, what is the cleanest way to do this.

Any asssistance greatly appreciated - I'm somewhat TestStand rusty, as I cut my teeth on 1.x

Regards,
ChromaBurst3671






0 Kudos
Message 1 of 7
(3,761 Views)

Hey ChromaBurst3671,

 

To answer your first question, it is possible to do.  It is much easier to pass parameters with TestStand 3.x. Now you can just connect controls and indicators to the connector pane of your VI, and load this VI into TestStand.  Within the specify module window it will have all the inputs and outputs from your VIs, and you can just tell which variables or values you want to pass in.  It is still possible to use the older method by passing in the sequence context as well although this is a little more cumbersome than the newer method.

To answer your second question, unfortunately there isn't really a way to terminate the RunVIAsynchronously test step thread from TestStand.  However, there is another method to get the same kind of behavior and still terminate the thread.  It is possible to use the sequence call step and specify a new execution for this sequence. In your case since you are just running a single VI, you wouldn't want to use a process model.  Once you have created this new execution you have a reference to that execution that you can use to call the terminate method.  One thing you will want to do in your LabVIEW VI is monitor the state of execution to stop the VI if the execution is terminated.  There are built in TestStand VIs that do this for you.  I have written a small example that demonstrates all of these concepts. 

The example calls a sequencefile that loads a VI.  The VI displays a message popup whose message value is passed in from the top level sequence (mainsequence). I created a string array and increment through the message array based off of the UUTLoopIndex property that comes from the process model (assuming sequential process model here). This directly corresponds to the number of times the TestUUT loop has been executed. Let me know if you have any questions regarding the example.

Thanks,

Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,727 Views)
Thanks Pat for your response!

I'm familiar with wiring parameters into and out of the LabVIEW "Edit LabVIEW VI Call" dialogue in TestStand. What I don't understand, is when you introduce a new Run VI Asynchronously test step, no "Specify Module" options is presented when I right-click on the step. Hence , how can one use the method you suggest to pass a sequence context?

All I want to do is pass a string variable to the step. I understand the code you supplied, but does this not defeat the propose of the Run VI Asynchronously "custom" test step, if you have to create a seperate sequence to get a seq context handle?

-Chroma3671
0 Kudos
Message 3 of 7
(3,722 Views)
Hey Chroma3671,

Sorry about that I may have misunderstood the question a little.  It should still be possible to pass in the sequence context with the Run VI Asynch.  When you click to specify the VI (little labview button next to specified VI) inside the configuration window for the Run VI Asynch, it should bring up a window that looks exactly like the specify module window for a LV adapter step type.  If this doesn't pop up let me know because there could be other problems that are occurring.

The main reason I posted the example that I did is because passing the sequence context is pretty easy to do with the Run VI Asynch, but terminating the thread is a little more tricky.  After thinking about it a little more another possible solution that I believe is a little easier than my original solution is to just check a Local variable within your TestStand sequence.  For example if you pass the sequence context into the VI, have a local boolean variable in TestStand called stop VI.  You could poll this variable from within your LabVIEW VI and if it ever gets set to true quit the VI.  Another possible solution would be to create a LabVIEW global, and when you want to stop the VI call a VI that sets this global to true or some known value telling the original VI to exit.  Hope this helps to clear things up a little.
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 4 of 7
(3,717 Views)
See attached snapshot - no specify module is present.....

-Chroma3671
0 Kudos
Message 5 of 7
(3,713 Views)
Hey Chroma,

You need to right click on the step and go to Configure Run VI Asynch.  Then in that dialog window there is a specify LabVIEW VI button.  This should open a dialog that looks similar to the specify module window for a regular LabVIEW step.  I have included a screenshot below to hopefully help clear things up.

Message Edited by Patrick P. on 06-09-2006 11:46 AM

Pat P.
Software Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,700 Views)
Hmmm, I see now.

And nope,  I'm not going to whinge about why this GUI metaphor doesn't work - given that it's next to a VI path control. Nope not one bit!

Thanks for your help Pat.... and yeap, I'm rusty!

Regards,
Chroma3671
0 Kudos
Message 7 of 7
(3,687 Views)