Rockwell-automation 1747-PCINT API Software for 1746 I/O Instrukcja Użytkownika Strona 62

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 155
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 61
6–8 Library of Routines OC_CreateIO Configuration
Publication 1747-6.5.3 June 1998
Example:
OCIOCFG iocfg;
int retcode, numslots, i;
char module_name[] = ”1746-BAS”;
iocfg.Rack1Size = 10; /* 10 slot chassis */
iocfg.Rack2Size = 7; /* 7 slot chassis */
iocfg.Rack3Size = 0; /* Only 2 chassis */
numslots = iocfg.Rack1Size + iocfg.Rack2Size + iocfg.Rack3Size;
for ( i=1; i<numslots; i++ ){
iocfg.SlotCfg[i].mix = OCEMPTYMIX;
iocfg.SlotCfg[i].type = OCEMPTYTYPE; /* Empty all slots */
}
iocfg.SlotCfg[6].mix = 35;
iocfg.SlotCfg[6].type = 6; /* Slot 6 has 1746-BAS module */
or
iocfg.SlotCfg[6].name = module_name; /* Use name instead */
.
. /* Add additional module information to */
. /* match the physical I/O configuration */
.
retcode = OC_CreateIOConfiguration( &iocfg );
/* Use OC_DownloadIOConfiguration() to download the information */
Przeglądanie stron 61
1 2 ... 57 58 59 60 61 62 63 64 65 66 67 ... 154 155

Komentarze do niniejszej Instrukcji

Brak uwag