MHD Logging: Difference between revisions

From B58 Wiki
(Created page with "MHD's logger has a useful feature which allows you to add custom logging parameters, which we explain below. You use this feature, you need the a2l file for your DME (see Resources for getting started). The basic process is as follows * Create a <prg>_UserChannels.xml file where <prg> is the value of ''Current PRG (hex)'' as shown by MHD flasher when you list the DME software versions. * The file follows a...")
 
No edit summary
Line 1: Line 1:
MHD's logger has a useful feature which allows you to add custom logging parameters, which we explain below.
MHD's logger has a useful feature which allows you to add custom logging parameters, which we explain below.


You use this feature, you need the a2l file for your DME (see [[Useful_resources_for_getting_started#A2L_file_for_your_car|Resources for getting started]]).
To use this feature, you need the a2l file for your DME (see [[Useful_resources_for_getting_started#A2L_file_for_your_car|Resources for getting started]]).


The basic process is as follows
The basic process is as follows
* Create a <prg>_UserChannels.xml file where <prg> is the value of ''Current PRG (hex)'' as shown by MHD flasher when you list the DME software versions.
* Create a ''$prg_UserChannels.xml'' file where ''$prg'' is the value of ''Current PRG (hex)'' as shown by MHD flasher when you list the DME software versions. For example ''00003076501103_UserChannels.xml''
* The file follows a format as follows
* The file follows a format as follows


{{Codesample |name=ingress.yaml |lang=yaml |scheme=dark |line=1 |highlight=5,8 |code=
<syntaxhighlight lang="xml" line>
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: foo-redirect
  namespace: tool-foo
  labels:
    name: foo-redirect
  annotations:
    kubernetes.io/ingress.class: nginx
}}
 
<code>


<?xml version="1.0" standalone="yes"?>
<?xml version="1.0" standalone="yes"?>
<ActualValues>
<ActualValues>
<ActualValue  
  <ActualValue  
  ReqBlock="$measurement-hex-address-according-to-a2l"  
    ReqBlock="$hex-address"       # ECU Address from A2L
  Size="$size-in-bytes"  
    Size="$size-in-bytes"         # Size (e.g. BYTE=1, WORD=2, LONG=4)
  DataA="$x-coefficient"  
    DataA="$x-coefficient"       # RAT_FUNC coeff F / coeff B
  DataB="$constant"  
    DataB="$constant"             # RAT_FUNC coeff C / coeff B
  Prefix="$memory-segment-leading-digits-unused"  
    Prefix="$digits"             # First two digits of MEMORY_SEGMENT containing this var
  Units="$units"  
    Units="$units"               # text string describing the units
  RoundingDigits="$decimal-places"  
    RoundingDigits="$dec-places" # decimal places for guages
  signed="$1-if-signed-otherwise-skip-this-attribute">
    signed="$1-if-signed">        # skip if UBYTE, UWORD, or ULONG, otherwise use signed="1"
 
    <Text xml:lang="en">$channel-name</Text> # name of the channel
  </ActualValue>
</ActualValues>
</ActualValues>


</code>
</syntaxhighlight>


Here's an example for Dzwt_pf1, the temperature correction component of an overall timing correction:


<ActualValue ReqBlock="51801f14" Size="2" DataA="0.1" DataB="0.0" Prefix="51" Units="°" RoundingDigits="1" signed="1">
Here's an example for Dzwt, the temperature correction component of an overall timing correction, for version R1C9J8B3B:
<Text xml:lang="en">Dzwt_pf1</Text>
 
<syntaxhighlight lang="xml" line>
 
<ActualValue ReqBlock="51801f12" Size="2" DataA="0.1" DataB="0.0" Prefix="51" Units="°" RoundingDigits="1" signed="1">
  <Text xml:lang="en">Dzwt</Text>
</ActualValue>
</ActualValue>


</syntaxhighlight>
The following shows the relevant A2L blocks for getting the required information:


This is so because the a2l file declares:
<syntaxhighlight lang="asap2" line>
/begin MEASUREMENT


/begin MEASUREMENT
/begin MEASUREMENT


Dzwt_pf1
    Dzwt
"Temperaturkorrektur ZW-Klopfgrenze Pfad1"
    "Temperaturkorrektur ZW-Klopfgrenze"
SWORD
    SWORD
juwcFuc_Dtmczic_mCgfamd_q__aa0o
    juwcFuc_Dtmczic_mCgfamd_q__aa0o
1
    1
100.
    100.
-3276.8
    -3276.8
3276.7
    3276.7
FORMAT "%6.1"
    FORMAT "%6.1"
ECU_ADDRESS 0x51801F14
    ECU_ADDRESS 0x51801F12




/end MEASUREMENT
/end MEASUREMENT


and
...


/begin COMPU_METHOD
/begin COMPU_METHOD


juwcFuc_Dtmczic_mCgfamd_q__aa0o
    juwcFuc_Dtmczic_mCgfamd_q__aa0o
"juwcFuc_Dtmczic_mCgfamd_q__aa0o"
    "juwcFuc_Dtmczic_mCgfamd_q__aa0o"
RAT_FUNC
    RAT_FUNC
"%6.3"
    "%6.3"
"°"
    "°"


COEFFS 0. 10. 0. 0. 0. 1.
    COEFFS 0. 10. 0. 0. 0. 1.


/end COMPU_METHOD
/end COMPU_METHOD
</syntaxhighlight>
* Finally, copy the user channels file to your phone and import it into MHD:
[[File:Channels.png]]

Revision as of 06:45, 19 July 2024

MHD's logger has a useful feature which allows you to add custom logging parameters, which we explain below.

To use this feature, you need the a2l file for your DME (see Resources for getting started).

The basic process is as follows

  • Create a $prg_UserChannels.xml file where $prg is the value of Current PRG (hex) as shown by MHD flasher when you list the DME software versions. For example 00003076501103_UserChannels.xml
  • The file follows a format as follows
<?xml version="1.0" standalone="yes"?>
<ActualValues>
  <ActualValue 
    ReqBlock="$hex-address"       # ECU Address from A2L
    Size="$size-in-bytes"         # Size (e.g. BYTE=1, WORD=2, LONG=4)
    DataA="$x-coefficient"        # RAT_FUNC coeff F / coeff B
    DataB="$constant"             # RAT_FUNC coeff C / coeff B
    Prefix="$digits"              # First two digits of MEMORY_SEGMENT containing this var
    Units="$units"                # text string describing the units
    RoundingDigits="$dec-places"  # decimal places for guages
    signed="$1-if-signed">        # skip if UBYTE, UWORD, or ULONG, otherwise use signed="1"

    <Text xml:lang="en">$channel-name</Text> # name of the channel
  </ActualValue>
</ActualValues>


Here's an example for Dzwt, the temperature correction component of an overall timing correction, for version R1C9J8B3B:

<ActualValue ReqBlock="51801f12" Size="2" DataA="0.1" DataB="0.0" Prefix="51" Units="°" RoundingDigits="1" signed="1">
  <Text xml:lang="en">Dzwt</Text>
</ActualValue>

The following shows the relevant A2L blocks for getting the required information:

/begin MEASUREMENT

/begin MEASUREMENT

    Dzwt
    "Temperaturkorrektur ZW-Klopfgrenze"
    SWORD
    juwcFuc_Dtmczic_mCgfamd_q__aa0o
    1
    100.
    -3276.8
    3276.7
    FORMAT "%6.1"
    ECU_ADDRESS 0x51801F12


/end MEASUREMENT

...

/begin  COMPU_METHOD

    juwcFuc_Dtmczic_mCgfamd_q__aa0o
    "juwcFuc_Dtmczic_mCgfamd_q__aa0o"
    RAT_FUNC
    "%6.3"
    "°"

    COEFFS 0. 10. 0. 0. 0. 1.

/end COMPU_METHOD
  • Finally, copy the user channels file to your phone and import it into MHD: