From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Post-Expression

Solved!
Go to solution

I load my limits from a text file using property loader. It updates an array in FileGlobals.

All my tests have limits defined like this (using Limits Tab):

(1)

Low   FileGlobals.GF_TestSpec.step_0101.LimitLo

High  FileGlobals.GF_TestSpec.step_0101.LimitHi

 

I am using the following post-expression (index expression is simplified for this example):

(2)

FileGlobals.Results[0].LL[index]= Str(Step.Limits.Low),

FileGlobals.Results[0].HL[index]= Str(Step.Limits.High)

 

The first ttime it runs my limits are 0,0, the second time and third etc.. they are correct (27-32) as in the text file.

I am assuming the assignment (1) does not take place until actual status expression is evaluated and post-expression is executed before that. Any ideas how to fix this? It is a 300+ tests sequence, already in production. Remote access is my only option so I would not want to rewrite it.

Thanks

CT

0 Kudos
Message 1 of 3
(2,993 Views)
Solution
Accepted by topic author Cimteker

You could change your post expression to also evaluate the expressions. Something like the following:

 

FileGlobals.Results[0].LL[index]= Str(Evaluate(Step.Limits.LowExpr)),

FileGlobals.Results[0].HL[index]= Str(Evaluate(Step.Limits.HighExpr))

 

This will be ok as long as there is no side effects from evaluating your expressions twice. If they are just specifying variables it should be ok.

 

Another idea is to load limits directly into the steps rather than in file globals and not specify the limits by expression, rather, let the properly loaded load their values.


Hope this helps,

-Doug

Message 2 of 3
(2,978 Views)

Hi Doug,

 

That is brilliant!. It was a long shot, I did not expect anybody to analyze my cumbersome example. Thanks a lot for your help.

 

0 Kudos
Message 3 of 3
(2,967 Views)