Skip to content

(Direct Binding) Modes and Types

Stephan Stricker edited this page Apr 29, 2020 · 4 revisions

Binding modes

  • "oneWay" is used for read access to the source. Example: Binding between an OPC UA variable and an output widget (e.g. widget "NumericOutput")
  • "twoWay" is used for read and write access to the source. Example: Binding between an OPC UA variable and an input widget (e.g. widget "NumericInput")
  • "oneWayToSource" is used for write access to the source. Example: Binding between an OPC UA variable and widget "PushButton"

Binding types

Value binding

Value binding is used if only the value is needed without units or limits. Data forwarding only involves the value of the bound variable.

<Binding mode="oneWay">
    <Source xsi:type="opcUa" refId="::AsGlobalPV:gMainLogic.par.coffeeType" attribute="value" />
    <Target xsi:type="brease" widgetRefId="ImageSwitchCoffeeType" contentRefId="myContent" attribute="selectedIndex" />
</Binding>

Node binding

Node binding is used if the value is needed with units or limits. Data forwarding involves the value, unit and limits of the bound variable.

<Binding mode="oneWay">
    <Source xsi:type="opcUa" refId="::AsGlobalPV:gMainLogic.par.coffeeType" attribute="node" />
    <Target xsi:type="brease" contentRefId="myContent" widgetRefId="ImageSwitchCoffeeType" attribute="node" />
</Binding>

List binding

If a value is needed from a list of values, then a list binding is used. With list binding, a list of values and a selector are defined. The value of the selector defines which element in the list will be selected. The value of the element from the list defines which value is bound. The selection is made using the index of the element.

In this example the slotId from the session is used in combination with the isLoggedIn flag to show or hide a button.

<Binding mode="oneWay">
  <Source xsi:type="listElement" >
	<Selector xsi:type="session" refId="::SYSTEM:clientInfo.slotId" attribute="value"  />
	<be:List xsi:type="be:opcUa" attribute="value" >
	  <bt:Element index="0" refId="::AsGlobalPV:ClientInfo[0].isLoggedIn" />
	  <bt:Element index="1" refId="::AsGlobalPV:ClientInfo[1].isLoggedIn" />
	  <bt:Element index="2" refId="::AsGlobalPV:ClientInfo[2].isLoggedIn" />
	  <bt:Element index="3" refId="::AsGlobalPV:ClientInfo[3].isLoggedIn" />
	  <bt:Element index="4" refId="::AsGlobalPV:ClientInfo[4].isLoggedIn" />
	</be:List>
  </Source>
  <Target xsi:type="brease" contentRefId="myContent" widgetRefId="LogoutButton1" attribute="visible" />
</Binding>

In this example the PLC Variable IndexVar is used to bind one of the PLC variables TestVar2 to an numeric input.

<!-- Multiple bindings from between PLC and mappView />-->	
  <Binding mode="twoWay">
    <Source xsi:type="listElement">
      <Selector xsi:type="opcUa" refId="::AsGlobalPV:IndexVar" attribute="value" />
        <be:List xsi:type="be:opcUa" attribute="value">
	  <bt:Element index="0" refId="::AsGlobalPV:TestVar2[0]" />
	  <bt:Element index="1" refId="::AsGlobalPV:TestVar2[1]" />
	  <bt:Element index="2" refId="::AsGlobalPV:TestVar2[2]" />
	  <bt:Element index="3" refId="::AsGlobalPV:TestVar2[3]" />
        </be:List>
     </Source>
    <Target xsi:type="brease" contentRefId="contentStart" widgetRefId="NumericInput2" attribute="value" />
</Binding>

Example of a list of type "brease"

<Binding mode="oneWay">
  <Source xsi:type="listElement" >
	<Selector xsi:type="session" refId="selectorVar" attribute="value"  />
	<be:List xsi:type="be:brease" contentRefId="contentId1" >
	  <bt:Element index="0" widgetRefId="numericInput1" attribute="value" />
	  <bt:Element index="1" widgetRefId="numericInput2" attribute="value" />
	  <bt:Element index="2" widgetRefId="numericInput3" attribute="value" />
	</be:List>
  </Source>
  <Target xsi:type="opcUa" refId=":Prg1:Var1" attribute="value" />
</Binding>

Structure binding

If multiple values of a structure are needed, then a structure binding is used.

<ComplexBinding templateId="TankData" widgetType="widgets.CoffeeMachine.Tank">
    <SourceRoot xsi:type="opcUaComplex" refId="::AsGlobalPV:TankStruct"/>
    <TargetRoot xsi:type="breaseComplex" widgetRefId="SetupTank1" contentRefId="Content1"/>
</ComplexBinding>

mapp Link binding

A mapp Link binding is used by widgets that can exchange information with a mapp component.

<Binding mode="twoWay">
    <Source xsi:type="mapp" refId="mpAlarmXCore" attribute="link" />
    <Target xsi:type="brease" widgetRefId="AlarmList1" contentRefId="myContent" attribute="mpLink" />
</Binding>
Clone this wiki locally