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.

Adaptor API Reference

This topic provides an overview of each function included in the demo adaptor source file, demoadaptor.cpp, grouped in the following categories. The vendoradaptor.cpp template includes similar functions.

Lifetime

Lifetime functions include those that involve the loading and unloading of the driver interface.

initImpl

Syntax

DAQStatus DemoDriver::initImpl()

Purpose

Initialize and load implementation of daqsdk::IDriver interface

Inputs

None

Output

None

Return status

DAQErr_Driver_Init on failure.

DAQSuccess on success.

termImpl

SyntaxDAQStatus DemoDriver::termImpl()
PurposeTerminate and unload implementation of daqsdk::IDriver interface
InputsNone
OutputNone
Return status

DAQErr_Driver_Term on failure.

DAQSuccess on success.

Enumeration

Enumeration functions involve the recognition of devices, subsystems, and channels.

enumerateDevicesImpl

SyntaxDemoDriver::enumerateDevicesImpl(Index &deviceCount) const
PurposeEnumerate devices available via vendor driver
InputsNone
OutputNumber of the devices enumerated
Return status

DAQErr_Driver_EnumerateDevices on failure.

DAQSuccess on success.

commitDevicesImpl

SyntaxDemoDriver::commitDevicesImpl(Index deviceCount)
PurposeInform the driver that the enumerated devices are to be committed, in enumerated order, for use by the adaptor
InputsNumber of devices enumerated
OutputNone
Return status

DAQErr_Driver_CommitDevices on failure.

DAQSuccess on success.

enumerateSubsystemsImpl

SyntaxDemoDriver::enumerateSubsystemsImpl(Index deviceIndex, Index &subsystemCount) const
PurposeEnumerate the subsystems available via for a given device
InputsIndex of the given device
OutputNumber of the subsystems enumerated
Return status

DAQErr_Driver_EnumerateSubsystems on failure.

DAQSuccess on success.

commitSubsystemsImpl

SyntaxDemoDriver::commitSubsystemsImpl(Index deviceIndex, Index subsystemCount)
PurposeInform the driver that the enumerated subsystems, for a given device, are to be committed, in enumerated order, for use by the adaptor
InputsIndex of the given device, number of the subsystems enumerated
OutputNone
Return status

DAQErr_Driver_CommitSubsystems on failure.

DAQSuccess on success.

enumerateChannelsImpl

SyntaxDemoDriver::enumerateChannelsImpl(Index deviceIndex, Index subsystemIndex, Index &channelCount) const
PurposeEnumerate the channels available via for a given subsystem and device
InputsIndex of the given device, the index of the given subsystem
OutputNumber of the channels enumerated
Return status

DAQErr_Driver_EnumerateChannels on failure.

DAQSuccess on success.

commitChannelsImpl

SyntaxDemoDriver::commitChannelsImpl(Index deviceIndex, Index subsystemIndex, Index channelCount)
PurposeInform the driver that the enumerated channels, for a given device and subsystem, are to be committed, in enumerated order, for use by the Adaptor
InputsIndex of the given device, the index of the given subsystem, the number of channels enumerated
OutputNone
Return status

DAQErr_Driver_CommitChannels on failure.

DAQSuccess on success.

getChannelGroupIndexImpl

SyntaxDemoDriver::getChannelGroupIndexImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, Index &channelGroupIndex) const
PurposeReturn the channel group index corresponding to a specified channel
InputsIndex of the specified device, index of the specified subsystem, index of the specified channel
OutputChannel group index
Return status

DAQErr_Driver_GetChannelGroupIndex on failure.

DAQSuccess on success.

determineOrderOfChannelAdditionImpl

SyntaxDemoDriver::getOrderOfChannelAdditionImpl(daqsdk::OrderOfChannelsInGroup &orderOfChannelsInGroup) const
PurposeReturn an enumeration representing the order in which channels indices are sorted, by the driver, in channel groups
InputsNone
OutputOrder of channels within channel groups
Return status

