LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

latch indicator Low after High

I have 4 indicators (LEDS) which show the status of 4 items.I have a further STATUS Led which indicates if all
4 indicators are high...AND GATE...
 
I want the Status led to go high when all are ok (AND GATE ) but fall low and stay low (Latch) if any of the 4 indicators (or all) goes from high state to low state and maybe goes high again, so i can see an error has happened at some point..
 
Anyone any ideas ?
 
I am using labview 8.0 or a screen picture would help.
 
Thanks,
 
Labtech5555
 
 
0 Kudos
Message 1 of 28
(4,070 Views)
Hi labtech,

make a boolean shift register holding the state "error has happened". Wire this to your "AND GATE" too... Include a "reset" to set back the value in this shift register.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 28
(4,064 Views)

Hi GerdW,

Thanks...Any chance of a quick picture Smiley Happy to help.

Much appreciated.

Labtech5555

0 Kudos
Message 3 of 28
(4,049 Views)

Here is a sample file for you. The main thing to note is that you need to make sure your values are read inside the while loop... not set as inputs. What I mean by this is you cannot wire your values into the while loop from the outside, they would have to be local variables and such, or read from the terminal inside, like I did here. I also put a reset into this sample so that you could mess with it and see how it works.

It is saved in LV 8.0 format so you can read it.

 

Good Luck,

CyberTazer
Software Systems Engineer
0 Kudos
Message 4 of 28
(4,042 Views)
Hi Labtech,

here's a pic:




Message Edited by GerdW on 04-03-2008 03:14 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 28
(4,036 Views)

Here is another version. It just uses a functional global.

Red
Certified LabVIEW Associate Developer
VI Technology
0 Kudos
Message 6 of 28
(3,941 Views)

Hi Guys,

Thanks for your help so far.

What i've got nearly works ..The output must stay low at the start when all inputs are low then go high only

when the inputs all go high.If any of the inputs then fall low  the output must latch and stay low.This is not quite working

on what i have so far.Still trying to fix ? 

Labtech5555

0 Kudos
Message 7 of 28
(3,880 Views)
This is starting to sound like you might want to whip up a quick state machine.  A setup state would let you keep the output low until all your controls went high, then you could transition to an error check state, where if any control drops the output drops, which would transition you to a display error state.  The only way out of the display error state would be user interaction, to ensure somebody knew an error had occurred.
0 Kudos
Message 8 of 28
(3,864 Views)

I agree with the state machine idea. Attached is an example for you. Please read the notes I have included and play with it a bit to make sure it does what you want it to, then modify for your code.

The way this works, as the while loop spins, the case statement is evaluated every time with a value passed in from the previous iteration of the loop. This allows you to evaluate the "state" of the program and decide what code you want to execute in the next iteration of the loop. In other words, every time you go through the while loop, the case thats run decides which case will run next time.

In the first time I seed the shift register for the case statement with 0. This is the initial case. The condition for going from state 0 to state 1 is that all inputs are high. After this, in state 1, if any input goes low, you are placed into state 2, the reset state. The only way out of this state is to hit the reset button... and so on. Note that you have a choice on where the loop goes after a reset... do you want it to immediately fail if all inputs are not high, or do you want it to start like it did, waiting first for all inputs to go high. This will decide where you want the reset state to send you, either to state 0 or state 1. See the notes on the diagram for further info.

One word of caution to those reading this interested in the state machine idea... if you use it... KEEP IT SIMPLE. This type of code can be very frustrating to debug. If your app will use complex reasoning to decide which state to go to, or you think there would be many many states, try to think of a way to simplify. If you dont, you will be stuck trying to figure out which state it is in and why for hours sometimes, before you can even start on the problem. Strip it down to what you need for a state decision as much as absolutely possible. Trust me on this one... I have been there.

Attached VI saved in LV 8.0 format.

Good luck,



Message Edited by cybertazer on 04-04-2008 08:50 AM
CyberTazer
Software Systems Engineer
0 Kudos
Message 9 of 28
(3,858 Views)
How about this...... It uses logic to detect the falling edge of ABCD, then latches to indicator to low.....
 
One a somewhat unrelated note.....How do you guys paste an image into a message so It shows in the post?
0 Kudos
Message 10 of 28
(3,837 Views)