事件绑定用于实现示例人机界面应用程序的以下功能:
•在以下情况下应显示弹出消息:
•如果在初始填充或更新列表时发生错误。
也就是说,如果 OPC UA 变量 ListApplication.Error 中出现 True 值,则弹出消息将显示为 "确定"。
•用 "确定 "关闭弹出消息时,应重置人机界面应用程序。
也就是说,将 OPC UA 变量 DoClearData 设为 True。
•如果在加载选定的视觉应用程序时发生错误。
也就是说,如果 OPC UA 变量 LoadApplication.Error 出现 True 值,则应重置人机界面应用程序。
•用 "确定 "关闭弹出信息,重置人机界面应用程序。
也就是说,将 OPC UA 变量 DoClearData 设为 True。
•单击 "加载应用程序 "按钮将当前选择的视觉应用程序成功加载到摄像机后。
也就是说,如果 OPC UA 变量 LoadApplication.Done 的值为 True。
•用 "确定 "关闭弹出信息时,应更新列表。
也就是说,将 OPC UA 变量 DoGenerateList 设为 True。
•如果可加载的视觉程序多于可列出的数量,则显示警告提示。
也就是说,如果在 OPC UA 变量 ListApplication.StatusID 上出现 viBASE_INF_APP_LIST_NOT_COMPLETE (1102315666) 值,就会显示警告通知。
•如果在此期间可加载的视觉应用程序数量已减少到可列出的数量,例如通过在 mapp Vision 中删除,则也会隐藏此警告。
也就是说,如果 OPC UA 变量 ListApplication.StatusID 的值为 0。
•仅适用于带部件 DropDownBox 的变体 B:在初始填充或更新列表后选择第一个条目。
也就是说,当 OPC UA 变量 ListRefreshCounter 的值发生变化时。
首先,将文件名为ePCUC. eventbinding、名称为ePCUC_eventBinding的事件绑定集文件添加到配置视图的 "mapp View "包中。

针对上述功能,现在将在该文件中创建四个事件绑定1),每个绑定介于opcUA.Event和clientSytstem.Action以及opcUA.NodeAction 之间(如适用)。例如,在加载选定的视觉应用程序时,如果出现错误,弹出式信息就会出现:
将 opcUA.Event 从工具箱拖入事件绑定集编辑器窗口:

然后直接在属性窗口中设置ListRefreshError名称。

现在,事件在属性窗口中的配置如下:
1.单击事件绑定集编辑器图形显示中的橙色opcUA区域。
2.选择条目ValueChanged作为事件 ID。
3.双击refId行,打开对话框 "选择OPC UA 变量"。
4.选择子节点值为相应的 OPC UA 变量(如 ListApplication.Error)。
5.确定后再次关闭对话框。

然后将clientSystem.Action元素从工具箱拖入事件绑定 ListRefreshError 的Action部分。

人机界面应用程序不应对 ListApplication.Error 的每次值变化都作出弹出消息的反应,而只应对正边作出反应。该条件定义如下:
1.单击事件绑定集编辑器图形显示中的 "执行"矩形。
2.在属性窗口的条件行右侧部分输入newValue AND NOT oldValue。

与事件关联的 clientSystem.Action 现在配置如下:
1.单击事件绑定集编辑器图形显示中的蓝色clientSystem区域。
2.在属性窗口中,选择右侧部分方法行中的ShowMessageBox。
3.以这些静态属性为例,定义弹出消息以提醒用户出错:
•类型OKCancel
•消息:在函数块 ViBaseListApplication 中出错。列表和功能块将被重置。
•页眉:警告
•图标:感叹号

可通过确定或取消关闭弹出消息。用户可通过 "确定 "确认 "列表和功能块将重置 "信息。作为对确定的反应,OPC UA 变量 DoClearData 应设置为 True。
为此,首先将元素opcUa.NodeAction从工具箱拖到事件绑定 ListRefreshError 的结果部分。

现在定义的条件是,添加的 opcUa.NodeAction 仅在 OK 时执行。
1.点击事件绑定集编辑器图形显示中的 "执行"矩形。
2.在 "属性 "窗口中,在条件行右侧部分输入result = 4.2)

然后对 opcUa.NodeAction 进行如下配置:
1.点击事件绑定集编辑器图形显示中的opcUa橙色内侧区域。
2.双击 refId 行,打开对话框 "选择 OPC UA 变量"。
3.选择子节点值为相应的 OPC UA 变量(如 ListApplication.Error)。
4.确定后再次关闭对话框。

5.在方法行的右侧部分选择SetValueBool。
6.在值行中设置静态值true。

