
- 32 -
www.hzgrow.com
Other instructions
To generate a random code
GetRandomCode
Description: to command the Module to generate a random number and return it to upper computer;
Input Parameter: none
Return Parameter: Confirmation code (1 byte)+RandomCode
Instruction code: 14H
Command (or instruction) package format:
2 bytes
4bytes
1 byte
2 bytes
1 byte
2 bytes
Header
Module
address
Package
identifier
Package length
Instruction
code
Checksum
0xEF01
xxxx
01H
03H
14H
0018H
Acknowledge package format:
2 bytes
4bytes
1 byte
2 bytes
1 byte
4 bytes
2 bytes
Header
Module
address
Package
identifier
Package
length
Confirmation
code
Random
number
Checksum
0xEF01
xxxx
07H
07H
xxH
RandomC
ode
sum
Note: Confirmation code=00H: generation success;
Confirmation code=01H: error when receiving package;
To read information page
ReadInfPage
Description: read information page(512bytes)
Input Parameter: none
Return Parameter: Confirmation code (1 byte)
Instruction code: 16H
Command (or instruction) package format:
2 bytes
4bytes
1 byte
2 bytes
1 byte
2 bytes
Header
Module
address
Package
identifier
Package length
Instruction
code
Checksum
0xEF01
xxxx
01H
03H
16H
sum
Acknowledge package format:
2 bytes
4bytes
1 byte
2 bytes
1 byte
2 bytes
Header
Module
address
Package
identifier
Package
length
Confirmation
code
Checksum
0xEF01
xxxx
07H
03H
xxH
sum
Note 1: Confirmation code=00H: ready to transfer the following data packet;
Confirmation code=01H: error when receiving package;
Confirmation code=0fH: can not transfer the following data packet;
2. The upper computer sends the command packet, the module sends the acknowledge
packet first, and then sends several data packet.