Oc_readioconfigfile, Oc_readioconfigfile -49 – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual
Page 109

Publication 1747-UM002A-US-P - June 2000
Library of Routines 6-49
OC_ReadIOConfigFile
OC_ReadIOConfigFile reads the configuration data that is already
stored in the DOS file created using OC_WriteIOConfigFile.
Syntax:
int
OC_ReadIOConfigFile(OCIOCFG *iocfg, char *
filename);
Parameters:
Description:
If G file data is included in the configuration file,
OC_ReadIOConfigFile allocates memory for the data and initializes the
G data values to point to the allocated memory. The host application
should release the allocated memory via the
free()
function when it
is no longer needed.
Return Value:
Considerations:
Supported in the DOS API library and the Windows NT API library
Example:
OCIOCFG
iocfg;
int
retcode;
/* DOS file named RACK1.CFG, is storing the rack configuration
info. */
retcode = OC_ReadIOConfigFile( &iocfg, ”RACK1.CFG” );
/* Use OC_DownloadIOConfiguration() to download the
information */
Parameter:
Description:
iocfg
A structure that contains a copy of the configuration data that is in
filename
filename
References a file that was created using OC_WriteIOConfigFile
Name:
Value:
Description:
SUCCESS
0
I/O configuration file was read successfully
ERR_OCFILERROR
19
error encountered while opening or reading the file