NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

P/F Test Step Post Expression Issue

I have a Pass/Fail test step in my sequence.  In the Post Expression of the step I want to assign a FileGlobal boolean variable with the step result.

 

In the Post Expression I have the following statement:

testdesign_0-1712947471997.png

In the step passes, the post expression does not set the FileGlobals.TestPassed boolean = True.  Why is that not the case?  How do I resolve this issue? Thanks!

0 Kudos
Message 1 of 6
(179 Views)

What does the data source expression for this test look like?

0 Kudos
Message 2 of 6
(112 Views)

Hi Oli, the data expression looks like this:

 

(#NoValidation(Locals.PartNumber) == (Locals.ScannedPartNumber))

 

I guess I could use in the Post Expression the same expression to set the test passed boolean.  I figured I could use Step.Result.PassFail since the statement FileGlobals.TestPassed = Step.Result.PassFail is in the Post Expression of the step.  However, the test passed variable never changes.  Very confused by this.

0 Kudos
Message 3 of 6
(104 Views)

Your test is a "None Adapter" step; put this in your post expression, and you should get what you want:

 

#NoValidation,
FileGlobals.TestPassed = Step.Result.PassFail = (Locals.PartNumber == Locals.ScannedPartNumber)

 

 

 

0 Kudos
Message 4 of 6
(96 Views)

Its a "None" adapter step but it is a "None" adapter Pass/Fail test step.  Since my "data source" experssion statement is 

(Locals.PartNumber == Locals.ScannedPartNumber)

I'd assume the step would then update the Step.Result.PassFail boolean = True.  However, when I put in the post expression

FileGlobals.TestPassed = Step.Result.PassFail

TestPassed always stays false.

0 Kudos
Message 5 of 6
(72 Views)

Change your Data Source to 

Step.Result.PassFail = (Locals.PartNumber == Locals.ScannedPartNumber)
0 Kudos
Message 6 of 6
(60 Views)