
Reserved Identifiers
143
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
PERSISTENT
If a variable is declared with the
PERSISTENT
keyword, it is initialized to zero
the first time the program is loaded but will retain its value after power-down or
reload.
• The
PERSISTENT
attribute does not apply to non-static local variables, since
non-static local variables are allocated on the program stack (a block of
memory reserved for allocation of temporary variables).
• The
PERSISTENT
attribute does not apply to the individual members of a
structure.
PROGRAM_NAME
This keyword declares the program name. It must appear on the first line of
the program and cannot appear more than once in any single program or
include file.
PROGRAM_NAME = '<program name>'
PULSE
This keyword turns a channel or variable on for the length of time set by the
function
SET_PULSE_TIME
. Once the pulse time elapses, the channel or vari-
able is turned off. The default pulse time is 0.5 seconds.
PULSE [DEVICE,CHANNEL]
PULSE [DEVCHAN[ ]]
PULSE [Variable]
PUSH
This keyword declares a block of code to be executed when a push event is
received for the associated device and channel. An example
PUSH
statement
is shown below:
PUSH [DEVICE,CHANNEL]PUSH [(DEVCHAN[ ])]
{// statements}
This keyword also defines a section in the
BUTTON_EVENT
handler for pro-
cessing
PUSH
events.
PUSH_CHANNEL
This keyword contains the channel number that was just turned on due to an
input change. The value remains valid for one pass through mainline. The inac-
tive state of this variable is all fields equal to zero.
PUSH_DEVCHAN
This keyword contains the device-channel (a
DEVCHAN
structure) that was just
turned on due to an input change. Individual fields of this
DEVCHAN
structure
can be accessed using dot-operator syntax, as shown below:
PUSH_DEVCHAN.Device
PUSH_DEVCHAN.Device.Number
PUSH_DEVCHAN.Device.Port
PUSH_DEVCHAN.Device.System
PUSH_DEVCHAN.Channel
These fields remain valid for one pass through mainline. The inactive state of
this variable is
all fields equal to zero
.
PUSH_DEVICE
This keyword contains the number of the device that was just turned on due to
an input change. The value remains valid for one pass through mainline. The
inactive state of this variable is all fields equal to zero.
RANDOM_NUMBER
This function returns a random number X in the range 0 <= X < Max.
LONG RANDOM_NUMBER (LONG Max)
Parameters:
•
Max
: An unsigned long integer (must be greater than zero) that will serve as
the upper limit for the random number generator.
The result is an unsigned long integer >= 0 and < Max.
Num = RANDOM_NUMBER(1000) // 0 <= Num < 1000
RAW_BE
This routine takes an intrinsic variable and converts it into a Character Array in
Big Endian Format representing the variable.
CHAR[] RAW_BE(IntrinsicVariable)
RAW_LE
This routine takes an intrinsic variable and converts it into a Character Array in
Little Endian Format representing the variable.
CHAR[] RAW_LBE(IntrinsicVariable)
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...