RX-64
PARAMETER0…N
Parameter is used when Instruction requires ancillary data. For the usage of parameters,
refer to “3-5 How to Use Packet”
CHECK SUM
It is used to check if packet is damaged during communication. Check Sum is calculated
according to the following formula.
Check Sum = ~ ( ID + Instr Para … Parameter N )
Where, “~” is the Not Bit operator.
When the calculation result of the parenthesis in the above formula is larger than 255
(0xFF), use only lower bytes.
For example, when you want to use Instruction Packet like the below
ID=1 (0x01),
Length= 5 (0x05),
Instruction= 3 (0x03),
Parameter1= 12 (0x0C), Parameter2= 100 (0x64),
Parameter3= 170 (0xAA)
Check Sum = ~ ( ID + Instr Para … Parameter 3 )
= ~ [ 0x01 + 0x05 + 0x03 + 0x0C + 0x64 + 0xAA ]
= ~ [ 0x123 ] // Only the lower byte 0x23 executes the Not operation.
=
0xDD
Thus,
Instruction
Packet
should be 0x01, 0x05, 0x03, 0x0C, 0x64, 0xAA, 0xDD.
17