<?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: ESU_LokPilotDCC.xml,v 1.9 2008/03/08 22:52:36 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 = "Walter Thompson wsthompson#earthlink.net"
        version = "4"
        lastUpdated = "20050619"/>
    <!--Based on the contribution of many others -->
    <!--version 2 - add consist direction - jake -->
    <!--version 3 - fix mfg name - jake -->
    <!--version 4 - changed numerious variable "items" so that Comprehensive programmer will work
         in place of MFG specific programmer, also added CV55, numFns to 8. wsthompson,@earthlink.net -->
    <decoder>
        <family
            name = "ESU LokPilot Silent BEMF decoders"
            mfg = "Electronic Solutions Ulm GmbH"
            lowVersionID = "21">
            <model
                model = "ESU_LokPilotDCC"
                numOuts = "6"
                numFns = "8"
                nmraWarrant="yes">
                <output name = "1" label = "Front Lights"/>
                <output name = "2" label = "Back Lights"/>
                <output name = "3" label = "Aux1"/>
                <output name = "4" label = "Aux2"/>
                <output name = "5" label = "Shunting"/>
                <output name = "6" label = "Acc/Dec off"/>
            </model>
        </family>
        <programming
            direct = "yes"
            paged = "yes"
            register = "yes"
            ops = "yes" />
        <variables>
            <variable
                label = "Primary Address"
                CV = "1"
                comment = "Short address"
                item = "Short Address"
                default = "03">
                <shortAddressVal/>
            </variable>
            <variable
                label = "Vstart"
                CV = "2"
                default = "3"
                comment = "A value of 63 corresponds to 100%">
                <decVal max = "63"/>
            </variable>
            <variable
                label = "Acceleration"
                CV = "3"
                default = "4"
                item = "Accel">
                <decVal max = "63"/>
            </variable>
            <variable
                label = "Deceleration"
                CV = "4"
                default = "3"
                item = "Decel">
                <decVal max = "63"/>
            </variable>
            <variable
                label = "Vhigh"
                CV = "5"
                default = "63"
                comment = "Range 1-63">
                <decVal max = "63"/>
            </variable>
            <variable
                label = "Vmid"
                CV = "6"
                default = "25"
                comment = "Range 1-63">
                <decVal max = "63"/>
            </variable>
            <!--readOnly="yes" -->
            <variable
                label = "Decoder Version"
                CV = "7"
                item = "Decoder Version">
                <decVal/>
                <!--readOnly="yes" -->
            </variable>
            <variable
                label = "Manufacturer ID"
                CV = "8"
                item = "Manufacturer">
                <decVal/>
            </variable>
            <variable label = "Manufacturer ID - Reset" CV = "8">
                <decVal/>
            </variable>
            <variable
                label = "Extended Address"
                CV = "17"
                item = "Long Address">
                <longAddressVal/>
            </variable>
            <variable
                label = "Consist Address"
                CV = "19"
                mask = "XVVVVVVV"
                item = "Consist Address">
                <decVal/>
            </variable>
            <variable
                label = "Consist Direction"
                CV = "19"
                mask = "VXXXXXXX">
                <enumVal>
                    <enumChoice choice = "Normal"></enumChoice>
                    <enumChoice choice = "Reversed"></enumChoice>
                </enumVal>
            </variable>
            <variable
                label = "Normal Direction of Motion"
                CV = "29"
                mask = "XXXXXXXV"
                item = "Locomotive Direction">
                <enumVal>
                    <enumChoice choice = "Forward"/>
                    <enumChoice choice = "Reverse"/>
                </enumVal>
            </variable>
            <variable
                label = "Speed Steps"
                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"
                default = "1"
                item = "Power Source Conversion">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "On"/>
                </enumVal>
            </variable>
            <variable
                label = "Use Speed Table"
                CV = "29"
                mask = "XXXVXXXX"
                item = "Speed Table Definition">
                <enumVal>
                    <enumChoice choice = "Use Vstart, Vmid, Vhigh (CV29, bit 4)"/>
                    <enumChoice choice = "Use Table (CV's 67-94)"/>
                </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 = "FL(f) controls output 1"
                CV = "33"
                mask = "XXXXXXXV"
                minOut = "1"
                default = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(f) controls output 2"
                CV = "33"
                mask = "XXXXXXVX"
                minOut = "2">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(f) controls output 3"
                CV = "33"
                mask = "XXXXXVXX"
                minOut = "3">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(f) controls output 4"
                CV = "33"
                mask = "XXXXVXXX"
                minOut = "4">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(f) controls output 5"
                CV = "33"
                mask = "XXXVXXXX"
                minOut = "5">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(f) controls output 6"
                CV = "33"
                mask = "XXVXXXXX"
                minOut = "6">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(r) controls output 1"
                CV = "34"
                mask = "XXXXXXXV"
                minOut = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(r) controls output 2"
                CV = "34"
                mask = "XXXXXXVX"
                minOut = "2"
                default = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(r) controls output 3"
                CV = "34"
                mask = "XXXXXVXX"
                minOut = "3">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(r) controls output 4"
                CV = "34"
                mask = "XXXXVXXX"
                minOut = "4">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(r) controls output 5"
                CV = "34"
                mask = "XXXVXXXX"
                minOut = "5">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "FL(r) controls output 6"
                CV = "34"
                mask = "XXVXXXXX"
                minOut = "6">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F1 controls output 1"
                CV = "35"
                mask = "XXXXXXXV"
                minOut = "1"
                minFn = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F1 controls output 2"
                CV = "35"
                mask = "XXXXXXVX"
                minOut = "2"
                minFn = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F1 controls output 3"
                CV = "35"
                mask = "XXXXXVXX"
                minOut = "3"
                minFn = "1"
                default = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F1 controls output 4"
                CV = "35"
                mask = "XXXXVXXX"
                minOut = "4"
                minFn = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F1 controls output 5"
                CV = "35"
                mask = "XXXVXXXX"
                minOut = "5"
                minFn = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F1 controls output 6"
                CV = "35"
                mask = "XXVXXXXX"
                minOut = "6"
                minFn = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F2 controls output 1"
                CV = "36"
                mask = "XXXXXXXV"
                minOut = "1"
                minFn = "2">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F2 controls output 2"
                CV = "36"
                mask = "XXXXXXVX"
                minOut = "2"
                minFn = "2">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F2 controls output 3"
                CV = "36"
                mask = "XXXXXVXX"
                minOut = "3"
                minFn = "2">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F2 controls output 4"
                CV = "36"
                mask = "XXXXVXXX"
                minOut = "4"
                minFn = "2"
                default = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F2 controls output 5"
                CV = "36"
                mask = "XXXVXXXX"
                minOut = "5"
                minFn = "2">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F2 controls output 6"
                CV = "36"
                mask = "XXVXXXXX"
                minOut = "6"
                minFn = "2">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F3 controls output 3"
                CV = "37"
                mask = "XXXXXXXV"
                minOut = "3"
                minFn = "3">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F3 controls output 4"
                CV = "37"
                mask = "XXXXXXVX"
                minOut = "4"
                minFn = "3">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F3 controls output 5"
                CV = "37"
                mask = "XXXXXVXX"
                minOut = "5"
                minFn = "3"
                default = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F3 controls output 6"
                CV = "37"
                mask = "XXXXVXXX"
                minOut = "6"
                minFn = "3">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F4 controls output 3"
                CV = "38"
                mask = "XXXXXXXV"
                minOut = "3"
                minFn = "4">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F4 controls output 4"
                CV = "38"
                mask = "XXXXXXVX"
                minOut = "4"
                minFn = "4">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F4 controls output 5"
                CV = "38"
                mask = "XXXXXVXX"
                minOut = "5"
                minFn = "4">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F4 controls output 6"
                CV = "38"
                mask = "XXXXVXXX"
                minOut = "6"
                minFn = "4"
                default = "1">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F5 controls output 3"
                CV = "39"
                mask = "XXXXXXXV"
                minOut = "3"
                minFn = "5">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F5 controls output 4"
                CV = "39"
                mask = "XXXXXXVX"
                minOut = "4"
                minFn = "5">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F5 controls output 5"
                CV = "39"
                mask = "XXXXXVXX"
                minOut = "5"
                minFn = "5">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F5 controls output 6"
                CV = "39"
                mask = "XXXXVXXX"
                minOut = "6"
                minFn = "5">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F6 controls output 3"
                CV = "40"
                mask = "XXXXXXXV"
                minOut = "3"
                minFn = "6">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F6 controls output 4"
                CV = "40"
                mask = "XXXXXXVX"
                minOut = "4"
                minFn = "6">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F6 controls output 5"
                CV = "40"
                mask = "XXXXXVXX"
                minOut = "5"
                minFn = "6">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "F6 controls output 6"
                CV = "40"
                mask = "XXXXVXXX"
                minOut = "6"
                minFn = "6">
                <enumVal>
                    <enumChoice choice = "No"/>
                    <enumChoice choice = "Yes"/>
                </enumVal>
            </variable>
            <variable
                label = "BEMF Active"
