Gossner Electronics & Embedded Systems GmbH
GPIBEE488
IEEE 488.2 programming library for GPIBee adapters · Windows, 32-bit and 64-bit
User Manual
Version V0.9.10 · built 2026-11-29
Engineered and made in Germany
www.GPIBee.com · Support@GPIBee.com

1. What GPIBee488 is

A lot of measurement software talks to GPIB instruments through the classic IEEE 488.2 programming interface: functions such as ibdev, ibwrt, ibrd, Send and Receive, found in a library called gpib-32.dll. Normally that library comes with a GPIB plug-in card or a USB adapter and a kernel driver.

GPIBee488 is a version of that library for the GPIBEE adapter. It talks to the adapter over the network, using the VXI-11 protocol that the GPIBee already speaks. Your program calls the same functions it always called, and the library turns each call into network requests to the adapter, which then does the work on the GPIB.

This means that software written for the 488.2 interface, including programs you only have as an .exe, can use a GPIBee without being changed or recompiled. New programs can be written against it in C, C++, Python, C#, Delphi or any other language that can call a Windows DLL.

YOUR WINDOWS PC Your program measurement software, script, test system 488.2 calls: ibwrt, ibrd, Send ... gpib-32.dll GPIBee488 library, 32-bit or 64-bit Ethernet / USB VXI-11 GPIBEE GPIB0 GPIBEE GPIB1 Oscilloscope · address 1 Multimeter · address 22 Signal generator · address 28 Each GPIBee is one GPIB interface (GPIB0 to GPIB7). No driver, no card, no extra software on the PC.
Figure 1 — How the parts fit together.

2. Highlights

Works with existing 488.2 software

Same function names, same arguments, same status bits and error codes. Programs that were built for a GPIB card load this library and run.

Nothing to install

No kernel driver, no signed driver package, no VISA, no runtime. Copy one DLL next to your program and you are done. The DLL only relies on parts of Windows that are always present, from Windows 7 on.

Real 64-bit gpib-32.dll

gpib-32.dll exists as a 32-bit and a 64-bit build, so 64-bit programs written for the classic interface finally have a library to load.

Several adapters

Up to eight GPIBees at once, as GPIB0 to GPIB7. Assign them by IP address or host name, or let the library find them on the network by itself.

Network reach

The instruments do not have to be near the PC. Anything you can reach over the network, including a GPIBee in another room or behind a router, works the same way as a card in the PC.

Coexists with other GPIB software

Placed in your program's own folder, the library is used by that program only. An existing GPIB installation on the same PC stays untouched and keeps working.

Cancels for real

ibstop stops a running transfer straight away, even a read that is stuck waiting for an instrument. It does not just wait for the timeout.

Honest about limits

Anything the adapter cannot do is reported with the error ECAP, never silently ignored. This manual lists each of these cases.

Interactive control included

A graphical tool to scan the bus, talk to instruments, try out every 488.2 call and run scripts. See section 6.

Quiet on the network

The library only talks to your GPIBees. It never contacts the internet, sends no usage data and opens no port for incoming connections. Security support for 5 years per release (section 13).

Built-in trace

Set one environment variable and every call with its arguments and its result is written to a log file. Handy when a program does not behave. See section 11.1.

3. What is in the package

The release comes as one archive, GPIBee488-V0.9.10.zip. Unpack it into a folder of your choice. It holds one folder per bitness, one folder for developers, this manual and a small version file.

GPIBee488-V0.9.10.zip
  GPIBee488-Manual.html     this manual
  version.txt               the version of this release, e.g. "GPIBee488 V0.9.10"
  x86\                      32-bit files
    gpib-32.dll
    libgpib-32.a
    gpibee488-ic-32.exe
  x64\                      64-bit files
    gpib-32.dll
    libgpib-32.a
    gpibee488-ic-64.exe
  include\
    gpib4882.h              header for C and C++
FileNeeded byWhat it does
gpib-32.dllevery programThe library itself. It holds all 488.2 functions and does all communication with the GPIBees. This is the one file every program needs.
gpibee488-ic-32.exe
gpibee488-ic-64.exe
youGPIBee-488 interactive control. Scan the bus, talk to instruments, configure the adapter assignment, run scripts. The library is built into the program, so it runs without the DLLs. Both builds do the same; use either.
gpib4882.hdevelopersHeader with all functions, constants, status bits and error codes, for C and C++.
libgpib-32.adevelopersImport library for MinGW / GCC, so a program can link against gpib-32.dll. Use the one from the folder that matches the bitness you compile for.
version.txt–The version of the release, as also shown in the file properties of every DLL and program.

The software is free of charge for users of GPIBee adapters; see the license terms in section 14.

All DLLs and programs carry the same version number, shown under Properties → Details in Windows Explorer. The version has the form Vmajor.minor.build; this manual belongs to V0.9.10.

4. Installing the DLLs

4.1 32-bit or 64-bit?

The bitness of the program decides, not the bitness of Windows. A 32-bit program can only load 32-bit DLLs, and a 64-bit program only 64-bit DLLs. Many older measurement programs are 32-bit even on a 64-bit Windows.

If you are not sure, open the Task Manager while the program runs: on the Details tab, a 32-bit program is listed with "(32 bit)" or shows "32-bit" in the Platform column. When in doubt, install both sets; Windows picks the right one by itself if they are in the system folders (section 4.3).

ProgramFiles fromInteractive control
32-bit programx86\gpibee488-ic-32.exe
64-bit programx64\gpibee488-ic-64.exe

4.2 Recommended: next to the program

Windows looks for a DLL in the program's own folder first. So the simplest installation is to copy gpib-32.dll of the right bitness into the folder that holds the program's .exe.

rem Example: a 32-bit program in C:\Tools\MyBench
copy x86\gpib-32.dll C:\Tools\MyBench\

4.3 System-wide

If several programs should use the GPIBees, or a program loads the library from a different folder, install the DLLs into the Windows system folders. This needs administrator rights. On 64-bit Windows the folder names are the opposite of what one would guess:

x64\ gpib-32.dll x86\ gpib-32.dll 64-bit programs 32-bit programs C:\Windows\System32 64-bit DLLs, despite the "32" in the name C:\Windows\SysWOW64 32-bit DLLs
Figure 2 — System folders on 64-bit Windows. On 32-bit Windows, the x86 files go to C:\Windows\System32 and there is no x64 set.
rem In a command prompt started with "Run as administrator", from the release folder:
copy x64\gpib-32.dll %WINDIR%\System32\
copy x86\gpib-32.dll %WINDIR%\SysWOW64\
Important: Other GPIB products install a DLL with exactly this name into exactly these folders. Copying ours over it replaces that product's library for every program on the PC, and its card or adapter then stops working with 488.2 software. Before a system-wide installation, rename or save any existing gpib-32.dll in these folders so that you can put it back. If another GPIB product must keep working, use the installation next to the program (section 4.2) instead.
Tip: A 32-bit command prompt on 64-bit Windows is silently redirected from System32 to SysWOW64. Use the normal (64-bit) command prompt for the copies above. In a 32-bit prompt, write %WINDIR%\Sysnative instead of %WINDIR%\System32.

4.4 Programs that look for another file name

Most 488.2 software loads a library called gpib-32.dll. Some programs, often newer or 64-bit ones, were built to load the same programming interface from a file with a different name. When such a program starts, Windows reports that this DLL is missing.

In that case, copy gpib-32.dll of the right bitness and give the copy the name the program asks for. The library contains every 488.2 function under its standard name, so it works under any file name. Put the copy where the program looks for it, next to the program or in the system folder (sections 4.2 and 4.3).

rem Example: a 64-bit program in C:\Tools\Bench64 asks for "other-name.dll"
copy x64\gpib-32.dll C:\Tools\Bench64\other-name.dll

4.5 Checking the installation

  1. Make sure the GPIBee is reachable: open its IP address in a web browser; the GPIBee web interface should appear.
  2. Start the interactive control (gpibee488-ic-64.exe or gpibee488-ic-32.exe) and press Scan bus. It lists every instrument on the bus of GPIB0 with its identity.

To check another interface, select it under Adapter first.

5. Which GPIBee is GPIB0?

A 488.2 program names its GPIB interface by number: GPIB0, GPIB1 and so on, or as the board number 0, 1, ... it passes to ibdev. With GPIBee488 each of these numbers is one GPIBee on the network. Up to eight are possible, GPIB0 to GPIB7.

The first time a program uses the library, the library decides which GPIBee gets which number:

  1. From your assignment. If at least one number has been assigned to an adapter (section 5.2), exactly those assignments are used. Numbers without an assignment do not exist.
  2. Automatically. If nothing is assigned, the library searches the local network for GPIBees. The ones it finds become GPIB0, GPIB1, ... in the order of their IP addresses.

A number without an adapter behaves like a missing GPIB card: every call on it fails with the error ENEB ("non-existent board").

A program decides this once, when it starts using the library. If you change the assignment while a program is running, restart that program.

5.1 Automatic search

With nothing assigned, the library sends a short broadcast on every network connection of the PC. Every VXI-11 device that answers within about a second is asked who it is, and only GPIBees are kept. Oscilloscopes and other LAN instruments answer the broadcast too, but are left out.

5.2 Assigning adapters

The easiest way is the Adapters... dialog of the interactive control (section 6.2): one line per interface number, Find adapters fills in what it finds on the network, Save stores it.

The assignment is kept in the Windows registry, one text value per interface number:

HKEY_CURRENT_USER\Software\GPIBee\gpibee488\Boards
    GPIB0    REG_SZ    192.168.1.50
    GPIB1    REG_SZ    lab-gpibee-2
    GPIB2    REG_SZ    10.0.4.17,gpib0

The value is the IP address or the host name of the GPIBee. It can be followed by a comma and the VXI-11 name of the GPIB port; without it, gpib0 is used, which is what the GPIBee calls its GPIB port. You can also write the values from a command prompt or with a .reg file:

reg add HKCU\Software\GPIBee\gpibee488\Boards /v GPIB0 /d 192.168.1.50
reg add HKCU\Software\GPIBee\gpibee488\Boards /v GPIB1 /d 192.168.1.51

5.3 Searching other subnets

The environment variable GPIBEE488_DISCOVER replaces the broadcast of the automatic search with a list of addresses to ask, separated by commas. Each entry can be a single GPIBee or the broadcast address of another subnet:

set GPIBEE488_DISCOVER=10.1.2.255,10.1.3.17

It has no effect when adapters are assigned in the registry.

6. GPIBee-488 interactive control

The interactive control is a program for talking to instruments by hand. Use it to check that everything is connected, to find the address of an instrument, to try out commands before you write them into a program, and to set up which GPIBee is which interface number.

It runs on its own: the library is built into it, so it needs no DLL. A selector in the window can switch it to the installed gpib-32.dll instead, which is a quick way to test the installation that your programs will load.

GPIBEE-488 interactive control GPIB0 · 192.168.1.50 ADAPTER GPIB0 · 192.168.1.50 Adapters... Web interface DEVICES 2234401AHEWLETT-PACKARD 28SMIQ03BRohde&Schwarz Addresses 0 to 30 · scan options Scan bus INSTRUMENT *IDN? Query Write Read Clear   Trigger   Serial poll   Local   Close      IFC   REN   Lockout   Clear all CONSOLE gpib0> scan 22 HEWLETT-PACKARD,34401A,0,11-5-2 28 Rohde&Schwarz,SMIQ03B,832870/054 gpib0> open 22 ud32 dev 22> q MEAS:VOLT:DC? ibsta 0x2100 [END CMPL] ibcnt 16 "+1.23456789E+00\n" ud32 dev 22> Run STATUS ERRREM TIMOCIC ENDATN CMPLLACS iberr none    ibcnt 16 BUS LINES REN   SRQ   NDAC DESCRIPTOR Timeout   10 s EOI with the last byte EOS byte 0x0A   ASCII... REOS   XEOS   BIN LIBRARY Built in (no DLL needed) 1 2 3 4 5
Figure 3 — Layout of the main window: (1) adapter and devices, (2) device actions and bus actions, (3) instrument line, (4) console, (5) status, bus lines, descriptor settings and library selector.

