前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >基于Step 7 PLCSIM和TIA Portal WinCC的PLC 与触摸屏的仿真联调

基于Step 7 PLCSIM和TIA Portal WinCC的PLC 与触摸屏的仿真联调

作者头像
剑指工控
发布2021-11-09 10:39:34
1.8K0
发布2021-11-09 10:39:34
举报
文章被收录于专栏:剑指工控剑指工控

JZGKCHINA

工控技术分享平台

中英文双语技术文章

Simulation joint debugging and testing between PLC and Touch Screen based on Step 7 PLCSIM and TIA Portal WinCC

基于Step 7 PLCSIM和TIA Portal WinCC的PLC 与触摸屏的仿真联调

Introduction: 引言

Simulation is a very useful auxiliary function for learning and debugging of the PLC & Touch Screen program.

“仿真”是PLC和触摸屏程序组态学习及调试过程中的一个非常实用的辅助功能。

Without physical hardware directly display the PLC program running status and HMI Dynamic Effects, make the learning and debugging & testing more convenient.

无需物理硬件直接显示PLC程序运行状态和HMI动态效果,使学习和调试测试更加方便。

Almost PLC & Touch Screen programming software support the independent simulation function.

目前大多数PLC & 触摸屏组态编程软件都支持独立的仿真功能。

But in a real project, both PLC and Touch Screen are used and communicate with each other. During the debugging and testing process, we want to verify the logic through visual interface (HMI) and the check the tag address correctness by linking with PLC.

但是在实际的工程项目中,PLC和 触摸屏是同时使用并相互通信的。在调试和测试过程中,我们要通过可视化界面(HMI)来验证逻辑,并通过与PLC的连接来检查标签地址的正确性。

Therefore simulation joint debugging and testing function become a good solution.

因此,仿真联调功能成为了一个很好的解决方案。

PLC programming and simulation: PLC编程及仿真

1. Open the “SIMATIC Manager” software and Create a new project;

打开编程软件并新建项目;

2. Right Click project icon→ “Insert New Object” → “SIMATIC 300 Station” for example;

右键项目图标→“插入新对象”→SIMATIC 300站点为例;

3. Click “SIMATIC 300(1)”→ Double Click “Hardware” to open “HW Config page”;

单击“SIMATIC 300(1)”→在右侧双击“硬件”打开硬件组态界面;

4. Insert “RACK”, ”Power Supply Module” and “CPU” in sequence;

依次插入“机架”,电源和CPU;

Tips:

For Siemens PLC and HMI Touch Screen, there are 3 types of Communication link, which are MPI, Profibus DP and Profinet (PN).

对于西门子PLC和HMI触摸屏来说,有3种通讯连接方式,MPI,Profibus DP 以及Profinet(PN)。

All of these three types communication link are able to simulated the joint debugging between PLC and Touch Screen

这三种通讯,均可以实现PLC和触摸屏的仿真联调。

Therefore, when you using one of that type, during hardware configuration step should select the corresponding module who support these type of communication.

因此,选用其中一种通讯方式,要注意在PLC和HMI触摸屏硬件组态环节选用支持该通讯方式的硬件模块。

In this case, we use the MPI type.

本例选用简单的MPI方式。

5. Click “Save and Compile” and Close window;

单击“保存并编译”然后关闭窗口;

6. Unfold the tree structure of project, click “Blocks”, and double click “OB1”, to start the logic programming.

展开项目的树状结构,点击“Blocks”,双击 “OB1”,开始逻辑编程。

7. Programming, save and close window;

程序编写,保存并关闭;

8. Click “Options” → “Set PG/PC Interface…” ; Select “PLCSIM.MPI.1” → “OK”;

单击“选项”→“设置PG/PC接口”;选择“PLCSIM.MPI.1”→“OK”;

9. Click “Simulation On/Off” to open the S7-PLCSIM software;

单击“仿真 开、关”打开“S7-PLCSIM”软件;

Select Communication type as “PLCSIM (MPI)”, and Click “Insert Input Variable” , “Insert Output Variable” , “Insert Bit Memory” , to simulate and monitor input/output status;

选择通讯方式为“PLCSIM(MPI)”, 单击“Insert Input Variable” , “Insert Output Variable” , “Insert Bit Memory”来仿真和监视输入输出状态;

Double Click “OB1” to open the logic program, click “Monitor on/off” to getting online monitoring status; Simulate input (I0.0) will see the output (Q0.0) turned on; Simulate the value for MW0 will see the value transfer to MW2;

双击“OB1” 打开程序页面,单击“监视开关” 进入在线监视状态; 仿真输入(I0.0)会看到输出(Q0.0)置1;仿真 数值到MW0 会看到数值传递到MW2;

HMI Touch Screen configuration and joint simulation:

HMI触摸屏组态及联合仿真

1. Open the “TIA Portal” software and Create a new project;

打开“TIA Portal”软件并创建新项目;

Click “Open the project view” to get into the Configuration window;

单击“打开项目视图”进入组态界面;

2. Click “Add new device”;Select hardware, uncheck the “Start device wizard” and “OK”

单击“添加新设备”;选择硬件,取消勾选 “启动设备向导” 然后 “确定”;

3. Unfold the device tree structure, double click “Connections”; Create a new controller, set the communication type as MPI, then save the setting;

展开设备树形结构,双击“连接”;添加一个新的控制器, 选择通讯方式为MPI并保存;

4. Unfold the “HMI tags” tree structure, double click “Default tag table”, create the tags and set the “Date type”, “Connection” and Address;

展开“HMI变量”树形结构,双击“默认变量表”,新建变量并设置“数据类型”,“连接”以及“地址”;

5. Unfold the “Screens” tree structure, double click “Screen_1” to open the page; add one “Circle” object as output indicator and set the animations.

展开“画面”树形结构,双击“Screen_1” 打开画面;添加一个“圆”对象作为输出指示并组态动画。

6. “Button” and “IO field” (Value input/output) as similar way;

按钮及IO域(数值输入输出)类似

7. Click “Save project” → “Compile” → “Start simulation”;

单击“保存项目”→“编译”→“开始仿真”

Conclusion: 结语

By using these way, we could easy to simulate both PLC logic program and HMI Touch Screen configuration at same time. And all the status and value changing will be monitored on background and HMI.

通过这种方式,我们可以很轻易地同时仿真PLC逻辑程序和HMI触摸屏的配置。所有状态和值的变化都将在后台和HMI上同时进行监控。

Data Linkage make more convenient to contrast the PLC logic program and HMI configuration, so that make the debugging and learning efficient.

数据联动使得上下位程序组态的对照变得更加方便,从而使调试和学习变得更加高效。

作者简介

淡定齿轮:

常驻伊拉克油田现场的工控人

油气上游领域自动化过程控制从业多年

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-03-19,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 剑指工控 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档