-
Notifications
You must be signed in to change notification settings - Fork 11
Integration in LabVIEW
The C/C++ bindings provide the ideal fundation for integration with LabVIEW.
If you don't want to build ClearVolume and its LabVIEW bindings yourself, you can use instead our ready-to-use binaries. Keep in mind that ClearVolume is actively developed and improved practically on a daily basis. So the latest features and bug fixes are unlikely to be available in the pre-built package found here
If instead you feel more ambitious, you can build the project using Gradle...
First make sure to satisfy all requirements listed in the main project page. this includes installing Java 8, VisualStudio, and Gradle.
-
Go to the project folder root and run:
gradle distribution
This will build both the Java and native code - the cvlib native library for C/C++. The cvlib native library for windows is generated in the build folder: .build/cvlib/
-
Make sure that your JAVA_HOME environment variable points to the java folder (this should be done automatically by the Java windows installer, but check if it is correct).
-
Test the library by executing the test program:
./build/cvlib/Example_Simple.exe
If everything went fine you should see a window poping up with some test volume rendered.
-
The labview library and test project and VI are copied into the folder:
./build/labview/
This contains
The native library consist of the following files:
- clearvolume folder -> labview library with ClearVolume VIs, and cvlib C/C++ bindings packaged together.
- test.lvproj -> LabVIEW project for test VI,
- test.vi -> test VI,
Typically you only really need your own LabVIEW project code, the clearvolume folder.
The ClearVolume LabVIEW API simply mirrors the C/C++ API. The LabVIEW library and VIS were automatically generated using the LabVIEW wizard for interfacing with native libraries. For access to the latest bleeding edge code, we recommend advanced users to regenerate the LabVIEW VIs themselves from the C/C++ bindings.
As indicated above, we provide a test VI (test.vi file). An image is worth thousands of words - below is a screenshot of this VI:
As said before the LabVIEW VIs mirror the functions defined in the cvlib.h header file of the C/C++ bindings. In this example we first initialise the library by providing the path to the ClearVolume.jar file. Next, we create an in-process renderer and server. Next we send data to both the in-process renderer and server until the user stops the loop. Finally, we close both the in-process renderer and server as well as the ClearVolume library itself.