soAddrInetSet (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The soAddrInetSet function will create a socket address with an IP address and port.

It is possible to modify an existing socket address with this function, for example to change the port.

 

 

Input:

host : STRING

The IP address. If empty, the IP address will not be set in the socket address.

 

port : DINT (0..65535, default 0)

The IP port number. If zero, the port will not be set in the socket address.

 

 

Output:

address : STRING

The socket address.

 

 

Returns: INT

1

- Success.

0

- The function is not supported.

-2

- One or more parameters are illegal.

 

Declaration:

FUNCTION soAddrInetSet : INT;
VAR_INPUT
  address : ACCESS STRING;
  host    : STRING;
  port    : DINT;
END_VAR;

 

 


Example:

 

Please see the "Examples - Web client"