6.1 The window

AreaWhat you do there
AdapterChoose which GPIBee (GPIB0, GPIB1, ...) the window works with. Web interface opens that GPIBee's own web page in the browser. Adapters... opens the assignment dialog (6.2).
DevicesScan bus lists every instrument on the bus with its identity. Double-click one to open it. The options below the list set the address range, whether secondary addresses are included, whether each device is asked *IDN?, and whether older instruments are also asked ID?.
InstrumentType a command and press Query, Write or Read. Pressing Enter sends it as a query if the text ends with ?, otherwise as a write. The buttons below clear, trigger, serial-poll, return to local or close the open device; the buttons on the right act on the whole bus (interface clear, remote enable, local lockout, clear all).
ConsoleShows every call and its result, in the same form you can type it. Any 488.2 function can be typed here (6.3). Up and Down recall earlier commands.
StatusThe bits of ibsta after the last call, iberr with its meaning, ibcnt, the bus lines the adapter can report, and the settings of the open device: timeout, EOI, EOS byte and mode. Changing a setting here makes the matching call.
LibrarySwitch between the library built into the program and the installed gpib-32.dll.

Rest the mouse on any button, field or lamp to get a short explanation. Typing help in the console lists all commands; help eos, for example, explains end-of-string handling.

EOS byte. The EOS (end of string) byte is a character, usually line feed, that can mark the end of a message. Type it as 0x0A, 10, LF, \n or pick it from the ASCII table behind the ASCII... button. The boxes REOS (stop reading at this byte), XEOS (send EOI with this byte) and BIN (compare all 8 bits) decide how it is used. A device opened from the device list starts with line feed as EOS byte and no box ticked, so ticking REOS is enough for an instrument that ends its replies with a line feed but does not send EOI.

ASCII table for selecting the EOS byte
Figure 4 — The ASCII table for the EOS byte. Move over a cell to see its code and meaning, click to select.

6.2 Adapters dialog

Adapters... shows one line per interface number, GPIB0 to GPIB7, each with the address of its GPIBee.

6.3 Console commands

The command names are the function names of the library, so whatever you try out in the console translates directly into code. Addresses are written 5, or 1:0 for primary address 1 with secondary address 0. @<ud> in front of a command runs it once on another descriptor, for example @0 ibsic.

GroupCommands
Sessionopen ibdev ibfind ibonl close use board list
Adaptersboards discover reload web
Transferw r q ibwrt ibrd ibwrta ibrda ibcmda ibwait ibstop ibnotify ibwrtf ibrdf
Deviceibclr ibtrg ibrsp ibloc ibpct ibppc ibln
Interfaceibsic ibsre ibcmd iblines ibrpp ibcac ibgts ibrsc ibist ibrsv ifc ren lines
Settingsibtmo ibeot ibeos ibpad ibsad ibconfig ibask ibbna
488.2 routinesSendIFC FindLstn DevClear DevClearList EnableRemote EnableLocal SendLLO SetRWLS Send SendList SendSetup SendDataBytes SendCmds Receive ReceiveSetup RcvRespMsg Trigger TriggerList ReadStatusByte AllSpoll FindRQS TestSRQ WaitSRQ PPoll PPollConfig PPollUnconfig PassControl ResetSys TestSys
Toolscan term hex repeat sleep run echo status backend cls help

w, r and q are shortcuts: w writes the rest of the line plus the line ending chosen under Append, r reads, q does both. ibwrt sends exactly what you give it, so the line ending has to be written out: ibwrt "*RST\n". Strings understand \n, \r, \t, \\, \" and \xHH; byte lists such as ibcmd 0x3F 0x5F work too.

gpib0> scan legacy 1-30        find instruments, ask old ones "ID?" as well
gpib0> open 22                 open the device at primary address 22
ud32 dev 22> ibtmo 3s
ud32 dev 22> q *IDN?
  ibsta 0x2100 [END CMPL]   ibcnt 32
  "HEWLETT-PACKARD,34401A,0,11-5-2\n"
ud32 dev 22> ibrsp              serial poll
ud32 dev 22> Send 28 "FREQ 100MHz" NLend
ud32 dev 22> @0 ibsic           interface clear on GPIB0

Scanning

scan [noidn] [legacy] [nosad] [ibln] [<from>-<to>]
OptionEffect
noidnOnly list the addresses; send nothing to the instruments.
legacyIf an instrument does not answer *IDN?, clear it and try ID?, as understood by many instruments older than IEEE 488.2.
nosadLeave out devices that answer on a secondary address.
iblnCheck each address with ibln instead of one FindLstn call.
<from>-<to>Only these primary addresses, for example 0-15.

An instrument that does not answer the identity query gets a device clear, so it is not left with an unfinished query.

Scripts

A script is a text file with one console command per line; # starts a comment. Run it with Run script..., with run <file> in the console, or from the command line. Stop ends a running script after the current command.

# Identify everything, then measure on the DMM at address 22
scan
SendIFC
open 22
ibtmo 1s
ibeos REOS LF
q *IDN?
repeat 10 q MEAS:VOLT:DC?
ibloc
close

6.4 Command line

OptionEffect
--run <file>Run a script when the program starts.
--cmd "<command>"Run one command when the program starts. Can be given several times.
--dllStart with the installed gpib-32.dll instead of the built-in library.
--host <address>Use the GPIBee at this address as GPIB0 for this run only, ignoring the assignment and the search. Built-in library only.
gpibee488-ic-64.exe --host 192.168.1.50 --cmd "scan" --cmd "open 22"

7. Programming with gpib-32.dll

7.1 The basics in a few lines

Note: The header gpib4882.h does not declare the global variables ibsta, iberr, ibcnt and ibcntl. In new programs use the functions above. Existing, already compiled programs that use these variables are not affected.

7.2 C or C++ with MinGW / GCC

#include <stdio.h>
#include "gpib4882.h"

int main(void)
{
    char buf[256];
    int  dmm;

    /* Interface 0, primary address 22, no secondary address,
       10 s timeout, EOI on the last byte, no EOS. */
    dmm = ibdev(0, 22, NO_SAD, T10s, 1, 0);
    if (dmm < 0) {
        printf("ibdev failed, iberr = %lu\n", ThreadIberr());
        return 1;
    }

    ibclr(dmm);
    ibwrt(dmm, "*IDN?\n", 6);
    ibrd(dmm, buf, sizeof buf - 1);
    if (ThreadIbsta() & ERR) {
        printf("read failed, iberr = %lu\n", ThreadIberr());
    } else {
        buf[ThreadIbcnt()] = '\0';
        printf("%s", buf);
    }

    ibonl(dmm, 0);          /* release the descriptor */
    return 0;
}

Build it against the files of the matching bitness:

gcc -m64 -I include idn.c -L x64 -lgpib-32 -o idn.exe     64-bit
gcc -m32 -I include idn.c -L x86 -lgpib-32 -o idn.exe     32-bit

Then put gpib-32.dll of the same bitness next to idn.exe.

7.3 Any C/C++ compiler: loading at run time

With Visual C++ or any other compiler you can load the DLL at run time. This needs no import library at all and lets a program start even when the DLL is missing.

#include <windows.h>
#include <stdio.h>
#include "gpib4882.h"

typedef int           (__stdcall *ibdev_t)(int, int, int, int, int, int);
typedef unsigned long (__stdcall *ibio_t)(int, void *, size_t);
typedef unsigned long (__stdcall *status_t)(void);

int main(void)
{
    HMODULE  lib = LoadLibraryA("gpib-32.dll");
    ibdev_t  p_ibdev;
    ibio_t   p_ibwrt, p_ibrd;
    status_t p_cnt;
    char     buf[256];
    int      ud;

    if (!lib) { printf("gpib-32.dll not found\n"); return 1; }
    p_ibdev = (ibdev_t) GetProcAddress(lib, "ibdev");
    p_ibwrt = (ibio_t)  GetProcAddress(lib, "ibwrt");
    p_ibrd  = (ibio_t)  GetProcAddress(lib, "ibrd");
    p_cnt   = (status_t)GetProcAddress(lib, "ThreadIbcnt");

    ud = p_ibdev(0, 22, NO_SAD, T10s, 1, 0);
    p_ibwrt(ud, "*IDN?\n", 6);
    p_ibrd(ud, buf, sizeof buf - 1);
    buf[p_cnt()] = '\0';
    printf("%s", buf);

    FreeLibrary(lib);
    return 0;
}

7.4 Python

Python can call the DLL directly through ctypes, with no extra package. Use the DLL whose bitness matches your Python (most installations today are 64-bit: x64\gpib-32.dll).

import ctypes

gpib = ctypes.WinDLL(r"C:\GPIBee488\x64\gpib-32.dll")   # WinDLL = __stdcall

gpib.ibdev.restype   = ctypes.c_int
gpib.ibwrt.argtypes  = [ctypes.c_int, ctypes.c_char_p, ctypes.c_size_t]
gpib.ibrd.argtypes   = [ctypes.c_int, ctypes.c_char_p, ctypes.c_size_t]
for f in (gpib.ibwrt, gpib.ibrd, gpib.ThreadIbsta, gpib.ThreadIberr, gpib.ThreadIbcnt):
    f.restype = ctypes.c_ulong

ERR, T3s = 0x8000, 12

def query(ud, text):
    data = text.encode() + b"\n"
    gpib.ibwrt(ud, data, len(data))
    buf = ctypes.create_string_buffer(4096)
    gpib.ibrd(ud, buf, len(buf))
    if gpib.ThreadIbsta() & ERR:
        raise IOError(f"GPIB error {gpib.ThreadIberr()}")
    return buf.raw[:gpib.ThreadIbcnt()].decode().strip()

dmm = gpib.ibdev(0, 22, 0, T3s, 1, 0)       # GPIB0, address 22
print(query(dmm, "*IDN?"))
print(query(dmm, "MEAS:VOLT:DC?"))
gpib.ibonl(dmm, 0)

7.5 C# (.NET)

using System;
using System.Runtime.InteropServices;
using System.Text;

static class Gpib
{
    const string Dll = "gpib-32.dll";
    [DllImport(Dll)] public static extern int  ibdev(int board, int pad, int sad, int tmo, int eot, int eos);
    [DllImport(Dll)] public static extern uint ibwrt(int ud, byte[] buf, UIntPtr cnt);
    [DllImport(Dll)] public static extern uint ibrd (int ud, byte[] buf, UIntPtr cnt);
    [DllImport(Dll)] public static extern uint ibonl(int ud, int v);
    [DllImport(Dll)] public static extern uint ThreadIbcnt();
}

class Program
{
    static void Main()
    {
        int ud = Gpib.ibdev(0, 22, 0, 13 /* T10s */, 1, 0);
        byte[] cmd = Encoding.ASCII.GetBytes("*IDN?\n");
        Gpib.ibwrt(ud, cmd, (UIntPtr)cmd.Length);
        byte[] buf = new byte[256];
        Gpib.ibrd(ud, buf, (UIntPtr)buf.Length);
        Console.WriteLine(Encoding.ASCII.GetString(buf, 0, (int)Gpib.ThreadIbcnt()));
        Gpib.ibonl(ud, 0);
    }
}

DllImport uses the Windows calling convention by default, which matches the DLL in both bitnesses. Build the program for x86 or x64 explicitly (not "Any CPU") and place the matching gpib-32.dll next to it.

7.6 Several instruments with the 488.2 routines

The 488.2 routines name the interface and the address in each call, so no descriptors are needed:

Addr4882_t all[] = { NOADDR };
Addr4882_t found[32];
char       reply[256];
int        i;

SendIFC(0);                                  /* clear the interface, become controller */
FindLstn(0, all, found, 32);                 /* who is on the bus?                     */

for (i = 0; found[i] != NOADDR; i++) {
    Send(0, found[i], "*IDN?", 5, NLend);    /* NLend: add \n and EOI                  */
    Receive(0, found[i], reply, sizeof reply - 1, STOPend);
    reply[ThreadIbcnt()] = '\0';
    printf("address %d: %s", GetPAD(found[i]), reply);
}

7.7 Waiting for a service request

