LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HP34970A configuration via RS232

How do you get LabVIEW to talk to and configure and HP 34970A datalogger via RS232 connection?

We are new to LabVIEW and need basic help with getting it to work with our equipment.
0 Kudos
Message 1 of 15
(5,338 Views)
First of all, do you have the LabVIEW driver? If not, go to http://zone.ni.com/idnet97.nsf/9b2b33e1993d877786256436006ec498/e4c553c139f78062862568ab005fba3c?OpenDocument and get the driver that matches your version of LabVIEW. Next, make sure you have the right serial cable. Next, configure either the instrument or HP34970A Initialize.vi so that the communication parameters are the same (i.e. parity, baud rate, etc.). Next, pick a VI under the Getting Started pallette of the instrument driver. Pick one that similar to what you need to do and what kind of hardware is inside the box. Next, change the instrument descriptor to be ASRL1::INSTR (if connected to comm 1). Next, run the VI and see what happens. I use a lot of these things but they're all GPIB because
I'm not masochistic enough to enjoy serial communications. I do seem to recall seeing a post that the instrument driver has the wrong termination character for serial. If you can't get the LabVIEW driver to work, try talking to the instrument using hperterminal. Good Luck.
Message 2 of 15
(5,338 Views)
I have programmed as you told me above, but there is an error code, -1073807339, which means timeout. I don't know how it happened and how to solve it.

Please answer as soon as possible. Thank you very much.
0 Kudos
Message 3 of 15
(5,338 Views)
In addition to what Dennis said:
1. check again the cable (especially pins 2 and 3 – you should have details in manual / as far as I know, most of the instruments are using Straight Through Cable [2 goes to 2 and 3 goes to 3] )
2. check the instrument settings – some instruments use GPIB as default communication
3. you can try to use old Serial Vis (attention: you will set input 0 for COM1) with a simple command like *RST or try to configure the port / send commands from MAX

good luck
Message 4 of 15
(5,338 Views)
The hardware is in good condition, when I use the benchlink, the software combined with hp34970a, to communicate between PC and hp34970a. However when I use labview to communicate the hardware, there is still some problem, no matter I use VIs, which are combined with hp34970a such as the hp34970a initialize.vi, to communicate it, but also I use Serial VIs with the error code 16640. I am so supprised that I have the experience of using Serial VIs to program, and I have overcome many difficulty except this time. I really don't know how this error happened.

Long for your suggestion. Thank you very much.
0 Kudos
Message 5 of 15
(5,338 Views)
Some of the drivers I have used worked fine on GPIB but not on serial. I found that the VI's left off the terminator (\n) at the end of the command line. It is not required for GPIB but was necessary for the serial device I used. I modified the drivers and added terminators and they then worked fine.
0 Kudos
Message 6 of 15
(5,338 Views)
Based on the theory of computer communication, carriage return is necessary for communication between serial ports. But it is not the reason to my problem. However I tried to establish the communication between PC and hp 34970a with Serial VIS, the error code was 16640. When I tried to do so with VISA VIs, the error code showed either "time out" or "The resource is valid, but VISA cannot currently access it.". I doubted that if there is a patch of I/O for hp 34970a.

Thank you for your suggestion.
0 Kudos
Message 7 of 15
(5,338 Views)
Serial communication can be a little finiky. Depending on your OS you should try and use the built in serial port communication utilities like the hyper terminal.

The best way to troubleshoot is to make sure you can establish communication with the hyper terminal. This lets you verify that the port is working. Then you can start working your way through serial, VISA VIs and the VISA Interactive control. If you're having trouble you may want to call an Applications Engineer via ni.com/ask

Regards,
Kamran - NI
An
0 Kudos
Message 8 of 15
(5,338 Views)
Make sure that you do not have any other applications running that mioght access the serial port. That is the error message I get if I forget to close hyperterminal or something like that.

Brian
0 Kudos
Message 10 of 15
(5,338 Views)
Nothing changed better. The error message is "Error 16640 occurred at an unidentified location.

Possible reasons:

Windows GetCommError: The hex value of this code is x4100.

Interpret it bit-wise as follows: x4000: serial port VI error; x0001: receiving queue overflowed or character was received after end-of-file character; x0002: character was lost by overwrite; x0004: parity error; x0008: framing error; x0010: break condition; x0020: CTS timeout; x0040: DSR timeout; x0080: RLSD timeout; x0100: transmission queue was full when new character arrived; x0200: parallel device timeout; x0400: parallel device I/O error; x0800: parallel device not selected; x1000: parallel device out of paper; x8000: requested mode is not supported or the id
ComDev parameter is invalid. Consult the LabVIEW serial port manual for more information."

I am so supprised that there is still something wrong when I used the Win32 VISA Interactive Control.exe to write buffers to hp34970a.

Kingkqj
0 Kudos
Message 12 of 15
(5,108 Views)