soAddrToIP (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


Convert a socket address to a 32 bit IP address.

 

Input:

address : STRING

The socket address.

 

Returns: DINT

The 32 bit IP address. 0 will be returned if address cannot be resolved.

 

 

Declaration:

FUNCTION soAddrToIP : DINT;
VAR_INPUT
  address : STRING;
END_VAR;

 

 


Example:

 

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