/* Let the DMM request service when its measurement is ready, then wait for it. */
ibwrt(dmm, "*SRE 16;*CLS;INIT\n", 18);

ibwait(0, SRQI);                 /* wait on GPIB0 until SRQ is asserted (or timeout) */
if (!(ThreadIbsta() & TIMO)) {
    char stb;
    ibrsp(dmm, &stb);            /* serial poll clears the request */
    ibwrt(dmm, "FETCH?\n", 7);
    ibrd(dmm, buf, sizeof buf);
}

7.8 Background transfers

ibrda(scope, wave, sizeof wave);       /* start reading, return at once     */
/* ... do other work ... */
ibwait(scope, CMPL | TIMO);            /* collect the result                 */
if (ThreadIbsta() & ERR) ibstop(scope); /* or cancel it: stops immediately   */
printf("%lu bytes\n", ThreadIbcnt());

8. Function reference

Every function of the 488.2 programming interface is present in gpib-32.dll, so every program loads. This section describes each of them: an overview table per group says how it behaves with a GPIBee, and a detailed entry below it says what to pass, what must be true before the call and what you get afterwards.

Supported works as specified.   Differs works, with a difference described in the note.   Not available returns ERR with iberr = ECAP because a GPIBee cannot do it.

How the entries are written

Each group starts with an overview table. Below it, every function has an entry of its own: click a function name in a table to jump there. An entry shows the declaration from gpib4882.h and then:

Rules for every function

All functions A–Z

AllSpoll DevClear DevClearList EnableLocal EnableRemote FindLstn FindRQS ibask ibbna ibcac ibclr ibcmd ibcmda ibconfig ibdev ibdma ibeos ibeot ibfind ibgts ibist iblck iblines ibln ibloc ibnotify ibonl ibpad ibpct ibppc ibrd ibrda ibrdf ibrpp ibrsc ibrsp ibrsv ibsad ibsic ibsre Ibsta ibstop ibtmo ibtrg ibwait ibwrt ibwrta ibwrtf PassControl PPoll PPollConfig PPollUnconfig RcvRespMsg ReadStatusByte Receive ReceiveSetup ResetSys Send SendCmds SendDataBytes SendIFC SendList SendLLO SendSetup SetRWLS TestSRQ TestSys ThreadIbsta Trigger TriggerList WaitSRQ

8.1 Opening, closing and settings

FunctionStatusPurpose and notes
ibdevSupportedOpen a device descriptor. Does not touch the bus, so it succeeds even when the instrument is switched off; the first transfer will tell.
ibfindDiffersOpen a descriptor by name. Interface names GPIB0 to GPIB7 work, written in capitals. User-defined device names are not available (there is no device configuration utility); such names fail with EDVR. Use ibdev for devices.
ibonlSupportedTake a descriptor offline (0, releases a device descriptor) or reset it to its defaults (1).
ibconfigDiffersChange a setting. Options without meaning for a GPIBee return ECAP; see the table in section 9.
ibaskDiffersRead a setting. Same option list as ibconfig, section 9.
ibbnaSupportedMove a device descriptor to another interface, given as "GPIB0" to "GPIB7".
ibpadSupportedChange the primary address of a descriptor.
ibsadSupportedChange the secondary address of a descriptor.
ibtmoSupportedSet the timeout. Codes below 1 ms (T10us to T300us) act as 1 ms, since a network round trip takes longer anyway. TNONE (no timeout) means a very long timeout of several weeks.
ibeotSupportedSend EOI with the last byte of a write, or not.
ibeosDiffersSet EOS byte and mode (REOS, XEOS, BIN) in one value. A byte without any mode bit is refused with EARG; set the byte alone with ibconfig(ud, IbcEOSchar, byte). ibeos(ud, 0) switches EOS off.
ibdmaSupportedAccepted and has no effect: there is no DMA in a network connection.

In detail

ibdev

Supported
int ibdev(int boardID, int pad, int sad, int tmo, int eot, int eos);

Opens a device descriptor for one instrument. All later device calls use the number it returns.

Parameters
boardIDInterface number, 0 for GPIB0 up to 7.
padPrimary address of the instrument, 0 to 30.
sadSecondary address: NO_SAD (0) for none, or 0x60 to 0x7E for secondary 0 to 30. The values 1 to 30 are also accepted and mean secondary 1 to 30.
tmoTimeout code, TNONE to T1000s (section 10.3).
eotNon-zero: send EOI with the last byte of every write.
eosEOS byte and mode in one value, as for ibeos; 0 for no EOS.
Before you call
A GPIBee is assigned to or can be found for boardID (section 5). The first call of a program may take about a second while the library searches for adapters.
Returns
The device descriptor, a number from 32 upwards, or -1 if the call failed.
After a successful call
The descriptor is ready to use with the given settings; the other settings have their defaults (section 9). The instrument itself has not been contacted yet, so a missing or switched-off instrument is only noticed at the first transfer.
Errors
  • ENEB – no GPIBee for this interface number
  • EARG – an address, timeout code or EOS value is out of range
  • ETAB – 32 device descriptors are already open
Plus the general errors listed at the start of this section.
int dmm = ibdev(0, 22, NO_SAD, T10s, 1, 0);
if (dmm < 0) printf("ibdev failed, iberr %lu\n", ThreadIberr());

ibfind

Differs
int ibfindA(const char *udname);
int ibfindW(const wchar_t *udname);   /* ibfind() picks one of them */

Opens an interface descriptor by its name.

Parameters
udname"GPIB0" to "GPIB7", written in capitals.
Before you call
A GPIBee is assigned to or can be found for that interface number.
Returns
The interface descriptor, which is simply the interface number (0 for GPIB0), or -1 on failure.
After a successful call
The interface descriptor is usable. Calling ibfind again for the same name returns the same number and keeps the current settings.
Errors
  • ENEB – no GPIBee for this interface number
  • EDVR – any other name, including device names and lower-case spellings
  • EARG – name is NULL, or the wide name contains non-ASCII characters
Plus the general errors listed at the start of this section.
With a GPIBee
User-defined device names are not available. Open instruments with ibdev. Interface descriptors can also be used without ibfind: the number 0 works as GPIB0 right away.

ibonl

Supported
unsigned long ibonl(int ud, int v);

Takes a descriptor offline, or resets it to its default settings.

Parameters
udDevice or interface descriptor.
v0: take offline. Non-zero: put online again with default settings.
Before you call
ud is a descriptor that is currently in use.
Returns
The new ibsta.
After a successful call
v = 0: a device descriptor is closed and its number may be handed out again by a later ibdev; the network link to the instrument is closed. An interface descriptor stays reserved but answers every call with EARG until ibonl(ud, 1).
v ≠ 0: all settings return to their defaults (section 9); the addresses are kept.
Errors
  • EARG – ud is not a valid descriptor
Plus the general errors listed at the start of this section.
ibonl(dmm, 0);     /* done with the multimeter */

ibconfig

Differs
unsigned long ibconfig(int ud, int option, int v);

Changes one setting of a descriptor.

Parameters
udDevice or interface descriptor.
optionOne of the Ibc... constants, section 9.
vThe new value.
Before you call
The option is available with a GPIBee (section 9) and valid for this kind of descriptor.
Returns
The new ibsta.
After a successful call
The setting is stored and used from the next call on. Changing IbcPAD or IbcSAD closes the link to the old address; the next transfer opens one to the new address. IbcSRE acts on the bus at once, like ibsre.
Errors
  • ECAP – the option is not available with a GPIBee
  • EARG – the value is out of range, or an interface-only option was used on a device descriptor
Plus the general errors listed at the start of this section.
ibconfig(dmm, IbcTMO, T3s);
ibconfig(dmm, IbcEOSchar, 0x0A);

ibask

Differs
unsigned long ibask(int ud, int option, int *v);

Reads one setting of a descriptor.

Parameters
udDevice or interface descriptor.
optionOne of the Iba... constants, section 9.
vReceives the value.
Before you call
v points to an int.
Returns
The new ibsta.
After a successful call
*v holds the current value. Nothing is changed.
Errors
  • ECAP – the option is not available
  • EARG – v is NULL, or an interface-only option was asked on a device descriptor
Plus the general errors listed at the start of this section.
int tmo;
ibask(dmm, IbaTMO, &tmo);

ibbna

Supported
unsigned long ibbnaA(int ud, const char *bname);
unsigned long ibbnaW(int ud, const wchar_t *bname);   /* ibbna() picks one */

Moves a device descriptor to another interface, keeping its address and settings.

Parameters
udDevice descriptor.
bname"GPIB0" to "GPIB7".
Before you call
ud is a device descriptor.
Returns
The new ibsta.
After a successful call
The next transfer goes through the GPIBee of the new interface.
Errors
  • EARG – interface descriptor, or a name not of the form GPIBn
  • ENEB – interface number above 7
Plus the general errors listed at the start of this section.
With a GPIBee
Whether a GPIBee exists for the new interface is only checked at the next transfer.

ibpad

Supported
unsigned long ibpad(int ud, int v);

Sets the primary address (0 to 30). Same as ibconfig(ud, IbcPAD, v).

Parameters
udDevice or interface descriptor.
vThe new value.
Before you call
ud is a valid descriptor.
Returns
The new ibsta.
After a successful call
The new value applies from the next call on. The link to the old address is closed; the next transfer goes to the new one.
Errors
  • EARG – value out of range or invalid descriptor
Plus the general errors listed at the start of this section.

ibsad

Supported
unsigned long ibsad(int ud, int v);

Sets the secondary address (NO_SAD, or 0x60 to 0x7E). Same as ibconfig(ud, IbcSAD, v).

Parameters
udDevice or interface descriptor.
vThe new value.
Before you call
ud is a valid descriptor.
Returns
The new ibsta.
After a successful call
The new value applies from the next call on. The link to the old address is closed; the next transfer goes to the new one.
Errors
  • EARG – value out of range or invalid descriptor
Plus the general errors listed at the start of this section.

ibtmo

Supported
unsigned long ibtmo(int ud, int v);

Sets the timeout code (TNONE to T1000s). Same as ibconfig(ud, IbcTMO, v).

Parameters
udDevice or interface descriptor.
vThe new value.
Before you call
ud is a valid descriptor.
Returns
The new ibsta.
After a successful call
The new value applies from the next call on. Codes below 1 ms act as 1 ms; TNONE means a very long timeout of several weeks.
Errors
  • EARG – value out of range or invalid descriptor
Plus the general errors listed at the start of this section.

ibeot

Supported
unsigned long ibeot(int ud, int v);

Sets whether EOI is sent with the last byte of a write (non-zero: yes). Same as ibconfig(ud, IbcEOT, v).

Parameters
udDevice or interface descriptor.
vThe new value.
Before you call
ud is a valid descriptor.
Returns
The new ibsta.
After a successful call
The new value applies from the next call on.
Errors
  • EARG – value out of range or invalid descriptor
Plus the general errors listed at the start of this section.

ibeos

Differs
unsigned long ibeos(int ud, int v);

Sets the EOS byte and how it is used, in one value.

Parameters
udDevice or interface descriptor.
vThe EOS byte in the low 8 bits, combined with the mode bits REOS (end a read at this byte), XEOS (send EOI together with this byte) and BIN (compare all 8 bits). 0 switches EOS off.
Before you call
At least one mode bit is set whenever a byte is given.
Returns
The new ibsta.
After a successful call
Reads on this descriptor stop at the EOS byte when REOS is set.
Errors
  • EARG – a byte without any mode bit, or undefined bits set
Plus the general errors listed at the start of this section.
With a GPIBee
To store the byte without switching any mode on, use ibconfig(ud, IbcEOSchar, byte).
ibeos(dmm, REOS | 0x0A);   /* replies end with a line feed */

ibdma

Supported
unsigned long ibdma(int ud, int v);

Switches DMA on or off. Accepted for compatibility; a network connection has no DMA, so the call has no effect.

Parameters
udDevice or interface descriptor.
vAny value.
Before you call
ud is a valid descriptor.
Returns
The new ibsta.
After a successful call
Nothing changes.
Errors
  • EARG – invalid descriptor
