Reserved Identifiers
137
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
IP_SERVER_OPEN
This function opens a server port to listen for client requests.
SLONG IP_SERVER_OPEN (INTEGER LocalPort,
LONG ServerPort,
INTEGER Protocol)
Parameters:
•
LocalPort
: The local port number to open. This number must be passed to
IP_Server_Close
to close the port.
•
ServerPort
: The number of the server port to listen on.
•
Protocol
: The transport protocol to use:
1 = TCP
2 = UDP
If this parameter is not specified, TCP (1) is assumed. The constants
IP_TCP
and
IP_UDP
can be used to specify this parameter.
Result
(via
ONERROR
event):
2: General Failure
10: Binding error
11: Listening error
14: Local port already used
15: UDP socket already listening
16: too many open sockets
Example:
IP_SERVER_OPEN (PORT1, SvPort, IP_TCP)
See
IP Communication
section on page 189 for more information.
ITOA
This function converts a 32-bit signed integer to a decimal ASCII string.
CHAR[ ] ITOA (LONG Num)
Parameters:
•
Num
: The 32-bit unsigned integer to convert to a decimal string.
Result:
A character string that contains the decimal representation of the specified
integer.
STRING = ITOA(501)// STRING = '501'
ITOHEX
This function converts a 32-bit unsigned integer to an ASCII string containing
the hexadecimal representation of the number.
CHAR[ ] ITOHEX (LONG Num)
Parameters:
•
Num
: The 32-bit unsigned integer to convert to a hexadecimal string.
Result:
A character string that contains the hexadecimal representation of the speci-
fied integer.
STRING = ITOHEX(1000) // STRING = '3E8'
LDATE
The system variable
LDATE
returns the current date in (mm/dd/yyyy) string for-
mat.
IF (LDATE = '12/25/2000'){}
Содержание 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...