Siemens Simatic S7-300 Service Manual Page 102

  • Download
  • Add to my manuals
  • Print
  • Page
    / 272
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 101
Integer Math Instructions
Statement List (STL) for S7-300 and S7-400 Programming
7-8
A5E00706960-01
7.7 + Add Integer Constant (16, 32-Bit)
Format
+ <integer constant>
Address Data type Description
<integer constant> (16, or 32-bit integer) Constant to be added
Description
+ <integer constant>
adds the integer constant to the contents of ACCU 1 and
stores the result in ACCU 1. The instruction is executed without regard to, and
without affecting, the status word bits.
+
<16-bit integer constant>
: Adds a 16-bit integer constant (in the range of -32768
to +32767) to the contents of ACCU 1-L and stores the result in ACCU 1-L.
+
<32-bit integer constant>
: Adds a 32-bit integer constant (in the range
of - 2,147,483,648 to 2,147,483,647) to the contents of ACCU 1 and stores the result
in ACCU 1.
Status word
BR CC 1 CC 0 OV OS OR STA RLO /FC
writes: - - - - - - - - -
Example 1
STL Explanation
L IW10 //Load the value of IW10 into ACCU 1-L.
L MW14 //Load the contents of ACCU 1-L to ACCU 2-L. Load the value of MW14 into
ACCU 1-L.
+I //Add ACCU 2-L and ACCU 1-L; store the result in ACCU 1-L.
+
25 //Add ACCU 1-L and 25; store the result in ACCU 1-L.
T DB1.DBW25 //Transfer the contents of ACCU 1-L (result) to DBW25 of DB1.
Example 2
STL Explanation
L IW12
L IW14
+
100 //Add ACCU 1-L and 100; store the result in ACCU 1-L.
>I //If ACCU 2 > ACCU 1, or IW12 > (IW14 + 100)
JC NEXT //then conditional jump to jump label NEXT.
Page view 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 271 272

Comments to this Manuals

No comments