LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

alarm timer

Hi, I developing a tank control application, and I want to have a maximun level alarm, but I only wants to shoot the alarm if the level mantains in maximun by 10 seconds.
Problem 1 - when my application starts to count the time, it forgets the rest of the code, the level never increases.
Problem 2- how can I create a timer that count 10 seconds.

thanks in advance
HDLP
0 Kudos
Message 1 of 14
(4,547 Views)
I don't know how your application looks like but I assumed you have a loop which checks the level.
Find attached example and see if it fits your app. This is just to have an idea of how can be done. If you are concerned about performance you can place some of those controls outside the loop and also insert a case structure for processing those calculations only when the level is greater than the limit and in case of alarm if you want to do more than a LED change.
There are some other ways to do it ... let me know if this one is good for you ...

Hope this helps
Message 2 of 14
(4,547 Views)
Sorry for so long time to answer.
Thanks for the help, this solve one of my problems, but it still keep doing what i don't want.
When the program is calculating the alarm time, it forgets the rest of my code!!!!., and the level thanks stops rising.
If you hane any ideia, i send my code.
Thanks in advance
0 Kudos
Message 3 of 14
(4,547 Views)
It doesn't "forget" the rest ... the problem is that those 5 second delays block the "fase" changes and the wait period is 5 seconds even though the value of "fases" are changing in other cases - !!! the output timer value from "Wait(ms)" function is read AFTER 5 seconds wait period !!! That's way you need to get the time in seconds (with little delays between readings) and the tank level won't be affected by alarm related calculations.
0 Kudos
Message 4 of 14
(4,547 Views)
Can you explain-me this better.
what do you mean with "the wait period is 5 seconds even though the value of "fases".
and whith "tath's way you need to get the time in seconds (with little delay between readings)" - How i do this
thanks in advance for your help
HDLP
0 Kudos
Message 5 of 14
(4,547 Views)
First, keep in mind that I may not understand correctly what you are trying to do. There are so many local variables and no comments on what each phase represents. Therefore, I can use some details.

Anyway, back to your questions:

- "the wait period is 5 seconds even though �"
= if [fase2] is TRUE the case including those 5 sec delays starts. Even though immediately after [fase2] becomes FALSE, you cannot interrupt the delay started when [fase2] was TRUE

- "that's way you need to get the time in seconds (with little delay between readings)"
= getting the time in seconds (when the first alarm value is encountered) and having a loop that reads the time in seconds (with a small delay (50ms or less) which is insignificant for your tank l
evel monitoring task) and subtracts the start value to see if the "before alarm" time elapsed - this way you don't have a long delay to affect your tank level readings. Of course, you need to terminate this loop in case the level is back to normal values. (this was the idea in my VI )

Even though our VIs are different (yours is more like a process simulation), I tried to modify mine to fit with your task. Find attached modified version.

Hope this helps
Message 6 of 14
(4,547 Views)
thanks for your example, my first phase is working perfectly now. My problem now is how can i change phases. I don't understad how can I change the phases.
Thanks again for all your work.
HDLP
0 Kudos
Message 7 of 14
(4,547 Views)
I modified a little bit my VI to show you an example of modifying phases (find the comments inside the block diagram). Attention: You are representing phases by booleans, different from my numbers' approach. If you don't have a case with two phases ON in the same time, my approach represents the same thing. If you may have 2 or 3 phases ON in the same time, then you need to create a new code (number) for that situation (like, 4, 5,�). Anyway, it's simpler to handle one number then 3 booleans. Even more, if you use a ring menu (or text) for phase number, you can avoid handling strings to show the name of the phase (use the ring's text to do this).

Hope this helps
Message 8 of 14
(4,547 Views)
thanks for your help my program is almost complete.
0 Kudos
Message 9 of 14
(4,547 Views)
Hi again!
I was trying to modify your alarm example, to do the same thing but in inverse, now I want to test if the tank is empty in a certain time. But my modifications dind't work can you help me???
thanks in advance
HDLP
0 Kudos
Message 10 of 14
(4,547 Views)