Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize hardware timed buffered counter acquisition with buffered analog input acquisition

LV7.1
DAQmx
PCI-6036E
SC-2345
Windows 2000

Greetings.
I am simply trying to synchronize AI readings with readings from one Counter.
I am trying to perform buffered analog input synchronized with buffered counter acquisition.
I'd like the AI acquistion to trigger the Counter acquistion.

I'm currently setting the Sample Clock Source for the CI Cnt Edges Task to "Dev1/ai/SampleClock" but when I try and set the source for the "DAQmx Trigger" I can't seem to select one that works. I assumed that the source should be the "Dev1/ai/StartTrigger" but that produces and error as does selecting any of the PFI's.

I'm new to DAQmx and didn't have any luck with the examples or what's been previously posted.
Thanks for your help.
0 Kudos
Message 1 of 9
(6,298 Views)
Steve,

Frankly, I'd say you're making a pretty good start with DAQmx already. I think all you need to do is to remove the DAQmx Trigger vi in the counter config chain. Since the counter is using the AI sample clock as its own sample clock, and since you (wisely) start the counter task first, the samples will already be synchronized without an explicit trigger.

I'd guess that the error might be due to your attempt to tap into an AI trigger that isn't there because your AI wasn't configured to use a trigger.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 9
(6,281 Views)
Ah, I didn't think about it like that. Thanks for simplifying my life. I really appreciate the feedback.

Steve
0 Kudos
Message 3 of 9
(6,277 Views)
The reason you're seeing the error is counter input operations don't support a start trigger. Start triggers are only supported by counter output operations. You're best bet is to follow Kevin's advice and share the sample clock without using a trigger.
0 Kudos
Message 4 of 9
(6,273 Views)
Gentlemen-
All of your initial help was great. I had some noise on my counter lines so switched from an E-Series card to a PCI-6259 M-series card in order to use the counter digital filters.

Now I can't get a corellated buffered counter and buffered analog input acquistion to work. This same code worked fine on an E-series card but it doesn't on the M-series.

I verified that the source and gate of the counter are working properly using the test panel and a external function generator.

But when I run the attached code I get no data out of the "Counter 1D U32 NSamples", only an error saying that the timeout of the function was reached and no count data became available. Am I missing the specification of a another clock or something?

The counters also work fine using the M-series example code "Count Digital Events (M-Series DAQmx) but this is not a buffered acquisition.

Any help would be greatly appreciated.

Steve
0 Kudos
Message 5 of 9
(6,255 Views)
It sounds like you're running into an issue related to duplicate count prevention. I assume you are using NI-DAQ 7.3? Upgrading to NI-DAQ 7.4 will probably automatically fix your problem because it changes the default behavior of duplicate count prevention. This thread has some more information about the behavior of duplicate count prevention, but to give you a short summary, I suspect that you have situations where your GATE (Sample Clock for Count Edges) is receiving multiple edges with no SOURCE (input terminal) edges inbetween. You can set Duplicate Count Prevention to true manually (it is a channel property) in DAQ 7.3 to fix this issue.

I hope this helps!
gus....
0 Kudos
Message 6 of 9
(6,230 Views)
Gus-
That was the problem. Thanks so much for your help!
Steve
0 Kudos
Message 7 of 9
(6,226 Views)
LV7.1.1, DAQmx, PXI-6251(M), PXI-6602, Windows XP, NI-DAQ 7.4

I'm getting the same problems when I try to synchronize the 6602 with the M board. I tried to set the duplicate count prevention to true,
but still no counter output.

Anyone who knows how to solve this?

Regards

Roger Isaksson

0 Kudos
Message 8 of 9
(5,977 Views)

I'm not near hw to test it now, but I would suggest you just experiment with both True and False settings.  I've bounced around a few different machines with different hw and different versions of NI-DAQ, and it seems that the "Duplicate Count Prevention" property hasn't behaved consistently across the various configurations. 

For example, when I was using DAQmx 7.2 or 7.3, a True setting behaved differently on a 6602 counter/timer card than on an E-series card (or maybe it was an M-series).  Then the default behavior changed on certain hardware from 7.3 to 7.4 as described toward the end of this thread.

Since there's only two settings, I've found it easier just to try both and observe which one does what I want rather than try to remember. These days, everytime I make room to remember something I have to forget something else to make room. Smiley Wink

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 9
(5,967 Views)