FUNCTION_BLOCK Simple2T

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

ECC

As shown above, this FB type can be derived from the Basic0T or Basic1T type by deleting the START state and its associated transitions, thereby converting the REQ and INIT states to Simple EC States. The interface, algorithms, and externally observable behaviors of instances of this type are identical to those for either the Basic0T or Basic1T type.

As shown below, this conversion results in a reduction of 73% in the number of lines of executable Event Handling Lines Of Code (EHLOC), 68% in the total EHLOC, and 26% in the size of the compiled Java™ .class file vs. the Basic0T type.

FB type Total EHLOC Executable EHLOC .class file size
Basic0T 25 15 2192
Basic1T 18 10 1986
Simple2T 8 4 1616
In the listing below, executable Event Handling Lines Of Code (EHLOCs) are highlighted in orange
and non-executable EHLOCs are highlighted in yellow.
public class Simple2T extends fb.rt.FBInstance {
/** Initialization Confirm */
public final EventOutput INITO = new EventOutput();
/** Execution Confirmation */
public final EventOutput CNF = new EventOutput();
/** Initialization Request */
public final EventServer INIT = (e) -> {
  alg_INIT();
  INITO.serviceEvent(this);
  }
;
/** Normal Execution Request */
public final EventServer REQ = (e) -> {
  alg_REQ();
  CNF.serviceEvent(this);
  }
;
/** Input event qualifier */
  public BOOL QI = new BOOL();
/** Output event qualifier */
  public final BOOL QO = new BOOL();
/** VAR RESULT:WSTRING */
  public final WSTRING RESULT = new WSTRING();
/** The default constructor. */
public Simple2T(){
    super();
  }
  /** ALGORITHM INIT IN ST*/
public void alg_INIT(){
QO.value = QI.value;
RESULT.value = "INIT";}
  /** ALGORITHM REQ IN ST*/
public void alg_REQ(){
QO.value = QI.value;
RESULT.value = "REQ";}
}