How do I share a clock between unclocked digital inputs and clocked analog inputs?

43 views (last 30 days)
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-digital-data.html>)
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!
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

Accepted Answer

Satyajeet Sasmal
Satyajeet Sasmal on 2 Mar 2016
The warning is caused by the fact that the specified DAQ device does not support clocked (hardware timed) digital operations (input or output).
Depending on the DAQ device model used, the following scenarios are possible:
1. Many NI DAQ device models do not support clocked digital I/O operations, so only software timed operations (inputSingleScan and outputSingleScan) would be available in this case.
Refer to the manufacturer-provided specifications for the specific DAQ device model/
For example, NI USB 6210 does not support clocked digital IO -- See device specifications at manufacturer’s URL (also see attached screenshot) http://sine.ni.com/nips/cds/view/p/lang/en/nid/203223
Note the following in the specifications example for NI USB 6210:
Timing : Software in the Digital I/O section
Use a DAQ device which supports clocked (hardware timed) operations for the digital I/O subsystem. Use a separate session for channels which do not support clocked operations, for example use analog input channels grouped in one session (s1), and digital channels grouped in a separate session (s2).
2. Some NI DAQ device models have multiple digital I/O ports (groups of lines, or channels in MATLAB), with some of the ports supporting hardware-timed (clocked) digital I/O operations, but some of the ports not supporting clocked operations.
Refer to the manufacturer-provided specifications for the specific DAQ device model
For example from the specifications for NI USB 6361, it looks as though only port 0 (8 lines, P0.0 - P0.7) supports hardware-timed clocked operations, while the other two ports (16 lines, P1.0 - P1.7 and P2.0 - P 2.7) support only software-timed operations.
See device specifications at manufacturer’s URL (also see attached screenshot) http://sine.ni.com/nips/cds/view/p/lang/en/nid/209073 http://sine.ni.com/ds/app/doc/p/id/ds-151/lang/en
Note the following in the specifications example for NI USB 6361: Timing: Software, Hardware Clocked Lines: 8 Maximum Clock Rate: 1 MHz
In this case, to use clocked operations in session, add only digital channels which correspond to a port/line with support for hardware-timed operations.
  1 Comment
Hassan Mehmood Khan
Hassan Mehmood Khan on 29 Jul 2020
How about USB 6009 ,
How can I program for the digitaloutput ?
I am using following code
d = daq.getDevices;
s = daq.createSession('ni');
sig = addDigitalChannel(s,'Dev1','port0/line0','OutputOnly');
signalData = sin(pi/2);
Now i want to Turn off and Turn On, the "sig" ?
How can i do that ?
.

Sign in to comment.

More Answers (0)

Categories

Find more on Simultaneous and Synchronized Operations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!