hier der dazugehörige orginaltext:
aufbau vom protokoll des anzusprächenden gerätes, und angaben zur checksum
Checksum calculation
Aufbau des ProtokolsThe algorithm to compute the checksum to validate the RS485 transmission is the CRC polynomial
standardized by CCITT:
Bn=N^16+N^12+N^5+Bn-1
Where N^16 means that N is elevated to the sixteenth power of 2 (i.e. it is shifted left of 16 bit)
and where the symbol ‘+’ represents the XOR bit by bit.
Practically, if New is the byte to process , Tmp is a swap byte and BccLo and BccHi are the low
and high parts of the validation word, the following algorithm must be followed:
A. Initialize BccLo=0xFF, BccHi=0xFF
B. For each byte to transmit or receive repeat the following steps:
1. New = New XOR BccLo
2. Tmp=New << 4
3. New=Tmp XOR New
4. Tmp=New >> 5
5. BccLo=BccHi
6. BccHi= New XOR Tmp
7. Tmp= New << 3
8. BccLo= BccLo XOR Tmp
9. Tmp= New >> 4
10. BccLo= BccLo Xor Tmp
C. Negate bit by bit BccLo e BccHi : CRC_L=~BccLo CRC_H=~BccHi
schon mal danke, für deine müheThe communication protocol uses commands of fixed length (8Byte + 2Byte for Checksum)
structured as follows:
Address Command Par.1 Par.2 Par.3 Par.4 Par.5 Par.6 CRC_L CRC_H
The structure of the answer is also with fixed length (6 Byte + 2 Byte for Checksum) :
Transmission State Module State Par.1 Par.2 Par.3 Par.4 CRC_L CRC_H
Lesezeichen