/* DIO.c : Write DO and read DI.(text file)(advanced) Compiler: BC++ 3.1, Turbo C ++ 1.01(3.01) (free from http://community.borland.com/museum) MSC 6.0, MSVC 1.52. Compile mode: large Project: DIO.c ..\Lib\(8000E.Lib,7188XAL.Lib,7188XBL.Lib,7188XL.Lib or 7188EL.Lib) Hardware: 7188/8000 [24 May,2005] by Bill */ #include"..\lib\7188Xa.h" void ShowDI(void); void SetDo(int Do1,int Do2); void main() { InitLib(); SetDo(1,1); //DO1 ON, DO2 ON ShowDI(); Getch(); SetDo(1,0); //DO1 ON, DO2 ON ShowDI(); Getch(); SetDo(0,1); //DO1 ON, DO2 OFF ShowDI(); Getch(); SetDo(0,0); //DO1 ON, DO2 OFF ShowDI(); Getch(); } void ShowDI(void) { Print("\n\r-->\n\r"); Print("DI1=%s\n\r",GetDi1()?"High":"Low"); Print("DI2=%s\n\r",GetDi2()?"High":"Low"); Print("Press any key to continue..."); } void SetDo(int Do1,int Do2) { Print("\n\rSet DO1 to %s",Do1?"High":"Low"); if(Do1) { SetDo1On(); } else { SetDo1Off(); } Print("\n\rSet DO2 to %s",Do2?"High":"Low"); if(Do2) { SetDo2On(); } else { SetDo2Off(); } }