LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting a HIGH signal

Solved!
Go to solution

Hi.

I am continuously reading a digital input signal in a while loop. My application consists of a normally open switch that when closed the input is a high. I would like to increment a counter to track each time the switch is closed. The problem is since the switch is mechanical, the counter increments more than once before it is actually released. How do I code it so that when I get a high I increment only once and increment another only on the next high and so on? 

 

Thank you in advance

0 Kudos
Message 1 of 5
(3,019 Views)

Hi.

I am continuously reading a digital input signal in a while loop. My application consists of a normally open switch that when closed the input is a high. I would like to increment a counter to track each time the switch is closed. The problem is since the switch is mechanical, the counter increments more than once before it is actually released. How do I code it so that when I get a high I increment only once and increment another only on the next high and so on? 

 

Thank you in advance

0 Kudos
Message 2 of 5
(3,021 Views)
Solution
Accepted by topic author LNH02

You can use this VI to define the direction of crossing you are looking for:

 

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

0 Kudos
Message 3 of 5
(3,016 Views)

Gregoryj,

 

Many thanks!!

0 Kudos
Message 5 of 5
(2,971 Views)