以下为16进制数:68 1B 1B 68 2 0 6C 32 1 0 0 0 0 0 E 0 0 4 1 12 A 10 2 0 1 0 1 84 0 3 20 8B 16

问题描述:

以下为16进制数:68 1B 1B 68 2 0 6C 32 1 0 0 0 0 0 E 0 0 4 1 12 A 10 2 0 1 0 1 84 0 3 20 8B 16
其中8B为:
(4-30之和)%0x100
请问是怎么算的,我算过和加起来取余不等于8B
这是S7-200串口通信问题.

(数组下标4 到下标30 元素之和)%0x100
#include
void main()
{
int i;
int s=0;
int x[] ={
0x68, 0x1B,0x1B ,0x68 ,0x2 ,0x0 ,0x6C ,0x32 ,
0x1 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0xE ,0x0 ,
0x0 ,0x4 ,0x1 ,0x12 ,0xA ,0x10 ,0x2 ,0x0,
0x1 ,0x0 ,0x1 ,0x84 ,0x0 ,0x3 ,0x20 ,0x8B ,0x16};
for (i=4;i