收藏 分享(赏)

【北京西门子培训教程】数据块中的数据存储.ppt

上传人:鼎天工程图书馆 文档编号:20235651 上传时间:2023-12-08 格式:PPT 页数:19 大小:353.50KB
下载 相关 举报
【北京西门子培训教程】数据块中的数据存储.ppt_第1页
第1页 / 共19页
【北京西门子培训教程】数据块中的数据存储.ppt_第2页
第2页 / 共19页
【北京西门子培训教程】数据块中的数据存储.ppt_第3页
第3页 / 共19页
【北京西门子培训教程】数据块中的数据存储.ppt_第4页
第4页 / 共19页
亲,该文档总共19页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

1、Date:2023/12/8File:SSP1_12C.1SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation数据块中的数据存储数据块中的数据存储Date:2023/12/8File:SSP1_12C.2SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation位存储器位存储器PIQPII数据存储区数据存

2、储区数据块数据块DBxDByDBz.I/O 区区L 堆栈堆栈Date:2023/12/8File:SSP1_12C.3SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation数据块数据块(DB)功能功能FC10功能功能FC20功能块功能块FB1OB1全局数据全局数据 DB20 所有块可以访问所有块可以访问背景数据背景数据 DB5 FB1的背景的背景DBDate:2023/12/8File:SSP1_12C.4SIMATIC S7Siemens AG

3、2000.All rights reserved.Information and Training CenterKnowledge for AutomationSTEP 7数据类型概述数据类型概述基本数据类型(到32 位)复杂数据类型(长于32位)用户定义数据类型(长于 32 位)位数据类型位数据类型(BOOL,BYTE,WORD,DWORD,CHAR)数学数据类型数学数据类型(INT,DINT,REAL)定时器类型定时器类型(S5TIME,TIME,DATE,TIME_OF_DAY)时间时间(DATE_AND_TIME)矩阵矩阵(ARRAY)结构结构(STRUCT)字符串字符串(STRING

4、)数据类型数据类型 UDT(用户定义数据类型)Date:2023/12/8File:SSP1_12C.5SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for AutomationSTEP 7基本数据类型基本数据类型BOOL1True 或 False(1 或0)BYTE8B#16#A9WORD16W#16#12AFDWORD32DW#16#ADAC1EF5CHAR8 w S5TIME16S5T#5s_200msINT16123DINT32L#65539REAL321.2

5、 或 34.5E-12TIME32T#2D_1H_3M_45S_12MSDATE16D#1993-01-20TIME_OF_DAY32TOD#12:23:45.12关键字关键字长度长度(位位)该类型的常数举例该类型的常数举例Date:2023/12/8File:SSP1_12C.6SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation复杂数据类型复杂数据类型关键字关键字长度长度(位位)举例举例DATE_AND_TIME64DT#97-09-24-1

6、2:14:55.0STRING8*(字符个数+2)This is a string(最多254个字符的字符串)SIEMENS ARRAY用户定义 测量值:ARRAY1.20(相同数据类型的元素组)INT STRUCT 用户定义 Motor:STRUCT(不同数据类型的元素组)Speed :INTCurrent:REALEND_STRUCTUDTUDT as block UDT as array element(用户定义数据类型=用户定义 基本或复杂数据类型组成的 STRUCT Drive:ARRAY1.4模板)Speed:INT UDT1 Current:REAL END_STRUCT Dat

7、e:2023/12/8File:SSP1_12C.7SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation结构举例结构举例程序编辑器中的显示程序编辑器中的显示(数据块数据块 DB 1):Operating Speed,data type IntegerRated Current,data type RealStartup Current,data type RealTurning Direction,data type Bool带有名字“Motor

8、_data”的结构(不同数据类型的几个元素)Motor_dataDate:2023/12/8File:SSP1_12C.8SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation矩阵举例矩阵举例1.Measuring_point,data type Real2.Measuring_point,data type Real3.Measuring_point,data type Real10.Measuring_point,data type Real带

9、有名字“Measuring_point”的矩阵(相同数据类型的几个元素)程序编辑器中的显示程序编辑器中的显示(数据块数据块 DB 2):Measuring_pointDate:2023/12/8File:SSP1_12C.9SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation建立新数据块建立新数据块Date:2023/12/8File:SSP1_12C.10SIMATIC S7Siemens AG 2000.All rights reserved

10、.Information and Training CenterKnowledge for Automation输入、保存、下载和监视数据块输入、保存、下载和监视数据块Date:2023/12/8File:SSP1_12C.11SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation寻址数据单元寻址数据单元078 位数据字节 0 DBB 0数据字节 1 DBW 0数据字节 8191DBD 8188DBW 8190DBB 8191数据字节 2 DBD

11、0数据字节 3 DBX 4.1Date:2023/12/8File:SSP1_12C.12SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation访问数据单元访问数据单元0123456789DB 19(符号名:Values)带有元素名字“Start”的 数据位 0.0或 A DB19.DBX0.0或A“Values”.Start或L DB19.DBW2或 L“Values”.Number或L DB19.DBB5或L“Values”.Loop传统访问方

12、法符号寻址完全表示访问1)OPN DB19L DBW2NumberOPN DB19A DBX 0.01)OPN DB19L DBB5Loop绝对寻址Date:2023/12/8File:SSP1_12C.13SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation打开数据块的合法性打开数据块的合法性OB 1OPNDB 4LDBW2DB 4TDBW 2DB 4FC 1DB 4CALL FC 1TDBW 4DB 5OPNDB 5LDBB6DB 5LDBW

13、 0TDBW 8CALL FC 2FC 2DB 5DB 6OPNDB 6LDBB6DB 2T DB2.DBB 0DB 2LDBW 4LDBW 10DB?FB 1CALL FB1,DB1?!Date:2023/12/8File:SSP1_12C.14SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation全局全局 DB(例如例如)UDT 块作为模板块作为模板用户定义数据类型用户定义数据类型(UDT)FlourMilkEggsYeastSugar配方2F

14、lourMilkEggsYeastSugar配方3FlourMilkEggsYeastSugarFlourMilkEggsYeastSugar根据根据UDT建立的建立的 DB配方1FlourMilkEggsYeastSugar带有三个UDT类型的元素Date:2023/12/8File:SSP1_12C.15SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation输入输入UDT块块Date:2023/12/8File:SSP1_12C.16SIMAT

15、IC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation根据数据类型建立数据块根据数据类型建立数据块Date:2023/12/8File:SSP1_12C.17SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation举例:举例:UDT中矩阵中矩阵声明查看声明查看数据查看数据查看Date:2023/12/8File:S

16、SP1_12C.18SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation练习12.1:数据块和数据格式 IB1 DB10.DBW1 DB11.DBW8 BIN BCD QW6 DB11.DBW9 BIN BCD QW6 IB2MW1 BCD BINMW3 IB3MW5 BCD BINMW7 I0.7=“0”:BEC :BEDate:2023/12/8File:SSP1_12C.19SIMATIC S7Siemens AG 2000.All rights reserved.Information and Training CenterKnowledge for Automation练习练习12.212.2:瓶装线编程:瓶装线编程-数据存储数据存储 满瓶满瓶(MW102)空瓶空瓶(MW 100)碎瓶碎瓶(MW 104)数据块数据块 DB5变量变量:full变量变量:empty变量变量:broken

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 技术资料 > 材料科学

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报