<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!DOCTYPE decoder-config SYSTEM "../DTD/decoder-config.dtd">

<!-- Copyright (C) JMRI 2004 All rights reserved -->
<!-- $Id: Lenz_51.xml,v 1.6 2008/03/06 03:30:41 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 Greene mgreene@cedarlane.com"
			version="2" lastUpdated="20040716" />

<!-- These are the version 5.1 decoders -->
<!-- The defaults in this file match the values found in decoders from the factory but not the documentation -->
<!-- Note that these Lenz decoders only support a 15 position speed table CV67-CV81 -->
<!-- This file was built using the Lenz 5.4 XML file as a basis -->

<decoder>
	<family name="Lenz 4th gen BEMF decoders" mfg="Lenz" lowVersionID="51">
		<model model="LE030" maxInputVolts="16V" maxMotorCurrent="0.7A"
		 maxTotalCurrent="0.7A" numOuts="2" formFactor="N" >
			<output name="1" label="A - White" />
			<output name="2" label="B - Yellow" />
			<size length="0.1.4" width="0.45" height="0.13" units="inches" />
			</model>
		<model model="LE040" maxInputVolts="16V" maxMotorCurrent="0.7A"
		 maxTotalCurrent="0.7A" numOuts="2" formFactor="N" >
			<output name="1" label="A - White" />
			<output name="2" label="B - Yellow" />
			<size length="0.63" width="0.57" height="0.18" units="inches" />
			</model>
		<model model="LE130" maxInputVolts="16V" maxMotorCurrent="1.0A"
		 maxTotalCurrent="1.2A" numOuts="4" formFactor="HO" >
			<output name="1" label="A - White" />
			<output name="2" label="B - Yellow" />
			<output name="3" label="C - Green" />
			<output name="4" label="D - Violet" />
			<size length="1.04" width="0.67" height="0.26" units="inches" />
		   </model>
		<model model="LE135" maxInputVolts="16V" maxMotorCurrent="1.3A"
		 maxTotalCurrent="1.5A" numOuts="3" formFactor="HO" >
			<output name="1" label="A - White" />
			<output name="2" label="B - Yellow" />
			<output name="3" label="C - Green" />
			<size length="1.12" width="0.83" height="0.22" units="inches" />
		   </model>
		<model model="LE230" maxInputVolts="26V" maxMotorCurrent="2.5A"
		        nmraWarrant="yes" nmraWarrantStart="200506"
		        maxTotalCurrent="2.5A" numOuts="8" formFactor="Large Scale" >
			<output name="1" label="A - Terminal L1" />
			<output name="2" label="B - Terminal L2" />
			<output name="3" label="C - S1: Yellow" />
			<output name="4" label="D - S2: White" />
			<output name="5" label="E - S3: Black" />
			<output name="6" label="F - S4: Red" />
			<output name="7" label="G - S5: Gray" />
			<output name="8" label="H - S6: Orange" />
			<size length="2.75" width="1.18" height="0.50" units="inches" />
		   </model>
	</family>

	<programming direct="byteOnly" paged="yes"
	                     register="yes" ops="yes"></programming>

	<variables>

		<variable label="Primary Address" CV="1" comment="Short address"
						item="Short Address"  default="03">
			<shortAddressVal/></variable>

		<variable label="Start Volts" CV="2" item="Vstart"
				comment="Range 1-15" default="4">
			<decVal max="15"/>
			</variable>

		<variable label="Accel" CV="3"
				comment="Range 1-31" default="4">
			<decVal max="31"/>
			</variable>

		<variable label="Decel" CV="4"
				comment="Range 1-31" default="1" >
			<decVal max="31"/>
			</variable>

		<variable label="Vhigh" CV="5" default="255" >
					<decVal max="10"/></variable>

		<variable label="Version ID" CV="7" readOnly="yes"
				item="Decoder Version" default="51" >
			<decVal/>
			</variable>

		<variable label="Manufacturer ID" CV="8" readOnly="yes"
				item="Manufacturer" default="99">
			<decVal/>
			</variable>

		<variable label="EMF frequency" CV="9"
				comment="Range 0-15" item="Total PWM Period" default="4">
			<decVal/>
			</variable>

		<variable label="Long Address" CV="17" item="Extended Address"
		        comment="4 digit address (Range 0001-9999)">
			<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="0">
			<enumVal>
				<enumChoice choice="14"/>
				<enumChoice choice="28"/>
				</enumVal>
			</variable>

		<variable label="Analog conversion mode" CV="29"
				mask="XXXXXVXX" default="1"
				item="Analog (DC) Operation">
			<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="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="60"
				mask="XXXXXXXV" default="1" >
  			<enumVal>
				<enumChoice choice="Back EMF control inactive"/>
				<enumChoice choice="Back EMF control active"/>
				</enumVal>
			</variable>


	<variable label="Brake Momentum on DC" CV="60" 
				item="DC Brake Momentum" mask="XXXXXVXX" default="0"

	          	comment="Governs how loco acts in DC track block">
			<enumVal>
				<enumChoice choice="Loco runs under DC analog voltage control"/>
				<enumChoice choice="Loco brakes to a stop using momentum set in CV4"/>
		        </enumVal>
			</variable>

	<variable label="Speed Table" CV="67">
			<speedTableVal entries="15"
			 max="63"/>
			</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" /> 
	<constant label="F1 controls output 3" minOut="3" default="1" /> 
	<constant label="F2 controls output 4" minOut="4" default="1" />
	<constant label="F3 controls output 5" minOut="5" default="1" /> 
	<constant label="F4 controls output 6" minOut="6" default="1" /> 
	<constant label="F5 controls output 7" minOut="7" default="1" /> 
	<constant label="F6 controls output 8" minOut="8" default="1" /> 


	</variables>

</decoder>

<pane name="Lenz">
	<column>

	<display item="Back EMF control" />
	<display item="Brake Momentum on DC" />
	</column>
	
</pane>

</decoder-config>



