FB_BA_Object

FB_BA_Object 1:

The function block FB_BA_Object represents the basis for the development of further objects.

These objects must be called cyclically in the project, here the suspension of calls ( e.g. within IF conditions) prevents a correct initialization.

FB_BA_Object 2:

Objects should be declared in a VAR or VAR_INPUT CONSTANT area.
Persistent declaration areas must be avoided!

FB_BA_Object 3:

Within inherited FBs the base FB must be called with "SUPER^()"!

Initialization

While an object is initialized, it passes through several states in succession:

Inheritance hierarchy

FB_BA_BasePublisher

    FB_BA_Object

Illustration

FUNCTION_BLOCK ABSTRACT FB_BA_Object EXTENDS FB_BA_BasePublisher IMPLEMENTS I_BA_Object, I_BACnet_ObjectOwner
VAR_INPUT CONSTANT PERSISTENT
  {region 'Fixed Parameters'}
    nInstanceID          : UDINT;
    sDeviceType          : T_BA_SmallString := XBA_Globals.sPlaceholder_Empty;

    eAssignAsTrendRef    : E_BA_AssignRefMode := E_BA_AssignRefMode.eInitByProfile;
  {endregion}
  {region 'Variable Parameters'}
    sObjectName          : T_MaxString := XBA_Globals.sPlaceholder_Empty;
    sDescription         : T_MaxString := XBA_Globals.sPlaceholder_Empty;
    sTag                 : STRING(XBA_Param.nTag_Length);
  {endregion}
END_VAR
VAR PERSISTENT
  {region 'General'}
    sInstObjectName      : STRING;
    sInstDescription     : STRING;
  {endregion}
END_VAR
VAR
  {region 'Fixed Variables'}
    iParent              : I_BA_View;
    iLabel               : I_BA_Label;
    iProfile             : I_BA_Profile;
  {endregion}
  {region 'SubInit'}
    eObjectType          : E_BA_ObjectType := E_BA_ObjectType.eObject;
    stAttributes         : ST_BA_ObjectAttributes;
  {endregion}
END_VAR
VAR
  {region 'General'}
    nLevel               : UINT := 0; // Current hierarchy level according to root object (which hast level 0)
    eState               : E_BA_ObjectState := E_BA_ObjectState.First;
    sFmtPresentValue     : STRING;// Present value in a formated string
  {endregion}
END_VAR

FB_BA_Object 4: Inputs CONSTANT PERSISTENT

Name

Type

Description

nInstanceID

UDINT

This property is a numeric code, for identifying the object. It must be unambiguous inside the device.

sDeviceType

T_BA_SmallString

This property is a text description of the physical device connected to the analog output.

eAssignAsTrendRef

E_BA_AssignRefMode

Reference mode.

sDescription

T_MaxString

This property represents a description text for the object.

In the base framework of TF8040, each level can receive a substring. The substrings of the levels are concatenated by the DPAD mechanism so that the complete name of the object is created by means of this algorithm (see DPAD).

sTag

STRING

This property represents an additional description text for the object.

The string sTag can be applied user-specific or project-specific. To enter the control cabinet device identification, for example.

FB_BA_Object 5: Inputs PERSISTENT

Name

Type

Description

sInstObjectName

STRING

Object name of the instance.

sInstDescription

STRING

Instance description.

VAR

Name

Type

Description

iParent

I_BA_Parent

Parent object interface.

iLabel

I_BA_Label

Interface description.

iProfile

I_BA_Profile

Profile interface.

eObjectType

E_BA_ObjectType

Selection of the object type.

stAttributes

ST_BA_ObjectAttributes

Attribute definition.

nLevel

UINT

Current hierarchical level according to the base object (level 0).

eState

E_BA_SubscriberState

Evaluation of the subscriber state.

sFmtPresentValue

STRING

Current value in a formatted string.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.35

Tc3_XBA from v5.3.0.0