How do I allow an alarm to be set based on a comparison but...
How do I allow an alarm to be set based on a comparison but then NOT aloow the alarm to clear until a button is pressed? I have a program that compares DAQ values to a threshold value. If the value surpasses the threshold, an led blinks. The problem is, if the value then goes back below threshold the blinking will stop, as a result of the comparison being False. What I want is to allow the alarm to begin the blinking but not allow it to stop until I press another button, essentially clearing the alarms. I am just flabbergasted at how to accomplish this. Any ideas?
Re: How do I allow an alarm to be set based on a comparison but...
Thank you very much. I actually came up with a similar solution before your response. I just created a state machine within my loop and made it so if the alarm ever goes on, the next state is permanently alarmed until the reset button is pressed. The shift registers did the trick. Thanks again!
Re: How do I allow an alarm to be set based on a comparison but...
Is the comparison within a loop? If so, you can place a shift register to the loop. Right-click the edge of the loop and select "Add Shift Register". Initialize the shift register with a boolean that set the alarnm LED off. Within the loop, place a Case Statement where you change the boolean value if the threshold is above the level. If the value drops, or never goes beyond the threshold, do not change the value. You can place a "reset button" within the Case Statement to clear the LED. I will prepare an example and post it in a moment... JLV.