Agilent Technologies 6814B Welding System User Manual


 
2 - Introduction to Programming
24
System Considerations
The remainder of this chapter addresses some system issues concerning programming. These are ac
source addressing and the use of the following types of GPIB system interfaces:
u HP Vectra PC controller with Agilent 82335A GPIB Interface Command Library
u IBM PC controller with National Instruments GPIB-PCII Interface/Handler
u Agilent controller with Agilent BASIC Language System
Assigning the GPIB Address in Programs
The ac source address cannot be set remotely. It must be set from the front panel. Once the address is
set, you can assign it inside programs. The following examples assume that the GPIB select code is 7,
and the ac source will be assigned to the variable ACS.
1070 ACS=706 ! Agilent 82335A Interface
1070 ASSIGN @ACS TO 706 ! Agilent BASIC Interface
For systems using the National Instruments DOS driver, the address is specified in the software
configuration program (IBCONFIG.EXE) and assigned a symbolic name. The address then is referenced
only by this name within the application program (see the National Instruments GPIB documentation).
Types of DOS Drivers
The Agilent 82335A and National Instruments GPIB are two popular DOS drivers. Each is briefly
described here. See the software documentation supplied with the driver for more details.
Agilent 82335A Driver
For GW-BASIC programming, the GPIB library is implemented as a series of subroutine calls. To access
these subroutines, your application program must include the header file SETUP.BAS, which is part of the
DOS driver software.
SETUP.BAS starts at program line 5 and can run up to line 999. Your application programs must begin at
line 1000. SETUP.BAS has built-in error checking routines that provide a method to check for GPIB errors
during program execution. You can use the error-trapping code in these routines or write your own code
using the same variables as used by SETUP.BAS.
National Instruments GPIB Driver
Your program must include the National Instruments header file DECL.BAS. This contains the initialization
code for the interface. Prior to running any applications programs, you must set up the interface with the
configuration program (IBCONF.EXE).
Your application program will not include the ac source symbolic name and GPIB address. These must
be specified during configuration (when you run IBCONF.EXE). Note that the primary address range is
from 0 to 30 but any secondary address must be specified in the address range of 96 to 126. The
instrument expects a message termination on EOI or line feed, so set EOI w/last byte of Write. It is also
recommended that you set Disable Auto Serial Polling.
All function calls return the status word IBSTA%, which contains a bit (ERR) that is set if the call results in
an error. When ERR is set, an appropriate code is placed in variable IBERR%. Be sure to check IBSTA%
after every function call. If it is not equal to zero, branch to an error handler that reads IBERR% to extract
the specific error.