D - Example Programs; Introduction; Assigning The Hp-Ib Address In Programs; National Instruments Gp-Ib Driver - Agilent Technologies 66311A User Manual

Table of Contents

Advertisement

D
Example Programs

Introduction

The example programs in this section are intended to show how some of the same dc source functions
can be programmed to each of the following HP-IB interfaces:
1. National Instruments GPIB-PCII Interface/Handler
2. HP BASIC Language System

Assigning the HP-IB Address in Programs

The dc source address cannot be set remotely. It must be set using the front panel Address key. Once the
address is set, you can assign it inside programs. The following example is for HP BASIC and assumes
that the HP-IB select code is 7, the address is 6, and the dc source is assigned to the variable PS.
1070 ASSIGN @PS TO 706
!HP 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 GP-IB documentation).

National Instruments GP-IB 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 dc source's symbolic name and HP-IB address. These
must be specified during configuration (when you run IBCONF.EXE). Note that the primary address
range is from 0 to 30. The dc source 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.
137

Advertisement

Table of Contents
loading

Table of Contents