As shown above, this function block type is modeled as a composite
type using an instance of the FB_SEL_COLOR
type and an instance of the OUT_COLOR
type to display a colored circle with a label to its right. In
practice, it is implemented as a subclass of
OUT_COLOR
.
When an event occurs at the
REQ
input while
QI=TRUE
, the color is updated to the value specified by the
C0
or
C1
input depending on whether the value of the
IN
input is
FALSE
or
TRUE,
respectively.
The input/output semantics of this FB type are as described below.
See the TESTBED_MVCL
System configuration for examples of the use of instances of this
type.
EVENT_INPUT
INIT WITH QI,LABEL,IN,C0,C1; (* Initialization *)
REQ WITH QI,IN,LABEL,C0,C1; (* Request *)
END_EVENT
EVENT_OUTPUT
INITO WITH QO; (* Initialization Confirm *)
CNF WITH QO; (* Service Confirmation *)
END_EVENT
VAR_INPUT
QI : BOOL := true; (* 1=Output Enabled, 0=Disabled *)
LABEL : WSTRING; (* Label *)
IN : BOOL; (* Input value *)
C0 : COLOR := COLOR#white; (* Color when IN=0 *)
C1 : COLOR := COLOR#green; (* Color when IN=1 *)
END_VAR
VAR_OUTPUT
QO : BOOL; (* 1=Output Enabled, 0=Disabled *)
END_VAR