data = s.startForeground
[data,timeStamps,triggerTime] = s.startForeground
s.startForeground starts operations of the session object, s, and blocks MATLAB® command line and other code until the session operation is complete.
To perform other MATLAB operations while the session operation executes, use daq.Session.startBackground.
data = s.startForeground returns the data acquired in the output parameter, data.
[data,timeStamps,triggerTime] = s.startForeground returns the data acquired, timestamps relative to the time the operation is triggered, and a trigger time indicating the absolute time the operation was triggered.
If a session includes output channels, call queueOutputData before calling startForeground.
You cannot perform continuous operations using startForeground. To perform continuous operations use daq.Session.startBackground.
An mxn matrix of doubles where m is the number of scans acquired, and n is the number of input channels in the session.
The timestamps relative to the time the operation is triggered in an mx1 array where m is the number of scans.
A MATLAB serial date time stamp representing the absolute time when timeStamps = 0.
Acquire data by creating a session with an analog input channel:
s = daq.createSession('ni'); s.addAnalogInputChannel('cDAQ1Mod1','ai0','Voltage');
Start the acquisition and save the acquired data into the variable data:
data = s.startForeground;
Generate a signal by creating a session with an analog output channel:
s = daq.createSession('ni'); s.addAnalogOutputChannel('cDAQ1Mod2', 'ao0', 'Voltage')
Create and queue an output signal and start the generation:
outputSignal = linspace(-1, 1, 1000); s.queueOutputData(outputSignal); s.startForeground;