Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxSetChanAttribute: Runtime error on setting HighTicks/LowTicks

Trying to change the counter's LowTicks or HighTicks of a configured and but not running (and not comitted) CO task:
 
DAQmxSetChanAttribute (task, chan, DAQmx_CO_Pulse_HighTicks, ticks);
 
results in the error message:
 
 NON-FATAL RUN-TIME ERROR:   "c:\...\CVI81\source\UH FTMW++\nimio.c", line 15561, col 41, thread id 0x00000BB4:   Function DAQmxSetChanAttribute: (return value == -200973 [0xfffceef3]). Measurements: Property cannot be queried because the task is not running.  Start the task prior to getting the specified property. Task Name: _unnamedTask<0>  Status Code: -200973
How can I change the counter's LowTicks or HighTicks of an existing counter channel (while not running) without having to recreate the channel? Thank you for your help.
0 Kudos
Message 1 of 4
(3,797 Views)
Hi,

currently I don´t know why there´s an error at that function.
I did the same in LabVIEW and got no errors.
But in CVI I also get an error -200452 "...not applicable to the task"
I asked our R&D about this issue and will be right back at you when i receive the answer.

But btw, why don´t u just use write-function to update the ticks?
Anyway nothing happens before sterting the task...

regards

Marco Brauner
0 Kudos
Message 2 of 4
(3,782 Views)
It seems that when you use

DAQmxCreateCOPulseChanTicks (taskHandle, chan, "", "OnboardClock",
                                     DAQmx_Val_Low, 0.0, 100, 100);

and then before starting the task

DAQmxSetChanAttribute (taskHandle, chan, DAQmx_CO_Pulse_HighTicks, ticks);  

there is no problem.



Marco Brauner NIG
0 Kudos
Message 3 of 4
(3,780 Views)

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

 

0 Kudos
Message 4 of 4
(3,765 Views)