NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Operator not working in the "Post-Expression"

Solved!
Go to solution

TestStand 2014 

 

I am using the Post-Expression to update an Array with a  Conditional Operator and somehow the array is not updating , the array doesn't change .  

Example : 

RunState.Sequence.Main["Read Current"].Result.Status == "Failed" ? FileGlobals.uut_Settings.UUTShort[0] = False : True    

 

Any recommendation ?

 

Thanks,

0 Kudos
Message 1 of 5
(3,359 Views)

I think you may have your assignment, condition and first return value mixed up;  try this:

 

FileGlobals.uut_Settings.UUTShort[0] = RunState.Sequence.Main["Read Current"].Result.Status == "Failed" ? False : True

I hope this helps,

 

Charlie

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 2 of 5
(3,356 Views)

Thanks , I will try it .

In Teststand 2012 I did not have this issue , do you know why ?  . 

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

Hi  Charlie 

I try your suggested sequence and it still not working , it's always change the Array to "True" even if the sequence "Failed" .   

The default array elements are  False .  

 

Any suggestion ? 

 

Thanks

Benny 

 

0 Kudos
Message 4 of 5
(3,292 Views)
Solution
Accepted by topic author bennyk@riscogroup.com

Hi 

I Try it in "Post Actions" section using "Custom Condition" and it is working fine . 

 image.png

In "Post-Expression" section it is not working as expected . 

 

Thanks

Benny   

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