beautypg.com

Print or display image table – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 64

background image

Chapter 6

Discrete I/O

6-9

putword

Use this routine to write a 16-bit word to the output image table.

Calling sequence:

putword(

data, rack, group

);

Arguments:

data:

an unsigned integer to be written to the output image table.

rack:

an integer 0 to 7, the logical rack number.

group:

an integer 0 to 7, the module group number.

Returned values:

none

This section describes a routine we provide to help you dump the input or
output image table, or any array, to screen, printer, or disk. You can dump
the array by byte (16 per line) or by word (8 per line).

pr_array

Use this routine to format a word or byte array for display.

Calling sequence:

pr_array(

fileptr, header, array, length

);

Arguments:

fileptr:

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

opened by the user program through fopen.

header:

a character pointer whose object is a descriptive phrase of a

few characters, such as “IIT”. If the display is to fit on an 80- character
line, the length of the header string must not exceed 34 characters if the
array is word oriented, 26 if byte oriented.

array:

the name of a character or unsigned integer array.

length:

an integer giving the length of the array. If the array is to be

displayed as words, length should be a positive number. If the array is
to be displayed as single bytes (type chararacter), length should be
minus the number of bytes in the array.

Print or Display

Image Table