gpib package

gpib.gpib_server module

Provides direct access to USB-enabled hardware.

class gpib.gpib_server.GPIBServer

Bases: HardwareInterfaceServer

Provides direct access to GPIB-enabled hardware.

name = '%LABRADNODE%_gpib'
query(self, c, data)

Make a GPIB query, a write followed by a read.

This query is atomic. No other communication to the device will occur while the query is in progress.

Parameters:
  • c – The LabRAD context

  • data (string) – The string to be written to the USB bus

read(self, c, n_bytes=None)

Read from the GPIB bus.

Parameters:
  • c – The LabRAD context

  • n_bytes (int, optional) – If specified, reads only the given number of bytes.

  • Otherwise

  • None. (reads until the device stops sending. Defaults to) –

Returns:

The bytes returned from the device, with leading and trailing whitespace stripped

Return type:

string

refresh_available_interfaces()

Fill self.interfaces with available connections using Python VISA

timeout(self, c, timeout=None)

Sets the timeout associated with the interface

Parameters:
  • c – The LabRAD context

  • timeout (numeric, optional) – The timeout for the interface in seconds. Defaults to None.

Returns:

The timeout in milliseconds

write(self, c, data)

Write a string to the GPIB bus.

Parameters:
  • c – The LabRAD context

  • data (string) – The string to be written to the GPIB bus