FB_BA_BV_Op

The FB_BA_BV_Op function block represents a binary value object.
It is used to display or input a binary value.
The function of the binary value object is defined by parameterizing the proprietary property eToggleMode, which determines whether it behaves as a switch or a push button.
eToggleMode = E_BA_ToggleMode.eSwitch means that the output value bPresentValue behaves normally and outputs the state of bValuePgm or bValueRm.
If something is connected to the bValuePgm input variable, the object automatically recognizes that the state of this input variable is output to bPresentValue. In the other case, the state bValueRm is output at the bPresentValue output.
eToggleMode = E_BA_ToggleMode.ePushButton means that the output value bPresentValue is determined by bValueRm. A change in the state of bValueRm means that the value of bValueRm changes for one cycle and then automatically returns to the old state. The object behaves like a push button.
The original value of bValueRm depends on the parameterization of bDefaultValue.
bValuePgm has no influence on bPresentValue if eToggleMode := E_BA_ToggleMode.ePushButton.
Syntax
FUNCTION_BLOCK FB_BA_AV_Op EXTENDS FB_BA_Object IMPLEMENTS I_BA_AnalogOpObject, I_BA_AnyValue
VAR_INPUT
bValuePgm : BOOL;
END_VAR
VAR_OUTPUT
bPresentValue : BOOL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
{region 'Variable Parameters'}
{attribute 'parameterCategory':='Value'}
bDefaultValue : BOOL;
{attribute 'parameterCategory':='Value'}
{attribute 'TcEncoding':='UTF-8'}
sInactiveText : T_BA_StateText;
{attribute 'parameterCategory':='Value'}
{attribute 'TcEncoding':='UTF-8'}
sActiveText : T_BA_StateText;
{attribute 'parameterCategory':='Behaviour'}
eToggleMode : E_BA_ToggleMode := E_BA_ToggleMode.eSwitch; // Only used if Instance is used as a setpoint!
{endregion}
{region 'Operational Parameters'}
{attribute 'parameterCategory':='Value'}
bValueRm : BOOL;
{endregion}
END_VAR
Inputs CONSTANT PERSISTENT
Name | Type | Description |
|---|---|---|
bDefaultValue | BOOL | Value that is assumed if all 16 priorities of the Priority array of a commandable object have no entry or are NULL. |
sInactiveText | Text output when the object is inactive. | |
sActiveText | Text output when the object is active. | |
eToggleMode | E_BA_ToggleMode | The enumeration can be used to specify how the bPresentValue output value of an object is generated depending on the bValuePgm input. If eToggleMode = eSwitch, then bPresentValue is equal to the value of bValuePgm. If eToggleMode = ePushButton, the value of bPresentValue changes with each rising edge of bValuePgm. |
bValueRm | BOOL | Variable for writing to a binary object from the HMI. |
Requirements
Development environment | Required PLC library |
|---|---|
TwinCAT from v3.1.4024.35 | Tc3_XBA from v5.3.0.0 |
Outputs