netClose (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

4.34 / 1.00.00


Closes a network interface.

When this function returns, no further communication is possible until the interface is re-opened using netOpen.

 

After this functions returns the netConnected() function will indicate than the connection to the network is unavailable.

 

 

Input:

iface : SINT

The network interface to close. 1 = Mobile network, 2 = LAN network, etc. (See Network)

 

Returns: INT

0

- Success.

-1

- Unknown network interface.

 

 

Declaration:

FUNCTION netClose : INT;
VAR_INPUT
  iface : SINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Open the network interface
netOpen(iface:=1);
 
BEGIN
 ...
 // Close the network interface
 netClose(iface:=1);
 ...
END;
END_PROGRAM;