NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Parameters From LabVIEW to TS Execution

I have a simple question: I am using a LV OI to launch a TS Sequence via the API.

(OK, actually I want to have 10 different OI screens that are each launching unique executions of the same Sequence)

I want to pass some relevant data to the new execution.

(as in, "Which OI created me?")

 

What is the simplest/best way to do this?

 

Currently, the way that I see to do it is to tell it to pause on first step, get the SeqContext from the Execution, and either write to Station Globals or write to Client Sequence Locals or something.

 

It seems like it should be easier. Like I should be able to access the StationGlobals before I launch the new execution. Or pass the parameter(s) directly during the New Execution method

 

I see "SequenceArgsParam" as an input to the New Execution method, but this is what the help says: "Pass a PropertyObject object that contains the arguments to the sequence you want to execute. Each subproperty of the PropertyObject object represents a parameter to the sequence. The subproperties must appear in the same order as the sequence parameters." That doesn't sound simple. Plus, most of the references to it in the documentation tell you not to use it.

 

I'm a LabVIEW guy. I want to push a cluster into a variant and have it work. Kindof like getting data into/out of a step module.

 

There's probably a way to do it that I am missing, but I am pretty rusty, on the new version learning curve, and honestly I am having problems finding anything helpful in the documentation. Can anyone help me out here? Thanks.

0 Kudos
Message 1 of 6
(3,179 Views)

Hello,

 

You mentioned "10 different OI screens", are you completely opening 10 different UI's (as in 10 different instances of the engine)?

 

I think that the easiest way to do this is going to be to get the name of the VI or executable using LabVIEW then store that as a local. Each execution will have it's own instance of the local so you can use that in the sequence you want to run.

 

That being said, I am curious exactly why you are doing this, what is your overall purpose? What is this application meant to do? There might be an easier way to achieve your goal.

With warm regards,

David D.
0 Kudos
Message 2 of 6
(3,163 Views)

I think that the easiest way to do this is going to be to get the name of the VI or executable using LabVIEW then store that as a local. Each execution will have it's own instance of the local so you can use that in the sequence you want to run.


Can you please explain/show exactly how you suggest this can be done?

Are you talking about the process model's locals or the client sequence's local?

How can you pass it to the execution before you start the execution (or do you have to pause it on the first step)?

 

To clarify what I am doing, I have 1 LabVIEW program that instantiates the TestStand engine once. I am controlling tests on multiple test cells (e.g., 10) Each test cell has a dynamically-cloned UI. All of them are using the same exact sequence. I want the cells controlled independently from thier respective UIs. When I start an execution, I want to tell the execution which cell is launching it so that it knows which set of hardware/channels/parameters to use in the execution.

 

 

0 Kudos
Message 3 of 6
(3,152 Views)

I do something similar to this effect except I use different boards. I use UI messages in TS to communicate to LV. There are some good examples of UI messages. the way that I do it is...

 

  1. At the start of my VI I write the data to a LV2 style global..
  2. Then TS will fire off and ask for the data.
  3. Inside my UI message handler I read the global and place it in the correct variable inside TS.
  4. TS then reads the variable.

I can explain better when I have TS in front of me (I am at home). Then I can give you some examples to look at.

 

 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 6
(3,140 Views)

I'll be looking forward to seeing it; I like the concept.

The questions that immediately jump to mind:

 

* Where are the messages from TS handled and how does TS know WHICH data to request (i.e., which cell's data?)

* How do you "place the correct variable inside of TS"?

* If TS is executing, then it's paused bacuase it's waiting for the UI message to be handled, right?

 

Thanks. Looking forward to seeing how you're doing it.

Message Edited by 10Things on 09-29-2008 09:22 PM
0 Kudos
Message 5 of 6
(3,137 Views)

10Things wrote:

I'll be looking forward to seeing it; I like the concept.

The questions that immediately jump to mind:

 

* Where are the messages from TS handled and how does TS know WHICH data to request (i.e., which cell's data?)

* How do you "place the correct variable inside of TS"?

* If TS is executing, then it's paused bacuase it's waiting for the UI message to be handled, right?

 

Thanks. Looking forward to seeing how you're doing it.

Message Edited by 10Things on 09-29-2008 09:22 PM

 

Here is a document about UI messages.  There is also some good

This is the path to a good example for accessing variables.  TestStand 4.0\Examples\AccessingPropertiesUsingAPI\UsingLabVIEW.

 

I will try to throw together a short example for using UI messages in LV. Got to go to a meeting now so it will be a couple of hours. this should keep you busy until then.

 

 

 

 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 6 of 6
(3,123 Views)