Siemens SINUMERIK 840Di Function Manual page 1171

Basic machine
Hide thumbs Also See for SINUMERIK 840Di:
Table of Contents

Advertisement

FUNCTION FC 99: VOID
T
L
LAR1 ;
AUF DB [#dbchr];
L B [AR1,P#40.0];
L
LAR1 ;
L
T
L
T
L
T
L
LAR1 ;
OPEN
L
2.14.3.3
Use of POINTER and ANY in FB if POINTER or ANY is available as parameter
Description of functions
FB 99 has inputs parameters that are defined as POINTER or ANY. The example shows a
body program via which the subcomponents of the POINTER or ANY can be accessed. In
this case, the DB parameterized with POINTER or ANY is opened and the address offset
stored as a cross area pointer in address register AR1, thus allowing access to data
elements of variables (generally structures and arrays) that are addressed via the POINTER,
ANY. This access operation is described at the end of the relevant program sequence in the
example. With data type ANY, it is also possible to execute a check or branch when the
variable is accessed based on the data type and the number of elements involved.
FUNCTIONBLOCK FB 99
VAR_INPUT
Row : BYTE ;
Convert : BOOL ;
Addr: POINTER;
Addr1 : ANY ;
END_VAR
VAR_TEMP
Power Line Basic PLC Program (P3)
Function Manual, 08/2005 Edition, 6FC5397-0BP10-0BA0
#dbchr;
D [AR1,P#2.0];
P##Addr1;
B [AR1,P#1.0];
#typ;
W [AR1,P#2.0];
#Amount;
W [AR1,P#4.0];
#dbchr;
D [AR1,P#6.0];
DB [#dbchr];
B [AR1,P#0.0];
//Activate numerical conversion
//Points to variable
2.14 Useful tips on programming with STEP 7
Comment
//Offset part of pointer
//Open DB of variables
//Retrieve byte value using pointer with
//address offset 40
//ANY
//Retrieve ANY
//Retrieve type
//Retrieve amount
//Retrieve DB number
//Offset part of pointer
//Open DB of variables
//Retrieve byte value using ANY
Comment
Detailed description
2-259

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents