Showing results for 
Search instead for 
Did you mean: 

Do counters need initializing (other than zeroing)?

Does something have to happen to enable a counter to count, other than wiring to Create Channel, Start Task, and DAQmxRead VI's?
I wrote an example very similar to the supplied sample Count Digital, but it didn't work. So I tried the Count Digital itself, and it worked. Then my own vi started working when I tried it again with no changes.
Now I'm writing another VI that uses a second counter channel. The second counter gets no counts. When I access the counters with MAX instead, both counters count properly. However when I run Count Digital and select the other counter by selecting a different value for the constant attached to the Create Channel vi "counter" input, it doesn't count. I didn't see an example vi that would access the second counter channel, to test the idea that I have to run one of their vi's first to make them work.
It seems like the counters have to have something happen before they will work, something that isn't visible in the block diagram. I didn't find any clues looking for things like "initialize counter" in the help or forum.
Here's an example that uses the two counters in my NI DAQPad-6259, on which both counter inputs are wired to the same external signal generator line. In this example, counter 0 operates correctly, and counter 1 shows no counts, even though MAX can get correct counts on both counters with the same hardware setup unchanged. I think I did everything identically on the two counter setups except for selecting different values on the "counter" channel constant.
Thanks for any help!
0 Kudos
Message 1 of 2

Wait, wait, never mind, found it.

I had something wired wrong and fooled myself with MAX.



0 Kudos
Message 2 of 2