There are two interfaces for data acquisition. The older Session interface and the new DataAcquisition interface. In either case, you just add input channels to your session/daq object for each input and module.
For example, with the Session interface:
s = daq.createSession('ni');
addAnalogInputChannel(s, 'cDAQ1Mod1', 'ai0', 'Voltage');
ch = addCounterInputChannel(s, 'cDAQ1Mod2', 'ctr0', 'EdgeCount');
ch.Terminal
s.Rate = 10;
s.DurationInSeconds = 1;
data = startForeground(s);
While for the DataAcquisition interface:
dq = daq("ni");
addinput(dq, "cDAQ1Mod1", "ai0", "Voltage");
ch = addinput(d,"cDAQ1Mod5","ctr0","EdgeCount");
ch.Terminal
dq.Rate = 1000;
data = read(dq, seconds(5));
Best Answer