Reserved Identifiers
164
NetLinx Programming Language Reference Guide
Send_Commands
Two new
Send_Command
s have been added to the master. The new commands enable or disable a feature
that helps synchronize level values. By default, this feature is disabled for compatibility reasons.
The synchronization algorithm works by setting the level value of a level five seconds after receiving a
level value from a level. While it may not be apparent, this makes sure that level values remain in sync
with each other if they ever get out of sync. The only way levels could ever get out of sync is when the
situation of "dueling levels" arises. A typical example of "dueling levels" is when two touch panels with
active sliders are combined with a volume control. If one slider attempts to raise the volume level while
the other is attempting to lower the volume level the level value bounces back and forth somewhere
between the desired levels. If both sliders are released at the exact same time, it is possible that one of
level values displayed on the touch panel's slider is inaccurate. The level synchronization algorithm
corrects the incorrect level five seconds after activity ceases.
The commands are
~
LEVSYNCON
and
~
LEVSYNCOFF
are sent to the level that should have the
synchronization algorithm enabled or disabled. The command itself is never sent to the device because
the master intercepts the command and processes it internally. Both commands accept a single parameter
that specifies the level number.
Using the "dueling levels" example above, the following send commands will turn on the
synchronization algorithm for level #1 of Touch Panel 1, level #4 of touch panel #2, and level #2 of the
volume control.
SEND_COMMAND dvTouchPanel1,'~LEVSYNCON 1'
SEND_COMMAND dvTouchPanel2,'~LEVSYNCON 4'
SEND_COMMAND dvVolume,'~LEVSYNCON 2'
Note that for some devices, turning the level synchronization algorithm on can cause undesired results.
The undesired results will vary from device to device so it is difficult to indicate any specific failure
mode. Keep in mind that the algorithm should only be turned on when necessary.
Also note that the
LEVSYNCON
and
LEVSYNCOFF
Send_Commands may not be sent to remote devices
(devices that belong to other systems) and only the device's master may issue these commands.
DEFINE_MUTUALLY_EXCLUSIVE and Variables
Symptom
: If you have a set of variables that are mutually exclusive and you set one of the variables to a
non-zero value by assignment, e.g. Var1 = 1 or the Studio Debug window, then the other variables in the
set stay "on" i.e. non-zero.
DEFINE_VARIABLE
INTEGER var[4]
INTEGER x
DEFINE_MUTUALLY_EXCLUSIVE
(var[1],var[2],var[3],var[4])
DEFINE_PROGRAM
WAIT 20
{
x++; IF (x > 4) x = 1;
var[x] = x // This will not invoke the mutually exclusive magic
}
In the NetLinx code example above, all elements of var will eventually be non-zero.
Keywords & Run-Time Library Functions (Cont.)
XOR (^^)
This keyword evaluates two conditions. One and only one condition can be
true for the entire expression to be true.
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...