Arithmetic Operations - Siemens S5-100U User Manual

Simatic s5 programmable controller
Hide thumbs Also See for S5-100U:
Table of Contents

Advertisement

S5-100U
Transferring to the System Data Area
Example: Set the scan monitoring time to 100 ms after each mode change from "STOP" to
"RUN". You can program this time in multiples of 10 ms in system data word 96. The
following function block can be called from OB21, for example.
STL
FB 11
L
KF
+10
T
RS
96
BE
Caution
!
The TIR, TRS and TNB operations are memory-changing operations with which you can
access the user memory and the system data area. These accesses are not monitored
by the operating system. Improper use of the operations can lead to changes in the
program and to a programmable controller crash.
8.3.3

Arithmetic Operations

An arithmetic operation changes the contents of ACCU 1 by a specified value. The parameter re-
presents this value as a positive or negative decimal number. Table 8-29 shows the essential
features of the "ADD" operation. An example follows the table.
Operation
Operand
ADD
ID
BF
KF
Processing
An arithmetic operation is executed independently of the RLO. It does not affect the RLO or the
condition codes.
You can subtract by entering a negative parameter.
Even if the result cannot be represented by 16 bits, no carry is made to ACCU 2, i.e., the contents
of ACCU 2 are not changed.
EWA 4NEB 812 6120-02
Block number and type
Load ACCU 1 with the factor 10.
Transfer this value to system data word 96.
Table 8-29. Overview of the "ADD" Operation
Add a constant
Add byte or word constants.
Parameter
-128
-32768 to
Explanation
Meaning
to
+127
+32767
STEP 5 Operations
8-67

Advertisement

Table of Contents
loading

Table of Contents