LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

agilent 34401A using usb-serial adapter

I am trying to measure voltage using the Agilent 34401A multimeter and acquire the readings using LabView 2009.  I already have another device using the physical COM port on the laptop and am trying to connect the Agilent 34401A via a serial-USB adapter. 

 

I've installed the drivers that the adapter came with as well as the LabView/Agilent drivers and made sure that the settings for the Agilent 34401A matches with the laptop (Baud rate, parity, etc.).  Data aquisition works when the Agilent is hooked up to the physical COM port--it just doesn't work with the USB-serial adapter.  I get an initialization error.

 

Any ideas?

0 Kudos
Message 1 of 12
(12,532 Views)

You are about the third or fourth person today that says an error is generated but then does not provide the error code and message. This is essential information.

0 Kudos
Message 2 of 12
(12,523 Views)

Sorry about that--first time posting on here. 

 

Error 1073807339 occurred at VISA Read in Agilent 34401.lvlib:Control Mode.vi -> Agilent 34401.lvlib:Initialize.vi->Agilent 34401 Read Single Measurement.vi

I've attached the error dialog box as well as the block diagram.

 

Using a Gigaware USB-A to serial cable from RadioShack.

Download All
0 Kudos
Message 3 of 12
(12,493 Views)

Do you have a separate cable connected between the adapter and the instrument? If so, check it it is the correct type (null-modem or straight-through). If you are using a separate cable and used that when you connected to the built-in port, it's probably okay, though.

 

I always first check communication with a separate terminal emulation program such as Hyperterminal. You could try that with a simple command such as *IDN?.

0 Kudos
Message 4 of 12
(12,466 Views)

I also had same problem with my usb-serial cable. It just does not work with 34401a driver in labview, it works with agilent IVI driver.

 

Why?

0 Kudos
Message 5 of 12
(11,708 Views)

Hi tatuo,

 

Since this forum has been inactive for quite some time, it is best to start a new discussion.  This will ensure that you will receive the best answer as soon as possible.

 

As for your question, usb to serial cables/converters usually have a limited set of functionality that a built in port has.  The NI-VISA driver is most likely making some sort of call that the converter doesn't support.

 

You could try using a port monitoring utility to see what may be causing the problem.

 

Justin D.

Justin D.

Applications Engineer
National Instruments
0 Kudos
Message 6 of 12
(11,666 Views)

I have almost same problems on Agilent 34401A. I use "USB to Serial RS-232 Adapter" connecting instrument and PC, and found ATEN USB to serial bridge (COM9) from my PC. So I selected VISA resource name is COM9. Please look at the picture.

Any ideas? THANKS>

0 Kudos
Message 7 of 12
(10,460 Views)

Hi Hello321,

 

It looks like you may not be communicating with your Agilent device as your VISA read VI is timing out.  There is also the possiblity you're reading too much information for the specific timeout.  You can check to make sure you're communicating with your device through the VISA test panel in MAX.  Go to MAX > Select the correct com port > Select "Open VISA Test Panel" > Follow the instructions from the link.

 

Please reference your user guide to determine what to write to your device.

 

http://digital.ni.com/public.nsf/allkb/19B075803E013125862575CF006B37F8?OpenDocument  

 

Thanks,

Bobby Breyer
Applications Engineer
National Instruments
0 Kudos
Message 8 of 12
(10,430 Views)

Hi Bobby,

 

Thanks for your help!

I checked MAX, looks serial USB to be shown at COM 9, please look at the picture.

However, I still have reading issue. VISA test Panel shows the error too when typing IDN command.

 

Additionally, if following the link to type Hex commands \2A\49\44\4E\3F\0D, Can't enter all as it is too long.

Download All
0 Kudos
Message 9 of 12
(10,402 Views)

Hi Hello321,

 

It looks like your IDN command worked, but it seems there's no termination character or something else is happening.  

 

So after reviewing the HP 34401A manual it looks like your initial settings may be off.  In the manual ( http://projectlab.engphys.ubc.ca/wp-content/uploads/HP34401A-UsersGuide.pdf#page=147 ) it looks like the parity should be set to none, and you also need to manipulate the number of start and stop bits.  Give that a try in your original program and let me know how it goes.

Bobby Breyer
Applications Engineer
National Instruments
0 Kudos
Message 10 of 12
(10,368 Views)