NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

If is possible to add new local var to sequence from the outside?

If is possible to add new local var to sequence from the outside?
I mean insert a new local variable to Sequence.Locals list or via expression, or by LabView VI (Sequence Context). or any another way.
Thanks.
0 Kudos
Message 1 of 4
(2,937 Views)

Hi,

The simplest way would be to use the API TS method PropertyObject.SetValBoolean, PropertyObject.SetValNumber or PropertyObject.Set ValString. With the SequenceContext you create a PropertyObject using the method SequenceContext.AsPropertyObject, which you use as the reference for the the SetVal method.

For the SetVal method, pass the full lookup string of your variable eg "Locals.MyString" and set the option parameter to 0x01 (insert if missing).

If you are calling this from LabVIEW, then use the SetVal property VI.

This will insert a varable into the Locals that is "in scope" of the step that is performing the task. 

In the TestStand Help - "Using the API in Different Programming Languages" and in the TestStand User manuals there is more information to help you.

This will only make a runtime version of your Local. ie when your sequencefile stop executing your Local will not exist in the Static version of the Sequence File.

 

Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 4
(2,938 Views)

Hi,

I have attached a small example TS3.0 sequencefile and LV7.1 VI.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
Message 3 of 4
(2,930 Views)
there is another way to insert variables into your sequence outside of the runstate version.  If you get the engine handle from the sequence context then select your sequence context again from the engine handle you will get the version of the sequence that the engine has, not the one in runstate.  I did this a while back and will try to post how I did it.
0 Kudos
Message 4 of 4
(2,903 Views)