char k;
InitLib();
InstallCom(port,115200L,8,0,1); /*install a COM Port for the I-7065D*/
ClearCom(port);
SendCmdTo7000(port, "@0100", 0); /*send a command to DO to off*/
if(ReceiveResponseFrom7000_ms(port,"@0100",20,0))
Print("I-7065D is not available\r\n");
while(!quit){ /*control Do*/
Print("\n\r Enter 1~5 to set [Do] on...'9' to quit\n\r");
k=Getch();
x=ascii_to_hex(k); /*convert ASCII code to hex*/
ClearCom(port);
switch(x){ /*send a command to set the I-7065D Do1~5 light to on*/
case 1: /*for command details, refer to the “I-7000 DIO manual”*/
SendCmdTo7000(port, "@0101", 0);Print("[%x]=ON",x);break;
case 2:
SendCmdTo7000(port, "@0102", 0); Print("[%x]=ON",x);break;
case 3:
SendCmdTo7000(port, "@0104", 0); Print("[%x]=ON",x);break;
case 4:
SendCmdTo7000(port, "@0108", 0); Print("[%x]=ON",x);break;
case 5:
SendCmdTo7000(port, "@0110", 0); Print("[%x]=ON",x);break;
case 9:
quit=1; Print("*quit*");break;
} /*end of switch*/
} /*end of while loop*/
}
ReceiveResponseFrom7000_ms()
Function: Receives a response from the I-7000 module.
Syntax:
int ReceiveResponseFrom7000_ms(int iPort,
unsigned char *cCmd, long lTimeout, int iChksum);
Header: #include
”7188xb.h”
Description: After calling the SendCmdTo7000() function, the
ReceiveResponseFrom7000_ms() function must be
called except for commands that do not require a
response.
iPort: 1 for COM1, 2 for COM2, etc.
cCmd: The response received from the I-7000 module. If
checksum is enabled, the function will check and
I-7188XB Series User’s Manual(Ver.1.0, Apr/2007,
7MH-020-10
) ---
134
Содержание I-7188XB Series
Страница 88: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 88...
Страница 138: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 138...
Страница 144: ...Step 8 Make the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 144...
Страница 151: ...Step 8 Rebuild the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 151...