NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Post Expression "If" statement

Im working with TS 4.0
 
Im trying to set a flag in a numeric limit test.  So basically, if the numeric test fails, in the post expression, id like to set local.flag=1.
 
How do i do this?
 
thanks all!
0 Kudos
Message 1 of 5
(17,984 Views)
if (Step.Result.Status == "Fail")
Local.flag = 1
 
 
TestStand 3.1
********************************
*The best Chinese farmer*
********************************
0 Kudos
Message 2 of 5
(17,980 Views)

Hi,

There's two things wrong with this.

1. Its "Failed"

2. Step.Result.Status will not have been evaluated yet. The Status gets evaluated after the Post Expression. Therefore your flag will not have changed value.

You would have to use one of the Callbacks such as PostResultListEntry.

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 3 of 5
(17,973 Views)

In the example above, is it necessary to put "if (Step.Result.Status == "Fail")" and "Local.flag = 1" on separate lines, or can they be strung together on one line like:

 

if (Step.Result.Status == "Failed") Local.flag = 1

 

 

 

 

 

 

 

 

 

No trees were harmed in making this post. However, several electrons were moderately inconvenienced.

No trees were harmed in making this post. However, several electrons were moderately inconvenienced.
0 Kudos
Message 4 of 5
(16,936 Views)
0 Kudos
Message 5 of 5
(16,929 Views)