Function Description

The CANCEL function is used to interrupt an asynchronous communication function in progress. The exchange number assigned to each communication can be used to identify the function to be stopped.

The time between the CANCEL function request and the CANCEL action depends on the number of communication functions in progress. The use of a CANCEL function means that for all channels and EFs:

  • The assigned asynchronous communication functions in progress are cancelled.

  • The dedicated frames buffered before using the CANCEL function may be sent.

NOTE: In character mode, the assigned INPUT_CHAR, INPUT_BYTE and/or OUT_IN_CHAR elementary functions in progress are cancelled and the associated asynchronous serial link channel is unlocked if it is waiting for the ending criteria.
NOTE: The execution of this function is synchronous with the execution of the PLC program (the communication function is stopped in the PLC cycle during which the CANCEL function was executed).

The additional parameters EN and ENO can be configured.

NOTE: Cancelling an exchange is effective at the application level, but has no effect at the physical communication port level. After a communication function has been initiated, the exchange is managed at the communication port level.

Cancelling a communication function at the application level means the Activity bit is reset, the Report is written the value 2, the Exchange number is released. If a reply is finally received at the port level for the exchange request, it can no longer be taken into account at the application level.

In the same manner, the Time Out event of communication function doesn't stop retries of a communicating module. This can happen when the network is slow and/or of low quality, causing retransmissions. In such a situation, consistency between the applicative Time Out at the EF level and protocol Time Outs configured at the module level, should be ensured.

FBD Representation

Representation:

Ladder Representation

Representation:

IL Representation

Representation:

LD Exchange_Num
CANCEL
ST Report

ST Representation

Representation:

CANCEL(Exchange_Num, Report);

Parameter Description

The following table describes the input parameters:

Parameter

Type

Comment

NUM

INT

This parameter specifies the number of the exchange whose execution is to be stopped.

The following table describes the output parameters:

Parameter

Type

Comment

CR

INT

This operation report is assigned one of the following two values:

  • 16#00: Correct operation. Communication is interrupted, the activity bit of the interrupted function is set to 0 and its report is assigned the value 2.

  • 16#0C: Incorrect exchange number.