# Retrieving data from Agilent 34401A Digital Multimeter over the RS232 interface

I want to interface Agilent 34401A Digital Multimeter over the RS232 interface. The settings (baud rate, parity, number of start and stop bits) are set to be same on multimeter, pc (device manager) and on the application that I use for terminal. Programming language is SCPI.

I successfully control the multimeter, that is I execute the commands such as: syst:rem; :meas:volt:dc? 10, 0.003; :conf:volt:dc 10, 0.003; :sens:volt:dc:rang 100; but I get no response over RS232 interface from my multimeter.

For example when I execute the command :meas:volt:dc? 10, 0.003; the measurement is performed and the voltage is displayed on multimeter’s display, but the value is not sent over RS232 to my terminal. No response what so ever.

In the manual for the multimeter there is a statement after each command -- “bus enter statement". Relevant extract provided below.

I could not find any reference or explanation what is meant by this. Does a special command exist for retrieving data from the multimeter?

:read? makes no effect on the multimeter.

Useful hint for someone who is also trying to set up RS232 communication with this device: Even if in the manual the colon preceding the SCIP command is not given, the multimeter returns “unknows header” error if it is not present.

• I did this a couple years ago to make a test jig using some Python scripts, I recall the meter was very picky about the port wiring, had me tearing my hair out for a few hours. Modern LXI is better for test equipment automation, IMO. – Spehro Pefhany Oct 19 '17 at 15:21
• As a tip, when you're just trying to verify you have working communication with a test instrument, start out by just sending the "*IDN?" query. Once you can get a good reply to that, then start sending actual measurement commands. – The Photon Oct 19 '17 at 15:52

The problem was in the way I send a command over terminal. After a command the multimeter expects line feed character, in PuTTY this is <ctrl-j>.

The code below successfully gets response with a value of a voltage.

syst:rem;
:meas:volt:dc? 10, 0.003;
<ctrl-j>


I found solution reading through this forum question: https://www.eevblog.com/forum/testgear/34401a-serial-interface-problems/

• PuTTY Configuration -> Terminal -> "Implicit LF in every CR" and "Implicit CR in every LF"? – Chris Knudsen Oct 19 '17 at 18:16

The Agilent devices require a somewhat esoteric form of flow control - DSR/DTR. You'll need to set that up before you can read data.

• Can you please elaborate a bit on this "esoteric form of flow control". What needs to be setup? I have just put and tried on my pc flow control to hardware (there is no DSR/DTR option) and in putty terminal I set to DTR/DSR option. Still no response over RS232 from the multimeter. I will appreciate any reference to where I can find more data. – balboa Oct 19 '17 at 15:59

Take a look at the linked document. See if the fetch? command returns anything similar to what the document shows. Also, check if your cable is wired the same as in the image on the last page. Using HyperTerminal with Agilent General Purpose Instruments

• Fetch? command gives error -230: Data stale - a FETCh? command was received but internal reading memory was empty. I read out the error code on the display, and found description in the manual, still no response over RS232. – balboa Oct 19 '17 at 15:56
• I use null modem cable. All connections are as in the user manual, except the pin 9 (RI - ring indicator). At my cable I have it open, but I suppose this should not cause the issue. – balboa Oct 19 '17 at 16:01

The serial cable pin-out From:

34398A/99A RS-232 Cable Kit/Adapter Kit User's Guide

34398-90001.pdf

I remember wiring some of these up when I was in the same situation...

• What code or program are you using to send/receive data? – Chris Knudsen Oct 19 '17 at 16:02
• I have all connections as in the figure above, except for the connection between the pin 9. I use PuTTY. – balboa Oct 19 '17 at 16:15

I found that to get the MEAS:VOLT:DC? command to work with my 34401A, I first had to put the system into remote mode.

So, in LabVIEW I first sent

SYST:REM\n

then I sent

MEAS:VOLT:DC? 10,0.003\n

over my VISA port. When I read back the buffer I got the voltage as desired as a text string.

Note that the \n is the LabVIEW "Linefeed" string constant, I concatenated that to the end of the main part of the string using the concatenate string block.

This was using a RS-232 to USB converter from plugable.com, with no cross-over (null-terminal) or anything else.

• Also port was set up as 9600 baud, 8 data bits, no parity, 1 stop bit, and no flow control using the property node block. – R White Jul 24 '18 at 19:36
• Finally, sometimes it has an error - usually the first time I run or something. I wrapped the whole thing in a While loop and check the status bit on the error out. If there is an error I just re-run the whole thing (re-open the port, etc etc). – R White Jul 24 '18 at 19:37