01-13-2012 04:43 PM
I am aquiring data using a USB-6210 A/D, and it works great until I try to take a waveform longer than 10s.
When I take a waveform longer than that, I get error 200284, "Some or all of the samples requested have not yet been acquired. To wait for the samples to become available use a longer read timeout..."
No problem, I thought, I'll just set a longer timeout. I searched through the documentation, and the only timeout I found was the Watchdog timeout. When I tried to set that to a longer value, I get status code -200452 - specific property is not supported by the device or is not applicable to the task.
I am using the code from the AcqVoltageSamples_IntClk.2008 .net sample with C# in Visual Studio 2008, .net 3.5 sp1.
How do I set the timeout so that ReadWaveform() does not timeout?
Here is the code:
privateAnalogMultiChannelReaderchannelReader;
privateAnalogWaveform<double> awf;
publicList<double> GetWaveForm()
{
try
{
Task getWaveform = newTask();
getWaveform.AIChannels.CreateVoltageChannel(Channel,"", TerminalConfiguration,RangeMinimum,
RangeMaximum,AIVoltageUnits.Volts);
getWaveform.Timing.ConfigureSampleClock("", SampleRate, SampleClockActiveEdge.Rising,
SampleQuantityMode.FiniteSamples, NumSamples);
getWaveform.Control(TaskAction.Verify);
channelReader = new AnalogMultiChannelReader(getWaveform.Stream);
AnalogWaveform<double>[] data = channelReader.ReadWaveform(NumSamples);
awf = data[0];
samples = new List<double>();
for(inti=0; i<NumSamples ; ++i) samples.Add( awf.Samples[i].Value );
returnsamples;
}
catch( DaqExceptionexception)
{
MessageBox.Show( exception.Message);
}
List<double> l = newList<double>();
return l;
}
Thanks,
Curt
Solved! Go to Solution.
01-20-2012 10:52 AM
Hi Curt,
Here is a Knowledge Base that can help you set the Timeout parameter in your code:
Using the DAQmx Task Timeout Property in Visual Studio
01-20-2012 11:42 AM
Thanks! That helps a lot!
Curt