<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!DOCTYPE decoder-config SYSTEM "../DTD/decoder-config.dtd">
<!-- Copyright (C) JMRI 2003, 2004 All rights reserved -->
<!-- $Id: Lenz_54.xml,v 1.15 2009/02/07 20:22:09 jacobsen Exp $ -->
<!--                                                                        -->
<!-- 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>
    <version author="Michael Mosher mjmx@comcast.net" version="5" lastUpdated="20030815"/>
    <version author="Jack Shall lcrr@bellsouth.net" version="6" lastUpdated="20090116"/>
<!-- version 2 - add consist direction - jake -->
<!-- version 3 fix vstart bug -->
<!-- version 4 made speed table selection more generic -->
<!-- version 5 removed LE511 - it's not a BEMF decoder -->
<!-- version 6: fix reset bug, add tooltips, modify format and labels, -->
<!--    fixed CV17 label/item names, add RailCom enabling, -->
<!--    change lowVersionID to 51, move Lighting options to Lights pane -->
<!-- These are the version 5.1 thru 5.4 decoders, with "12 bit BEMF" or "5th gen BEMF " -->
<!-- and "XF & special" -->
    <decoder>
        <family name="Lenz 5th gen BEMF decoders" mfg="Lenz" lowVersionID="51">
            <model model="LE010XF" numOuts="2" nmraWarrant="yes" nmraWarrantStart="200506">
                <output name="1" label="A - White"/>
                <output name="2" label="B - Yellow"/>
            </model>
            <model model="LE011XF" numOuts="2">
                <output name="1" label="A - White"/>
                <output name="2" label="B - Yellow"/>
            </model>
            <model model="LE130XF" 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="LE0521W" numOuts="2" nmraWarrant="yes" nmraWarrantStart="200506">
                <output name="1" label="A - White"/>
                <output name="2" label="B - Yellow"/>
                <size length="0.51" width="0.36" height="0.14" units="inches"/>
            </model>
            <model model="LE0521D" numOuts="2" nmraWarrant="yes" nmraWarrantStart="200506">
                <output name="1" label="A - White"/>
                <output name="2" label="B - Yellow"/>
                <size length="0.51" width="0.36" height="0.14" units="inches"/>
            </model>
            <model model="LE1024" 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="LE1025C" numOuts="4">
                <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="LE4024" 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 (1-127)" CV="1" item="Short Address" default="3" tooltip="Sets the Primary (short, 2 digit) address">
                <shortAddressVal/>
            </variable>
            <variable label="Start Voltage (0-31)" CV="2" item="Vstart" default="0" tooltip="Sets the starting voltage at throttle speed step 1.  Note: some decoders only accept a max value of 15">
                <decVal max="31"/>
            </variable>
            <variable label="Acceleration Momentum (1-31)" CV="3" item="Accel" default="1" tooltip="Sets the acceleration rate (delay)">
                <decVal min="1" max="31"/>
            </variable>
            <variable label="Deceleration (Brake) Momentum (1-31)" CV="4" item="Decel" default="1" tooltip="Sets the deceleration rate (delay)">
                <decVal min="1" max="31"/>
            </variable>
            <variable label="Maximum Speed (1-10)" CV="5" item="Vhigh" default="10" tooltip="Sets the maximum voltage at full throttle (only active if Back EMF enabled)">
                <decVal min="1" max="10"/>
            </variable>
            <variable label="Decoder Version No." CV="7" readOnly="yes" item="Decoder Version">
                <decVal/>
            </variable>
            <variable label="Manufacturers Identification No." CV="8" readOnly="yes" item="Manufacturer" default="99">
                <decVal/>
            </variable>
            <variable label="EMF Frequency (0-15)" CV="9" item="Motor PWM Frequency" default="10" tooltip="Adjust EMF pulse rate frequency for finer motor control">
                <decVal max="15"/>
            </variable>
            <variable label="Extended Address (0001-9999)" CV="17" item="Long Address" tooltip="Sets the Extended (long, 4 digit) address">
                <longAddressVal/>
            </variable>
            <variable label="Consist Address (0-127)" CV="19" mask="XVVVVVVV" item="Consist Address" default="0" comment="Stores consist address. Range 0-127 (direction set in bit 7)">
                <decVal max="127"/>
            </variable>
            <variable label="Loco Direction In Consist" CV="19" mask="VXXXXXXX" item="Consist Direction" comment="A consist address over 127 will also set this bit">
                <enumVal>
                    <enumChoice choice="Normal"/>
                    <enumChoice choice="Reversed"/>
                </enumVal>
            </variable>
            <variable label="Locomotive's Normal Direction of Motion" CV="29" mask="XXXXXXXV" item="Locomotive Direction" default="0">
                <enumVal>
                    <enumChoice choice="Forward"/>
                    <enumChoice choice="Reverse"/>
                </enumVal>
            </variable>
            <variable label="Speed Steps (aka Headlight Mode)" CV="29" mask="XXXXXXVX" item="Speed Step Mode" default="1">
                <enumVal>
                    <enumChoice choice="14"/>
                    <enumChoice choice="28/128 (recommended)"/>
                </enumVal>
            </variable>
            <variable label="Analog Conversion Mode" CV="29" mask="XXXXXVXX" item="Analog (DC) Operation" default="1">
                <enumVal>
                    <enumChoice choice="Off (DCC operation only)"/>
                    <enumChoice choice="On (loco can operate on DC or DCC)"/>
                </enumVal>
            </variable>
            <variable label="Lenz RailCom (not used on all decoders)" CV="29" mask="XXXXVXXX" default="0" tooltip="Enables RailCom when used with Lenz systems">
                <enumVal>
                    <enumChoice choice="RailCom disabled"/>
                    <enumChoice choice="RailCom enabled"/>
                </enumVal>
            </variable>
            <variable label="Use Speed Table" CV="29" mask="XXXVXXXX" item="Speed Table Definition" default="0">
                <enumVal>
                    <enumChoice choice="Don't Use Speed Table"/>
                    <enumChoice choice="Use Speed Table"/>
                </enumVal>
            </variable>
            <variable label="Addressing Mode" CV="29" mask="XXVXXXXX" item="Address Format">
                <enumVal>
                    <enumChoice choice="2 digit addressing"/>
                    <enumChoice choice="4 digit addressing"/>
                </enumVal>
            </variable>
            <variable label="Back EMF Control" CV="50" mask="XXXXXXXV" item="Load Control" default="1" tooltip="Activates the Back EMF function">
                <enumVal>
                    <enumChoice choice="Inactive"/>
                    <enumChoice choice="Active"/>
                </enumVal>
            </variable>
            <variable label="When loco enters DC track section: " CV="50" mask="XXXXXVXX" item="DC Brake Momentum" default="0" tooltip="Governs how loco responds in DC powered track block (Analog Conversion Mode must be OFF)" comment="Governs how loco acts in DC track block">
                <enumVal>
                    <enumChoice choice="Loco continues under analog (DC) voltage control"/>
                    <enumChoice choice="Loco brakes to a stop using momentum set in CV4"/>
                </enumVal>
            </variable>
            <variable label="Directional Headlights" CV="51" mask="XXXXXXXV" item="Directional Headlights" default="0" tooltip="Enables Rule 17 for headlights (independent control)" comment="output A">
                <enumVal>
                    <enumChoice choice="Headlights are directional and operate automatically"/>
                    <enumChoice choice="Headlights are independently controlled (F0-Front, F1-Rear)"/>
                </enumVal>
            </variable>
            <variable label="Output A Dimming Control" CV="51" mask="XXXXXXVX" item="Function F0F behavior" default="0" tooltip="Determines how front headlight dims (when dimming is enabled)" comment="CV 52 controls amount">
                <enumVal>
                    <enumChoice choice="Front headlight is always dimmed"/>
                    <enumChoice choice="F1 or F4 controls headlight dimming"/>
                </enumVal>
            </variable>
            <variable label="Front Headlight (Output A) Dimming" CV="51" mask="XXXXXVXX" item="Function F0F effect generated" default="0" tooltip="Enables front headlight dimming">
                <enumVal>
                    <enumChoice choice="Front headlight never dim"/>
                    <enumChoice choice="Front headlight can dim"/>
                </enumVal>
            </variable>
            <variable label="Output A is a Gyrolight" CV="51" mask="XXXVXXXX" item="Function F0F option 1">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output A is a Mars light" CV="51" mask="XXVXXXXX" item="Function F0F option 2">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output A is a single strobe" CV="51" mask="XVXXXXXX" item="Function F0F option 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output A is a double strobe" CV="51" mask="VXXXXXXX" item="Function F0F option 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output A Dimming Intensity (0-255)" CV="52" item="Function F0F options" default="64" tooltip="Sets intensity of dimmed headlight (larger number = brighter light)">
                <decVal/>
            </variable>
            <variable label="Output B Dimming Control" CV="57" mask="XXXXXXVX" item="Function F0R behavior" default="0" tooltip="Determines how rear headlight dims (when dimming is enabled)" comment="CV 58 controls amount">
                <enumVal>
                    <enumChoice choice="Rear headlight is always dimmed"/>
                    <enumChoice choice="F1 or F4 controls headlight dimming"/>
                </enumVal>
            </variable>
            <variable label="Rear Headlight (Output B) Dimming" CV="57" mask="XXXXXVXX" item="Function F0R effect generated" default="0" tooltip="Enables rear headlight dimming">
                <enumVal>
                    <enumChoice choice="Rear headlight never dim"/>
                    <enumChoice choice="Rear headlight can dim"/>
                </enumVal>
            </variable>
            <variable label="Output B is a Gyrolight" CV="57" mask="XXXVXXXX" item="Function F0R option 1">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output B is a Mars light" CV="57" mask="XXVXXXXX" item="Function F0R option 2">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output B is a single strobe" CV="57" mask="XVXXXXXX" item="Function F0R option 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output B is a double strobe" CV="57" mask="VXXXXXXX" item="Function F0R option 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output B Dimming Intensity (0-255)" CV="58" item="Function F0R options" default="64" tooltip="Sets intensity of dimmed headlight (larger number = brighter light)">
                <decVal/>
            </variable>
            <variable label="Blinking Rate for Outputs C and D (0-255)" CV="56" minOut="3" item="Function 1 behavior" default="15" tooltip="Sets the blinking rate for outputs C and D">
                <decVal/>
            </variable>
            <variable label="Output C Blinks" CV="53" mask="XXXXXXXV" minOut="3" item="Function 1 options" default="0" tooltip="Output C blinks with the frequency set in CV56">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Output D Blinks" CV="53" mask="XXXXXXVX" minOut="4" item="Function 1 option 2" default="0" tooltip="Output D blinks with the frequency set in CV56">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Outputs C and D act as Ditch Lights" CV="53" mask="XXXXXVXX" item="Function 1 option 3" default="0" minOut="3" tooltip="CV55 controls which function turns on both ditch lights and CV54 controls which function activates the alternating blinking">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </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"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F2 controls output C" CV="54" mask="XXXXXXVX" minOut="3" minFn="2" item="F2 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F3 controls output C" CV="54" mask="XXXXXVXX" minOut="3" minFn="3" item="F3 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F4 controls output C" CV="54" mask="XXXXVXXX" minOut="3" minFn="4" item="F4 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F5 controls output C" CV="54" mask="XXXVXXXX" minOut="3" minFn="5" item="F5 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F6 controls output C" CV="54" mask="XXVXXXXX" minOut="3" minFn="6" item="F6 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F7 controls output C" CV="54" mask="XVXXXXXX" minOut="3" minFn="7" item="F7 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F8 controls output C" CV="54" mask="VXXXXXXX" minOut="3" minFn="8" item="F8 controls output 3">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F1 controls output D" CV="55" mask="XXXXXXXV" minOut="4" minFn="1" item="F1 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </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"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F3 controls output D" CV="55" mask="XXXXXVXX" minOut="4" minFn="3" item="F3 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F4 controls output D" CV="55" mask="XXXXVXXX" minOut="4" minFn="4" item="F4 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F5 controls output D" CV="55" mask="XXXVXXXX" minOut="4" minFn="5" item="F5 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F6 controls output D" CV="55" mask="XXVXXXXX" minOut="4" minFn="6" item="F6 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F7 controls output D" CV="55" mask="XVXXXXXX" minOut="4" minFn="7" item="F7 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="F8 controls output D" CV="55" mask="VXXXXXXX" minOut="4" minFn="8" item="F8 controls output 4">
                <enumVal>
                    <enumChoice choice="No"/>
                    <enumChoice choice="Yes"/>
                </enumVal>
            </variable>
            <variable label="Speed Table" CV="67">
                <speedTableVal/>
            </variable>
            <variable label="User Private ID #1 (0-255)" CV="105" item="User Id #1">
                <decVal/>
            </variable>
            <variable label="User Private ID #2 (0-255)" CV="106" item="User Id #2">
                <decVal/>
            </variable>
            <variable label="Decoder Software Version" CV="128" readOnly="yes" default="02" tooltip="The decoder software version number (read only)">
                <decVal/>
            </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>
        <resets>
            <factReset label="Reset All CVs to factory defaults (use Register Mode for this)" CV="8" default="33"/>
        </resets>
    </decoder>
    <pane name="Lenz">
        <column>
            <display item="Decoder Software Version"/>
            <label label=" "/>
            <display item="Lenz RailCom (not used on all decoders)"/>
        </column>
    </pane>
</decoder-config>
