-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Arguments: (comport, readTimeout, serialBaud, serialTimeout)
Used to initialize library.
- 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
Reads data and returns the data as string
data = inst.read()
>"HEWLETT-PACKARD,34401A,...."
writes data to GPIB
- 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 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,...."