<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Events</title><link>https://sourceforge.net/p/mergcbus/wiki/Events/</link><description>Recent changes to Events</description><atom:link href="https://sourceforge.net/p/mergcbus/wiki/Events/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 22 May 2014 09:52:36 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/mergcbus/wiki/Events/feed" rel="self" type="application/rss+xml"/><item><title>Events modified by Mike Johnson</title><link>https://sourceforge.net/p/mergcbus/wiki/Events/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="event-teaching"&gt;Event teaching&lt;/h1&gt;
&lt;p&gt;There are rather too many OPC's for this: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;0x53 INIT LEARN MODE &lt;/li&gt;
&lt;li&gt;0x54 EXIT LEARN MODE &lt;/li&gt;
&lt;li&gt;0x55 CLEAR ALL EVENTS &lt;/li&gt;
&lt;li&gt;0x56 REQUEST EVENT SPACE &lt;/li&gt;
&lt;li&gt;0x70 EVENT SPACE REPLY &lt;/li&gt;
&lt;li&gt;0x94 READ EVENT VARS IN LEARN MODE &lt;/li&gt;
&lt;li&gt;0x95 UNLEARN SPECIFIC EVENT IN LEARN MODE &lt;/li&gt;
&lt;li&gt;0xD2 TEACH EVENT, EV# &amp;amp; EVVAL = EV PAR0 &amp;amp; EV PAR1 &lt;/li&gt;
&lt;li&gt;0xD3 EVENT RESPONSE DATA, EV# &amp;amp; EVVAL = EV PAR0 &amp;amp; EV PAR1 &lt;/li&gt;
&lt;li&gt;0xE4 EVENT LEARN REJECTED &lt;/li&gt;
&lt;li&gt;0xE5 EVENT LEARNT &lt;/li&gt;
&lt;li&gt;0xE6 TEACH TYPE SPECIFIC EVENT, EV# &amp;amp; EVVAL = EV PAR0 &amp;amp; EV PAR1 &lt;/li&gt;
&lt;li&gt;0xE7 REPLY TYPE SPECIFIC EVENT DATA &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This can be simplified to the following 5 commands, 2 of which are used by the loader. &lt;/p&gt;
&lt;p&gt;This creates some limits for event data: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Always 4 bytes for the event number, short events should use 0 for the first 2 bytes. &lt;/li&gt;
&lt;li&gt;Up to 256 events per module. &lt;/li&gt;
&lt;li&gt;Up to 64 bytes for the event data so it can use the same buffer as the loader. &lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dc-erase-event-data-everase"&gt;DC Erase Event data (EVERASE)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;DC&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN4&amp;gt;&lt;/p&gt;
&lt;p&gt;The node should erase all events that match the event number. If the event number is zero then it erases all events, and re-initialize all node variables. The reply should be 7C OPC_ACK=OK, even if there is nothing to do. &lt;/p&gt;
&lt;h3 id="fe-event-read-evread"&gt;FE Event read (EVREAD)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;DC&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN4&amp;gt;&amp;lt;INDEX&amp;gt;&lt;/p&gt;
&lt;p&gt;If the event number is zero then read all events. The first read should have index = 0. Each read should increase the index until the error return no data is received. This returns one event, in an OPC_EVWRITE for the event number and a number of OPC_DATA packets. The index is used to decide which event data to read if there is more than one set of event data with a matching event number. The module should send an error reply (opcode FC) if there is no data corresponding to this index. &lt;/p&gt;
&lt;h3 id="fd-event-write-evwrite"&gt;FD Event write (EVWRITE)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;FD&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN4&amp;gt;&amp;lt;B&amp;gt;&lt;/p&gt;
&lt;p&gt;The 4 byte event number is never zero. B is number of bytes of data that will follow. This packet is followed by enough event data packets (opcode FC) to contain the data. The module should send opcode 7C, ack after storing the data, or timeout if a packet gets lost, or error if there is no space to store it. &lt;/p&gt;
&lt;h3 id="53-enter-learn-mode-nnlrn"&gt;53 Enter learn mode (NNLRN)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;53&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&lt;/p&gt;
&lt;p&gt;The node should enter learn mode, and the yellow LED go on. &lt;/p&gt;
&lt;h3 id="54-exit-learn-mode-nnuln"&gt;54 Exit Learn Mode (NNULN)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;54&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&lt;/p&gt;
&lt;p&gt;Exit learn mode and the Yellow LED should go off. &lt;/p&gt;
&lt;h3 id="55-clear-all-events-nnclr"&gt;55 Clear all Events (NNCLR)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;55&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&lt;/p&gt;
&lt;p&gt;Clear all events in a node. &lt;/p&gt;
&lt;h3 id="56-event-free-space-nnevn"&gt;56 Event Free space (NNEVN)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;56&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&lt;/p&gt;
&lt;p&gt;Read the number of event spaces left, reply is opc=70. &lt;/p&gt;
&lt;h3 id="70-event-space-left-evnlf"&gt;70 Event Space Left (EVNLF)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;0x70&amp;gt;&amp;lt;NN hi&amp;gt;&amp;lt;NN lo&amp;gt;&amp;lt;number left&amp;gt;&lt;/p&gt;
&lt;p&gt;The reply to an opc=56, the number of spaces left for events. &lt;/p&gt;
&lt;h3 id="94-read-event-variables-evrd"&gt;94 Read Event Variables (EVRD)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;94&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN0&amp;gt;&lt;/p&gt;
&lt;p&gt;Read an event variable, the reply is sent with opc=D3. &lt;/p&gt;
&lt;h3 id="95-unlearn-event-evuln"&gt;95 Unlearn Event (EVULN)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;95&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN0&amp;gt;&lt;/p&gt;
&lt;p&gt;This removes the event and all its EVs. &lt;/p&gt;
&lt;h3 id="d2-learn-event-evlrn"&gt;D2 Learn Event (EVLRN)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;D2&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN0&amp;gt;&amp;lt;EV hi&amp;gt;&amp;lt;EV lo&amp;gt;&lt;/p&gt;
&lt;p&gt;EN is the 32 bit event number. The current SLiM nodes have two bytes for the event action variable. As implemented just now, these are EV hi and EV lo. This allows a complete event to be taught with one frame. &lt;/p&gt;
&lt;p&gt;An alternative is to have the EV set by &amp;lt;EV#&amp;gt;&amp;lt;EV val&amp;gt; Where EV# is the index number of the EV val associated with an event. This would allow up to 256 EV values per event but would need one EVLRN frame per byte. &lt;/p&gt;
&lt;h3 id="d3-event-data-evans"&gt;D3 Event data (EVANS)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;D2&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN0&amp;gt;&amp;lt;EV hi&amp;gt;&amp;lt;EV lo&amp;gt;&lt;/p&gt;
&lt;p&gt;Response to a request for an EV value in a node in learn mode. &lt;/p&gt;
&lt;p&gt;A node response to a request from a device for the EVs associated with an event (REQEV). For multiple EVs, there will be one response per request. &lt;/p&gt;
&lt;h3 id="e4-event-learn-rejected-evrej"&gt;E4 Event learn rejected (EVREJ)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;E4&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&amp;lt;EVOPC&amp;gt;&amp;lt;SNNHI&amp;gt;&amp;lt;SNNLO&amp;gt;&amp;lt;EVHIGH&amp;gt;&amp;lt;EVLOW&amp;gt;&lt;/p&gt;
&lt;p&gt;This is issued if a learn session is exited without learning an event, for self documenting purposes. &lt;/p&gt;
&lt;h3 id="e5-event-learn-evlrnt"&gt;E5 Event learn (EVLRNT)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;E5&amp;gt;&amp;lt;NNhigh&amp;gt;&amp;lt;NNlow&amp;gt;&amp;lt;EVOPC&amp;gt;&amp;lt;SNNHI&amp;gt;&amp;lt;SNNLO&amp;gt;&amp;lt;EVHIGH&amp;gt;&amp;lt;EVLOW&amp;gt;&lt;/p&gt;
&lt;p&gt;This is issued on exit from a good learn session, for self documenting. &lt;/p&gt;
&lt;h3 id="e6-teach-type-specific-event-etype"&gt;E6 Teach type specific event (ETYPE)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;E6&amp;gt;&amp;lt;Etype&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN0&amp;gt;&amp;lt;EV#&amp;gt;&amp;lt;EVval&amp;gt;&lt;/p&gt;
&lt;p&gt;The CANRPI64 will be capable of issuing and responding to ( 0x92 AREQ ) AND ( 0X93 ARSP ) events, stored in a separate table. This OPCODE is used in learn mode and is the equivalent to 0xD2 and 0xD3 only with the extra &lt;span&gt;[EVOPC]&lt;/span&gt; byte to determine which table to use. Each Event is able to invoke multiple 'Actions', these are stored as a string, the EV# determines where in the 'Action String' the EVVAL belongs. &lt;/p&gt;
&lt;h3 id="e7-teach-type-specific-event-etype"&gt;E7 Teach type specific event (ETYPE)&lt;/h3&gt;
&lt;p&gt;Format: &amp;lt;E7&amp;gt;&amp;lt;Etype&amp;gt;&amp;lt;EN3&amp;gt;&amp;lt;EN2&amp;gt;&amp;lt;EN1&amp;gt;&amp;lt;EN0&amp;gt;&amp;lt;EV#&amp;gt;&amp;lt;EVval&amp;gt;&lt;/p&gt;
&lt;p&gt;The CANRPI64 will be capable of issuing and responding to ( 0x92 AREQ ) AND ( 0X93 ARSP ) events, stored in a separate table. This OPCODE is used in learn mode and is the equivalent to 0xD2 and 0xD3 only with the extra &lt;span&gt;[EVOPC]&lt;/span&gt; byte to determine which table to use. Each Event is able to invoke multiple 'Actions', these are stored as a string, the EV# determines where in the 'Action String' the EVVAL belongs. &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:36 -0000</pubDate><guid>https://sourceforge.net64d23b51d285893f3ad3f1061def6f4444d2765d</guid></item></channel></rss>