Events
/////////////////////////////////////////////// I2C Bus - documentation module /**
In a control system, there are often events that occur that we have to be notified about. For example, when an alarm input goes high. Events are sent to an event port. Currently the only implemented event port is the "UDP Event Port". Each event is sent in a "name=value;" format. Events have the following format:
The eventName is the event name (uses
Tags), and eventValue is it's value. The event name uses text lables as defined by
Tags. Each event is terminated with a ';' character. If the value contains a ';' character, two ';' characters are sent after each other. Multiple events can also be sent in a single message, and will have the following format:
event1Name=event1Value;event2Name=event2Value;event3Name=event3Value;....
An example event will be when a port changes state. For example, if port A2 changes value from 0 to 1, the following event will be sent (if the system is configured to send events for port A2):
a02=1;
To activate events, an UDP packet has to be send to port 54124 of the Modtronix SBC65EC Web Server by a remote client. The first two bytes of this packet must be an uppercase hex value indicating which ports are to be enabled. Each bit in the byte represents an Event Port. Bit 0 represents the UDP event port, bits 1 to 7 are reserved for future use. For example, to enable the UDP event port, 01 must be sent to port 54124. After receiving this UDP packet, the Modtronix SBC65EC Web Server will start streaming events back to the sender.
Currently the following events are supported:
Event Name | Format | Description |
Heartbeat Event | l40=2; |
Every second a heartbeat event is sent. The format is "l40=2;". As long as the remote client
receives this event (in a UDP packet) each second, it knows the server is still alive, and will sent it any events that arise. |
Serial LCD 1 Key Event | l34=x; |
If a serial LCD display (I2C address 80) is connected to the I2C port of the @boardname, an event will be sent
each time a key is pressed (LCD display can have a keyboard connected to it). The x part of the event is the key code, and is a character from 'a' to 'p' (one
of 16 possible keys). |
Serial LCD 2 Key Event | l35=x; |
Same as Serial LCD 1 Key Event, but for LCD display with I2C address 81. |
Serial LCD 3 Key Event | l36=x; |
Same as Serial LCD 1 Key Event, but for LCD display with I2C address 82. |
Serial LCD 4 Key Event | l37=x; |
Same as Serial LCD 1 Key Event, but for LCD display with I2C address 83. |
The following events are sent if an expansion board (like the IOR5E or MXD2R) is present:
Event Name | Format | Description |
Expansion Board Input 1 Event | x40=x; |
If the expansion board has an Input 1, this event is sent if this input changes. The event is "x40=0;" if the input is 0,
or "x40=1" if the input is 1. |
Expansion Board Input 2 Event | x41=x; |
Same as Expansion Board Input 1 Event, but for Input 2. |
Expansion Board Input 3 Event | x42=x; |
Same as Expansion Board Input 1 Event, but for Input 3. |
Expansion Board Input 4 Event | x43=x; |
Same as Expansion Board Input 1 Event, but for Input 4. |
Expansion Board Input 5 Event | x44=x; |
Same as Expansion Board Input 1 Event, but for Input 5. |
Expansion Board Input 6 Event | x45=x; |
Same as Expansion Board Input 1 Event, but for Input 6. |
Expansion Board Opto Coupler Input 1 Event | x20=x; |
If the expansion board has an Opto Coupler Input 1, this event is sent if this input changes. The event is "x20=0;" if the input is off,
or "x20=1" if the input is active. |
Expansion Board Opto Coupler Input 2 Event | x21=x; |
Same as Expansion Board Opto Coupler Input 1 Event, but for Input 2. |
Expansion Board Opto Coupler Input 3 Event | x21=x; |
Same as Expansion Board Opto Coupler Input 1 Event, but for Input 3. |
Expansion Board Opto Coupler Input 4 Event | x21=x; |
Same as Expansion Board Opto Coupler Input 1 Event, but for Input 4. |