Table of contents
7.4.2
7.4.3
OK and Not OK instructions ...................................................................................................... 185
7.5
Math .......................................................................................................................................... 186
7.5.1
Calculate instruction.................................................................................................................. 186
7.5.2
7.5.3
Modulo instruction ..................................................................................................................... 188
7.5.4
Negation instruction .................................................................................................................. 189
7.5.5
7.5.6
Absolute value instruction ......................................................................................................... 190
7.5.7
7.5.8
Limit instruction ......................................................................................................................... 192
7.5.9
7.6
Move.......................................................................................................................................... 194
7.6.1
7.6.2
7.6.3
Fill instructions .......................................................................................................................... 199
7.6.4
Swap instruction........................................................................................................................ 200
7.7
Convert...................................................................................................................................... 201
7.7.1
CONV instruction ...................................................................................................................... 201
7.7.2
7.7.3
7.7.4
7.7.5
7.8
Program control......................................................................................................................... 209
7.8.1
7.8.2
IF-THEN statement ................................................................................................................... 210
7.8.3
CASE statement........................................................................................................................ 211
7.8.4
FOR statement.......................................................................................................................... 212
7.8.5
WHILE-DO statement ............................................................................................................... 213
7.8.6
REPEAT-UNTIL statement ....................................................................................................... 214
7.8.7
CONTINUE statement............................................................................................................... 214
7.8.8
EXIT statement ......................................................................................................................... 215
7.8.9
GOTO statement....................................................................................................................... 216
7.8.10
RETURN statement .................................................................................................................. 216
7.8.11
7.8.12
JMP_LIST instruction ................................................................................................................ 217
7.8.13
SWITCH instruction................................................................................................................... 218
7.8.14
7.8.15
7.8.16
Stop scan cycle instruction........................................................................................................ 222
7.8.17
Get Error instructions ................................................................................................................ 222
7.9
Word logic operations ............................................................................................................... 226
7.9.1
7.9.2
Invert instruction........................................................................................................................ 227
7.9.3
7.9.4
7.10
Shift and Rotate ........................................................................................................................ 231
7.10.1
Shift instructions........................................................................................................................ 231
7.10.2
Rotate instructions .................................................................................................................... 232
8
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05