It is recommended to get acquainted with the improved version of the RXD_CRC function.
Function performs checksum calculation (Type setting) over RXD buffer starting from index
to (index + size - 1)
. The calculated checksum is compared with the value stored in the RXD buffer at position index value_index
.
The result of the comparison is passed to the valid
output.
Function menu | Block diagram |
---|---|
![]() |
![]() |
Name | Type | Description |
---|---|---|
index |
int32 | Position in the RXD buffer from which the checksum is calculated |
size |
int32 | Length of data array for checksum calculation |
value_index |
int32 | Position of the value in the RXD buffer against which the calculated checksum will be compared |
Name | Type | Description |
---|---|---|
valid |
bool | Result of the checksum verification. If True, then the calculated checksum value matches the value in the RXD buffer located at the value_index index. |
Name | Description |
---|---|
Type | Checksum calculation algorithm: CRC-16 (Modbus) - Standard CRC-16 Modbus algorithm. CRC-8 (Maxim/Dallas) - Standard Maxim/Dallas CRC-8 algorithm. XOR (8 bits) - Sequential XOR operation. Sum (8 bits) - Sequential addition of elements. |
Byte Order | Only if Type = CRC-16 (Modbus) Byte order, for further checksum conversions (for example, we assume that the calculated value = 0x0201 ):Little-endian - Then 0x0102 value will be used.Big-endian - Then 0x0201 value will be used. |
Invert | If the flag is set, then the value will be bit-wise inverted before the next operation. For example, if it was 0x0201 , then it will be 0xFDFE . |
Add 1 | If the flag is set, then the value will be incremented by 1 before being written to the buffer.For example, if it was 0x0201 , then it will be 0x0202 . |
Byte order, Invert, Add 1 operations are performed after the checksum calculation in turn in enumerated order and affect the final value used in the comparison.