Using sampling rates

<< 点击显示目录 >>

主页  mappView帮助助手 > mapp View帮助信息 > 工程 > 变量和数据 > OPC UA 变量 >

Using sampling rates

采样率与简单绑定

为了使用采样率,必须创建一个OPC UA绑定。

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

如果没有为opcUA类型指定额外的属性--如本例中的情况--那么就会使用默认的采样率("default")。

要改变绑定变量的采样率,请使用额外的 "samplingRate "属性。

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

可以在不同的绑定中为同一个OPC UA变量指定不同的采样率。

动态绑定的采样率

通过动态绑定,采样率在整个列表中被指定一次。因此,列表中的每个元素使用相同的采样率。

    <Binding mode="oneWay">
      <Source xsi:type="listElement">
        <Selector xsi:type="brease" widgetRefId="selectorWidget" contentRefId="contentId1" attribute="value" />
        <be:List xsi:type="be:opcUa" attribute="value" samplingRate="slow" >
          <bt:Element index="0" refId="x1"/>
          <bt:Element index="1" refId="x2"/>
          <bt:Element index="2" refId="x3"/>
        </be:List>
      </Source>
      <Target xsi:type="brease" contentRefId="contentId1" widgetRefId="Output_detail2" attribute="value" />
    </Binding>

复杂绑定的采样率

不能为复杂绑定指定采样率。绑定结构变量的采样率由绑定模板定义。

       <ComplexBinding templateId="TankData" widgetType="widgets.DemoProject.Tank">
         <SourceRoot xsi:type="opcUaComplex" refId="::AsGlobalPV:TankCnt1"/>
         <TargetRoot xsi:type="breaseComplex" contentRefId="contentId" widgetRefId="Tank1"/>
        </ComplexBinding>