LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

increment by 1 digital input

Solved!
Go to solution

Hello,

 

I'm trying to make a 1 by 1 counter with a digital input from my DAQ. I have a sensor connected to the digital input channel and whenever it is activated, the program is supposed to increment a counter by 1. However when the sensor is activated, the counter keeps counting on and on (really fast). I want it to count only 1 with each pulse.

 

I have tried everything I can think of, case structure, event structure, signal collector, sequence...but with no result. Is there a way of limiting the count?

 

Thanks, hope someone can help

 

 

0 Kudos
Message 1 of 6
(2,848 Views)
Solution
Accepted by topic author Ali84

You really need an edge detect.

 

Rising Edge.png

 

Omar
Message 2 of 6
(2,842 Views)

Hi Ali,

 

"with a digital input from my DAQ"

You should wire the digital input to a Counter when your DAQ supports it. Then you only count on rising edges of the digital signal...

Otherwise count only in the case of rising edges!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(2,839 Views)

Omar,

 

I know this is older, but looking at your diagram and trying to replicate it, something doesn't work.

 

If I wire it exactly as shown, the feedback node stays black and doesn't 'pick up' the fact that it's supposed to be a boolean.  The only way I can get it to go boolean is to connect to the output of the comparison.

 

What am I missing?

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 4 of 6
(2,656 Views)

Hi Ralph,

 

you're missing correct wiring...

 

How should we help when you don't show your VI?

Did you wire the input of the feedback node?

Did you change the direction of the feedbacknode?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 6
(2,652 Views)

GerdW,

 

I didn't change the direction.  That was it.  :manlol:

 

Any chance I can get your attention in my other thread?  Count analog input

 

I'm trying to implement this example and while the example works, the remainder of the VI doesn't.  😞

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 6 of 6
(2,647 Views)