04-16-2009 10:30 AM
Hello,
I'm trying to write a stepper driver output that ramps up in frequency. I have it running with a fixed number of steps and a fixed frequency. I'm just trying to ramp from 0Hz to some speed over a fixed period of time using the ANSI-C function DAQmxWriteCtrFreqScalar. When I call it on a task (regardless of if it's running or not) it fails with the status response -20459:
Measurements: Write failed, because there are no output channels in this task to which data can be written.
Task Name: linMotorDrv
Status Code: -200459
Is there a way to change the frequency of a continuous pulse train while it's running? And does anyone know why I wouldn't be able to write to this output channel? I'm able to set all the parameters when configuring the task initially, but never again after.
Thanks in advance.
-mtburt
04-17-2009 01:31 PM
Hi mtburt,
Welcome to the NI forums!
This thread covers the same issue (coded in LabVIEW). Instead of calling DAQmx Write, I would suggest using the DAQmxSetCOPulseFreq and DAQmxSetCOPulseDutyCyc functions:
This should allow you to change your pulse settings on the fly in software. There is an open Corrective Action Request regarding the misleading error message--we hope to fix this soon to make things more clear. Thanks for posting and have a great day!
-John