LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Latch an "In Range and Coerce" Output until Reset

I have numerous voltages and signals that I am reading from an PXI system.  Each of these signals needs to fall between a minimum and maximum.
Right now, the entire "program" is running inside of a While Loop.  Each signal is being read and then passed to an "In Range and Coerce".  This function is working well, in that it notifies me when the value falls outside of the maximum and minimum.  But what I need to do is to "latch" the output from the "In Range and Coerce" until I have completed other functions also running in this While Loop.
I'm very new to LabView and a hardware engineer on top of that.  I know that the way I'm doing this is probably not the best way.  I am open to any suggestions.
Thanks,
-Steve
0 Kudos
Message 1 of 11
(3,443 Views)
I'm not sure that I understand exactly what you're looking for.  If I'm misunderstanding you please let me know.  Also posting your code always helps with questions like this.

You might be able to achieve your goal with a shift register and a boolean operator.

I've attached a little picture that shows how this might be done.  In the pic, normally the true case will execute, but the false case will execute if any of the past measurement were out of range.

Is this helpful?

Adam
0 Kudos
Message 2 of 11
(3,427 Views)
Could you explain on what you mean by 'latch'
0 Kudos
Message 3 of 11
(3,416 Views)

It sounds to me like the kind of "latching" you're looking for is automatically available to you as a side-effect of LabVIEW's "dataflow" nature.

Once a value exits an output terminal of the "In Range and Coerce" function, all wire paths connected to that output will receive the exact same value. I.e., once a value gets on a wire, it remains constant through all branchings connected to that wire.  If you turn on debug highlighting mode, you'll see what this means more visually.

A common source of LabVIEW problems for people experienced in text languages is overuse of local and/or global variables.  Perhaps this is the root of your issues with "latching?"

In text languages, data is contained within and "transported" by variables.  In LabVIEW, data is contained within and transported by wires.  In LabVIEW, variables and controls/indicators are just termination points to allow the data to be displayed or passed to/from calling functions.  They aren't really important in and of themselves.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 11
(3,393 Views)
All good suggestions and ideas.  What I really need is an In Range and Coerce with an exta input called "Reset Output" and for output to stay in the set condition until the "reset" changes state.
I wasn't using variables, although you are right in saying that (what little I know) is based on text based languages.  Would using variables actually help in this instance?
Thanks,
-Steve
0 Kudos
Message 5 of 11
(3,387 Views)
I think this is what you're looking for:


Download All
0 Kudos
Message 6 of 11
(3,383 Views)
So how do I use this inside of my current While Loop?  Since it never terminates, the outside loop that containes all the remaining process, won't run.
Thanks,
-Steve
0 Kudos
Message 7 of 11
(3,361 Views)
Oops, did I set that up wrong?

What I thought I did (what I meant to do) was set the loop to execute exactly once.

If you're familliar with C, that would be like a do {;} while (0);

In labview there are lots of places where these loops that never repeat themselves are useful.  They're usually called "LV2 globals" or "functional globals".
0 Kudos
Message 8 of 11
(3,358 Views)
I'm sorry for not asking the right questions.  Thanks for putting up with me as a "Newbie".
Is there any way to take the latch shown in the post above and make it into a sub-VI that can run in a pre-existing While-Loop?
Thanks,
-Steve

Message Edited by steve_bjservices on 03-14-2007 01:21 PM

0 Kudos
Message 9 of 11
(3,339 Views)
Did you try the VI that I posted?
0 Kudos
Message 10 of 11
(3,335 Views)