soAddrFromIP (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


Convert a 32 bit IP address to a socket address.

 

 

Input:

ip : DINT

The 32 bit IP address.

 

 

Returns: STRING

The socket address.

 

 

Declaration:

FUNCTION soAddrFromIP : STRING;
VAR_INPUT
  ip : DINT;
END_VAR;

 

 


Example:

 

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
address : STRING;
ip      : DINT;
END_VAR;
 
BEGIN
  ...
DebugFmt(message := "IP address = \4", v4 := ip);
 
// Convert a socket address
address := soAddrFromIP(ip := ip);
 
DebugMsg(message := "Socket address = [" + address + "]");
  ...
END;
END_PROGRAM;