Events; Button Events - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Events

Axcess is a linear environment. All interactions between external devices and the master processor are
handled within mainline code. The processor runs mainline code, services the wait and pulse queues, and
checks the bus for any changes in device status. We view these interactions or changes in status as
Events, which fall into one of four categories: Button Events, Channel Events, Data Events, and Level
Events.
NetLinx has a special program section called
processing that previously could only occur within mainline code can now be handled in the
DEFINE_EVENT
NetLinx maintains a table of defined event handlers. When a new event comes into the NetLinx
processing queue, the event is compared against the table of events. If the event is found, only the code in
the event definition is evaluated and executed; mainline is bypassed. If an event handler is not defined,
mainline is run and the event is evaluated against the mainline code. This provides a more efficient
mechanism for processing events, since mainline is not required to process a single
I/O request. If no events are pending, mainline is run. Mainline becomes an idle time process.
With the addition of the
becomes greatly diminished, if not totally eliminated. Programs can still be written using the traditional
technique of processing events and providing feedback in mainline code; however, programs written
using the event table structure will run faster and be much easier to maintain.

Button Events

Events associated with a button on a touch panel or an AXD-MSP32 will fall into one of three
categories:
The structure for Button Events is as follows:
BUTTON_EVENT [<device>,<channel>]
{
}
The
[<device>, <channel>]
channel set in addition to individual device and channel declarations. The
actions to be performed when a button is pressed and held for a minimum length of time indicated by the
parameter, which is specified in tenth seconds.
<time>
NetLinx Programming Language Reference Guide
section.
DEFINE_EVENT
What happens when the button is pushed.
What happens when the button is released.
What happens if the button is held.
PUSH:
{
(* push event handler code *)
}
RELEASE:
{
(* release event handler code *)
}
HOLD [<time>,[REPEAT]]
{
(* hold event handler code *)
}
declaration can contain a
to handle incoming events. The event
DEFINE_EVENT
section for processing events, the mainline's role in NetLinx
device set, or a
DEV
NetLinx Programming Overview
device-
DEVCHAN
event specifies the
HOLD
21

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents