Persistent; Program_Name; Pulse; Push - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

PERSISTENT

PROGRAM_NAME

PULSE

PUSH

PUSH_CHANNEL

PUSH_DEVCHAN

PUSH_DEVICE

RANDOM_NUMBER

RAW_BE

RAW_LE

NetLinx Programming Language Reference Guide
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.
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>'
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]
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.
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.
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.
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.
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)
This routine takes an intrinsic variable and converts it into a Character Array in
Big Endian Format representing the variable.
CHAR[] RAW_BE(IntrinsicVariable)
This routine takes an intrinsic variable and converts it into a Character Array in
Little Endian Format representing the variable.
CHAR[] RAW_LBE(IntrinsicVariable)
Reserved Identifiers
// 0 <= Num < 1000
143

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents