gclib 2.1.20
Galil Communications Library
All Classes Files Functions Variables Typedefs Macros Modules Pages
Galil Communications Library (gclib)

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.

      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.1.20 2.1.20
        Hello World!
      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.1.20 2.1.20
        Hello World!
    • > py -m pip install https://www.galil.com/sw/pub/python/gclib-1.0.0-py3-none-any.whl
      > copy "%GCLIB_ROOT%\examples\python\*" .
      > py
      >>> import gclib
      >>> gclib.py().GVersion()
      'py.2.1.20 2.1.20'
    • $ python3 -m venv gclib
      $ source gclib/bin/activate
      (gclib) $ pip install https://www.galil.com/sw/pub/python/gclib-1.0.0-py3-none-any.whl
      (gclib) $ cp /usr/share/gclib/examples/python/* .
      (gclib) $ python
      >>> import gclib
      >>> gclib.py().GVersion()
      'py.2.1.20 2.1.20'
  • To compile Java programs, ensure the JDK is installed, as the JRE does not provide a Java compiler.
    • > 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.1.20 2.1.20
      Hello World!
    • $ 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.1.20 2.1.20
      Hello World!
  • > 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.1.20 2.1.20
    Hello World!
  • > 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.1.20 2.1.20
    Hello World!
  • 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"
Next
Examples