Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 62

6–8
Library of Routines
OC_CreateIO Configuration
Publication 1747-6.5.3 June 1998
Example:
OCIOCFG
iocfg;
int
retcode, numslots, i;
char
module_name[] = ”1746-BAS”;
iocfg.Rack1Size = 10;
/* 10 slot chassis */
iocfg.Rack2Size = 7;
/* 7 slot chassis */
iocfg.Rack3Size = 0;
/* Only 2 chassis */
numslots = iocfg.Rack1Size + iocfg.Rack2Size + iocfg.Rack3Size;
for ( i=1; i<numslots; i++ ){
iocfg.SlotCfg[i].mix = OCEMPTYMIX;
iocfg.SlotCfg[i].type = OCEMPTYTYPE; /* Empty all slots */
}
iocfg.SlotCfg[6].mix = 35;
iocfg.SlotCfg[6].type = 6;
/* Slot 6 has 1746-BAS module */
or
iocfg.SlotCfg[6].name = module_name;
/* Use name instead */
.
.
/* Add additional module information to */
.
/* match the physical I/O configuration */
.
retcode = OC_CreateIOConfiguration( &iocfg );
/* Use OC_DownloadIOConfiguration() to download the information */