LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set time duration always 10 sec

Hello,In my project iam measuring temperature,if the value falls out of range and this violation takes place atleast once in 10 seconds then there should be set alarm.Iam able to do this for first 10 sec,but after that iam facing problem,because after first 10 seconds I have to check if there is any viloation from 1to 11th sec(i.e 10 sec),2 to 12 sec,3 to 13 sec........ please help me with example how can i do this,if there is no viloation in 10sec period then I have to clear alarm.

mainly my problem is I am not understanding how to always set duration 10sec,i.e 11-1,12-2.............
0 Kudos
Message 1 of 4
(3,239 Views)
Hofer,

Here is a software monostable...

Within your monitoring loop, connect your alarm true/false to the monostable VI's "trigger" input, and set the duration input to 10 (seconds). The VI's "output" boolean will remain true for at least "duration" seconds after the input has seen a "true" (even if a "false" is input during the "duration" period). Further true "trigger" inputs restart the "duration" timing period, so if a second trigger/alarm occurs five seconds into a 10 second duration, then the output will stay true for at least 15 seconds (i.e. the output will only reset to false if the input is clear (false) for at least duration seconds after a trigger).

Quite a nice neat bit of code (though I say so myself) - what do you think?

Mark.
0 Kudos
Message 2 of 4
(3,224 Views)
Spotted the deliberate mistake yet? - The time input needs to be in milliseconds, not seconds.

Mark.
0 Kudos
Message 3 of 4
(3,210 Views)
Another way to do this is to use a rolling buffer. I have attached an example which checks every 1 second to see if the value of a random number is greater than a threshold value. The buffer slides for 10 cycles of the loop, which is 10 seconds for the timed loop. You should be able to easily implement this approach in your current setup as long as you're using timed data acquisition.
0 Kudos
Message 4 of 4
(3,199 Views)