1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| crcSnd = DoCRC1(bTemp)
crcSnd1 = Int(crcSnd / 256)
crcSnd2 = crcSnd - (crcSnd1 * 256)
'..................
crcCalc = DoCRC2(bRcv)
crcCalc1 = Int(crcCalc / 256)
crcCalc2 = crcCalc - (crcCalc1 * 256)
'........................
Function DoCRC1(ByVal payLoad As Variant)
On Error Resume Next
CrcCtrl1.CRCType = 3 ' set which algorithm to use - vb pops up valid types!
CrcCtrl1.DoCRCVar payLoad ' do the calculation, without a seed, ie not split up
DoCRC1 = CrcCtrl1.GetCRCDecStr ' display the result in a label
'MsgBox (CrcCtrl1.GetCRCHexStr & CrcCtrl1.GetCRCDecStr)
End Function
Function DoCRC2(ByVal payLoad As Variant)
On Error Resume Next
CrcCtrl2.CRCType = 9 ' set which algorithm to use - vb pops up valid types!
CrcCtrl2.DoCRCVar payLoad ' do the calculation, without a seed, ie not split up
DoCRC2 = CrcCtrl2.GetCRCDecStr ' display the result in a label
End Function |
Partager