NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Add variables automatically to Sequence files from Templates

Hi,

 

I have some steps and corresponding variables added to Templates of insertion palette. Each of these steps are pre-configured with the parameter values with numbers, strings, bool values and also variables (which are added to Templates). On adding this step from templates to any sequence file, the parameter values for variables will appear in red indicating the variables do not exist in the current sequence context.

 

The question is, Is there a way by which the variables can be automatically added to the sequence file when the step is added from Templates?

 

Any help and advice would be greatly appreciated.

 

Software: TestStand versions used 4.0, 4.0.1, 4.1

 

Thanks

Mrm

0 Kudos
Message 1 of 4
(3,391 Views)

If you make the step a custom step type, you could add an OnNewStep substep that inserts whatever you want. This is how the flow control steps automatically insert their matching end steps. Without a custom step type, I can't think of an event you could hook into. I supposed you could install an SDK timer in the UI thread that polls for changecount modifications in all open files, but that would be an awkward unsupported hack.

Message Edited by James Grey on 04-02-2009 09:44 AM
0 Kudos
Message 2 of 4
(3,387 Views)

Hi James,

 

Each step added in template is different, in terms of functions called but to the same DLL, can custom step be created in such cases, i have steps of the order of few hundreds.

 

I'm having few more questions with this approach being followed to add the variables 

  1. Is it possible to get the reference of variable and containers added to templates?
  2. Is cloning the variables of Templates option available, just like cloning steps in sequence files? If so how?
  3. Can the Templates be programmatically accessed? (From C#)

Thanks for the new approach suggested, OnNewStep was new to me.

 

Regards

Mrm

 

Message Edited by Mrm on 04-03-2009 07:13 AM
0 Kudos
Message 3 of 4
(3,367 Views)

The templates are accessed by Engine.GetTemplatesFile().Data.

 

The templates are just a hierarchy o PropertyObjects, so PropertyObject.Clone should work.

 

 

0 Kudos
Message 4 of 4
(3,362 Views)