At a Glance
This example
covers canceling an exchange carried out with the OUT_IN_CHAR
function.
When the exchange is launched, a unique number is assigned to it. This number remains valid until the end of the exchange.
The CANCEL
function uses this number to interrupt the exchange to which it
is assigned.
Programming the OUT_IN_CHAR
Function
Programming in ST:
IF RE(%I0.3.8) AND NOT %MW170.0 THEN
(* initialization of the data to send *)
%MW173 := 10;
(* communication function *)
OUT_IN_CHAR(ADDR(‘{20.5}0.0.0.SYS’),1,Str_Out,Str_In,%MW170:4);
END_IF;
Programming the CANCEL
Function
Programming in ST:
%MW180 := SHRZ_INT(%MW170,8);
IF RE(%I0.3.9) THEN
CANCEL(%MW180,%MW185);
END_IF;
The CANCEL
function comprises
two parameters:
on input: the exchange number to be cancelled
on output: the report
It is necessary to initialize the first parameter with the
number of the exchange to be cancelled. This number is located in
the most significant byte of the first word of the management table.
For us, this is the most significant byte of %MW170
. Before sending the CANCEL
function, it is necessary to create an 8 bit shift in order to recover
the eight most significant bits of %MW170
.
Request parameters:
Parameters |
Description |
---|---|
|
The least significant bit contains the number of the exchange to be cancelled. NOTE: The most significant byte must be zero. |
|
Function report. |