资源预览内容
第1页 / 共29页
第2页 / 共29页
第3页 / 共29页
第4页 / 共29页
第5页 / 共29页
第6页 / 共29页
第7页 / 共29页
第8页 / 共29页
第9页 / 共29页
第10页 / 共29页
亲,该文档总共29页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Date File FCFBs 1 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 功能和功能块 Date File FCFBs 2 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 目标 学习了本章之后 你将 熟悉临时变量的用途 能够声明临时变量并在程序中使用 熟悉可赋值参数的块的用途 能够编程可赋值参数的功能和它们的调用 了解功能 FC 和功能块 FB 之间的差别 熟悉背景模型和多重背景模型 熟悉静态变量的用途 能够声明静态变量并在程序中使用 能够编程可赋值参数的功能块和它们的调用 Date File FCFBs 3 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 局部变量 临时变量 当相关块执行完毕后被清除 临时存储在 L stack中 可在下列块中使用 OB FC FB 静态变量 当相关块执行完毕后仍然 保留 永久存储在DB中 只能在FB中使用 局部变量 数据 只在一个块中有效 全局变量 数据 在全部程序中有效 PII PIQ I O M T C DB 区 符号地址绝对地址 访问方式 Date File FCFBs 4 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 临时变量 Date File FCFBs 5 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 256 Bytes 事件 所占用的 L stack 1 OB1 OB 1 1 操作系统 程序所占用的局部数据区的总长度 FC 20 有临时 变量 OB1 FC20 FC17 3 3 OB1 FC17 4 4 OB1 FC17 6 6 FC 20 有临时 变量 OB1 FC20 FC17 5 5 FC 17 有临时 变量 2 OB1 FC17 2 7 OB1 7 Date File FCFBs 6 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 执行的程序 局部数据堆栈的大小 对于 S7 300 局部堆栈大小 优先级 256 bytes 1 27 总容量 1 5 Kbyte CPU 313 316 启动程序 只执行一次 循环扫描程序 256 bytes 256 bytes 256 bytes12 3 2 时间中断 日时钟中断 延时处理中断 循环处理中断 循环扫描中的错误处理中断 256 bytes16 28 26 256 bytes 事件驱动中断 硬件中断 启动过程中的错误处理中断 Date File FCFBs 7 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 块所需要的局部数据区的长度 Right Click Date File FCFBs 8 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 练习 使用临时变量 Setpoint Setpoint 替换为临时变量 Setpoint Date File FCFBs 9 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 示例 用输出 LED故障信息指示 Fault Signal Display Acknowledge Stored Fault 要求 解决方案 AcknowledgeStored Fault Fault Signal Stored FaultFault Signal Display Edge Memory Flash Frequency P RS S RQ Date File FCFBs 10 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives Fault Signal Edge Memory Acknowledge Stored Fault Display Flash freq FC 20 调用FC 20 e g in OB 1 可以分配参数的块 A AI1 0 RM40 0 AI1 1 FP M40 1 SM 40 0 AM40 0 AM10 3 O A I1 1 AN M40 0 Q5 1 不可以 分配参数的块 形式参数 M 40 0 M 40 1 I 1 3 I 1 0 Q 5 1 M 10 3 实际参数 A A Acknowledge R Stored Fault A Fault Signal FP Edge Memory S Stored Fault A Stored Fault A Flash Freq O A Fault Signal AN Stored Fault Display 可以分配参数的块 FC 20 的 STL程序 Date File FCFBs 11 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 定义FC 20形式参数 使用方法图形显示 只能读在块的左侧 只能写在块的右侧 参数类型 输入参数 输出参数 输入 输出 参数 定义 in out In out可读 可写在块的左侧 形式参数 Date File FCFBs 12 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 编辑可以分配参数的块 Date File FCFBs 13 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 调用可以分配参数的块 Date File FCFBs 14 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 练习 编辑可以分配参数的FC块 Date File FCFBs 15 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 练习 调用可以分配参数的FC块 第一次调用FC20时 的参数分配 第二次调用FC20时 的参数分配 Date File FCFBs 16 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 功能块 FB DB 2 OB 1 FB块的变量声明表 FB 20 EN Fault Signal AcknowledgeDisplay Flash FrequencyENO Date File FCFBs 17 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 用功能块实现的故障信息显示 FB的声明表 背景数据块 Date File FCFBs 18 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 生成背景数据块 1 在FB调用时生成背景数据块2 创建一个新的背景数据块 在 LAD STL FBD Editor在 SIMATIC Manager Date File FCFBs 19 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 之后插入 删除块的参数 Save Date File FCFBs 20 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 检查块的一致性 Date File FCFBs 21 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 调用被修改过的块时应做的更正 单击鼠标右键 Date File FCFBs 22 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 练习 编辑功能块 Date File FCFBs 23 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 练习 调用功能块并测试 添加 Network 2 3 删除 Network 2 Date File FCFBs 24 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Training for Automation and Drives 多重背景模型 DB10 普通背景模型 FB20 OB 1 Call FB20 DB10 Disturb Input Acknowledge Flash Freq Display DB11 FB20 Call FB20 DB11 Disturb Input Acknowledge Flash Freq Display DB12 FB20 Call FB20 DB12 Disturb Input Acknowledge Flash Freq Display 多重背景模型 FB 100 DB100 Call FB100 DB100 OB 1 statDist 1FB20 statDist 2FB20 第二次调用 FB20 的参数和静态参数 Call Dist 2 Disturb Input Acknowledge Flash Freq Display 第一次调用 FB20 的参数和静态参数 Call Dist 1 Disturb Input Acknowledge Flash Freq Display Date File FCFBs 25 SIMATIC S7 Siemens AG 2003 All rights reserved SITRAIN Tra
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号