Plus the general errors listed at the start of this section.

8.2 Reading and writing

FunctionStatusPurpose and notes
ibwrtDiffersWrite data to a device. Any length. On an interface descriptor the data goes to the GPIBee itself, not onto the bus.
ibrdDiffersRead data from a device, until EOI, the EOS byte (with REOS), a full buffer or the timeout. On an interface descriptor the data comes from the GPIBee itself, not from the bus.
ibwrtaDiffersStart a write in the background. Collect the result with ibwait(ud, CMPL); cancel it with ibstop. One background transfer per descriptor at a time (a second one gets EOIP). As ibwrt on an interface descriptor.
ibrdaDiffersStart a read in the background, as ibwrta.
ibwrtfDiffersWrite the contents of a file to a device. The file is sent in 4 KB blocks, each ending with EOI when EOI is on.
ibrdfDiffersRead one message from a device into a file. As ibrd on an interface descriptor.
ibcmdSupportedSend command bytes (with ATN) on an interface, e.g. 0x3F UNL, 0x08 GET.
ibcmdaSupportedSend command bytes in the background.
ibstopSupportedStop a background transfer. The transfer is aborted on the adapter at once, even when it is waiting for an instrument that does not respond; the result shows ERR with EABO.
ibwaitDiffersWait for an event. Supported masks: 0 (just update the status), CMPL (background transfer finished, limited by the timeout), SRQI on an interface (wait until SRQ is asserted, up to the timeout) and RQS on a device (one serial poll: the result shows whether the device requests service; it does not keep waiting). Other bits such as END, LACS or TACS return at once.
ibnotifyDiffersCall a function of yours when an event happens. Events SRQI, RQS and CMPL are supported and checked every 20 ms; other bits in the mask return ECAP. One notification per descriptor (a second one gets EARM); ibnotify(ud, 0, NULL, NULL) cancels. With RQS the device is serial-polled to find out, which clears its request.

In detail

ibwrt

Differs
unsigned long ibwrt(int ud, const void *buf, size_t cnt);

Sends data to an instrument.

Parameters
udDevice descriptor.
bufThe bytes to send.
cntNumber of bytes. Any length.
Before you call
The instrument at the descriptor's address is switched on and listening.
Returns
The new ibsta. CMPL on success.
After a successful call
ibcnt is the number of bytes the instrument accepted. If IbcEOT is on (default), EOI was sent with the last byte. Long messages are sent in several network packets, with EOI only at the very end.
Errors
  • ENOL – no instrument at that address
  • EABO – with TIMO: the timeout expired before all bytes were taken
  • EARG – buf is NULL while cnt is not 0
Plus the general errors listed at the start of this section.
With a GPIBee
On an interface descriptor the data goes to the GPIBee adapter itself (its built-in command interface, described in the GPIBee manual), not onto the bus. To address bus devices by hand, use ibcmd together with the 488.2 routines.
ibwrt(dmm, "MEAS:VOLT:DC?\n", 14);

ibrd

Differs
unsigned long ibrd(int ud, void *buf, size_t cnt);

Reads data from an instrument.

Parameters
udDevice descriptor.
bufReceives the data. It is not zero-terminated.
cntSize of buf; the read never stores more.
Before you call
The instrument has something to say, usually because you just sent it a query.
Returns
The new ibsta. END is set when the message ended with EOI, or with the EOS byte while REOS is on.
After a successful call
ibcnt bytes are in buf. The read stopped at EOI, at the EOS byte (with REOS), when buf was full, or at the timeout. If buf filled up first, END is clear and the rest of the message can be read with another ibrd.
Errors
  • EABO – with TIMO: no complete message within the timeout. Bytes received so far are in buf and counted in ibcnt.
  • ENOL – no instrument at that address
  • EARG – buf is NULL while cnt is not 0
Plus the general errors listed at the start of this section.
With a GPIBee
On an interface descriptor the read comes from the GPIBee adapter itself, not from the bus (see ibwrt).
char buf[256];
ibrd(dmm, buf, sizeof buf - 1);
buf[ThreadIbcnt()] = '\0';

ibwrta

Differs
unsigned long ibwrta(int ud, const void *buf, size_t cnt);

Starts a write in the background and returns at once.

Parameters
udDevice descriptor.
bufThe bytes to send.
cntNumber of bytes.
Before you call
No other background transfer is running on this descriptor.
Returns
The new ibsta, normally 0: the transfer is running, so CMPL is not set yet.
After a successful call
The write runs on its own thread. Keep buf unchanged and valid until it has finished. Collect the result with ibwait(ud, CMPL), cancel it with ibstop, or be called back with ibnotify and CMPL. The result then carries ibsta and ibcnt exactly as ibwrt would have.
Errors
  • EOIP – a background transfer is already running on this descriptor
  • EARG – invalid descriptor, or buf is NULL with cnt not 0
Plus the general errors listed at the start of this section.
With a GPIBee
As with ibwrt, an interface descriptor writes to the adapter itself.

ibrda

Differs
unsigned long ibrda(int ud, void *buf, size_t cnt);

Starts a read in the background and returns at once.

Parameters
udDevice descriptor.
bufReceives the data.
cntSize of buf.
Before you call
No other background transfer is running on this descriptor.
Returns
The new ibsta, normally 0.
After a successful call
The read runs on its own thread with the same rules as ibrd. Do not touch buf until it has finished. Collect the result as for ibwrta.
Errors
  • EOIP – a background transfer is already running
  • EARG – invalid descriptor or buffer
Plus the general errors listed at the start of this section.
ibrda(scope, wave, sizeof wave);
/* ... other work ... */
ibwait(scope, CMPL | TIMO);

ibwrtf

Differs
unsigned long ibwrtfA(int ud, const char *filename);
unsigned long ibwrtfW(int ud, const wchar_t *filename);   /* ibwrtf() picks one */

Sends the whole contents of a file to an instrument.

Parameters
udDevice descriptor.
filenamePath of the file. The wide version accepts ASCII characters only.
Before you call
The file exists and can be read.
Returns
The new ibsta.
After a successful call
The file was sent in blocks of 4 KB. ibcnt is the total number of bytes sent. With IbcEOT on, every block ends with EOI, so an instrument may see each block as a separate message; for one message, send the file with a single ibwrt instead.
Errors
  • EFSO – the file cannot be opened
  • EARG – name missing, or not ASCII in the wide version
Plus the general errors listed at the start of this section.
With a GPIBee
Errors of the transfer are reported as for ibwrt, with ibcnt counting what was sent before the error.

ibrdf

Differs
unsigned long ibrdfA(int ud, const char *filename);
unsigned long ibrdfW(int ud, const wchar_t *filename);   /* ibrdf() picks one */

Reads one message from an instrument into a file.

Parameters
udDevice descriptor.
filenamePath of the file to create or overwrite.
Before you call
The folder exists and is writable.
Returns
The new ibsta. CMPL and END on success.
After a successful call
The file holds all bytes received until the message ended (EOI, or EOS with REOS). ibcnt is the total.
Errors
  • EFSO – the file cannot be created or written
  • EABO – with TIMO: the instrument stopped sending; what arrived is in the file
Plus the general errors listed at the start of this section.

ibcmd

Supported
unsigned long ibcmd(int ud, const void *buf, size_t cnt);

Sends command bytes on the bus, with ATN asserted: addressing, unlisten, trigger and so on.

Parameters
udInterface descriptor.
bufThe command bytes, for example 0x3F (UNL), 0x20+n (listen address n), 0x08 (GET).
cntNumber of bytes.
Before you call
ud is an interface descriptor.
Returns
The new ibsta.
After a successful call
The bytes are on the bus. ibcnt is the number sent. The library forgets its remembered list of devices on the bus, so the next ibln scans again.
Errors
  • EARG – device descriptor, or buf is NULL
  • EBUS – the bytes could not be sent
Plus the general errors listed at the start of this section.
With a GPIBee
Commands sent this way change the bus state behind the library's back. Use them deliberately and while no other transfer is running.
static const unsigned char trig[] = { 0x3F, 0x25, 0x27, 0x08 };
ibcmd(0, trig, sizeof trig);   /* trigger devices 5 and 7 together */

ibcmda

Supported
unsigned long ibcmda(int ud, const void *buf, size_t cnt);

Sends command bytes in the background. Same as ibcmd, but returns at once.

Parameters
udInterface descriptor.
bufThe command bytes; keep them valid until done.
cntNumber of bytes.
Before you call
No background transfer is running on this descriptor.
Returns
The new ibsta, normally 0.
After a successful call
Collect the result with ibwait(ud, CMPL), ibstop or ibnotify.
Errors
  • EOIP – a background transfer is already running
  • EARG – device descriptor or missing buffer
Plus the general errors listed at the start of this section.

ibstop

Supported
unsigned long ibstop(int ud);

Stops a background transfer at once.

Parameters
udThe descriptor the transfer was started on.
Before you call
Usually a transfer started with ibrda, ibwrta or ibcmda is running.
Returns
The new ibsta: always ERR and CMPL with iberr = EABO, also when nothing was running.
After a successful call
The GPIBee has abandoned the transfer, even a read waiting for a silent instrument; the call waits at most a few seconds for this. ibcnt is the number of bytes moved before the stop. The descriptor can be used again right away.
Errors
  • EARG – invalid descriptor
Plus the general errors listed at the start of this section.

ibwait

Differs
unsigned long ibwait(int ud, int mask);

Waits for an event, or just reports the current status.

Parameters
udDevice or interface descriptor.
mask0, or a combination of CMPL, SRQI, RQS and TIMO.
Before you call
For SRQI, ud is an interface descriptor; for RQS, a device descriptor.
Returns
The new ibsta.
After a successful call
mask 0: returns at once. If a background transfer has finished meanwhile, its result is reported.
CMPL: waits until the background transfer on ud has finished, at most the descriptor's timeout, and reports its result (ibsta, iberr, ibcnt). If the timeout expires first, the result is ERR, TIMO, EABO and the transfer keeps running.
SRQI (interface): waits until SRQ is asserted, at most the timeout. The line is checked every 20 ms.
RQS (device): serial-polls the device once and returns. RQS is set if the device was requesting service; the poll clears its request.
Other bits (END, LACS, ...) return at once with CMPL.
Errors
  • EARG – invalid descriptor
  • EABO – with TIMO: the event did not happen within the timeout
Plus the general errors listed at the start of this section.
ibwait(0, SRQI | TIMO);
if (!(ThreadIbsta() & TIMO)) { /* someone requests service */ }

ibnotify

Differs
unsigned long ibnotify(int ud, int mask, GpibNotifyCallback_t callback, void *RefData);

Calls a function of yours when an event happens, instead of waiting for it.

Parameters
udDevice or interface descriptor.
maskSRQI (interface), RQS (device) and/or CMPL. 0 cancels.
callbackYour function; NULL cancels.
RefDataAny pointer; handed to the callback unchanged.
Before you call
No notification is armed on this descriptor yet.
Returns
The new ibsta.
After a successful call
The library checks the event about every 20 ms on its own thread. When it happens, it calls callback(ud, ibsta, iberr, ibcntl, RefData) on that thread. The value the callback returns is the mask to wait for next; returning 0 ends the notification. ibnotify(ud, 0, NULL, NULL) ends it from outside.
Errors
  • ECAP – the mask contains other bits
  • EARM – a notification is already armed on this descriptor
  • EARG – invalid descriptor
Plus the general errors listed at the start of this section.
With a GPIBee
With RQS the device is serial-polled every 20 ms. The poll that sees the request also clears it, so the status byte itself is gone by the time the callback runs; if you need it, use SRQI on the interface and poll the devices yourself in the callback. Keep the callback short and thread-safe.
int __stdcall on_srq(int ud, unsigned long sta, unsigned long err,
                     unsigned long cnt, void *ref)
{
    /* handle it; return SRQI to keep watching, 0 to stop */
    return SRQI;
}
...
ibnotify(0, SRQI, on_srq, NULL);

8.3 Device and bus control

