/* 2001.7.11 The program implement 4 digital input and relay output */ #include #define DO1 0x100 #define SCAN1 0x101 #define SCAN2 0X102 #define LED 0x103 #define DIN 0x104 #define DOUT 0x105 void main() { int quit=0,DI; char c; Print("IVEIEW 100: 4DO outputs test.\n\r"); while(!quit) { outp(DOUT,0x01); //DO1 ACTIVE Print("DO 1 high \n\r"); Getch(); outp(DOUT,0x02); //DO1 ACTIVE Print("DO 2 high \n\r"); Getch(); outp(DOUT,0x04); //DO1 ACTIVE Print("DO 3 high \n\r "); Getch(); outp(DOUT,0x08); //DO1 ACTIVE Print("DO 4 high \n\r"); c=Getch(); if( c=='q') quit=1; } }