Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS 232 to control E3633A PS Error: 511

Solved!
Go to solution

Goal: to write a short python script to create a PD control loop for temperature. 

PS: Aligent E3633A

Software: pyserial (python) or 232Analyzer (both producing identical errors)

System: win7 64bit

Serial adapter: USB to serial: Belkin N10117, Driver used: 

 

COM port: 9 (also tried 10, different USB port of course)

Baudrate: 2400 (also tried 9600)

Data bits: 7 (also tried 😎

Parity: Even (also tried none and odd) 

Stop bit: 1 (also tried 2 and 1.5)

 

Please forgive me, I'm a serial noob. 

When I write in ASCII: SYST:BEEP (using pyserial in cmd prompt or 232Analyzer), the power supply with report an error -511. I looked through the user manual of the PS and the error is a "Framing error." I've double and triple checked my connections and settings (COM, Baudrate, parity, data bits) on the computer and the PS. I've also tried changing the data bits to 8 and the results were far worse. With the data bits set to 8 with no parity, the PS would most of the time be non-responsive to the commands sent. I've tried many different commands to the PS, but every command I send gives me the 511 error. I haven't been able to root cause this, but it seems to be a very simple thing to control this power supply using RS232. :S

Note: GPIB is not an option for me because of the cost.  

 

Thank you for any help you can provide. I can provide more detail about pyserial/232Analyzer if requested. =D

 

--Andy

0 Kudos
Message 1 of 4
(6,715 Views)

Don't use the try and error method. Check/Setup the E3633A serial settings and then use the matching settings on the PC. If you don't know how to setup the E3633A get and read the E3633A manual. If don't have a printed version available, download it as PDF from Agilents site.

To verify that the stuff, you are sending, is OK attach a null-modem cable on the sending port, attach  the other side to another serial port and setup a serial terminal program ( like hyperterm or teraterm ) to use that port. BTW. A common error of a beginner is to forget the termination character at the end of the command.

Message 2 of 4
(6,707 Views)

 

First of all, thank you for your reply. I've been taking your advice and have connected another computer using tera term with the exact settings as setup with 232Analyzer. I didn't clarify on my original post, I matched the settings from the PC and the PS first, then after I couldn't get it working I tried different settings. 

I've made some progress, but not much. Using Tera term I am able to see the exact commands sent through 232Analyzer or Pyserial and they are correct. I've read a fair bit of the manual trying to get this working. There is a section about termination character, I've copied the excerpt below. It mentions to include a <new line> as the termination character and I did so. The progress I made is that I can send a 'new line' and a 'return to beginning' to the power supply without it complaining. This is achieved with the "/n" and "/r" written using Pyserial. When I write something like "SYST:REM/n" to the power supply it still complains with framing error and sometimes an undefined header. 

 

However, even with the /n added to the command I am unable rid myself of the -511 framing error. 

 

Any insights?  

 

From User Manual:  

 

-113 Undefined header
A command was received that is not valid for this power supply. You may have
misspelled the command or it may not be a valid command. If you are using
the short form of the command, remember that it may contain up to four letters.
Example: TRIGG:DEL 3

 

-511 RS-232 framing error 

 

SCPI Command Terminators
A command string sent to the power supply must terminate with a <new line>
character. The IEEE-488 EOI (end-or-identify) message is interpreted as a
<new line> character and can be used to terminate a command string in place
of a <new line> character. A <carriage return> followed by a <new line> is
also accepted. Command string termination will always reset the current SCPI
command path to the root level. The <new line> character has the ASCII
decimal code of 10.

 

 

 

0 Kudos
Message 3 of 4
(6,692 Views)
Solution
Accepted by topic author OneChance

Problem solved! 

Settings that solved it:

HAVE TO USE: 8 bits no parity, any baudrate and the termination character \n

Had too many problems entering the termination character of <new line> into the 232Analyzer. Used Pyserial instead. 

 

I don't understand why 7 bits + parity doesn't work, but that is not of too much revalence since it works with 8 bits. 

thank you markus kossmann for your advice. It helped a lot. 

0 Kudos
Message 4 of 4
(6,680 Views)