FunctionStatusPurpose and notes
ibclrSupportedSelected device clear.
ibtrgSupportedGroup execute trigger to one device.
iblocSupportedReturn a device to local (front panel) control.
ibsicSupportedInterface clear (IFC) on an interface.
ibsreSupportedAssert or release the REN (remote enable) line.
iblnDiffersCheck whether a device answers at an address. ALL_SAD is not available.
iblinesDiffersRead the control lines. The GPIBee reports REN, SRQ and NDAC; only these have their valid bit set. ATN, DAV, NRFD, EOI and IFC are reported as "not available" (valid bit 0), as the specification provides for.
ibcacDiffersTake control (assert ATN). Synchronous and asynchronous take-control behave the same.
ibgtsDiffersGo to standby (release ATN). Shadow handshake is not available; the argument is ignored.
ibrscDiffersThe GPIBee is always the system controller. ibrsc(ud, 1) succeeds; giving the role up (ibrsc(ud, 0)) returns ECAP.
ibpctNot availablePass control to another device. The current GPIBee firmware cannot hand over control, so this returns ECAP.
iblckSupportedLock or unlock a device or interface, with a wait time. The lock is held on the GPIBee, so it protects against other programs and other PCs as well.
ibistNot availableSet the individual status bit for parallel polls of the interface itself. The GPIBee always acts as controller and is never polled.
ibrsvNot availableSet the serial poll status byte of the interface itself. Same reason as ibist.

In detail

ibclr

Supported
unsigned long ibclr(int ud);

Sends a selected device clear to one instrument. The instrument stops what it is doing and clears its input and output buffers.

Parameters
udDevice descriptor.
Before you call
The instrument is switched on and connected.
Returns
The new ibsta.
After a successful call
The instrument is cleared.
Errors
  • ENOL – no instrument at that address
  • EABO – with TIMO: no answer within the timeout
Plus the general errors listed at the start of this section.

ibtrg

Supported
unsigned long ibtrg(int ud);

Sends a group execute trigger to one instrument.

Parameters
udDevice descriptor.
Before you call
The instrument is switched on and connected.
Returns
The new ibsta.
After a successful call
The instrument has been triggered.
Errors
  • ENOL – no instrument at that address
  • EABO – with TIMO: no answer within the timeout
Plus the general errors listed at the start of this section.

ibloc

Supported
unsigned long ibloc(int ud);

Returns one instrument to local control, so its front panel works again.

Parameters
udDevice descriptor.
Before you call
The instrument is switched on and connected.
Returns
The new ibsta.
After a successful call
The instrument is in local state. The next transfer puts it into remote again, as long as REN is asserted.
Errors
  • ENOL – no instrument at that address
  • EABO – with TIMO: no answer within the timeout
Plus the general errors listed at the start of this section.

ibsic

Supported
unsigned long ibsic(int ud);

Sends interface clear (IFC) on the bus. All instruments stop talking and listening; the GPIBee becomes controller in charge.

Parameters
udInterface descriptor.
Before you call
ud is an interface descriptor.
Returns
The new ibsta.
After a successful call
The bus is in a defined idle state. The remembered list of devices on the bus is discarded.
Errors
  • EARG – device descriptor
Plus the general errors listed at the start of this section.
ibsic(0);

ibsre

Supported
unsigned long ibsre(int ud, int v);

Asserts or releases the REN (remote enable) line.

Parameters
udInterface descriptor.
vNon-zero: assert REN. 0: release it, which returns all instruments to local.
Before you call
ud is an interface descriptor.
Returns
The new ibsta.
After a successful call
The REN line has the requested state; ibask(ud, IbaSRE, ...) reports it.
Errors
  • EARG – device descriptor
Plus the general errors listed at the start of this section.

ibln

Differs
unsigned long ibln(int ud, int pad, int sad, short *listen);

Checks whether an instrument is present at an address.

Parameters
udDevice or interface descriptor; it only selects the interface.
padPrimary address, 0 to 30.
sadNO_SAD for no secondary address, or 0x60 to 0x7E.
listenReceives 1 if a device answers, otherwise 0.
Before you call
listen points to a short.
Returns
The new ibsta.
After a successful call
*listen says whether a device is there. Nothing is sent to the instrument.
Errors
  • EARG – address out of range, ALL_SAD given, or listen is NULL
Plus the general errors listed at the start of this section.
With a GPIBee
The library asks the GPIBee for a list of all devices on the bus (about 2.5 s) and keeps it for 3 seconds, so checking many addresses in a row is fast. ALL_SAD ("any secondary address") is not available; check each secondary address separately, or use FindLstn.
short here;
ibln(0, 22, NO_SAD, &here);

iblines

Differs
unsigned long iblines(int ud, short *result);

Reads the state of the bus control lines.

Parameters
udDevice or interface descriptor; it selects the interface.
resultReceives the line word.
Before you call
result points to a short.
Returns
The new ibsta.
After a successful call
The low byte of *result says which lines could be read (ValidREN, ValidSRQ, ValidNDAC); the high byte holds their state (BusREN, BusSRQ, BusNDAC). Only read a Bus... bit whose Valid... bit is set.
Errors
  • EARG – result is NULL
Plus the general errors listed at the start of this section.
With a GPIBee
ATN, DAV, NRFD, EOI and IFC cannot be read through a GPIBee; their valid bits are always 0.
short l;
iblines(0, &l);
if ((l & ValidSRQ) && (l & BusSRQ)) { /* SRQ is asserted */ }

ibcac

Differs
unsigned long ibcac(int ud, int v);

Takes control of the bus: asserts ATN.

Parameters
udInterface descriptor.
vSynchronous (1) or asynchronous (0). Both behave the same.
Before you call
ud is an interface descriptor.
Returns
The new ibsta.
After a successful call
ATN is asserted.
Errors
  • EARG – device descriptor
Plus the general errors listed at the start of this section.

ibgts

Differs
unsigned long ibgts(int ud, int v);

Goes to standby: releases ATN so that instruments can exchange data among themselves.

Parameters
udInterface descriptor.
vShadow handshake. Not available; the value is ignored.
Before you call
ud is an interface descriptor.
Returns
The new ibsta.
After a successful call
ATN is released.
Errors
  • EARG – device descriptor
Plus the general errors listed at the start of this section.

ibrsc

Differs
unsigned long ibrsc(int ud, int v);

Requests or releases the system controller role.

Parameters
udInterface descriptor.
vNon-zero: be system controller. 0: give the role up.
Before you call
ud is an interface descriptor.
Returns
The new ibsta.
After a successful call
The GPIBee is the system controller; it always is.
Errors
  • ECAP – v is 0: a GPIBee cannot give up the role
  • EARG – device descriptor
Plus the general errors listed at the start of this section.

ibpct

Not available
unsigned long ibpct(int ud);

Passes control of the bus to another controller.

Parameters
udDevice descriptor of the controller to take over.
Before you call
Nothing special.
Returns
The new ibsta, with ERR set.
After a successful call
Nothing changes. The current GPIBee firmware cannot hand over control.
Errors
  • ECAP – always, with the current firmware
  • EARG – interface descriptor
Plus the general errors listed at the start of this section.

iblck

Supported
unsigned long iblck(int ud, int v, unsigned int LockWaitTime, void *Reserved);

Locks or unlocks a device or interface for exclusive use.

Parameters
udDevice or interface descriptor.
vNon-zero: lock. 0: unlock.
LockWaitTimeHow long to wait for a lock held by someone else, in milliseconds. 0: do not wait.
ReservedPass NULL.
Before you call
To unlock: you hold the lock.
Returns
The new ibsta.
After a successful call
While you hold the lock, other programs and other PCs that use the same instrument through this GPIBee are refused (ELCK) until you unlock or close the descriptor.
Errors
  • ELCK – someone else holds the lock and it was not released within LockWaitTime, or you unlock without holding it
Plus the general errors listed at the start of this section.

ibist

Not available
unsigned long ibist(int ud, int v);

Would set the interface's own individual status bit for parallel polls.

Parameters
udInterface descriptor.
vBit value.
Before you call
Nothing special.
Returns
ERR set.
After a successful call
Nothing changes. The GPIBee is always controller and is never polled itself.
Errors
  • ECAP – always
Plus the general errors listed at the start of this section.

ibrsv

Not available
unsigned long ibrsv(int ud, int v);

Would set the interface's own serial poll status byte.

Parameters
udInterface descriptor.
vStatus byte.
Before you call
Nothing special.
Returns
ERR set.
After a successful call
Nothing changes, for the same reason as ibist.
Errors
  • ECAP – always
Plus the general errors listed at the start of this section.

8.4 Polling

FunctionStatusPurpose and notes
ibrspSupportedSerial poll one device, returns its status byte.
ibrppSupportedParallel poll on an interface; returns the state of the eight DIO lines.
ibppcDiffersConfigure a device for parallel polls (enable with line and sense, or disable). On a device descriptor this works; on an interface descriptor it would configure the interface's own response, which a GPIBee does not have, and returns ECAP.

In detail

ibrsp

Supported
unsigned long ibrsp(int ud, char *spr);

Serial-polls one instrument and returns its status byte.

Parameters
udDevice descriptor.
sprReceives the status byte.
Before you call
spr points to a char.
Returns
The new ibsta. RQS is set if bit 6 of the status byte is set.
After a successful call
*spr holds the status byte. If the instrument was requesting service, the poll has cleared that request. The serial poll timeout (IbcSPollTime) applies.
Errors
  • ENOL – no instrument at that address
  • EABO – with TIMO: no answer within the serial poll timeout
  • EARG – spr is NULL
Plus the general errors listed at the start of this section.
char stb;
ibrsp(dmm, &stb);
if (stb & 0x40) { /* service requested */ }

ibrpp

Supported
unsigned long ibrpp(int ud, char *ppr);

Conducts a parallel poll on the interface.

Parameters
udDevice or interface descriptor; it selects the interface.
pprReceives the poll result.
Before you call
Devices to be polled have been configured with ibppc or PPollConfig.
Returns
The new ibsta.
After a successful call
Bit n−1 of *ppr is set if the device configured for data line n requests service.
Errors
  • EARG – ppr is NULL
Plus the general errors listed at the start of this section.

ibppc

Differs
unsigned long ibppc(int ud, int v);

Configures one device for parallel polls, or removes its configuration.

Parameters
udDevice descriptor.
vEnable: 0x60 | (sense << 3) | (line − 1), i.e. 0x60 to 0x6F. Disable: 0x70.
Before you call
ud is a device descriptor.
Returns
The new ibsta.
After a successful call
The device answers parallel polls on the given data line (1 to 8), or no longer answers.
Errors
  • ECAP – interface descriptor: the GPIBee has no parallel poll response of its own
  • EARG – v is neither an enable nor a disable value
Plus the general errors listed at the start of this section.
ibppc(dmm, 0x60 | (1 << 3) | (3 - 1));   /* line 3, sense 1 */

8.5 Status

FunctionStatusPurpose and notes
ThreadIbstaSupportedibsta of the last call made by the calling thread.
ThreadIberrSupportediberr of the calling thread.
ThreadIbcntSupportedibcnt of the calling thread. ThreadIbcntl gives the same value.
IbstaSupportedibsta of the last call in the program, from any thread.
IberrSupportedAs Ibsta, for iberr.
IbcntSupportedAs Ibsta, for ibcnt.

In detail

ThreadIbsta

Supported
unsigned long ThreadIbsta(void);
unsigned long ThreadIberr(void);
unsigned long ThreadIbcnt(void);
unsigned long ThreadIbcntl(void);   /* same value as ThreadIbcnt */

Return ibsta, iberr and ibcnt of the last call made by the calling thread.

Before you call
None. Can be called any time.
Returns
The value.
After a successful call
Nothing changes. Each thread has its own values, so a call in another thread does not overwrite them. This is the recommended way to read the status.
if (ThreadIbsta() & ERR) printf("error %lu\n", ThreadIberr());

Ibsta

Supported
unsigned long Ibsta(void);
unsigned long Iberr(void);
unsigned long Ibcnt(void);

Return ibsta, iberr and ibcnt of the last call made by any thread of the program.

Before you call
None.
Returns
The value.
After a successful call
Nothing changes. In programs with several threads, prefer the Thread... functions.

