Oc_writeioconfigfile, Oc_writeioconfigfile -76, Example – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 136: Syntax, Parameters: description, Return value

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

6-76 Library of Routines

Example:

HANDLE

Handle;

BYTE

retent_data[500];

int

retcode;

retcode =

OC_WriteHostRetentiveData( Handle, retent_data,

0, 500 );

OC_WriteIOConfigFile

OC_WriteIOConfigFile writes the configuration data contained in the

iocfg

structure to the file named

filename

.

Syntax:

int

OC_WriteIOConfigFile(OCIOCFG *iocfg,

char *filename);

Parameters:

Description:

Configuration files created by OC_WriteIOConfigFile can be read by
OC_ReadIOConfigFile.

The

OCIOCFG

structure is defined as:

typedef struct tagOCIOCFG

{

BYTE

Rack1Size;/* number of slots in Rack 1 */

BYTE

Rack2Size;/* number of slots in Rack 2 */

BYTE

Rack3Size;/* number of slots in Rack 3 */

OCSLOTCFG

SlotCfg[OCMAXSLOT];/* configuration for each

slot */

} OCIOCFG;

Return Value:

Parameter:

Description:

iocfg

A structure that contains the configuration data that is to be written
to

filename

filename

References the file to write
If

filename

does not exist, it is created.

Name:

Value:

Description:

SUCCESS

0

I/O configuration file was written successfully

ERR_OCFILERROR

19

error encountered while opening or writing the file

Advertising
This manual is related to the following products: