<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!-- Copyright (C) JMRI 2005 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="Alex Loes (Al) trainjmri@yahoo.com" version="5.3" lastUpdated="20240401"/>
  <version author="Alain Carasso (Alain355) acarasso_fr@yahoo.fr" version="5.2" lastUpdated="20230410"/>
  <version author="Alain Carasso (Alain355) acarasso_fr@yahoo.fr" version="5.1" lastUpdated="20160429"/>
  <version author="Alain Carasso (Alain355) acarasso_fr@yahoo.fr" version="5" lastUpdated="20160414"/>
  <version author="Bernd Wisotzki (Ba), wsb56" version="4" lastUpdated="20140730"/>
  <version author="Bernd Wisotzki (Ba), wsb56" version="3" lastUpdated="20140524"/>
  <version author="Jeff Schmaltz escopetas@comcast.net" version="2" lastUpdated="20130825"/>
  <version author="John A. Stewart alex.stewart@crc.ca" version="1" lastUpdated="20100427"/>
  <!-- 
Decoder definitions; have received decoders with pamphlets dated March 2010. There are
many changes over older decoder definitions, thus the start on a new file.

Gold+ Silent-Back EMF DCC Decoder
    Lenz pamphlet 10433-01  March 2010 
    Yellow packaging top, indicating version 7.1.3
    cv7 -   95
    cv128 - 5
    
Silver direct+ Silent-Back EMF DCC Decoder
    Lenz pamphlet 10330-01 March 2010
    Grey packaging top, indicating version 7.6???
    cv7 -  95
    cv128 - 5

    Comments for Version 2

    1) Used models list from http://www.digital-plus.de/e/digitalplus-decoder-uebersicht.php as of August 2013
    2) Modified function mapping based on http://www.digital-plus.de/pdf/GOLD_SILVER_plus_manual.pdf,
       dated "4. Auflage / 4rd Edition / 4. Edition 06 11, B.10.112"
    3) Family low/high version came from p. 67 of http://www.digital-plus.de/pdf/b_90008_d.pdf, dated "Ausgabe 11 10"
    
		Comments for version 3
	
	1) Complete refactoring and added German

	Comments for version 4
	
	1) Added mechanism to present to the user only the CV he can change with his concrete model. 
	2) Updated decoder with the new silver+ Next16 and the new gold maxi
	3) Used models list from http://www.digital-plus.de/e/digitalplus-decoder-uebersicht.php as of July 2014
	4) Updated some information due to new revisions of the manuals/decoders

	Comments for version 5

	1) Added the Lenz standard plus V2 decoder (RailCom, 4 outputs with F1(f) and F1(r))
	2) Added versionID check for those Plus Serie decoder when known

Comments for version 5.2

	I added the Lenz Silver Plus Plux22 decoder (8 outputs like the Gold Maxi 10440)
	
	-->
  <!--
nmraWarrant="yes" nmraWarrantStart="200604"
-->
  <decoder>
    <family name="Lenz Plus decoders released March 2010, updated April 2016" mfg="Lenz" highVersionID="99" lowVersionID="72" comment="Decoders featuring Precision Braking Control and Low Gear Switching Drive">
    	<model model="Standard+ NEM652 10231-01" numOuts="3" numFns="31" maxMotorCurrent="1.0A" formFactor="HO" maxTotalCurrent="1.0A">
		<versionCV highVersionID="93" lowVersionID="93"/>
    		<output name="1" label="A" maxcurrent="0.3A"/>
    		<output name="2" label="B" maxcurrent="0.3A"/>
    		<output name="3" label="C" maxcurrent="0.3A"/>
    	</model>
    	<model model="Standard+ V2 NEM652 10231-02" numOuts="4" numFns="31" maxMotorCurrent="1.0A" formFactor="HO" maxTotalCurrent="1.0A">
			<versionCV highVersionID="104" lowVersionID="77"/>
    		<output name="1" label="A" maxcurrent="0.3A"/>
    		<output name="2" label="B" maxcurrent="0.3A"/>
    		<output name="3" label="C" maxcurrent="0.3A"/>
    		<output name="4" label="D" maxcurrent="0.3A"/>
    	</model>
    	<model model="Silver+ mini wired 10310-01" numOuts="2" numFns="31" maxMotorCurrent="0.5A" formFactor="N" maxTotalCurrent="0.5A">
    		<output name="1" label="A - White" maxcurrent="0.3A"/>
    		<output name="2" label="B - Yellow" maxcurrent="0.3A"/>
    	</model>
    	<model model="Silver+ mini NEM651 10311-01" numOuts="2" numFns="31" maxMotorCurrent="0.5A" formFactor="N" maxTotalCurrent="0.5A">
    		<output name="1" label="A" maxcurrent="0.3A"/>
    		<output name="2" label="B" maxcurrent="0.3A"/>
    	</model>
    	<model model="Silver+ mini wired 10310-02" numOuts="2" numFns="31" maxMotorCurrent="0.5A" formFactor="N" maxTotalCurrent="0.5A">
    		<versionCV highVersionID="96" lowVersionID="96"/>
    		<output name="1" label="A - White" maxcurrent="0.3A"/>
    		<output name="2" label="B - Yellow" maxcurrent="0.3A"/>
    	</model>
    	<model model="Silver+ mini NEM651 10311-02" numOuts="2" numFns="31" maxMotorCurrent="0.5A" formFactor="N" maxTotalCurrent="0.5A">
    		<versionCV highVersionID="96" lowVersionID="96"/>
    		<output name="1" label="A" maxcurrent="0.3A"/>
    		<output name="2" label="B" maxcurrent="0.3A"/>
    	</model>
    	<model model="Silver+ NEM652 10331-01" numOuts="5" numFns="31" maxMotorCurrent="1.0A" formFactor="HO" maxTotalCurrent="1.0A">
    		<versionCV highVersionID="95" lowVersionID="95"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    	</model>
    	<model model="Silver+ PluX12 10312-01" numOuts="5" numFns="31" maxMotorCurrent="0.75A" formFactor="TT" maxTotalCurrent="0.75A">
      		<versionCV highVersionID="97" lowVersionID="97"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    	</model>
     	<model model="Silver+ PluX22 10322-01" numOuts="8" numFns="31" maxMotorCurrent="0.75A" formFactor="TT" maxTotalCurrent="0.75A">
      		<versionCV highVersionID="97" lowVersionID="97"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    		<output name="6" label="F" maxcurrent="0.5A"/>
    		<output name="7" label="G" maxcurrent="0.5A"/>
    		<output name="8" label="H" maxcurrent="0.5A"/>
    	</model>
    	<model model="Silver+ Next18 10312-01" numOuts="5" numFns="31" maxMotorCurrent="0.75A" formFactor="TT" maxTotalCurrent="0.75A" comment="New in 2014">
    		<versionCV highVersionID="94" lowVersionID="94"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    	</model>
    	<model model="Silver+ 21 10321-01" numOuts="5" numFns="31" maxMotorCurrent="1.0A" formFactor="HO" maxTotalCurrent="1.0A">
    		<versionCV highVersionID="99" lowVersionID="99"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    	</model>
    	<model model="Silver+ direct 10330-01" numOuts="5" numFns="31" maxMotorCurrent="1.0A" formFactor="HO" maxTotalCurrent="1.0A">
    		<versionCV highVersionID="98" lowVersionID="98"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    	</model>
    	<model model="Gold+ mini wired 10410-01" numOuts="2" numFns="31" maxMotorCurrent="0.5A" formFactor="N" maxTotalCurrent="0.5A">
    		<output name="1" label="A - White" maxcurrent="0.3A"/>
    		<output name="2" label="B - Yellow" maxcurrent="0.3A"/>
    	</model>
    	<model model="Gold+ mini NEM651 10411-01" numOuts="2" numFns="31" maxMotorCurrent="0.5A" formFactor="N" maxTotalCurrent="0.5A">
    		<output name="1" label="A" maxcurrent="0.3A"/>
    		<output name="2" label="B" maxcurrent="0.3A"/>
    	</model>
    	<model model="Gold+ NEM652 10433-01" numOuts="5" numFns="31" maxMotorCurrent="1.0A" formFactor="HO" maxTotalCurrent="1.0A">
    		<versionCV highVersionID="91" lowVersionID="91"/>
    		<output name="1" label="A" maxcurrent="0.5A"/>
    		<output name="2" label="B" maxcurrent="0.5A"/>
    		<output name="3" label="C" maxcurrent="0.5A"/>
    		<output name="4" label="D" maxcurrent="0.5A"/>
    		<output name="5" label="E" maxcurrent="0.5A"/>
    	</model>
    	<model model="Gold maxi 10440" numOuts="8" numFns="31" maxMotorCurrent="3.0A" formFactor="0" maxTotalCurrent="3.0A" comment="New in 2014" connector="SUSI">
    		<versionCV highVersionID="72" lowVersionID="72"/>
    		<output name="1" label="A" maxcurrent="1.0A"/>
    		<output name="2" label="B" maxcurrent="1.0A"/>
    		<output name="3" label="C" maxcurrent="1.0A"/>
    		<output name="4" label="D" maxcurrent="1.0A"/>
    		<output name="5" label="E" maxcurrent="1.0A"/>
    		<output name="6" label="F" maxcurrent="1.0A"/>
    		<output name="7" label="G" maxcurrent="1.0A"/>
    		<output name="8" label="H" maxcurrent="1.0A"/>
    	</model>

    </family>
    <programming direct="yes" paged="yes" register="yes" ops="yes"/>
    <variables>
      <xi:include href="http://jmri.org/xml/decoders/nmra/shortAndLongAddress.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/vStartHighMid.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/accelDecel.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/mfgVersionId_cv7_8.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/bemfRep_cv9.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/consistAddrDirection.xml"/>
      <!-- this were moved earlier to fix a Xerces XInclude bug that would not -->
      <!-- allow you to next inclusion of parts/enum-disabledEnabled.xml if it -->
      <!-- had been included first directly from the top level of the XML file -->
      <xi:include href="http://jmri.org/xml/decoders/lenz/braking_cv51.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/abc_cv51.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/railcom_cv28_29.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29direction.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29speedSteps.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29analog.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29table3-28.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/protection_cv30.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/functionmap_plus.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/motorControl_cv50.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/lightingOptions2_cv55_56_116_118.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/fn_ctrl_57_59.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/lighting_cv60_cv64.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/speedTable_cv67.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/userId.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/motorControl2_cv112_114.xml"/>
      <!-- CV115 not listed in Plus manual -->
      <variables include="Gold maxi 10440,Gold+ NEM652 10433-01,Silver+ Next18 10312-01,Silver+ PluX12 10312-01,Silver+ mini wired 10310-02,Silver+ mini NEM651 10311-02,Silver+ mini wired 10310-01,Silver+ mini NEM651 10311-01,Standard+ V2 NEM652 10231-02">
      	<xi:include href="http://jmri.org/xml/decoders/lenz/susi_cv126_127.xml"/>
      </variables>
    	
      <xi:include href="http://jmri.org/xml/decoders/lenz/serviceNo_cv128.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/extendedCoupling_cv145_149.xml"/>
    </variables>
    <resets>
      <factReset label="Reset All CVs" CV="8" default="33">
         <label xml:lang="it">Reset delle CV ai valori di fabbrica</label>
      </factReset>
    </resets>
  </decoder>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneFunctionMap.xml"/>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneLenz.xml"/>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneLighting.xml"/>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneSUSI.xml"/>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneExtendedCoupling.xml"/>
</decoder-config>
