EasyManuals Logo

AMX NETLINX PROGRAMMING LANGUAGE User Manual

AMX NETLINX PROGRAMMING LANGUAGE
246 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #41 background imageLoading...
Page #41 background image
NetLinx Programming Overview
25
NetLinx Programming Language Reference Guide
upon receipt of another chunk of data, and is only done when data is received. For example, DATA.TEXT
may equal
{'over the lazy brown dog',ETX} and the DATA_BUFFER[500] might equal
{STX,'The quick gray fox jumps over the lazy brown dog',ETX}. By evaluating the
buffer value, you can evaluate the entire string at once.
Two other important aspects of the
DATA_EVENT are the ONLINE and OFFLINE event handlers.
ONLINE and OFFLINE events are triggered when the master recognizes a device has come on the bus or
has dropped off the bus.
In Axcess, device initialization is primarily handled with the
DEFINE_START section of code. The other
alternative was to evaluate the
DEVICE_ID on each pass through mainline. If the
DEVICE_ID(<device>) equaled the DEVICE_ID of the device, the device was online. If
DEVICE_ID(<device>) equaled 0, the device was offline. Within the conditional statements, the
device could be initialized or a warning could be sent. The downfall of these approaches is that
DEFINE_START initializations are only run when the master is reset, and evaluations of the DEVICE_ID
must run with each pass of mainline and are dependent on the speed of mainline.
NetLinx handles all device initializations and offline warning through the
DATA_EVENT. Since every
device triggers an
ONLINE event when the master is reset, this not only ensures that the device will be
initialized on startup, but also insures that the device will be initialized any time the device comes online.
The
DATA_EVENT is also evaluated on a need to know basis, rather than on each pass through mainline.
The following example shows basic code for tracking a touch panel page in Axcess. Assume that the
variables have been properly defined in the
DEFINE_VARIABLE section. The DEFINE_START section
contains the creation of the buffer and the
DEFINE_PROGRAM section contains the string evaluation.
Existing Axcess code:
DEFINE_START
.
.
CREATE_BUFFER TP1, TP1_BUFFER
SEND_COMMAND TP1, 'TPAGEON'
.
.
DEFINE_PROGRAM
.
.
IF (LENGTH_STRING (TP1_BUFFER))
{
SELECT
{
ACTIVE (FIND_STRING (TP1_BUFFER,'PAGE-',1)):
{
JUNK = REMOVE_STRING (TP1_BUFFER,'PAGE-',1)
CUR_PAGE = TP1_BUFFER
}
ACTIVE (FIND_STRING (TP1_BUFFER,'KEYP-',1)):
{
(* keypad code *)
}
ACTIVE (FIND_STRING (TP1_BUFFER,'KEYB-',1)):
{
(* keyboard code *)
Continued

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the AMX NETLINX PROGRAMMING LANGUAGE and is the answer not in the manual?

AMX NETLINX PROGRAMMING LANGUAGE Specifications

General IconGeneral
BrandAMX
ModelNETLINX PROGRAMMING LANGUAGE
CategorySoftware
LanguageEnglish

Related product manuals