This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Acquire Digital Data Using an External Clock via Chassis PFI Terminal

The following example shows how to acquire clocked digital data using an external clock provided at the CompactDAQ chassis PFI terminal.

%% Setup
% cDAQ 9178 chassis
% cDAQ2Mod3 is 9402
% Digital signal is connected to PFI0 terminal of NI 9402 module
% Function generator provides 100 kHz clock to PFI0 terminal on NI 9178
% chassis

s = daq.createSession('ni');
addDigitalChannel(s, 'cDAQ2Mod3', 'Port0/Line0', 'InputOnly');
addClockConnection(s, 'External', 'cDAQ2/PFI0', 'ScanClock');
s.Rate = 100E+3;
[data, timestamps] = startForeground(s);
plot(timestamps, data);