<< Click to Display Table of Contents >> Navigation: »No topics above this level« CRC Plug-in |
CanEasy provides functionality for sequence counter and CRC calculation via the user plug-in CRCPlg.plu.
The CRC plug-in can be configured via database attributes.
Database attributes can be set automatically when importing a CanEasy configuration; additionally, they can be created via the COM interface of CanEasy.
Name |
Type |
Description |
CanEasy_CRC |
Byte |
If a signal carries this attribute with a value of 1, CRC calculation for the message data is active and the result is stored in this signal. Alternatively, the attribute FuncType can be set accordingly. |
CanEasy_CRC_DID |
Byte |
A constant used for CRC calculation; value range 0-255. |
CanEasy_CRC_Start |
Byte |
By default, CRC is calculated over the entire DLC of the message. For an example DLC of 8, if you want to skip the first and last bytes, set start = 1 and stop = 6 (counting from 0). |
CanEasy_CRC_Stop |
Byte |
|
CanEasy_CRC_Table |
String |
If a CRC table is used, it must be encrypted. |
CanEasy_CRC_Generator |
Byte |
Instead of the CRC table also a polynomial can be used. Internally, the table is generated from the polynomial in this case. Frequently used is the polynomial 0x2F. Note: The attribute can be set for each signal individually or for the whole database. |
CanEasy_CRC_ID |
Bool |
If message ID is to be included into CRC calculation, the attribute must be set to a value of 1. |
CanEasy_CRC_StartVal |
Byte |
Initial value with which the CRC calculation is started. If not specified, 0xFF is used. |
CanEasy_CRC_FFZero |
Bool |
If the flag is set, a calculated CRC 0 is replaced with 0xFF. |
CanEasy_CRC_UseId |
Bool |
If the flag is set, the message ID is calculated into the CRC. |
CanEasy_CRC_Prefix |
Byte-Array |
Usually 2 bytes that are included in the CRC calculation. |
CanEasy_SQC |
Byte |
If a signal carries this attribute with a value of 1, it is incremented each time you send the message. Alternatively, the attribute FuncType can be set accordingly. |
CanEasy_SQC_Start |
Byte |
By default, the sequence counter runs over the complete range of the signal. For example, if you want to count only from 5-9, set Start=5 and Stop=9. Note: If you invert start and stop, the sequence counter is decremented. |
CanEasy_SQC_Stop |
Byte |
|
CanEasy_SQC_Table |
String |
If the sequence counter has its own table for CRC calculation, the table must be encrypted. Note: The attribute can be set for each signal individually or for the whole database. |
Set a new table for CRC or SQC
With the name extension "New" an unencrypted table can be stored. This is automatically encrypted at simulation start and saved via the attribute CanEasy_CRC_Table or CanEasy_SQC_Table.
CRC Calculation
•For CRC calculation, an XOR (exclusive OR) is calculated over the entire message DLC.
•The CRC signal must be 8 bits long and is skipped during calculation.
•If a CRC table is used, the current CRC value is used as table index.
•If configured, additional attributes (such as the message ID or constant) are included in the XOR.
Error tests - calculating an invalid CRC
For error tests it may be necessary to calculate an invalid CRC.
This function can be activated via the context menu of a message.
See: Functions -> Checksum -> Invalid
State |
Description |
Active |
Checksum is calculated correctly |
Deactivated |
The checksum is no longer calculated |
Invalid |
An invalid checksum will be calculated |
Deactivating the sequence counter is also possible via the context menu.
Context menu
Name |
Description |
Make report |
Use the context menu of the CRC plug-in to display an overview of all deactivated messages in the report window. |
Reset errors |
Resets all invalid or deactivated CRC and SQC signals |
Total CRC errors |
Show the current count of detected CRC errors |
Total SQC errors |
Show the current count of detected SQC errors |
Reset error counters |
Resets the error counters |
Check received messages |
Is not active by default. Active this setting to analyze the CRC and SQC of received messages. |