NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set expression from variable

Solved!
Go to solution

Hello,

i have a lot of teststeps that have all the same big preexpression.

How can i put this expression into a StationGlobal variable so that i i have to change only at one position and put the StationGlobal into the preexepression.

Thx

0 Kudos
Message 1 of 5
(4,002 Views)
Solution
Accepted by topic author OnlyOne

Hi,

 

could you provide a small example?

I suppose "Evaluate" will do the trick.

 

Regards

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 2 of 5
(3,994 Views)

Exactly.

Works perfect. Thx

0 Kudos
Message 3 of 5
(3,987 Views)

Hi again,

as already postet when putting the exepression in StationGlobal then i can reuse it with the Evaluate(StationGlobals.xyz).

So the function is correct and working.

 

Now i have another problem: I want to define this StationGlobal content with a statement at the beginning of my sequne

So something like StationGlobals.MyExpression =
 (Find(RunState.NextStep.Name," - ") < 0 ? RunState.NextStep.Name : Mid(RunState.NextStep.Name, Find(RunState.NextStep.Name," - ") + Len(" - ")))

 

The check icon says No error but when executing there is an error

 

The post-expression for the step 'Set RenameExpression' could not be evaluated.
Error in argument 1, 'RunState.NextStep.Name', in call to the expression function 'Find'.
Unknown variable or property name 'RunState.NextStep'.

 

Errorcode: -17306; Unknown variable or property name.

 

How can i write this text to my StationGlobal for later evaluating?

 

Thx

 

0 Kudos
Message 4 of 5
(3,714 Views)

Hi,

 

what about using a preexpression in sequence call?

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 5
(3,707 Views)