版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、数字指令0.0CMP =IIN1 IN2MIW0 IW2Q 5.7T4S_ODTSQI 0.7TVS5T#35sRI 0.5Q4.5BCDBIMW0 QW6SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.1SITRAIN Training for Automation and Drives数字指令0.0CMP =IIN1 IN2MIW0 IW2Q 5.7T4S_ODTSQI 0.7TVS5T#35sRI 0.5Q4.5BCDBIMW0 QW6SIMATIC S7Siemens AG 2003
2、. All rights reserved.Date:2018/10/3File:DigitalOp.2SITRAIN Training for Automation and Drives目标学习了本章之后,你将 .熟悉INT、 DINT、 REAL数据类型和BCD显示.能够在“Monitor / Modify Variable”测试功能中选择显示格式.懂得“装载” 和“传送”指令.能够为解决问题使用和编程S5计数器功能.能够为解决问题使用和编程S5定时器功能.能够为解决问题使用和编程转换指令INT BCD.能够为解决问题使用和编程比较指令.能够为解决问题使用和编程基本算术功能SIMATIC
3、S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.3SITRAIN Training for Automation and DrivesV0248要求, 处理和输出数据过程操作和监视控制单元操作面板例如 MPI拨轮按钮, 电位器, 7段显示0815处理数值AI/ AO例如 PROFIBUSDI/ DO过 程 控制器现场装置SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.4SITRAIN Training f
4、or Automation and Drives数值范围 -32768 至 +32767整数 (INT, 16位整数) 数据类型算术运算: 例如 + I, * I, I, =I(不带符号:0 to 65535)显示格式:15 14 13 12 11 10 9 8 76 5 4 3 2 1 0+29符号正数27+24+22+21BIN.: 2#0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0DEC: + 662HEX: W#16# 0 2 9 6不带符号6x 160 =6+ 6629 x 161= 1442 x 162= 51266215 14 13 12 11 10 9 8 76
5、 5 4 3 2 1 0DEC:- 662BIN.:2#1 1 1 1 1 1 0 1 01 1 0 1 0 1 0HEX: W#16#F D 6 A符号负数-215+214+213+212不带符号10 x 160 =16+211+210以补码表示+28+26+25+23 +21- 6626 x 161 =9613 x 162 =332815 x 163 =6144064874SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.5SITRAIN Training for Automation a
6、nd Drives双整数(DINT, 32位整数)数据类型数值范围 L# -2147483648 至 L#+2147483647(不带符号:0 to 4294967295)算术运算: 例如 + D, * D, D, =D显示格式:符号正数84980000HEX: DW#16#1 0 0 11 0 0 00 0 0 00 1 0 01 0 0 00 0 0 00 0 0 0BIN.: 2#0 0 0 0DEC: L# +54080931 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
7、 0(不带符号)31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0符号负数7BF77FFFHEX: DW#16#BIN.: 2#1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 1 1 1以补码表示DEC: L# -540809(不带符号)SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.6SITRAIN Tr
8、aining for Automation and Drives实数 (浮点数, 32位)数据类型数值范围 -1.17549510-38 至 3.40282310+38算术运算: 例如 + R, * R, R, =Rsin, acos, ln, exp, SQR实数的标准格式 = (Sign) (1.f) (2e-127)举例: 7.50000e-001(7.5 * 10-1 = 0.75)实数的符号e = 指数 (8 Bit)f = 尾数 (23 Bit)31 30 29 2827 2625 24 2322 21 20 19 18 17 16 15 14 13 1211 1098765432
9、100011111101000000000000000000000027 26 25 24 2322 21 20 2-1 2-2 2-3 2-4 .2-23实数= +1.5 * 2 126-127 = 0.75SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.7SITRAIN Training for Automation and Drives用于输入和输出整数的 BCD 码数值范围 16 Bit:- 999 至 + 99932 Bit:-9999999 至 + 9999999转换操作:BTI
10、, BTD, ITB, DTB(不是算术运算!) 0296BIN.: 2#0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 016 Bit:DEC: + 662HEX:W#16#0296符号(+)296符号 (+)0000296BIN.: 2#0 x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0HEX:DW#16#000029632 Bit:SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.8DEC: + 66
11、2SITRAIN Training for Automation and Drives“Monitor / Modify Variables”: 显示格式SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.9SITRAIN Training for Automation and Drives数据装载和传送 (1)LADFBDSTLMB5OUTIN5ENOENMOVEENOIN5MB5OUTENMOVE+5MB5LT装载举例L+5/16-位常数 (整数)LL#523123/32-位常数 (双整数)
12、LB#16#EF/十六进制字节L2#0010 0110 1110 0011/16-位二进制值L3.14/32-位常数 (实数)SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.10SITRAIN Training for Automation and Drives数据装载和传送(2):L W#16#CAFEL W#16#AFFE:XXXXXXXXYYYYYYYYACCU2内容ACCU1内容程序0000CAFEXXXXXXXX0000AFFE0000CAFESIMATIC S7Siemens A
13、G 2003. All rights reserved.Date:2018/10/3File:DigitalOp.11SITRAIN Training for Automation and Drives数据装载和传送(3)程序装载LMB 0LMW 0LMD 0ACCU1内容31231570 000000000000000000000000MB031231570 0000000000000000MB0MB1MB0MB1MB2MB331231570传送TQD 4 QD 4TQW 4 QW 4TQB 4 QB 4SIMATIC S7Siemens AG 2003. All rights reserv
14、ed.Date:2018/10/3File:DigitalOp.12SITRAIN Training for Automation and DrivesSTEP 7中的S5计数器LADFBDSTLQW 6CV_BCDRI 0.7MW 4CVPVC#20SI 0.3CDI 0.5CUQQ 4.3S_CUDI 0.4C5QW 6Q 4.3=QRI 0.7CV_BCDPVC#20MW 4CVSI 0.3CDI 0.5CUI 0.4C5S_CUDCUC5AI0.5CDC5AI0.3LC#20SC5AI0.7RC5LC5TMW4LCC5TQW6AC5=Q4.3QQSIMATIC S7Siemens AG
15、 2003. All rights reserved.Date:2018/10/3File:DigitalOp.13AI0.4SITRAIN Training for Automation and Drives计数器:功能图CUCDSR54Count3210QSIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.14SITRAIN Training for Automation and Drives计数器:位指令LADFBDSTLNetwork 1:C5I 0.0C5 SCC#20I 0.0C#2
16、0Network 2:I 0.1C5C5I 0.1Network 3:I 0.2C5C5I 0.2Network 4:C5Q 4.0Q 4.0C5=CDCUCVSCCDCUA L SI 0.0 C#20 C5AI 0.1CUC5AI 0.2CDC5AC5=Q 4.0SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.15SITRAIN Training for Automation and Drives练习: 计数传送的零件 (FC 18, C 18)DIT_System_ON T_System
17、_OFFL_SYSTEM T_Jog_RTL_MANT_Jog_LTL_AUTOS_M/A_ModeSelect T_M/A_AcceptI 0.0I 0.1I 0.2I 0.3I 0.4I 0.5I 0.6I 0.7DO Q 4.0.1.2.3.4.5.6.7ACTUAL number of partsQW 6V-15V.+15VAI1AI2 AO1-15V.+15VAO2AI1VAI20815AI2AI1AO2AO1SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.16SITRAIN Tr
18、aining for Automation and Drives定时器:接通延时 (SD)LADFBDSTLI0.7 S5T#35sI0.5例如T4S TVRBCDS_ODTS处的RLOR处的RLO定时器操作QQ4.5QBIMW0 QW6T4STV RS_ODTI0.7 S5T#35sI0.5MW0BI BCDQQW6 Q4.5=AI0.7LS5T#35s SD T4AI0.5RT4LT4TMW0LCT4TQW6AT4=Q4.50,01s -0,1s -1s -10s -00时间值: 0 . . . 999011011S5TIME数据类型SIMATIC S7Siemens AG 2003. A
19、ll rights reserved.Date:2018/10/3File:DigitalOp.17SITRAIN Training for Automation and Drives定时器: 带保持接通延时 (SS)LADFBDSTLT4I0.7Q4.5S5T#35sI0.5MW0QW6BCDBITVRS_ODTSSQT4I0.7S5T#35sMW0QW6 Q4.5I0.5=BCDQTVRS_ODTSSBIA LSSI0.7 S5T#35sT4AI0.5RT4LT4TMW0LCT4TQW6AT4=Q4.5S处的RLO R处的RLO定时器操作例如QSIMATIC S7Siemens AG 20
20、03. All rights reserved.Date:2018/10/3File:DigitalOp.18SITRAIN Training for Automation and Drives定时器:脉冲 (SP)LADFBDSTLI0.7 S5T#35sI0.5例如T4S TVRBCDS_PULSES处的RLO R处的RLO定时器操作QQ4.5T4I0.7S5T#35sMW0QW6 Q4.5I0.5=BI BCDQSTV RS_PULSEQBIA LSPI0.7 S5T#35sT4AI0.5RT4LT4TMW0LCT4TQW6AT4=Q8.5MW0 QW6SIMATIC S7Siemens
21、 AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.19SITRAIN Training for Automation and Drives定时器:扩展脉冲 (SE)LADFBDSTLT4I0.7Q4.5S5T#35sI0.5MW0 QW6BCDBITVRS_PEXTSQT4I0.7S5T#35sMW0QW6 Q4.5I0.5=BIBCDQSTV RS_PEXTA LSEI0.7 S5T#35sT4AI0.5RT4LT4TMW0LCT4TQW6A=T4Q4.5S处的RLO R处的RLO定时器操作例如QSIMATIC S7Siem
22、ens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.20SITRAIN Training for Automation and Drives定时器:关断延时 (SF)LADFBDSTLT4I0.7Q4.5S5T#35sI0.5MW0QW6BCDQBIS TVRS_OFFDTT4I0.7S5T#35sMW0QW6 Q4.5I0.5=BI BCDQSTV RS_OFFDTA LSFI0.7 S5T#35sT4AI0.5RT4LT4TMW0LCT4TQW6AT4=Q4.5S处的RLO R处的RLO定时器操作例如QSIMATIC
23、S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.21SITRAIN Training for Automation and Drives练习: 定时器图SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.22SITRAIN Training for Automation and Drives练习: 传送带电机点动Lock-out time LEFTT_Jog_RT I 0.2Run Conveyor RIGH
24、T(Q20.5 / Q8.5)Lock-out RIGHTT 15 (SF)T_Jog_LT I 0.3Run Conveyor LEFT(Q20.6 / Q8.6)Lock-out time RIGHTLock-out LEFTT 16 (SF)SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.23SITRAIN Training for Automation and Drives练习: 传送功能的监视 (FC 17)DIT_System_ONFltI 0.0DO Q 4.0ACTUAL n
25、umber of partsI 0.1T_System_OFFL_System.1I 0.2T_Jog_RTL_MAN.2I 0.3T_Jog_LTL_AUTO.3I 0.4S_M/A_ModeSelect.4I 0.5T_M/A_Accept.5I 0.6.6I 0.7.7I 1.0T_Fault_RstQW 6V-15V.+15VAI1AI2 AO1-15V.+15VAO2V AI1WeightAI20815AI2AI1AO2AO1SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.24SI
26、TRAIN Training for Automation and Drives练习:计数传送带运行故障Conv. oper. faultM 17.03Conv. oper.fault2counter C 1710AUTO mode Q 4.3 (Q 8.3)SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.25SITRAIN Training for Automation and Drives用BCD码输入的数任务用BCD码显示的数转换BCD整数转换操作 BCD 整数08150248LADF
27、BDSTLBCD_IENENOINOUTIW2ENOINMW10QW6I_BCDOUTENENOINIW2MW20BCD_IOUTENINININMW20MW10QW6OUTINI_BCDENENOSIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.26L BTI TIW2MW20L ITB TMW10QW6SITRAIN Training for Automation and Drives比较指令LADFBDSTL0.0CMP =IIN1 IN2Q5.7=M0.0&IN2IW2IN1IW0CM
28、P =IIW0 IW2Q5.7M0.0A A ( L L=I)=MQ 5.7IW0IW2SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.27SITRAIN Training for Automation and DrivesLADFBDSTL基本数学功能加MW4IN1MW4IN1MW4 MW10+ IMW10IN2OUTMW6MW10IN2ENOTMW6SUB_I减法MW5 MW11SUB_IENOOUTMW7EN IN1IN2OUTMW5 MW11MW7ENOLMW5LMW11- ITMW
29、7ENIN1 IN2乘法DIV_RENENO IN1IN2OUTD40MD6 MD12除法MMD4MD66MUL_R ENENO IN1IN2MD32MD6 MD12 MD40 MD4MD66ENOOUTDIV_ROUTMUL_RMD32ENOLMD6EN IN1IN2LMD12* RTMD66LMD40LMD4/ RTMD32SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.28EN IN1IN2SITRAIN Training for Automation and Drives练习: 计数
30、传送的零件(FC 18, MW 20)DIT_System_ONFltI 0.0DO Q 4.0ACTUAL number of partsI 0.1I 0.2T_System_OFF T_Jog_RTL_SystemL_MAN.1.2I 0.3T_Jog_LTL_AUTO.3I 0.4S_M/A_ModeSelect.4I 0.5T_M/A_Accept.5I 0.6.6I 0.7.7I 1.0T_Fault_RstQW 6V-15V.+15VAI1AI2 AO1-15V.+15VAO2V AI1AI2AI1SETPOINT number of parts Weight0815 IW 2AI
31、2AO2AO1SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.29SITRAIN Training for Automation and Drives练习: 计数传送的零件(FC 18), 答案提示MOVEENOUTINENONW 1:Set counter to 0复位的条件0MW 20OUTIN1IN2ADD_IENENONW 2:Counting using memory word, ACTUAL number of parts计数的上升沿MW 201MW 20NW 3:Display
32、 ACTUAL number of parts on BCD digital display零件的实际值 (MW 20) 从整数到 BCD转换- 结果在 BCD 数字显示 ( QW 6)NW 4:Readin SETPOINT number of parts and convert from BCD to Integer来自数码拨轮 ( IW 2)的值从 BCD 转换到整数- 把零件的给定值 (Integer)存储在 MW 200NW 5:ACTUAL-SETPOINT comparison, LED (red LED Q8.4)比较实际值 (MW 20)和给定值(MW 200), 比较的结果
33、送到 LEDSIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.30SITRAIN Training for Automation and Drives练习: 控制 LED常亮常亮at both bays when a new part can be placed on the conveyor1 Hz 闪光at the bay where the part was placed and from which the conveyor can be started2 Hz 闪光at both b
34、ays as long as the transport function is runningACTUAL=SETPOINTSIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.31SITRAIN Training for Automation and Drives如果你想知道更多SIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.32SITRAIN Training for Automation
35、 and Drives定时器: STEP 7 的S5定时器的时间格式以常数时间设定S5T#35s200ms(时基 : 01 (100ms), 单位时间数: 352)以变量时间设定01352XX01001101010010时基单位时间(BCD码)在 “L T.” 执行后Accu 1 内容29282726252423222120XXXXXX0101100000剩余的单位时间(Integer)在 “LC T.” 执行后Accu 1 内容01352XX01001101010010时基剩余的单位时间(BCD码)SIMATIC S7Siemens AG 2003. All rights reserved.
36、Date:2018/10/3File:DigitalOp.33SITRAIN Training for Automation and Drives定时器:位指令LADFBDSTL&SDTVS5T#5sAI0.1RT4T4Q 4.0A=SD T4I0.0S5T#5sALNetwork 1:T4I0.0T4I0.0S5T#5sNetwork 2:T4Q 4.0Q 4.0T4Network 3:I0.1T4T4I0.1R&=&RSDSIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.34SITRAIN
37、 Training for Automation and Drives转换指令 I - DI - REAL任务从双整数到实数的转换从整数到双整数的转换带有实数的运算程序整数格式的数据(16 位)F B DENOINMD14MD26OUTENENOINMW12DI_RMD14OUTENI_DISTLMD26OUTINMD14MD14OUTINMW12DI_RENENOI_DIENENOINININLADSIMATIC S7Siemens AG 2003. All rights reserved.Date:2018/10/3File:DigitalOp.35INL ITD DTR TMW12MD26SITRAIN Training for Automation and Drives数字逻辑指令WOR_WMW10TAW / OW / XOWIW 0W#16#5F2ALLWXOR_WWAND_WENENOIN1IN2IW0 W#16#5F2AMW1015001000000
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 租赁设备合同范本
- 二零二四年度医疗设备采购、安装及调试合同2篇
- 财务工作职责报告范文
- 毕节钢厂处理报告范文
- 《高校教师师德修养》课件
- 重点领域行业2024年度研发合作合同
- 《中国mm指南更》课件
- 关于餐饮劳动合同书电子版
- 2024二手汽车买卖合同及售后服务条款3篇
- 双方公司合作协议书范本
- 太空舱产品买卖合同
- 金螳螂装修合同模板
- 2024年内蒙古电力集团限责任公司招聘400人历年(高频重点复习提升训练)共500题附带答案详解
- 茶楼采购供货合同
- 【课件】点线传情-造型元素之点线面高中美术人美版(2019)选择性必修1+绘画
- 服务质量保障措施及进度保障措施
- 奇瑞终身质保合同范本
- 上睑下垂的护理
- 中药贴敷疗法
- 小学数学六年级下册期末测试卷含答案(综合题)
- DZ∕T 0054-2014 定向钻探技术规程(正式版)
评论
0/150
提交评论