SIEMENS 数字指令 M0.0 CMP ==1Q5 IN1 IW2 IN2 10.7S ODT Q4.5 S5T#35sT BI MWO 10.5 R BCDQW6 SIMATIC S7 Date:2021//24 formation and Training Cente Siemens AG2000 SSP 09C
Date: 2021/2/24 File: SSP1_09C.1 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 数字指令 CMP ==I IN1 IN2 IW0 IW2 M0.0 Q 5.7 T4 S_ODT TV S Q BCD BI R I0.7 I0.5 S5T#35s Q4.5 MW0 QW6
SIEMENS 数据格式 进制BCD 数 0000 0001 0123456789 十进制值: 128+64 0010 符号位 0011 数据类型整型例如205 0100 0101 0110 0111 31 2423 1615 0 1000 00000000o00 oooooooo 1001 10 指数(8位) 尾数(23位) 123 符号位 数据类型实数例如456789 15 SIMATIC S7 Date:2021/2/24 formation and Training Cente Siemens AG2000 SSP 09C.2
Date: 2021/2/24 File: SSP1_09C.2 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 数据格式 十进制 BCD 数 数 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 11 12 13 14 15 1 1 0 0 1 1 0 1 7 0 0 0 0 0 0 0 0 15 8 0 128 + 64 8 4 1 符号位 数据类型 整型 例如 205 十进制值: + + + 0 15 8 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 31 24 23 16 指数(8位) 尾数(23 位) 数据类型 实数 例如 45.6789 符号位
SIEMENS 数据格式(16位) PG CPU 符号(+) BCD W#16#296 000000110100101110 正数 15141312111098 0000000 整数 0101000 296 2523 符号() BCD W#16#F413 11010000010011 负数 1514131211109876543210 11 111111001100011 整数 4413 24232 256+128+16+8+4=412 (412+1)=-413 SIMATIC S7 Date:2021/2/24 formation and Training Cente Siemens AG2000 SSP 09C.3
Date: 2021/2/24 File: SSP1_09C.3 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 数据格式 (16 位) BCD 整数 BCD 2 8 = 256 + 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 2 5 = 32 + 2 3 = 8 = 296 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0 符号 (+) 2 9 6 1 1 1 1 0 1 0 0 0 0 0 1 0 0 1 1 符号 (-) 4 1 3 W#16#F413 2 7 = 128 + 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 2 3 = 8+ 2 2 = 4 = 412 2 8 = 256+ 2 4 = 16+ - (412 + 1) = - 413 负数 整数 正数 W#16#296 +296 -413 PG CPU
SIEMENS 数据格式(32位) BCD 符号(+) D1000000000000000000000101001010 DINT 313029282726252423222120191817161514131211109 7654 L#+296 00000000000000000000000100101000 252 整数(32位)= 256+32+8=296 REAL实数的通用格式=(Sgn)·(1·(2012 +0.75 实数 符号e=指数(8B f=底数(23B +75E-1 29282726252423222120191817161514131211109 7654 010000000000000000000000 27262524232221202-1222-324 实数=+15*2126127=075 SIMATIC S7 Date:2021//24 formation and Training Cente Siemens AG2000 SSP 09C.4
Date: 2021/2/24 File: SSP1_09C.4 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 数据格式 (32 位) 实数= +1,5 * 2 126-127 = 0,75 DW#16#296 L#+296 +0.75 或 +7.5 E-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 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 2 8 = 256 + 2 5 = 32 + 2 3 = 整数 (32 位) = 8 = 296 0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 e = 指数 (8 Bit) f = 底数 (23 Bit) 实数的通用格式= (Sign) • (1.f) • (2e-127) 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 -23 2 -1 2 -2 2- 4 2 ..... -3 0 0 0 0 符号 (+) 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 2 9 6 0 0 0 0 0 0 0 0 0 0 0 0 BCD DINT REAL
SIEMENS 数据装入和传递(1) LAD FBD STL MOVE MOVE EN ENO EN OUT MB5 T MB5 OUT MB55 N 装载 L+5 16-位常数(整数 举例 LL#523123 32-位常数(双整数) L B#16#EF 十六进制字节 L2#0010011011100011 16-位二进制值 L3.14 32-位常数(实数) SIMATIC S7 Date:2021//24 formation and Training Cente Siemens AG2000 SSP 09C.5
Date: 2021/2/24 File: SSP1_09C.5 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 装载 举例 数据装入和传递 (1) L +5 // 16-位常数 (整数) L L#523123 // 32-位常数 (双整数) L B#16#EF // 十六进制字节 L 2#0010 0110 1110 0011 // 16-位二进制值 L 3.14 // 32-位常数 (实数) MOVE EN IN OUT ENO MB5 5 FBD L +5 T MB5 STL MOVE EN OUT ENO MB5 LAD 5 IN
SIEMENS 数据装入和传递(2 ACCU1 ACCU2 程序 内容 内容 XxX|X‖xX YYYYYYYY W#16HCAFEF00OO XXXXXXXX L W#16#AFFE 0000 A F FE 0000C A FE SIMATIC S7 Date:2021/2/24 formation and Training Cente Siemens AG2000 SSP1 09C6
Date: 2021/2/24 File: SSP1_09C.6 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 数据装入和传递(2) 0 0 0 0 0 0 0 0 : : L W#16#CAFE L W#16#AFFE : : : C A F E X X X X X X X X A F F E ACCU2 内容 ACCU1 内容 程序 X X X X X X X X Y Y Y Y Y Y Y Y 0 0 0 0 C A F E
SIEMENS 数据装入和传递(3) AccU1内容 程序 15 装数>LMNo→ oooo0 o MB0 MB11 31 23 L MD O MBO MB1 MB2 MB3 QD 4 QD 4 传递 T QW4 QW T QB 4 SIMATIC S7 Date:2021//24 formation and Training Cente Siemens AG2000 SSP 09C.7
Date: 2021/2/24 File: SSP1_09C.7 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 数据装入和传递(3) 31 23 15 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MB0 31 23 15 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MB0 MB1 31 23 15 7 0 MB0 MB1 MB2 MB3 装载 L MB 0 程序 T QD 4 QD 4 QW 4 QB 4 传递 ACCU1内容 L MW 0 L MD 0 T QW 4 T QB 4
SIEMENS 定时器概述 STL 例: 输入延时 0.7 S ODT Q85 S ODT S Q S5T#355 B MWO A|0.7 0.5 R BCD MW2 L S5T##35s SD 4 A|0.5 L 4 T MWO LC T4 T MW2 Q85 SIMATIC S7 Date:2021/2/24 formation and Training Cente Siemens AG2000 SSP 09C.8
Date: 2021/2/24 File: SSP1_09C.8 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation LAD STL 示例: 输入延时 S_ODT A I0.7 L S5T#35s SD T4 A I0.5 R T4 L T4 T MW0 LC T4 T MW2 A T4 = Q8.5 定时器概述
SIEMENS 定时器:接通延时(D) LAD FBD STL T4 T4 0.7 S ODT Q4.5 S ODT A10.7 Q 0.7 L S5T#35 S5T#35STV MWO S5T#35S-TV BCDQW6 SD T4 05 Q4.5 A10.5 R BCD QW6 05-R R T4 MWO S处的RLQ LC T4 R处的RLO T QW6 A 4 定时器 =Q4.5 操作 例如 Q S5TIME 0,01 00下 数据类型 01s<-[01 1s<-L[01 时间值:0...999 10s<- SIMATIC S7 Date:2021/2/24 formation and Training Cente Siemens AG2000 SSP 09C.9
Date: 2021/2/24 File: SSP1_09C.9 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 定时器:接通延时 (SD) LAD T4 S_ODT TV S Q BCD BI R I0.7 I0.5 S5T#35s Q4.5 MW0 QW6 FBD S_ODT TV Q BI R I0.7 I0.5 S5T#35s MW0 QW6 T4 BCD = Q4.5 S STL A I0.7 L S5T#35s SD T4 A I0.5 R T4 L T4 T MW0 LC T4 T QW6 A T4 = Q4.5 例如 S处的RLO R处的RLO 定时器 操作 Q 时间值: 0 . . . 999 0,01s <-- 0,1s <-- 1s <-- 10s <-- 0 0 0 1 1 0 1 1 S5TIME 数据类型
SIEMENS 定时器:带保持接通延时(SS) LAD FBD STL T4 A|0.7 10.7 S ODTS Q4.5 S ODTS L S5T#35s 0.7 Ss T4 S5T#35S-TV MWO S5T#35S-TV BCD QW6 A10.5 0.5 Q4.5 R BCDF QW6 05R T MWO LC T4 T QW6 A t4 =Q4.5 S处的RLQ R处的RLO 定时器 操作 例如 SIMATIC S7 Date:2021//24 formation and Training Cente Siemens AG2000 SSP 09C.10
Date: 2021/2/24 File: SSP1_09C.10 SIMATIC S7 Siemens AG 2000. All rights reserved. Information and Training Center Know ledge for Automation 定时器: 带保持接通延时 (SS) STL A I0.7 L S5T#35s SS T4 A I0.5 R T4 L T4 T MW0 LC T4 T QW6 A T4 = Q4.5 LAD T4 S_ODTS TV S Q BCD BI R I0.7 I0.5 S5T#35s Q4.5 MW0 QW6 FBD S_ODTS TV Q BI R I0.7 I0.5 S5T#35s MW0 QW6 T4 BCD = Q4.5 S 例如 S处的RLO R处的RLO 定时器 操作 Q