LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to latch a boolean indicator when true. Once it reads true I want it to stay latched even if the input changes states.

I am running a continuous DAQ application. When an input comes withen a certain percentage of the output I want to illuminate a boolean light. But, I want it to stay lit even if the input becomes false.
0 Kudos
Message 1 of 20
(30,565 Views)
Yes, unlike boolean controls, indicators have not all those fancy mechanical actions, as indicators are supposed _to_indicate_ the values on theirs inputs. But you can implement your required latching programmatically - with a shift register (if in a loop) or with a local variable of this indicator. In both cases just perform a logical OR operation with old value. So once set to TRUE, the indicator will remain in this case (just don't forget to initialise it to false in the beginning).
Message 2 of 20
(30,563 Views)
Here's a boolean latch VI I made that has inputs for resetting the latch when needed, and also you can choose to either reset on first call or not.

This is in ver 6.0.2

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 20
(30,563 Views)
Ed,

Thanks for the input, how do I tie my boolean input to your latch VI?
0 Kudos
Message 4 of 20
(30,563 Views)
The input terminal "Latch Control" (should have thought up a better name) is where you wire the boolean you want latched, and wire the "Latched?" output terminal to complete the circuit.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 20
(30,563 Views)
Hi,

I am including a VI which solves your problem.

If you are looking for soemething different, pl. give feedback.

Best Regards,
Nirmal Sharma
India
Message 6 of 20
(30,559 Views)
Here's a boolean latch sub-VI I made that has an input for resetting the latch when needed, and also you can choose to either reset on first call or not.

The input terminal "Latch Control" is where you wire the boolean you want latched, and wire the "Latched?" output terminal to complete the circuit.


This is in ver 6.0.2 but will upgrade to 6.1 or 7 with no problems.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 7 of 20
(30,559 Views)
How would you implement this latch when you are monitoring multiple inputs to the DAQ card. I am trying to do the same with 7 channels. I know the shift register will have 7 elements but I am missing the rest.
0 Kudos
Message 8 of 20
(30,209 Views)
Piotrekp,
 
I've attached a short example that shows you how to do this with 2 different signals.  You could expand this to handle any number of input signals.  To make things look neater you also might want to try using functional globals instead of plain shift registers in your while loop.  Functional globals are explained in this document...
 
 
As a side note.  It's usually a good idea to create a new thread instead of posting to a thread that hasn't been replied to in a while.  In this case the most recent reply before yours was in 2003.  This makes it less likely that other users will see your post and reply to it.
 
I hope this helps,
Justin D.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 20
(30,194 Views)
Hi Justin 😧

Can you post the TestLatch.vi on this thread in Labview version 7.1. I do not have Labview 8.0

Respectfully,

Nirav


0 Kudos
Message 10 of 20
(30,030 Views)