1Use Of Pointer And Any In Fc - Siemens SINUMERIK 828D Function Manual

Hide thumbs Also See for SINUMERIK 828D:
Table of Contents

Advertisement

13.15.2.1 Use of POINTER and ANY in FC
Function
FC 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.
Example
Code
FUNCTION FC 99: VOID
VAR_INPUT
Row : BYTE ;
Convert : BOOL ;
Addr: POINTER;
Addr1 : ANY ;
END_VAR
VAR_TEMP
dbchr : WORD ;
Number: WORD ;
type : BYTE ;
END_VAR
BEGIN
NETWORK
TITLE =
L
LAR1 ;
L
T
L
LAR1 ;
AUF DB [#dbchr];
L B [AR1,P#40.0];
L
LAR1 ;
L
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
P##Addr;
W [AR1,P#0.0];
#dbchr;
D [AR1,P#2.0];
P##Addr1;
B [AR1,P#1.0];
P3: Basic PLC Program for SINUMERIK 840D sl
13.15 Programming tips with STEP 7
Comment
//Activate numerical conversion
//Points to variable
//POINTER
//Retrieve pointer
//Retrieve DB number
//Offset part of pointer
//Open DB of variables
//Retrieve byte value using pointer with
//address offset 40
//ANY
//Retrieve ANY
//Retrieve type
1077

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840d sl

Table of Contents