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')
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:
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:
I figured it out by myself. I made very simple mistake, just added wrong clock connection. If you have similar error try running command terminals and use other terminal to clock connection. For example I modified my clock connection: