Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquiring digital inputs using NI USB6003 DAQ

Solved!
Go to solution

Hi,

 

I am using a NI DAQ USB6003 and would like to acquire digital and analog inputs with MATLAB (2015, 64-bit). I have no problems with the analog acquisition, but when I try to add a digital channel, I get a warning as follows:

 

Warning: A channel that does not support clocked sampling was added to the session. Clocked operations using startForeground and startBackground will be disabled. Only on-demand operations using inputSingleScan and outputSingleScan can be done. 

 

As I would like to continuously acquire data and also match the digital acquisition rates with the analog channels, I tried configuring MATLAB to share the clock with the analog inputs (http://uk.mathworks.com/help/daq/share-an-analog-input-subsystems-internal-clock-to-acquire-clocked-...

 

My code is simply as follows:

 

s = daq.createSession('ni');

addAnalogInputChannel(s,'Dev1',0,'Voltage')

addDigitalChannel(s,'Dev1','port1/line3','InputOnly')

 

But once the digital channel is added, the same warning comes up. I have the same problem using the counter inputs. Any ideas on how I can get around this? Please let me know if any further information is needed!

 

Thank you!

 

Best Regards

Cheryl

 

P.S. Not sure if this is helpful but here is some information on the device:

 

ni: National Instruments USB-6003 (Device ID: 'Dev1')

   Analog input subsystem supports:

      -10 to +10 Volts range

      Rates from 0.1 to 100000.0 scans/sec

      8 channels ('ai0' - 'ai7')

      'Voltage' measurement type

   

   Analog output subsystem supports:

      -10 to +10 Volts range

      Rates from 0.1 to 5000.0 scans/sec

      2 channels ('ao0','ao1')

      'Voltage' measurement type

   

   Digital subsystem supports:

      13 channels ('port0/line0' - 'port2/line0')

      'InputOnly','OutputOnly','Bidirectional' measurement types

   

   Counter input subsystem supports:

      1 channel ('ctr0')

      'EdgeCount' measurement type

0 Kudos
Message 1 of 3
(6,513 Views)
Solution
Accepted by cherylteresa

Hi Cheryl,

 

The error you are getting appears to be because you are trying to use a PFI line as a sample clock for the DI. The error is telling you that the device doesn't support "clocked sampling" meaning the device can't sample at a rate determined by every time a digital signal goes high. This is confirmed by going to the data sheet for the USB 6003 (http://www.ni.com/pdf/manuals/374372a.pdf). Page 3 says that the DI portion of the card only supports "Static Digital Input" which means software timed reads. Therefore it can not sample at a "clocked" a.k.a. "hardware" determined rate. It can only read the DI lines at intervals determined by when you call the Read function in software, not determined by a physical line repeatedly going high. 

 

Considering that you were trying to do something that this device physically can not do, you may be able to still use the device, but you certainly need to rethink your methodology. If you need hardware timing, I’d recommend having a conversation with NI who might help you find a device that can do what you need. Maybe a USB X Series or a cDAQ solution would be a good fit.

 

I hope this helps,

Eric

 

Message 2 of 3
(6,502 Views)

Hi Eric,

 

Ah I see, it was a misunderstanding on my part. Thank you for the clarification!

 

Best Regards

 

Cheryl

0 Kudos
Message 3 of 3
(6,486 Views)