Date,2009-7-30
File,SSP2_02C.1
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
源文件编程 和 用户程序的重新接线
,什么是口令?,
Date,2009-7-30
File,SSP2_02C.2
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
编程工具
PRGG_T2D
Date,2009-7-30
File,SSP2_02C.3
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
利用文本编辑器生成程序
Date,2009-7-30
File,SSP2_02C.4
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
启动文本编辑器
Date,2009-7-30
File,SSP2_02C.5
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
编辑一个源文件 (1)
被编辑的源文件块样板块文件文件插入块样板插入块插入文件插入文件产生
Date,2009-7-30
File,SSP2_02C.6
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
编辑一个源文件 (2)
UDT
全局 DB
UDT型 DB
FB3
FB3的背景 DB
FC5
OB1
分配给调用调用调用调用分配给
Date,2009-7-30
File,SSP2_02C.7
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
代码块的语法
Date,2009-7-30
File,SSP2_02C.8
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
数据块的语法
Date,2009-7-30
File,SSP2_02C.9
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
变量声明
Date,2009-7-30
File,SSP2_02C.10
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
保护属性属性 代码块
(O B,F B,F C)
数据块 UDT
K NO W _H O W _P RO TE CT (关键技术保护) 有 有 无
A UT HO R (作者) 有 有 无
FA M IL Y (类别) 有 有 无
NA M E (名称) 有 有 无
V E RS IO N (版本) 有 有 无
UN LI NK E D (未连接) 无 有 无
RE A D_ O NL Y (只读) 无 有 无
Date,2009-7-30
File,SSP2_02C.11
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
保存,一致性检查和编译
Date,2009-7-30
File,SSP2_02C.12
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
练习 2.1,利用源文件将 FC转换为 FB (1)
Date,2009-7-30
File,SSP2_02C.13
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
练习 2.1,利用源文件将 FC转换为 FB (2)
:
:
:
:
Date,2009-7-30
File,SSP2_02C.14
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
程序重新接线简介信号模板前连接器失效的通道
I 16.7
可用的通道
I 17.0
A I 16.7
.
.
.
.
AN I16.7
“旧” 程序
A I 17.0
.
.
.
.
AN I17.0
“新,程序
Date,2009-7-30
File,SSP2_02C.15
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
用 SIMATIC管理器实现重新接线
Date,2009-7-30
File,SSP2_02C.16
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
概述:用源程序实现重新接线带符号地址的
STEP 7 程序
“Blocks”
文件夹
“Source Files”
文件夹带符号地址的源程序
1
符号表
( 旧)
符号表
( 新)2
“Blocks”
文件夹重新接线的带符号地址的
STEP 7 程序
3
Date,2009-7-30
File,SSP2_02C.17
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
从已有的 S7程序产生源程序
Date,2009-7-30
File,SSP2_02C.18
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
生成的源程序
Date,2009-7-30
File,SSP2_02C.19
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
符号表:改变绝对地址之前之后
Date,2009-7-30
File,SSP2_02C.20
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
重新接线的结果
FC 5,旧”
FC 5,新”
Date,2009-7-30
File,SSP2_02C.21
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
用“符号优先”重新接线
Date,2009-7-30
File,SSP2_02C.22
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
练习 2.2:用 SIMATIC管理器实现重新接线步骤 操作 结果
1
在 SIMATIC管理器中,从项目,STOE_32”
下将 S7程序 REWIRE拷贝到,My Project”项目下一个名为,REWIRE”的 S7程序被存在项目,My Project”中。
在 S7程序,REWIRE”中,单击,Blocks”对象 对象被选中。2
选择菜单命令
Options -> Rewire,弹出“重新接线”窗口。3
在旧地址中输入 I 8.0,在新地址中输入 I 9.0,
用,OK”钮确认 S7 程序,REWIRE”被修改成新地址。4
从 S7 程序,REWIRE”打开符号表,把符号
LB1的地址从 I 8.0 换成 I 9.0。
保存符号表并退出符号编辑器。
符号 LB1被分配一个新地址。5
利用交叉参考表检查重新接线是否成功。 I 9.0替换程序中原来的 I 8.0。6
Date,2009-7-30
File,SSP2_02C.23
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
修改扫描
2x
Date,2009-7-30
File,SSP2_02C.24
SIMATIC S7
Siemens AG 2000,All rights reserved.
Information and Training Center
Know ledge for Automation
练习 2.3:修改扫描为安全起见,采用常闭触点 (NC) 停止设备。当出现断线或接地故障时,
这个开关停止设备运行。
程序中的对信号,1”的扫描必须用对信号,0”的扫描代替。