✓最后保存更改后,事件绑定设置文件 ePCUC.eventbinding 包含以下 文本视图中 事件绑定 ListRefreshError的 条目 :
<?xml version="1.0" encoding="utf-8"?
<EventBindingSet id="ePCUC_eventBinding" xmlns="http://www.br-automation.com/iat2014/eventbinding/v2" xmlns:types="http://www.br-automation.com/iat2015/widgetTypes/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Bindings> 事件绑定
<EventBinding id="ListRefreshError">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 动作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseListApplication.列表和功能块将被重置。" header="Warning" icon="Exclamation" /> </Target> <Page="ViBaseListApplication 中的错误"。
</Target> 目标
<Result> 结果
<ResultHandler condition="result = 4">
<动作
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </事件绑定
</绑定
</EventBindingSet> </EventBindingSet
mapp Vision 帮助文档的这一部分无法描述如何创建所有必要的事件绑定。这里记录了两个变体的ePCUC.eventbinding文件的 XML 内容。
引用 contentRefId、refId 和 widgetRefId 与前面的章节一致。任何更改都必须进行相应调整。
<?xml version="1.0" encoding="utf-8"?
<EventBindingSet id="ePCUC_eventBinding"
xmlns="http://www.br-automation.com/iat2014/eventbinding/v2"
xmlns:types="http://www.br-automation.com/iat2015/widgetTypes/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<绑定> <事件绑定
<EventBinding id="ListRefreshError">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 动作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseListApplication.列表和功能块将被重置。" header="Warning" icon="Exclamation" /> </目标
</Target> 目标
<Result> 结果
<ResultHandler condition="result = 4">
<动作
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </EventBinding
<EventBinding id="ListRefreshIncompleteInfo">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.StatusID" event="ValueChanged" />
<EventHandler condition="newValue = 1102315666">
<Action> 操作
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="true" /> </p
</目标
</动作
</EventHandler> </EventHandler
<EventHandler condition="newValue = 0">
<动作
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="false" /> </p
</目标
</动作
</EventHandler> </EventBinding> 事件绑定
</EventBinding> </EventBinding
<EventBinding id="LoadAppError">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 操作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseLoadApplication.列表和功能块将被重置。" header="Warning" icon="Exclamation" /> </Target>"功能块 ViBaseLoadApplication "中的错误。
</目标
<Result> 结果
<ResultHandler condition="result = 4">
<动作
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </EventBinding
<EventBinding id="LoadAppDone">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Done" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 操作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OK" message="已成功加载 Vision 应用程序。列表将被刷新" header="Success" icon="Information" /> </目标
</目标
<Result> <ResultHandler
<ResultHandler condition="result = 4">
<操作> <目标
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoGenerateList">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </事件绑定
</绑定
</EventBindingSet> </EventBindingSet>
|
带部件表的变体 A
|
<?xml version="1.0" encoding="utf-8"?
<EventBindingSet id="ePCUC_eventBinding"
xmlns="http://www.br-automation.com/iat2014/eventbinding/v2"
xmlns:types="http://www.br-automation.com/iat2015/widgetTypes/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<绑定> <事件绑定
<EventBinding id="ListRefreshError">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 动作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseListApplication.列表和功能块将被重置。" header="Warning" icon="Exclamation" /> </Target> <Page="ViBaseListApplication 中的错误"。
</Target> 目标
<Result> 结果
<ResultHandler condition="result = 4">
<动作
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </EventBinding
<EventBinding id="ListRefreshIncompleteInfo">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.StatusID" event="ValueChanged" />
<EventHandler condition="newValue = 1102315666">
<Action> 操作
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="true" /> </p
</目标
</动作
</EventHandler> </EventHandler
<EventHandler condition="newValue = 0">
<动作
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="false" /> </p
</目标
</动作
</EventHandler> </EventBinding> 事件绑定
</EventBinding> </EventBinding
<EventBinding id="LoadAppError">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 操作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseLoadApplication.列表和功能块将被重置。" header="Warning" icon="Exclamation" /> </Target>"功能块 ViBaseLoadApplication "中的错误。
</目标
<Result> 结果
<ResultHandler condition="result = 4">
<动作
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </EventBinding
<EventBinding id="LoadAppDone">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Done" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action> 操作
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OK" message="已成功加载 Vision 应用程序。列表将被刷新" header="Success" icon="Information" /> </目标
</目标
<Result> <ResultHandler
<ResultHandler condition="result = 4">
<操作> <目标
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoGenerateList">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" /> <Target
</目标
</动作
</ResultHandler> </p
</Result
</动作
</EventHandler>
</EventBinding> </EventBinding
<EventBinding id="SelectIndexZeroAfterListRefresh">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListRefreshCounter" event="ValueChanged" />
<EventHandler condition="">
<动作
<Target xsi:type="widgets.brease.DropDownBox.Action" contentRefId="cPCUC" widgetRefId="VAListItemCollectionDemo">
<Method xsi:type="widgets.brease.DropDownBox.Action.SetSelectedIndex" index="0" /> </p
</目标
</动作
</EventHandler> </EventBinding> 事件绑定
</EventBinding> </事件绑定
</绑定
</EventBindingSet> </EventBindingSet>
|
带有下拉框部件的变体 B
|
Event bindings are used to implement the following features of the sample HMI application:
•Pop-up messages should be displayed in the following cases:
•If an error occurs during initial filling or updating the list.
That is, if value True appears on OPC UA variable ListApplication.Error.
•Closing the pop-up message with OK should reset the HMI application.
That is, set OPC UA variable DoClearData to True.
•If an error occurs while loading the selected vision application.
That is, if value True appears on OPC UA variable LoadApplication.Error.
•Closing the pop-up message with OK should reset the HMI application.
That is, set OPC UA variable DoClearData to True.
•After the currently selected vision application has been successfully loaded onto the camera by clicking button "Load application".
That is, if value True appears on OPC UA variable LoadApplication.Done.
•Closing the pop-up message with OK should update the list.
That is, set OPC UA variable DoGenerateList to True.
•Display the warning notice if there are more loadable vision applications than can be listed.
That is, if value viBASE_INF_APP_LIST_NOT_COMPLETE (1102315666) appears on OPC UA variable ListApplication.StatusID.
•As well as hiding this warning notice if in the meantime the number of loadable vision applications has been reduced to the number that can be listed, e.g. by deleting in mapp Vision.
That is, if value 0 appears on OPC UA variable ListApplication.StatusID.
•Only for variant B with widget DropDownBox: Selecting the first entry after initial filling or updating of the list.
That is, when a value change occurs on OPC UA variable ListRefreshCounter.
First the event binding set file with filename ePCUC.eventbinding and name ePCUC_eventBinding is added to package "mapp View" of the Configuration View.

