Rockwell-automation 1747-PCINT API Software for 1746 I/O Manual de usuario Pagina 33

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 155
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 32
Developing Applications 3–7
Publication 1747-6.5.3 Junel 1998
/*
** Open the scanner
*/
retcode = OC_OpenScanner( &Handle, 0, 0);
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_OpenScanner failed: %d\n”, retcode );
Ioexit( 1 );
}
/*
** Reset the scanner
*/
printf( ”\n\n Going to reset OC, takes 6 seconds to complete...\n” );
retcode = OC_ResetScanner( Handle, OCWAIT );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_ResetScanner failed: %d\n”, retcode );
Ioexit( 1 );
}
/*
** Check scanner status register
*/
retcode = OC_GetScannerStatus( Handle, &status );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_GetScannerStatus failed: %d\n”, retcode );
Ioexit( 1 );
}
if ( status != SCANSTS_INIT)
{
printf(”\nERROR: POST failure detected: %d\n”, status);
Ioexit(1);
}
/*
** Initialize the DPR partitions
** You can use OC_CreateIOConfiguration to determine the I/O image table
** sizes before paritioning the DPR
*/
ocpart.OutputImageSize = 0x800;
ocpart.InputImageSize = 0x800;
ocpart.HostRetentiveDataSize = 0;
retcode = OC_InitScanner( Handle, &ocpart );
if ( retcode != SUCCESS )
{
printf(” \nERROR: OC_InitScanner failed: %d\n”, retcode );
Ioexit( 1 );
}
/*
** Display software/hardware versions
*/
retcode = OC_GetVersionInfo( Handle, &verinfo );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_GetVersionInfo failed: %d\n”, retcode );
Ioexit( 1 );
}
printf( ”\n\n Scanner Firmware Series: %02d Revision: %02d ”,
verinfo.ScannerFirmwareSeries, verinfo.ScannerFirmwareRevision );
printf( ”\n Hardware Series: %02d Revision: %02d”,
verinfo.OCHardwareSeries, verinfo.OCHardwareRevision );
delay( 3000 );
Access the
scanner
See page 6-48.
Initialize the
scanner
See pages
6-63, 6-33,
and 6-7.
Vista de pagina 32
1 2 ... 28 29 30 31 32 33 34 35 36 37 38 ... 154 155

Comentarios a estos manuales

Sin comentarios