This is the web edition of the original ⮫ AC500-S safety user manual, version 1.3.2. This web edition is provided for quick reference only. The original safety user manual must be used to meet functional safety application requirements. |
The SF_CRC_INIT function initializes the CRC calculation table and does further settings for the used safety communication CRC calculation identified via input CRC_SLOT.
This function shall only be called once per safety communication and related CRC slot because:
-
Internal tables are created for optimized runtime calculation which needs processing time.
-
Further calls (after successful configuration) return FALSE and re-configuration is rejected because the former successful initialization remains unchanged, as designed.
The function SF_CRC_INIT must be called for each used safety communication identified via CRC_SLOT input.

Name |
Data type |
Initial value |
Description, parameter values |
---|---|---|---|
VAR_INPUT |
|||
CRC_SLOT |
BYTE |
0 |
Identifies the CRC for the given safety communication with related CRC slot value for which the CRC initialization is configured. Allowed values: 0..7 |
BITS |
BYTE |
0 |
Defines the CRC bit size to be used (depending on degree of the used polynomial). Allowed values: 8 … 32 |
START_VALUE |
DWORD |
16#00000000 |
Defines the start value for CRC calculation. It depends on the safety communication protocol specification. All values are allowed. |
POLYNOM |
DWORD |
16#00000000 |
CRC polynomial (represented by the hexadecimal value of the given CRC equation). All values except 0 are allowed. 0 value leads to SAFE STOP of the safety CPU if SF_CRC_FINISH function is called afterwards. |
REFLECT_IN |
BOOL |
FALSE |
Defines if input data shall be rotated bitwise or not. FALSE: No bitwise rotation TRUE: Bitwise rotation |
REFLECT_OUT |
BOOL |
FALSE |
Defines if CRC value shall be rotated bitwise or not FALSE: No bitwise rotation TRUE: Bitwise rotation |
XOR_OUT |
DWORD |
16#00000000 |
Defines the operand for bitwise XOR operation with the CRC value, which is later delivered at the output using SF_CRC_FINISH function. All values are allowed. |
VAR_OUTPUT |
|||
SF_CRC_INIT |
BOOL |
TRUE |
Result of CRC calculation initialization for safety communication and related CRC slot. TRUE: CRC calculation initialization is successful. FALSE: Error in CRC calculation initialization. Possible reasons:
|
Call in ST
SF_CRC_INIT_Slot1 := SF_CRC_INIT(CRC_SLOT1, BITS_SLOT1, START_VALUE_SLOT1, POLYNOM_SLOT1, REFLECT_IN_SLOT1, REFLECT_OUT_SLOT1, XOR_OUT_SLOT1);