It is recommended to get acquainted with the improved version of the TXD_CRC function.
Function performs checksum calculation (Type setting) over TXD buffer, starting from index
to (index + size - 1)
. The calculated checksum is compared with the value stored in the TXD buffer at position index value_index
.
Function menu | Block diagram |
---|---|
![]() |
![]() |
Name | Type | Description |
---|---|---|
enable |
bool | If True, then the function calculates the checksum |
index |
int32 | Position in the TXD 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 TXD buffer against which the calculated checksum will be compared |
Not available
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.