除包头和自身所有字节异或
数据类型为
Public Type DataType
        Data_Header(2) As Byte '数据包包头
        Data_Size As Byte '数据包包长
        Data_Type(0) As Byte '数据包类型
        Source_ID(7) As Byte '本机ID
        Dest_ID(7) As Byte '目的ID
        DataSendTime(6) As Byte '数据包发送时间
        OtherDataUnit(11) As DataUnit '若干数据(或信息)单元
        Xor_Verify(0) As Byte '校验字节
End Type

解决方案 »

  1.   

    Public Type DataType
            Data_Header(2) As Byte '数据包包头  0x80,0x80,0x80
            Data_Size As Byte '数据包包长  双字节整数
            Data_Type(0) As Byte '数据包类型  压缩bcd码
            Source_ID(7) As Byte '本机ID 压缩bcd码
            Dest_ID(7) As Byte '目的ID 压缩bcd码
            DataSendTime(6) As Byte '数据包发送时间 压缩bcd码
            OtherDataUnit(11) As DataUnit '若干数据(或信息)单元 压缩bcd码
            Xor_Verify(0) As Byte '校验字节 异或校验   除包头外和自身所有字节异或
    End Type
    现在数据包为:
    128 128 128 0 121 0 0 134 16 3 80 9 65 6 0 0 0 0 0 0 0 0 4 6 23 19 53 89 129 0 0 6 0 160 64 0 160 64 0 0 137 0 0 6 0 160 64 0 160 64 0 0 138 0 0 6 0 122 68 0 0 0 0 0 4 0 0 4 6 23 19 53 89 0 0 0 138 17 0 6 0 122 68 0 0 0 0 0 4 17 0 4 6 23 19 53 89 0 0 0 138 1 0 6 0 122 68 0 0 0 0 0 4 1 0 4 6 23 19 53 89 0 0 0 76
      

  2.   

    还有就是
    Public Type JDSDataUnit
            btData(11) As Byte '数据单元
    End TypePublic Type DataType
            Data_Header(2) As Byte '数据包包头
            Data_Size As Byte '数据包包长
            Data_Type(0) As Byte '数据包类型
            Source_ID(7) As Byte '本机ID
            Dest_ID(7) As Byte '目的ID
            DataSendTime(6) As Byte '数据包发送时间
            OtherDataUnit() As DataUnit '若干数据(或信息)单元
            Xor_Verify(0) As Byte '校验字节
    End TypeOtherDataUnit()如何redim,以及如何赋值啊