6.1.6. Working with controller in LabWindows¶
Download LabWindows example from the Software page.
The archive contains two examples for LabWindows:
- The console version is an example of testcli for the LabWindows CVI environment using the libximc library
- The GUI version is an example of testgui with a User Interface Editor for the LabWindows CVI environment using the libximc library
The work of the examples was tested on the LabWindows CVI 2017 version.
Open the project ..\examples\testlabwindows\testcli\testcli.prj or
..\examples\testlabwindows\testgui\simple.prj in LabWindows CVI.
To build, run Build -> Rebuild.
Copy ..ximc\win64\libximc.dll, ..ximc\win64\bindy.dll and ..ximc\win64\xiwrapper.dll to the directory where the .exe file is located.
By default, the examples have a 64-bit build installed, and the 64-bit libximc library is connected to the example. If you need to build a 32-bit version of the application, select one of the 32-bit builds in the Build -> Configuration menu. Remove the 64-bit version of the libximc.lib library from the project and connect the 32-bit one. The libximc library with dependencies is located in the ximc/win32 and ximc/win64 folders.
LabWindows environment will start. You will see graphical user interface
of the front panel of the example.
At the top of the window you will see the libximc version.
The “Current position” field displays position in steps/s. By changing the value in the field and clicking the Move button the move to position command will be executed.
Libximc library opens controllers in exclusive access mode. Any controller opened by libximc needs to be closed before it may be used by another process. Do not stop this LabWindows example or any other LabWindows program which uses libximc with the “Close” button - this doesn’t give the running program a chance to call the close_device() function, thus all opened controllers will be locked and inaccessible until you close Labwindows environment entirely.
LabWindows console will start. You will see an example of the console version.
The program “testcli” reports the version of the library used, and also indicates which port it holds. After that, the “testcli” program sends the command_movr to the controller. After successful execution of the command, the close_device command will be called