The Galil Communications Library (gclib) is a C API that allows users to connect to and communicate with Galil controllers. Galil provides multiple wrappers around gclib, allowing for use in C++, Python, Java, C#, Visual Basic, or LabVIEW projects.
Installation
All languages require the underlying C library to be installed.
Windows Linux
Quickstart
Follow the instructions to build a simple example program using gclib.
- C/C++
- Windows
- Install CMake.
- Install one of the supported compilers:
- MSVC 14.0 (Visual Studio 2015) or later
- MinGW 8.1 or later
- Compile and run the Hello World example:
> cmake -S "%GCLIB_ROOT%/examples" -B build
> cd build
> cmake --build .
> .\hello-world.exe
gclib version is 2.0.10 2.0.10
Hello World!
- Linux
- Install CMake and gcc.
| RHEL / CentOS Stream / Fedora / Rocky | Ubuntu / Debian / Raspberry Pi OS |
$ sudo dnf install cmake gcc | $ sudo apt install cmake gcc |
- Compile and run the Hello World program:
$ cmake -S /usr/share/gclib/doc/examples -B build
$ cd build
$ cmake --build .
$ ./hello-world
gclib version is 2.0.10 2.0.10
Hello World!
- Python
- Windows
> py -m pip install https://www.galil.com/sw/pub/python/gclib-1.0.0.tar.gz
> py
>>> import gclib
>>> gclib.py().GVersion()
'py.2.0.10 2.0.10'
- Linux
$ python3 -m venv gclib
$ source gclib/bin/activate
(gclib) $ pip install https://www.galil.com/sw/pub/python/gclib-1.0.0.tar.gz
(gclib) $ python
>>> import gclib
>>> gclib.py().GVersion()
'py.2.0.10 2.0.10'
- Java To compile Java programs, ensure the JDK is installed, as the JRE does not provide a Java compiler.
- Windows
> curl -O https://www.galil.com/sw/pub/java/gclib-java-1.0.0.tar
> tar -xvf gclib-java-1.0.0.tar
> cd gclib-java-1.0.0
> set CLASSPATH=".;./gclib-1.0.0.jar;lib/jna-5.16.0.jar"
> javac examples/* -d .
> java HelloWorld
gclib version is 2.0.10 2.0.10
Hello World!
- Linux
$ curl -O https://www.galil.com/sw/pub/java/gclib-java-1.0.0.tar
$ tar -xvf gclib-java-1.0.0.tar
$ cd gclib-java-1.0.0
$ export CLASSPATH=".:./gclib-1.0.0.jar:lib/jna-5.16.0.jar"
$ javac examples/* -d .
$ java HelloWorld
gclib version is 2.0.10 2.0.10
Hello World!
- C#
> curl -O https://www.galil.com/sw/pub/dotnet/gclib-dotnet-1.0.0.tar.gz
> tar -xvf gclib-dotnet-1.0.0.tar.gz
> cd gclib-dotnet-1.0.0
> dotnet nuget add source %cd% --name gclib
> cd examples/cs
> dotnet run --project HelloWorld
gclib version is 2.0.10
Hello World!
- VB
> curl -O https://www.galil.com/sw/pub/dotnet/gclib-dotnet-1.0.0.tar.gz
> tar -xvf gclib-dotnet-1.0.0.tar.gz
> cd gclib-dotnet-1.0.0
> dotnet nuget add source %cd% --name gclib
> cd examples/vb
> dotnet run --project HelloWorld
gclib version is 2.0.10
Hello World!
LabVIEW
Download
- Right click the downloaded file and choose "Add to VIPM Library".
- Choose "Add To Library & Install" when prompted.
- Search for
gclib in the package list, then double click on it to bring up the package info.
- To see all available functions, click "Show in Palettes"
- To see all example VIs, click "Show Examples"