07-09-2007 06:08 AM
07-12-2007 04:46 AM
07-12-2007 10:24 AM
07-14-2007 07:02 PM
Marco,
thanx a lot for looking into this and for your help. I tried your suggestions. It didn't work for me though. The sequence
DAQmxCreateCOPulseChanTicks (taskHandle, chan, "", "OnboardClock", DAQmx_Val_Low, 0.0, 100, 100);
DAQmxSetChanAttribute (taskHandle, chan, DAQmx_CO_Pulse_HighTicks, ticks);
resulted in the same error message. As suggested, I also tried the Write-function:
DAQmxWriteCtrTicksScalar (taskHandle, 0, 10.0, highticks, lowticks, 0);
which triggered a similar error:
Function DAQmxWriteCtrTicksScalar: (return value == -200846 [0xfffcef72]). Measurements: Write cannot be performed when the auto start input to DAQmx Write is false, task is not running, and timing for the task is not configured or Timing Type is set to On Demand. Set auto start to true, start the task, or configure timing and specify Timing Type other than On Demand. Task Name: _unnamedTask<0> Status Code: -200846
So far, I have not found a way to change the lowticks/highticks of a pulse in a finite counter output, while the task is not running. Changing the ticks with either the SetChanAttribute or the WriteCtrTicks seen to only apply to continuous counter output tasks. Curiously, I never encountered this problem with the old DAQ driver:
GPCTR_Change_Parameter (device,ND_COUNTER_0,ND_COUNT_1,lowticks);
GPCTR_Change_Parameter (device,ND_COUNTER_0,ND_COUNT_2,highticks);
worked fine for single pulse output. However, the old DAQ driver does not support the new M-series boards. I need to change the pulse duration in my application to create specific finite pulse patterns and have to do this before the counters are COMMITED (ARMED in the old DAQ driver) again for another finite pulse pattern.
I'm very puzzled at the moment. More help is very much appreciated.
Thanks a lot in advance, Jens