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!
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.
In the configuration window of the event, the function is selected in the folder "Functions > BuildingAutomation > UseBaObjectInUserControl".
The controls in the UserControl are then linked to the BaObject or its subelements via the identifiers of the controls.
It is also possible to connect UserControls within a UserControl with BaObjects. |
Linking
BaObject
To use the BaObject directly, the control must have the identifier $UserControlName$.Root.
$UserControlName$ is replaced with the name of the UserControl.
Make sure that the root element of the UserControl has the same name as the file of the UserControl. |
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.
Access to the element Pu is via the symbol path $UserControlName$.Pu as identifier.
Access to the element Cmd is via the symbol path $UserControlName$.Pu.Cmd as identifier.
Parameters from BaObject
Access to the parameter of an element is done via the symbol path.
Example:
- $UserControlName$.Root.sDescription
- $UserControlName$.Pu.Cmd.bPresentValue
- $UserControlName$.OpMod.OpModMan.nPresentValue
- $UserControlName$.HtgLmt.Sp.fPresentValue
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.