Hi,
After reading quite a few posts relaying feedback on the PSU, I decided to kill my jealousy before it killed me and got myself a new 10 years old 6632B. I've been extremely happy with up to the point when I decided to try to connect to it via RS232...
I am using USB-serial bridge, and tried both pyvisa (which claims to support RS232) and pyserial equally unsuccessful.
Here is the code that I am using.
PySerial:
#!/usr/bin/python
import serial
psu=serial.Serial("/dev/tty.usbserial", 9600, timeout=1)
psu.write("*IDN?\r\n")
while 1:
a=psu.read()
print "%d\n" % ord(a)
And PyVisa:
#!/usr/bin/python
import visa
lib = visa.VisaLibrary("/Library/Frameworks/visa.framework/visa")
rm=visa.ResourceManager();
print rm.list_resources()
psu=visa.instrument("ASRL1::INSTR")
psu.write("*IDN?\r\n")
print(psu.read())
I tried different combinations of the line terminator, which did not seem to make any difference.
PySerial version output looks something like this:
0
252
254
252
0
252
254
252
0
PyVisa version just times out.
When either of the versions is running, PSU switches display, which implies they are trying to talk to each other.
All in all it looks like the settings for the serial connection are wrong, but I am out of ideas how to fix it.
The settings on the PSU are as follows:
ADDRESS 5
REMOTE FP ENAB
LANG SCPI
FLOW NONE
PARITY NONE
BAUDRATE 9600
INTF HPIB (this one is interesting: when I switch it to RS232, it changes display message to "RS232 is in use", but does not keep the settings)
At this point I am trying to do "hello world" type of application -- I am pretty sure I can take it from there.
Any hints would be much appreciated ...