Using configuration PLC attributes

The common form for using configuration PLC attributes is:

{attribute 'TcHmi.ProcessLibrary.[Attribute Name]' := '[Value/Values separated by comma]'}
Using configuration PLC attributes 1:

Where to use configuration attributes

Configuration attributes should be used in the declaration. Depending on a type, before FUNCTION_BLOCK keyword or within the VAR_ area right before a declaration of the variable which is to be linked to an element of the control.

Pragma can be used to group the attributes, {region}…{endregion}.

Examples of using configuration PLC attributes

The TcHmi.ProcessLibrary.FaceplateControl attribute with the region pragma:

{region 'TcHmiProcessLibrary.FaceplateControl'}
    {attribute 'TcHmi.ProcessLibrary.FaceplateControl.TargetFile':= 'CustomFaceplates/fbAttrTest_Operate.usercontrol'}
    {attribute 'TcHmi.ProcessLibrary.FaceplateControl.Parameter' := 'DataSymbol:= THISEXP^'}
{endregion}

Configuring a faceplate with the region pragma:

{region 'TcHmiProcessLibrary.FaceplateParameters'}
    {attribute 'TcHmi.ProcessLibrary. ShowFaceplate' := 'True'}
    {attribute 'TcHmi.ProcessLibrary.Modal' := 'False'}
    {attribute 'TcHmi.ProcessLibrary.Movable' := 'True'}
    {attribute 'TcHmi.ProcessLibrary.RestoreBounds' := 'False'}
    {attribute 'TcHmi.ProcessLibrary.HideWithControl' := 'True'}
    {attribute 'TcHmi.ProcessLibrary.ReshowWithControl' := 'False'}
{endregion}

Configuring a faceplate tab:

{attribute 'TcHmi.ProcessLibrary.Tab1.Name' := 'CustomOperate'}
{attribute 'TcHmi.ProcessLibrary.Tab1.TargetFile' := 'CustomFaceplates/fbAttrTest_Operate.usercontrol,true,true,false'}
{attribute 'TcHmi.ProcessLibrary.Tab1.Parameter' := 'DataSymbol:= THISEXP^'}
{attribute 'TcHmi.ProcessLibrary.Tab1.Alignment' := 'Center,Center'}
{attribute 'TcHmi.ProcessLibrary.Tab1.Icon' := 'PLPATH^/Images/Operate.svg,32,32,px,px'}

Configuring a faceplate tab with the ready-to-use Faceplate_Chart.usercontrol:

{attribute 'TcHmi.ProcessLibrary.Tab2.Name' := 'Chart'}
{attribute 'TcHmi.ProcessLibrary.Tab2.TargetFile' := 'Faceplates/Faceplate_Chart.usercontrol,true,true,false'}
{attribute 'TcHmi.ProcessLibrary.Tab2.Parameter' := 'DataSymbolPath1:= THIS^.fValue,SclMin:=0,SclMax:=10000,Unit:=STAG^THIS^::nUnitETAG^'}
{attribute 'TcHmi.ProcessLibrary.Tab2.Alignment' := 'Center,Center'}
{attribute 'TcHmi.ProcessLibrary.Tab2.Icon' := 'PLPATH^/Images/Chart.svg,32,32,px,px'}
Using configuration PLC attributes 2:

Making a variable for chart historization

The ‘Chart’ attribute should be added before the declaration of the variable (within VAR_ area). A chart will be shown for this to historize it:

{attribute 'TcHmi.ProcessLibrary.Chart'}
fValue: REAL;

Configuring a faceplate tab using ready-to-use faceplate:

{attribute 'TcHmi.ProcessLibrary.Tab3.Name' := 'CustomOperate2'}
{attribute 'TcHmi.ProcessLibrary.Tab3.TargetFile' := 'Faceplates/BinVlvFaceplate_Operate.usercontrol,true,true,false'}
{attribute 'TcHmi.ProcessLibrary.Tab3.Parameter' := 'DataSymbol:=STAG^ PLC1.GVL_MTP.V01ETAG^'}
{attribute 'TcHmi.ProcessLibrary.Tab3.Alignment' := 'Center,Center'}
{attribute 'TcHmi.ProcessLibrary.Tab3.Icon' := 'Imports/Images/EX-logo.svg,32,32,px,px'}

Configuring label appearance:

{region 'TcHmiProcessLibrary.LabelParameters'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextHorizontalAlignment' := 'Right'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextVerticalAlignment' := 'Bottom'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.Left' := '-10'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.LeftUnit' := 'px'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.Top' := '-50'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.TopUnit' := '%'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.Right' := '-10'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.RightUnit' := 'px'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.Bottom' := '-10'}
    {attribute 'TcHmi.ProcessLibrary.LabelTextPadding.BottomUnit' := 'px'}
{endregion}