Hello,
I am experiencing a strange problem when programming a PCI-6259 by
LabWindows/CVI (the example "External_AO_Reference.zip" available on
the NI website was used).
I am trying to output a waveform from AO0 after having previously set AO0 itself to a single fixed value
by means of a dedicated task (by the way, the idea is then to slowly
move the dac output from the actual value to a value matching exactly
the first point of the future waveform, thus avoiding abrupt changes at
the output).
Only after the dac AO0 is set to a value (say -3V) I stop and clear the
respective task and create the waveform generation one using an
external reference. As soon as I write the buffer into the DAC, the
output suddenly changes to an unexpected value(say -0.59V), thus
voiding the previous single point setting. Then the waveform generation
occurs in the expected output range.
This is the code used to set AO0 to a single fixed value:
// Specify and external
reference, which connector pin to input it, and the value it will be.
DAQmxSetChanAttribute (taskHandle, chan, DAQmx_AO_DAC_Ref_Src, DAQmx_Val_External);
DAQmxSetChanAttribute (taskHandle, chan, DAQmx_AO_DAC_Ref_ExtSrc, "/Dev4/APFI0");
DAQmxSetChanAttribute (taskHandle, chan, DAQmx_AO_DAC_Ref_Val, refValue);
// until here AO0 out = -3V
DAQmxErrChk
(Write_ContGenPerWfmIntClk(taskHandle,data,sampsPerCycle));
// here I observe the sudden AO change to
about -0.59 V
DAQmxErrChk
(Start_ContGenPerWfmIntClk(taskHandle));
// here the waveform is output on AO0 as
expected
I have tried many settings and obtained the same behaviour.
Presetting the dac output is of major importance in my application where any sudden change must be avoided.
Can anybody suggest a fix to this problem ?