NetLinx Programming Overview
8
NetLinx Programming Language Reference Guide
DEFINE_PROGRAM
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:
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
keyword.
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
keyword.
An example of both is shown below.
X = 1
Y = 8
X = X << 2 (* X is now equal to 4 *)
Z = Y >> 3 (* Z is now equal to 1 *)
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 (
++
) increments the value of its variable by one. The
Decrement-by-One operator or double minus sign (
--
) decrements the value of its variable by one.
An example of value increment and decrement operators is shown below.
X = 1
Y = 5
X++ (* X is now equal to 2 *)
Y-- (* Y is now equal to 4 *)X = Y++(* This is not a legal statement *)
Axcess Language
NetLinx 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.
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.
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...