Hi,
I'm having problem to read a subset of the 6259 DAQ port lines. Even though I define the physical channels to be 16 bits from line 0 to 15, It failed when I use the "ReadMultiSamplePortUInt16Async" function. The error message -200878 complains that the digital channel contains more bits than supported by the 16-bit version of DAQmx Port Read and suggest to use the 32 bit version.
It'll work if I use the "ReadMultiSamplePortUInt32Async" function. My questions are:
1) Why the "ReadMultiSamplePortUInt16Async" fails when the data size is 16 bits defined from line 0 to line 15?
2) If I use the "ReadMultiSamplePortUInt32Async" function, can I still use port0/line16:31 on other tasks such as digital outupt operation independent of the digital input from line0:15?
3) What is the best solution to read a subset of a port without affecting the rest of the lines?
The following is the code:
m_Task = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask("DigitalInputTask"));
// Create the digital input channel
m_Task->DIChannels.CreateChannel("Dev3/port0/line0:15", "", DAQmxOneChannelForAllLines);
// Configure the sample clock
m_Task->Timing.ConfigureSampleClock(m_ClockSource, m_SampleRate,
DAQmxSampleClockActiveEdgeRising, DAQmxSampleQuantityModeContinuousSamples, 1000);
// Create the reader
m_Reader = std::auto_ptr<CNiDAQmxDigitalSingleChannelReader>(new CNiDAQmxDigitalSingleChannelReader(m_Task->Stream));
m_Reader->InstallEventHandler(*this, OnReadEvent);
m_Reader->ReadMultiSamplePortUInt16Async(m_NumberOfSamples, m_Data, m_Dlg);
Thanks in advance!
Ray