NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Expression

Hi,

 

I have this sequence file in which, for customizing the report, a number (the index of the paragraph) is passed by reference as parameter between the called sequence and the caller one.

 

In the Called Sequence I have a statement step to control when to increase this index:

StationGlobals.Debug ? Nothing : (Locals.TempIDX +=1)

 

The issue is: on the first call everything seems fine, TempIDX stays zero after the step; on the second call of the Called Sequence when the statement step is performed I found that TempIDX is increased even if the Boolean Debug is still True.

What am I missing?

 

Thank you for the help!

Best Regards,

Zuc

 

0 Kudos
Message 1 of 5
(251 Views)

Are you using multi-thrading? 

Global Variables are prone to RaceConditons

 

0 Kudos
Message 2 of 5
(223 Views)

Hi  Oli_Wachno,

 

i hoped it was something like that, but no. Always only one thread. Since the called sequence (the o ne wit the expression) is inside a for each in the caller, it seems that at the second loop the expression is executed without evaluation.

 

TestStand version 2022

 

Best Regards,

Zuc

 

 

0 Kudos
Message 3 of 5
(214 Views)

I tried this in TS2019 and did not see a problem.  I can try TS2021 and TS2025 tomorrow.

0 Kudos
Message 4 of 5
(134 Views)

Hi ee-jallen,

 

sorry my mistake i havne not updated the issue!  there is no problem in the expression it was  multiple nested call in the sequence that created the problem!

 

Thank you for the patience and the help!

 

Best Regards,

Zuc

 

0 Kudos
Message 5 of 5
(68 Views)