int port=2; /*to use COM2*/
int i;
char data[ ]=”$01M\r”; /*command to read a module’s name*/
InitLib(); /* Initiate the 7188xc library */
InstallCom(port); /*install the COM2 driver*/
for(i=0; i<5; i++)
ToCom(port, data[i]); /*send a command to the I-7000 module*/
……… /*program code*/
RestoreCom(port); /*uninstall the COM driver*/
In addition to using the
ToCom()
function, the
SendCmdTo7000()
function can also be used to send commands to an I-7000 series
module. The
ReceiveResponseFrom7000()
function can be used to
receive the response from an I-7000 series module.
Functions used to connect to an I-7000 module:
SendCmdTo7000(int iPort, unsigned char *cCmd, int
iChksum);
This function sends a command to an I-7000 series module. If the
checksum is enabled, the function will add 2 bytes checksum to
the end of the command.
ReceiveResponseFrom7000_ms(int iPort, unsigned char
*cCmd, long lTimeout, int iChksum);
After calling the
SendCmdTo7000()
function the
ReceiveResponseFrom7000_ms()
function can be called to
retrieve a response from an I-7000 series module.
Refer to the demo programs in the
CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\7K87K_Module
directory for more detailed information.
Note:
For more I-7000 commands, please refer to the “
user’s manual
for 7000 DIO
”.
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
59
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...