<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Train</title><link>https://sourceforge.net/p/mergcbus/wiki/Train/</link><description>Recent changes to Train</description><atom:link href="https://sourceforge.net/p/mergcbus/wiki/Train/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 22 May 2014 09:52:38 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/mergcbus/wiki/Train/feed" rel="self" type="application/rss+xml"/><item><title>Train modified by Mike Johnson</title><link>https://sourceforge.net/p/mergcbus/wiki/Train/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="loco-and-consist-train-control-commands"&gt;Loco and Consist Train Control Commands&lt;/h1&gt;
&lt;h3 id="21-release-enginekloc"&gt;21 Release Engine(KLOC)&lt;/h3&gt;
&lt;p&gt;Format: &lt;span&gt;[&amp;lt;MjPri?&amp;gt;&amp;lt;MinPri?=2&amp;gt;&amp;lt;CANID&amp;gt;]&lt;/span&gt;&amp;lt;21&amp;gt;&amp;lt;Session&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Dat1&amp;gt; is the engine session number. &lt;/p&gt;
&lt;p&gt;The command station decrements the reference counter for the engine record. If the reference count is 0, the command station removes the engine from the engine list. &lt;/p&gt;
&lt;h3 id="22-query-engine-qloc"&gt;22 Query engine (QLOC)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;22&amp;gt;&amp;lt;Session&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Dat1&amp;gt; is the engine session number. &lt;/p&gt;
&lt;p&gt;The command station responds with PLOC if the NN is assigned. Otherwise responds with ERR: engine not found. &lt;/p&gt;
&lt;h3 id="23-keep-alive-keep"&gt;23 Keep Alive (KEEP)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;24&amp;gt;&amp;lt;Session&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Dat1&amp;gt; is the engine session number. &lt;/p&gt;
&lt;p&gt;Sent by a cab to notify it is active. If a cab does not send this message within the life time-out period, it is removed from the refresh list. &lt;/p&gt;
&lt;p&gt;Probably not needed. Deleted in Ver 6. &lt;/p&gt;
&lt;h3 id="40-request-engine-assignmentrloc"&gt;40 Request engine assignment(RLOC)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;40&amp;gt;&amp;lt;AAAAAAAA&amp;gt;&amp;lt;AAAAAAAA&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Dat1&amp;gt; and &amp;lt;Dat2&amp;gt; are &lt;span&gt;[AddrH]&lt;/span&gt; and &lt;span&gt;[AddrL]&lt;/span&gt; of the decoder, respectively. 7 bit addresses have (AddrH=0). 14 bit addresses have bits 7,8 of AddrH set to 0. &lt;/p&gt;
&lt;p&gt;The command station responds with (PLOC) if engine is free and is being assigned. Otherwise responds with (ERR): engine in use. This command is typically sent by a cab to the command station following a change of the controlled decoder address. &lt;/p&gt;
&lt;h3 id="41-query-consist-qcon"&gt;41 Query Consist (QCON)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;41&amp;gt;&amp;lt;ConID&amp;gt;&amp;lt;Index&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; is consist address. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is engine index in the consist. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Allows enumeration of a consist. Command station responds with PLOC if an engine exists at the specified index, otherwise responds with ERR: no more engines. &lt;/p&gt;
&lt;h3 id="44-set-throttle-session-mode-stmod"&gt;44 Set Throttle session mode (STMOD)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;44&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;MMMMMMMM&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session number &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; contains mode bits: &lt;ul&gt;
&lt;li&gt;Bits 0 - 1: speed mode &lt;/li&gt;
&lt;li&gt;00 - 128 speed steps &lt;/li&gt;
&lt;li&gt;01 - 14 speed steps &lt;/li&gt;
&lt;li&gt;10 - 28 speed steps with interleave steps ? &lt;/li&gt;
&lt;li&gt;11 - 28 speed steps &lt;/li&gt;
&lt;li&gt;Bits 2 - 7: spare &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sent from a cab to the command station to change the number of speed steps used, to that supported by the decoder. The command station should remember the setting and send it in PLOC replies for this decoder. &lt;/p&gt;
&lt;h3 id="45-consist-engine-pcon"&gt;45 Consist Engine (PCON)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;45&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;Consist#&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session number &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is consist address (8 bits). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Adds a decoder to a consist. If consisting is successful, an ACK is sent. If engine is consisted already, an error is reported: engine in use. &lt;/p&gt;
&lt;h3 id="46-remove-engine-from-consist-kcon"&gt;46 Remove Engine from consist (KCON)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;46&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;Consist#&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session number &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is consist address. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Removes a decoder from a consist. If deconsisting is successful an ACK is sent. If engine is not consisted, an error is reported: Engine not found. &lt;/p&gt;
&lt;h3 id="47-set-engine-speeddirdspd"&gt;47 Set Engine Speed/Dir(DSPD)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;47&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;Speed/Dir&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session number &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is speed/dir value &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sent by a device to request an engine speed/dir change. The speed is in the DCC format for the number of speed steps. For 128 steps, bit 7 is the direction, 1 for forward. The other 7 bits are the speed, 0 is stop, 1 is emergency stop. For 14 or 28 steps, bit 6 is 1, bit 5 is the direction, bit 4 is the lsb of the 28 step speed, the other 4 bits are the speed, with 0 is stop and 1 is emergency stop. &lt;/p&gt;
&lt;h3 id="48-set-engine-flags-dflg"&gt;48 Set Engine Flags (DFLG)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;48&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;DDDDDDDD&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session number &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is the flags &lt;/li&gt;
&lt;li&gt;bits 0-1: Speed Mode &lt;ul&gt;
&lt;li&gt;00 - 128 speed steps &lt;/li&gt;
&lt;li&gt;01 - 14 speed steps &lt;/li&gt;
&lt;li&gt;10 - 28 speed steps with interleave steps &lt;/li&gt;
&lt;li&gt;11 - 28 speed steps &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bit 2: Lights On/OFF ? &lt;/li&gt;
&lt;li&gt;Bit 3: Engine relative direction ? &lt;/li&gt;
&lt;li&gt;Bits 4-5: Engine state &lt;ul&gt;
&lt;li&gt;00 - active ? &lt;/li&gt;
&lt;li&gt;01 - consisted &lt;/li&gt;
&lt;li&gt;10 - consist master &lt;/li&gt;
&lt;li&gt;11 - inactive ? &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bits 6-7: Reserved. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sent by a cab to notify the command station of a change in engine flags. Probably not needed see opcodes 44 and E1. &lt;/p&gt;
&lt;h3 id="49-dcc-event-mapping-commands-dcce"&gt;49 DCC Event mapping commands (DCCE)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;49&amp;gt;&amp;lt;MMMMAAAA&amp;gt;&amp;lt;AAAAAAAA&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Address and event. &lt;ul&gt;
&lt;li&gt;Bits 0-3: DCC Accessory Output Address MSB &lt;/li&gt;
&lt;li&gt;Bits 4-7: Event Operations &lt;/li&gt;
&lt;li&gt;0000 Enter Learn Mode &lt;/li&gt;
&lt;li&gt;0001 Unlearn events &lt;/li&gt;
&lt;li&gt;0010 - 1111 reserved &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; DCC Accessory Output Address LSB &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sent by a cab to initiate an event - DCC accessory mapping action. Possible actions are to learn a new mapping (the command station enters learn mode and captures the next CBUS event to create a mapping) and unlearn a mapping. &lt;/p&gt;
&lt;h3 id="60-set-engine-functions-dfun"&gt;60 Set Engine functions (DFUN)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;60&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;Dat1&amp;gt;&amp;lt;Dat2&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Session&amp;gt; is the engine session number. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; is 1 for FN0-FN5, 2 is FN5-FN8, 3 is FN9-FN12, 4 is FN13-FN20 and 5 is FN21-FN28. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is 5, 4 or 8 bits one per function in DCC order. eg. FN0 is in bit 4. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sent by a device to request an engine Fn state change. &lt;/p&gt;
&lt;h3 id="e1-engine-report-ploc"&gt;E1 Engine report (PLOC)&lt;/h3&gt;
&lt;p&gt;There are 2 formats for this: &lt;/p&gt;
&lt;p&gt;Format1: &amp;lt;E1&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;AddrH&amp;gt;&amp;lt;AddrL&amp;gt;&amp;lt;Speed/Dir&amp;gt; | Consist#&amp;gt;&amp;lt;Fn1&amp;gt;&amp;lt;Fn2&amp;gt;&amp;lt;Fn3&amp;gt;&lt;/p&gt;
&lt;p&gt;Session for engine assigned by the command station. This session number is used in all referenced to the engine until it is released. &lt;/p&gt;
&lt;p&gt;AddrH and AddrL is the DCC address. For short addresses AddrH it is set to 0. If the engine is consisted, AddrL is the consist address. &lt;/p&gt;
&lt;p&gt;Speed/Direction value. Bit 7 is the direction bit and bits 0-6 are the speed value. &lt;/p&gt;
&lt;p&gt;&amp;lt;Fn1&amp;gt; is the function byte F0 to F4 &amp;lt;Fn2&amp;gt; is the function byte F5 to F8 &amp;lt;Fn3&amp;gt; is the function byte F9 to F12 &lt;/p&gt;
&lt;p&gt;Format2: &amp;lt;E1&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;AddrH&amp;gt;&amp;lt;AddrL&amp;gt;&amp;lt;Flags&amp;gt;&amp;lt;Speed/Dir | Consist#&amp;gt;&amp;lt;B1&amp;gt;&amp;lt;B2&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session for engine assigned by the command station. This session number is used in all references to the engine until it is released. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is the MS byte of the DCC address. For short addresses it is set to 0. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat3&amp;gt; is the LS byte of the DCC address. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat4&amp;gt; is the Flags byte. &lt;ul&gt;
&lt;li&gt;bits 0-1: Speed Mode &lt;/li&gt;
&lt;li&gt;00 - 128 speed steps &lt;/li&gt;
&lt;li&gt;01 - 14 speed steps &lt;/li&gt;
&lt;li&gt;10 - 28 speed steps with interleave steps &lt;/li&gt;
&lt;li&gt;11 - 28 speed steps &lt;/li&gt;
&lt;li&gt;Bit 2: spare &lt;/li&gt;
&lt;li&gt;Bit 3: spare &lt;/li&gt;
&lt;li&gt;Bit 4: Consisted &lt;/li&gt;
&lt;li&gt;Bit 5: Consist Master &lt;/li&gt;
&lt;li&gt;Bit 6: spare &lt;/li&gt;
&lt;li&gt;Bit 7: In use. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&amp;lt;Dat5&amp;gt; is the Speed/Direction value. Bit 7 is the direction bit and bits 0-6 are the speed value. If the engine is consisted, this is the consist address. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat6&amp;gt; spare. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat7&amp;gt; spare. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Due to the number of functions, these states are in the opcode E8 PLOCF packet, which may be before or after the PLOC packet. &lt;/p&gt;
&lt;p&gt;A report of an engine entry sent by the command station. Usually sent in response to QLOC or as an acknowledgement of acquiring an engine requested by a cab (RLOC). &lt;/p&gt;
&lt;h3 id="e8-engine-function-report-plocf"&gt;E8 Engine function report (PLOCF)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;E8&amp;gt;&amp;lt;Session&amp;gt;&amp;lt;AddrH&amp;gt;&amp;lt;AddrL&amp;gt;&amp;lt;FN0&amp;gt;&amp;lt;FN5&amp;gt;&amp;lt;FN13&amp;gt;&amp;lt;FN21&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;Dat1&amp;gt; Session for engine assigned by the command station. This session number is used in all references to the engine until it is released. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat2&amp;gt; is the MS byte of the DCC address. For short addresses it is set to 0. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat3&amp;gt; is the LS byte of the DCC address. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat4&amp;gt; is the 5 functions FN0 to FN4 in DCC bit order. See opcode 60 DFUN. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat5&amp;gt; is the 8 functions FN5 to FN12. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat6&amp;gt; is the 8 functions FN13 to FN20. &lt;/li&gt;
&lt;li&gt;&amp;lt;Dat7&amp;gt; is the 8 functions FN21 to FN28. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The PLOCF may appear before or after the PLOC, and is usually a reply to a QLOC or RLOC request. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mike Johnson</dc:creator><pubDate>Thu, 22 May 2014 09:52:38 -0000</pubDate><guid>https://sourceforge.net39c0e2d699e58713dfdecc98728dd1d5687bff3c</guid></item></channel></rss>