MC Calc Checksum.vi

ECU Measurement and Calibration Toolkit Help

Edition Date: October 2018

Part Number: 371602T-01

»View Product Info
Download Help (Windows Only)

Purpose

Calculates the checksum of a data block in memory.

Format

diagram

Input

long unsigned integer ECU ref in is the task reference which links to the selected ECU. This reference is originally returned from MC ECU Open.vi or MC ECU Select.vi, and then wired through subsequent VIs.
1D array Data is a byte array over which the checksum calculation is performed.
byte unsigned integer Type of checksum specifies the kind of checksum which is calculated.
cluster Error in is a cluster which describes error conditions occurring before the VI executes. If an error has already occurred, the VI returns the value of the error in cluster to error out.
boolean status is TRUE if an error occurred. This VI is not executed when status is TRUE.
long unsigned integer code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
string source identifies the VI where the error occurred.

Output

long unsigned integer ECU ref out is the same as ECU ref in. Wire the task reference to subsequent VIs for this task.
long unsigned integer Checksum is the calculated checksum.
cluster Error out describes error conditions. If the Error in cluster indicated an error, the Error out cluster contains the same information. Otherwise, Error out describes the error status of this VI.
boolean status is TRUE if an error occurred.
long signed integer code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
string source identifies the VI where the error occurred.

Description

MC Calc Checksum.vi implements a checksum calculation over a given data block. The checksum algorithm is performed by the ECU M&C toolkit using a predefined algorithm (XCP only) or over a dedicated checksum function provided by a specific DLL. The Checksum DLL is defined in the A2L data base and can be changed by the application by the MC Set Property.vi using the Checksum DLL Name property.

If you are using the CCP protocol, type of checksum must always be set to 0xFF, as CCP supports an external checksum DLL only. If using XCP, the following values for type of checksum are defined in the XCP specification:

TypeNameDescription
0x01XCP_ADD_11Add BYTE into a BYTE checksum, ignore overflows
0x02XCP_ADD_12Add BYTE into a WORD checksum, ignore overflows
0x03XCP_ADD_14Add BYTE into a DWORD checksum, ignore overflows
0x04XCP_ADD_22Add WORD into a WORD checksum, ignore overflows, blocksize must be modulo 2
0x05XCP_ADD_24Add WORD into a DWORD checksum, ignore overflows, blocksize must be modulo 2
0x06XCP_ADD_44Add DWORD into DWORD, ignore overflows, blocksize must be modulo 4
0x07XCP_CRC_16See CRC error detection algorithms
0x08XCP_CRC_16_CITTSee CRC error detection algorithms
0x09XCP_CRC_32See CRC error detection algorithms
0xFFXCP_USER_DEFINEDUser defined algorithm, in externally calculated function

For a detailed description of the checksum algorithm, refer to the MC Build Checksum.vi or the XCP Part 2 Protocol Layer Specification.

For more detailed information about CRC algorithms, refer to the following site:

http://www.repairfaq.org/filipg/LINK/F_crc_v34.html

WAS THIS ARTICLE HELPFUL?

Not Helpful