NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change a Step Output to a Variable?

Hi Community,

I'm quite a novice regarding Teststand, so I need some basic hints, to go forward.

Basically, I wish to use the output from a .vi to decide if a While loop should continue or not.

The .vi runs inside a loop in a seperate thread, so I guess that the output should be defined as a global variable.

Attached is a view of the settings inside the .vi.

 

But how do I create a global variable, containing the .vi output?

 

Looking forward to receive your comments on this.

 

Best Regards,

Flemming Lassen Nielsen

0 Kudos
Message 1 of 7
(1,209 Views)

I can think of 2 (somewhat simple) ways to do this:

1. Pass in a Sequence Context reference into this VI and then using property nodes to set a TestStand variable.

2. In LabVIEW, save the value in a Global Variable, Notifier, or Functional Global Variable and use another VI that does nothing but read that value and output it.  You then just call that "get" VI from TestStand to get the value where you need it.

 

If it were my choice, I would go with #2.


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 7
(1,190 Views)

Hi Knight of NI 😉

 

Thank you for your suggestions.

I have looked a little into other Step Types in the actual Sequence, and I found one with a lot of stuff written in the Status Expression, please see attached.

I guess that this is another example of references to the Sequence Context.

 

Is this similar to what you mean as your #1 suggestion?

Unfortunately, I will also need some help on the correct syntax, when making the specific Sequence Context Reference.

 

Best Regards,

Flemming Lassen Nielsen

0 Kudos
Message 3 of 7
(1,153 Views)

Hi Community,

 

Unfortunately, I'm stuck in this Task, as I don't know how to go forward.

 

My basic wish is to let a While loop run, until a specific output from another Step falls below a specific Level.

I have attached the Sequence.

I have defined the Global Variable: Globals.PressureLoop, which should hold the Output from an Analog Logging .vi, running in a seperate thread.

The Output from the Analog Logging .vi seems to be an ASCII string. How can this end up as a Number in my Global Variable?

 

Best Regards,

Flemming Lassen Nielsen

0 Kudos
Message 4 of 7
(1,118 Views)

Hi Flemming,

 

honestly I am neither sure we understood where you are stuck nor you understood crossrulz suggestions.

 

From what I understand, the While Loop is running in your TestStand MainSequence. The determining "output" is not actually a VI output, but a value inside the VI which will be regenerated periodically.

Now your issue is to get the current values from the VI to the MainSequence.

 

Since you preferred crossrulz #1 solution of using TestStand variables to pass the values instead of passing them LabVIEW internally, here is a little screenshot showing what he meant:

kghzvi_1-1661754911664.png

This code needs to be implemented into the VI that is generating the PressureLoop values. It will set the StationGlobals.PressureLoop numeric variable in TestStand with the current value without your VI having to stop. So the while loop in the MainSequence can read that StationGlobal while the VI is running in the parallel sequence.

 

Alternatives would be to change the VI to store the value in some sort of LabVIEW global variable (as crossrulz suggested), or to change the VI to finish executing after generating one value and looping the VI Call in TestStand. That way you can use the VI parameters normally to forward each value to the TestStand variable.

Either way you will have to change the value generating VI.

 

If this does not solve your issue, please give a more detailed description of what you are doing and trying to do and use the correct terminology. e.g. Globals.PressureLoop is very misleading. Is it a StationGlobal? FileGlobal? Weirdly named LabVIEW Global Variable?

 

Stefan

 

 

0 Kudos
Message 5 of 7
(1,105 Views)

Hi Stefan,

 

I'm sorry for taking your time.

I will not be able to add your suggested screenshot to the vi.

It seems that I'm not sufficiently aware of wording and terminologies within TestStand. Sorry for that.

I had an expectation that I at least would be able to ask a simple question, but I failed.

TestStand is obviously way too complicated for users like me.

 

I will try to solve my Issue, without using TestStand.

 

Regards,

Flemming Lassen Nielsen

0 Kudos
Message 6 of 7
(1,087 Views)

Apologies for assuming you wanted help on a topic just because you asked a question in the forum.

I obviously should have payed more respect to your personal capabilities and limitations and should not have replied that offensive as in proposing one or even multiple solutions for your question.

That was my bad.

I will make sure to deeply think about my behavior in order not to offend users with my forum posts anymore.

It would probably be wise to leave it to the authors to answer their own questions as they are best suited to understand them in the first place.

 

PS: I did not suggest a screenshot of a VI, because if authors post screenshots of VIs in this forum, the first comment usually gives the hint that we cannot debug screenshots and asks for the actual VI instead.

 

Stefan

0 Kudos
Message 7 of 7
(1,081 Views)