Discussion:
Read digital inputs from 6 IO lines
(too old to reply)
evangel55
2006-10-20 14:40:13 UTC
Permalink
Hi,
   I don't know if this question has been posted but I am using a M-series 6289 Multifunctional DAQ card currently under CVI. I tried to read digital inputs at 4 Hz from 6 lines at the same time. However, it seems that I missed some digital signals which results in inconsistency. In CVI, I create individual task to read samples from each IO line, which is executed under a "for" loop. Hence, I wonder if there is a more efficient method to perform the same task of reading inputs.
 
YBMessage Edited by evangel55 on 10-20-2006 09:38 AM
Ed W
2006-10-24 05:40:08 UTC
Permalink
Hi evangel55,

 

Which DAQmx function are you currently using?

 

Check out the NI-DAQmx C Reference Help.  Based on your post, I think that the DAQmxWriteDigitalLines would work for your purposes.  The description is shown below. 
DAQmxReadDigitalLines

int32 DAQmxReadDigitalLines (TaskHandle taskHandle, int32 numSampsPerChan, float64 timeout, bool32 fillMode, uInt8 readArray[], uInt32 arraySizeInBytes, int32 *sampsPerChanRead, int32 *numBytesPerSamp, bool32 *reserved);

Purpose:  Reads multiple samples from each digital line in a task. Each line in a channel gets one byte per sample.
I hope this helps, but if this is what you?re currently using or if you're doing something different, then I?d probably need more info ? it may help to post the code with your for loop.

 

Ed W.

Continue reading on narkive:
Loading...