Values can be entered in decimal form or in scientific notation / floating-point
representation.
Shift X Bits
Shift received value to the right by as many bits as defined here. Negative values shift to
the left.
This value is applied after the mask but before offset and scale.
See section mapping calculations for details about how this property applies to receive
and transmit mappings.
Scale
Decimal value to scale the received value before applying it to the mapped variable. Is
applied after mask, shift and offset 1 but before offset 2.
Values can be entered in decimal form or in scientific notation / floating-point
representation.
Offset2
Decimal value applied after all the other calculations are done.
See section mapping calculations for details about how this property applies to receive
and transmit mappings.
Values can be entered in decimal form or in scientific notation / floating-point
representation.
Mapping calculations
The calculations applied to a mapping are defined mainly for receive mappings - in case of
J1939 they can be directly derived from the resolution and offset defined in the standard.
For transmit mappings all calculations are inverted so that the same values can be applied
to receive and transmit mappings.
The formula converting a mapped area of a CAN message into the variable value is as
follows:
variable_value = (((( CAN_value >> shift ) & mask ) + offset1 ) * scale ) +
offset2
Consequently the calculation applied to transmit mappings inverts the above:
CAN_value = (((( variable_value - offset2 ) / scale ) - offset1 ) & mask ) <<
shift
Note: For constants only "shift" and "mask" are applied.
Note: Currently signed/unsigned calculation is performed based on variable definition. If
variable is signed this means the CAN_value is considered negative if the most significant
bit of the mapped area is set. This leads into some issues with J1939 values which are
transmitted unsigned but should be displayed in signed format (as described in example
below).