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
”7188xc.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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
132
Summary of Contents for I-7188XC Series
Page 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Page 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Page 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Page 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...