Purpose

Creates a signal conversion object in memory. Format

mcTypeStatus mcConversionCreate(
mcTypeTaskRef ECURefNum,
char *ConversionName,
f64 Factor,
f64 Offset,
char *Unit);

Input

ECURefNum

ECURefNum is the task reference that links to the selected ECU. This reference is originally returned from mcECUCreate.

ConversionName

ConversionName identifies the conversion object that handles measurement scaling. Use this name as a reference in mcMeasurementCreate.

Factor

Factor configures the scaling factor used to convert raw measurement data in the message to/from scaled floating-point units. The factor is the A in the linear scaling formula AX+B, where X is the raw data, and B is the scaling offset.

Offset

Offset configures the scaling offset used to convert raw data in the measurement message to/from scaled floating-point units. The scaling offset is the B in the linear scaling formula AX+B, where X is the raw data, and A is the scaling factor.

Unit

Configures the measurement channel unit string. You can use this value to display units (such as volts or RPM) along with the channel samples. Output

Return Value

The return value indicates the status of the function call as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.

Use the function of the ECU M&C API to obtain a descriptive string for the return value.

Description

Use mcConversionCreate to create a conversion object in memory instead of referring to measurement properties defined in the A2L database.