01-31-2011 05:02 PM
Hi all, bit of a newbie here.
My goal is to read a set of virtual sensors, when one is "tripped" it starts an alarm timer sequence and if the "reset" is hit in time the alarm doesn't go off. I think I have it up to that point, where I am a little confused is how to reset the alarm boolean to false, if the alarm does go off. I'm thinking it needs to be outside the loop, but I don't know how. Any help/guidance would be greatly appreciated, thanks.
Solved! Go to Solution.
02-01-2011 03:03 AM
02-01-2011 04:10 AM
Create local variable of alarm boolean indicator and pass "False" value in "False" case structure.
02-01-2011 02:54 PM
Hi,
Your block diagram is pretty well organized - so good job on that.
There is no delay in your main loop. This causes a big CPU load when no sensor is "tripped".
The way you implemented the timer function works but is not very flexible when you make program changes. Timers are very easy to create using "action engines". You can use the Express Timer vi, but I find that the side effects often take more time to deal with than just making your own.
Your "alarm loop" has controls and indicators inside it and it holds up execution of the main loop. This can give you problems like how to reset the alarm and it causes the Stop button to not work when an alarm is in process.
Check out the attached example. Use probes and Highlight Execution to "see" how the code works.
steve