FB_BA_Object

The FB_BA_Object function block represents the basis for the development of further objects.
An overview of the integration of the FB_BA_Object can be found at the beginning of the Tc3_XBA documentation.
These objects must be called cyclically in the project. The suspension of calls (e.g., within IF conditions) prevents correct initialization here.
![]() | Objects should be declared in a VAR or VAR_INPUT CONSTANT area. |
![]() | Within inherited FBs the base FB must be called with "SUPER^()"! |
Initialization
While an object is initialized, it passes through several states in succession:
- All objects initialize until "E_BA_ObjectState.eWaitForInit"
- After that, the XBA_Globals.Top parameter signals to continue object initialization
- All objects continue until "E_BA_ObjectState.eWaitForProject"
- Top starts the project when all objects are set to "E_BA_ObjectState.eWaitForProject".
- All objects now go to "E_BA_ObjectState.eOperation"
- Top signals for one more cycle "E_BA_ProjectState.eFirstOpCycle"
- Then the project also goes into "E_BA_ProjectState.eOperation"
Syntax
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 has level 0)
eState : E_BA_ObjectState := E_BA_ObjectState.First;
sFmtPresentValue : STRING;// Present value in a formated string
{endregion}
END_VAR
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 | This property is a text description of the physical device connected to the analog output. | |
eAssignAsTrendRef | Assigns objects as a reference to trend objects (automatic trending). The selected setting is executed once and automatically disabled after use. It is possible to manually adjust the settings of individual objects at any time. | |
sObjectName | This property represents a name for the object. It must be unambiguous within the device. 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). | |
sDescription | 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. |
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 | Selection of the object type. | |
stAttributes | Attribute definition. | |
nLevel | UINT | Current hierarchical level according to the base object (level 0). |
eState | 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 |
