beautypg.com

Ibpad – Measurement Computing GPIB-488 User Manual

Page 43

background image

Chapter 3

GPIB 488.1 Library Reference

Programming Reference Manual

3-30

GPIB-488

IBPAD

Changes the primary address assigned to a device or interface board.

Syntax

C

ibpad (int boarddev, int address)

Parameters

boarddev

is an integer containing the board or device handle.

address

specifies the new primary GPIB address. Valid primary addresses range from 0 to

30 (0 to 1E hex).

Returns

ibsta

will contain a 16-bit status word as described in Appendix B,

IBSTA

.

iberr

will contain an error code if an error occurred. Contains the previous primary address

if no error occurred.

EARG

error occurs if address is out of range.

Usage Notes

This routine temporarily changes the configuration setting. It remains in effect until

ibonl

or

ibfind

is called,

ibpad

is called again, or the system is re-started.

If a device is specified, its talk and listen addresses are assigned on the basis of

address

. Its

Listen Address equals

address

+ 20 hex. Its Talk Address equals

address

+ 40 hex. Thus,

if a primary address of 0D hex was specified, the corresponding Listen Address would be 2D
hex (MLA 13) and Talk Address would be 4D hex (MTA 13). If a board is specified, the board
is assigned the primary address defined by

address

. Refer also to

ibsad

and

IBONL

.

Be sure that the address specified agrees with the GPIB address of the device. (Set with
hardware switches or by a software program. Refer to the device's documentation for more
information.)

Example

This example changes the primary GPIB address associated with a DVM at PAD 4 to 1C hex.

C

int dvm;

dvm = ibdev (0,4,0,13,1,0);

ibpad (dvm, 0x1C);