libximc
2.9.8
|
Library usage can be examinated from test application testapp. Non-C languages are supported because library supports stdcall calling convention and so can be used with a variety of languages.
C test project is located at 'examples/testapp' directory, C# test project - at 'examples/testcs', VB.NET - 'examples/testvbnet', Delphi 6 - 'examples/testdelphi', sample bindings for MATLAB - 'examples/testmatlab', for Java - 'examples/testjava', for Python - 'examples/testpython'. Development kit also contains precompiled examples: testapp and testappeasy as 32 and 64-bit applications for Windows and 64-bit application for osx, testcs, testvbnet, testdelphi - 32-bit only, testjava is architecture-independent, testmatlab and testpython are runtime-interpreted.
NOTE: SDK requires Microsoft Visual C++ Redistributable Package (provided with SDK - vcredist_x86 or vcredist_x64)
Testapp can be built using testapp.sln. Library must be compiled with MS Visual C++ too, mingw-library isn't supported. Make sure that Microsoft Visual C++ Redistributable Package is installed.
Open solution examples/testapp/testapp.sln, build and run from the IDE.
MinGW is a port of GCC to win32 platform. It's required to install MinGW package. Currently not supported
MinGW-compiled testapp can be built with MS Visual C++ or mingw library.
Then copy library libximc.dll to current directory and launch testapp.exe.
First of all you should create C++ Builder-style import library. Visual C++ library is not compatible with BCB. Invoke:
Then compile test application:
Test app should be built with XCode project testapp.xcodeproj. Library is a Mac OS X framework, and at example application it's bundled inside testapp.app
Then launch application testapp.app and check activity output in Console.app.
Make sure that libximc (rpm, deb, freebsd package or tarball) is installed at your system. Installation of package should be performed with a package manager of operating system. On OS X a framework is provided.
Note that user should belong to system group which allows access to a serial port (dip or serial, for example).
Test application can be built with the installed library with the following script:
In case of cross-compilation (target architecture differs from the current system architecture) feed -m64 or -m32 flag to compiler. On OS X it's needed to use -arch flag instead to build an universal binary. Please consult a compiler documentation.
Then launch the application as:
Note: make run on OS X copies a library to the current directory. If you want to use library from the custom directory please be sure to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH to the directory with the library.
Wrapper assembly for libximc.dll is wrappers/csharp/ximcnet.dll. It is provided with two different architectures and depends on .NET 2.0.
Test .NET applications for Visual Studio 2013 is located at testcs (for C#) and testvbnet (for VB.NET) respectively. Copy ximcnet.dll, libximc.dll, xiwrapper.dll, bindy.dll from the ximc-2.x.x/ximc/win64 or ximc-2.x.x/ximc/win32 accordingly to your system to the current directory. Open solutions, build and run.
Wrapper for libximc.dll is a unit wrappers/delphi/ximc.pas
Console test application for is located at testdelphi. Tested with Delphi 6 and only 32-bit version.
Just compile, place DLL near the executable and run program.
How to run example on Linux. Navigate to ximc-2.x.x./examples/testjava/compiled/ and run:
How to run example on Windows or Mac. Navigate to ximc-2.x.x./examples/testjava/compiled/. Copy contents of ximc-2.x.x/ximc/win64 or ximc-2.x.x/ximc/macosx accordingly to the current directory. Then run:
How to modify and recompile an example. Navigate to examples/testjava/compiled. Sources are embedded in a testjava.jar. Extract them:
Then rebuild sources:
or for windows or mac
Then build a jar:
Sample MATLAB program testximc.m is provided at the directory examples/testmatlab. Change current directory to the examples/matlab. On windows copy ximc.h, libximc.dll, bindy.dll, xiwrapper.dll and contents of ximc/(win32,win64)/wrappers/matlab/ directory to the current directory.
On Mac install Apple's "Command Line Tools for XCode" and then copy ximc/macosx/libximc.framework and contents of ximc/macosx/wrappers/matlab to the the current directory.
Then launch in MATLAB prompt:
If you want to turn on file logging, you should run the program that uses libximc library with the "XILOG" environment variable set to desired file name. This file will be opened for writing on the first log event and will be closed when the program which uses libximc terminates. Data which is sent to/received from the controller is logged along with port open and close events.
libximc generally does not require special permissions to work, it only needs read/write access to USB-serial ports on the system. An exception to this rule is a Windows-only "fix_usbser_sys()" function - it needs elevation and will produce null result if run as a regular user.
vim: ft=doxygen