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
259
Example 2 transfer an ANY parameter constructed earlier to another FB (FC)
An ANY parameter that has already been compiled must be transferred to another FB (FC).
This can be done only by means of an ANY stored in VAR_TEMP
FUNCTIONBLOCK FB 100
Comment
VAR_INPUT
DBNumber: INT ;
DBOffset : INT ;
Data type: INT ;
Number: INT ;
END_VAR
VAR_TEMP
dbchr : WORD ;
Temp_addr : ANY ;
END_VAR
BEGIN
NETWORK
TITLE =
L
P##Temp_addr;
LAR1 ;
//Retrieve pointer from VAR_TEMP
L
B#16#10;
//ANY identifier
T
LB [AR1,P#0.0];
L
Data type;
T
LB [AR1,P#1.0];
L
Amount;
T
LW [AR1,P#2.0];
L
DBNumber;
T
LW [AR1,P#4.0];
L
DBOffset;
SLD 3;
//Offset is a bit offset
T
LD [AR1,P#6.0];
CALL FB 101, DB 100
(ANYPAR := #Temp_addr);
//ANYPAR is data type ANY
2.14.4
Multiinstance DB
With version 7 and higher of STEP 7, FBs might have a multiinstance capability, i.e., they
might incorporate multiinstance DBs. The primary characteristic of multiinstance DBs is that
a block can be used for various instances of FBs (see STEP 7 documentation). As such, the
quantity structure of the DBs can be optimized.
Multi-instance DBs should be activated only when they are actually going to be used since
they increase the runtime and code size of the FBs.
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 ...