to pop up its description (if any).


As shown above, this FB type is derived from the Basic0T
type by deleting the
transitions between the
REQ
state and the
START
state, thereby converting the
REQ
state to a Simple EC
State. Its interface, algorithms, and externally observable
behaviors of instances are identical to those for the
Basic0T
type.
As shown below, this conversion results in a reduction of 33% in the
number of lines of executable Event Handling Lines Of Code (EHLOC)
and 28% in the total EHLOC, but only 9% in the size of the compiled
Java™
.class
file.
NOTE - "Hybrid" ECCs such as the one shown above might not be portable between the FBDK and other engineering environments, and might not be compilable for other runtime environments.
FB type | Total EHLOC | Executable EHLOC | .class file size |
---|---|---|---|
Basic0T |
25 | 15 | 2192 |
Basic1T |
18 | 10 | 1986 |
In the listing below, executable Event Handling Lines Of Code
(EHLOCs) are highlighted in orange
and non-executable EHLOCs are highlighted in yellow.
and non-executable EHLOCs are highlighted in yellow.
public class Basic1T extends fb.rt.FBInstance { /** The index (0) of state START. */ public static final int INDEX_START = 0; /** The index (1) of state INIT. */ public static final int INDEX_INIT = 1; /** Initialization Confirm */ public final EventOutput INITO = new EventOutput(); /** Execution Confirmation */ public final EventOutput CNF = new EventOutput(); /** Initialization Request */ public final EventServer INIT = (e) -> service_INIT(); /** 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 Basic1T(){ super(); } protected synchronized void service_INIT(){ if(eccState == INDEX_START){ state_INIT(); } } /** The actions to take upon entering state START. */ void state_START(){ eccState = INDEX_START; } /** The actions to take upon entering state INIT. */ void state_INIT(){ eccState = INDEX_INIT; alg_INIT(); INITO.serviceEvent(this); state_START(); } /** 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";} }