LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resolve the serial communication error in HP34970?

Solved!
Go to solution

I want to use serial port to commnucation between pc and hb34970. In gpib mode, it is ok. But in serial mode, report error. just like this:

 

for setting com2: 

16:11:47.359 2009-8-26 [Init_dq_Device]error:-1073807339--HP34970A Initialize.vi->Init_DQ_Device.vi->main_app.vi VISA read.visa name:ASRL2::INSTR

 

for setting com1:

16:13:25.921 2009-8-26 [Init_dq_Device]error:-1073807339--HP34970A Initialize.vi->Init_DQ_Device.vi->main_app.vi VISA read.visa name:ASRL1::INSTR

 

I don't know the meaning of -1073807339 and whether i should set:ASRL1::INSTR for com1. Anyone can help me about this problem.

 

Thanks very much.

 

attach my subvi.

 

 

0 Kudos
Message 1 of 11
(5,931 Views)

That error code means a timeout error. You can right-click on an error cluster and select the "Explain Error" to tell you what the code means. You should first verify that you can properly talk to the 34970 using a different communication program, such as HyperTerminal if you're on a Windows machine. You can also use MAX to talk to the instrument. This will determine if you have a bad cable, or incorrect serial port settings. The default communication rate is 57600 bps. Try a lower rate.

 

Also, there is no need to do what you're doing to create the VISA resource name. Just use a VISA resource name control, which allows you to select the instrument and interface from a list. 

0 Kudos
Message 2 of 11
(5,926 Views)

hi, smercurio_fc

 

Thank your help. Only my program report this error. Another program can work normally. So I am very anxious. 😞

 

I don't have device now so I try to resolve it from remote site. The error happen in HP34970A Initialize.vi and I use

 

its default setting, but i don't know what lead to error.

 

About "Also, there is no need to do what you're doing to create the VISA resource name. Just use a VISA resource name control, which allows you to select the instrument and interface from a list."

 

I only provide a UI for user to set serial port number. Because i don't know how to scan serial port automatically.

 

thanks.

 

br.

 

0 Kudos
Message 3 of 11
(5,916 Views)

You have way too much code for a simple task. The single control will work for either GPIB or serial. The user has to simply click on the resource name control to get a list of available resources.

 

VISA Resource Name.PNG

 

Also, the 34970 llb you are using should be replaced with the 8.x project library.

0 Kudos
Message 4 of 11
(5,904 Views)

Hi, Dennis Knutson

 

very glad to see you.

 

For my vi, i only provide a UI for user to select GPIB or serial mode, and setting related port.

 

About "Also, the 34970 llb you are using should be replaced with the 8.x project library.", What do you

 

mean? There is a new driver for 34970,right?

 

I search the forum and find a old thread:Agilent 34970 Visa Timeout.

 

There is your answer:

 

I made a mistake. The initialize function already had a timeout function. I just didn't look at the VI closely enough. There is a case statement that sets either the serial port parameters or just sets the VISA timeout. If you are setting the timout right after the VISA Open, it's just getting set back to 10 seconds. Change it in the case statement and see if that works. Sorry, and I hope this works.

 

Do you think this is the same with my problem? Your mean to modify default 10 seconds to more longer timeout,right? 

 

Thanks.

0 Kudos
Message 5 of 11
(5,897 Views)

You seem to have a serious misunderstanding of VISA and what the VISA Resource Name control does. With a single control, the user would automatically select the instrument and based on the resource type, the GPIB or serial connection would be used. You are using multiple controls and only ONE is required. Your technique allows the user to select a resource  that may or may not exist. Try it with the expected type of control and see if you get a timeout.

 

The version 8 driver for the instrument is not new. It has been available for quite some time. If you were originally developing with LabVIEW7, you must not have upgraded when you moved to 8.x. If you started your development with 8.x, then you installed the wrong driver.

 

Modifying the timeout is not going to work. If you are sure that you have a good cable, then perhaps the wrong port is selected. Since the initialize function will configure the serial port if the resource is defined as a serial resource, your technique of creating the resource name may have a bug and the initialize may not be getting done. This is easy to troubleshoot by stepping into the initialize function to see what is actually happening.

0 Kudos
Message 6 of 11
(5,885 Views)

hi Kudos

 

thank your help.

 

For VISA Resource Name control, I don't know whether it will update automatically according to current PC. From its pulldown

 

list, I only can find com1, com2, LPT. No GPIB or other com port is listed. I don't know if current port is other than COM1 or

 

COM2, what will happen.  Will it be listed here automatically? So please explain it in detail for me. Thanks.

 

 

I start with 8.5, But i don't know which driver for 34570 should be used? 😞   I just download it through labview,there are

 

two driver for HP34970, and it can work in my previous program. I mean it can communicate with 34570. Please point out

 

which one should be used. Thanks.

 

 

I think the cable is ok  because other program can work by it. From log, VISA Read vi report error. But i don't know how to resolve

 

 it by now. 😞

 

I will check port setting firstly.

 

Thank you very much. Any suggestion or advise  will be appreciated.

 

mwt.

0 Kudos
Message 7 of 11
(5,872 Views)

Yes, the pulldown will automatically update. No matter what, you have no idea whether the instrument is actually connected to com1 or com2. Your code will certainly not know the difference if someone moves the cable.Yours is hardcoded and that would be a very bad thing if you decide to make the VI into an exe.

 

You chose the 7.0 driver instead of the 8.0 driver. The 8.0 driver is better suited if you are using 8.x. Because it is a project and a LabVIEW Library (quite different than the obsolete llb that you have) it has advantages when you use it within your project.

Message 8 of 11
(5,866 Views)
Solution
Accepted by topic author mmm2006

MMM,

I think you might want to check your cable again.  Serial cables come it two types, Straight (patch) or Null.  This is because serial devices may be either DCE (Data Communications Equipment) or DTE (Data Terminal Equipment.)  You have proved the cable is good by using it with another peice of equipment but, you haven't proved that it is the right TYPE of cableSmiley Wink  frompg 273 of the manual you need a null modem cable the instrument is DTE

 

Check the 34790A user manual.  You also need to set-up the 34790A to expect RS232.  From the front panel you have to access the interface menu and select RS-232 and configure the port settings. Have you done this?  Make sure the port settings match yourPC com port settings

 

Another very common set-up issue is to connect to the trigger/alarm interface by mistake.  The serial port is the lower 9 pin connector on the 34790As rear panel


"Should be" isn't "Is" -Jay
Message 9 of 11
(5,834 Views)

Thank your help very much.

 

The issue is resovled. Different setting leads to this problem.

 

Thanks.

0 Kudos
Message 10 of 11
(5,823 Views)