?? hp3478a.doc
字號:
HP 3478A Multimeter
_______________________________________________________________________________
Introduction:
This instrument module provides GPIB programming support for the HP
3478A Multimeter. It contains functions for opening, configuring,
taking measurements from, and closing the instrument via the GPIB.
_______________________________________________________________________________
Assumptions:
To successfully use this module, the following conditions must be met:
- the HP3478A is connected to the GPIB.
- the GPIB address supplied to the initialize function must match
the GPIB address set via the dipswitches on the rear of the
instrument.
- there is one unused device name in the handler.
_______________________________________________________________________________
LabWindows Libraries:
In order to use this instrument module outside of the LabWindows envi-
ronment, it must be linked with the following LabWindows libraries:
- Formatting and I/O
- GPIB
_______________________________________________________________________________
Error Codes:
All error codes are returned in a global integer variable:
hp3478a_err
A program should examine this variable after each function call is made
to determine if any errors occurred.
________________________________________________________________________________
Function Tree Layout:
Initialize
Initial Setup
Configure and Measure
Configure
Measure
Close
________________________________________________________________________________
Function : Initialize
C Syntax : void hp3478a_init(Addr);
int Addr;
Purpose : Initializes the hp3478a on the GPIB and resets the
instrument to its power-on default state.
Parameter List : Addr - GPIB Address (0 to 30)
C Example : hp3478a_init(23);
Error Codes : The valid error codes for this function are:
0 : Success
-1 : GPIB Address out of range
220 : Unable to open instrument
230 : GPIB write error
233 : Unable to configure GPIB address
235 : Unable to clear device
________________________________________________________________________________
Function : Initial Setup
C Syntax : void hp3478a_init(autozero, display_fun, message);
int autozero, display_fun;
char *message;
Purpose : Enables/disables the autozero mode and permits
a message to be displayed in the 3478A display.
Parameter List : autozero - enable/disable the autozero mode
0 : autozero off
1 : autozero on
display_fun -
1 : normal display
2 : user specified display
message - variable containing the string to be
displayed (12 char. max; no spaces)
C Example : hp3478a_init(0, 2, "AN_EXAMPLE");
Error Codes : The valid error codes for this function are:
0 : Success
-1 : Autozero out of range
-2 : Display function out of range
230 : GPIB write error
231 : GPIB read error
232 : Instrument not initialized
________________________________________________________________________________
Function : Configure
C Syntax : void hp3478a_config(fun,range,trigger);
int fun, range, trigger;
Purpose : Configures the function, range, and trigger
parameters of the meter.
Parameter List : fun - meter function
1 : DC Volts
2 : AC Volts
3 : 2 wire Ohms
4 : 4 wire Ohms
5 : DC current
6 : AC current
7 : Extended Ohms
range - measurement range
-3 : Autoranging
-2 : 30 mV
-1 : 300 mV/mA
0 : 3 V/A
1 : 30 V/Ohms
2 : 300 V/Ohms
3 : 3K Ohms
4 : 30K Ohms
5 : 300K Ohms
6 : 3M Ohms
7 : 30M Ohms
trigger - trigger mode
1 : Internal trigger
2 : External trigger
3 : Single trigger
4 : Trigger hold
5 : Fast trigger
C Example : hp3478a_config(1,-3,1);
Error Codes : The valid error codes for this function are:
0 : Success
-1 : Function out of range
-2 : Range out of range
-3 : Trigger out of range
230 : GPIB write error
232 : Instrument not initialized
________________________________________________________________________________
Function : Measure
C Syntax : void hp3478a_measure(reading);
double *reading;
Purpose : Reads the current measurement value from the meter.
Parameter List : reading- a real variable in which the value of
the measurement is returned.
C Example : double reading;
hp3478a_measure(&reading);
Error Codes : The valid error codes for this function are:
0 : Success
231 : GPIB read error
232 : Instrument not initialized
235 : Unable to trigger instrument
________________________________________________________________________________
Function : Configure and Measure
C Syntax : void hp3478a_full(fun,range,trigger,reading);
int fun, range, trigger;
double *reading;
Purpose : Configures the meter and then reads the current
measurement value.
Parameter List : fun - meter function
1 : DC Volts
2 : AC Volts
3 : 2 wire Ohms
4 : 4 wire Ohms
5 : DC current
6 : AC current
7 : Extended Ohms
range - measurement range
-3 : Autoranging
-2 : 30 mV
-1 : 300 mV/mA
0 : 3 V/A
1 : 30 V/Ohms
2 : 300 V/Ohms
3 : 3K Ohms
4 : 30K Ohms
5 : 300K Ohms
6 : 3M Ohms
7 : 30M Ohms
trigger - trigger mode
1 : Internal trigger
2 : External trigger
3 : Single trigger
4 : Trigger hold
5 : Fast trigger
reading - a real variable in which the value of
the measurement is returned.
C Example : double reading;
hp3478a_full(0,0,0,&reading);
Error Codes : The valid error codes for this function are:
0 : Success
-1 : Function out of range
-2 : Range out of range
-3 : Trigger out of range
230 : GPIB write error
231 : GPIB read error
232 : Instrument not initialized
________________________________________________________________________________
Function : Close
C Syntax : void hp3478a_close();
Purpose : Effectively disconnects the hp3478a from the GPIB
and returns the instrument to local mode.
Parameter List : NONE
C Example : hp3478a_close();
Error Codes : The valid error codes for this function are:
0 : Success
221 : Unable to close instrument
232 : Instrument not initialized
234 : Unable to place instrument in local mode
________________________________________________________________________________
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -