工控编程吧 gkbc8 com
西门子语句表STL S7 300 S7 400 编程手册 中文超清版
文档手册目录或截图为:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
目录
位逻辑指令.............................................................................................................................................................13
1.1 位逻辑指令概述............................................................................................................................13
1.2 A 与运算.................................................................................................................................15
1.3 AN 与非运算...........................................................................................................................16
1.4 O 或运算................................................................................................................................17
1.5 ON 或非运算..........................................................................................................................18
1.6 X 异或运算.............................................................................................................................19
1.7 XN 同或运算...........................................................................................................................20
1.8 O 先与运算后或运算..............................................................................................................21
1.9 A( 与运算嵌套开始.................................................................................................................22
1.10 AN( 与非运算嵌套开始...........................................................................................................23
1.11 O( 或运算嵌套开始.................................................................................................................23
1.12 ON( 或非运算嵌套开始..........................................................................................................24
1.13 X( 异或运算嵌套开始.............................................................................................................24
1.14 XN( 同或运算嵌套开始...........................................................................................................25
1.15 ) 嵌套结束.............................................................................................................................25
1.16 = 赋值.....................................................................................................................................27
1.17 R 复位....................................................................................................................................28
1.18 S 置位....................................................................................................................................29
1.19 NOT 对 RLO 取反..................................................................................................................30
1.20 SET 置位 RLO (=1) ..............................................................................................................30
1.21 CLR 清零 RLO (=0) ..............................................................................................................32
1.22 SAVE 将 RLO 保存到BR 寄存器...........................................................................................33
1.23 FN 下降沿..............................................................................................................................34
1.24 FP 上升沿...............................................................................................................................36
2 比较指令......................................................................................................................................................39
2.1 比较指令概述................................................................................................................................39
2.2 ? I 比较整数 (16位) .................................................................................................................40
2.3 ? D 比较长整数 (32 位) ...........................................................................................................41
2.4 ? R 比较浮点数 (32 位) ...........................................................................................................42
3 转换指令......................................................................................................................................................43
3.1 转换指令概述................................................................................................................................43
3.2 BTI 将 BCD 码转换为整型 (16 位) .......................................................................................44
3.3 ITB 将整型 (16 位) 转换为 BCD 码.......................................................................................45
3.4 BTD 将 BCD 码转换为整型 (32 位) .....................................................................................46
3.5 ITD 将整型 (16 位) 转换为长整型 (32 位) ..........................................................................47
3.6 DTB 将长整型 (32 位) 转换为 BCD码..................................................................................48
3.7 DTR 将长整型 (32 位) 转换为浮点数 (32位 IEEE 754) .......................................................49
3.8 INVI 对整数 (16 位) 求反码...................................................................................................50
3.9 INVD 对长整数 (32位) 求反码.............................................................................................51
3.10 NEGI 对整数 (16 位) 求补码.................................................................................................52
3.11 NEGD 对长整数 (32位) 求补码............................................................................................53
3.12 NEGR 浮点数 (32 位,IEEE 754) 取反................................................................................54
3.13 CAW 改变 ACCU 1-L (16 位) 中的字节顺序........................................................................55
3.14 CAD 改变 ACCU 1 (32 位) 中的字节顺序.............................................................................56
3.15 RND 取整...............................................................................................................................57
3.16 TRUNC 截断..........................................................................................................................58
3.17 RND+ 取整为高位长整数.......................................................................................................59
3.18 RND- 取整为低位长整数........................................................................................................60
4 计数器指令...................................................................................................................................................61
4.1 计数器指令概述............................................................................................................................61
4.2 FR 启用计数器 (释放) ..........................................................................................................62
4.3 L 将当前计数器值载入 ACCU 1.............................................................................................63
4.4 LC 将当前计数器值作为 BCD码载入 ACCU 1......................................................................64
4.5 R 将计数器复位......................................................................................................................66
4.6 S 设置计数器预设值...............................................................................................................67
4.7 CU 升值计数器.......................................................................................................................68
4.8 CD 降值计数器.......................................................................................................................69
5 数据块指令...................................................................................................................................................71
5.1 数据块指令概述............................................................................................................................71
5.2 OPN 打开数据块....................................................................................................................72
5.3 CDB 交换共享数据块和实例DB............................................................................................73
5.4 L DBLG 在 ACCU 1中装载共享数据块的长度.......................................................................73
5.5 L DBNO 在 ACCU 1中装载共享数据块的编号......................................................................74
5.6 L DILG 在 ACCU 1中装载实例DB的长度............................................................................74
5.7 L DINO 在 ACCU 1中装载实例DB的编号............................................................................75
6 逻辑控制指令...............................................................................................................................................77
6.1 逻辑控制指令概述........................................................................................................................77
6.2 JU 无条件跳转........................................................................................................................79
6.3 JL 跳转到标签........................................................................................................................80
6.4 JC 当 RLO = 1时跳转............................................................................................................82
6.5 JCN 当 RLO = 0时跳转.........................................................................................................83
6.6 JCB 当带BR 位的RLO = 1 时跳转........................................................................................84
6.7 JNB 当带BR 位的RLO = 0 时跳转........................................................................................85
6.8 JBI 当 BR = 1 时跳转 .............................................................................................................86
6.9 JNBI 当 BR = 0时跳转...........................................................................................................87
6.10 JO 当 OV = 1 时跳转..............................................................................................................88
6.11 JOS 当 OS = 1 时跳转 ...........................................................................................................89
6.12 JZ 当为零时跳转....................................................................................................................91
6.13 JN 当不为零时跳转................................................................................................................92
6.14 JP 当为正时跳转....................................................................................................................93
6.15 JM 当为负时跳转....................................................................................................................94
6.16 JPZ 当为正或零时跳转...........................................................................................................95
6.17 JMZ 当为负或零时跳转..........................................................................................................96
6.18 JUO 无序时跳转.....................................................................................................................97
6.19 LOOP 循环.............................................................................................................................99
7 整数运算指令.............................................................................................................................................101
7.1 整数算术指令概述......................................................................................................................101
7.2 使用整数算术指令时得出状态字的位数值..................................................................................102
7.3 +I ACCU 1 + ACCU 2,整型 (16位) .................................................................................103
7.4 -I ACCU 2 - ACCU 1,整型 (16 位) ...................................................................................104
7.5 *I ACCU 1 * ACCU 2,整型 (16位) ..................................................................................105
7.6 /I ACCU 2 / ACCU 1,整型 (16 位) ...................................................................................106
7.7 + 整型常数相加 (16、32 位) ..............................................................................................108
7.8 +D ACCU 1 + ACCU 2,长整型 (32 位) ............................................................................110
7.9 -D ACCU 2 - ACCU 1,长整型 (32 位) .............................................................................111
7.10 *D ACCU 1 * ACCU 2,长整型 (32 位) .............................................................................112
7.11 /D ACCU 2 / ACCU 1,长整型 (32位) ..............................................................................113
7.12 MOD 除法余数,长整型 (32 位) ........................................................................................114
8 浮点型数学运算指令..................................................................................................................................115
8.1 浮点运算指令概述......................................................................................................................115
8.2 使用浮点运算指令时得出状态字的位数值..................................................................................116
8.3 浮点型数学运算指令:基本........................................................................................................117
8.3.1 +R 将 ACCU 1 和 ACCU 2作为浮点数 (32 位 IEEE 754) 相加..........................................117
8.3.2 -R 以浮点数 (32 位 IEEE 754) 的形式从 ACCU 2 减去 ACCU 1........................................119
8.3.3 *R 将 ACCU 1 与 ACCU 2作为浮点数 ( 32位 IEEE 754) 相乘.........................................120
8.3.4 /R 以浮点数 (32 位 IEEE 754) 的形式用 ACCU 1 除 ACCU 2............................................121
8.3.5 ABS 浮点数 (32 位 IEEE 754) 的绝对值.............................................................................122
8.4 浮点型数学运算指令:扩充........................................................................................................123
8.4.1 SQR 计算浮点数 (32 位) 的平方.........................................................................................123
8.4.2 SQRT 计算浮点数 (32 位) 的平方根...................................................................................124
8.4.3 EXP 计算浮点数 (32位) 的指数值......................................................................................125
8.4.4 LN 计算浮点数 (32位) 的自然对数.....................................................................................126
8.4.5 SIN 计算浮点数 (32位) 角度的正弦值................................................................................127
8.4.6 COS 计算浮点数 (32 位) 角度的余弦值..............................................................................128
8.4.7 TAN 计算浮点数 (32位) 角度的正切值..............................................................................129
8.4.8 ASIN 计算浮点数 (32 位) 的反正弦值.................................................................................130
8.4.9 ACOS 计算浮点数 (32 位) 的反余弦值...............................................................................131
8.4.10 ATAN 计算浮点数 (32 位) 的反正切值................................................................................132
9 装载和传送指令.........................................................................................................................................133
9.1 装载和传送指令概述...................................................................................................................133
9.2 L 装载...................................................................................................................................134
9.3 L STW 将状态字加载到 ACCU 1中.....................................................................................136
9.4 LAR1 从ACCU 1装载地址寄存器 1....................................................................................137
9.5 LAR1 <D> 用长整型 (32 位指针) 装载地址寄存器 1..........................................................138
9.6 LAR1 AR2 从地址寄存器 2装载地址寄存器1.....................................................................139
9.7 LAR2 从ACCU 1装载地址寄存器 2....................................................................................139
9.8 LAR2 <D> 用长整型 (32 位指针) 装载地址寄存器 2..........................................................140
9.9 T 传送...................................................................................................................................141
9.10 T STW 将 ACCU 1传送至状态字........................................................................................142
9.11 CAR 交换地址寄存器1和地址寄存器 2...............................................................................143
9.12 TAR1 将地址寄存器1传送至 ACCU 1................................................................................143
9.13 TAR1 <D> 将地址寄存器 1传送至目标地址 (32位指针) ..................................................144
9.14 TAR1 AR2 将地址寄存器 1传送至地址寄存器 2.................................................................145
9.15 TAR2 将地址寄存器2传送至 ACCU 1................................................................................145
9.16 TAR2 <D> 将地址寄存器 2传送至目标地址 (32位指针) ..................................................146
10 程序控制指令.............................................................................................................................................147
10.1 程序控制指令总览......................................................................................................................147
10.2 BE 块结束 ............................................................................................................................148
10.3 BEC 有条件的块结束...........................................................................................................149
10.4 BEU 无条件的块结束...........................................................................................................150
10.5 CALL 块调用........................................................................................................................151
10.6 调用 FB.......................................................................................................................................154
10.7 调用 FC......................................................................................................................................156
10.8 调用 SFB....................................................................................................................................158
10.9 调用 SFC....................................................................................................................................160
10.10 调用多重情景..............................................................................................................................161
10.11 调用来自库的块..........................................................................................................................161
10.12 CC 条件调用 ........................................................................................................................162
10.13 UC 无条件调用.....................................................................................................................163
10.14 MCR (主控继电器) ....................................................................................................................164
10.15 关于使用 MCR 功能的重要注意事项..........................................................................................166
10.16 MCR( 将 RLO 保存到MCR 堆栈中,开始MCR..................................................................167
10.17 )MCR 结束 MCR..................................................................................................................169
10.18 MCRA 激活 MCR 区域.........................................................................................................170
10.19 MCRD 取消激活MCR区域 .................................................................................................171
11 移位和循环指令 .........................................................................................................................................173
11.1 移位指令.....................................................................................................................................173
11.1.1 移位指令概述..............................................................................................................................173
11.1.2 SSI 带符号整型移位 (16 位) ..............................................................................................174
11.1.3 SSD 带符号长整型移位 (32位) .........................................................................................176
11.1.4 SLW 左移字 (16 位) ...........................................................................................................178
11.1.5 SRW 右移字 (16 位) ..........................................................................................................180
11.1.6 SLD 左移双字 (32 位) ........................................................................................................182
11.1.7 SRD 右移双字 (32 位) .......................................................................................................184
11.2 循环指令.....................................................................................................................................186
11.2.1 循环移位指令概述......................................................................................................................186
11.2.2 RLD 循环左移双字 (32 位) .................................................................................................187
11.2.3 RRD 循环右移双字 (32 位) ................................................................................................189
11.2.4 RLDA 通过 CC 1循环左移 ACCU 1 (32位) .......................................................................191
11.2.5 RRDA 通过 CC 1循环右移 ACCU 1 (32位) ......................................................................192
12 定时器指令.................................................................................................................................................193
12.1 定时器指令概述..........................................................................................................................193
12.2 定时器在存储器中的位置与定时器组件......................................................................................194
12.3 FR 启用定时器 (自由) ........................................................................................................197
12.4 L 将当前定时器值作为整数载入 ACCU 1.............................................................................199
12.5 LC 将当前定时器值作为 BCD载入ACCU 1........................................................................201
12.6 R 复位定时器.......................................................................................................................203
12.7 SP 脉冲定时器.....................................................................................................................204
12.8 SE 扩展脉冲定时器..............................................................................................................206
12.9 SD 接通延迟定时器..............................................................................................................208
12.10 SS 掉电保护接通延时定时器 ...............................................................................................210
12.11 SF 断开延时定时器..............................................................................................................212
13 字逻辑指令.................................................................................................................................................215
13.1 字逻辑指令概述..........................................................................................................................215
13.2 AW 单字与运算 (16位) .....................................................................................................216
13.3 OW 单字或运算 (16位) .....................................................................................................218
13.4 XOW 单字异或运算 (16 位) ...............................................................................................220
13.5 AD 双字与运算 (32位) ......................................................................................................222
13.6 OD 双字或运算 (32位) ......................................................................................................224
13.7 XOD 双字异或运算 (32 位) ................................................................................................226
14 累加器指令.................................................................................................................................................229
14.1 累加器和地址寄存器指令概述....................................................................................................229
14.2 TAK 将 ACCU 1与 ACCU 2 互换........................................................................................230
14.3 POP 具有两个 ACCU的 CPU..............................................................................................231
14.4 POP 具有四个 ACCU的 CPU..............................................................................................232
14.5 PUSH 具有两个 ACCU的 CPU...........................................................................................233
14.6 PUSH 具有四个 ACCU的 CPU...........................................................................................234
14.7 ENT 进入 ACCU 堆栈..........................................................................................................235
14.8 LEAVE 离开 ACCU堆栈......................................................................................................235
14.9 INC 增加ACCU 1-L-L..........................................................................................................236
14.10 DEC 减少 ACCU 1-L-L........................................................................................................237
14.11 +AR1 将 ACCU 1加到地址寄存器 1....................................................................................238
14.12 +AR2 将 ACCU 1加到地址寄存器 2....................................................................................239
14.13 BLD 程序显示指令 (空) ......................................................................................................240
14.14 NOP 0 空指令......................................................................................................................240
14.15 NOP 1 空指令......................................................................................................................241
A 所有 STL指令概述....................................................................................................................................243
A.1 按德语助记符排序的 STL指令 (SIMATIC) ..............................................................................243
A.2 按英语助记符 (国际) 排序的 STL指令......................................................................................248
B 编程实例....................................................................................................................................................253
B.1 编程实例总览..............................................................................................................................253
B.2 实例:位逻辑指令......................................................................................................................254
B.3 实例:定时器指令......................................................................................................................257
B.4 实例:计数器和比较指令...........................................................................................................260
B.5 实例:整数运算指令...................................................................................................................262
B.6 实例:字逻辑指令......................................................................................................................263
C 参数传送....................................................................................................................................................265
索引 ...................................................................................................................................................................267
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
更多目录内容,请 免费 下载 观看;
说明:所有资源,解压密码一律为工控编程吧网址 gkbc8 com;
下载地址为: (为增加互动交流,回复后可免费下载)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
游客,为过滤非法行为,全站隐藏资源仅对充值会员开放 进入升级
|