/* This demo program is for 7K and 87K module general function. 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: 87K_demo.c ..\Lib\(7188xa/b/c.lib,8000.Lib, 8000E.lib) Hardware: 7188/8000 <== COM port ==> 7K or 87K modelue [24 May,2005] by Bill [30,Jan,2007] by Liam [July,13,2011] by Nicholas */ #include "..\..\lib\7188e.h" /* === English comments ========================================== This demo program is for all functions of 7k and 87K I/O modules . Users can refer the demo to excute every commands list in 7k and 87K I/O module's document. For example: $AAM, #AA, @AA, @AA6... etc. If users wants to use AI,AO,DI,DO,DIO, we have prepared several demos. Uers can copy the code from these demos then paste to their own program. */ void main() { unsigned char InBuf[20]; InitLib(); //Step 1: InstallCom_2(115200L,8,0,0); //(Baudrate,Data bit,Parity bit,Stop bit) //Step 2: SendCmdTo7000(2,"$01M",0); /* COM2, Command="$AAM" which AA=01,Checksum=disabled For example: command="$01M" ===> Gets module name at address 01. For detailed command sets,refer to CD:\Napdos\DCON\IO_Module\hw_dcon_on_87kUnit or CD:\Napdos\7000\Manual\ */ //Step 3: ReceiveResponseFrom7000_ms(2,InBuf,100,0); /* COM2, Put received data to InBuf Timeout=100 ms Checksum=disabled */ //Step 4: Print("InBuf=%s",InBuf); //Step 5: RestoreCom2(); }