8.6 488.2 routines

These routines take an interface number and one address or a list of addresses ending with NOADDR. A list can hold up to 32 addresses.

FunctionStatusPurpose and notes
SendIFCSupportedInterface clear; resets the bus.
FindLstnSupportedFind the devices present on the bus, including secondary addresses.
DevClearSupportedClear one device, or all devices with NOADDR.
DevClearListDiffersClear the listed devices. They are cleared one after another rather than with one bus command; an empty list clears all devices at once.
EnableRemoteSupportedAssert REN and put the listed devices into remote state.
EnableLocalSupportedReturn the listed devices to local; an empty list releases REN for the whole bus.
SendLLOSupportedLocal lockout for all devices.
SetRWLSSupportedRemote with lockout for the listed devices.
SendSupportedSend a message to one device. End modes NULLend, NLend, DABend.
SendListDiffersSend the same message to several devices. Each device receives it in turn, not all at the same moment.
SendSetupDiffersPrepare devices to listen for SendDataBytes. Only the first device of the list receives the data that follows. To reach several devices, use SendList.
SendDataBytesDiffersSend data to the device prepared with SendSetup (see there). Without a SendSetup before it, EADR.
SendCmdsSupportedSend command bytes on the bus.
ReceiveSupportedRead a message from one device, until STOPend (EOI) or a given end character.
ReceiveSetupDiffersPrepare a device to talk for RcvRespMsg. The device is remembered and addressed when RcvRespMsg runs, not right away.
RcvRespMsgDiffersRead from the device prepared with ReceiveSetup. Without a ReceiveSetup before it, EADR.
TriggerSupportedTrigger one device, or all addressed devices with NOADDR.
TriggerListDiffersTrigger the listed devices. They are triggered one after another, a few milliseconds apart, not with one group trigger. If they must start at exactly the same moment, address them as listeners and send GET yourself with SendCmds (example at the end of section 10). An empty list sends one GET.
ReadStatusByteSupportedSerial poll one device.
AllSpollSupportedSerial poll the listed devices.
FindRQSSupportedFind the first listed device that requests service.
TestSRQSupportedTell whether SRQ is asserted right now.
WaitSRQSupportedWait until SRQ is asserted or the interface timeout expires. The line is checked every 20 ms.
PPollSupportedParallel poll.
PPollConfigSupportedConfigure a device's parallel poll response (data line 1 to 8, sense 0 or 1).
PPollUnconfigSupportedRemove the parallel poll configuration of the listed devices, or of all devices with an empty list.
ResetSysSupportedReset the system: IFC, clear, then *RST to each listed device.
TestSysSupportedRun *TST? on each listed device; ibcnt gives the number of devices that failed.
PassControlNot availablePass control to another controller. The current GPIBee firmware cannot hand over control.

In detail

SendIFC

Supported
void SendIFC(int boardID);

Resets the bus with interface clear. Usually the first call of a program that uses the 488.2 routines.

Parameters
boardIDInterface number, 0 for GPIB0.
Before you call
A GPIBee exists for boardID.
Returns
Nothing; check ThreadIbsta().
After a successful call
All instruments are unaddressed; the GPIBee is controller in charge.
Errors
  • ENEB – no GPIBee for this interface
Plus the general errors listed at the start of this section.
SendIFC(0);

FindLstn

Supported
void FindLstn(int boardID, const Addr4882_t *addrlist, Addr4882_t *results, size_t limit);

Finds the instruments present on the bus.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistThe addresses you are interested in, ending with NOADDR. A list holding only NOADDR (or NULL) reports every device found.
resultsReceives the addresses found, ending with NOADDR.
limitNumber of entries results can hold, including the closing NOADDR.
Before you call
results has room for limit entries.
Returns
Nothing.
After a successful call
results lists the devices found, including those on secondary addresses; ibcnt is their number. The scan takes about 2.5 s and is always done afresh.
Errors
  • ETAB – more devices than fit into results
  • EARG – results is NULL or limit is 0
Plus the general errors listed at the start of this section.
Addr4882_t all[] = { NOADDR }, found[32];
FindLstn(0, all, found, 32);

DevClear

Supported
void DevClear(int boardID, Addr4882_t addr);

Clears one instrument, or all of them.

Parameters
boardIDInterface number, 0 for GPIB0.
addrAddress of the instrument, or NOADDR to clear every device on the bus.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The device (or all devices) is cleared.
Errors
  • ENOL – no instrument at that address
Plus the general errors listed at the start of this section.

DevClearList

Differs
void DevClearList(int boardID, const Addr4882_t *addrlist);

Clears several instruments.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The listed devices are cleared one after another. An empty list (only NOADDR) clears all devices at once.
Errors
  • ENOL – one of the devices does not answer; the ones after it are not cleared
Plus the general errors listed at the start of this section.

EnableRemote

Supported
void EnableRemote(int boardID, const Addr4882_t *addrlist);

Asserts REN and puts the listed instruments into remote state.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
REN is asserted. The listed devices are in remote; an empty list only asserts REN.
Errors
  • ENEB – no GPIBee for this interface
Plus the general errors listed at the start of this section.

EnableLocal

Supported
void EnableLocal(int boardID, const Addr4882_t *addrlist);

Returns instruments to local control.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The listed devices are in local state. An empty list releases REN, which returns the whole bus to local.
Errors
  • ENOL – a listed device does not answer
Plus the general errors listed at the start of this section.

SendLLO

Supported
void SendLLO(int boardID);

Sends local lockout: the local buttons of all instruments in remote stop working.

Parameters
boardIDInterface number, 0 for GPIB0.
Before you call
Usually REN is asserted.
Returns
Nothing.
After a successful call
Instruments cannot be switched to local from their front panel until REN is released.

SetRWLS

Supported
void SetRWLS(int boardID, const Addr4882_t *addrlist);

Puts the listed instruments into remote with lockout. Same as EnableRemote followed by SendLLO.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The devices are remote and locked out from local control.

Send

Supported
void Send(int boardID, Addr4882_t addr, const void *buf, size_t cnt, int eotMode);

Sends a message to one instrument.

Parameters
boardIDInterface number, 0 for GPIB0.
addrOne address, made with MakeAddr(pad, sad).
bufThe bytes to send.
cntNumber of bytes.
eotModeNLend: append a line feed and send EOI with it. DABend: send EOI with the last byte. NULLend: no EOI.
Before you call
The instrument is switched on.
Returns
Nothing.
After a successful call
ibcnt is the number of bytes sent (including the added line feed with NLend).
Errors
  • ENOL – no instrument at that address
  • EABO – with TIMO: not all bytes were accepted within the timeout
Plus the general errors listed at the start of this section.
Send(0, MakeAddr(22, NO_SAD), "*RST", 4, NLend);

SendList

Differs
void SendList(int boardID, const Addr4882_t *addrlist, const void *buf, size_t cnt, int eotMode);

Sends the same message to several instruments.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
bufThe bytes to send.
cntNumber of bytes.
eotModeAs for Send.
Before you call
The list holds at least one address.
Returns
Nothing.
After a successful call
Each listed device has received the message, one after another rather than all at the same moment.
Errors
  • EARG – empty list
  • ENOL – a device does not answer; the ones after it receive nothing
Plus the general errors listed at the start of this section.

SendSetup

Differs
void SendSetup(int boardID, const Addr4882_t *addrlist);

Prepares instruments to receive data sent later with SendDataBytes.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
The list holds at least one address.
Returns
Nothing.
After a successful call
The library remembers the first address of the list; the following SendDataBytes sends to that device only. Nothing is sent on the bus yet. To reach several devices, use SendList.
Errors
  • EARG – empty list
Plus the general errors listed at the start of this section.

SendDataBytes

Differs
void SendDataBytes(int boardID, const void *buf, size_t cnt, int eotMode);

Sends data to the instrument prepared with SendSetup.

Parameters
boardIDInterface number, 0 for GPIB0.
bufThe bytes.
cntNumber of bytes.
eotModeAs for Send.
Before you call
SendSetup was called before, for the same interface.
Returns
Nothing.
After a successful call
As after Send.
Errors
  • EADR – no SendSetup before, or one for another interface
Plus the general errors listed at the start of this section.

SendCmds

Supported
void SendCmds(int boardID, const void *buf, size_t cnt);

Sends command bytes on the bus, like ibcmd.

Parameters
boardIDInterface number, 0 for GPIB0.
bufThe command bytes.
cntNumber of bytes.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
ibcnt is the number of bytes sent. The remembered list of devices on the bus is discarded.
Errors
  • EBUS – the bytes could not be sent
  • EARG – missing buffer
Plus the general errors listed at the start of this section.
static const unsigned char cmds[] = { 0x3F, 0x25, 0x27, 0x08 };
SendCmds(0, cmds, sizeof cmds);   /* GET to 5 and 7 at once */

Receive

Supported
void Receive(int boardID, Addr4882_t addr, void *buf, size_t cnt, int termination);

Reads a message from one instrument.

Parameters
boardIDInterface number, 0 for GPIB0.
addrOne address, made with MakeAddr(pad, sad).
bufReceives the data.
cntSize of buf.
terminationSTOPend: stop at EOI. Any value 0 to 255: also stop at that byte, for example '\n'.
Before you call
The instrument has something to say.
Returns
Nothing.
After a successful call
ibcnt bytes are in buf; END is set when the message ended with EOI or the end byte.
Errors
  • EABO – with TIMO: no complete message within the timeout
  • ENOL – no instrument at that address
Plus the general errors listed at the start of this section.
char r[256];
Receive(0, MakeAddr(22, NO_SAD), r, sizeof r - 1, STOPend);
r[ThreadIbcnt()] = '\0';

ReceiveSetup

Differs
void ReceiveSetup(int boardID, Addr4882_t addr);

Prepares an instrument to talk for RcvRespMsg.

Parameters
boardIDInterface number, 0 for GPIB0.
addrOne address, made with MakeAddr(pad, sad).
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The address is remembered. The device is only addressed when RcvRespMsg runs.

RcvRespMsg

Differs
void RcvRespMsg(int boardID, void *buf, size_t cnt, int termination);

Reads from the instrument prepared with ReceiveSetup.

Parameters
boardIDInterface number, 0 for GPIB0.
bufReceives the data.
cntSize of buf.
terminationAs for Receive.
Before you call
ReceiveSetup was called before, for the same interface.
Returns
Nothing.
After a successful call
As after Receive.
Errors
  • EADR – no ReceiveSetup before
Plus the general errors listed at the start of this section.

Trigger

Supported
void Trigger(int boardID, Addr4882_t addr);

Triggers one instrument, or all instruments currently addressed as listeners.

Parameters
boardIDInterface number, 0 for GPIB0.
addrAddress of the instrument, or NOADDR to send one GET to whoever is addressed.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The device has been triggered.
Errors
  • ENOL – no instrument at that address
Plus the general errors listed at the start of this section.

TriggerList

Differs
void TriggerList(int boardID, const Addr4882_t *addrlist);

Triggers several instruments.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The listed devices were triggered one after another, a few milliseconds apart. An empty list sends one GET to whoever is addressed. For a truly simultaneous trigger, see the example at SendCmds.
Errors
  • ENOL – a device does not answer; the ones after it are not triggered
Plus the general errors listed at the start of this section.

ReadStatusByte

Supported
void ReadStatusByte(int boardID, Addr4882_t addr, short *result);

Serial-polls one instrument.

Parameters
boardIDInterface number, 0 for GPIB0.
addrOne address, made with MakeAddr(pad, sad).
resultReceives the status byte in its low 8 bits.
Before you call
result points to a short.
Returns
Nothing.
After a successful call
*result holds the status byte; RQS is set if the device requested service. The poll clears the request.
Errors
  • ENOL – no instrument at that address
  • EARG – result is NULL
Plus the general errors listed at the start of this section.

AllSpoll

Supported
void AllSpoll(int boardID, const Addr4882_t *addrlist, short *results);

Serial-polls several instruments.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
resultsReceives one status byte per listed address, in the same order.
Before you call
results has one entry per address.
Returns
Nothing.
After a successful call
results is filled; ibcnt is the number of devices polled.
Errors
  • ENOL – a device does not answer; polling stops there
Plus the general errors listed at the start of this section.

FindRQS

Supported
void FindRQS(int boardID, const Addr4882_t *addrlist, short *result);

Finds the first listed instrument that requests service.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
resultReceives that device's status byte.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The devices are polled in list order until one requests service. *result is its status byte and ibcnt its position in the list (counting from 0).
Errors
  • ETAB – no listed device requests service; ibcnt is the number polled
  • ENOL – a device does not answer
Plus the general errors listed at the start of this section.

TestSRQ

Supported
void TestSRQ(int boardID, short *result);

Tells whether SRQ is asserted right now, without waiting.

Parameters
boardIDInterface number, 0 for GPIB0.
resultReceives 1 if SRQ is asserted, otherwise 0.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
*result is set; SRQI in ibsta mirrors it.
Errors
  • EARG – result is NULL
Plus the general errors listed at the start of this section.

WaitSRQ

Supported
void WaitSRQ(int boardID, short *result);

Waits until an instrument asserts SRQ.

Parameters
boardIDInterface number, 0 for GPIB0.
resultReceives 1 if SRQ came, 0 on timeout.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
Returns as soon as SRQ is asserted (checked every 20 ms), or when the interface timeout has passed. Find the requesting device with FindRQS or AllSpoll.
Errors
  • EABO – with TIMO: no SRQ within the timeout
Plus the general errors listed at the start of this section.

PPoll

Supported
void PPoll(int boardID, short *result);

Conducts a parallel poll.

Parameters
boardIDInterface number, 0 for GPIB0.
resultReceives the state of data lines 1 to 8 in bits 0 to 7.
Before you call
Devices have been configured with PPollConfig.
Returns
Nothing.
After a successful call
*result is set.
Errors
  • EARG – result is NULL
Plus the general errors listed at the start of this section.

PPollConfig

Supported
void PPollConfig(int boardID, Addr4882_t addr, int dataLine, int lineSense);

Configures one instrument for parallel polls.

Parameters
boardIDInterface number, 0 for GPIB0.
addrOne address, made with MakeAddr(pad, sad).
dataLineData line 1 to 8 the device answers on.
lineSense1: the device drives the line when it requests service. 0: the opposite.
Before you call
The device supports parallel polls.
Returns
Nothing.
After a successful call
The device answers parallel polls on dataLine.
Errors
  • EARG – address, line or sense out of range
Plus the general errors listed at the start of this section.

PPollUnconfig

Supported
void PPollUnconfig(int boardID, const Addr4882_t *addrlist);

Removes the parallel poll configuration.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistThe devices, ending with NOADDR. A list holding only NOADDR affects every device.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
The devices no longer answer parallel polls.
Errors
  • EARG – an address out of range
Plus the general errors listed at the start of this section.

ResetSys

Supported
void ResetSys(int boardID, const Addr4882_t *addrlist);

Resets the whole measurement system.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
Before you call
Nothing special.
Returns
Nothing.
After a successful call
Interface clear was sent, the listed devices (all devices for an empty list) were cleared, and each listed device received *RST.
Errors
  • ENOL – a device does not answer; the sequence stops there
Plus the general errors listed at the start of this section.

TestSys

Supported
void TestSys(int boardID, const Addr4882_t *addrlist, short *results);

Runs the self-test of each listed instrument.

Parameters
boardIDInterface number, 0 for GPIB0.
addrlistAddresses, made with MakeAddr(pad, sad), ending with NOADDR. Up to 32 entries.
resultsReceives the self-test result of each device, 0 meaning passed.
Before you call
The devices understand *TST?. Allow for their self-test time in the interface timeout.
Returns
Nothing.
After a successful call
results holds the answers; ibcnt is the number of devices that failed.
Errors
  • EABO – with TIMO: a self-test took longer than the timeout
Plus the general errors listed at the start of this section.

PassControl

Not available
void PassControl(int boardID, Addr4882_t addr);

Passes control of the bus to another controller.

Parameters
boardIDInterface number, 0 for GPIB0.
addrOne address, made with MakeAddr(pad, sad).
Before you call
Nothing special.
Returns
Nothing; ERR is set.
After a successful call
Nothing changes. The current GPIBee firmware cannot hand over control.
Errors
  • ECAP – always, with the current firmware
Plus the general errors listed at the start of this section.

9. Settings for ibconfig and ibask

OptionStatusNotes
IbcPAD, IbcSADSupportedPrimary and secondary address. ibask returns the secondary address in the form it was set with.
IbcTMOSupportedTimeout code, as ibtmo.
IbcEOTSupportedEOI with the last byte of a write.
IbcEOSrd, IbcEOSwrt, IbcEOScmp, IbcEOScharSupportedThe parts of the EOS setting one by one: stop reading at EOS, send EOI with EOS, 8-bit compare, the byte itself.
IbcEndBitIsNormalSupportedOn (default): END is set for EOI and for the EOS byte. Off: only for EOI.
IbcSPollTimeSupportedTimeout for serial polls.
IbcSRESupportedInterface only. Asserts or releases REN, as ibsre.
IbcSCSupportedInterface only. Always system controller (see ibrsc).
IbaBNASupportedibask only: the interface number a device descriptor belongs to.
IbcREADDR, IbcUnAddrDiffersAccepted and reported back, but have no effect: the GPIBee addresses the device for every transfer by itself.
IbcAUTOPOLLDiffersInterface only. Accepted and reported back; no automatic serial polling takes place.
IbcLONDiffersAccepted and reported back; listen-only mode is not available.
IbcDMADiffersAccepted, no effect; ibask returns 0.
IbcTIMINGNot availableThe bus timing (T1 delay) is set on the GPIBee itself, in its web interface.
IbcPPC, IbcPP2, IbcPPollTimeNot availableUse ibppc / PPollConfig to configure devices for parallel polls.
IbcIst, IbcRsvNot availableThe GPIBee is never polled itself (see ibist, ibrsv).
IbcCICPROT, IbcIRQ, IbcReadAdjust, IbcWriteAdjust, IbcSendLLO, IbcSignalNumber, IbcBlockIfLocked, IbcHSCableLengthNot availableRelate to properties of plug-in GPIB hardware that a network adapter does not have.
IbaSerialNumberNot availableThe serial number of a GPIBee is shown in the adapters dialog of the interactive control and in the GPIBee's web interface.

A setting that is not available returns ERR with ECAP and is not stored. Nothing is ever ignored silently.

10. Status word, errors and timeouts

10.1 Status bits (ibsta)

BitValueMeaning
ERR0x8000The call failed; iberr says why.
TIMO0x4000The timeout expired.
END0x2000The read ended with EOI or the EOS byte.
SRQI0x1000SRQ is asserted on the interface.
RQS0x0800The device requests service.
CMPL0x0100The operation is complete.
LOK, REM, CIC, ATN, TACS, LACS, DTAS, DCAS0x0080 ... 0x0001State of the interface when it is itself a device. The GPIBee is always the controller, so these bits are not set.

10.2 Error codes (iberr)

CodeValueMeaning, and what usually causes it with a GPIBee
EDVR0System error. The GPIBee cannot be reached over the network (switched off, wrong address, firewall), or a device name was given to ibfind.
ECIC1The interface must be controller in charge.
ENOL2No listener: no device answers at this address. Check address, cable and power of the instrument.
EADR3Addressing error, e.g. SendDataBytes without SendSetup.
EARG4Invalid argument, e.g. address out of range, unknown descriptor, function used on the wrong kind of descriptor.
ESAC5The interface must be system controller.
EABO6The operation was aborted: timeout (with TIMO) or ibstop.
ENEB7No such interface: no GPIBee is assigned to or found for this number (section 5).
EOIP10A background transfer is still running on this descriptor.
ECAP11Not available with a GPIBee (sections 8 and 9).
EFSO12File error in ibrdf / ibwrtf.
EBUS14Error while sending command bytes on the bus.
ETAB20A table is full: too many descriptors open, too many results for FindLstn, or FindRQS found no device requesting service.
ELCK21The device or interface is locked by another program or another PC.
EARM22An ibnotify is already armed on this descriptor.

10.3 Timeouts

CodeTimeCodeTimeCodeTime
TNONE (0)no limit*T3ms (6)3 msT1s (11)1 s
T10us (1)1 ms*T10ms (7)10 msT3s (12)3 s
T30us (2)1 ms*T30ms (8)30 msT10s (13)10 s (default)
T100us (3)1 ms*T100ms (9)100 msT30s (14)30 s
T300us (4)1 ms*T300ms (10)300 msT100s (15)100 s
T1ms (5)1 msT300s (16), T1000s (17)300 s, 1000 s

* Values marked with an asterisk differ from the nominal value; see ibtmo in section 8.1.

Tip: Each call travels over the network, which adds a fraction of a millisecond on a local network and more over long distances. Very short timeouts that worked with a plug-in card may need to be raised a little.

Simultaneous trigger of several devices

/* Unlisten, address devices 5 and 7 as listeners, then one Group Execute Trigger. */
static const unsigned char cmds[] = { 0x3F, 0x20 + 5, 0x20 + 7, 0x08 };
SendCmds(0, cmds, sizeof cmds);

11. Troubleshooting

11.1 Trace log

The library can write every call, with its arguments and its result, to a log file. Nothing needs to be rebuilt: set an environment variable before starting the program.

set GPIBEE_TRACE=1                    log to %TEMP%\gpibee_trace.log
set GPIBEE_TRACE=C:\logs\gpib.log     log to this file
myprogram.exe

The log starts with a line naming the program that loaded the library, with its bitness. If the log stays empty after running a program, the program did not load our library at all; check where the DLLs are (section 4). The log also shows which GPIBee became which interface number, and why. The output also goes to the Windows debug output, so a tool such as DebugView shows it live. Remove the variable again for normal use.

11.2 Common problems

SymptomWhat to check
Program says gpib-32.dll is missing, or "not a valid Win32 application"The DLL is not where the program looks, or it has the wrong bitness. Copy it from the folder matching the program's bitness next to the .exe (section 4).
Program says a DLL other than gpib-32.dll is missing, although GPIBee488 is installedThe program loads the 488.2 interface under a different file name. Copy gpib-32.dll and give the copy that name (section 4.4).
Every call fails with ENEBNo GPIBee for this interface number. Open the interactive control, press Adapters... and Find adapters. If none is found, assign the address by hand (section 5.2).
Calls fail with EDVRThe GPIBee does not answer over the network. Open its address in a browser. Check cable, power, IP address, and that no firewall blocks the connection.
ENOL on writeNo instrument at that address. Check the address on the instrument, the GPIB cable and that the instrument is switched on. Scan bus shows what is there.
Read ends with TIMO although data arrivedThe instrument ends its replies with a line feed but no EOI. Set REOS with EOS byte 0x0A: ibeos(ud, REOS | 0x0A).
The first call of a program takes about a secondNo adapter is assigned, so the library searches the network. Assign the adapter to avoid the search (section 5.2).
A program sees a different GPIB card than the GPIBeeWindows loaded another product's gpib-32.dll. Put ours next to the program, or check the system folders (section 4.3). The trace log (11.1) tells you which one was loaded: if it stays empty, it was not ours.
ELCKAnother program or another PC holds a lock on the instrument or interface. Close it, or wait for the lock to be released.

12. Requirements

ItemRequirement
Operating systemWindows 7 or newer, 32-bit or 64-bit.
Additional softwareNone. No driver, no VISA, no runtime package.
AdapterOne or more GPIBEE adapters, connected over Ethernet, or over USB in USB network mode.
NetworkThe PC must reach the GPIBee's IP address (TCP; UDP broadcast for the automatic search).
InterfacesUp to 8 GPIBees (GPIB0 to GPIB7), up to 32 open device descriptors at a time.

13. Security information

This section gives the security information for GPIBee488 that the EU Cyber Resilience Act (Regulation (EU) 2024/2847, Annex II) asks a manufacturer to provide with a product: who we are and how to reach us, what the product is meant for, what risks to be aware of, how to set it up and keep it up to date, and how to remove it again.

13.1 Manufacturer and contact

