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.

Vendor Adaptor Templates

The Data Acquisition Toolbox™ SDK is installed with a set of source file stubs for an adaptor called VendorAdaptor. The source files are installed in the folder:

matlabroot\toolbox\daq\daqsdk\src\daqadaptor\VendorAdaptor

The basic components and structure of the source files for this adaptor are the same as those in the DemoAdaptor. If you need to create an adaptor from scratch, it is recommended that you use a copy of the VendorAdaptor source files. The following table indicates the purpose of each source file.

FileDescription
vendoradaptor.hpp, vendoradaptor.cppWraps device driver code in methods that allow you to configure, discover, and enumerate the hardware in MATLAB.
daqstream_analog.hpp, daqstream_analog.cppImplements a DAQStream object for an analog subsystem, that allows you to stream data to and from the hardware.
custom_vendor.cppDispatches custom calls from MATLAB to the adaptor. At a minimum this must contain a customizeMap function.

Typical Workflow to Create Adaptor

To create an adaptor from the set of template files in the folder VendorAdaptor, use the following steps. Assume that you want to name the adaptor MyAdaptor.

  1. Create a copy of the entire folder, and name it MyAdaptor.

  2. Working in the new folder called MyAdaptor, change the names of the files:

    Original NameNew Name
    vendoradaptor.hppmyadaptor.hpp
    vendoradaptor.cppmyadaptor.cpp
    custom_vendor.cppcustom_my.cpp
  3. Update the content of the files so that the new names are used for references to other files, the adaptor, devices, and vendor.

  4. Update the functions to use your driver code. For more information, see Adaptor API Reference.

  5. Build the adaptor with the buildAdaptor function.

Related Examples

More About

Was this topic helpful?