Reserved Identifiers
130
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
GET_IP_ADDRESS (Cont.)
The Flags member is a bit field that may be used for several different purposes.
Each bit is defined below:
Differing configuration parameters may be obtained, depending upon the con-
figuration of the network DHCP server. It is possible that the DHCP server will
provide the host name, IP address, subnet mask, gateway, and even DNS infor-
mation. In a minimal configuration, the DHCP server will only supply the IP
address and subnet mask.
IP_ADDRESS_STRUCT IPAddressResult =
GET_IP_ADDRESS(0:0:0,IPAddress)
Note
: For NetLinx Central Controllers, the "Host Name" can only consist of
alphanumeric characters.
GET_LAST
This function returns the index of the array element that most recently caused
an event handler to be triggered.
DEFINE_VARIABLE
DEVCHAN dcMyDCSet[] = { {TP,5}, {TP,4}, {TP,3}, {TP,2},
{TP,1}}
INTEGER Index
BUTTON_EVENT[dcMyDCSet]
{
PUSH:
{
Index = GET_LAST(dcMyDCSet)
Switch (Index)
{
Case 1: {} (* Button 5 was pressed *)
Case 2: {} (* Button 4 was pressed *)
Case 3: {} (* Button 3 was pressed *)
Case 4: {} (* Button 2 was pressed *)
Case 5: {} (* Button 1 was pressed *)
}
}
}
Result:
• 0: No Event was triggered using this array.
• >0: The index that causes an event to be triggered.
Since the
PUSH
and
RELEASE
keywords can be written using
DEVCHAN
arrays,
this function can also be used to determine which element causes a push or
release to be triggered. The function can be called anywhere in code but is usu-
ally called from within an event handler. A classic application of this function is
to determine the keypad number pressed when the channel codes for the key-
pad are out of order, which they typically are for a wireless transmitter.
Note
:
GET_LAST
works with
BUTTON_EVENTS
and
CHANNEL_EVENTS
, but not
with
LEVEL_EVENTS
.
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...