GPIB Connection to 2340A - Response garbled #photo-notice


Hi all,
I've been trying to use use GPIB interface on my 2340A and had only limited success so far. I've bought a Prologix GPIB-USB adapter for the task. I can connect to the instrument and send commands that show up on the debug screen - see,,,20,2,0,0 - here just asking for the instrument to identify. The response, however, is not intelligible. The settings I've used on the scope are here:,,,20,2,0,0

And the python code I've used is

import pyvisa
rm = pyvisa.ResourceManager('@py')
inst = rm.open_resource('ASRL/dev/cu.usbserial-PX4QY88I::INSTR')
inst.baud_rate = 9600
inst.read_termination = '\n'
inst.write_termination = '\n'
inst.timeout = 2500
inst.encoding = 'latin-1'

and which returns 'ΓΏ\r'

setting the instrument encoding in python to 'ascii' (the default) instead of 'latin-1' results in an error as byte 0 cannot be decoded. I'm working a Mac and would like to keep working in python and the toolkit is Windows only.

Any help is greatly appreciated.

Join to automatically receive all group messages.