LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lock elements of array true when the input element becomes true

Solved!
Go to solution

I am working on a project in which I want to create an alarm for any number of inputs.  Any time that there is a input that is out of range, an alarm will be indicated.  I would like the indicated alarm to persist until the user pushes a reset button, even if the out of range condition is removed.  In addition, new alarm indication may occur and should also persist. 

 

In the VI below, the Alarm Dummy Control is used to generate alarm(s).  I want the Alarm Indicated array to maintain any element that had or currently has a true (alarm element).  Every alarm will persist until the manual reset is pushed.  

 

I am sure there is a simple solution, but I am drawing a blank right now.  Alarm VI.JPG

0 Kudos
Message 1 of 5
(4,192 Views)

Keep the Alarm Indicated values in a shift register and OR them with the current alarm.  Just set the array back to all FALSE when you want to clear the alarms.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(4,185 Views)

I partially understand what you are saying.  Any value that is True (goes into the shift register) and then when "OR" with the new value will still result in True, even if that element has become false.  I had not thought of this approach.  I am still stuck with the fact that it is an array.  Can I use the For Loop to auto index through the array? How do I properly set up the shift register such that each element is compared with the same element from the previous iteration and not from the previous element?

0 Kudos
Message 3 of 5
(4,180 Views)
Solution
Accepted by topic author fstauble

You can operate on the array directly, no FOR loop needed.

 

Here's a very quick draft. See if it can give you some ideas.

 

 

Message 4 of 5
(4,167 Views)

Note that the small case structure is NOT necessary because indexing into an array with -1 will give you an empty string anyway. I put the case structure in there for easier feature additions. For example if it should say "No Alarms", "Everything OK" or similar, you could just add that string to the -1 case.

0 Kudos
Message 5 of 5
(4,115 Views)