06-11-2015 06:06 PM
Hi,
When I try to output different voltages from two different output channels on the card, I end up getting Error -200077 errorInvalidAttributeValue for the second channel I try to output to. The result is no output. To intialize the channels ("Dev1/ao0" and "Dev1/ao1"), I run the DAQmxCreateAOVoltageChan function assigning 0 and 1 as the task handle. At this point, no errors have been thrown yet. I suspect the error gets thrown when I run DAQmxWriteAnalogF64 to write the voltage to the channel. This problem only happens to the second channel I try to write to. There is no error when I only initialize and run a single channel.
Does anybody know what exactly the error means? What really stumps me is that I swapped the hardware into this computer from another, and it all worked when I tested it on the earlier computer.
If any more information is needed, I can provide it.
06-12-2015 10:27 AM
I got some additional information that might help. I am not sure what it means.
DAQmx Error: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property. Property: DAQmx_SampQuant_SampPerChan Requested Value: 1 Valid Values Begin with: 2 Valid Values End with: 18446744065119617024 Task Name: _unnamedTask<1> Status Code: -200077
The closest thing I can see to the property is the second parameter of DAQmxWriteAnalogF64, called numSampsPerChan. Currently it is set to 1 because I am sending only a single voltage. If I try and set the parameter to 2, the computer will try to access a non-existent element of an array and there is another error. Where can I access this property?
06-12-2015 01:41 PM
Hi dluu,
Try using DAQmxSetSampQuantSampPerChan() to change that setting to something within the appropriate range. Is this the only you are getting? If so, hopefully setting this will help fix your issue.
Paul C
06-12-2015 02:12 PM
Hi,
Thanks for the reply. That is the only error that I am getting. I tried the function that you suggested, but now there is a new problem of:
DAQmx Error: Generation cannot be started, because the selected buffer size is too small. Increase the buffer size. Selected Buffer Size: 1 Minimum Required Buffer Size: 2 Task Name: _unnamedTask<1> Status Code: -200609
Again, this problem only arises on the second channel that I initalized.
Can you tell me if I did this correctly? This is what I did on both channels:
DAQmxCreateTask("",&taskHandle); DAQmxCreateAOVoltageChan(taskHandle,channel,"",0,10,DAQmx_Val_Volts,NULL) DAQmxCfgSampClkTiming(taskHandle,"",mFreqSampling,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,mSampleNumber); DAQmxSetSampQuantSampPerChan( taskHandle , 5 ); DAQmxStartTask(taskHandle);
//This is where the error pops up.
DAQmxErrChk(
DAQmxWriteAnalogF64(taskHandle,
data_length, ///length of input data
1, //auto start
time_out,
DAQmx_Val_GroupByChannel,
in_data_arr, //input data
number_of_data_writen, //See above current function (this is an array of zeros)
NULL)
);