Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Do Simulated Devices Not Support "ReadRelativeTo" Value of "MostRecentSample"?

Solved!
Go to solution

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-6034I have used this value with real PCI-6034 cards before, so the device should support it, rightIs 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

0 Kudos
Message 1 of 2
(2,879 Views)
Solution
Accepted by topic author SamSkuce
Urgh.  I == idiot.  I wasn't setting the sample clock before attempting to start the task.  Problem solved.
Message 2 of 2
(2,869 Views)