Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2167

"Timeout expired before operation could complete" while using NI-9423 in Matlab

$
0
0

Hello,

I'm trying to read data from Digital Module NI-9423 installed in a CompactDAQ chassis cDAQ-9191. I have simple photoelectric sensor connected to NI-9423. 

I'm running following comands in Matlab (I named my device "net1" in NI MAX and have my sensor connected to port0/line0):

 

s = daq.createSession('ni')
s.addDigitalChannel('net1','port0/line0', 'Inputonly');
addClockConnection(s,'external','net1/PFI0','ScanClock');
data = startForeground(s);

This simple code keeps giving me "Timeout expired before operation could complete" error.

 

In NI MAX test panels everything works fine. State is changing in right port and right line when I'm putting something in front of the sensor. I can also run command in Matlab:

inputSingleScan(s)

and the answer is presented with no problems (1 when there is something in front of the sensor and 0 otherwise). But i need to work with real time data collected with startForeground command.

 I also tried simulating exactly the same configuration (NI-9423 installed in cDAQ-9191) in NI MAX and tried to work with simulated device in Matlab, running the same code as posted above. This approach works fine, I'm getting matrix "data" with zeros and ones alternately, exactly how it is presented in test panel of simulated device. But of course I need to work with real device and real data.

Can someone please tell me what I can try to fix my issue?
Any help would be greatly appreciated.  

PS. Here is output of command getVendors in Matlab containing my version of Matlab and NI driver version:

>> daq.getVendors

ans = 

Data acquisition vendor 'National Instruments':

            ID: 'ni'
      FullName: 'National Instruments'
AdaptorVersion: '3.13 (R2018a)'
 DriverVersion: '17.6.0 NI-DAQmx'
 IsOperational: true

 


Viewing all articles
Browse latest Browse all 2167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>