Skip to content

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.


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

NameTypeRequiredDescription
instrumentstringYesVISA resource string or configured alias

Example

# Clear by alias
result = await client.call_tool("instrument_clear", {
"instrument": "dmm"
})
# Clear by VISA resource string
result = await client.call_tool("instrument_clear", {
"instrument": "GPIB0::22::INSTR"
})

Returns

Sent Selected Device Clear to dmm (GPIB0::22::INSTR)

Serial poll an instrument. Returns the 8-bit status byte. Bit 6 (0x40) indicates the device is requesting service (RQS/SRQ).

Parameters

NameTypeRequiredDescription
instrumentstringYesVISA 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):

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 identifies which device is requesting service.

Parameters

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

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

Parameters

NameTypeRequiredDescription
instrumentstringYesVISA resource string or configured alias

Example

result = await client.call_tool("bus_trigger", {
"instrument": "dmm"
})

Returns

Triggered dmm (GPIB0::22::INSTR)

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

NameTypeRequiredDescription
backendstringYesName 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-Charge

Return an instrument to local (front panel) control. Sends the IEEE-488 Go To Local (GTL) message.

Parameters

NameTypeRequiredDescription
instrumentstringYesVISA resource string or configured alias

Example

# Return a single instrument to local control
result = await client.call_tool("instrument_local", {
"instrument": "dmm"
})

Returns

Instrument dmm (GPIB0::22::INSTR) returned to local control

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

NameTypeRequiredDescription
instrumentstringYesVISA resource string or configured alias

Example

result = await client.call_tool("instrument_remote", {
"instrument": "dmm"
})

Returns

Instrument dmm (GPIB0::22::INSTR) set to remote