NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

set boolean "specify by expression" in sequence call

Solved!
Go to solution

Hello,

 

Is it possible to set the checkbox "Specify by expressionin a statement ?

The statement should be in the cleanup.

If yes, what is the code line to write ? because this variable is not in 

the variable window so I have no idea about how set this boolean.

 

Thanks

0 Kudos
Message 1 of 10
(4,124 Views)

Sorry I did mistakes in my previous post

 

Is it possible to set the checkbox "Specify by expressionof a Sequence Call in a statement ?

The statement should be in the cleanup.

If yes, what is the code line to write ? because this variable is not in 

the variable window so I have no idea about how set this boolean.

 

Maybe it is possible to call the sequence call like this:

RunState.Sequence.Main['Sequence Call"]...

but I didn't find how to access the boolean "Specify By Expression"

 

Thanks

0 Kudos
Message 2 of 10
(4,121 Views)

Yes, you can set the Specify by Expression.

 tt.JPG

0 Kudos
Message 3 of 10
(4,104 Views)

I know it lol.

But I want to set the checkbox at true or false in a separate statement, not directly in the sequence call.

 

Thanks

0 Kudos
Message 4 of 10
(4,096 Views)

You shouldn't do that if you can have multiple threads executing the same sequence at once because settings on steps are shared between all threads running them. You are effectively writing self-modifying code. You might consider having two sequence calls, one by expression and one not, and using a precondition to decide which to run.

 

If you want to change this setting programmatically you need to do something like the following:

 

step.Module.AsSequenceCallModule().SpecifyByExpression = true.

 

You are effectively editing the sequence file when you do this though, so I'd really recommend trying to solve the problem a different way. If you want help with that, please explain why you are wanting to change this setting at runtime and perhaps we can suggest a better way to solve the original problem.

-Doug

0 Kudos
Message 5 of 10
(4,088 Views)

I really need to have an expression like you write.

I need to do it in the cleanup because it is not really for a sequence call 

but for a call_test (which are very similar to a sequence call, with exactly the same options),

which are create with a software specially create for my firm.

In my CALL_TEST I can't change anything, I can't add pre or post expression, post action, etc...

 

And the software has lots of bugs and sometimes the SpecifyByExpression are not true.

during the test it is normal but at the begining of the test it must be at true.

and because of the external software, this boolean is not at the right value.

So when I finish my test I need a step in the cleanup to give it the expected value.

 

My teststand don't find AsSequence in the auto completion after Step.Module 😞

So I have a evaluation error.  

0 Kudos
Message 6 of 10
(4,082 Views)

Where is the step you want to change the setting on in relation to the one that's changing the setting? Are the in the same sequence? Are they the same step?

 

-Doug

0 Kudos
Message 7 of 10
(4,069 Views)

they are in the same sequence.

I need a statement in the cleanup to change the value of SpecifyByExpression which is in the main at the end of the tests.

 

0 Kudos
Message 8 of 10
(4,060 Views)
Solution
Accepted by topic author AlexTestStand

An expression similar to the following should work:

 

RunState.Sequence.Main["myseqcall"].Module.AsSequenceCallModule.SpecifyByExpr = true

 

-Doug

Message 9 of 10
(4,053 Views)

Thanks for all Doug 🙂

0 Kudos
Message 10 of 10
(4,036 Views)