ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Steps parameters default value permanently

Using the following expression in a statement Step:

RunState.SequenceFile.Data.FileGlobalDefaults.mynum = 7,
RunState.SequenceFile.ChangeCount++

I am able to change the default value of a FileGlobal variable during sequence execution so I can retain it by saving the sequence file afterwards.

I would like to do the same for Steps parameters.

 

In a custom StepType coded in LabVIEW I can set Step parameters with the TS API:

RafTecnora_0-1761119913357.png

Is it possible to do the same with a Step pre or post expression?

 

For instance, when I set the following post-expression in a PopUp step:

ThisContext.AsPropertyObject.SetValString("step.TitleExpr",1,"\"MyTitle\""),
RunState.SequenceFile.ChangeCount++

the parameter value changes at runtime, but when sequence ends the new value is not retained.

 

Thanks for reading

 

Raffaello

0 Kudos
Message 1 of 2
(182 Views)

I assume that "TitleExpr" is a custom property that you added to a step type

 

When TestStand runs a sequence it creates a run-time copy of a sequence so that changes to steps and most of their step properties (built-in and custom) do NOT affect the edit-time copy of the sequence in the sequence file in memory. This allows a sequence to be run in multiple executions or threads without stomping on each other. The one exception to run-time copies of built-in step properties is "TS" property, which is shared between the edit-time copy and any run-time copies, so any changes to RunState.Step.TS will affect the file in memory. This is not copied to conserve memory. You can only access the edit-time copy of a step using the context and this type of lookup path:
    "RunState.SequenceFile.Data.Seq["MainSequence"].Main["YourStepNameOrIndex"]..."

 

Here is a topic that lightly touches on what is copied at run-time: https://www.ni.com/docs/en-US/bundle/teststand/page/executions.html 


Hope that helps.

Scott Richardson
https://testeract.com
Message 2 of 2
(149 Views)