1

I am reading about the Data-Conversion in Autosar(RTE). I understood using comp-method we can fetch the offset and factor values.

<COMPU-METHOD>
<SHORT-NAME>linear</SHORT-NAME>
<CATEGORY>LINEAR</CATEGORY>
<UNIT-REF DEST="UNIT">kmh</UNIT-REF>
<COMPU-INTERNAL-TO-PHYS>
<COMPU-SCALES>
<COMPU-SCALE>
<COMPU-RATIONAL-COEFFS>
<COMPU-NUMERATOR>
<V>30</V>
<V>2</V>
</COMPU-NUMERATOR>
<COMPU-DENOMINATOR>
<V>1</V>
</COMPU-DENOMINATOR>
</COMPU-RATIONAL-COEFFS>
</COMPU-SCALE>
</COMPU-SCALES>
</COMPU-INTERNAL-TO-PHYS>
</COMPU-METHOD>

In the above example, the formula will be

F = 30 + 2 * x

But I am not able to understand Compumethod of category SCALE_LINEAR_AND_TEXTTABLE or TEXTTABLE.

<COMPU-METHOD>
<SHORT-NAME>linearAndTexttable</SHORT-NAME>
<CATEGORY>SCALE_LINEAR_AND_TEXTTABLE</CATEGORY>
<UNIT-REF DEST="UNIT">kmh</UNIT-REF>
<COMPU-INTERNAL-TO-PHYS>
<COMPU-SCALES>
<COMPU-SCALE>
<LOWER-LIMIT INTERVAL-TYPE="CLOSED">0</LOWER-LIMIT>
<UPPER-LIMIT INTERVAL-TYPE="CLOSED">300</UPPER-LIMIT>
<COMPU-RATIONAL-COEFFS>
<COMPU-NUMERATOR>
<V>30</V>
<V>2</V>
</COMPU-NUMERATOR>
<COMPU-DENOMINATOR>
<V>1</V>
</COMPU-DENOMINATOR>
</COMPU-RATIONAL-COEFFS>
</COMPU-SCALE>
<COMPU-SCALE>
<LOWER-LIMIT INTERVAL-TYPE="CLOSED">350</LOWER-LIMIT>
<UPPER-LIMIT INTERVAL-TYPE="CLOSED">350</UPPER-LIMIT>
<COMPU-CONST>
<VT>SensorError</VT>
</COMPU-CONST>
</COMPU-SCALE>
<COMPU-SCALE>
<LOWER-LIMIT INTERVAL-TYPE="CLOSED">351</LOWER-LIMIT>
<UPPER-LIMIT INTERVAL-TYPE="CLOSED">351</UPPER-LIMIT>
<COMPU-CONST>
<VT>SignalNotAvailable</VT>
</COMPU-CONST>
</COMPU-SCALE>
</COMPU-SCALES>
</COMPU-INTERNAL-TO-PHYS>
</COMPU-METHOD>

In the above example, I can get the factor and offset values. But what about the Upper and Lower limit values of each compu-scales.We need to use these values also in the formula or these values just used to generate the enumeration macros in ApplicationTypes header file?

goodman
  • 424
  • 8
  • 24

1 Answers1

3

The upper and lower values of the texttable part are required for the generation of enumeration macros, they do not contribute to the linear part.

Uwe Honekamp
  • 2,478
  • 1
  • 17
  • 15
  • Thanks for your response. I have one query, In TPS Software Component Template there is one concept namedTextTableMapping.Which Defines the mapping of two DataPrototypes typed by AutosarDataTypes that refer to CompuMethods of category TEXTTABLE, SCALE_LINEAR_AND_TEXTTABLE.In this, we have TextTableValuePair where we can give the first value and the second value of data prototypes. This values we need to use for data conversion of type TEXTTABLE? – goodman Jun 12 '19 at 05:34
  • Yes, this way you can define how one value at the sending end transforms into another value at the receiving end. – Uwe Honekamp Jun 12 '19 at 05:37
  • Ok..It is applicable for composite datatypes also?. Because for the composite datatype, how can we give text table value pairs to each subelement in the datatype? – goodman Jun 12 '19 at 05:40
  • The InstanceRef takes care of that. – Uwe Honekamp Jun 12 '19 at 06:09