Asymmetry between send/receive terminations for Keithley 2410
Regardless of the termination used for Keithley, it always responds with \r
:
[pixdaq@itkpix-daq-05 powercontrol]$ cat run2.py
import serial
ser = serial.Serial("/dev/ttyUSB2")
for term in ['\r', '\n', '\r\n', '\n\r']:
print(repr(term))
ser.write(bytes(f'*IDN?{term}', 'utf-8'))
print(repr(ser.read(80)))
[pixdaq@itkpix-daq-05 powercontrol]$ python run2.py
'\r'
b'KEITHLEY INSTRUMENTS INC.,MODEL 2410,4315929,C34 Sep 21 2016 15:30:00/A02 /J/M\r'
'\n'
b'KEITHLEY INSTRUMENTS INC.,MODEL 2410,4315929,C34 Sep 21 2016 15:30:00/A02 /J/M\r'
'\r\n'
b'KEITHLEY INSTRUMENTS INC.,MODEL 2410,4315929,C34 Sep 21 2016 15:30:00/A02 /J/M\r'
'\n\r'
b'KEITHLEY INSTRUMENTS INC.,MODEL 2410,4315929,C34 Sep 21 2016 15:30:00/A02 /J/M\r'
Right now, TextSerialCom, will always look for the termination that is sent to the Keithley, but that is not necessarily going to match. One can enforce only \r
for this model, or ... allow the receive to be more flexible.