Skip to content

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.


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

NameTypeRequiredDescription
bridge_namestringYesName of the bridge to scan
identifybooleanNoSend *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 found

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

NameTypeRequiredDescription
bridge_namestringYesName of the bridge
addressintegerNoGPIB address to poll (0—30). If omitted, polls all known listeners

Example

# Poll a single instrument
result = await client.call_tool("serial_poll", {
"bridge_name": "bench-a",
"address": 22
})
# Poll all known listeners
result = 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):

BitMaskMeaning
60x40RQS — device is requesting service
50x20ESB — event status bit (check *ESR?)
40x10MAV — message available in output queue
0—3, 7variesInstrument-specific

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

NameTypeRequiredDescription
bridge_namestringYesName 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-a

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

NameTypeRequiredDescription
bridge_namestringYesName of the bridge
addressintegerNoGPIB address (0—30) for selective clear. Omit for universal clear

Example

# Clear a specific instrument
result = await client.call_tool("bus_clear", {
"bridge_name": "bench-a",
"address": 22
})
# Clear all instruments
result = await client.call_tool("bus_clear", {
"bridge_name": "bench-a"
})

Returns

Sent Selected Device Clear to address 22 on bench-a

or

Sent Universal Device Clear on bench-a

Send Group Execute Trigger (GET) to instruments. Triggers cause instruments to initiate a pre-configured action, typically a measurement.

Parameters

NameTypeRequiredDescription
bridge_namestringYesName of the bridge
addressesarray of integersNoGPIB addresses to trigger. If omitted, triggers the currently addressed device

Example

# Trigger specific instruments
result = await client.call_tool("bus_trigger", {
"bridge_name": "bench-a",
"addresses": [5, 22]
})
# Trigger the currently addressed device
result = await client.call_tool("bus_trigger", {
"bridge_name": "bench-a"
})

Returns

Triggered addresses [5, 22] on bench-a

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

NameTypeRequiredDescription
bridge_namestringYesName 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