LinuxGPIB.Net 0.1.0

dotnet add package LinuxGPIB.Net --version 0.1.0
                    
NuGet\Install-Package LinuxGPIB.Net -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LinuxGPIB.Net" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinuxGPIB.Net" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LinuxGPIB.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LinuxGPIB.Net --version 0.1.0
                    
#r "nuget: LinuxGPIB.Net, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LinuxGPIB.Net@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LinuxGPIB.Net&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LinuxGPIB.Net&version=0.1.0
                    
Install as a Cake Tool

LinuxGPIB.Net

NuGet Version Target Framework Platform License: GPL v3

LinuxGPIB.Net is a modern .NET 8+ wrapper for the linux-gpib 4.3.7 C library, providing safe, high-level abstractions for communicating with GPIB instruments on Linux.

  • High-level API (no P/Invoke required)
  • Thread-safe device coordination via GpibDeviceManager
  • Synchronous and asynchronous operations
  • Tested with linux-gpib 4.3.7
  • Licensed under GPLv3 or later

Installation

1. Install the NuGet package

dotnet add package LinuxGPIB.Net

2. Install linux-gpib (version 4.3.7)

LinuxGPIB.Net requires the native linux-gpib library to be installed on the system.

A installation guide for linux-gpib 4.3.4 can be found here: http://elektronomikon.org/install.html

The guide is still applicable for linux-gpib 4.3.7. Replace the version-specific steps with the sequence below:

wget https://github.com/coolshou/linux-gpib/archive/refs/tags/4.3.7.tar.gz
tar -xzf 4.3.7.tar.gz

cd linux-gpib-4.3.7/linux-gpib-user/
./configure
make
make install
ldconfig

cd ../linux-gpib-kernel/
make
make install

Depending on your GPIB hardware, you may need to load the appropriate kernel module (e.g., ni_gpib, gpib_bitbang, etc.).


Quick Start

Basic usage through the high-level GpibDevice class:

using LinuxGPIB.Net;

var dev = new GpibDevice(primaryAddress: 5);

dev.Write("*IDN?");
string idn = dev.Read();

Console.WriteLine(idn);

Query helper

string idn = dev.Query("*IDN?");

Configuration Example

var dev = new GpibDevice(
    primaryAddress: 5,
    timeout: GpibTimeout.T3s,
    boardIndex: 0,
    eot: 1,
    eos: 0);

Asynchronous Polling

await dev.QueryAsync("*IDN?");              // Wait for MAV
await dev.WaitForMessageAsync();           // Wait for MAV
await dev.WaitForServiceRequestAsync();    // Wait for SRQ

Thread-Safe Device Access

Use GpibDeviceManager to serialize calls per instrument and automatically dispose idle devices.

using LinuxGPIB.Net;
using LinuxGPIB.Net.Management;

var manager = new GpibDeviceManager();
var address = new GpibAddress(5);

string idn = await manager.ExecuteAsync(address, async dev =>
{
    dev.Write("*IDN?");
    return dev.Read();
});

Device Discovery

var bus = new GpibBus();
var devices = bus.DiscoverDevices();

Features

  • High-level wrapper around linux-gpib
  • Automatic cleanup of idle devices
  • Read, write, and query support
  • Serial polling (MAV and SRQ)
  • Asynchronous wait operations
  • Device discovery utilities

Requirements

  • Linux platform
  • linux-gpib 4.3.7
  • .NET 8.0+

Tested hardware

This library has been tested on real hardware with:

Other GPIB instruments should work, but have not been explicitly tested.


License

LinuxGPIB.Net is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See the LICENSE file for details.


Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 201 12/6/2025