Siemens SINUMERIK 840D sl Function Manual page 1531

Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

FUNCTIONBLOCK FB 99
L
LAR1 ;
L
T
L
LAR1 ;
OPEN
L
//address offset 40
L
LAR1 ;
L
T
L
T
L
T
L
LAR1 ;
OPEN
L
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.
Basic logic functions: PLC basic program solution line (P3 sl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
P##Addr;
DIW [AR1,P#0.0];
#dbchr;
DID [AR1,P#2.0];
DB [#dbchr];
B [AR1,P#40.0];
P##Addr1;
//Retrieve ANY from instance DB
DIB [AR1,P#1.0];
#typ;
DIW [AR1,P#2.0];
#Amount;
DIW [AR1,P#4.0];
#dbchr;
DID [AR1,P#6.0];
DB [#dbchr];
B [AR1,P#0.0];
2.14 Programming tips with STEP 7
Comment
//Retrieve pointer from instance DB
//Retrieve DB number
//Offset part of pointer
//Open DB of variables
//Retrieve byte value using pointer with
//ANY
//Retrieve ANY from instance DB
//Retrieve type
//Retrieve amount
//Retrieve DB number
//Offset part of pointer
//Open DB of variables
//Retrieve byte value using ANY
Detailed description
257

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840di slSinumerik 840dSinumerik 840diSinumerik 810dSinumerik 840d powerlineSinumerik 840de powerline ... Show all

Table of Contents