Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using one counter with FiniteSamps and another with ContSamps

Solved!
Go to solution

I am trying to use 2 counters on the USB-6229 (or USB-6259), where one counter is set up for FiniteSamps and another for ContSamps. I have the following MeasurementStudio code:

 

ErrChk DAQmxCreateCOPulseChanTicks(hCnt0, "Dev1/ctr0", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
ErrChk DAQmxCfgImplicitTiming(hCnt0, DAQmx_Val_FiniteSamps, 100);

ErrChk DAQmxStartTask(hCnt0);

ErrChk DAQmxCreateCOPulseChanTicks(hCnt1, "Dev1/ctr1", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);

ErrChk DAQmxCfgImplicitTiming(hCnt1, DAQmx_Val_ContSamps, 2);

ErrChk DAQmxStartTask(hCnt1);

 

When I run it, I get a run-error 50103 "The specified resource is reserved". If I change the FiniteSamps to ContSamps on the first counter, everything works fine.

If I use only one counter with FiniteSamps, everything also works fine.

Is this a bug in DAQmx or the dual counter use on M-series devices is limited to ContSamps?

 

Vic

0 Kudos
Message 1 of 2
(4,678 Views)
Solution
Accepted by topic author vicpik

Hi Vic,

 

This is actually expected on an M Series device.  Here's a timing diagram from the M Series User Manual that might make this a bit more clear:

 

2009-09-24_155647.png

 

The device actually uses one counter to gate the other so the result is a finite pulse generation.  If you can provide the gate from another source, you may configure a continuous pulse generation on both counters and gate them (DAQmx calls this a "Pause Trigger") from this external signal. 

 

You might also want to look into using Correlated Digital I/O to generate multiple finite pulses (up to 32 lines on your 6229 and 6259).  You could use one of the counters to generate a timebase for the digital lines, and build the waveform accordingly.

 

 

One thing to note is that our new X Series boards can generate a finite pulse generation on a "single" counter (there is actually a paired internal counter that allows for this).  There are four user-accessible counters on X Series devices, meaning you could generate four finite pulse trains.

 

 

Best Regards,

John

John Passiak
0 Kudos
Message 2 of 2
(4,675 Views)