<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!-- Copyright (C) JMRI 2007, 2008 All rights reserved -->
<!--                                                                        -->
<!-- JMRI is free software; you can redistribute it and/or modify it under  -->
<!-- the terms of version 2 of the GNU General Public License as published  -->
<!-- by the Free Software Foundation. See the "COPYING" file for a copy     -->
<!-- of this license.                                                       -->
<!--                                                                        -->
<!-- JMRI is distributed in the hope that it will be useful, but WITHOUT    -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  -->
<!-- for more details.                                                      -->
<decoder-config xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://jmri.org/xml/schema/decoder-4-15-2.xsd">
  <version author="Jeff Schmaltz escopetas@comcast.net" version="1.4" lastUpdated="20090305"/>
  <version author="Jeff Schmaltz escopetas@comcast.net" version="1.3" lastUpdated="20090218"/>
  <version author="Jeff Schmaltz escopetas@comcast.net" version="1.2" lastUpdated="20080127"/>
  <version author="Jeff Schmaltz escopetas@comcast.net" version="1.1" lastUpdated="20070204"/>
  <version author="Jeff Schmaltz escopetas@comcast.net" version="1.0" lastUpdated="20060923"/>
  <!-- 
      This decoder XML is meant to be used with the "Custom" programmer format.
      The pane definitions are included below the decoder definition.  The LGB
      decoders seem to fit the description of "weird" as mentioned in that
      programmer.  Also, this allows the tooltips from this decoder file to be
      displayed for the user.

      I have tested this decoder file using the SPROG II interface.  The range
      of versions listed is hypothetical as the versions for all the Massoth/LGB
      decoder types overlap. The highest version I have encountered is 3.4 (in
      both large and small onboard) and the lowest is 1.0 (in a MTS I 55020).

      CV 106 is used by Massoth as "ID for decoder type" and is possibly one way
      of determining decoder type from the CV's, as the version numbers overlap.
      To date, I have encountered the following values in CV 106 (any additions to
      this list would be appreciated):

      55020:              10
      55021:             192
      55022:              16
      Small onboard:      65 (steam), 73 (steam), 81 (diesel), 82 (diesel), 83 (rail car), 93
      Large onboard:     129 (steam), 134 (2-10-2), 137 (Aster steam), 145 (diesel/electric)
                         146 (rail car), 147 (US diesel)
      55027:             193
      eMOTION L:         201 (according to 1.0 manual)
      eMOTION LS:        202 (according to 2.2 manual)
      eMOTION XL:        193 (according to 2.0 manual), 200
      eMOTION XXL:       ???
      eMOTION XLS:       202 (according to 1.3 manual), 203
      eMOTION 8FL:       204 (according to 1.2 manual)
      LED Light:         204
      6500x sound unit:  208
      Hot Metal Car:      10

      This definition was based on the LGB document "CV description for LGB onboard
      decoders, October 5, 2004" (OnboardCVs.pdf, which seems to have disappeared
      from the LGB website, email me for a copy - or if you have an updated version!),
      the documents for the 55020, 55021, and 55022 decoders, plus the instructions
      for some locos. These are all available from the LGB website.

      This decoder file is most proper for the 55021 and 55022 MTS II add-on decoders
      and the small and large onboard decoders.  It can work with newer 55020 MTS I
      add-on decoders but this decoder lacks some features, such as back-EMF and long
      (2-byte) addresses. Only the onboard decoders have the F2 functions.  Not all
      the features work with all locos.  Refer to the decoder and loco documentation
      for details.  However, some features may not be documented e.g. the 2 vs. 4
      chuff bit worked on a sound-equipped loco where it was not mentioned in the
      instructions!

      I tried to match DeccoderPro "item" names when I was fairly certain they were
      correct.  The "label" names tried to match the names used in the LGB
      documentation.

      Finally, I choose not to specify any "default" values (which then results in
      a default of 0) because of the different defaults in the wide variety of LGB
      locos with onboard decoders.  These defaults are listed in the loco document.
      Defaults for the add-on decoders can be found in their respective manuals.

      Any and all feedback on this file would be appreciated.

      Version History:

        1.0 - 23 Sep 2006
              Initial release 
        1.1 - 4 Feb 2007
              Cosmetic format changes
              Made CV 7, 8, & 106 readOnly (works correctly with 1.7.5+)
              Added CV numbers to tooltips
        1.2 - 27 Jan 2008
              Cosmetic changes to CV 54 including adding tooltips
              Value for P-Update added to CV 51
              Added individual models so attributes could be added to them
              Removed high version
              Implemented "factReset"
        1.3 - 18 Feb 2009
              Added highVersionID, high version is higher than current version at time of writing

        1.4 - 5 Mar 2009
              Converted single "Speed Control" pane to "Basic Speed Control" and "Speed Table" following Bruce Shanks'
                 Version 13 changes to the Comprehensive programmer