DAQErr_Driver_OrderOfChannelAddition on failure.

DAQSuccess on success.

Channel groups contain a list of channels ordered first by device, then by subsystem, and finally by channel. The group must acquire data from requested channels either in the listed order ("Sorted") or in the order requested ("InOrderOfAddition"). For example, if the group contains four channels and a user requests channels 4, 2, and 1, they should expect data from the channel group either in the order 4, 2, 1 (the order in which the channels were added) or in the order 1, 2, 4 (sorted). See Channel Groups.

releaseDevicesImpl

SyntaxDemoDriver::releaseDevicesImpl(Index deviceIndex)
PurposeRelease the resources committed by the driver for a specified device
InputsIndex of the device resources to release
OutputNone
Return status

DAQErr_Driver_ReleaseDevices on failure.

DAQSuccess on success.

releaseSubsystemsImpl

SyntaxDemoDriver::releaseSubsystemsImpl(Index deviceIndex, Index subsystemIndex)
PurposeRelease the resources committed by the driver for a specified subsystem and device
InputsIndex of the device resources to release, index of the subsystem resources to release
OutputNone
Return status

DAQErr_Driver_ReleaseSubsystems on failure.

DAQSuccess on success.

releaseChannelsImpl

SyntaxDemoDriver::releaseChannelsImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex)
PurposeRelease the resources committed by the driver for a specified channel of a subsystem of a device
InputsIndex of the device resources to release, index of the subsystem resources to release, index of the channel resources to release
OutputNone
Return status

DAQErr_Driver_ReleaseChannels on failure.

DAQSuccess on success.

Hardware Management

Hardware management functions control the configuration of channel groups.

addChannelImpl

SyntaxDemoDriver::addChannelImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex)
PurposeRegister the specified channel with its channel group
InputsIndex of the device, index of the subsystem for given device, index of the channel for the given subsystem
OutputNone
Return status

DAQErr_Driver_AddChannel on failure.

DAQSuccess on success.

removeChannelImpl

SyntaxDemoDriver::removeChannelImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex)
PurposeUnregister the specified channel from its channel group
InputsIndex of the device, index of the subsystem for given device, index of the channel for the given subsystem
OutputNone
Return status

DAQErr_Driver_RemoveChannel on failure.

DAQSuccess on success.

reserveChannelGroupImpl

SyntaxDemoDriver::reserveChannelGroupImpl(ChannelGroupIndex groupIndex)
PurposeReserve the specified channel group and all its resources
InputsIndex of the channel group
OutputNone
Return status

DAQErr_Driver_ReserveChannelGroup on failure.

DAQSuccess on success.

unreserveChannelGroupImpl

SyntaxDemoDriver::unreserveChannelGroupImpl(ChannelGroupIndex groupIndex)
PurposeUnreserve/release the specified channel group and all its resources
InputsIndex of the channel group
OutputNone
Return status

DAQErr_Driver_UnreserveChannelGroup on failure.

DAQSuccess on success.

Vendor and Device Discovery

These functions retrieve information about vender and device.

getDriverVersionImpl

SyntaxDemoDriver::getDriverVersionImpl(uint32_T &major, uint32_T &minor, uint32_T &patch) const
PurposeReturn driver version number
InputsNone
OutputMajor version number, minor version number, patch version number
Return status

DAQErr_Driver_GetDriverVersion on failure.

DAQSuccess on success.

getVendorInfoImpl

SyntaxDemoDriver::getVendorInfoImpl(std::string &shortName, std::string &fullName, std::string &driverName) const
PurposeReturn relevant vendor information (name and driver-name)
InputsNone
OutputVendor shortname (typically used as a vendor ID), vendor fullname, driver name (including full path)
Return status

DAQErr_Driver_GetVendorInfo on failure.

DAQSuccess on success.

getDeviceInfoImpl

SyntaxDemoDriver::getDeviceInfoImpl(Index deviceIndex, std::string &model, std::string &prefix, std::string &id, std::string &serialNumber, bool &isRecognizedDevice) const
PurposeReturn relevant device information
InputsIndex of the device
OutputDevice model, device prefix (e.g., 'Dev', 'Audio', etc.), device ID, device serial number, indication of whether the driver recognizes and supports the device
Return status

DAQErr_Driver_GetDeviceInfo on failure.

DAQSuccess on success.

getFirmwareVersionImpl

SyntaxDemoDriver::getFirmwareVersionImpl(Index deviceIndex, uint32_T &major, uint32_T &minor, uint32_T &patch) const
PurposeReturn firmware version number
InputsNone
OutputMajor version number, minor version number, patch version number
Return status

DAQErr_Driver_GetFirmwareVersion on failure.

DAQSuccess on success.

Subsystem Discovery

These functions retrieve information about the subsystem.

getSubsystemsOfTypeImpl

SyntaxDemoDriver::getSubsystemsOfTypeImpl(Index deviceIndex, IndexList &subsystemIndices, daqsdk::Subsystem subsystemType, daqsdk::TransferDirection transferDirection) const
PurposeReturn subsystems of a given type (Analog, Digital, etc.) and direction (Input, Output)
InputsIndex of the device, subsystem type, transfer direction
OutputList of subsystem indices with the given type/direction or empty if no matches are found
Return status

DAQErr_Driver_GetSubsystemsOfType on failure to execute the request (but not when no subsystems are found).

DAQSuccess on success.

getMeasurementTypesImpl

SyntaxDemoDriver::getMeasurementTypesImpl(Index deviceIndex, Index subsystemIndex, std::vector<daqdatatypes::MeasurementType> &measurementTypes) const
PurposeReturn the measurement types supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputList of measurement types supported by the specified subsystem
Return status

DAQErr_Driver_GetMeasurementTypes on failure to execute the request (but not when no subsystems are found).

DAQSuccess on success.

getDefaultMeasurementTypeImpl

SyntaxDemoDriver::getDefaultMeasurementTypeImpl(Index deviceIndex, Index subsystemIndex, daqdatatypes::MeasurementType &defaultMeasurementType) const
PurposeReturn the default measurement type supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputDefault measurement types supported by the specified subsystem
Return status

DAQErr_Driver_GetDefaultMeasurementType on failure.

DAQSuccess on success.

getRateLimitImpl

SyntaxDemoDriver::getRateLimitImpl(Index deviceIndex, Index subsystemIndex, daqdatatypes::RateLimit &rateLimit) const
PurposeReturn the rate limits supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputRate limits supported by the specified subsystem
Return status

DAQErr_Driver_GetRateLimit on failure.

DAQSuccess on success.

getResolutionImpl

SyntaxDemoDriver::getResolutionImpl(Index deviceIndex, Index subsystemIndex, uint8_T &resolution) const
PurposeReturn the measurement resolution supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputMeasurement resolution supported by the specified subsystem
Return status

DAQErr_Driver_GetResolution on failure.

DAQSuccess on success.

getTerminalConfigsImpl

SyntaxDemoDriver::getTerminalConfigsImpl(Index deviceIndex, Index subsystemIndex, std::vector<daqdatatypes::TerminalConfiguration> &terminalConfigurations) const
PurposeReturn the terminal configurations supported by a specified subsystem and device for each channel
InputsIndex of the device, index of the subsystem
OutputTerminal configurations supported by the specified subsystem
Return status

DAQErr_Driver_GetTerminalConfigs on failure.

DAQSuccess on success.

getRangesAvailableForTerminalConfigImpl

SyntaxDemoDriver::getRangesAvailableForTerminalConfigImpl(Index deviceIndex, Index subsystemIndex, daqdatatypes::TerminalConfiguration terminalConfig, std::vector<daqdatatypes::Range> &ranges) const
PurposeReturn ranges supported by specified terminal configuration for subsystem and device
InputsIndex of the device, index of the subsystem, terminal configuration type
OutputRanges supported by the specified terminal configuration for a given subsystem
Return status

