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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 174
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 46
Publication 1747-UM002A-US-P - June 2000
Developing Applications 3-15
printf("\nERROR: OC_GetTemperature failed: %d\n", rc);
Ioexit(1);
}
printf("\nTemperature: %dC ", temp);
/* Read auto-config */
if (SUCCESS != (rc = OC_GetIOConfiguration(OChandle, &OCcfg)))
{
printf("\nERROR: OC_GetIOConfiguration failed: %d\n", rc);
Ioexit(1);
}
/* Display rack configuration */
slots = OCcfg.Rack1Size + OCcfg.Rack2Size + OCcfg.Rack3Size;
if ( slots > 31 ) slots = 31;
printf("\n\nRack configuration:");
for (i=1; i<slots; i++)
{
if (OCcfg.SlotCfg[i].type != 0xff)
{
printf("\nSlot %2d: Type %2d, Mix %3d %s",
i, OCcfg.SlotCfg[i].type, OCcfg.SlotCfg[i].mix,
OCcfg.SlotCfg[i].Name);
}
else
{
printf("\nSlot %2d: %s", i, OCcfg.SlotCfg[i].Name);
}
/* check for BAS modules class 1 or 4 */
if ( ((OCcfg.SlotCfg[i].mix == 35) || (OCcfg.SlotCfg[i].mix == 131))
&& (OCcfg.SlotCfg[i].type == 6))
{
if ( OCcfg.SlotCfg[i].mix == 35 )
{ /* if Class 1 BAS module, then ...
OCcfg.SlotCfg[i].mix = 131; /* ...make it class 4 */
OCcfg.SlotCfg[i].Name = NULL; /* remove name so that OC_CreateIOConfiguration
will key off mix/type */
fRecreateIOcfg = 1;
}
BASslot = i;
}
/* check for IB32 modules */
if ( OCcfg.SlotCfg[i].mix == 7 )
{
IB32slot = i;
}
}
/* if we converted a Class 1 BAS module to Class 4, recreate the IO configuration */
/* to insure we get the M0 and M1 file sizes */
if (fRecreateIOcfg == 1)
{
if (SUCCESS != (rc = OC_CreateIOConfiguration(&OCcfg)))
{
printf("\nERROR: OC_CreateIOConfiguration failed: %d\n", rc);
Ioexit(1);
}
}
Przeglądanie stron 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 173 174

Komentarze do niniejszej Instrukcji

Brak uwag