Bus Operations Tools
Bus operations work at the IEEE-488 protocol level — discovering devices, reading status, and issuing bus-level commands. These tools address the bus as a whole rather than individual instruments.
bus_scan
Section titled “bus_scan”Scan the GPIB bus for listening instruments. Sends ++findlstn to discover all devices, then optionally sends *IDN? to each discovered address to identify the instrument.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge to scan |
identify | boolean | No | Send *IDN? to each listener (default: true) |
Example
result = await client.call_tool("bus_scan", { "bridge_name": "bench-a", "identify": True})Returns
Bus scan on bench-a: 3 listener(s) Address 5: Agilent Technologies E3631A (S/N: MY12345678) Address 7: Tektronix TDS2024B (S/N: C031234) Address 22: KEITHLEY INSTRUMENTS INC. MODEL 2000 (S/N: 1234567)When identify is false, addresses are listed without identification:
Bus scan on bench-a: 3 listener(s) Address 5: listener found Address 7: listener found Address 22: listener foundserial_poll
Section titled “serial_poll”Serial poll one or all instruments on the bus. Returns the status byte for each polled instrument. Bit 6 (0x40) indicates the device is requesting service (RQS/SRQ).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge |
address | integer | No | GPIB address to poll (0—30). If omitted, polls all known listeners |
Example
# Poll a single instrumentresult = await client.call_tool("serial_poll", { "bridge_name": "bench-a", "address": 22})
# Poll all known listenersresult = await client.call_tool("serial_poll", { "bridge_name": "bench-a"})Returns
Serial poll on bench-a: Address 22: status=0x40 (64) [SRQ] Address 5: status=0x00 (0)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 calls ++findrqs to identify which device is requesting service.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge to check |
Example
result = await client.call_tool("check_srq", { "bridge_name": "bench-a"})Returns
When a device is requesting service:
SRQ ASSERTED on bench-a — device at address 22 requesting service (status=0x50)When no device is requesting service:
SRQ not asserted on bench-abus_clear
Section titled “bus_clear”Send a device clear command. With an address, sends Selected Device Clear (SDC) to that specific instrument. Without an address, sends Universal Device Clear (DCL) to all devices on the bus.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge |
address | integer | No | GPIB address (0—30) for selective clear. Omit for universal clear |
Example
# Clear a specific instrumentresult = await client.call_tool("bus_clear", { "bridge_name": "bench-a", "address": 22})
# Clear all instrumentsresult = await client.call_tool("bus_clear", { "bridge_name": "bench-a"})Returns
Sent Selected Device Clear to address 22 on bench-aor
Sent Universal Device Clear on bench-abus_trigger
Section titled “bus_trigger”Send Group Execute Trigger (GET) to instruments. Triggers cause instruments to initiate a pre-configured action, typically a measurement.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge |
addresses | array of integers | No | GPIB addresses to trigger. If omitted, triggers the currently addressed device |
Example
# Trigger specific instrumentsresult = await client.call_tool("bus_trigger", { "bridge_name": "bench-a", "addresses": [5, 22]})
# Trigger the currently addressed deviceresult = await client.call_tool("bus_trigger", { "bridge_name": "bench-a"})Returns
Triggered addresses [5, 22] on bench-ainterface_clear
Section titled “interface_clear”Assert Interface Clear (IFC) for 150 microseconds. This resets all bus interfaces to their idle state and establishes this bridge as Controller-In-Charge (CIC).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge |
Example
result = await client.call_tool("interface_clear", { "bridge_name": "bench-a"})Returns
IFC asserted on bench-a — this bridge is now Controller-In-Charge