Define_Program; Operators - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

NetLinx Programming Overview

DEFINE_PROGRAM

Axcess Language
The DEFINE_PROGRAM or mainline section of the
Axcess program is where most of the programming
process takes place. Axcess supports 99 reserved
identifiers or keywords. 83 of these keywords can be
used in the mainline.
Axcess runs through a loop where:
• The AXlink bus is queried for any changes.
• Mainline code is run.
• Axcess checks the wait stack and the pulse stacks
for any expired waits and pulses.
• The process is repeated.

Operators

NetLinx added several operators to the language consistent with C++ programming. In conditional
statements (True or False statements), the double equal signs (==) can be used to evaluate whether two
statements are equal. The double equal signs perform the same function as a single equal sign.
There are two Bitwise operators:
An example of both is shown below.
X = 1
Y = 8
X = X << 2
Z = Y >> 3
NetLinx also includes value increment and decrement operators. These operators with variables as
statements work just like an Assignment operator or the equal sign does. The Increment-by-One operator
or double plus sign (
Decrement-by-One operator or double minus sign (
An example of value increment and decrement operators is shown below.
X = 1
Y = 5
X++
Y--
8
Shift Left shifts the bits of a value to the left n binary positions or effectively multiplies the
value by 2n, where n is the number of places to shift. Shift Left is designated by a double less-
than sign (
) or the
<<
LSHIFT
Shift Right shifts the bits of a value to the right n binary positions or effectively divides the
value by 2n, where n is the number of places to shift. Shift Right is designated by a double
greater-than sign (
)or the
>>
RSHIFT
(* X is now equal to 4 *)
(* Z is now equal to 1 *)
) increments the value of its variable by one. The
++
(* X is now equal to 2 *)
(* Y is now equal to 4 *)X = Y++(* This is not a legal statement *)
NetLinx Language
The DEFINE_PROGRAM or mainline section of the
NetLinx program and the DEFINE_EVENTS section of
code are responsible for processing events in a NetLinx
system. NetLinx has expanded the list of keywords to
194 reserved identifiers. NetLinx also supports loops,
data conversions, string processing, and file handling.
NetLinx handles mainline in a similar fashion to Axcess,
with a couple of differences. Because NetLinx supports
multiple bus formats (AXlink, ICSNet, and Ethernet),
events and changes in bus status are handled through a
connection manager and message queue. NetLinx
checks the message queue to see if an event is defined
for the message. If not, NetLinx makes a pass through
mainline. When NetLinx finishes the event handler or
mainline, NetLinx processes the Wait list and Pulse list,
and returns to the message queue to start the process
again.
keyword.
keyword.
) decrements the value of its variable by one.
--
NetLinx Programming Language Reference Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents