Validate and scale received CAN signal values.
None (Main library). (See Section 2.3, “Licensed Features”.)
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.
The raw input value requiring validation.
A code that defines the status of the inport u. The block acts on an error code of 5, 6, 7, or 8 (see Table 5.8, “CAN signal validate error codes.”).
Range: [0, 8]
The clean output value after validation.
0 if the outport y_invalid_code is 0; 1 otherwise.
Range: 0 or 1
A value indicating the manner in which the input is invalid (see below for a table of error codes).
Range: [0, 8]
The value which indicates
the input is in error. It is internally converted to int32
data type.
Range: [-2147483647, 2147483647]
The value which
indicates the input is unavailable. It is internally converted to
int32
data type.
Range: [-2147483647, 2147483647]
The smallest post-scaling value that is valid.
The largest post-scaling value that is valid.
The value to be substituted if necessary.
Conversion factor from integer to engineering units. A value of 1 should be used if no scaling is required.
Offset value to convert from integer to engineering units, in engineering units. A value of 0 should be used if no offset is required.
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]
A drop down of possible types for outport y.
The possible error codes are enumerated as:
Table 5.8. CAN signal validate error codes.
u_invalid_code | y_invalid_code | Description |
---|---|---|
8 | 0 | The 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. |
8 | 4 | The 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. |
8 | 3 | The 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. |
8 | 2 | The output value is set to mask default value because the input value is equal to mask unavailable value. |
8 | 1 | The output value is set to mask default value because the input value is equal to mask error value. |
5, 6, 7 | equal to u_invalid_code | The output value is set to mask default value because of the input invalid code. |
<5 or >8 | 2 | The output value is set to mask default value because of the input invalid code. |