| gclib 2.4.1 Galil Communications Library

Loading...
Searching...
No Matches
Galil Communications Library (gclib)

The Galil Communications Library (gclib) is a thread-safe 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

Note
  gcaps is a service that is included in the gclib and gdk installers. It allows multiple gclib clients to share a single controller connection, which can be especially useful for unsolicited data.

# Quickstart

Follow the instructions to build a simple example program using gclib.

- C/C++
  - Windows
    1. Install CMake.
    2. Install one of the supported compilers:
       - MSVC 14.0 (Visual Studio 2015) or later
       - MinGW 8.1 or later
    3. Compile and run the Hello World example:
       > cmake -S "%GCLIB_ROOT%\examples\c" -B build
       > cd build
       > cmake --build .
       > .\hello-world.exe
       gclib version is 2.4.1
       Hello World!
  - Linux
    1. Install CMake and gcc.

       RHEL / CentOS Stream / Fedora / Rocky | Ubuntu / Debian / Raspberry Pi OS
       --- | ---
       $ sudo dnf install cmake gcc | $ sudo apt install cmake gcc

    2. Compile and run the Hello World program:
       $ cmake -S /usr/share/gclib/examples/c -B build
       $ cd build
       $ cmake --build .
       $ ./hello-world
       gclib version is 2.4.1
       Hello World!
- Python
  - Windows
    > py -m pip install https://www.galil.com/sw/pub/python/gclib-1.0.1-py3-none-any.whl
    > copy "%GCLIB_ROOT%\examples\python\*" .
    > py
    >>> import gclib
    >>> gclib.py().GVersion()
    'py.2.4.1 2.4.1'
  - Linux
    $ python3 -m venv gclib
    $ source gclib/bin/activate
    (gclib) $ pip install https://www.galil.com/sw/pub/python/gclib-1.0.1-py3-none-any.whl
    (gclib) $ cp /usr/share/gclib/examples/python/* .
    (gclib) $ python
    >>> import gclib
    >>> gclib.py().GVersion()
    'py.2.4.1 2.4.1'
- 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=.;.\*;lib\*
    > robocopy "%GCLIB_ROOT%\examples\java" examples
    > javac examples\* -d .
    > java HelloWorld
    gclib version is 2.4.1 2.4.1
    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=.:./*:lib/*
    $ javac /usr/share/gclib/examples/java/* -d .
    $ java HelloWorld
    gclib version is 2.4.1 2.4.1
    Hello World!
- C#
  > curl -O https://www.galil.com/sw/pub/dotnet/gclib-dotnet.1.0.0.nupkg
  > dotnet nuget add source %cd% --name gclib
  > robocopy /e "%GCLIB_ROOT%\examples\cs" examples
  > cd examples
  > dotnet run --project HelloWorld
  gclib version is 2.4.1 2.4.1
  Hello World!
- VB
  > curl -O https://www.galil.com/sw/pub/dotnet/gclib-dotnet.1.0.0.nupkg
  > dotnet nuget add source %cd% --name gclib
  > robocopy /e "%GCLIB_ROOT%\examples\vb" examples
  > cd examples
  > dotnet run --project HelloWorld
  gclib version is 2.4.1 2.4.1
  Hello World!

- LabVIEW

  Download

  1. Right click the downloaded file and choose "Add to VIPM Library".
  2. Choose "Add To Library & Install" when prompted.
  3. 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"

  Looking for older versions?

Next
Examples