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

<!-- Copyright (C) JMRI 2002, 2005, 2007, 2008 All rights reserved -->
<!-- $Id: Digitrax_Economy.xml,v 1.9 2009/06/20 00:22:40 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="Christopher Zurek" 
					version="5" lastUpdated="20090519"/>
		<version author="Christopher Zurek" 
					version="4" lastUpdated="20080309"/>
		<version author="Bob Jacobsen" 
					version="3" lastUpdated="20070422"/>
		<version author="Michael Mosher mjmx@comcast.net" 
					version="2" lastUpdated="20050112"/>

		<!-- Created from version 10 of the 1x3 file -->

      <!-- Version 1.1 - changed spelling of "behavior" (Jack Shall) -->
      <!-- Version 2 - fixed mask for "Vstart/Vmid/Vfull in 128 step mode" -->
      <!-- Version 3 - added reset entries - Bob Jacobsen -->
	  <!-- Version 4 - removed "Rear Headlight to F4" and fixed function mapping (Christopher Zurek) -->
	  <!-- Version 5 - added F1 and F2 for later made decoders (Christopher Zurek) -->

<decoder>
	<family name="Economy Series 3 with FX3, silent" 
			mfg="Digitrax" lowVersionID="35" highVersionID="36">
	<model model="DH123" numOuts="2" numFns="5" connector="9pin" 
				lowVersionID="35" highVersionID="36">
			<output name="1" label="White" connection="wire" /> 
			<output name="2" label="Yellow" connection="wire" />
				</model>
	<model model="DH123 Four Function" numOuts="4" numFns="8" connector="9pin" 
				lowVersionID="36" highVersionID="36">
			<output name="1" label="White" connection="wire" /> 
			<output name="2" label="Yellow" connection="wire" />
			<output name="3" label="Green" connection="wire" />
			<output name="4" label="Violet" connection="wire" /> 
			<size length="1.2" width=".66" height="0.25" 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="A value of 255 corresponds to 100%">
			<decVal></decVal>
			</variable>
		<variable label="Acceleration Rate" CV="3" item="Accel">
			<decVal max="31"/>
			</variable>
		<variable label="Deceleration Rate" CV="4" item="Decel">
			<decVal max="31"/>
			</variable>
		<variable label="Max Volts" CV="5" item="Vhigh">
			<decVal/>
			</variable>
		<variable label="Mid Volts" CV="6" item="Vmid">
			<decVal/>
			</variable>
		<variable label="Version ID" CV="7" readOnly="yes" item="Decoder Version">
				<decVal/>
			</variable>
		<variable label="Manufacturer ID" CV="8" readOnly="yes" item="Manufacturer">
				<decVal/>
			</variable>

		<variable label="Motor Drive Frequency" CV="9" item="Total PWM Period" default="0"
					comment="00 is fastest, 255 is slowest">
				<decVal/>
			</variable>

		<variable label="Long Address" CV="17" item="Extended Address">
			<longAddressVal/>
			</variable>
		<variable label="Advanced Consist address" CV="19" item="Consist Address" mask="XVVVVVVV" default="0">
			<decVal max="127"/>
			</variable>
		<variable label="Advanced Consist direction" CV="19" item="Consist Direction" mask="VXXXXXXX" default="0">
			<enumVal>
				<enumChoice choice="forward"/>
				<enumChoice choice="reverse"/>
				</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"/>
				</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="Use Vstart, Vmid, Vhigh"/>
				<enumChoice choice="Use 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="Forward light F0F effect generated" CV="49" mask="XXXXVVVV"
					item="Function F0F effect generated">
			<enumVal>
				<enumChoice choice="Normal function of lead"/>
				<enumChoice choice="Random flicker"/>
				<enumChoice choice="Mars light"/>
				<enumChoice choice="Flashing head light"/>
				<enumChoice choice="Single pulse strobe"/>
				<enumChoice choice="Double pulse strobe"/>
				<enumChoice choice="Rotary beacon simulation"/>
				<enumChoice choice="Gyralite"/>
				<enumChoice choice="Rule 17 dimmable headlight"/>
				<enumChoice choice="FRED end of train light"/>
				<enumChoice choice="Right ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Left ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Reserved (0x0C)"/>
				<enumChoice choice="Reserved (0x0D)"/>
				<enumChoice choice="Reserved (0x0E)"/>
				<enumChoice choice="Reserved (0x0F)"/>
				</enumVal>
			</variable>
		<variable label="Forward light F0F behavior" CV="49" mask="VVVVXXXX"
					item="Function F0F behavior">
			<enumVal>
				<enumChoice choice="Forward direction, ON with function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with function ON, phase B"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase A"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase B"/>
				<enumChoice choice="Forward direction, ON with F0 on &amp; function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with F0 on &amp; function ON, phase B"/>
				<enumChoice choice="Special logic for Fwd Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Special logic for Rev Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Reserved (0x8)"/>
				<enumChoice choice="Reserved (0x9)"/>
				<enumChoice choice="Speed=0, non-directional, phase A, function qualifier"/>
				<enumChoice choice="Speed>0, non-directional, phase B, function qualifier"/>
				<enumChoice choice="Reserved (0xC)"/>
				<enumChoice choice="Reserved (0xD)"/>
				<enumChoice choice="Ditch off phase A - Alternate operation, flash with F2"/>
				<enumChoice choice="Ditch off phase B - Alternate operation, flash with F2"/>
				</enumVal>
			</variable>
		<variable label="Reverse light F0R effect generated" CV="50" mask="XXXXVVVV"
					item="Function F0R effect generated">
			<enumVal>
				<enumChoice choice="Normal function of lead"/>
				<enumChoice choice="Random flicker"/>
				<enumChoice choice="Mars light"/>
				<enumChoice choice="Flashing head light"/>
				<enumChoice choice="Single pulse strobe"/>
				<enumChoice choice="Double pulse strobe"/>
				<enumChoice choice="Rotary beacon simulation"/>
				<enumChoice choice="Gyralite"/>
				<enumChoice choice="Rule 17 dimmable headlight"/>
				<enumChoice choice="FRED end of train light"/>
				<enumChoice choice="Right ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Left ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Reserved (0x0C)"/>
				<enumChoice choice="Reserved (0x0D)"/>
				<enumChoice choice="Reserved (0x0E)"/>
				<enumChoice choice="Reserved (0x0F)"/>
				</enumVal>
			</variable>
		<variable label="Reverse light F0R behavior" CV="50" mask="VVVVXXXX"
					item="Function F0R behavior">
			<enumVal>
				<enumChoice choice="Forward direction, ON with function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with function ON, phase B"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase A"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase B"/>
				<enumChoice choice="Forward direction, ON with F0 on &amp; function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with F0 on &amp; function ON, phase B"/>
				<enumChoice choice="Special logic for Fwd Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Special logic for Rev Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Reserved (0x8)"/>
				<enumChoice choice="Reserved (0x9)"/>
				<enumChoice choice="Speed=0, non-directional, phase A, function qualifier"/>
				<enumChoice choice="Speed>0, non-directional, phase B, function qualifier"/>
				<enumChoice choice="Reserved (0xC)"/>
				<enumChoice choice="Reserved (0xD)"/>
				<enumChoice choice="Ditch off phase A - Alternate operation, flash with F2"/>
				<enumChoice choice="Ditch off phase B - Alternate operation, flash with F2"/>
				</enumVal>
			</variable>
			<variable label="Function 1 effect generated" CV="51" mask="XXXXVVVV" minOut="3">
			<enumVal>
				<enumChoice choice="Normal function of lead"/>
				<enumChoice choice="Random flicker"/>
				<enumChoice choice="Mars light"/>
				<enumChoice choice="Flashing head light"/>
				<enumChoice choice="Single pulse strobe"/>
				<enumChoice choice="Double pulse strobe"/>
				<enumChoice choice="Rotary beacon simulation"/>
				<enumChoice choice="Gyralite"/>
				<enumChoice choice="Rule 17 dimmable headlight"/>
				<enumChoice choice="FRED end of train light"/>
				<enumChoice choice="Right ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Left ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Reserved (0x0C)"/>
				<enumChoice choice="Reserved (0x0D)"/>
				<enumChoice choice="Reserved (0x0E)"/>
				<enumChoice choice="Reserved (0x0F)"/>
				</enumVal>
			</variable>
		<variable label="Function 1 behavior" CV="51" mask="VVVVXXXX" minOut="3">
			<enumVal>
				<enumChoice choice="Forward direction, ON with function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with function ON, phase B"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase A"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase B"/>
				<enumChoice choice="Forward direction, ON with F0 on &amp; function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with F0 on &amp; function ON, phase B"/>
				<enumChoice choice="Special logic for Fwd Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Special logic for Rev Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Reserved (0x8)"/>
				<enumChoice choice="Reserved (0x9)"/>
				<enumChoice choice="Speed=0, non-directional, phase A, function qualifier"/>
				<enumChoice choice="Speed&gt;0, non-directional, phase B, function qualifier"/>
				<enumChoice choice="Reserved (0xC)"/>
				<enumChoice choice="Reserved (0xD)"/>
				<enumChoice choice="Ditch off phase A - Alternate operation, flash with F2"/>
				<enumChoice choice="Ditch off phase B - Alternate operation, flash with F2"/>
				</enumVal>
			</variable>
		<variable label="Function 2 effect generated" CV="52" mask="XXXXVVVV" minOut="4">
			<enumVal>
				<enumChoice choice="Normal function of lead"/>
				<enumChoice choice="Random flicker"/>
				<enumChoice choice="Mars light"/>
				<enumChoice choice="Flashing head light"/>
				<enumChoice choice="Single pulse strobe"/>
				<enumChoice choice="Double pulse strobe"/>
				<enumChoice choice="Rotary beacon simulation"/>
				<enumChoice choice="Gyralite"/>
				<enumChoice choice="Rule 17 dimmable headlight"/>
				<enumChoice choice="FRED end of train light"/>
				<enumChoice choice="Right ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Left ditch light; when F2 on, flashes alternately"/>
				<enumChoice choice="Reserved (0x0C)"/>
				<enumChoice choice="Reserved (0x0D)"/>
				<enumChoice choice="Reserved (0x0E)"/>
				<enumChoice choice="Reserved (0x0F)"/>
				</enumVal>
			</variable>
		<variable label="Function 2 behavior" CV="52" mask="VVVVXXXX" minOut="4">
			<enumVal>
				<enumChoice choice="Forward direction, ON with function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with function ON, phase B"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase A"/>
				<enumChoice choice="Non directional, ON with function ON, effect phase B"/>
				<enumChoice choice="Forward direction, ON with F0 on &amp; function ON, phase A"/>
				<enumChoice choice="Reverse direction, ON with F0 on &amp; function ON, phase B"/>
				<enumChoice choice="Special logic for Fwd Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Special logic for Rev Ditch Light or Rule 17 dimming"/>
				<enumChoice choice="Reserved (0x8)"/>
				<enumChoice choice="Reserved (0x9)"/>
				<enumChoice choice="Speed=0, non-directional, phase A, function qualifier"/>
				<enumChoice choice="Speed&gt;0, non-directional, phase B, function qualifier"/>
				<enumChoice choice="Reserved (0xC)"/>
				<enumChoice choice="Reserved (0xD)"/>
				<enumChoice choice="Ditch off phase A - Alternate operation, flash with F2"/>
				<enumChoice choice="Ditch off phase B - Alternate operation, flash with F2"/>
				</enumVal>
			</variable>
			
		<variable label="Digitrax Transponding" CV="61" mask="XXXXXXVX"
			item="Advanced Ack">
			<enumVal>
				<enumChoice choice="Off"/>
				<enumChoice choice="On"/>
				</enumVal></variable>
				
		<variable label="Split field motor" CV="61" mask="XXXXXVXX">
			<enumVal>
				<enumChoice choice="Normal DC motor"/>
				<enumChoice choice="Split field/AC motor"/>
				</enumVal></variable>				
		<variable label="Vstart/Vmid/Vfull in 128 step mode" CV="61" mask="XXVXXXXX">
			<enumVal>
				<enumChoice choice="Enabled"/>
				<enumChoice choice="Disabled"/>
				</enumVal>
			</variable>
		<variable label="Short-circuit protection" CV="61" mask="XVXXXXXX"
				comment="Undocumented feature, occasionally requested by Digitrax tech support">
			<enumVal>
				<enumChoice choice="Enabled"/>
				<enumChoice choice="Disabled"/>
				</enumVal>
			</variable>
		<variable label="Lamp keep-alive voltage" CV="62" mask="VVVVXXXX"
				item="Global lighting option 1"
				comment="0 is no keep-alive, use with LEDs">
				<decVal max="15"/>
			</variable>
		<variable label="FX rate adjust" CV="62" mask="XXXXVVVV"
				item="Global lighting option 2"
				comment="0 is fast, 15 is slow, 4 is recommended for start">
				<decVal max="15"/>
			</variable>
		<variable label="Ditch light hold-over time" CV="63"
				item="Global lighting option 3"
				comment="0 is none, 40 is realistic 5 seconds, 255 is about 20 seconds">
				<decVal/>
			</variable>
			
		
		<variable label="Switching speed enabled by F6" CV="54" mask="XXXXXXXV" >
			<enumVal>
				<enumChoice choice="Disabled"/>
				<enumChoice choice="Enabled"/>
				</enumVal>
			</variable>
		<variable label="Torque compensation" CV="54" mask="XXXVXXXX" >
			<enumVal>
				<enumChoice choice="Enabled"/>
				<enumChoice choice="Disabled"/>
				</enumVal>
			</variable>
		<variable label="Decoder Lock Feature" CV="54" mask="XVXXXXXX" default="0">
			<enumVal>
				<enumChoice choice="Enabled"/>
				<enumChoice choice="Disabled"/>
				</enumVal>
			</variable>

		<variable label="Decoder Lock ID number" CV="16" mask="XXXXXVVV" default="0">
			<decVal/>
			</variable>

		<variable label="Kick Start" CV="65">
			<decVal/>
			</variable>
		<variable label="Forward Trim" CV="66">
			<decVal/>
			</variable>
		<variable label="Reverse Trim" CV="95">
			<decVal/>
			</variable>
		<variable label="User Private ID #1" CV="105"
					item="User Id #1">
			<decVal/>
			</variable>
		<variable label="User Private ID #2" CV="106"
					item="User Id #2">
			<decVal/>
			</variable>
		<variable label="Speed Table" CV="67">
			<speedTableVal/>
			</variable>
			
	<!-- Define the Function-Output mapping based on NMRA definitions -->
		<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(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="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="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="F3 controls output 1" CV="37" mask="XXXXXXXV" minOut="1" minFn="3"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
		<variable label="F3 controls output 2" CV="37" mask="XXXXXXVX" minOut="2" minFn="3"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
		<variable label="F3 controls output 3" CV="37" mask="XXXXXVXX" minOut="3" minFn="3"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
		<variable label="F3 controls output 4" CV="37" mask="XXXXVXXX" minOut="4" minFn="3"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
		
		<variable label="F4 controls output 4" CV="38" mask="XXXXXXXV" minOut="4" minFn="4"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
					
		<variable label="F5 controls output 4" CV="39" mask="XXXXXXXV" minOut="4" minFn="5"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
		
		<variable label="F6 controls output 4" CV="40" mask="XXXXXXXV" minOut="4" minFn="6"> <enumVal> 
			<enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
				
	</variables>

  <resets>
  	<factReset label="Reset All CVs" CV="8" default="8"/>
  	<factReset label="Reset All CVs except speed table" CV="8" default="9"/>
  </resets>

</decoder>

<pane name="Digitrax">
	<column>
		<display item="Transponding" />
		<display item="Split field motor" />		
		<display item="Vstart/Vmid/Vfull in 128 step mode" />
		<display item="Short-circuit protection" />
		<display item="Switching speed enabled by F6" />
		<display item="Torque compensation" />
		<display item="Decoder Lock Feature" />
		<display item="Decoder Lock ID number" />
		
	</column>
</pane>

</decoder-config>



 	  	 