-->
  <decoder>
    <family name="LGB" mfg="Massoth Elektronik, GmbH">
      <model model="LGB MTS I 55020 loco decoders" lowVersionID="10" highVersionID="29" maxInputVolts="24 V" maxMotorCurrent="1.5 A" maxTotalCurrent="2.0 A" numOuts="3" numFns="10" formFactor="G" connector="other">
        <output name="1" label="Front light" maxcurrent="0.3 A" connection="other"/>
        <output name="2" label="Rear light " maxcurrent="0.3 A" connection="other"/>
        <output name="3" label="F1 " maxcurrent="0.3 A" connection="other"/>
        <size length="55" width="25" height="12" units="mm"/>
      </model>
      <!-- 55020 currents are for the later Massoth versions,
           the earlier Lenz versions were 1.5 motor, 0.15 per function, and 1.5 total
-->
      <model model="LGB MTS II 55021 loco decoders" lowVersionID="10" highVersionID="29" maxInputVolts="24 V" maxMotorCurrent="1.5 A" maxTotalCurrent="2.0 A" numOuts="3" numFns="10" formFactor="G" connector="other">
        <output name="1" label="Front light" maxcurrent="0.3 A" connection="other"/>
        <output name="2" label="Rear light " maxcurrent="0.3 A" connection="other"/>
        <output name="3" label="F1 " maxcurrent="0.3 A" connection="other"/>
        <size length="55" width="25" height="13" units="mm"/>
      </model>
      <model model="LGB MTS II 55022 small loco decoders" lowVersionID="10" highVersionID="29" maxInputVolts="24 V" maxMotorCurrent="0.8 A" maxTotalCurrent="1 A" numOuts="3" numFns="10" formFactor="G" connector="other">
        <output name="1" label="Front light" maxcurrent="0.05 A" connection="solder"/>
        <output name="2" label="Rear light " maxcurrent="0.05 A" connection="solder"/>
        <output name="3" label="F1 " maxcurrent="0.05 A" connection="solder"/>
        <size length="28" width="14" height="13" units="mm"/>
      </model>
      <model model="LGB MTS II onboard loco decoders" lowVersionID="20" highVersionID="39" maxInputVolts="24 V" numOuts="4" numFns="10" formFactor="G" connector="other">
        <output name="1" label="Front light" connection="other"/>
        <output name="2" label="Rear light " connection="other"/>
        <output name="3" label="F1 " connection="other"/>
        <output name="4" label="F2 " connection="other"/>
      </model>
    </family>
    <programming direct="yes" paged="no" register="yes" ops="no"/>
    <variables>
      <xi:include href="http://jmri.org/xml/decoders/nmra/shortAndLongAddress.xml"/>
      <variable CV="2" item="Vstart" tooltip="Sets the starting voltage at throttle speed step 1 - 0: slow, 255: maximum speed">
        <decVal min="0" max="255"/>
        <label>Starting voltage</label>
        <label xml:lang="it">Volt Partenza</label>
        <label xml:lang="fr">V démarr.</label>
        <label xml:lang="de">Startspannung</label>
      </variable>
      <variable CV="3" item="Accel" tooltip="Sets the acceleration rate - 1: rapid acceleration, 255: gradual acceleration">
        <decVal min="1" max="255"/>
        <label>Acceleration</label>
        <label xml:lang="it">Accellerazione (0-255)</label>
        <label xml:lang="fr">Accelération (0-255)</label>
        <label xml:lang="de">Anfahrverzögerung (0-255)</label>
      </variable>
      <variable CV="4" item="Decel" tooltip="Sets the deceleration rate - 1: rapid braking, 255: gradual braking)">
        <decVal min="1" max="255"/>
        <label>Braking</label>
        <label xml:lang="it">Decellerazione (1-255)</label>
        <label xml:lang="fr">Décélération (1-255)</label>
        <label xml:lang="de">Bremszeit (1-255)</label>
      </variable>
      <variable CV="5" item="Vhigh" tooltip="Sets the maximum voltage at full throttle - 1: slow, 255: maximum speed">
        <decVal min="1" max="255"/>
        <label>Maximum Motor Voltage</label>
        <label xml:lang="it">Volt Massimi (0-255):</label>
        <label xml:lang="de">Höchstgeschwindigkeit</label>
      </variable>
      <!-- CV 7-8 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/mfgVersionId.xml"/>
      <variable CV="9" item="Total PWM Period" tooltip="Sets the motor drive frequency - Note: Back-EMF only works with 16 kHz">
        <enumVal>
          <enumChoice choice="16 kHz">
            <choice>16 kHz</choice>
          </enumChoice>
          <enumChoice choice="1.8 kHz">
            <choice>1.8 kHz</choice>
          </enumChoice>
          <enumChoice choice="270 Hz">
            <choice>270 Hz</choice>
          </enumChoice>
          <enumChoice choice="70 Hz">
            <choice>70 Hz</choice>
          </enumChoice>
        </enumVal>
        <label>Motor Frequency</label>
        <label xml:lang="it">Frequenza Motore</label>
      </variable>
      <!-- CV=29 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/cv29direction.xml"/>
      <variable CV="29" mask="XXXXXXVX" item="Speed Step Mode" tooltip="Sets the speed step mode">
        <enumVal>
          <enumChoice choice="14">
            <choice>14</choice>
          </enumChoice>
          <enumChoice choice="28/128 (not LGB MTS)">
            <choice>28/128 (not LGB MTS)</choice>
            <choice xml:lang="it">28/128 (non LGB MTS)</choice>
          </enumChoice>
        </enumVal>
        <label>Speed Steps</label>
        <label xml:lang="it">Step Velocità</label>
      </variable>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29analog.xml"/>
      <variable CV="29" mask="XXXVXXXX" item="Speed Table Definition" tooltip="Determines whether loco will use manufacturer's internal or user-defined speed step table">
        <enumVal>
          <enumChoice choice="internal speed step table">
            <choice>internal speed step table</choice>
            <choice xml:lang="it">tabella velocità interna</choice>
          </enumChoice>
          <enumChoice choice="user-programmed speed step table (CV's 67-94)">
            <choice>user-programmed speed step table (CV's 67-94)</choice>
            <choice xml:lang="it">tabella velocità personalizzata (CV 67-94)</choice>
          </enumChoice>
        </enumVal>
        <label>Use Speed Table</label>
        <label xml:lang="it">Usa Tabella velocità</label>
      </variable>
      <variable item="Voltage for F1 terminal" CV="49" tooltip="Voltage for F1 terminal - 1:low voltage, 5:5V light bulbs or smoke generator, 32:maximum voltage">
        <decVal min="1" max="32"/>
        <label>Voltage for F1 terminal</label>
      </variable>
      <variable item="Voltage for lighting terminals" CV="50" tooltip="Voltage for front, rear and interior light - 1:low voltage, 5:5V light bulbs, 32:maximum voltage">
        <decVal min="1" max="32"/>
        <label>Voltage for lighting terminals</label>
      </variable>
      <variable item="Command for F1 terminal" CV="51" tooltip="Command which triggers the F1 terminal">
        <enumVal>
          <enumChoice choice="lighting button (LGB=9, others=0)" value="0">
            <choice>lighting button (LGB=9, others=0)</choice>
            <choice xml:lang="it">pulsante Luci (LGB=9, altri=0)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel only)" value="1">
            <choice>button 1 (parallel only)</choice>
            <choice xml:lang="it">pulsante 1 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel only)" value="2">
            <choice>button 2 (parallel only)</choice>
            <choice xml:lang="it">pulsante 2 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel only)" value="3">
            <choice>button 3 (parallel only)</choice>
            <choice xml:lang="it">pulsante 3 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel only)" value="4">
            <choice>button 4 (parallel only)</choice>
            <choice xml:lang="it">pulsante 4 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel only)" value="5">
            <choice>button 5 (parallel only)</choice>
            <choice xml:lang="it">pulsante 5 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel only)" value="6">
            <choice>button 6 (parallel only)</choice>
            <choice xml:lang="it">pulsante 6 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel only)" value="7">
            <choice>button 7 (parallel only)</choice>
            <choice xml:lang="it">pulsante 7 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel only)" value="8">
            <choice>button 8 (parallel only)</choice>
            <choice xml:lang="it">pulsante 8 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel and serial)" value="9">
            <choice>button 1 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 1 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel and serial)" value="10">
            <choice>button 2 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 2 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel and serial)" value="11">
            <choice>button 3 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 3 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel and serial)" value="12">
            <choice>button 4 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 4 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel and serial)" value="13">
            <choice>button 5 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 5 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel and serial)" value="14">
            <choice>button 6 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 6 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel and serial)" value="15">
            <choice>button 7 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 7 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel and serial)" value="16">
            <choice>button 8 (parallel and serial)</choice>
            <choice xml:lang="it">pulsante 8 (Parallelo e seriale)</choice>
          </enumChoice>
          <enumChoice choice="buttons 1-8 with fast pulse string (for 55021 with P-Update only)" value="33">
            <choice>buttons 1-8 with fast pulse string (for 55021 with P-Update only)</choice>
            <choice xml:lang="it">pulsanti 1-8 con serie impulsi veloci (solo per 55021 con vers.P)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is reversing)" value="64">
            <choice>lighting button (LGB=9, others=0) (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is reversing)" value="65">
            <choice>button 1 (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is moving forward)" value="128">
            <choice>lighting button (LGB=9, others=0) (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is moving forward)" value="129">
            <choice>button 1 (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
        </enumVal>
        <label>Command for F1 terminal</label>
        <label xml:lang="it">Comando per F1</label>
      </variable>
      <variable item="Command for front lighting terminal" CV="52" tooltip="Command which triggers the front light terminal">
        <enumVal>
          <enumChoice choice="lighting button (LGB=9, others=0)" value="0">
            <choice>lighting button (LGB=9, others=0)</choice>
            <choice xml:lang="it">Pulsanti luci (LGB=9, altri=0)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel only)" value="1">
            <choice>button 1 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 1 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel only)" value="2">
            <choice>button 2 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 2 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel only)" value="3">
            <choice>button 3 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 3 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel only)" value="4">
            <choice>button 4 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 4 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel only)" value="5">
            <choice>button 5 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 5 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel only)" value="6">
            <choice>button 6 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 6 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel only)" value="7">
            <choice>button 7 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 7 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel only)" value="8">
            <choice>button 8 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 8 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel and serial)" value="9">
            <choice>button 1 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 1 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel and serial)" value="10">
            <choice>button 2 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 2 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel and serial)" value="11">
            <choice>button 3 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 3 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel and serial)" value="12">
            <choice>button 4 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 4 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel and serial)" value="13">
            <choice>button 5 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 5 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel and serial)" value="14">
            <choice>button 6 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 6 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel and serial)" value="15">
            <choice>button 7 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 7 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel and serial)" value="16">
            <choice>button 8 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 8 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is reversing)" value="64">
            <choice>lighting button (LGB=9, others=0) (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is reversing)" value="65">
            <choice>button 1 (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is moving forward)" value="128">
            <choice>lighting button (LGB=9, others=0) (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is moving forward)" value="129">
            <choice>button 1 (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
        </enumVal>
        <label>Command for front lighting terminal</label>
        <label xml:lang="it">Comando per luci frontali</label>
      </variable>
      <variable item="Command for rear lighting terminal" CV="53" tooltip="Command which triggers the rear light terminal">
        <enumVal>
          <enumChoice choice="lighting button (LGB=9, others=0)" value="0">
            <choice>lighting button (LGB=9, others=0)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel only)" value="1">
            <choice>button 1 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 1 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel only)" value="2">
            <choice>button 2 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 2 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel only)" value="3">
            <choice>button 3 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 3 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel only)" value="4">
            <choice>button 4 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 4 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel only)" value="5">
            <choice>button 5 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 5 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel only)" value="6">
            <choice>button 6 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 6 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel only)" value="7">
            <choice>button 7 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 7 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel only)" value="8">
            <choice>button 8 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 8 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel and serial)" value="9">
            <choice>button 1 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 1 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel and serial)" value="10">
            <choice>button 2 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 2 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel and serial)" value="11">
            <choice>button 3 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 3 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel and serial)" value="12">
            <choice>button 4 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 4 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel and serial)" value="13">
            <choice>button 5 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 5 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel and serial)" value="14">
            <choice>button 6 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 6 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel and serial)" value="15">
            <choice>button 7 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 7 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel and serial)" value="16">
            <choice>button 8 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 8 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is reversing)" value="64">
            <choice>lighting button (LGB=9, others=0) (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is reversing)" value="65">
            <choice>button 1 (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is moving forward)" value="128">
            <choice>lighting button (LGB=9, others=0) (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is moving forward)" value="129">
            <choice>button 1 (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
        </enumVal>
        <label>Command for rear lighting terminal</label>
        <label xml:lang="it">Comando per luci retro</label>
      </variable>
      <variable item="hand-off function" CV="54" mask="XXXXXXXV" tooltip="Determines if MTS hand-off is on or off">
        <enumVal>
          <enumChoice choice="off">
            <choice>off</choice>
          </enumChoice>
          <enumChoice choice="on">
            <choice>on</choice>
          </enumChoice>
        </enumVal>
        <label>hand-off function</label>
        <label xml:lang="it">Funzioni manuali</label>
      </variable>
      <variable item="MTS Back-EMF" CV="54" mask="XXXXXXVX" tooltip="Determines if digital back-EMF is on or off">
        <enumVal>
          <enumChoice choice="off">
            <choice>off</choice>
          </enumChoice>
          <enumChoice choice="on">
            <choice>on</choice>
          </enumChoice>
        </enumVal>
        <label>MTS Back-EMF</label>
        <label xml:lang="it">MTS Back-EMF</label>
      </variable>
      <variable item="analog Back-EMF" CV="54" mask="XXXXXVXX" tooltip="Determines if analog back-EMF is on or off">
        <enumVal>
          <enumChoice choice="off">
            <choice>off</choice>
          </enumChoice>
          <enumChoice choice="on">
            <choice>on</choice>
          </enumChoice>
        </enumVal>
        <label>analog Back-EMF</label>
        <label xml:lang="it">Back-EMF analogico</label>
      </variable>
      <!-- Bits 4-8 of "LGB Configuration" CV54 are loco dependent -->
      <!-- Check your loco's manual -->
      <variable item="Loco dependent bit 4" CV="54" mask="XXXXVXXX" tooltip="Check your loco's manual to determine use of this bit">
        <enumVal>
          <enumChoice choice="0 - e.g. Load-dependent sounds off">
            <choice>0 - e.g. Load-dependent sounds off</choice>
            <choice xml:lang="it">0 - es. Suono Off dipendente da carico</choice>
          </enumChoice>
          <enumChoice choice="1 - e.g. Load-dependent sounds on">
            <choice>1 - e.g. Load-dependent sounds on</choice>
            <choice xml:lang="it">1 - es. Suono On dipendente da carico</choice>
          </enumChoice>
        </enumVal>
        <label>Loco dependent bit 4</label>
        <label xml:lang="it">Bit 4 dipendente da Loco</label>
      </variable>
      <variable item="Loco dependent bit 5" CV="54" mask="XXXVXXXX" tooltip="Check your loco's manual to determine use of this bit">
        <enumVal>
          <enumChoice choice="0 - e.g. F1 permanently on">
            <choice>0 - e.g. F1 permanently on</choice>
            <choice xml:lang="it">0 - es. F1 sempre On</choice>
          </enumChoice>
          <enumChoice choice="1 - e.g. F1 flashing">
            <choice>1 - e.g. F1 flashing</choice>
            <choice xml:lang="it">1 - es. F1 lampeggia</choice>
          </enumChoice>
        </enumVal>
        <label>Loco dependent bit 5</label>
        <label xml:lang="it">Bit 5 dipendente da Loco</label>
      </variable>
      <variable item="Loco dependent bit 6" CV="54" mask="XXVXXXXX" tooltip="Check your loco's manual to determine use of this bit">
        <enumVal>
          <enumChoice choice="0 - e.g. F2 permanently on">
            <choice>0 - e.g. F2 permanently on</choice>
            <choice xml:lang="it">0 - es. F2 sempre On</choice>
          </enumChoice>
          <enumChoice choice="1 - e.g. F2 flashing">
            <choice>1 - e.g. F2 flashing</choice>
            <choice xml:lang="it">1 - es. F2 Lampeggia</choice>
          </enumChoice>
        </enumVal>
        <label>Loco dependent bit 6</label>
        <label xml:lang="it">Bit 6 dipendente da Loco</label>
      </variable>
      <variable item="Loco dependent bit 7" CV="54" mask="XVXXXXXX" tooltip="Check your loco's manual to determine use of this bit">
        <enumVal>
          <enumChoice choice="0 - e.g. Number of chuffs 2">
            <choice>0 - e.g. Number of chuffs 2</choice>
            <choice xml:lang="it">0 - es. Numero chuff=2</choice>
          </enumChoice>
          <enumChoice choice="1 - e.g. Number of chuffs 4">
            <choice>1 - e.g. Number of chuffs 4</choice>
            <choice xml:lang="it">1 - es. Numero chuff=4</choice>
          </enumChoice>
        </enumVal>
        <label>Loco dependent bit 7</label>
        <label xml:lang="it">Bit 7 dipendente da Loco</label>
      </variable>
      <variable item="Loco dependent bit 8" CV="54" mask="VXXXXXXX" tooltip="Check your loco's manual to determine use of this bit">
        <enumVal>
          <enumChoice choice="0 - e.g. Automatic sounds on">
            <choice>0 - e.g. Automatic sounds on</choice>
            <choice xml:lang="it">0 - es. Suono autom. On</choice>
          </enumChoice>
          <enumChoice choice="1 - e.g. Automatic sounds off">
            <choice>1 - e.g. Automatic sounds off</choice>
            <choice xml:lang="it">1 - es. Suono autom. Off</choice>
          </enumChoice>
        </enumVal>
        <label>Loco dependent bit 8</label>
        <label xml:lang="it">Bit 8 dipendente da Loco</label>
      </variable>
      <variable item="Voltage for F2 terminal" CV="56" tooltip="Voltage for F2 terminal - 1:low voltage, 5:5V light bulbs or smoke generator, 32:maximum voltage">
        <decVal min="1" max="32"/>
        <label>Voltage for F2 terminal</label>
        <label xml:lang="it">Volt terminale 2</label>
      </variable>
      <variable item="Command for F2 terminal" CV="57" tooltip="Command which triggers the F2 terminal">
        <enumVal>
          <enumChoice choice="lighting button (LGB=9, others=0)" value="0">
            <choice>lighting button (LGB=9, others=0)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel only)" value="1">
            <choice>button 1 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 1 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel only)" value="2">
            <choice>button 2 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 2 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel only)" value="3">
            <choice>button 3 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 3 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel only)" value="4">
            <choice>button 4 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 4 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel only)" value="5">
            <choice>button 5 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 5 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel only)" value="6">
            <choice>button 6 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 6 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel only)" value="7">
            <choice>button 7 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 7 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel only)" value="8">
            <choice>button 8 (parallel only)</choice>
            <choice xml:lang="it">Pulsante 8 (solo Parallelo)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (parallel and serial)" value="9">
            <choice>button 1 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 1 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 2 (parallel and serial)" value="10">
            <choice>button 2 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 2 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 3 (parallel and serial)" value="11">
            <choice>button 3 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 3 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 4 (parallel and serial)" value="12">
            <choice>button 4 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 4 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 5 (parallel and serial)" value="13">
            <choice>button 5 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 5 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 6 (parallel and serial)" value="14">
            <choice>button 6 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 6 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 7 (parallel and serial)" value="15">
            <choice>button 7 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 7 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="button 8 (parallel and serial)" value="16">
            <choice>button 8 (parallel and serial)</choice>
            <choice xml:lang="it">Pulsante 8 (Parallelo e Seriale)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is reversing)" value="64">
            <choice>lighting button (LGB=9, others=0) (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is reversing)" value="65">
            <choice>button 1 (on only when loco is reversing)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia indietro)</choice>
          </enumChoice>
          <enumChoice choice="lighting button (LGB=9, others=0) (on only when loco is moving forward)" value="128">
            <choice>lighting button (LGB=9, others=0) (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsanti Luci (LGB=9, altri=0) (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
          <enumChoice choice="button 1 (on only when loco is moving forward)" value="129">
            <choice>button 1 (on only when loco is moving forward)</choice>
            <choice xml:lang="it">Pulsante 1 (ON solo con loco in marcia avanti)</choice>
          </enumChoice>
        </enumVal>
        <label>Command for F2 terminal</label>
        <label xml:lang="it">Comando per F2</label>
      </variable>
      <variable item="Pause Time between changes in direction" CV="58" tooltip="Pause equals programmed value x 0.5 seconds">
        <decVal min="0" max="255"/>
        <label>Pause Time between changes in direction</label>
        <label xml:lang="it">Pausa tra cambio direzione</label>
      </variable>
      <!-- Found reference to this CV in Instructions for 23900 MTS-DUO switcher -->
      <!-- Not sure how it relates to using F8 to switch half-speed mode on and off -->
      <!-- Checked Instructions for a couple of other small diesels but no mention of CV59 -->
      <variable item="Half-speed mode" CV="59" mask="XXXXXVXX" tooltip="May only apply to 23900 MTS-DUO switcher">
        <enumVal>
          <enumChoice choice="Half-speed mode deactivated">
            <choice>Half-speed mode deactivated</choice>
            <choice xml:lang="it">Velocità da manovra disattivata</choice>
          </enumChoice>
          <enumChoice choice="Half-speed mode activated">
            <choice>Half-speed mode activated</choice>
            <choice xml:lang="it">Velocità da manovra attivata</choice>
          </enumChoice>
        </enumVal>
        <label>Half-speed mode</label>
        <label xml:lang="it">Velocità da manovra</label>
      </variable>
      <variable item="Back-EMF Maximum Adjustment Factor" CV="60" tooltip="1: small steps, 255: large steps (Note: LGB recommends not changing this CV)">
        <decVal min="1" max="255"/>
        <label>Back-EMF Maximum Adjustment Factor</label>
        <label xml:lang="it">Massimo Fattore correzione Back EMF</label>
      </variable>
      <variable item="Back-EMF Adjustment Frequency" CV="61" tooltip="0: immediate adjustment, 255: maximum delay (Note: LGB recommends not changing this CV)">
        <decVal min="0" max="255"/>
        <label>Back-EMF Adjustment Frequency</label>
        <label xml:lang="it">Frequenza Fattore correzione Back EMF</label>
      </variable>
      <variable item="Back-EMF Maximum Adjustment" CV="62" tooltip="0: no adjustment, 255: maximum adjustment (Note: LGB recommends not changing this CV)">
        <decVal min="0" max="255"/>
        <label>Back-EMF Maximum Adjustment</label>
        <label xml:lang="it">Massima Correzione Back EMF</label>
      </variable>
      <variable item="Speed Table" CV="67">
        <speedTableVal>
          <speedTableEntry step="1" value="8"/>
          <speedTableEntry step="2" value="16"/>
          <speedTableEntry step="3" value="24"/>
          <speedTableEntry step="4" value="32"/>
          <speedTableEntry step="5" value="40"/>
          <speedTableEntry step="6" value="48"/>
          <speedTableEntry step="7" value="56"/>
          <speedTableEntry step="8" value="64"/>
          <speedTableEntry step="9" value="72"/>
          <speedTableEntry step="10" value="80"/>
          <speedTableEntry step="11" value="88"/>
          <speedTableEntry step="12" value="96"/>
          <speedTableEntry step="13" value="104"/>
          <speedTableEntry step="14" value="112"/>
          <speedTableEntry step="15" value="120"/>
          <speedTableEntry step="16" value="128"/>
          <speedTableEntry step="17" value="136"/>
          <speedTableEntry step="18" value="144"/>
          <speedTableEntry step="19" value="152"/>
          <speedTableEntry step="20" value="160"/>
          <speedTableEntry step="21" value="168"/>
          <speedTableEntry step="22" value="176"/>
          <speedTableEntry step="23" value="184"/>
          <speedTableEntry step="24" value="192"/>
          <speedTableEntry step="25" value="208"/>
          <speedTableEntry step="26" value="224"/>
          <speedTableEntry step="27" value="240"/>
          <speedTableEntry step="28" value="255"/>
        </speedTableVal>
        <label>Speed Table</label>
      </variable>
      <!-- Do not attempt to read CV 105 on an LGB decoder -->
      <variable CV="106" readOnly="yes" item="Product Number" tooltip="ID for Decoder Type (read only)">
        <decVal/>
        <label>ID for Decoder Type</label>
        <label xml:lang="it">ID Tipo Decoder</label>
      </variable>
    </variables>
    <resets>
      <factReset label="Reset to factory settings" CV="55" default="55">
        <label>Reset to factory settings</label>
        <label xml:lang="it">Reset ai valori di fabbrica</label>
      </factReset>
    </resets>
  </decoder>
  <pane>
    <column>
      <dccaddress/>
      <label>
        <text> </text>
      </label>
      <display item="Short Address"/>
      <display item="Long Address"/>
      <display item="Address Format"/>
      <label>
        <text> </text>
      </label>
      <display item="Locomotive Direction"/>
      <display item="Speed Step Mode"/>
      <display item="Analog (DC) Operation"/>
    </column>
    <column>
      <label>
        <text> </text>
      </label>
      <label>
        <text> </text>
      </label>
      <label>
        <text> </text>
      </label>
      <separator/>
      <label>
        <text> </text>
      </label>
      <display item="Manufacturer"/>
      <display item="Decoder Version"/>
      <display item="Product Number"/>
    </column>
    <name>Basic</name>
    <name xml:lang="it">Base</name>
  </pane>
  <pane>
    <column>
      <display item="Accel"/>
      <display item="Decel"/>
      <label>
        <text> </text>
      </label>
      <display item="Total PWM Period"/>
      <label>
        <text> </text>
      </label>
      <display item="Pause Time between changes in direction"/>
      <label>
        <text> </text>
      </label>
      <display item="MTS Back-EMF"/>
      <display item="analog Back-EMF"/>
      <label>
        <text> </text>
      </label>
      <display item="Back-EMF Maximum Adjustment Factor"/>
      <display item="Back-EMF Adjustment Frequency"/>
      <display item="Back-EMF Maximum Adjustment"/>
    </column>
    <name>Motor</name>
    <name xml:lang="it">Motore</name>
  </pane>
  <pane>
    <column>
      <row>
        <column>
          <label>
            <text> </text>
          </label>
          <display item="Speed Table Definition" format="offradiobutton" layout="above" label="Select this button to use settings shown below">
            <label>Select this button to use settings shown below</label>
            <label xml:lang="it">Selezionare per usare i parametri visualizzati</label>
          </display>
          <label>
            <text>           To turn off, use Speed Table pane</text>
            <text xml:lang="it">Per disabilitare, usa Tabella Velocità</text>
          </label>
          <label>
            <text> </text>
          </label>
        </column>
      </row>
      <row>
        <label>
          <text> </text>
        </label>
      </row>
      <row>
        <label>
          <text> </text>
        </label>
      </row>
      <row>
        <column>
          <display item="Vstart" tooltip="Sets the starting voltage at throttle speed step 1"/>
          <display item="Vmid" tooltip="Sets the voltage at mid throttle"/>
          <display item="Vhigh" tooltip="Sets the maximum voltage at full throttle"/>
          <display item="Speed Table/Mid Range Cab Speed Step" tooltip="Sets voltage curve for mid throttle, set Vstart and Vhigh first"/>
        </column>
        <column>
          <display item="Vstart" format="hslider" label="" tooltip="Sets the starting voltage at throttle speed step 1">
            <label/>
          </display>
          <display item="Vmid" format="hslider" label="" tooltip="Sets the voltage at mid throttle">
            <label/>
          </display>
          <display item="Vhigh" format="hslider" label="" tooltip="Sets the maximum voltage at full throttle">
            <label/>
          </display>
        </column>
      </row>
    </column>
    <name>Basic Speed Control</name>
    <name xml:lang="it">Base Velocità</name>
  </pane>
  <pane>
    <column>
      <row>
        <column>
          <display item="Speed Table Definition" format="onradiobutton" layout="above" label="Select this button to use a Speed Table for Speed Control">
            <label>Select this button to use a Speed Table for Speed Control</label>
            <label xml:lang="it">Selezionare per usare parametri nella Tabella Velocità</label>
          </display>
          <label>
            <text>            To turn off, use Basic Speed Control pane</text>
            <text xml:lang="it">Per disabilitare, usa pannello Base Velocità </text>
          </label>
        </column>
      </row>
      <row>
        <label>
          <text> </text>
        </label>
      </row>
      <row>
        <label>
          <text> </text>
        </label>
      </row>
      <row>
        <column>
          <label>
            <text> </text>
          </label>
          <display item="Speed Table Selection" tooltip="Select manufacturer's speed table or user table"/>
        </column>
      </row>
      <row>
        <column>
          <display item="Speed Table" layout="above"/>
          <label>
            <text> </text>
          </label>
        </column>
      </row>
    </column>
    <name>Speed Table</name>
    <name xml:lang="it">Tabella Velocità</name>
  </pane>
  <pane>
    <column>
      <display item="Voltage for lighting terminals"/>
      <display item="Voltage for F1 terminal"/>
      <display item="Voltage for F2 terminal"/>
      <label>
        <text> </text>
      </label>
      <display item="Command for front lighting terminal"/>
      <display item="Command for rear lighting terminal"/>
      <display item="Command for F1 terminal"/>
      <display item="Command for F2 terminal"/>
      <label>
        <text> </text>
      </label>
      <display item="Loco dependent bit 5"/>
      <display item="Loco dependent bit 6"/>
    </column>
    <name>Lights and Functions</name>
  </pane>
  <pane>
    <column>
      <display item="Loco dependent bit 4"/>
      <display item="Loco dependent bit 7"/>
      <display item="Loco dependent bit 8"/>
    </column>
    <name>Sound</name>
    <name xml:lang="it">Suono</name>
  </pane>
  <pane>
    <column>
      <display item="hand-off function"/>
      <display item="Half-speed mode"/>
    </column>
    <name>Miscellaneous</name>
    <name xml:lang="it">Varie</name>
    
  </pane>
  <pane>
    <column>
      <cvtable/>
    </column>
    <name>CVs</name>
    <name xml:lang="it">CV</name>
  </pane>
</decoder-config>