DAQErr_Driver_GetRangesAvailableForTerminalConfig on failure.

DAQSuccess on success.

getDefaultTerminalConfigsImpl

SyntaxDemoDriver::getDefaultTerminalConfigsImpl(Index deviceIndex, Index subsystemIndex, std::vector<daqdatatypes::TerminalConfiguration> &defaultTerminalConfigs) const
PurposeReturn the default terminal configuration types supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputDefault terminal configuration types supported by the specified subsystem
Return status

DAQErr_Driver_GetDefaultTerminalConfigs on failure.

DAQSuccess on success.

isOnDemandOperationSupportedImpl

SyntaxDemoDriver::isOnDemandOperationSupportedImpl(Index deviceIndex, Index subsystemIndex, bool &isSupported) const
PurposeIndicate whether on-demand operations are supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputWhether on-demand operations are supported by the specified subsystem
Return status

DAQErr_Driver_IsOnDemandOperationSupported on failure.

DAQSuccess on success.

getCouplingsImpl

SyntaxDemoDriver::getCouplingsImpl(Index deviceIndex, Index subsystemIndex, std::vector<daqdatatypes::Coupling> &couplings) const
PurposeReturn the couplings supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputCouplings supported by the specified subsystem
Return status

DAQErr_Driver_GetCouplings on failure.

DAQSuccess on success.

getDefaultCouplingImpl

SyntaxDemoDriver::getDefaultCouplingImpl(Index deviceIndex, Index subsystemIndex, daqdatatypes::Coupling &defaultCoupling) const
PurposeReturn the default coupling supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputDefault coupling supported by the specified subsystem
Return status

DAQErr_Driver_GetDefaultCoupling on failure.

DAQSuccess on success.

getSampleTypesImpl

SyntaxDemoDriver::getSampleTypesImpl(Index deviceIndex, Index subsystemIndex, std::vector<daqdatatypes::SampleType> &sampleTypes) const
PurposeReturn the sample types supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputSample types supported by the specified subsystem
Return status

DAQErr_Driver_GetSampleTypes on failure.

DAQSuccess on success.

getDefaultSamplingTypeImpl

SyntaxDemoDriver::getDefaultSamplingTypeImpl(Index deviceIndex, Index subsystemIndex, daqdatatypes::SampleType &defaultSampleType) const
PurposeReturn the default sample type supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputDefault sample type supported by the specified subsystem
Return status

DAQErr_Driver_GetDefaultSamplingType on failure.

DAQSuccess on success.

getChannelNamesImpl

SyntaxDemoDriver::getChannelNamesImpl(Index deviceIndex, Index subsystemIndex, std::vector<std::string> &channelNames) const
PurposeReturn the channel names supported by a specified subsystem and device
InputsIndex of the device, index of the subsystem
OutputChannel names supported by the specified subsystem
Return status

DAQErr_Driver_GetChannelNames on failure.

DAQSuccess on success.

Configuration

Configuration functions control rates, ranges, and coupling.

getRateImpl

SyntaxDemoDriver::getRateImpl(ChannelGroupIndex groupIndex, daqsdk::float64 &rate) const
PurposeReturn the rate supported by a specified channel group in its current configuration
InputsIndex of the group
OutputRate supported by the specified channel group
Return status

DAQErr_Driver_GetRate on failure.

DAQSuccess on success.

setRateImpl

SyntaxDemoDriver::setRateImpl(ChannelGroupIndex groupIndex, daqsdk::float64 rate)
PurposeSet the rate for a specified channel group in its current configuration
InputsIndex of the group, rate
OutputNone
Return status

DAQErr_Driver_SetRate on failure.

DAQSuccess on success.

getChannelCouplingImpl

