Experts Exchange connects you with the people and services you need so you can get back to work.
Function Bit8(l As Long) As Boolean
If l And 128 Then
Bit8 = True
Open in new window
dim CRC as bytedim CRCDATA as bytedim CRCbit0 as bytedim CRCDATAbit0 as bytedim I as bytedim TestBit as byteCRC=0CRCDATA=40 'inputFor I = 0 to 7 ' Do for all 8 bits in data byte CRCBit0 = Bitwise.BitAnd( CRC, &b1 ) CRCDATAbit0=Bitwise.BitAnd( CRCDATA, &b1 ) TestBit = Bitwise.BitXor( CRCBit0, CRCDataBit0 )' XOR bit0 of data byte and crc CRCData = Bitwise.ShiftRight( CRCData, 1 ) ' Position data byte for next bit test If TestBit = 0 then goto Shift ' If test bit not set, just shift CRC CRC = Bitwise.BitXor( CRC, 24 ) ' If set, account for EXOR feedback $18=24dec Shift: ' Shift right the CRC byte CRC = Bitwise.ShiftRight( CRC, 1 ) ' CRC bit 0 to bit bucket if TestBit=1 then CRC = Bitwise.BitOr( CRC,128) END IFNext I Test bit rotates into CRC bit 7Next I
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $95.20.
Premium members get this course for $168.80.
Premium members get this course for $349.00.
Premium members get this course for $159.20.
Premium members get this course for $37.50.
Premium members get this course for $62.50.