09-23-2009 07:59 PM
I am trying to use 2 counters on the USB-6229 (or USB-6259), where one counter has FiniteSamps and another has ContSamps. I have the following code:
ErrChk DAQmxCreateCOPulseChanTicks(hCnt0, "Dev1/ctr0", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
ErrChk DAQmxCfgImplicitTiming(hCnt0, DAQmx_Val_FiniteSamps, 100);
ErrChk DAQmxCreateCOPulseChanTicks(hCnt1, "Dev1/ctr1", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
ErrChk DAQmxCfgImplicitTiming(hCnt1, DAQmx_Val_ContSamps, 2);
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
Solved! Go to Solution.
09-24-2009 03:45 PM
Hi Vicpik,
What you are seeing is not a bug, the issue here is that finite pulse train generation actually requires two counters for a single task. The details are outlined quite well in the following KB:
How Many Counters Does Each Type of Counter Input or Output Task Take?
If you need to do both task you may need an additional DAQ card, or you could try our new X series cards, that have 4 available counters.
Let us know if you need any further assistance.
Thanks
Scott M.