ioNetEnable (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All devices with RS485

Firmware version:

4.56 / 1.00.00


This function is used to enable or disable an I/O Extension net.

When a net is disabled, the firmware will release the serial port used, and disable update of all the devices that are connected to the net.

Similar to the ioDeviceEnable function, the inputs and/or outputs of the devices are no longer updated, the status of the devices will not change and no new exceptions are raised.

 

The network ID is for the I/O Extension net that is found in the RTCU IDE, not the MODBUS connection ID returned by modbusOpen.

 

 

Input:

net_id : SINT

The network ID of the I/O Extension network.

 

enable : BOOL

TRUE:

The I/O on devices connected on the net is updated.

FALSE:

The I/O on devices connected on the net is no longer updated.

 

Returns: INT

0

- Success.

1

- The I/O net is not found.

2

- Could not open modbus net.

3

- Could not open serial port.

 

Declaration:

FUNCTION ioNetEnable : INT;
VAR_INPUT
  net_id   : SINT;
  enable   : BOOL;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM ModbusExample;
 
  // Disable net
  ioNetEnable(net_id := 1, enable := OFF);
  ...
 
BEGIN
  ...
END;
END_PROGRAM;