Siemens Simatic S7-300 Service Manual Page 122

  • Download
  • Add to my manuals
  • Print
  • Page
    / 272
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 121
Floating-Point Math Instructions
Statement List (STL) for S7-300 and S7-400 Programming
8-12
A5E00706960-01
8.4.3 EXP Generate the Exponential Value of a Floating-Point
Number (32-Bit)
Format
EXP
Description of instruction
EXP
(generate the exponential value of a floating-point number, 32-bit, IEEE-FP)
calculates the exponential value (exponential value for base
e
) of a floating-point
number (32-bit, IEEE-FP) in ACCU 1. The result is stored in accumulator 1. The
instruction influences the CC 1, CC 0, OV, and OS status word bits.
The contents of accumulator 2 (and also the contents of accumulator 3 and
accumulator 4 for CPUs with four ACCUs) remain unchanged.
Result
The result in ACCU 1 is CC 1 CC 0 OV OS Note
+qNaN 1 1 1 1
+infinite 1 0 1 1 Overflow
+normalized 1 0 0 -
+denormalized 0 0 1 1 Underflow
+zero 0 0 0 -
-qNaN 1 1 1 1
Example
STL Explanation
L MD10 //The value from memory double word MD10 is loaded into ACCU 1. (This
value must be in the floating-point format.)
EXP //Calculate the exponential value of the floating-point number
(32-bit, IEEE-FP) in ACCU 1 at base e. Store the result in ACCU 1.
AN OV //Scan the OV bit in the status word for "0."
JC OK //If no error occurred during the EXP instruction, jump to the OK jump
label.
BEU //Block end unconditional, if an error occurred during the EXP
instruction.
OK: T MD20 //Transfer the result from ACCU 1 to memory double word MD20.
Page view 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 271 272

Comments to this Manuals

No comments