For the above features, four event bindings1) are now created in this file, each between opcUA.Event and clientSytstem.Action as well as opcUA.NodeAction, if applicable. As an example, this is described for the pop-up message that should appear after an error when loading the selected vision application:
opcUA.Event is dragged from the Toolbox into the Event Binding Set Editor window:

Directly after that, name ListRefreshError is set in the property window.

The event is now configured in the property window as follows:
1.The orange opcUA area in the graphical representation in the Event Binding Set Editor is clicked.
2.Entry ValueChanged is selected as eventId.
3.Dialog box Select OPC UA variable is opened by double-clicking on the refId row.
4.Subnode value is selected fr the appropriate OPC UA variable (e.g. ListApplication.Error).
5.The dialog box is closed again with OK.

Element clientSystem.Action is then dragged from the Toolbox into section Action of event binding ListRefreshError.

The HMI application should not react to every value change of ListApplication.Error with a pop-up message, but only to a positive edge. This condition is defined as follows:
1.Rectangle Execute in the graphical representation in the Event Binding Set Editor is clicked.
2.In the property window, newValue AND NOT oldValue is entered in the right-hand section in the Condition row.

The clientSystem.Action linked to the event is now configured as follows:
1.The blue clientSystem area in the graphical representation in the Event Binding Set Editor is clicked.
2.In the property window, ShowMessageBox is selected in the method row in the right-hand section.
3.The pop-up message to alert the user of an error is defined with these static properties as an example:
•type: OKCancel
•message: Error in FunctionBlock ViBaseListApplication. List and Function block will be reset.
•header: Warning
•icon: Exclamation

The pop-up message can be closed with OK or Cancel. The user confirms the information "List and Function block will be reset" with OK. OPC UA variable DoClearData should then be set to True as a reaction to OK.
To implement this, element opcUa.NodeAction is first dragged from the Toolbox to section Results of event binding ListRefreshError.

The condition is now defined that the added opcUa.NodeAction is executed only on OK.
1.Rectangle Execute in the graphical representation in the Event Binding Set Editor is clicked.
2.In the Property Window, result = 4 is entered in the right-hand section in the Condition row.2)

opcUa.NodeAction is then configured as follows:
1.The orange, inner opcUa area in the graphical representation in the Event Binding Set Editor is clicked.
2.Dialog box Select OPC UA variable is opened by double-clicking on the refId row.
3.Subnode value is selected fr the appropriate OPC UA variable (e.g. ListApplication.Error).
4.The dialog box is closed again with OK.

