02-22-2010 05:30 PM
I'm using a simulated device in my analog signal acquisition project, and when I try to set the "ReadRelativeTo" property of the Task stream to "MostRecentSample", it throws an error saying I can only use "CurrentReadPosition". This happens with a simulated PCIe-6320 and PCI-6034. I have used this value with real PCI-6034 cards before, so the device should support it, right? Is this a bug, or am I doing something wrong?
Here's my C# code:
Task daqTask = new Task();
daqTask.AIChannels.CreateVoltageChannel("dev2/ai0:5", String.Empty, AITerminalConfiguration.Differential, -10, +10, AIVoltageUnits.Volts);
daqTask.Stream.ReadRelativeTo = ReadRelativeTo.MostRecentSample;
daqTask.Stream.ReadOffset = -1;
daqTask.Start(); /* Exception occurs here. */
And here's the full text of the exception:
Requested value is not a supported value for this property.
Property: NationalInstruments.DAQmx.DaqStream.ReadRelativeTo
You Have Requested: NationalInstruments.DAQmx.ReadRelativeTo.MostRecentSample
You Can Select: NationalInstruments.DAQmx.ReadRelativeTo.CurrentReadPosition
Task Name: _unnamedTask<0>
Status Code: -200077
Solved! Go to Solution.
02-23-2010 10:20 AM