GPIB Tools
These 7 tools provide IEEE-488 protocol-level operations — device clearing, status polling, service request handling, triggering, interface control, and local/remote mode management.
Instruments are addressed by VISA resource string ("GPIB0::22::INSTR") or by a configured alias ("dmm"). Backend-level operations (check_srq, interface_clear) take a backend name instead.
instrument_clear
Section titled “instrument_clear”Send Selected Device Clear (SDC) to a specific instrument. Clears the instrument’s input buffer and resets its parser to a known state without changing configuration settings.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Yes | VISA resource string or configured alias |
Example
# Clear by aliasresult = await client.call_tool("instrument_clear", { "instrument": "dmm"})
# Clear by VISA resource stringresult = await client.call_tool("instrument_clear", { "instrument": "GPIB0::22::INSTR"})Returns
Sent Selected Device Clear to dmm (GPIB0::22::INSTR)serial_poll
Section titled “serial_poll”Serial poll an instrument. Returns the 8-bit status byte. Bit 6 (0x40) indicates the device is requesting service (RQS/SRQ).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Yes | VISA resource string or configured alias |
Example
result = await client.call_tool("serial_poll", { "instrument": "dmm"})Returns
Serial poll dmm (GPIB0::22::INSTR): status=0x40 (64) [SRQ]Status byte bit assignments (IEEE 488.2):
| Bit | Mask | Meaning |
|---|---|---|
| 6 | 0x40 | RQS — device is requesting service |
| 5 | 0x20 | ESB — event status bit (check *ESR?) |
| 4 | 0x10 | MAV — message available in output queue |
| 0—3, 7 | varies | Instrument-specific |
check_srq
Section titled “check_srq”Check if the SRQ (Service Request) line is asserted on the bus. If SRQ is asserted, the tool automatically identifies which device is requesting service.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
backend | string | Yes | Name of the backend to check |
Example
result = await client.call_tool("check_srq", { "backend": "bench-a"})Returns
When a device is requesting service:
SRQ ASSERTED on bench-a — GPIB0::22::INSTR requesting service (status=0x50)When no device is requesting service:
SRQ not asserted on bench-abus_trigger
Section titled “bus_trigger”Send Group Execute Trigger (GET) to an instrument. Triggers cause instruments to initiate a pre-configured action, typically a measurement.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Yes | VISA resource string or configured alias |
Example
result = await client.call_tool("bus_trigger", { "instrument": "dmm"})Returns
Triggered dmm (GPIB0::22::INSTR)interface_clear
Section titled “interface_clear”Assert Interface Clear (IFC) for 150 microseconds. This resets all bus interfaces to their idle state and establishes the adapter as Controller-In-Charge (CIC).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
backend | string | Yes | Name of the backend |
Example
result = await client.call_tool("interface_clear", { "backend": "bench-a"})Returns
IFC asserted on bench-a — this adapter is now Controller-In-Chargeinstrument_local
Section titled “instrument_local”Return an instrument to local (front panel) control. Sends the IEEE-488 Go To Local (GTL) message.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Yes | VISA resource string or configured alias |
Example
# Return a single instrument to local controlresult = await client.call_tool("instrument_local", { "instrument": "dmm"})Returns
Instrument dmm (GPIB0::22::INSTR) returned to local controlinstrument_remote
Section titled “instrument_remote”Put an instrument in remote mode by asserting REN (Remote Enable). The front panel may be partially or fully disabled depending on the instrument.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Yes | VISA resource string or configured alias |
Example
result = await client.call_tool("instrument_remote", { "instrument": "dmm"})Returns
Instrument dmm (GPIB0::22::INSTR) set to remote