5.SetValueBool is selected in the right-hand section in the method row.
6.Static value true is set in the value row.

✓After finally saving the changes, event binding set file ePCUC.eventbinding contains the following entry for event binding ListRefreshError in the text view:
<?xml version="1.0" encoding="utf-8"?>
<EventBindingSet id="ePCUC_eventBinding" xmlns="http://www.br-automation.com/iat2014/eventbinding/v2" xmlns:types="http://www.br-automation.com/iat2015/widgetTypes/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Bindings>
<EventBinding id="ListRefreshError">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseListApplication. List and Function block will be reset." header="Warning" icon="Exclamation" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
</Bindings>
</EventBindingSet>
It is beyond the scope of this section of the mapp Vision help documentation to describe how to create all of the required event bindings. The resulting XML contents of file ePCUC.eventbinding for the two variants are recorded here.
References contentRefId, refId and widgetRefId are consistent with the previous sections. Any changes must be adjusted accordingly.
<?xml version="1.0" encoding="utf-8"?>
<EventBindingSet id="ePCUC_eventBinding"
xmlns="http://www.br-automation.com/iat2014/eventbinding/v2"
xmlns:types="http://www.br-automation.com/iat2015/widgetTypes/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Bindings>
<EventBinding id="ListRefreshError">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseListApplication. List and Function block will be reset." header="Warning" icon="Exclamation" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="ListRefreshIncompleteInfo">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.StatusID" event="ValueChanged" />
<EventHandler condition="newValue = 1102315666">
<Action>
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="true" />
</Target>
</Action>
</EventHandler>
<EventHandler condition="newValue = 0">
<Action>
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="false" />
</Target>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="LoadAppError">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseLoadApplication. List and Function block will be reset." header="Warning" icon="Exclamation" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="LoadAppDone">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Done" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OK" message="The Vision Application was loaded sucessfully. List will be refreshed" header="Success" icon="Information" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoGenerateList">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
</Bindings>
</EventBindingSet>
|
Variant A with widget Table
|
<?xml version="1.0" encoding="utf-8"?>
<EventBindingSet id="ePCUC_eventBinding"
xmlns="http://www.br-automation.com/iat2014/eventbinding/v2"
xmlns:types="http://www.br-automation.com/iat2015/widgetTypes/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Bindings>
<EventBinding id="ListRefreshError">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseListApplication. List and Function block will be reset." header="Warning" icon="Exclamation" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="ListRefreshIncompleteInfo">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListApplication.StatusID" event="ValueChanged" />
<EventHandler condition="newValue = 1102315666">
<Action>
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="true" />
</Target>
</Action>
</EventHandler>
<EventHandler condition="newValue = 0">
<Action>
<Target xsi:type="widgets.brease.Label.Action" contentRefId="cPCUC" widgetRefId="ListIncomplete">
<Method xsi:type="widgets.brease.Label.Action.SetVisible" value="false" />
</Target>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="LoadAppError">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Error" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OKCancel" message="Error in FunctionBlock ViBaseLoadApplication. List and Function block will be reset." header="Warning" icon="Exclamation" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoClearData">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="LoadAppDone">
<Source xsi:type="opcUa.Event" refId="::PCUC:LoadApplication.Done" event="ValueChanged" />
<EventHandler condition="newValue AND NOT oldValue">
<Action>
<Target xsi:type="clientSystem.Action">
<Method xsi:type="clientSystem.Action.ShowMessageBox" type="OK" message="The Vision Application was loaded sucessfully. List will be refreshed" header="Success" icon="Information" />
</Target>
<Result>
<ResultHandler condition="result = 4">
<Action>
<Target xsi:type="opcUa.NodeAction" refId="::PCUC:DoGenerateList">
<Method xsi:type="opcUa.NodeAction.SetValueBool" value="true" />
</Target>
</Action>
</ResultHandler>
</Result>
</Action>
</EventHandler>
</EventBinding>
<EventBinding id="SelectIndexZeroAfterListRefresh">
<Source xsi:type="opcUa.Event" refId="::PCUC:ListRefreshCounter" event="ValueChanged" />
<EventHandler condition="">
<Action>
<Target xsi:type="widgets.brease.DropDownBox.Action" contentRefId="cPCUC" widgetRefId="VAListItemCollectionDemo">
<Method xsi:type="widgets.brease.DropDownBox.Action.SetSelectedIndex" index="0" />
</Target>
</Action>
</EventHandler>
</EventBinding>
</Bindings>
</EventBindingSet>
|
Variant B with widget DropDownBox
|