5.1.103. Signal validate (put_SignalValidate)

Validate and scale received CAN signal values.

5.1.103.1. Supported targets

All targets

5.1.103.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.103.3. Description

The signal validate block performs validation checks on a supplied input value (usually from a received CAN message). It checks for the input data being unavailable or in error, applies a linear transfer function, performs clipping, then casts the output to a user selected type.

It is common to find a CAN specification that designates values for CAN signals as in error or unavailable. Although not always the case, typically the highest values are used (e.g., in an unsigned 8 bit quantity that can range from 0 to 255, typically 254 and 255 signify that the signal is unavailable or in error). This block directly supports this concept.

Minimum and maximum limits (in engineering units) are also defined for each CAN signal, and received data outside those limits typically indicates an error (in transmitting module behaviour, or CAN communications). This block directly supports checking for out of range engineering values.

And while many quantities are transmitted in integer format that corresponds to the value in engineering units, many other fields have scale and offset values. This block directly supports converting the scaled integer value to an engineering value as:

engineering_value = (Scale factor * u) + Offset value

When an error is detected, if the block has previously output a valid value, it will continue to output the previous valid value while the error condition persists for a number of delayed cycles, after which, if the error persists, the default value is output.

5.1.103.4. Inports

5.1.103.5. Outports

  • y

    The clean output value after validation.

  • invalid_flag

    0 if the outport y_invalid_code is 0; 1 otherwise.

    Range: 0 or 1

  • y_invalid_code

    A value indicating the manner in which the input is invalid (see below for a table of error codes).

    Range: [0, 8]

5.1.103.6. Mask parameters

  • Error value

    The value which indicates the input is in error. It is internally converted to int32 data type.

    Range: [-2147483647, 2147483647]

  • Unavailable value

    The value which indicates the input is unavailable. It is internally converted to int32 data type.

    Range: [-2147483647, 2147483647]

  • Minimum value

    The smallest post-scaling value that is valid.

  • Maximum value

    The largest post-scaling value that is valid.

  • Default value

    The value to be substituted if necessary.

  • Scale factor

    Conversion factor from integer to engineering units. A value of 1 should be used if no scaling is required.

  • Offset value

    Offset value to convert from integer to engineering units, in engineering units. A value of 0 should be used if no offset is required.

  • Error delay cycles

    An integer number of block executions; the number of cycles before any error condition is output. May be zero, in which case error conditions are output immediately the block executes.

    Range: [0, 65535]

  • Output type

    A drop down of possible types for outport y.

5.1.103.7. Notes

  • The possible error codes are enumerated as:

    Table 5.8. CAN signal validate error codes.

    u_invalid_codey_invalid_codeDescription
    80The block implements both conversion of the input scaled integer value to an engineering value and clipping of the result, according to the mask parameters setting.
    84The block implements conversion of the input scaled integer value to an engineering value. The output has been clipped to the maximum value detailed in the block mask.
    83The block implements conversion of the input scaled integer value to an engineering value. The output has been clipped to the minimum value detailed in the block mask.
    82The output value is set to mask default value because the input value is equal to mask unavailable value.
    81The output value is set to mask default value because the input value is equal to mask error value.
    5, 6, 7equal to u_invalid_codeThe output value is set to mask default value because of the input invalid code.
    <5 or >82The output value is set to mask default value because of the input invalid code.