From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-23-2008 01:48 PM
05-27-2008 11:37 AM
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 outputfloat64 f64Min
float64 f64Max
= 1.1; //1.1 max volts outputfloat64 fVal
= 1.0; //1.0 volts. What I want output to beint32 iWritten
= 0;DAQmxErrChk
(DAQmxCreateTask("AO", &m_hNIAOTask));DAQmxErrChk
(DAQmxCreateAOVoltageChan(m_hNIAOTask,"Dev1/ao0",NULL,f64Min,f64Max,DAQmx_Val_Volts,NULL));DAQmxErrChk
(DAQmxWriteAnalogF64(m_hNIAOTask, 1, TRUE, 10.0, DAQmx_Val_GroupByScanNumber, &fVal, &iWritten, NULL));
05-27-2008 02:06 PM
Hi dthess,
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,
05-30-2008 10:57 AM
05-30-2008 11:00 AM
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.
Again thanks,
Don