
2.3.4
Special Function Blocks
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/.
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. -19 to +0.1304384 Exp. +20
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.
Function Blocks
CPU 948 Programming Guide
C79000-G8576-C848-04
2 - 33
Содержание CPU 948
Страница 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Страница 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Страница 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Страница 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Страница 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Страница 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Страница 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Страница 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Страница 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Страница 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Страница 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Страница 404: ...Operations with the Base Address Register BR Register CPU 948 Programming Guide 9 34 C79000 G8576 C848 04 ...
Страница 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Страница 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Страница 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Страница 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Страница 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...