LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

HP34401A Help ?

Here is a link to the user manual, if you do not have it.

 

You do not have to deal with VISA functions as Roberto stated.

You can use the RS-232 library of CVI.

 

Simply open the port (using the OpenComConfig function) with correct settings (baud rate, start/stop bits, parity, data size) and start transmitting/receiving data using ComWrt and ComRd functions respectively.

 

This is a more straightforward approach, if you do not need interface independency in your application.

S. Eren BALCI
IMESTEK
0 Kudos
Message 11 of 21
(2,120 Views)
Just as a note the attached driver is not from NI as noted in the readme.txt and copyright in the header file.  The NI VXI Plug and Play driver for the 34401a  is available on IDNet.  The HP 34401 plug&play Help mentions issues under the In Case of Trouble section.
0 Kudos
Message 12 of 21
(2,106 Views)

As was mentioned, you do not NEED to use the Instrument Driver, but it will make programming easier down the road. When setting up the instrument, probably best to use the basic 232 commands.

 

Before jumping into CVI, try running a loopback test from Hyperterminal and/or MAX. This will verify your hardware is working and get youa littlemroe familiar with how 232 communication works. After you have a loopback test working, try connecting the instrument and sending the command "*IDN?". This is a standard command that a lot of devices will respond to. The manual for the device will confirm this. If this is not a known command, try finding a simple command that should respond with some information. Try this out in MAX or hyperterminal. Once this works, you can be sure that the port and instrument are functioning.

 

Now you can get into CVI and build your application.

 

Let me know how this turns out. FYI, the Instrument Control forum could also help with this although they may shy away from CVI 😉

---

Peter Flores
Applications Engineer
0 Kudos
Message 13 of 21
(2,096 Views)

By looking at the manual ebalci have linked I saw that your dmm can be programmed using SCPI command set: this language can be easily used in hyperterminal as it is made of simple text strings (here the link to documentation on SCPI in IVI web site; your instrument, however, may use a reduced command set: check in vendor documentation).

 

Verifications suggested by ebalci and pflores are basic: after you have successfully tested your communication channel you may go to interacting with the instrument. I am attaching some sample code I used to communicate with a Fluke DMM via SCPI: you may use it as a guide for you to develop your own set of instructions.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 14 of 21
(2,092 Views)

Thanks for all the replys.

I will try the direct connection and read over all the material that you provided and will get back to you.

Help share your knowlegde
0 Kudos
Message 15 of 21
(2,071 Views)

Hi

 

In your sample c file.

How do you know how long to delay before asking the next query.

 

Help share your knowlegde
0 Kudos
Message 16 of 21
(2,066 Views)
Unfortunately there is no rule for this Smiley Surprised : every instrument can take a different time to perform measurement. You'kk have to look in the documentation and/or make some attempts with different timings.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 17 of 21
(2,047 Views)

One useful thing with serial communication is the timeout interval, if you can make good use of it.,

 

When you want to read data with the ComRd function, data does not have to be availabe at the instant you call ComRd.

The serial port driver waits for a specific time period, which you determine with the SetComTime function, for the specified number of data bytes to arrive.

 

Data can arrive anytime within this period, and ComRd waits automatically without any other extra coding.

ComRd returns the number of data bytes it has acquired, so that you can compare it with what you expect.

 

Even if you do not put any explicit delays, ComRd may handle this delay as well.

S. Eren BALCI
IMESTEK
0 Kudos
Message 18 of 21
(2,035 Views)

I got it to work finaly.

The problem i was have was the setup i was not giving the device enough time to config be for i call for READ?.

Thanks For The Help.

 

But i got another question.

When i set the Number of power line cycle to 100 and auto zero on the readings only happen every 4sec and not 2sec like mentioned in the  manual.

Why is this ?

If its incorrect what could cause this to happen ?

 

This is my config settings:

 

strcpy(Str,"*RST;*CLS\n"); // Reset and Clear Registers comChk (ComWrt (PortAddress, Str,strlen(Str))); Delay (0.2); strcpy (msg, "SYST:REM\n");// Switch to remote control comChk (ComWrt (PortAddress, msg, strlen (msg))); Delay (0.2); strcpy (msg, "CONF:VOLT:DC 0.0003\n");// Set Function to Volt DC comChk (ComWrt (PortAddress, msg, strlen (msg))); Delay (0.2); strcpy (msg, "VOLT:DC:NPLC 100\n"); // Number of Power line cycles comChk (ComWrt (PortAddress, msg, strlen (msg))); Delay (0.2); strcpy (msg, "ZERO:AUTO OFF\n"); // Auto Zero comChk (ComWrt (PortAddress, msg, strlen (msg))); Delay (0.2);

 

 

 

 

Help share your knowlegde
0 Kudos
Message 19 of 21
(2,025 Views)

Hi,

 

The measurement time is highly related with the range and/or precision you select.

 

If you required a very high precision, the integration time might be longer than you expected.

If I am not mistaken, there should be a table or something in the manual that summerizes this.

S. Eren BALCI
IMESTEK
0 Kudos
Message 20 of 21
(1,987 Views)