Skip to content
Decee1 edited this page Aug 31, 2021 · 1 revision

Functions

Class open_resource

Arguments: (comport, readTimeout, serialBaud, serialTimeout)
Used to initialize library.

Arguments:

  • comport
  • readTimeout (default 1000)
  • serialBaud (default 115200)
  • serialTimeout (default 1)


comport is the serial/comport on your computer that addresses to the Prologix GPIB
readTimeout is the timeout for the Prologix GPIB when it reads from another GPIB instrument, default 1 second or 1000ms
serialBaud is the baudrate of the Prologix
serialTimeout is the timeout of the Python serial library, it is default 1 but can be reduced. Should be higher than readTimeout

read()

Reads data and returns the data as string
data = inst.read()
>"HEWLETT-PACKARD,34401A,...."

write()

writes data to GPIB

Arguments:

  • dataToSend


dataToSend is a string which is the data needed to be transferred to the GPIB device Example:
inst.write("*IDN?")
data = inst.read()
>"HEWLETT-PACKARD,34401A,...."

query(dataToSend)

Query simply first write dataToSend to GPIB instrument and after that reads the data returned. If no data is recieved within serialBaud it returns as much data as it got to read before terminated by timeout
data = inst.query("*IDN?")
>"HEWLETT-PACKARD,34401A,...."

Clone this wiki locally