MC Build 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 a checksum over a defined memory range within the ECU.

Format

checksum

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.
cluster Address is a cluster which contains the following values.
long unsigned integer Address specifies the address part of the source address.
byte unsigned integer Extension contains the extension part of the source address.
long unsigned integer Block size determines the size of the block for which the checksum has to be 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.
byte unsigned integer Type of checksum returns the type of the calculated checksum. If you are using the CCP protocol, type of checksum is 0xFF. For XCP, refer to the Description section.
long unsigned integer Checksum returns 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 Build Checksum.vi is used to calculate the checksum of the specified memory block inside the ECU starting at the selected Memory Transfer Address. The checksum algorithm is not specified by CCP and the checksum algorithm may be different on different devices.

If you are using the CCP protocol, MC Build Checksum.vi implements the CCP BUILD_CHKSUM command. The checksum algorithm is not specified by CCP and the checksum algorithm may be different on different devices.

If you are using the XCP protocol, MC Build Checksum.vi implements the BUILD_CHECKSUM command of the XCP specification. The result of the checksum calculation is returned in Checksum regardless of the checksum type. 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, block size must be modulo 2
0x05XCP_ADD_24Add WORD into a DWORD checksum, ignore overflows, block size must be modulo 2
0x06XCP_ADD_44Add DWORD into DWORD, ignore overflows, block size must be modulo 4
0x07XCP_CRC_16Refer to CRC error detection algorithms
0x08XCP_CRC_16_CITTRefer to CRC error detection algorithms
0x09XCP_CRC_32Refer to CRC error detection algorithms
0xFFXCP_USER_DEFINEDUser defined algorithm in externally calculated function

If type of checksum is returned as 0xFF (XCP_USER_DEFINED), the slave can indicate that the master for calculating the checksum must use a user-defined algorithm implemented in an externally calculated function (for instance, Win32 DLL, UNIX shared object file, etc.). The master gets the name of the external function file to be used for this slave from the ASAM MCD 2MC description file or from a property which can be set.

For a detailed description of the checksum algorithm, refer to the XCP Part 2 Protocol Layer Specification.

WAS THIS ARTICLE HELPFUL?

Not Helpful