Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx read giving unexpected results

Hi

I have a new compactDAQ system and am working out the kinks of getting used to the new hardware.  I have a simple example to test my DIO functionality, but the results are very weird.

 

I have a cDAQ-9401 that I am using as a digital input device.  I have another 9401 that I am temporarily using to generate digital output signals to detect.  I simply have line 0 of each device connected.

 

I am running Labview 2011.  I modified a simple change detection / event generation example to read the digital input lines on one device. I am reading all 8 input lines, but I am detecting a change only on line 0.  When I try to read all eight lines of the 9401 after a change detection generates an event, I am getting unexpected (to me, at least) results.

 

I have attached two versions of the same program.  In the first version, I use DAQmx-Read (Digital 1D BoolNChan 1Samp 1Line) and connect the output to a 1D boolean array on the display.  In the second version, I use DAQmx-Read (Digital 2D BoolNChan 1Samp NLine) and display a 2D boolean array.

 

The first version returns an error.  The second version runs fine, displaying a 1D array of booleans.

 

Can anybody explain why the first version doesn't work?

 

 

Download All
0 Kudos
Message 1 of 3
(4,992 Views)

Hello DirtDr,

 

Thanks for posting at NI forums! Could you specify what’s the error code and message you’re getting?

 

Best Regards,

 

Alina M

Applications Engineering

National Instruments

0 Kudos
Message 2 of 3
(4,948 Views)

Error -200463 occurred at read DI event boolean.vi

 

Possible reason(s): Specified read or write operation failed, because the number of lines in the data for a channel does not match the number of lines in the channel. If you are using the Digital Waveform datatype, make sure the number of lines in the digital waveform matches the number of lines in the channel. If you are using boolean data, make sure the array dimension for lines in the data matches the number of lines in the channel. Number of Lines in Channel: 8 Number of Lines in Data: 1 Task Name: _unnamedTask<3>

 

 

0 Kudos
Message 3 of 3
(4,945 Views)