Description, Return value: considerations, Example – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual
Page 108

Publication 1747-UM002A-US-P - June 2000
6-48 Library of Routines
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.
Return Value:
Considerations:
Supported in the DOS API library and the Windows NT API library
Example:
HANDLE
Handle;
WORD
inputdata[2];
int
retcode;
retcode =
OC_ReadInputImage( Handle, NULL, 6, 0, 2,
inputdata );
/* Read slot 6 data, first 2 words, directly from the input
image */
/* table to inputdata buffer */
Name:
Value:
Description:
SUCCESS
0
input image was read successfully
ERR_OCACCESS
2
handle
does not have access to scanner
ERR_OCPARAM
8
parameter contains invalid value
ERR_OCSCANCFG
14
scanner has not been configured
ERR_OCSLOT
12
slot number is invalid