LinuxGPIB.Net
0.1.0
dotnet add package LinuxGPIB.Net --version 0.1.0
NuGet\Install-Package LinuxGPIB.Net -Version 0.1.0
<PackageReference Include="LinuxGPIB.Net" Version="0.1.0" />
<PackageVersion Include="LinuxGPIB.Net" Version="0.1.0" />
<PackageReference Include="LinuxGPIB.Net" />
paket add LinuxGPIB.Net --version 0.1.0
#r "nuget: LinuxGPIB.Net, 0.1.0"
#:package LinuxGPIB.Net@0.1.0
#addin nuget:?package=LinuxGPIB.Net&version=0.1.0
#tool nuget:?package=LinuxGPIB.Net&version=0.1.0
LinuxGPIB.Net
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:
- HP 54600B oscilloscope
- Raspberry Pi 3 Model B
- gpib4pi (https://github.com/lightside-instruments/gpib4pi)
- linux-gpib 4.3.7
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 | Versions 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. |
-
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 |