LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Latch Boolean and Hold

I have a program which Turns on 4 fans using a relay module by user input via the front panel or by detecting a sound and activating the a digital input on a digital input module, the problem I'm having is that I want to be able to display to the user if the fans are operating in the "auto mode" with a boolean indicator, however light turns on and then turns off, is there any way to get it to stay on until the timer goes off. 

I have attached my code

0 Kudos
Message 1 of 10
(4,516 Views)
First, I would recommend not using an indicator that has an appearance of a button for Auto Mode.
 
How does the Auto Mode indicator ever turn True?  It is getting its value from the 5th index of the Array coming from FP Read.  What hardware is connected to that digital input?  Is it something momentary?  You could use a shift register with the appropriate set of boolean logic to maintain a True value in later iterations to keep that Auto Mode as True.  But then you would have to figure out what are the right conditions that have to occur to reset that indicator back to False.
0 Kudos
Message 2 of 10
(4,514 Views)
the hardware connected to the 5th index is a 24v switch when it is on auto mode can not be activated and when it is off auto mode works properly, i was thinking of using shift registers but got really confused with the logic
0 Kudos
Message 3 of 10
(4,508 Views)
A couple of quick comments/questions.

You forgot to attach the FP Controller LED Candy.vi.  It does not look like it matters, but just an fyi for future code posting, it helps to have all the vi's.
Try to follow the dataflow programming "standard", ie wire from left to right.  There are a lot of wires that go from the left hand side all the way to the right side and then back again.  Create subvis if necessary.

Which indicator are you trying to use for indicating auto mode??  You have one labeled Auto Mode On and another labeled Auto, with different indexes in the array giving them values (4 vs 5).

Let us know, thanks.
Kenny

0 Kudos
Message 4 of 10
(4,506 Views)
sorry, yeah that could be confusing, the one that is labled "auto" indicates if the fan was activated by the sound (4th index), and the one labled "auto mode" indicates whether or not the 24v switch is on or off (5th index) allowing or not allowing the sound to activate the fans
0 Kudos
Message 5 of 10
(4,501 Views)
so i tried to use a shift register, but i'm completely lost
what i would like to do is just be able to tell when the 4th index was latched then hold a boolean to true (to show the user) to indicate that the 4th index was activated then once the time runs out clear the boolean

so basically I need some way to monitor the 4th index to see if it went high, i think this would be easier if it went high then stayed high, but it doesn't it acts like a latch

i have attached my updated version and LED candy
Download All
0 Kudos
Message 6 of 10
(4,483 Views)

I attached a reworked copy of your led candy vi, jus ta suggestion of how to do a slightly more elegant way of doing the same thing (note: if you decide to use my code in the led candy, remove the sequence structure).  I didnt get around to wiring the error cluster throughout, but I highly recommend wiring the error cluster throughout all the vi's, especially as your programs get bigger.

I also attached a simple timer.  You can work it into your code pretty easy.  I commented it, but if you have questions, feel free to ask.

Saved in LV 8.5



Message Edited by Kenny K on 03-31-2008 02:51 PM
Kenny

Download All
0 Kudos
Message 7 of 10
(4,473 Views)
thanks for the help, i will take a look at this tomorrow
0 Kudos
Message 8 of 10
(4,467 Views)


Kenny K wrote:
I attached a reworked copy of your led candy vi, jus ta suggestion of how to do a slightly more elegant way of doing the same thing (note: if you decide to use my code in the led candy, remove the sequence structure). 
A couple of points:
  • The "array of FP IO" does not belong in a shift register, because it never changes inside the loops. A plain nonindexing input tunnel is sufficient.
  • The "array size" is never needed, because all loops are autoindexing.

Here's  quick alternative with basically similar result. 🙂


 



Message Edited by altenbach on 03-31-2008 02:00 PM
0 Kudos
Message 9 of 10
(4,457 Views)
DOH  Smiley Sad
 
I was looking at it, going, why does this look too complex.  my brain is a little slow today........thanks altenbach


Message Edited by Kenny K on 03-31-2008 04:05 PM
Kenny

0 Kudos
Message 10 of 10
(4,454 Views)