Rockwell-automation 1747-PCIS API Software - Open Controller Manual de usuario Pagina 67

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 174
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 66
Publication 1747-UM002A-US-P - June 2000
Library of Routines 6-7
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 */
OC_DemandInputScan
OC_DemandInputScan forces the scanner to immediately perform an
input scan.
Syntax:
int OC_DemandInputScan(HANDLE handle, int mode);
Parameters:
Description:
If an I/O scan is in progress when this function is called, the input
scan is performed after the current scan has completed.
Parameter: Description:
handle Must be a valid handle returned from OC_OpenScanner
mode If
mode is:
OCWAIT OC_DemandInputScan waits for the input scan to be
completed before returning to the caller.
OCNOWAIT OC_DemandInputScan returns immediately.
Vista de pagina 66
1 2 ... 62 63 64 65 66 67 68 69 70 71 72 ... 173 174

Comentarios a estos manuales

Sin comentarios