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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 174
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 45
Publication 1747-UM002A-US-P - June 2000
3-14 Developing Applications
/* Reset the scanner */
printf("\nResetting the scanner...");
if (SUCCESS != (rc = OC_ResetScanner(OChandle, OCWAIT)))
{
printf("\nERROR: OC_ResetScanner failed: %d\n", rc);
Ioexit(1);
}
/* Check scanner status register */
if (SUCCESS != (rc = OC_GetScannerStatus(OChandle, &status)))
{
printf("\nERROR: OC_GetScannerStatus failed: %d\n", rc);
Ioexit(1);
}
if ( status != SCANSTS_INIT)
{
printf("\nERROR: POST failure detected: %d\n", status);
Ioexit(1);
}
/* Initialize the DPR partitions */
ocpart.OutputImageSize = 0x800;
ocpart.InputImageSize = 0x800;
ocpart.HostRetentiveDataSize = 0;
if (SUCCESS != (rc = OC_InitScanner(OChandle, &ocpart)))
{
printf("\nERROR: OC_InitScanner failed: %d\n", rc);
Ioexit(1);
}
/* Display software/hardware versions */
if (SUCCESS != (rc = OC_GetVersionInfo(OChandle, &verinfo)))
{
printf("\nERROR: OC_GetVersionInfo failed: %d\n", rc);
Ioexit(1);
}
printf("\nOC API Series: %02d Revision: %02d ",
verinfo.APISeries,verinfo.APIRevision);
printf("\nOCdriver Series: %02d Revision: %02d ",
verinfo.OCdriverSeries, verinfo.OCdriverRevision);
printf("\nOC Scanner Firmware Series: %02d Revision: %02d ",
verinfo.ScannerFirmwareSeries, verinfo.ScannerFirmwareRevision);
printf("\nOC Hardware Series: %02d Revision: %02d\n",
verinfo.OCHardwareSeries, verinfo.OCHardwareRevision);
/* Read switch position */
if (SUCCESS != (rc = OC_GetSwitchPosition(OChandle, &swpos)))
{
printf("\nERROR: OC_GetSwitchPosition failed: %d\n", rc);
Ioexit(1);
}
printf("\nSwitch position: ");
switch(swpos)
{
case SWITCH_TOP:
printf("Top");
break;
case SWITCH_BOTTOM:
printf("Bottom");
break;
case SWITCH_MIDDLE:
printf("Middle");
break; }
/* Read temperature */
if (SUCCESS != (rc = OC_GetTemperature(OChandle, &temp)))
{
Initialize the
scanner
Przeglądanie stron 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 173 174

Komentarze do niniejszej Instrukcji

Brak uwag