Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6601 Counter Woes: What is wrong with this Vi?

I am trying to read the data from the counters after a gate period specified by the user. I can successfully read one counter, but the moment I try to replicate the vi for two other counters, I get a reading of 0 or the same value for all the counters even when 2 of the 3 are not connected (to a frequency generator). I have attached my Vi with this message. Can anyone tell me what I am doing that causes this trouble? Thank you.

KB.
0 Kudos
Message 1 of 3
(3,322 Views)
KB,

I did not notice any obvious problems with your VI. However, it does not appear that you are checking for errors. It could be that an error is being generated. Could you add the appropriate error handling code? If an error is occurring, it should shed some light upon the issue that you are currently facing.

Let me know.

Spencer S.
0 Kudos
Message 2 of 3
(3,322 Views)
I think the problem is in your call to 'Counter Group Config.vi'. You haven't wired anything to the "group" input. Each counter task needs to be assigned a unique group #. Otherwise, the same default value is used every time, resulting in the kinds of symptoms you described.

Pass in a unique group # to each instance of your "initialise..." subvi and see if that works. I'm also attaching a little utility vi I got in the habit of using for all my counter tasks. Its outputs are designed to feed right into the inputs of 'Counter Group Config'.

Another option may be to use DAQmx instead of traditional NI-DAQ.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 3 of 3
(3,322 Views)