Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Read digital inputs from 6 IO lines

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.
 
YB

Message Edited by evangel55 on 10-20-2006 09:38 AM

0 Kudos
Message 1 of 4
(3,552 Views)
Is there a CVI supported command to read the entire port at once? Then just mask and extract the line data bits you need to operate on.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 4
(3,544 Views)

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.

0 Kudos
Message 3 of 4
(3,501 Views)
Sorry, the last post should read
 
DAQmxReadDigitalLines
 
Ed. W
0 Kudos
Message 4 of 4
(3,501 Views)