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.

buildAdaptor

Build adaptor for third-party data acquisition interface

Syntax

daq.sdk.utility.mex.buildAdaptor(adaptorName,customFunc,srcPath,outputPath)
daq.sdk.utility.mex.buildAdaptor(adaptorName,customFunc,srcPath,outputPath,vendorLib)
script = daq.sdk.utility.mex.buildAdaptor(___)

Description

example

daq.sdk.utility.mex.buildAdaptor(adaptorName,customFunc,srcPath,outputPath) builds an adaptor for enumerating, configuring, and streaming data to and from a data acquisition device driver.

Note

This function requires that your system is configured with Microsoft® Visual Studio® 2013 or later.

example

daq.sdk.utility.mex.buildAdaptor(adaptorName,customFunc,srcPath,outputPath,vendorLib) allows you to specify a custom library for the build.

example

script = daq.sdk.utility.mex.buildAdaptor(___) returns the script used for the build. This can be useful for diagnostic purposes.

Examples

collapse all

Build the custom adaptor named MyAdaptor.

daq.sdk.utility.mex.buildAdaptor('MyAdaptor','custom_my', ...
    'c:\adaptors\sdk\daqadaptor','c:\adaptors\sdk\bin\win64');

Build the custom adaptor and return the build script.

scr = daq.sdk.utility.mex.buildAdaptor('MyAdaptor','custom_my', ...
'c:\adaptors\sdk\daqadaptor','c:\adaptors\sdk\bin\win64');
scr
scr =

    'mex 'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\Shared\dispatcher.cpp' 
'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\Shared\daqadaptor.cpp' 
'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\Shared\daqstream.cpp' 
'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\Shared\adaptorfactory.cpp' 
'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\MyAdaptor.cpp' 
'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\daqstream_analog.cpp' 
'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor\custom_my.cpp' 
-I'C:\Program Files\MATLAB\R2017\toolbox\daq\daqsdk\src\daqadaptor\Shared' 
-I'C:\Program Files\MATLAB\R2017\toolbox\daq\daqsdk\src\include' 
-I'C:\adaptors\daqsdk\src\daqadaptor\MyAdaptor' -DADAPTOR=MyAdaptor 
-DDAQADAPTOR_EXPORT -DINT16_MIN=-32768 -DINT16_MAX=32767 -output MyAdaptor 
-outdir 'C:\adaptors\daqsdk\bin\win64' -v -g COMPFLAGS='$COMPFLAGS -W3' 
CXXFLAGS='$CXXFLAGS -std=c++11''

You can save this script to a file and further modify it. You can run your modified script with eval or daq.sdk.utility.mex.runBuildScript. For syntax options, type

help daq.sdk.utility.mex.runBuildScript

Use the custom library MyLibrary for building an adaptor.

pathToHeaderAndLib = 'C:\libraries\MyLibrary'
myLibrary.HeaderPath = fullfile(pathToHeaderAndLib,'include');
myLibrary.LibPath = fullfile(pathToHeaderAndLib,'lib');
myLibrary.LibName = 'MyLibrary';

buildAdaptor('DemoAdaptor','custom_demo',adaptorPath,outputPath,myLibrary);

Input Arguments

collapse all

Name of the adaptor, specified as a character vector or string.

Example: 'DemoAdaptor'

Data Types: char | string

Name of the file containing the source code for custom functions, specified as a character vector or string. The file must be in the folder identified by srcPath.

Example: 'custom_demo.cpp'

Data Types: char | string

Path to adaptor source folder, specified as a character vector or string.

Example: 'c:\temp\sdk\daqadaptor'

Data Types: char | string

Path to generated adaptor MEX-file location, specified as a character vector or string.

Example: 'c:\temp\sdk\bin\win64'

Data Types: char | string

Vendor library locations, specified as a structure containing these three fields:

  • HeaderPath — a character vector specifying the path to the vendor header.

  • LibPat — a character vector specifying the path to the vendor static library.

  • LibName — a character vector specifying the name of the static library, without file extension.

Data Types: struct

Output Arguments

collapse all

Build script returned as a character vector. This script indicates what the function ran to build the adaptor.

Introduced in R2017a

Was this topic helpful?