Oc_readinputimage -54, 54 a – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual

Page 108

Advertising
background image

6–54

Library of Routines

OC_ReadInputImage

Publication 1747-6.5.3 June 1998

OC_ReadInputImage

OC_ReadInputImage reads the current input image from the scanner.

Syntax:

int

OC_ReadInputImage(HANDLE handle, WORD *inpimgcpy, int slotnum, WORD offset, WORD

len, WORD *imagebuf);

Parameters:

Description:

To guarantee that a series of calls to OC_ReadInputImage read data from a single input scan,
OC_ReadInputImage can first be called to read the entire input image into a local buffer pointed to by

imagebuf

, with the

inpimgcpy

pointer set to NULL and

slotnum

set to -1. The

imagebuf

buffer can

then be passed as

inpimgcpy

in subsequent OC_ReadInputImage calls to retrieve the slot data from the

copy of the input image. This preserves input image file integrity across multiple calls to
OC_ReadInputImage.

If file integrity is not necessary, the host application can set

inpimgcpy

to NULL and access data directly

from shared memory.

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

inpimgcpy

If

inpimgcpy

is:

NULL

OC_ReadInputImage reads data directly from the input image
in the scanner’s shared memory.

not NULL OC_ReadInputImage reads data from

inpimgcpy

which

contains a copy of the scanner’s input image.

slotnum

offset

len

If

slotnum

is:

positive

input data for that slot is read into the array pointed to by

imagebuf

. Then

imagebuf

contains

len

words of input

data starting at word

offset

of the module in the slot. Data

will not be read past the end of the input image for the slot.

-1

the entire input image is read into the array pointed to by

imagebuf

, and

offse

t

and

len

are ignored.

imagebuf

Must point to an array that is large enough to accept the amount of data
in the requested input image

Advertising
This manual is related to the following products: