I am confused by the documentation and behavior of DAQmxReadDigitalLines(). The function has parameters sampsPerChanRead and numBytesPerSamp. These should tell you how many bytes were read in a given call.
Now I do something like this (please pardon the elipses):
DAQmxCreateTask(...)
DAQmxCreateDIChan(... "dev1/port0/line0:3", DAQmxChanForAllLines)
DAQmxCreateDIChan(... "dev1/port0/line5:7", DAQmxChanForAllLines)
DAQmxReadDigitalLines(... &sampsPerChanRead, &numBytesPerSamp)
This reads just one sample, as I have not configured any timing for it. The values of the parameters are
sampsPerChanRead=1
numBytesPerSamp=4
but I see that the data array has 7 bytes set. This looks like a bug to me: the value of 4 bytes would seem to come from the fact that I configured 4 lines in the first call to DAQmxCreateDIChan(). The actual 7 bytes read would seem to come from the fact that I configure a total of 7 lines in the task.
My guess is that this isn't the way I was expected to do this, so this case was overlooked.
Is that right?
Thanks for any light you can shed on this matter.
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com