This code executes without error. However when I go to measure ao0 on the USB6009 it still reads 0 volts. All I want to do is lower or raise the output and hold it there on demand. iWritten returns 1.
= 0.0; //0.0 min volts output
float64 f64Max= 1.1; //1.1 max volts output
float64 fVal= 1.0; //1.0 volts. What I want output to be
int32 iWritten= 0;
DAQmxErrChk(DAQmxWriteAnalogF64(m_hNIAOTask, 1, TRUE, 10.0, DAQmx_Val_GroupByScanNumber, &fVal, &iWritten, NULL));
Your code looks good except you never call the DAQmxStartTask function to start the output. This is probably why the output never leaves 0 volts. Once you start the task the output will hold to whatever value you set and not change unless you call the write function again. One thing to remember is that the output will hold the last value written to it even after you stop the task. So if you want the output to be zero volts after your program finishes make sure to write 0 volts to the output before stopping the task. I good example of static timed AO is the example program VoltUpdate. This can be found with the DAQmx ANSI C examples under “C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog Out\Generate Voltage\Volt Update”. Please let me know if you have any questions.
Thanks for the feedback guys. As always it's appreciated.
I found the problem. I was measureing the voltage on non clamped down screw terminals on the block. Apparently the circuit does not carry here. Once I inserted my probe into the clamp port, I saw the voltage swing.