<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!-- Copyright (C) JMRI 2003 All rights reserved -->
<!-- $Id: Lenz_LE077XF.xml 17977 2011-07-18 17:23:46Z zoo $ -->
<!--                                                                        -->
<!-- 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.xsd">
  <version author="Phil Grainger (phil.grainger@ca.com)" version="7.1" lastUpdated="20031008"/>
<!-- Updated to new names by jake@physics.berkeley.edu -->
<!-- Added CV 23, 24, and function mapping - Bob J -->
<!-- Changed FX to match older LExxxXF decoders, file had SelectDrive FX settings -->
<!-- version 5 - add consist direction - jake -->
<!-- version 6 - fix Vstart and leight effects bugs -->
<!-- version 7 - made speed table selection more generic -->
<!-- Version 7.1 - changed spelling of "behavior" (Jack Shall) -->
<!-- These are the version 4.5 decoders, with "precision glide" and "XF" -->
  <decoder>
    <family name="Lenz XF, precision glide decoders" mfg="Lenz" lowVersionID="44" highVersionID="45">
      <model model="LE062XF" numOuts="2" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
      </model>
      <model model="LE063XF" numOuts="2">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
      </model>
      <model model="LE077XF" numOuts="3" nmraWarrant="yes" nmraWarrantStart="20000123">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE102XF" numOuts="3">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE103XF" numOuts="3" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE104XF" numOuts="3" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE105XF" numOuts="4" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
        <output name="4" label="D - Violet"/>
      </model>
      <model model="LE113XF" numOuts="4" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
        <output name="4" label="D - Violet"/>
      </model>
    </family>
    <programming direct="byteOnly" paged="yes" register="yes" ops="yes"/>
    <variables>
      <variable label="Primary Address" CV="1" comment="Short address" item="Short Address" default="03">
        <shortAddressVal/>
        <label>Primary Address</label>
        <comment>Short address</comment>
      </variable>
      <variable label="Start Volts" CV="2" item="Vstart" comment="Range 0-31">
        <decVal/>
        <label>Start Volts</label>
        <comment>Range 0-31</comment>
      </variable>
      <variable label="Accel" CV="3" comment="Range 0-31">
        <decVal max="31"/>
        <label>Accel</label>
        <comment>Range 0-31</comment>
      </variable>
      <variable label="Decel" CV="4" comment="Range 0-31">
        <decVal max="31"/>
        <label>Decel</label>
        <comment>Range 0-31</comment>
      </variable>
<!-- deleted max and mid voltage-->
      <variable label="Version ID" CV="7" readOnly="yes" item="Decoder Version">
        <decVal/>
        <label>Version ID</label>
      </variable>
      <variable label="Manufacturer ID" CV="8" readOnly="yes" item="Manufacturer" default="99">
        <decVal/>
        <label>Manufacturer ID</label>
      </variable>
      <variable label="Manufacturer ID - Reset" CV="8" default="99">
        <decVal/>
        <label>Manufacturer ID - Reset</label>
      </variable>
