VISA (Rust)¶
Hardware I/O goes through the visa feature (on by default) and the instrument-visa crate, which wraps visa-rs.
Install¶
- Install NI-VISA or Keysight IO Libraries.
- Depend on the facade crate:
Linking¶
| Variable | Purpose |
|---|---|
LIB_VISA_PATH |
Directory containing visa64.lib / visa.lib |
LIB_VISA_NAME |
Library name (visa64, visa32, visa) |
CI runners typically use default-features = false so they never link a native VISA library.
Discovery entry point¶
Async: AsyncDiscovery::visa()?.scan().await? with the tokio feature. Session open is still sync; subsequent read/write are async.
Feature flags¶
| Feature | Default | Description |
|---|---|---|
visa |
yes | VISA backend via instrument-visa |
tokio |
no | Async API over visa-rs tokio adapter |
cross-compile |
no | Cross-compile enum repr for visa-rs |
record |
no | Record real I/O into mock scripts |
# Cross-compile example
instrument-components = { version = "0.1", features = ["visa", "cross-compile"] }
You still need a target VISA import library at link time (LIB_VISA_PATH).
Mock without VISA¶
Use ScriptedFixture / DeviceCatalog::from_fixture — see getting started.