Special Function Blocks - Siemens CPU 948 Programming Manual

Simatic s5 s5-155u
Table of Contents

Advertisement

2.3.4

Special Function Blocks

Example
Floating point root extractor RAD:GP FB 6
The function block RAD:GP extracts the root of a floating point number
(8-bit exponent and 24-bit mantissa). It forms the square root. The
result is also a floating point number (8-bit exponent and 24-bit
mantissa). The least significant bit of the mantissa is not rounded up or
down.
If applicable, for the rest of the processing, the function block sets the
"radicand negative" identifier.
Numerical range:
Radicand
- 0.1469368 Exp. -38 to +0.1701412 Exp. +39
Root
+0.3833434 Exp.
Function: Y = √   A
Y = SQRT; A = RADI
Calling the function block FB 6:
In the example, the root is extracted from a floating point number that is
located in DD5 of DB 17 with an 8-bit exponent and a 24-bit mantissa. The
result, another 32-bit floating point number, is written to DD 10. Prior to
this, the appropriate data block must be opened. The parameter VZ (parameter
type: Q, data type: BI) indicates the sign of the radicand: VZ = 1 for a
negative radicand.
CPU 948 Programming Guide
C79000-G8576-C848-04
Apart from the function blocks that you program yourself, you can
order standard function blocks as a finished software product. These
contain standard functions for general use (e.g. signalling functions
and sequence control).
Standard function blocks are assigned numbers FB 1 to FB 199.
If you order standard function blocks, remember the special
instructions in the accompanying description (i.e. areas assigned and
conventions etc.).
The standard function blocks for the S5-155U are listed in catalog
ST 57 /11/.
-19 to +0.1304384 Exp. +20
Function Blocks
2 - 33

Advertisement

Table of Contents
loading

Table of Contents