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: 

Inverting a output variable logic before post into Step.Result.Error.Ocurred  how to?

Dears, I'm having trouble to change the value of my boolean before log it on the  ExecutinFlag.png

 

In my output(ExecutionFlag), I use a different logic, where FALSE means not worked, and TRUE means worked.

So, I need help in matters to or change the teststand to a negative logic or change the variable before post it into the Step.Result.Error.Ocurred .

 

I have other methods to do this, creating a different statement, and after it send this value to the Error Ocurred, however, all the solutions I have are not convinient, for this reason I decided to post it here.

0 Kudos
Message 1 of 8
(1,432 Views)

In the post-step statement, invert your value.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(1,415 Views)

Dear Cross, I tried to it, however into the post action I cannot see my execution flag anymore. Do you have any advice that allows me so see the ExecutionFlag outside the out context? 

Also, I already tried to change the value of the Error Ocurred into the post action using the following expression:

Step.Result.Error.Occurred = !Step.Result.Error.Occurred, it didnt work.

0 Kudos
Message 3 of 8
(1,409 Views)

Please, someone help me ?

0 Kudos
Message 4 of 8
(1,324 Views)

No sure I understand what you want to do. Are you using Step.Result.Error.Occurred to force a FAIL in the step execution result? Or notify a FAIL in the execution of the code module?

0 Kudos
Message 5 of 8
(1,317 Views)

Dear Sps, the first one, I'm trying to force a FAIL using the Step.Result.Error.Occurred .

The only problem is because the logical of my library is TRUE when NOT FAIL and FALSE when FAIL. Exactly the opposite logic of the error.occurred, so I have two options, I can change my library logic, or send the boolean of my library in a inverted logic.

I would like to use the second option, but I'm not able to do it right now.

0 Kudos
Message 6 of 8
(1,311 Views)

You can do it using a local variable to support a post-expression execution. If you write directly in Step.Result.Error.Occurred it is going to trigger the default behavior of TestStand.

 

Put the output of the boolean value that represent the runtime error in a local variable (or any other variable you want to use as a support). In my case Locals.support_boolean

 

spsendia_0-1597935825015.png

 

In the Post-Expression of this step, put something like this:

 

spsendia_1-1597935888074.png

 

 

0 Kudos
Message 7 of 8
(1,307 Views)

Thanks a lot for you reply.

This solution we also had in mine, however, we would like to not do it, once it will take a lots to change it step by step, in this way we would prefer to change our logical status.

We would like to do it not adding post expression.

Is there any way I can do it on the same line of the attribution?

0 Kudos
Message 8 of 8
(1,300 Views)