In STEP 7 can be integers, long integers and real numbers to add, subtract, multiply and divide arithmetic. Arithmetic instructions in accumulator 1 and 2 were as minuend or dividend accumulator value 2 in. Result of an arithmetic of preservation, the original value of the accumulator 1 Accumulator 1 is covered in the calculation result, the value in the accumulator 2 remain unchanged.When the CPU performing arithmetic operations, regardless of RLO, does not have an impact on the RLO. Learning arithmetic instructions must be noted that the result of arithmetic operation will have an impact of some bits of the status word, these bits are: CC1 and CC0, OV, OS. Bit manipulation instructions and conditional jump instructions, often these flags judge to decide what action.
l + I 16-bit integer add instructionl -I 16-bit integer subtraction instructionl * I 16-bit integer multiplied instructionl / I 16-bit integer division instructionl + D 32-bit integer add instructionl -D 32-bit integer subtraction instructionl * D 32-bit integer multiplied instructionl / D 32-bit integer division instructionl MOD 32-bit integer division remainder instruction fetchExample 3.7.1
L MW0 // MW 0 will be loaded with the value in ACCU 1
L MW2 // The value of 2 MW of load ACCU 1, ACCU 1 of the original value of the low word of accumulator 2 transferred
+ // L accumulator low word and the low word of accumulator 2 by adding
T MW10 // The result of the operation to the MW 10* FBD format
And of STL instructions that much different enable input EN and enable output ENO. Only when I 0.0 = 1, before the addition operation. If the result of an operation is out of range or I 0.0 = 0, then Q 4.0 = 0.
