Keywords & Run-Time Library Functions (Cont.)
IP_SERVER_OPEN
ITOA
ITOHEX
LDATE
NetLinx Programming Language Reference Guide
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)
SeeIP Communication section on page 189 for more information.
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'
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)
The system variable LDATE returns the current date in (mm/dd/yyyy) string for-
mat.
IF (LDATE = '12/25/2000'){}
Reserved Identifiers
// STRING = '3E8'
137
Need help?
Do you have a question about the NETLINX PROGRAMMING LANGUAGE and is the answer not in the manual?
Questions and answers