【教程】Matrikon OPC使用教程连载(六)

 

上一篇文章已经完成MatrikonOPC Data Manager的配置,本篇文章将与大家分享如何测试OPC连接。

测试OPC连接

修改MatrikonOPC Data Manager中的值

此测试的目的是为了了解在MatrikonOPC Data Manager中为创建的共享数据点发出OPC写入时OPC体系结构的行为。在双向共享点上在OPC Data Manager中发出OPC写入的预期行为是,该值将写入OPC Server for DDEOPC Server for Simulation and Testing

在MatrikonOPC Data Manager中测试OPC写入:

1.在“Configuration(配置)”屏幕右下方的窗格中,鼠标右键单击共享点(已在本教程的“添加OPC数据点”部分中添加)。

2.从显示的菜单中选择“Write(写入)”。

3.出现“Write Value(写入值)”窗口(图1)。

                                             MatrikonOPC 图1-Write Value窗口

                                                                               图1-Write Value窗口

4.在“Value(值)”字段中,输入1550

5.单击“Apply(应用)”按钮以提交更改并关闭“Write Value”窗口。

6.查看Book1.xls文件以确认FIC101值已更改(图2)。

                                      MatrikonOPC 图2-在Microsoft Excel中验证值更改

                                                            图2-在Microsoft Excel中验证值更改

7.要确保将值写入OPC Server for Simulation,需使用OPC Explorer建立与OPC服务器的另一个连接。

8.浏览并添加OPC Data Manager引用的Bucket Brigade项(即Int1Int2Int4)。

9.确认FIC101数据点的值已从1600更改为1550(图3)。

                         MatrikonOPC 图3-在MatrikonOPC Server for Simulation and Testing中验证值更改

                                          图3-在MatrikonOPC Server for Simulation and Testing中验证值更改


修改Microsoft Excel中的值

此测试的目的是在Microsoft Excel中更改值时验证OPC体系结构的行为。在Excel中更改值的预期行为是,将使用Excel中的当前值更新OPC Server for DDE。OPC服务器中的此值更改将导致发生OPC读取,将新值发送到OPC Data ManagerOPC Data Manager中将发生OPC写入,将新值发送到OPC Server for Simulation中的关联数据点。

测试Microsoft Excel中的值更改:

1.在Microsoft Excel Book1.xls文件中,将FIC101的值更改为2000(图4)

                                                                                  MatrikonOPC 图4-更改Excel值

                                                                                        图4-更改Excel值

2.查看OPC Data Manager Configuration窗口并确认FIC101共享数据点值已更改为2000(图5)。

                       MatrikonOPC 图5-MatrikonOPC Data Manager中值改变

                                                                       图5-MatrikonOPC Data Manager中值改变

3.要确保将值写入OPC Server for Simulation,需使用OPC Explorer建立与OPC服务器的另一个连接。浏览并添加OPC Data Manager引用的Bucket Brigade项目(例如,Int1Int2Int4)。

4.确认FIC101数据点的值已更改为2000(图6)。

                         MatrikonOPC 图6-在MatrikonOPC Server for Simulation and Testing验证值更改

                                           图6-在MatrikonOPC Server for Simulation and Testing验证值更改


修改MatrikonOPC Server for Simulation and Testing中的值

此测试的目的是在OPC Server for Simulation and Testing中更改值时验证OPC体系结构的行为。在OPC Server for Simulation中更改值的预期行为是将OPC读取发送到OPC Data Manager。随后的OPC写操作将在OPC Data Manager中发生,将新值发送到OPC Server for DDE中的关联数据点,最终发送到Microsoft Excel

测试MatrikonOPC Server for Simulation and Testing中值变化:

1.在OPC Explorer中,在顶部标签(Bucket Brigade.Int1)上单击鼠标右键,然后从显示的菜单中选择“Write Values”。

2.出现Write Values窗口(图7)。

                                                   MatrikonOPC 图7-写入值窗口

                                                                                 图7-Write Values窗口

3.在“New Value”字段中选择当前标记值。

4.将标记值更改为2513,然后单击“OK”按钮。(图8)

注意:此操作从OPC ExplorerOPC Server for Simulation发出写入。 通过在写入后查看OPC Explorer并验证该项目的值更改为2513,这确认了OPC服务器中的值已成功更改。

                          MatrikonOPC 图8-在MatrikonOPC Server for Simulation and Testing中更改值

                                               图8-在MatrikonOPC Server for Simulation and Testing中更改值

5.查看OPC Data Manager Configuration屏幕并检查FIC101 / Bucket Brigade.Int1共享数据点值。 共享点的值显示为2513

6.在Microsoft Excel中,验证FIC101的值更改为2513(图9)。

                                                                                   MatrikonOPC 图9-在Excel验证值更改

                                                                                   图9-在Excel验证值更改

OPC连接测试就到此结束,以上操作顺利完成说明OPC之间的连接已经配置完成并且测试通过,接下来就可以在两个OPC服务器之间交换数据了。

下一篇文章将与大家分享使用Matrikon OPC服务器时常见的问题和解决方法,敬请期待噢~

猜你喜欢

转载自blog.csdn.net/weixin_43746001/article/details/85156831