Oc_writemodulefile, Oc_writemodulefile -77, Considerations – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 137: Example, Syntax, Parameters: description

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

Library of Routines 6-77

Considerations:

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

Example:

OCIOCFG

‘iocfg

int

retcode;

/* Either OC_CreateIOConfiguration() or

OC_GetIOConfiguration() were */

/* called previously to fill in ’iocfg’ structure */

retcode = OC_WriteIOConfigFile( &iocfg, ”RACK1.CFG” );

OC_WriteModuleFile

OC_WriteModuleFile writes a data file to a module.

Syntax:

int

OC_WriteModuleFile(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.

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 written to the module starting at word

offset

. This function does not write 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 written from the module located at

slotnum

on

the scanner into the buffer

mfile

Advertising
This manual is related to the following products: