VisaDevice

class tam.VisaDevice(visa_rm, visa_id)[source]

Create an instance of VisaDevice.

Parameters:
  • visa_rm – A reference to a Visa resource manager. As returned (for example) by a call to pyvisa.ResourceManager().

  • visa_id (str) – The ID of the instrument to connect with.

close()[source]

Close the connection to the selected instrument.

initialize()[source]

Open a connection to the selected instrument.

This will also initialize query delay and timeout values for the instrument. Default values for these are VisaDevice.DEFAULT_QUERY_DELAY and VisaDevice.DEFAULT_TIMEOUT. See also the properties query_delay and timeout.

query(cmd)[source]

Send a query command to the instrument.

Parameters:

cmd (str) – The command to send.

Returns:

The instrument response as a string.

property query_delay

Get or set the query delay. This is the delay in seconds between write and read operations.

query_float(cmd)[source]

Send a query command to the instrument.

Parameters:

cmd (str) – The command to send.

Returns:

The instrument response as a float.

query_int(cmd)[source]

Send a query command to the instrument.

Parameters:

cmd (str) – The command to send.

Returns:

The instrument response as an integer.

property timeout

Get or set the timeout. This is the timeout (in millisecs) for all instrument I/O operations.

write(cmd)[source]

Send a command to the instrument.

Parameters:

cmd (str) – The command to send.