beautypg.com

Oc_readmodulefile, Oc_readmodulefile -50, Syntax – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 110: Parameters: description, Return value: considerations

background image

Publication 1747-UM002A-US-P - June 2000

6-50 Library of Routines

OC_ReadModuleFile

OC_ReadModuleFile reads a data file from a module.

Syntax:

int

OC_ReadModuleFile(HANDLE handle, BYTE ftype,

WORD *mfile, int slotnum, WORD offset, WORD len);

Parameters:

Description:

This function accesses an internal data file of the selected module. I/O
scanning is blocked while this access takes place.

Return Value:

Considerations:

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

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

ftype

Defines the module type as:
FILTYP_M0

M0 file

FILTYP_M1

M1 file

FILTYP_G

G file

mfile

Buffer file that contains data read from the module at

slotnum

The data in

mfile

is read from the module starting at word

offset

. This function does not read data past the end of the

module file for the slot.

slotnum

Must be a valid slot number

offset

Must be valid word number within module file

len

Number of words read from the module located at

slotnum

on the

scanner into the buffer

mfile

Name:

Value:

Description:

SUCCESS

0

file was read successfully

ERR_OCACCESS

2

handle

does not have access to scanner

ERR_OCPARAM

8

parameter contains invalid value

ERR_OCRESPONSE

10

scanner did not respond to request

ERR_OCSCANCFG

14

scanner has not been configured

ERR_OCSLOT

12

slot number is invalid

This manual is related to the following products: