RXD_CRC - improved version of the RXD_CHECKSUM function that allows you to calculate more checksum options.
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 | Algorithm for calculating the checksum. The setting is divided into two parts: On the left is the choice of CRC length: CRC-8 - 1 byte; CRC-16 - 2 bytes; CRC-32 - 4 bytes. On the right is the choice of CRC type for the selected length: Custom - Manual selection of function settings; Other options are presets for the settings below. For a complete list of presets for various CRC types, see CRC Calculation |
Poly | Generating polynomial |
Init | Starting data - register values at the start of calculations |
RefIn | Flag indicating the start and direction of computation must match the order of transmission in the channel to detect bursts of errors. There are two options: False — starting from the most significant bit (MSB-first); True — starting from the less significant bit (LSB-first). |
RefOut | Flag that determines whether the order of the register bits is reversed when entering an element XorOut: False — not inverted; True — inverted. |
XorOut | Bitwise XOR operation is performed between the result and XorOut (see function BXOR) |
Check | CRC check value. The specified value should be obtained by calculating the customized CRC from the byte array:0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39 |
Byte Order | Only if the CRC length is greater than 1 byte. 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. |