01-05-2009 03:15 PM
Hello,
I'm creating a VI to control a stepper motor by varying the output frequency to the motor driver. Above certain frequency, the motor requires a frquency ramp to reach the desired frequency. So I'd like to configure my VI to slowly ramp up (1kHz/second ramp rate). I have a while loop, and inside I call DAQ create virtual channel (CO Pulse Freq) and then an implicit timing VI to generate continous samples, and then I call start task. Another while loop basically checks the task status and waits for 1 second. What I see is that the frequency input to the DAQ create virtual channel vi changes, but the output frequency doesn't change since no change in speed is observed on the motor. However, if I stop the task after the 1second wait, the frequency input takes effect and different speed is observed on the motor, with a slight delay in response. The delay is undesirable since it defeats the purpose of continous ramping up.
So I'm basically looking for a way to update task parameters dynamically without any delays/pauses.
Does anyone have a suggestion? Thank you in advance.
Solved! Go to Solution.
01-06-2009 10:02 AM
Hi Izong!
First off, I'm not completely following what your vi structure is, but it doesn't sound quite correct. I wrote up a quick VI that does what I think you want. I'll attach a screenshot. The gist of it is, like you said, create the channel and start the task. Then in a loop that runs every 1 second, update the pulse train.
01-06-2009 01:04 PM
Channel property node actually can't change the parameter while the task is running. If you put a probe on the frequency input, it seems like the value is updating, but if you actually hook up a scope on the physical output channel, the value isn't changed.
I found out that to change the parameter on the fly, I have to use DAQ write task vi.
Thanks for looking into it for me.
Lei