UseBaObjectsInUserControl

Description

By default, a UserControl reads out the complete structure behind a linked parameter, which can lead to a high communication traffic. With a BaObject (e.g. BaView) this can quickly become a lot of data.
This function reduces the server communication to a minimum when using a BaObject as a parameter in a UserControl.

Use

The parameter from the UserControl for the BaObject must be of type Symbol. By this definition the parameter is not read, but only passed on.
Likewise the name of the parameter must be BaObject!

UseBaObjectsInUserControl 1:
UseBaObjectsInUserControl 2:

In this way, access to the underlying symbols of the BaObject is no longer possible.

The function should be called whenever the BaObject parameter has been changed.
For this purpose, a new event .BaObject is created.

UseBaObjectsInUserControl 3:
UseBaObjectsInUserControl 4:

In the configuration window of the event, the function is selected in the folder "Functions > BuildingAutomation > UseBaObjectInUserControl".

UseBaObjectsInUserControl 5:

The controls in the UserControl are then linked to the BaObject or its subelements via the identifiers of the controls.

UseBaObjectsInUserControl 6:

It is also possible to connect UserControls within a UserControl with BaObjects.
The identifier must be assigned as explained in the next paragraph. Likewise, the inner UserControl must then also have the parameter BaObject.

Linking

BaObject

To use the BaObject directly, the control must have the identifier $UserControlName$.Root.
$UserControlName$ is replaced with the name of the UserControl.

UseBaObjectsInUserControl 7:
UseBaObjectsInUserControl 8:

Make sure that the root element of the UserControl has the same name as the file of the UserControl.
UseBaObjectsInUserControl 9:

Subelements of BaObject

To use a subelement, the control must carry the symbol path as identifier.
Explanation using the example of a BaView with the following structure.

UseBaObjectsInUserControl 10:

Access to the element Pu is via the symbol path $UserControlName$.Pu as identifier.

UseBaObjectsInUserControl 11:

Access to the element Cmd is via the symbol path $UserControlName$.Pu.Cmd as identifier.

UseBaObjectsInUserControl 12:

Parameters from BaObject

Access to the parameter of an element is done via the symbol path.

Example:

If the control is of type Checkbox, ComboBox or InputBox, then the value of the parameter is written to the PLC after the user interaction is terminated.

Without BaObject or BaParameter

If the control or UserControl within the UserControl is not to work with a BaObject or BaParameter, then the identifier of the control must not contain $UserControlName$..

Parameter

UserControl

tchmi:framework#/definitions/TcHmi.Controls.System.TcHmiUserControl

The UserControl in which the BaObjects are to be used. Mostly this parameter is the UserControl itself (self).

BaObject

tchmi:general#/definitions/Object

The UserControl parameter to which the BaObject is connected from the outside must be linked with this parameter.