herrsede Posted April 3, 2020 Report Share Posted April 3, 2020 Hi everyone, i'm new here, i'm working with plc, but i have unitronics usp-104-b10 on my desk up to now.unilogic version: 1.28.34 I need to solve crc checkum rs485 specific protocol of one noname thermostat. I tried it through message composer but it failed.Thermostat works, I tested it with com debug, connection is ok. Checksum definition:checksum = (header + command + id1 + id1 + data0 + data1 + data2 + data3) and FF xor 3C example: # H30 = (# H0B + # H00 + # H01 + # H00 + # H00 + # H00 + # H00 + # H00) & #HFF xor # H3C it should look like this: txBuffer = 0B 00 01 00 00 00 00 00 30do you have any idea how to solve it? Quote Link to comment Share on other sites More sharing options...
bobnorway Posted April 5, 2020 Report Share Posted April 5, 2020 add the values from first byte to the last byte to the sum. (1+2) H0b + H00 = H0b (S+3) H0b + H01 = H0c (S+4) H0c + H00 = H0c (S+5) H0c + H00 = H0c (S+6) H0c + H00 = H0c (S+7) H0c + H00 = H0c (S+8) H0c + H00 = H0c (S+FF) H0c + Hff = H0c mask off values larger than one byte) (S xor 3c) H0c xor H3c = H30 The H3c is probably to ensure that the check sum which is the last byte is not zero Quote Link to comment Share on other sites More sharing options...
herrsede Posted April 5, 2020 Author Report Share Posted April 5, 2020 thanks bob, then it also occurred to me, I did the function. it works. Quote Link to comment Share on other sites More sharing options...
bobnorway Posted April 6, 2020 Report Share Posted April 6, 2020 glad to help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.