Table of contents
S7-1200 Programmable controller
10 System Manual, 03/2014, A5E02486680-AG
6.6.3 Copy protection ......................................................................................................................... 195
6.7 Downloading the elements of your program ............................................................................. 196
6.8 Uploading from the CPU ........................................................................................................... 197
6.8.1 Copying elements of the project ............................................................................................... 197
6.8.2 Using the compare function ...................................................................................................... 198
6.9 Debugging and testing the program .......................................................................................... 198
6.9.1 Monitor and modify data in the CPU ......................................................................................... 198
6.9.2 Watch tables and force tables ................................................................................................... 199
6.9.3 Cross reference to show usage ................................................................................................ 199
6.9.4 Call structure to examine the calling hierarchy ......................................................................... 201
7 Basic instructions ................................................................................................................................. 203
7.1 Bit logic operations .................................................................................................................... 203
7.1.1 Bit logic instructions .................................................................................................................. 203
7.1.2 Set and reset instructions .......................................................................................................... 206
7.1.3 Positive and negative edge instructions .................................................................................... 209
7.2 Timer operations ....................................................................................................................... 212
7.3 Counter operations .................................................................................................................... 220
7.4 Comparator operations ............................................................................................................. 226
7.4.1 Compare values instructions ..................................................................................................... 226
7.4.2 IN_Range (Value within range) and OUT_Range (Value outside range) instructions .............. 227
7.4.3 OK (Check validity) and NOT_OK (Check invalidity) instructions ............................................. 228
7.5 Math functions ........................................................................................................................... 229
7.5.1 CALCULATE (Calculate) instruction ......................................................................................... 229
7.5.2 Add, subtract, multiply and divide instructions .......................................................................... 230
7.5.3 MOD (return remainder of division) instruction ......................................................................... 231
7.5.4 NEG (Create twos complement) instruction .............................................................................. 232
7.5.5 INC (Increment) and DEC (Decrement) instructions ................................................................ 232
7.5.6 ABS (Form absolute value) instruction ..................................................................................... 233
7.5.7 MIN (Get minimum) and MAX (Get maximum) instructions ...................................................... 234
7.5.8 LIMIT (Set limit value) instruction .............................................................................................. 235
7.5.9 Exponent, logarithm, and trigonometry instructions .................................................................. 236
7.6 Move operations ........................................................................................................................ 238
7.6.1 MOVE (Move value), MOVE_BLK (Move block), and UMOVE_BLK (Move block
uninterrruptible) instructions ...................................................................................................... 238
7.6.2 FieldRead (Read field) and FieldWrite (Write field) instructions ............................................... 240
7.6.3 FILL_BLK (Fill block) and UFILL_BLK (Fill block uninterruptible) instructions .......................... 242
7.6.4 SWAP (Swap bytes) instruction ................................................................................................ 243
7.7 Conversion operations .............................................................................................................. 244
7.7.1 CONV (Convert value) instruction ............................................................................................. 244
7.7.2 Conversion instructions for SCL ............................................................................................... 245
7.7.3 ROUND (Round numerical value) and TRUNC (Truncate numerical value) instructions......... 249
7.7.4 CEIL and FLOOR (Generate next higher and lower integer from floating-point number)
instructions ................................................................................................................................ 250
7.7.5 SCALE_X (Scale) and NORM_X (Normalize) instructions ....................................................... 251
7.8 Program control operations ....................................................................................................... 254
7.8.1 JMP (Jump if RLO = 1), JMPN (Jump if RLO = 0), and Label (Jump label) instructions .......... 254