01-03-2006 04:29 PM - edited 01-03-2006 04:29 PM
Message Edited by sdewey on 01-03-2006 04:41 PM
01-04-2006 11:35 AM
01-04-2006 03:27 PM
Thanks Michael,
I ended up using a much simpler section of code:
DAQmxErrChk DAQmxCreateTask("", taskHandle)
DAQmxErrChk DAQmxCreateAOVoltageChan(taskHandle, "Dev1/ao0", _
"aoChannel", 0, 5, DAQmx_Val_VoltageUnits2_Volts, "")
DAQmxErrChk DAQmxWriteAnalogScalarF64(taskHandle, True, 10, AOut, ByVal 0&)
And it seems to work well. I was hoping to clean it up a bit and tried to pull the DAQmxCreateTask command out of the control loop, but it doesn't seem to work if a new task isn't created each time a new value is written.
Does it have to create a new task each time? Does it automatically clear the last task after it writes the new value?
-Shawn
01-04-2006 04:11 PM
Shawn,
Try putting a DAQmxBaseStartTask before the DAQmxWriteAnalogScalarF64. You shouldn't have to create the task over and over.