Send, Send -18 – Measurement Computing GPIB-488 User Manual

Page 86

Advertising
background image

Chapter 4

GPIB 488.2 Library Reference

Programming Reference Manual

4-18

GPIB-488

Send

Sends data to one GPIB device.

Syntax

C

Send (int board, short address,char data[],

long count, int eotmode)

Parameters

board

is an integer which identifies the GPIB board to be used for this operation. In most

applications, this value is 0.

address

is an integer representing the GPIB address of the device to receive the data.

data

is the string of data which is sent to the device.

count

specifies the maximum number of data bytes which are to be sent to the device.

eotmode

is the flag used to signal the end of data.

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.

Usage Notes

When this routine is executed, the specified GPIB board is addressed as a Talker, the
designated GPIB device is addressed as a Listener and the number of bytes (specified by

count

) in

data

is sent. Values for

eotmode

are:

NLend

—Send NL (Line Feed) with EOI after last data byte.

DABend

—Send EOI with the last data byte in the string.

NULLend

—Do not mark the end of the transfer.

These constants are defined in the header file.

Example

In this example, GPIB board 0 sends an identification query to the GPIB device at address 3.
End of data is signalled by an EOI.

C

Send (0, 3, "*IDN?", DABend)

Advertising