From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daq 6008 counting a digital input

Hi, I am having trouble building a counting vi.  I want to count how many times a digital input changes state, I have tried to use the Daq assistant instead of a Boolean but keep getting errors. Any help would be much appreciated.

0 Kudos
Message 1 of 3
(1,949 Views)

Your VI is not complete. What is event case [2] supposed to be connected to? In other words, what front panel control/indicator triggers it? Did you intent to put this in the Timeout case?

 

Can you provide more details on exactly what it is that you're trying to count? You said "count how many times a digital input changes state". Does this mean low->high, high->low, or both? Your VI name implies that this might be for a relay. If so, are you accounting for bouncing, or is this what you are trying to measure?

 

Also, are you aware that the 6008 already has a counter built into the hardware? I would suggest using that. Take a look at the examples that ship with DAQmx on how to set up a counter.

0 Kudos
Message 2 of 3
(1,946 Views)

What I am trying to do is count the pulses from a flow meter which will pulse every time a liter passes through it. I would like to use a normally open volt free contact to count on a numeric indicator. I have tried to to using the counter on the 6008 but just can't get it to work.

0 Kudos
Message 3 of 3
(1,937 Views)