<!-- Deleted all CV 13 references-->
      <variable label="Long Address" CV="17" item="Extended Address" comment="4 digit address (Range 0001-9999)">
        <longAddressVal/>
        <label>Long Address</label>
        <comment>4 digit address (Range 0001-9999)</comment>
      </variable>
      <variable label="Consist Address" CV="19" mask="XVVVVVVV" item="Consist Address">
        <decVal/>
        <label>Consist Address</label>
      </variable>
      <variable label="Consist Direction" CV="19" mask="VXXXXXXX">
        <enumVal>
          <enumChoice choice="Normal">
            <choice>Normal</choice>
          </enumChoice>
          <enumChoice choice="Reversed">
            <choice>Reversed</choice>
          </enumChoice>
        </enumVal>
        <label>Consist Direction</label>
      </variable>
      <variable label="Acceleration Trim (range 0-255)" CV="23" default="255" item="Consist Acceleration Adjustment" comment="Additional Acceleration rate info for fine-tuning. (Range 0-255)">
        <decVal min="0" max="255"/>
        <label>Acceleration Trim (range 0-255)</label>
        <comment>Additional Acceleration rate info for fine-tuning. (Range 0-255)</comment>
      </variable>
      <variable label="Deceleration Trim (range 0-255)" CV="24" default="255" item="Consist Deceleration Adjustment" comment="Additional Deceleration (braking) rate info for fine-tuning. (Range 0-255)">
        <decVal min="0" max="255"/>
        <label>Deceleration Trim (range 0-255)</label>
        <comment>Additional Deceleration (braking) rate info for fine-tuning. (Range 0-255)</comment>
      </variable>
      <variable label="Normal direction of motion" CV="29" mask="XXXXXXXV" item="Locomotive Direction">
        <enumVal>
          <enumChoice choice="Forward">
            <choice>Forward</choice>
          </enumChoice>
          <enumChoice choice="Reverse">
            <choice>Reverse</choice>
          </enumChoice>
        </enumVal>
        <label>Normal direction of motion</label>
      </variable>
      <variable label="Speed Steps" CV="29" mask="XXXXXXVX" item="Speed Step Mode" default="1">
        <enumVal>
          <enumChoice choice="14">
            <choice>14</choice>
          </enumChoice>
          <enumChoice choice="28/128 (recommended)">
            <choice>28/128 (recommended)</choice>
          </enumChoice>
        </enumVal>
        <label>Speed Steps</label>
      </variable>
      <variable label="Analog conversion mode" CV="29" mask="XXXXXVXX" default="1" item="Analog (DC) Operation">
        <enumVal>
          <enumChoice choice="Off">
            <choice>Off</choice>
          </enumChoice>
          <enumChoice choice="On">
            <choice>On</choice>
          </enumChoice>
        </enumVal>
        <label>Analog conversion mode</label>
      </variable>
      <variable label="Use Speed Table" CV="29" mask="XXXVXXXX" item="Speed Table Definition">
        <enumVal>
          <enumChoice choice="Don't use Speed Table">
            <choice>Don't use Speed Table</choice>
          </enumChoice>
          <enumChoice choice="Use Speed Table">
            <choice>Use Speed Table</choice>
          </enumChoice>
        </enumVal>
        <label>Use Speed Table</label>
      </variable>
      <variable label="Addressing Mode" CV="29" mask="XXVXXXXX" item="Address Format">
        <enumVal>
          <enumChoice choice="2 digit addressing">
            <choice>2 digit addressing</choice>
          </enumChoice>
          <enumChoice choice="4 digit addressing">
            <choice>4 digit addressing</choice>
          </enumChoice>
        </enumVal>
        <label>Addressing Mode</label>
      </variable>
      <variable label="Accel/Decel Trim" CV="50" mask="XXXXXXXV" comment="Governs how loco acts in DC track block">
        <enumVal>
          <enumChoice choice="Accel/Decel trim OFF">
            <choice>Accel/Decel trim OFF</choice>
          </enumChoice>
          <enumChoice choice="Accel/Decel trim ON">
            <choice>Accel/Decel trim ON</choice>
          </enumChoice>
        </enumVal>
        <label>Accel/Decel Trim</label>
        <comment>Governs how loco acts in DC track block</comment>
      </variable>
      <variable label="Brake Momentum on DC" CV="50" item="DC Brake Momentum" mask="XXXXXVXX" comment="Governs how loco acts in DC track block">
        <enumVal>
          <enumChoice choice="Loco runs under DC analog voltage control">
            <choice>Loco runs under DC analog voltage control</choice>
          </enumChoice>
          <enumChoice choice="Loco brakes to a stop using momentum set in CV4">
            <choice>Loco brakes to a stop using momentum set in CV4</choice>
          </enumChoice>
        </enumVal>
        <label>Brake Momentum on DC</label>
        <comment>Governs how loco acts in DC track block</comment>
      </variable>
      <variable label="Directional Headlights" CV="51" comment="output A" mask="XXXXXXXV">
        <enumVal>
          <enumChoice choice="Headlights are directional and operate automatically">
            <choice>Headlights are directional and operate automatically</choice>
          </enumChoice>
          <enumChoice choice="Headlights are independantly controlled (F0-Front, F1-Rear)">
            <choice>Headlights are independantly controlled (F0-Front, F1-Rear)</choice>
          </enumChoice>
        </enumVal>
        <label>Directional Headlights</label>
        <comment>output A</comment>
      </variable>
      <variable label="Functional Headlight Dimming" CV="51" mask="XXXXXXVX" item="Global lighting option 1">
        <enumVal>
          <enumChoice choice="Dimming Disabled">
            <choice>Dimming Disabled</choice>
          </enumChoice>
          <enumChoice choice="Dimming Enabled. If headlights are directional, F1 dims headlight">
            <choice>Dimming Enabled. If headlights are directional, F1 dims headlight</choice>
          </enumChoice>
        </enumVal>
        <label>Functional Headlight Dimming</label>
      </variable>
      <variable label="If Lights Independent, F4 dims F0" CV="51" mask="XXXXXVXX" item="Global lighting option 2">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>If Lights Independent, F4 dims F0</label>
      </variable>
      <variable label="If Lights Independent, F4 dims F1" CV="51" mask="XXXXVXXX" item="Global lighting option 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>If Lights Independent, F4 dims F1</label>
      </variable>
      <variable label="Dimming Value" CV="52" item="Global lighting option 4" default="64">
        <decVal/>
        <label>Dimming Value</label>
      </variable>
      <variable label="Output C, D blink rate" CV="56" item="Function 4 options" default="15" minOut="3">
        <decVal min="0" max="255"/>
        <label>Output C, D blink rate</label>
      </variable>
      <variable label="Output C blinks" CV="53" minOut="3" item="Function 3 effect generated" mask="XXXXXXXV">
        <enumVal>
          <enumChoice choice="no">
            <choice>no</choice>
          </enumChoice>
          <enumChoice choice="yes">
            <choice>yes</choice>
          </enumChoice>
        </enumVal>
        <label>Output C blinks</label>
      </variable>
      <variable label="Output D blinks" CV="53" minOut="3" item="Function 4 effect generated" mask="XXXXXXVX">
        <enumVal>
          <enumChoice choice="no">
            <choice>no</choice>
          </enumChoice>
          <enumChoice choice="yes">
            <choice>yes</choice>
          </enumChoice>
        </enumVal>
        <label>Output D blinks</label>
      </variable>
      <variable label="Output C, D are ditch lights" CV="53" minOut="3" item="Function 4 behavior" mask="XXXXXVXX">
        <enumVal>
          <enumChoice choice="no">
            <choice>no</choice>
          </enumChoice>
          <enumChoice choice="yes">
            <choice>yes</choice>
          </enumChoice>
        </enumVal>
        <label>Output C, D are ditch lights</label>
      </variable>
      <variable label="F1 controls output C" CV="54" mask="XXXXXXXV" minOut="3" minFn="1" item="F1 controls output 3" default="1">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F1 controls output C</label>
      </variable>
      <variable label="F2 controls output C" CV="54" mask="XXXXXXVX" minOut="3" minFn="2" item="F2 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F2 controls output C</label>
      </variable>
      <variable label="F3 controls output C" CV="54" mask="XXXXXVXX" minOut="3" minFn="3" item="F3 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F3 controls output C</label>
      </variable>
      <variable label="F4 controls output C" CV="54" mask="XXXXVXXX" minOut="3" minFn="4" item="F4 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F4 controls output C</label>
      </variable>
      <variable label="F5 controls output C" CV="54" mask="XXXVXXXX" minOut="3" minFn="5" item="F5 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F5 controls output C</label>
      </variable>
      <variable label="F6 controls output C" CV="54" mask="XXVXXXXX" minOut="3" minFn="6" item="F6 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F6 controls output C</label>
      </variable>
      <variable label="F7 controls output C" CV="54" mask="XVXXXXXX" minOut="3" minFn="7" item="F7 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F7 controls output C</label>
      </variable>
      <variable label="F8 controls output C" CV="54" mask="VXXXXXXX" minOut="3" minFn="8" item="F8 controls output 3">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F8 controls output C</label>
      </variable>
      <variable label="F1 controls output D" CV="55" mask="XXXXXXXV" minOut="4" minFn="1" item="F1 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F1 controls output D</label>
      </variable>
      <variable label="F2 controls output D" CV="55" mask="XXXXXXVX" minOut="4" minFn="2" item="F2 controls output 4" default="1">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F2 controls output D</label>
      </variable>
      <variable label="F3 controls output D" CV="55" mask="XXXXXVXX" minOut="4" minFn="3" item="F3 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F3 controls output D</label>
      </variable>
      <variable label="F4 controls output D" CV="55" mask="XXXXVXXX" minOut="4" minFn="4" item="F4 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F4 controls output D</label>
      </variable>
      <variable label="F5 controls output D" CV="55" mask="XXXVXXXX" minOut="4" minFn="5" item="F5 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F5 controls output D</label>
      </variable>
      <variable label="F6 controls output D" CV="55" mask="XXVXXXXX" minOut="4" minFn="6" item="F6 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F6 controls output D</label>
      </variable>
      <variable label="F7 controls output D" CV="55" mask="XVXXXXXX" minOut="4" minFn="7" item="F7 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F7 controls output D</label>
      </variable>
      <variable label="F8 controls output D" CV="55" mask="VXXXXXXX" minOut="4" minFn="8" item="F8 controls output 4">
        <enumVal>
          <enumChoice choice="No">
            <choice>No</choice>
          </enumChoice>
          <enumChoice choice="Yes">
            <choice>Yes</choice>
          </enumChoice>
        </enumVal>
        <label>F8 controls output D</label>
      </variable>
      <variable label="User Private ID #1" CV="105" item="User Id #1">
        <decVal/>
        <label>User Private ID #1</label>
      </variable>
      <variable label="User Private ID #2" CV="106" item="User Id #2">
        <decVal/>
        <label>User Private ID #2</label>
      </variable>
      <variable label="Speed Table" CV="67">
        <speedTableVal/>
        <label>Speed Table</label>
      </variable>
<!-- Define the fixed Function-Output mapping -->
      <constant label="FL(f) controls output 1" minOut="1" default="1"/>
      <constant label="FL(r) controls output 2" minOut="2" default="1"/>
    </variables>
  </decoder>
  <pane name="Lenz">
    <column>
      <display item="Accel/Decel Trim"/>
      <label label=" ">
        <label> </label>
      </label>
    </column>
    <name>Lenz</name>
  </pane>
</decoder-config>