ItemInformation
ManufacturerGossner Electronics & Embedded Systems GmbH, Neukirchen-Vluyn, Germany
TrademarkGPIBEE
Postal address and company detailswww.gpibee.com/impressum.html
E-mailSupport@GPIBee.com
Webwww.GPIBee.com
Security information, updates, advisories and EU declaration of conformitywww.gpibee.com/security.html

13.2 Reporting a vulnerability

If you find a security weakness in GPIBee488, in the interactive control or in a GPIBee adapter, please tell us before you make it public. Our single point of contact for security reports is Support@GPIBee.com. Please start the subject line with SECURITY and include, as far as you can:

We confirm that we received the report, keep you informed while we work on it, and agree a date with you before anything is published. How we handle reports is described in our coordinated vulnerability disclosure policy on www.gpibee.com/security.html. The same page lists published security advisories.

13.3 Product identification

ItemInformation
Product nameGPIBee488, IEEE 488.2 programming library for GPIBee adapters
TypeSoftware for Windows (32-bit and 64-bit): gpib-32.dll, GPIBee-488 interactive control (gpibee488-ic-32.exe, gpibee488-ic-64.exe), header and import libraries (section 3)
Version of this releaseV0.9.10, released 2026-11-29
How to find the version you haveIn Windows Explorer: right-click a DLL or program, Properties → Details, "File version" and "Product version". The file version.txt of the release holds the same. All files of one release carry the same version.

13.4 Intended purpose and security environment

GPIBee488 lets Windows programs control GPIB test and measurement instruments through GPIBee adapters. It is intended for laboratories, development, production test and service, operated by qualified staff, on a local network that only trusted people and devices can reach.

What the library does and does not do on a PC:

The network protocol between PC and GPIBee is VXI-11, the standard protocol for LAN-connected instruments. Like every VXI-11 instrument, the GPIBee accepts commands from anyone who can reach it on the network; the protocol has neither passwords nor encryption. The security of an installation therefore depends on the network the GPIBee is connected to, as for any other LAN instrument.

13.5 Known risks

These are situations, in normal use or in foreseeable misuse, that can lead to a security risk, together with what to do about them.

SituationRiskWhat to do
GPIBee on a network that untrusted people or devices can reach, or reachable from the internetOthers can send commands to your instruments, read measurement data, or change it on the way.Keep GPIBees on an isolated lab network or VLAN, or connect them over USB. Never forward their ports to the internet. Reach remote labs through a VPN.
Automatic search on a network shared with othersA device that pretends to be a GPIBee could be picked as GPIB0, and the numbering can change.Assign your GPIBees by address (section 5.2). The search is then not used at all.
DLLs placed in a folder that other users can write toAnother user could replace gpib-32.dll with a manipulated copy, which then runs with the rights of everyone who starts the program.Install programs and DLLs in folders that only administrators can change, such as C:\Program Files or the system folders. Do not run measurement programs from shared or download folders.
DLLs from an unknown sourceA file with the same name could be manipulated.Get GPIBee488 only from www.gpibee.com/security.html or your distributor. Check the file properties: company "Gossner Electronics & Embedded Systems GmbH" and the version you expect.
Trace log left switched onThe log records every call with addresses, host names, file names and the program path. Other users of the PC may be able to read it.Switch tracing on only for troubleshooting, delete the log afterwards, and remove the variable GPIBEE_TRACE.
Machine-wide adapter assignmentAn entry under HKEY_LOCAL_MACHINE applies to all users; a user's own entry under HKEY_CURRENT_USER takes precedence over it.For fixed setups, check the assignment of each user, or remove per-user entries so that the machine-wide one applies.
Commands that act on real equipmentWrong or unauthorised commands can switch outputs on, change ranges or damage connected equipment.Limit who can run measurement programs, and protect safety-relevant setups with hardware interlocks. GPIBee488 is not intended for safety functions.
Outdated versionKnown weaknesses stay open.Watch the security page and install updates (13.7).

13.6 Secure installation and use

  1. Download the release from a trusted source and check the file properties (13.5).
  2. Install the DLLs into the program's folder or the system folders, and make sure only administrators can change those folders (section 4).
  3. Connect GPIBees to a separate, trusted lab network, or over USB. Protect the GPIBee web interface with a password (see the GPIBee manual).
  4. Assign your adapters by address (section 5.2) instead of relying on the automatic search.
  5. Leave tracing switched off in normal operation.
  6. Keep GPIBee488 and the GPIBee firmware up to date.

Changes to the product can weaken its security. Edited files, files mixed from different releases, registry entries pointing to unknown hosts, and the variables GPIBEE488_DISCOVER and GPIBEE_TRACE all change where data goes or what is recorded. Use only unchanged files of one release, and only the settings described in this manual. Copying gpib-32.dll under another file name as described in section 4.4 does not change the file and is fine.

13.7 Security updates

GPIBee488 does not update itself, and it never downloads anything. There is therefore no automatic update setting to switch off. You decide when to install an update.

The GPIBee adapter has its own firmware with its own updates; see the GPIBee manual and www.gpibee.com/firmware.html.

13.8 Support period

Each release of GPIBee488 receives security updates for 5 years after its release. Security problems found in that time are fixed in a new release, free of charge.

This releaseV0.9.10, released 2026-11-29
Security support until2031-11-29

A security fix may come as a newer release that replaces this one; installing it keeps you within the support period.

13.9 Secure removal

To remove GPIBee488 and all data it has stored from a PC:

  1. Close all programs that use it.
  2. Delete gpib-32.dll, and any copies of it under other names (section 4.4), from the program folders where you put them. If you installed it system-wide, delete it from %WINDIR%\System32 and %WINDIR%\SysWOW64 and put back any files you saved before (section 4.3).
  3. Delete the interactive control programs and the rest of the release folder.
  4. Delete the adapter assignment:
    reg delete HKCU\Software\GPIBee\gpibee488 /f
    reg delete HKLM\SOFTWARE\GPIBee\gpibee488 /f /reg:64     only if set machine-wide; needs administrator rights
  5. Delete trace logs, if tracing was ever used: %TEMP%\gpibee_trace.log and any file named in GPIBEE_TRACE. Remove the environment variables GPIBEE_TRACE and GPIBEE488_DISCOVER if you set them.

GPIBee488 stores nothing else. Measurement data your own programs save is not affected. To pass on or dispose of a GPIBee adapter, reset it to factory settings as described in the GPIBee manual; this also removes its network settings and web interface password.

13.10 Building GPIBee488 into your own product

If you ship GPIBee488 as part of your own software or system:

13.11 Software components

ComponentUse
GPIBee488 (Gossner Electronics & Embedded Systems GmbH)All functions of the library and of the interactive control. Developed in-house.
MinGW-w64 runtime and GCC runtime libraryCompiler start-up and runtime code, built into the files at compile time.
Windows system librariesPart of Windows and used from there; not shipped with GPIBee488.

GPIBee488 contains no other third-party libraries.

13.12 EU declaration of conformity

The EU declaration of conformity is available at www.gpibee.com/security.html.

14. License terms

GPIBee488 is provided free of charge to users of GPIBee adapters. The following terms apply. By installing, copying or using the software you accept them. If you do not accept them, do not install or use the software.

14.1 Scope

These terms cover the GPIBee488 software in all versions, consisting of the library gpib-32.dll, the GPIBee-488 interactive control, the header file, the import libraries and this manual (together "the Software"). The licensor is Gossner Electronics & Embedded Systems GmbH, Neukirchen-Vluyn, Germany ("we", "us").

14.2 What you may do

  1. Use. We grant you, free of charge, a non-exclusive, worldwide right, unlimited in time, to install and use the Software on any number of computers, for private and commercial purposes, to control instruments through GPIBee adapters.
  2. Copy and pass on. You may copy the Software and pass it on to others free of charge, on its own or as part of your own software or systems, provided that the files remain unchanged and complete (giving copies of gpib-32.dll another file name as described in section 4.4 is allowed), that copyright notices are not removed, and that these terms go with it. Whoever receives the Software from you uses it under these terms.
  3. Develop your own programs. You may use the header file and import libraries to develop your own programs that use the Software. Your programs belong to you, and you may license them on any terms you choose.
  4. Example code. The programming examples printed in this manual may be copied, changed and used in your own programs without restriction.

14.3 What you may not do

  1. Sell the Software, or charge a separate fee for it. Charging for your own product or service that includes the Software is allowed.
  2. Change, decompile, disassemble or otherwise reverse engineer the Software, except where the law expressly permits this, for example to achieve interoperability under §§ 69d and 69e of the German Copyright Act (UrhG).
  3. Remove or alter copyright notices, version information or these terms.
  4. Use our names or trademarks, including GPIBee, for your own products, other than to state truthfully that your product works with GPIBee adapters.

14.4 Ownership

The Software is licensed, not sold. All copyrights and other rights in the Software remain with us, except for the third-party components listed in 14.10, whose rights remain with their authors.

14.5 No warranty

The Software is given away free of charge and provided "as is". We do not warrant that it is free of errors, that it works without interruption, or that it is suitable for a particular purpose or works with a particular instrument or program. Statutory claims for defects exist only where we have fraudulently concealed a defect (§ 524 of the German Civil Code, BGB). Our commitment to provide security updates during the support period (section 13.8) is not affected.

14.6 Limitation of liability

  1. We are liable without limitation for damage caused intentionally or through gross negligence, for injury to life, body or health, under the German Product Liability Act (ProdHaftG), and wherever liability cannot be excluded by law.
  2. In all other cases our liability is excluded, whatever the legal grounds. This applies in particular to lost data, lost production, lost profit, damage to instruments or other equipment, and indirect or consequential damage.
  3. These limitations also apply to the personal liability of our managing director, employees and agents.

14.7 Your responsibility

You are responsible for choosing the Software for your purpose, for testing it in your setup before relying on it, for keeping backups of your data, and for the commands your programs send to instruments. The Software is not designed or approved for use in safety functions, in medical devices, in aviation or in other applications where a failure could endanger people or cause serious damage.

14.8 Export control

You must comply with the export control and sanctions laws that apply to you when you use or pass on the Software.

14.9 End of the license

Your rights under these terms end automatically if you breach them. You must then stop using the Software and delete all copies. Sections 14.4 to 14.12 continue to apply.

14.10 Third-party components

The Software contains small parts of the MinGW-w64 runtime and of the GCC runtime library, built into the files by the compiler. These parts are distributed under their own licenses: the MinGW-w64 runtime mainly as public domain and under the Zope Public License 2.1 and similar permissive licenses, the GCC runtime library under the GNU General Public License version 3 with the GCC Runtime Library Exception. These terms do not restrict any rights you have under those licenses. The license texts are available from Support@GPIBee.com and on www.gpibee.com/security.html.

14.11 Law and place of jurisdiction

These terms are governed by the law of the Federal Republic of Germany, excluding the UN Convention on Contracts for the International Sale of Goods (CISG). If you are a merchant, a legal entity under public law or a special fund under public law, the place of jurisdiction for all disputes is our registered office. If you are a consumer, the mandatory consumer protection rules of the country where you live remain unaffected.

14.12 Other provisions

If a provision of these terms is invalid or unenforceable, the remaining provisions stay in force. The invalid provision is replaced by the valid provision that comes closest to its purpose. We may publish new versions of these terms with new versions of the Software; the terms supplied with a version apply to that version.

15. Legal and contact

GPIBee488 is provided under the license terms in section 14. It is an independent implementation of the IEEE 488.2 programming interface. It contains no third-party GPIB driver code. All trademarks are the property of their respective owners.

The information in this manual is provided "as is", without warranty of any kind. Specifications and behavior may change with new versions. The library is not designed or certified for safety-critical applications.

ContactInformation
ManufacturerGossner Electronics & Embedded Systems GmbH
Webwww.GPIBee.com
SupportSupport@GPIBee.com. A trace log (section 11.1) helps us a lot when something does not work.
SecurityVulnerability reports, updates and the EU declaration of conformity: see section 13.
Company detailswww.gpibee.com/impressum.html
This manualGPIBee488 V0.9.10, built 2026-11-29