LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to compare time of boolean

Hello 

 My aim is to find 'on' time and 'off' time of a boolean switch.It should be in the range..If not it is failed..I developed vi but my prob is that 'on and off time is being compared when it is in progress.couldn't find proper result.I need to compare time duration once it get completed but not in present state (i.e want to compare  previous stored value)Please anyone help me.  

0 Kudos
Message 1 of 8
(3,245 Views)

Since you care about both transitions, you need to do your actions only when you detect a boolean transition.  For this, I just use a Feedback Node (to hold the previous state) and then a Not Equal.  From there, I can do all of the updating of states and checking that is needed.


GCentral
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
0 Kudos
Message 2 of 8
(3,192 Views)

Thank you..Can u send vi plz..

0 Kudos
Message 3 of 8
(3,108 Views)

http://www.ni.com/tutorial/9330/en/

 

He just did, download the png file, it contains a VI too...

 

edit: also have a look at this vi:

http://zone.ni.com/reference/en-XX/help/371361H-01/ptbypt/boolean_crossing_ptbypt/

It can simplify your block diagram, sinc it is already included in LabVIEW...

0 Kudos
Message 4 of 8
(3,079 Views)

Blokk wrote:

He just did, download the png file, it contains a VI too...


The snippet is in LabVIEW 2014, but the OP posted in 2012.

0 Kudos
Message 5 of 8
(3,006 Views)

yep, not noticed 🙂

 

0 Kudos
Message 6 of 8
(2,998 Views)

Here's a more streamlined version (LabVIEW 2012):

 

(Of course you would need to tweak the tolerance control and add more indicators as needed.)

 

 

Download All
0 Kudos
Message 7 of 8
(2,977 Views)

Thank you so much 🙂

0 Kudos
Message 8 of 8
(2,917 Views)