beautypg.com

Ibwrtf, Ibwrtf -55 – Measurement Computing GPIB-488 User Manual

Page 68

background image

Chapter 3

GPIB 488.1 Library Reference

GPIB-488

3-55

Programming Reference Manual

IBWRTF

Writes data from a file to the specified device or GPIB Interface Board.

Syntax

C

ibwrtf (int boarddev, char filename [])

Parameters

boarddev

is an integer containing the board or device handle.

filename

is the name of the file (up to 50 characters, including drive/path) to store the data.

Specify a drive and path if necessary. This file is automatically opened as a binary file.

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. An

EFSO

error is generated if the file

can not be found.

ibcnt

,

ibcntl

will contain the number of bytes that were written.

ibcnt

is a 16-bit integer.

ibcntl

is a 32-bit integer. If the requested count was greater than 64 K, use

ibcntl

instead

of

ibcnt

.

Usage Notes

A write terminates when one of the following occurs:

An error is detected.

The time limit is exceeded.

A DCL or SDC is received from the Active Controller.

All data has been sent.

If

boarddev

specifies a device, the specified device is addressed to talk and its associated

access board is addressed to listen. If

boarddev

specifies a GPIB interface board, you must

have already addressed a device as a listener and the board as a talker. If the board is the CIC,
it unasserts ATN in order to receive data. This routine leaves the board in that state.

Example

This program sends the command "

UPLOAD

" to a device and prepares the device to receive a

large amount of data. The program then sends the data from a file to the device.

C

int device;

ibwrt (device, "UPLOAD");

ibwrtf (device, "c:gpib.dat");