i apologize for the change in the code. I was originally intending to use >> 8 to shift it 8 bits over. You are right in that it had a 16-bit char per index in the ReqMsg array.
i googled...
Type: Posts; User: remoir
i apologize for the change in the code. I was originally intending to use >> 8 to shift it 8 bits over. You are right in that it had a 16-bit char per index in the ReqMsg array.
i googled...
er. then can i AND a char ReqMSG with 0x00FF ? i am not sure if this is possible. Would the result be a char ?
i am hoping to do a shift right by 8 bits for ReqMsg[i] which is a char, and then taking that result AND 0x00FF, before finally converting the value to integer. Do i need to change the variable type...
hi,
would this be correct ?
chksum = chksum + (int)(ReqMsg[i] & 0x00FF) + (int) ((ReqMsg[i]>>8) & 0x00FF) ;
Hi all,
i am trying to write a checksum function found in a PLC program.
i have a line as below
chksum = chksum + (ReqMsg[i] & 00FF) + ((floor(ReqMsg[i]/8)) & 00FF) ;
i want to evaluate...