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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 155
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 35
3–10 Developing Applications
Publication 1747-6.5.3 June 1998
/*
** Read first Input word
*/
retcode = OC_ReadInputImage( Handle, NULL, input_slot, 0, 1, &wData );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_ReadInputImage failed: %d\n”, retcode );
Ioexit( 1 );
}
printf( ”\n\n First input image data word --> 0x%04x \n”, wData );
delay( 3000 );
/*
** Write to the first Output word
*/
printf( ”\n\n Incrementing first discrete output word. \n” );
for ( wData=0; wData < 256; wData++)
{
retcode = OC_WriteOutputImage( Handle, NULL, output_slot, 0, 1, &wData );
if ( retcode != SUCCESS )
{
printf(”\nERROR: OC_WriteOutputImage failed: %d\n”, retcode);
Ioexit(1);
}
delay ( 10 );
}
/*
** Must always close the scanner before exiting
*/
OC_CloseScanner( Handle );
printf( ”\n\n Program is done! \n\n” );
} /* end main() */
Scan I/O
See page
6-54 and
6-90.
Vista de pagina 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 154 155

Comentarios a estos manuales

Sin comentarios