ioSetMode (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All devices with RS485

Firmware version:

2.10 / 1.00.00


This function will change how external I/O devices are updated.

There are two different update modes:

 

Asynchronous (0, Default)

The update of the external I/O devices is started in the BEGIN/END construction and is performed asynchronously with the onboard I/O.

This ensures that the communication will not slow down execution of the application while the variables bound to inputs in external I/O devices are not updated until the next instance of the BEGIN/END construction (possibly longer if the BEGIN/END loop is executed faster than the update communication).

 

Synchronous (1)

The external I/O devices are never updated in the BEGIN/END construction.

The update is performed with the ioSynchronize function which does not return until after the communication has been completed.

Note:  the VPL variables bound to in- and outputs are not updated by the ioSynchronize function. This only happens in the BEGIN/END construction.

 

Note: UPDATEIO and UPDATEOUT work like the BEGIN/END construction for updating the external I/O devices.

 

 

Input:

mode : INT (0/1, Default 0)

The I/O Extension update mode.

0

Asynchronous update of I/O Extension devices.

1

Synchronous update of I/O Extension devices with ioSynchronize.

 

Returns:

0

- The mode is set.

1

- Unknown mode.

 

Declaration:

FUNCTION ioSetMode;
VAR_INPUT
  mode : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM ModbusExample;
 
ioSetMode(mode := 1);
 
BEGIN
  ioSynchronize();   // Update the external I/O
  ...
END;
END_PROGRAM;