Detailed description
2.14 Programming tips with STEP 7
Basic logic functions: PLC basic program solution line (P3 sl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
257
FUNCTIONBLOCK FB 99
Comment
L
P##Addr;
LAR1 ;
//Retrieve pointer from instance DB
L
DIW [AR1,P#0.0];
//Retrieve DB number
T
#dbchr;
L
DID [AR1,P#2.0];
//Offset part of pointer
LAR1 ;
OPEN
DB [#dbchr];
//Open DB of variables
L
B [AR1,P#40.0];
//Retrieve byte value using pointer with
//address offset 40
//ANY
L
P##Addr1;
LAR1 ;
//Retrieve ANY from instance DB
//Retrieve ANY from instance DB
L
DIB [AR1,P#1.0];
//Retrieve type
T
#typ;
L
DIW [AR1,P#2.0];
//Retrieve amount
T
#Amount;
L
DIW [AR1,P#4.0];
//Retrieve DB number
T
#dbchr;
L
DID [AR1,P#6.0];
//Offset part of pointer
LAR1 ;
OPEN
DB [#dbchr];
//Open DB of variables
L
B [AR1,P#0.0];
//Retrieve byte value using ANY
2.14.3.4
POINTER or ANY variable for transfer to FC or FB
With version 1 or later of STEP7 it is possible to define a POINTER or an ANY in
VAR_TEMP. The following two examples show how an ANY can be supplied.
Example 1 Transfer ANY parameter via a selection list to another FB (FC)
Several ANY parameters are defined in an FB (FC). A specific ANY parameter must now be
chosen from a selection list for transfer to another FB (FC). This can only be done by means
of an ANY in VAR_TEMP. 1 to 4 can be set in parameter "WhichAny" in order to select
Addr1 to Addr4.
Note
Address register AR2 is used in the block. However, this address register AR2 is also used
for multiinstance DBs. For this reason, this FB should not be declared as multi-instance DB.
Summary of Contents for SINUMERIK 840D sl
Page 282: ...Index Basic logic functions Acceleration B2 64 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 388: ...Basic logic functions Travel to fixed stop F1 Function Manual 11 2006 6FC5397 0BP10 2BA0 52 ...
Page 962: ...Index Basic logic functions Emergency Stop N2 20 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 1704: ...Constraints Basic logic functions Spindles S1 94 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 1716: ...Index Basic logic functions Spindles S1 106 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 1996: ...Index Basic logic functions Tool Offset W1 208 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 2150: ...Table of contents Basic logic functions Appendix 4 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 2184: ...Glossary Basic logic functions Appendix 38 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...