Oc_readinputimage, Oc_readinputimage -47, Return value: considerations – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 107: Example, Syntax, Parameters

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

Library of Routines 6-47

Return Value:

Considerations:

Supported in the DOS API library and the Windows NT API library

Example:

HANDLE

Handle;

BYTE

retent_data[500];

int

retcode;

retcode =

OC_ReadHostRetentiveData( Handle, retent_data,

0, 500 );

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:

Name:

Value:

Description:

SUCCESS

0

host retentive data was written successfully

ERR_OCACCESS

2

handle

does not have access to scanner

ERR_OCINIT

5

scanner has not been initialized, see OC_InitScanner

ERR_OCPARAM

8

parameter contains invalid value

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: