LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed condition (timed comparison)

Solved!
Go to solution

Hello, just wanted to ask of a simple way to make a timed condition.  To be brief, I have a value which I want it to be greater than zero for "x" seconds.  If such value is greater than zero for these "x" seconds, then a boolean "true" value would light a LED indicator on.  However, if during these "x" seconds the value is equal to or lower than zero, even for a single second, then the LED indicator will have to remain off or in its "false" value.

 

Is there a simple way to make a timed comparison?  In advance thank you very much for reading and for posting your suggestions.

 

Best,

Nestor 

0 Kudos
Message 1 of 7
(2,126 Views)
Solution
Accepted by topic author Nestor_C

Nestor,

 

Put all the values acquired during the "x" seconds in an array. Use the Array Min Max function.  If min < 0, then false.

 

Lynn

Message 2 of 7
(2,116 Views)

An alternative implentation is basically to say that you want a VI which will delay a T value on a boolean wire (B) for N seconds. If you look at the Time Elapsed express VI, it gets you most of the way there. You basically just need to call it with Auto Reset set to F and wire NOT B into the reset terminal, then look at the result. If B is F, reset will be T and the output is F. If B is T, reset will be F and after N seconds the output will be T.

 

You might also want to give special consideration to the case where N<=0.


___________________
Try to take over the world!
Message 3 of 7
(2,109 Views)

Excellent.  Thank you very much Lynn!!!

 

Best,

Nestor

0 Kudos
Message 4 of 7
(2,098 Views)

TST, Thank you very much for your alternative implementation!!!  Both solutions I've received work great!!!

 

Best,

Nestor

0 Kudos
Message 5 of 7
(2,094 Views)

Nestor,

 

Be aware that for non-integer representations of data, equality comparisons to zero will not produce a True output unless the value is exactly zero. If you do any calculations on the data you could get values on the order of 1E-16 which looks like zero on most displays but will not show as equal to zero on a comparison.  >= or <= comparisons are usually OK.  This probably does not matter for what you are doing now, but it is somethign you should be aware of for the future.

 

Lynn

Message 6 of 7
(2,082 Views)

Got it Lynn, thank you very much for your advice!

 

Best,

Nestor

0 Kudos
Message 7 of 7
(2,066 Views)