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.

Adaptor Functions for a Data Acquisition Session

This topic lists the adaptor and streaming functions that need to be implemented for each stage and operation of a session lifetime.

Device Discovery

Device discovery is accomplished with the daq.getDevices function. Implement the following adaptor functions for this task.

Adaptor FunctionsNotes
initImpl
enumerateDevicesImpl
commitDevicesImpl
getOrderOfChannelAdditionImpl

Devices — Identify devices for driver.

enumerateSubsystemsImpl
commitSubsystemsImpl

Device Subsystems — Repeated for each device.

enumerateChannelsImpl
commitChannelsImpl

Subsystem Channels — Repeated for each subsystem of each device.

getChannelGroupIndexImpl

Channel Index — Repeated for each channel of each subsystem.

getVendorInfoImpl	
getDriverVersionImpl

Vendor Information — Get the vendor information and driver information.

getDeviceInfoImpl
getFirmwareVersionImpl
Device Information — Get the device information. Repeated for each device.
getSubsystemsOfTypeImpl
getMeasurementTypesImpl
getDefaultMeasurementTypeImpl
getCouplingsImpl
getDefaultCouplingImpl
getSampleTypesImpl
getDefaultSamplingTypeImpl
getNativeDataTypeImpl
getRateLimitImpl
getResolutionImpl
getTerminalConfigsImpl
getRangesAvailableForTerminalConfigImpl
getRangesAvailableForTerminalConfigImpl
getDefaultTerminalConfigImpl
isOnDemandOperationSupportedImpl
getChannelNamesImpl

Analog Input — Repeated for each device with an analog input subsystem.

getSubsystemsOfTypeImpl
getMeasurementTypesImpl
getDefaultMeasurementTypeImpl
getNativeDataTypeImpl
getRateLimitImpl
getResolutionImpl
getTerminalConfigsImpl
getRangesAvailableForTerminalConfigImpl
getDefaultTerminalConfigImpl
isOnDemandOperationSupportedImpl
getChannelNamesImpl

Analog Output — Repeated for each device with an analog output subsystem.

getSubsystemsOfTypeImpl
getMeasurementTypesImpl
getDefaultMeasurementTypeImpl
getRateLimitImpl
isOnDemandOperationSupportedImpl
getDigitalChannelTypesImpl
getChannelNamesImpl
Digital Input/Output — Repeated for each device with a digital input/output subsystem.

Session Configuration and Single Scan Operation

The session configuration controls which devices and channel settings you use for data input and output. For each of the following data acquisition session functions, implement the corresponding adaptor functions.

Session FunctionAdaptor FunctionsNotes

addAnalogInputChannel

addAnalogOutputChannel

addDigitalChannel

addChannelImpl
getGroupRateLimitsImpl
setRateImpl
getRateImpl
Repeated for each channel added to the session.
removeChannel
removeChannelImpl
getGroupRateLimitsImpl
 
session.Rate
unreserveChannelGroupImpl
setRateImpl
getRateImpl

Set the session Rate property value.

inputSingleScan
inputSingleScanImpl
 
outputSingleScan
outputSingleScanImpl
 
prepare
isDeviceAvailableImpl
reserveChannelGroupImpl
 
release
unreserveChannelGroupImpl
 

Streaming

Streaming uses DAQStream objects for transferring data between the session and the device driver. The session configuration is necessary to support streaming.

Implement the following functions for the adaptor or stream objects, as indicated in the notes.

Session FunctionSource FunctionsNotes
queueOutputData No adaptor stream function.

startForeground

startBackground

makeStream
initialize
terminate
configureStream
unconfigureStream
registerCallbacks
unregisterCallbacks
prestart
start
stop
getNumInputScansAvailable
getNumScansOutputByHardware
getOutputBufferSize
flushOutputBuffer
isDeviceDone
read
write
readWrite
Implemented in daqstream* code. See Streaming API Reference and Streaming Sequence Diagrams.
stop
stop
Session function used for stopping background operation.

Session Reset

Session FunctionAdaptor FunctionsNotes
daqreset releaseChannelsImplRepeated for all channels.
releaseSubsystemsImplRepeated for all subsystems.
releaseDevicesImplRepeated for all devices.
termImplTerminate sessions.

Related Topics