嗨,Hima,
我检查只是为了确保,但选择的选项是基本求和,这是我准备我的数据包。我相当肯定,求和使用了两个补码,其中LSB首先被发送,MSB被发送到第二个。问题可能在我的LSB和MSB中,但我几乎可以肯定,发送的是正确的值。下面是VisualStudio中的第一个包以及错误包的构建,希望这能为问题提供更多的启发。
字节[]分组=新字节[7 ];
包[ 0 ]=0x01;/ /开始
分组〔1〕=0x38;/ /命令码
分组〔2〕=0x00;/ /长度LSB
分组〔3〕=0x00;/ /长度MSB
分组〔4〕=0x0C;/ /校验和LSB
分组〔5〕=0x07;//校验和MSB
包[ 6 ]=0x17;/ /结束
响应包
1 8 0 0 0 247 255 23
-谢谢
亚当
以上来自于百度翻译
以下为原文
Hi Hima,
I checked just to make sure but the option that is selected is the basic summation, which is what I prepared my packets for. I'm fairly certain that summation uses two's complement where the LSB is sent first and the MSB is sent second. The issue might be in my LSB and MSB but i'm almost certain that what is being sent are the correct values. Below is the construction of the first packet in Visual Studio along with the error packet, hope this sheds some more light on the issue.
byte[] packet = new byte[7];
packet[0] = 0x01; // start
packet[1] = 0x38; // command code
packet[2] = 0x00; // Length LSB
packet[3] = 0x00; // Length MSB
packet[4] = 0x0C; // Checksum LSB
packet[5] = 0x07; // Checksum MSB
packet[6] = 0x17; // End
Response packet
1 8 0 0 247 255 23
-Thanks
Adam
嗨,Hima,
我检查只是为了确保,但选择的选项是基本求和,这是我准备我的数据包。我相当肯定,求和使用了两个补码,其中LSB首先被发送,MSB被发送到第二个。问题可能在我的LSB和MSB中,但我几乎可以肯定,发送的是正确的值。下面是VisualStudio中的第一个包以及错误包的构建,希望这能为问题提供更多的启发。
字节[]分组=新字节[7 ];
包[ 0 ]=0x01;/ /开始
分组〔1〕=0x38;/ /命令码
分组〔2〕=0x00;/ /长度LSB
分组〔3〕=0x00;/ /长度MSB
分组〔4〕=0x0C;/ /校验和LSB
分组〔5〕=0x07;//校验和MSB
包[ 6 ]=0x17;/ /结束
响应包
1 8 0 0 0 247 255 23
-谢谢
亚当
以上来自于百度翻译
以下为原文
Hi Hima,
I checked just to make sure but the option that is selected is the basic summation, which is what I prepared my packets for. I'm fairly certain that summation uses two's complement where the LSB is sent first and the MSB is sent second. The issue might be in my LSB and MSB but i'm almost certain that what is being sent are the correct values. Below is the construction of the first packet in Visual Studio along with the error packet, hope this sheds some more light on the issue.
byte[] packet = new byte[7];
packet[0] = 0x01; // start
packet[1] = 0x38; // command code
packet[2] = 0x00; // Length LSB
packet[3] = 0x00; // Length MSB
packet[4] = 0x0C; // Checksum LSB
packet[5] = 0x07; // Checksum MSB
packet[6] = 0x17; // End
Response packet
1 8 0 0 247 255 23
-Thanks
Adam
举报