Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

inputSingleScan

Acquire single scan from all input channels

Syntax

data = inputSingleScan(s);
[data,triggerTime] = inputSingleScan(s);

Description

example

data = inputSingleScan(s); returns an immediately acquired single scan from each input channel in the session as a 1-by-n array of doubles. The value is stored in data, where n is the number of input channels in the session.

Tip

To acquire more than a single scan, use startForeground.

example

[data,triggerTime] = inputSingleScan(s); returns an immediately acquired single scan from each input channel in the session as a 1-by-n array of doubles. The value is stored in data, where n is the number of input channels in the session and the MATLAB® serial date timestamp representing the time the data is acquired is returned in triggerTime.

Examples

collapse all

Acquire a single input from an analog channel.

Create a session and add two analog input channels:

s = daq.createSession('ni');
addAnalogInputChannel(s,'cDAQ1Mod1',1:2,'Voltage');

Input a single scan:

 data = inputSingleScan(s)
data =

   -0.1495    0.8643

Acquire a single input from a digital channel and get data and the trigger time of the acquisition.

Create a session and add two digital channels with InputOnly measurement type:

s = daq.createSession('ni');
addDigitalChannel(s,'dev1','Port0/Line0:1','InputOnly');

Input a single scan:

 [data,triggerTime] = inputSingleScan(s)

Acquire a single input from a counter channel.

Create a session and add a counter input channel with EdgeCount measurement type:

s = daq.createSession('ni');
addCounterInputChannel(s,'Dev1',0,'EdgeCount');

Input a single edge count:

 data = inputSingleScan(s)

Input Arguments

collapse all

Data acquisition session, specified as a session object. Create the session object using daq.createSession. Use the data acquisition session for acquisition and generation operations. Create one session per vendor and use that vendor session to perform all data acquisition operations.

Output Arguments

collapse all

Value from acquired data, returned as a 1-by-n array of doubles.

Timestamp of acquired data which is a MATLAB serial date timestamp representing the absolute time when timeStamps = 0.

Introduced in R2010b

Was this topic helpful?