beautypg.com

Ibrd – National Instruments GPIB-PC User Manual

Page 122

background image

Section Four A

BASICA/QuickBASIC GPIB-PC Function Calls

©National Instruments Corp.

4A-47

GPIB-PC User Manual

BASICA/QuickBASIC

BASICA/QuickBASIC

IBRD

IBRD

Purpose:

Read data to string

Format:

CALL IBRD (BD%,RD$)

Remarks:

BD%

specifies a device or an interface board.

RD$

identifies the storage buffer for data bytes that are read
from the GPIB.

The

IBRD

function reads from 1 to 255 bytes of data from a

GPIB device. In QuickBASIC the

IBRD

function reads

from 1 to 32K bytes of data from a GPIB device.

Device

IBRD

Function:

When

BD%

specifies a device, the following board steps are performed

automatically to read from the device:

1.

The

IBCMD

function is called to address the device to talk and

the access board to listen.

2.

The board

IBRD

function is called to read the data from the

device, as explained in the following discussion.

3.

The

IBCMD

function is called to unaddress the access board

and unaddress all devices using the Untalk and Unlisten
commands.

Other command bytes may be sent as necessary.

When the device

IBRD

function returns,

IBSTA%

holds the latest

device status;

IBCNT%

is the actual number of data bytes read from the

device; and

IBERR%

is the first error detected if the ERR bit in

IBSTA%

is set.

Board

IBRD

Function:

When

BD%

specifies an interface board, the

IBRD

function attempts to

read from a GPIB device that is assumed to already be properly
initialized and addressed.

If the access board is CIC, the

IBCMD

function must be called prior to

IBRD

to address a device to talk and the board to listen. Otherwise, the

device on the GPIB that is the CIC must perform the addressing.