FB_BA_MV_Op

FB_BA_MV_Op 1:

The function block FB_BA_MV_Op represents a multi-state value object.
It is used to display or input a multi-state value.

If something is connected to the input variable nValuePgm, then the object automatically recognizes that it is used to display a value. Otherwise it is used to enter a multi-state value.

The Multi-State_Value object specifies an object type whose properties represent externally visible characteristics of a virtual data point for a "Multi-State Value". The Multi-State_Value has no I/O hardware in the associated Device object, it is stored in memory.

Inheritance hierarchy

FB_BA_Base

    FB_BA_BasePublisher

        FB_BA_Object

Illustration

FUNCTION_BLOCK FB_BA_MV_Op EXTENDS FB_BA_Object IMPLEMENTS I_BA_MultistateOpObject, I_BA_AnyValue
VAR_INPUT
  nValuePgm          : UDINT;
END_VAR
VAR_OUTPUT
  nPresentValue      : UDINT := 1;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  {region 'Variable Parameters'}
    nDefaultValue    : UDINT := 1;
    eToggleMode      : E_BA_ToggleMode := E_BA_ToggleMode.eSwitch;
  {endregion}
  {region 'Fixed Parameters'}
    aStateText       : T_BA_StateTextArray;
  {endregion}
  {region 'Operational Parameters'}
    nValueRm         : UDINT := 1;
  {endregion}
END_VAR
VAR
  {region 'Output-Properties'}
    nStateCount      : UDINT;
  {endregion}
END_VAR
VAR
  {region 'Interface'}
    eValueSource     : E_BA_ProcessSignalSource;
  {endregion}
END_VAR

FB_BA_MV_Op 2: Inputs

Name

Type

Description

nValuePgm

UDINT

Value of a multi-state object for the "Program" priority.

FB_BA_MV_Op 3: Outputs

Name

Type

Description

nPresentValue

UDINT

Current value for multi-stage outputs.

FB_BA_MV_Op 4: Inputs CONSTANT PERSISTENT

Name

Type

Description

nDefaultValue

UDINT

Value that is assumed if all 16 priorities of the Priority_Array of a commandable object have no entry or are NULL.

eToggleMode

E_BA_ToggleMode

Enumeration for defining how the output value bPresentValue of an object is generated depending on the input bValuePgm.

aStateText

T_BA_StateTextArray

The array is used to declare the state texts of a multi-state object.

nValueRm

UDINT

Variable for writing an object from the HMI.

VAR

Name

Type

Description

nStateCount

UDINT

Number of states of a multi-state object.

eValueSource

E_BA_ProcessSignalSource

The variable indicates whether an object of the type FB_BA_..._OP serves as a display or input object.

eVarInput = 1 The object is used to display a value. The value is passed to the object at an input within the PLC.

eParameter = 2 The object is used to enter a parameter that can be changed by a BACnet client or the TwinCAT HMI.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.35

Tc3_XBA from v5.3.0.0