6.1.4. Working with controller in Matlab¶
Libximc library can be used to work with controller in Matlab. Download examples from the Software page.
Sample MATLAB program testximc.m is provided at the directory examples/testmatlab.
Before launch:
On Windows: Change current directory in the MATLAB to the examples/matlab. Then launch in MATLAB prompt:
On OS X: copy ximc/macosx/libximc.framework, ximc/macosx/wrappers/ximcm.h, ximc/ximc.h to the directory examples/matlab. Install XCode compatible with Matlab.
On Linux: install libximc*deb and libximc-dev*dev of target architecture. Then copy ximc/macosx/wrappers/ximcm.h to the directory examples/matlab. Install gcc compatible with Matlab.
For XCode and gcc version compability check document or similar.


In the command window you will see the output of the example which reports controller status.
You can call libximc functions from Matlab program this way: define the path to the
libximc.dll, bindy.dll and xiwrapper.dll dynamic link libraries and its header ximc.h
and additional to ximc.m files if you are using 64-bin environment. Use loadlibrary
Matlab
function once to load libximc library, then use calllib
Matlab function to call desired libximc function.
You will find a list of libximc functions and their input and output parameters in the
Programming guide.
Note
Our supporting software was tested with Windows 10 64 bit, Matlab 2017 and DAQmx 2017.