Building a SICL Application in Linux

This section provides guidelines to building a SICL application in a Linux environment.

Including the SICL Declaration File

For C and C++ programs, you must include the sicl.h header file at the beginning of every file that contains SICL function calls. This header file contains the SICL function prototypes and the definitions for all SICL constants and error codes.

#include “sicl.h”

Libraries for C Applications and DLLs

The Linux SICL programs must link to libsicl.so under /usr/lib64.

Compiling and Linking C Applications using GCC

Assuming GCC is used as compiler, you can follow steps below:

1. Add -I/opt/Keysight/iolibs/include as part of gcc compile command line to add include directory where sicl.h sits.

2. Add -lsicl as part of gcc compile command line to link to SICL Library

Thread Support for Applications

SICL can be used in multithreaded designs and SICL calls can be made from multiple threads in applications. However, there are some important points to keep in mind:

  • SICL error handlers (installed with ionerror) are per process (not per thread), but are called in the context of the thread that caused the error to occur. Calling ionerror from one thread will overwrite any error handler presently installed by another thread.

  • The igeterrno is per thread and returns the last SICL error that occurred in the current thread.

  • You may want to make use of the SICL session locking functions (ilock and iunlock) to help coordinate common instrument accesses from more than one thread.

  • See Using SICL with a LAN for thread information when using SICL with LAN.