Skip to content

Items description b

<Parsing Definition>

The ParsingDefinition is the actual evaluation of a CAN message. This setting is made for each value depending on the CAN message. This definition allows the specification according to the location of a signal (e.g. Torque) within a CAN message.

ParsingDefinition XML example (click to view)
<ParsingDefinition>
    <BinaryStreamDefinition src="CAN">
      <CanMessage canId="0x100F11FF" canIdLength="29" mask="0x1FFFFFFF" protocolStyle="GENERIC">
        <Values>
          <IntValue startPos="0" length="8" endianness="LITTLE" signed="false" continueOnLastPostion="false">
            <valueDefinition ref="value.common.machine.distance.total"/>
            <transformer ref="transformer.1.0"/>
          </IntValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x12F003F0" canIdLength="29" mask="0x1FFFFFFF" protocolStyle="GENERIC">
        <Values>
          <IntValue startPos="0" length="8" endianness="LITTLE" signed="false" continueOnLastPostion="false">
            <valueDefinition ref="value.common.cu.battery.cyclecount"/>
            <transformer ref="transformer.1.0"/>
          </IntValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x18F00400" canIdLength="29" mask="0x1FFFFFFF" protocolStyle="GENERIC">
        <Values>
          <IntValue startPos="24" length="16" endianness="LITTLE" signed="false" continueOnLastPostion="false">
            <valueDefinition ref="value.common.engine.speed"/>
            <transformer ref="transformer.0_125.0"/>
          </IntValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x1FA" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
        <Values>
          <IntValue startPos="0" length="8" endianness="LITTLE" signed="false" continueOnLastPostion="false">
            <valueDefinition ref="value.common.engine.def.level"/>
            <transformer ref="transformer.1.0"/>
          </IntValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x2A0" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
        <Values>
          <IntValue startPos="8" length="16" endianness="LITTLE" signed="false" continueOnLastPostion="false">
            <valueDefinition ref="value.common.machine.hours.fullload"/>
            <transformer ref="transformer.1.0"/>
          </IntValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x7FA" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
        <Values>
          <SeparatedCharValue charset="US-ASCII" separator="*">
            <CharValue column="0">
              <valueDefinition ref="value.String1"/>
            </CharValue>
            <CharValue column="1">
              <valueDefinition ref="value.String2"/>
            </CharValue>
            <CharValue column="3">
              <valueDefinition ref="value.String3"/>
            </CharValue>
            <CharValue column="4">
              <valueDefinition ref="value.String4"/>
            </CharValue>
          </SeparatedCharValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x100" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
        <Values>
          <SimpleCharValue startPos="0" charset="UTF-8" continueOnLastPostion="false">
            <valueDefinition ref="value.tail"/>
              <length type="CHAR" value="20"/>
          </SimpleCharValue>
        </Values>
      </CanMessage>
      <CanMessage canId="0x123" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
        <Values>
          <DtcValue startPos="7" continueOnLastPostion="false">
            <Spn id="517111"/>
            <Fmi code="33"/>
            <Source address="254"/>
          </DtcValue>
          <DtcValue startPos="6" continueOnLastPostion="false">
            <Spn id="517111"/>
            <Fmi code="34"/>
            <Source address="254"/>
          </DtcValue>
          <DtcValue startPos="5" continueOnLastPostion="false">
            <Spn id="517111"/>
            <Fmi code="35"/>
            <Source address="254"/>
          </DtcValue>
        </Values>
      </CanMessage>
    </BinaryStreamDefinition>
  </ParsingDefinition>

Parsing Definition Specification

Declaration Description
<BinaryStreamDefinition> Indicates the Source of a message.
src Currently only supports CAN.
channel Optional: If channel is not specified, the IDs are evaluated independently of the channel specification. If a channel is specified, then all messages from this channel will be evaluated exclusively in this binary stream definition and no longer in a binary stream definition that has no channel specified. Therefore, it is recommended to always use the channel attribute. Read also the note in J1939 DM1_DM2.
"1" = CAN-Interface 1
"2" = CAN-Interface 2
"3" = Internal logging (Data transmitted by the operation manager)
"4" = CAN3-Interface 3
<CanMessage> Defines which CAN message is evaluated.
canId Specifies the exact identity of the CAN message (e.g.: 11bit → 0x7FF; 29bit → 0x1FFFFFFF).
canIdLength Specifies the length of the CAN-message (11Bit or 29bit).
mask Filter for the ID (e.g. 0x1FFFFFFF only receives exactly the specified ID).
protocolStyle Currently, only supports GENERIC.
ignoreJ1939InvalidData Optional: If this attribute is set to true, the values for the respective signals (which have all bits = 1) are ignored and not stored in the database.
Example: The value of an integer with 8 bits (0b11111111 = 0xFF) is not saved. If this attribute is set to false or is not specified, all values are saved.
allowMissingValues When set to true (i.e. the default, also when the attribute is not set), the actual CAN message is allowed to contain fewer values than configured in PDC - any missing value will be silently skipped. When set to false, an entire CAN message with missing values will be discarded (in order to control a strict CLF parsing).
<Values> Represents the area in which the signals are defined in the message.
<IntValue> Indicates that it is an integer value (also <FloatValue> is possible).

