02-21-2008 03:18 PM
m_DAQmxTask.AIChannels.CreateVoltageChannel(m_Device.AIPhysicalChannels[channelIndex], channelName,
AITerminalConfiguration.Differential, m_ScalingFactor * -1.0, m_ScalingFactor, "BinaryCodes");m_DAQmxTask.Timing.ConfigureSampleClock(
string.Empty, m_ClockFrequency, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, m_NScans);m_DAQmxTask.Triggers.ReferenceTrigger.ConfigureDigitalEdgeTrigger(
"PFI0", DigitalEdgeReferenceTriggerEdge.Rising, m_PreTriggersScans);m_DAQmxTask.Stream.ReadAllAvailableSamples =
true;m_SingleChannelReader =
new AnalogSingleChannelReader(m_DAQmxTask.Stream);m_SingleChannelReader.BeginReadMultiSample(m_NScans,
new AsyncCallback(singleChannelRead), null);then, in singleChannelRead, the line:
double
[] dataArray = m_SingleChannelReader.EndReadMultiSample(iasResult);Gives me a DAQmx error 200281 read relative blah blah blah.
02-28-2008
03:55 PM
- last edited on
11-13-2025
12:39 PM
by
Content Cleaner
Hello Tyzack,
This error is probably occurring, because you have set up a reference trigger (which is designed to acquire pretrigger samples prior to being triggered), but the trigger is occurring before enough pretrigger samples have been acquired.
If you are new to data acquisition in Measurement Studio, I would recommend you check out the program structure of some of our examples, such as AcqVoltageSamples_IntClkDigRef, located in the National Instruments directory on your machine:
\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\AcqVoltageSamples_IntClkDigRef\cs
This is a very helpful example that demonstrates the overall structure of data acquisition in Measurement Studio. I hope that helps.