Rockwell-automation 1747-PCIS API Software - Open Controller Instrukcja Użytkownika Strona 41

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 174
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 40
Publication 1747-UM002A-US-P - June 2000
Developing Applications 3-9
/*
** Download the configuration to the scanner
*/
retcode = OC_DownloadIOConfiguration( Handle, &OCcfg );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_DownloadIOConfiguration failed: %d\n”,
retcode );
Ioexit( 1 );
}
/*
** Set output update mode to always
*/
retcode = OC_SetOutputUpdateMode( Handle, OUTUPD_ALWAYS );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_SetOutputUpdateMode failed: %d\n”,
retcode );
Ioexit( 1 );
}
/*
** Set scan time to 5ms, periodic scan mode
*/
retcode = OC_SetScanTime( Handle, SCAN_PERIODIC, 20 );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_SetScanTime failed: %d\n”, retcode );
Ioexit( 1 );
}
/*
** Goto Scan Mode
*/
retcode = OC_SetScanMode( Handle, SCAN_RUN );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_SetScanMode failed: %d\n”, retcode );
Ioexit( 1 );
}
/*
** Turn on User LED 1
*/
retcode = OC_SetUserLEDState( Handle, 1, LED_GREEN_SOLID );
if ( retcode != SUCCESS )
{
printf( ”\nERROR: OC_SetUserLEDState failed: %d\n”, retcode );
Ioexit( 1 );
}
printf( ”\n\n LED1 is on solid green now. \n” );
delay( 3000 );
Configure
the
scanner.
Control scanner
operation
Przeglądanie stron 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 173 174

Komentarze do niniejszej Instrukcji

Brak uwag