Hello all,
I have a panel with a control for the expected input voltage. I use it to set graph vertical range, and I use it for defining a task. I can start and stop the task with a command button. After start, the callback retrieves the maximum expected input, defines the minimum as zero, creates a task, and starts the task:
min = 0.0;
GetCtrlVal (mainpanel, PANEL_INPUTRANGE, &max);
DAQmxErrChk (DAQmxCreateAIVoltageChan(gTaskHandleInput,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
... ... ...
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(gTaskHandleInput,DAQmx_Val_Acquired_Into_Buffer,gSamplesPerChannel,0,ChartModeSingleSampleCallback,NULL));
DAQmxErrChk (DAQmxStartTask(gTaskHandleInput));
I can start and stop the task without errors, and the function for EveryNSamplesEvent puts data on a stripchart.
However when I change the expected input range, e.g. from 1V to 2V, I do not get any data from EveryNSamplesEvent (or maybe only once instead of continuous stream). When I push the stop-button and then the start-button again, the task runs again without errors. So after changing expected input range, it needs start-stop-start where both starts are identical including the creation of a new AIVoltage-task.
This error occurs with simulated devices as well with one tested real instrument (6015). DAQmx is version 8.5.
Q: what happens here ?
Regards, Jos