FUNCTION_BLOCK X2Y2_ST

Hover on a highlighted element
to pop up its description (if any).

ALGORITHM REQ IN ST :
  OUT := (X-Y)*(X+Y);
END_ALGORITHM

Upon the occurrence of an event at its REQ input, an instance of this Simple Function Block type computes the value of its OUT variable, followed by an event at its CNF output. The OUT value is computed via the REQ algorithm shown above, which uses the IEC 61131-3 FBD (Function Block Diagram) graphical language to implement the formula

OUT = x2 - y2 = (x + y)*(x - y) .

The external interface and functionality of this FB type are the same as for the X2Y2 and X2Y2_FBD types, and its execution control is the same as for the X2Y2_FBD type. The only difference is that in this FB type, the REQ algorithm is written in the IEC 61131-3 ST (Structured Text) language, as shown above.