beautypg.com

Print or display results, 8ć12 – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 102

background image

Chapter 8

Block Transfer

8-12

A routine is available to display the results of a BT on a screen or a printer
or write formatted results to an ASCII file.

bt_print

format a BT queue entry for display. This function translates the
command, address (rack, group, slot), and status to English for writing to
screen or file, and formats the data as hex words, 8 per line.

Calling sequence:

bt_print(

fileptr, command, address, &qbtptr

);

Arguments:

fileptr:

stdout or stderr for screen output, or a pointer to a user file

opened with fopen.

command:

an integer, either C_BT_READ or C_BT_WRITE.

address:

the module address that was passed to the original queueing

function.

qbtptr:

a pointer to your QBT type packet.

Returned values:

none.

Example: This code tests a BT for completion and prints the results when
the BT has finished:

#define OUT_VOLTS (16*4) /* rack 4 slot 0 */
static QBT btw;

. . .

bt_write(OUT_VOLTS, &btw);

. . .

if ( bt_done(&btw) )

bt_print(stdprt, C_BT_WRITE, OUT_VOLTS, &btw);

Print or Display

Results