NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Use control flow statement to evalute signals

Hi,

 

I have a number of steps in my sequence file such that when TS runs it looked like this:

 

SignalA >20       pass

Signal B <= 30   pass

       "

       "

 

Now I wish to use some control flow statements like While and If loops so that I could create steps like this:

 

While ( SignalA > 20)

       "

       "

Problem is there are no "SignalA" in the TS expressions.  I tried putting together an expression like RunState.Sequence.?? (some unique id of the step)Result.step = "failed".  But the While loop can't seem to evaluate to True

 

 

Any suggestion would be appreciated.

 

Thanks!

 

ph2

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

Hey ph2,

 

I'm not sure what your goal is with this but there is probably a better way to accomplish what you want.

 

Where is SignalA coming from?  A VI?  A dll?  Do you only have to acquire it once or do you need to get it every iteration of the loop?  Is the step that acquires it inside the While statement or is it an asynchronous thread?  Why not just store it to a Local or FileGlobal and then access that.  It would be easier.

 

BTW- If SignalA > 20 step is a Numeric Limit then you can access it by using Step.Result.Numeric. 

 

Let me know exactly what your goal here is and I could possibly help you find a better solution.

 

Cheers,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 5
(3,341 Views)

Hi Jigg,

 

Please see response below:

 

Where is SignalA coming from?  A VI?  A dll? 

---->It's from a dll.  Dor example, the dll code module will evaluate if SignalA > some value.  If yes,  TestStand will pass the step

 

Do you only have to acquire it once or do you need to get it every iteration of the loop? 

-----> Get it every iteration of the loop or everytime a step is created 

 

 

Is the step that acquires it inside the While statement or is it an asynchronous thread?

----->  should be in asynchronous thread 

 

Why not just store it to a Local or FileGlobal and then access that.  It would be easier.

Can't acquire the SignalA directly, it's pulled from the code module.

 

Thanks!

 

P

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

So basically you have a step that calls a function in the DLL and based on the return then it will either pass or fail...correct?

 

Why don't you just loop on that step until it passes?  For the step select the Looping property in the Properties.  Change the Loop Type to pass/Fail Count.  Change the Stop after to 1.   Basically now the first iteration that passes will stop the looping.  Then you can change the or after a maximum of ___ iterations to however many you want.  This would be my recommendation.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 5
(3,305 Views)

Jigg,

 

This is a good idea, I'll try that in the lab!

 

Thanks so much!

 

P

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