PDC – Value Length Restrictions

When reading CAN message data, the following restrictions apply regarding bit length and bit position:

Supported definitions:
- Bit lengths of 8, 16, 24, or 32 bits, provided they are byte-aligned (startPos = 0, 8, 16, 24, …).
- Bit lengths of 1 to 7 bits, provided the signal is fully located within a single byte (e.g. startPos="5" and length="3").

For these cases, a special startPos must be calculated, see note below for an calculation example.

Unsupported definitions:
- Any startPos / length combinations that span more than one byte but do not occupy all bits of the affected bytes (e.g. startPos="40" and length="12").
startPos Specifies the start position of the signal in the message.
length Specifies the length of the signal in bits. The attribute is optional for SimpleCharValue and if not given all bytes till the end of the stream are read for the value.
endianness Specifies the byte sequence of the signal. Allowed values: LITTLE → LSB first (least significant bit), BIG → MSB first (most significant bit). BIG is the default.
signed Specifies whether the data received is signed. Allowed values: true, false (default).
continueOnLastPostion Defaults to true, which implies that startPos starts from the end of the prior value. MUST be set to false for absolute positioning.
<valueDefinition> Reference to a ValueDefinition defining the signal key used to store the parsing result in DataPlatform.
<Transformer> Reference to transformer definition.
<SeparatedCharValue> Represents the area in which the properties of the string to be saved are defined.
requireAllValuesPresent Optional flag that allows for partial multi-value string matches for the <SeparatedCharValue> node.
charset Defines the character encoding to be used to store the string. Defaults to US-ASCII for SeparatedCharValue and SimpleCharValue
startPos Specifies the position from where the string is to be stored, starting with "0".
separator Defines the separator of the string, the default value is *. The separator makes only sense when the sourceType is ASCII. The values can then be a set of multiple strings separated by the specified separator.
<CharValue> Opens the dropping of a string, taking into account the specified separator, into the variable of the ValueDefinition.
column Defines the column in which the string to be stored is located.
<SimpleCharValue> Represents the area in which the properties of a simple character or string to be saved are defined.
type Defines the type of the char. Possible values are char or byte.
value Defines the length of the char. The default value is 1.
DtcValue This option allows configuration of bit coded DTC messages. Each Bit represents one DTC error. The Source, SPN and FMI will be replaced according to the customer specific DTC labels in chapter J1939 table J1939 Value Specification.

Calculation of startPos for sub-byte signals (1–7 bit)

For signals with a bit length of 1 to 7 bits that are fully located within a single CAN byte, the startPos is calculated using a linear bit index:

startPos = (byteIndex × 8) + bitOffset, where byteIndex is the zero-based index of the byte within the CAN message (first byte = 0) and bitOffset is the zero-based bit position within the byte (LSB = 0, MSB = 7).

Example:

A signal located in byte 1 (second byte), with a bit offset of 2 and a bit length of 2, results in startPos = (1 × 8) + 2 = 10, therefore the corresponding PDC configuration is startPos="10" and length="2".

Special Case: Relaxed Parsing

CAN message values are parsed according to the definition in the PDC. By default values not matching the definition are ignored. The default is different for <SimpleCharValue>. There, if the corresponding part of the CLF message is split on a different number of values than defined in the PDC, then all values are ignored.
In some cases you may want to extract as many values as defined in the PDC. That requires the requireAllValuesPresent flag to be set false on <SeparatedCharValue> node.

Setting the requireAllValuesPresent flag to false for the <SeparatedCharValue> node will read just the available values with the available definition and ignore the missing ones. See the example code snippet below.

 <CanMessage canId="0x7FA" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
        <Values>
          <SeparatedCharValue requireAllValuesPresent="false">
            <CharValue column="0">
              <valueDefinition ref="value.string" />
            </CharValue>
            <CharValue column="1">
              <valueDefinition ref="value.string1.ext" />
            </CharValue>
            <!-- NEW V02.00.00 -->
            <CharValue column="2">
              <valueDefinition ref="value.string2.ext" />
            </CharValue>
            <!-- NEW V02.00.00 -->
            <CharValue column="3">
              <valueDefinition ref="value.string3.ext" />
            </CharValue>
          </SeparatedCharValue>
        </Values>
    </CanMessage>