item="EMF Static Config"
                CV = "49"
                mask = "XXXXXXXV"
                default = "1">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "On"/>
                </enumVal>
            </variable>
            <variable
                label = "Adjust EMK Voltage"
item="EMF Dynamic Config"
                CV = "51"
                default = "56"
                comment = "Range 0-79">
                <decVal min = "0" max = "79"/>
            </variable>
            <variable
                label = "K Adjustment"
item="EMF Droop Config"
                CV = "52"
                default = "32"
                comment = "Range 0-79">
                <decVal min = "0" max = "79"/>
            </variable>

            <variable
                label = "I Adjustment" 
item="EMF Feedback Cutout"
                CV = "53"
                default = "24"
                comment = "Range 0-79">
                <decVal min = "0" max = "79"/>
            </variable>

		<variable label="Analog Mode"
		    item = "Analog Mode"
		    CV = "55"
		    mask = "XXXXXXVV">
		    <enumVal>
			<enumChoice choice = "Off"/>
			<enumChoice choice = "AC Analog Mode"/>
			<enumChoice choice = "DC Analog Mode"/>
			<enumChoice choice = "AC+DC Analog Mode"/>
		    </enumVal>
		</variable>

           
            <variable
                label = "Signal Dependent Deceleration"
                CV = "57"
                default = "0"
                comment = "Range 0-63">
                <decVal min = "0" max = "63"/>
            </variable>
            <variable
                label = "Blink Rate"
                item = "Global lighting option 1"
                CV = "59"
                default = "33"
                comment = "Range 10-63, value is multiplied by 32.768 ms">
                <decVal min = "10" max = "63"/>
            </variable>
            <variable
                label = "Brightness Head Lights"
                item = "Output 1 effect generated"
                CV = "60"
                default = "15"
                mask = "XXXXVVVV">
                <decVal/>
            </variable>
            <variable
                label = "Output Configuration Head Lights"
                item = "Output 1 behavior"
                CV = "60"
                default = "0"
                mask = "XVVVXXXX">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "Blink (Phase 1)"/>
                    <enumChoice choice = "Blink (Phase 2)"/>
                    <enumChoice choice = "Strobe"/>
                    <enumChoice choice = "Double Strobe"/>
                    <enumChoice choice = "Marslight"/>
                    <enumChoice choice = "Gyrolight"/>
                </enumVal>
            </variable>
            <variable
                label = "Brightness Back Lights"
                item = "Output 2 effect generated"
                CV = "61"
                default = "15"
                mask = "XXXXVVVV">
                <decVal/>
            </variable>
            <variable
                label = "Output Configuration Back Lights"
                item = "Output 2 behavior"
                CV = "61"
                default = "0"
                mask = "XVVVXXXX">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "Blink (Phase 1)"/>
                    <enumChoice choice = "Blink (Phase 2)"/>
                    <enumChoice choice = "Strobe"/>
                    <enumChoice choice = "Double Strobe"/>
                    <enumChoice choice = "Marslight"/>
                    <enumChoice choice = "Gyrolight"/>
                </enumVal>
            </variable>
            <variable
                label = "Brightness AUX1"
                item = "Output 3 effect generated"
                CV = "62"
                default = "15"
                mask = "XXXXVVVV">
                <decVal/>
            </variable>
            <variable
                label = "Output Configuration AUX1"
                item = "Output 3 behavior"
                CV = "62"
                default = "0"
                mask = "XVVVXXXX">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "Blink (Phase 1)"/>
                    <enumChoice choice = "Blink (Phase 2)"/>
                    <enumChoice choice = "Strobe"/>
                    <enumChoice choice = "Double Strobe"/>
                    <enumChoice choice = "Marslight"/>
                    <enumChoice choice = "Gyrolight"/>
                </enumVal>
            </variable>
            <variable
                label = "Brightness AUX2"
                item = "Output 4 effect generated"
                CV = "63"
                default = "15"
                mask = "XXXXVVVV">
                <decVal/>
            </variable>
            <variable
                label = "Output Configuration AUX2"
                item = "Output 4 effect generated"
                CV = "63"
                default = "0"
                mask = "XVVVXXXX">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "Blink (Phase 1)"/>
                    <enumChoice choice = "Blink (Phase 2)"/>
                    <enumChoice choice = "Strobe"/>
                    <enumChoice choice = "Double Strobe"/>
                    <enumChoice choice = "Marslight"/>
                    <enumChoice choice = "Gyrolight"/>
                </enumVal>
            </variable>
            <variable
                label = "DCC Speedstep Detection"
                CV = "64"
                default = "1"
                mask = "XXXXXXXV">
                <enumVal>
                    <enumChoice choice = "Off"/>
                    <enumChoice choice = "On"/>
                </enumVal>
            </variable>
            <variable
                label = "ZIMO Manual Function"
                CV = "64"
                default = "1"
                mask = "XXXXXXVX">
                <enumVal>
                    <enumChoice choice = "New (MX2000)"/>
                    <enumChoice choice = "Old (MX1)"/>
                </enumVal>
            </variable>
            <variable
                label = "Emergency Stop"
                CV = "64"
                default = "0"
                mask = "XXXXXVXX">
                <enumVal>
                    <enumChoice choice = "On"/>
                    <enumChoice choice = "Off"/>
                </enumVal>
            </variable>
            <variable label = "Speed Table" CV = "67">
                <speedTableVal/>
            </variable>
        </variables>
    </decoder>
	
	<pane name="ESU">
		<column>
			<display item="DCC Speedstep Detection" tooltip="CV 64 bit 0" />
		</column>
		<column>
			<display item="ZIMO Manual Function" tooltip="CV 64 bit 1"/>
		</column>
		<column>
			<display item="Emergency Stop" tooltip="CV 64 bit 3"/>
		</column>
		<column>
			<display item="Signal Dependent Deceleration" tooltip="CV 57" />
		</column>		
		<column>
			<display item="Analog Mode" />
		</column>		
	
	</pane>
</decoder-config>