SyntaxDemoDriver::getChannelCouplingImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, daqdatatypes::Coupling &coupling) const
PurposeReturn the channel coupling of a specified channel for a given subsystem and device
InputsIndex of the device, index of the subsystem, index of the channel
OutputCoupling supported by the specified channel
Return status

DAQErr_Driver_GetChannelCoupling on failure.

DAQSuccess on success.

setChannelCouplingImpl

SyntaxDemoDriver::setChannelCouplingImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, std::string coupling)
PurposeSet the channel coupling of a specified channel for a given subsystem and device
InputsIndex of the device, index of the subsystem, index of the channel
OutputNone
Return status

DAQErr_Driver_SetChannelCoupling on failure.

DAQSuccess on success.

getChannelTerminalConfigImpl

SyntaxDemoDriver::getChannelTerminalConfigImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, daqdatatypes::TerminalConfiguration &terminalConfig) const
PurposeReturn the terminal configuration of a specified channel for a given subsystem and device
InputsIndex of the device, index of the subsystem, index of the channel
OutputTerminal configuration supported by the specified channel
Return status

DAQErr_Driver_GetChannelTerminalConfig on failure.

DAQSuccess on success.

setChannelTerminalConfigImpl

SyntaxDemoDriver::setChannelTerminalConfigImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, std::string terminalConfig)
PurposeSet the terminal configuration of a specified channel for a given subsystem and device
InputsIndex of the device, index of the subsystem, index of the channel
OutputNone
Return status

DAQErr_Driver_SetChannelTerminalConfig on failure.

DAQSuccess on success.

getChannelRangeImpl

SyntaxDemoDriver::getChannelRangeImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, daqdatatypes::Range &range) const
PurposeReturn the range of a specified channel for a given subsystem and device
InputsIndex of the device, index of the subsystem, index of the channel
OutputRange supported by the specified channel
Return status

DAQErr_Driver_GetChannelRange on failure.

DAQSuccess on success.

setChannelRangeImpl

SyntaxDemoDriver::setChannelRangeImpl(Index deviceIndex, Index subsystemIndex, Index channelIndex, daqdatatypes::Range range)
PurposeSet the range of a specified channel for a given subsystem and device
InputsIndex of the device, index of the subsystem, index of the channel
OutputNone
Return status

DAQErr_Driver_SetChannelRange on failure.

DAQSuccess on success.

Reservation

Reservation functions query device and channel availability.

isDeviceAvailableImpl

SyntaxDemoDriver::isDeviceAvailableImpl(Index deviceIndex, bool &isDeviceAvailable) const
PurposeReturn whether or not a specified device is still available, connected, committed, and enumerated
InputsIndex of the device
OutputReturn whether or not the device is available as previously committed and enumerated
Return status

DAQErr_Driver_IsDeviceAvailable on failure.

DAQSuccess on success.

isRegistrationReservationImpl

SyntaxDemoDriver::isRegistrationReservationImpl(Index deviceIndex, bool &isReservation) const
PurposeReturn whether or not registering a channel in a channel group reserves the channel group
InputsIndex of the channel group
OutputReturn whether or not “registration is reservation.” (See Channel Groups.)
Return status

DAQErr_Driver_IsRegistrationReservation on failure.

DAQSuccess on success.

Single Scans

Single scan functions acquire or generate a static scan of data.

inputSingleScan

SyntaxDemoDriver::inputSingleScanImpl(ChannelGroupIndex groupIndex, DataScan &data) const
PurposeAcquire a scan of data for all channels registered with a channel group
InputsNone
OutputAcquired scan of data
Return status

DAQErr_Driver_InputSingleScan on failure.

DAQSuccess on success.

OutputSingleScan

SyntaxDemoDriver::outputSingleScanImpl(ChannelGroupIndex groupIndex, DataScan &&outputData) const
PurposeGenerate a scan of data for all channels registered with a channel group
InputsData to generate output
OutputNone
Return status

DAQErr_Driver_OutputSingleScan on failure.

DAQSuccess on success.

Related Examples

More About

Was this topic helpful?