Search:

Type: Posts; User: remoir

Search: Search took 0.01 seconds.

  1. Thread: CheckSum help

    by remoir
    Replies
    13
    Views
    3,704

    i apologize for the change in the code. I was...

    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...
  2. Thread: CheckSum help

    by remoir
    Replies
    13
    Views
    3,704

    er. then can i AND a char ReqMSG with 0x00FF ? i...

    er. then can i AND a char ReqMSG with 0x00FF ? i am not sure if this is possible. Would the result be a char ?
  3. Thread: CheckSum help

    by remoir
    Replies
    13
    Views
    3,704

    i am hoping to do a shift right by 8 bits for...

    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...
  4. Thread: CheckSum help

    by remoir
    Replies
    13
    Views
    3,704

    hi, would this be correct ? chksum =...

    hi,

    would this be correct ?

    chksum = chksum + (int)(ReqMsg[i] & 0x00FF) + (int) ((ReqMsg[i]>>8) & 0x00FF) ;
  5. Thread: CheckSum help

    by remoir
    Replies
    13
    Views
    3,704

    CheckSum help

    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...
Results 1 to 5 of 5