Reading And Writing Plc Variables - Siemens SINUMERIK 802D sl Programming And Operating Manual

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

Advertisement

Programming
3.9 Arithmetic parameters, LUD and PLC variables
Fields
In addition to the individual variables, one or two-dimensional fields of variables of these data
types can also be defined:
DEF INT PVAR5[n]
DEF INT PVAR6[n,m]
Example:
DEF INT PVAR7[3]
Within the program, the individual field elements can be reached via the field index and can
be treated like individual variables. The field index runs from 0 to a small number of the ele-
ments.
Example:
N10 PVAR7[2]=24
Value assignment for field with SET instruction:
N20 PVAR5[2]=SET(1,2,3)
Value assignment for field with REP instruction:
N20 PVAR7[4]=REP(2)
3.9.3

Reading and writing PLC variables

Functionality
To allow rapid data exchange between NC and PLC, a special data area exists in the PLC
user interface with a length of 512 bytes. In this area, PLC data are compatible in data type
and position offset.
In the NC program, these compatible PLC variables can be read or written. To this end, spe-
cial system variables are provided:
$A_DBB[n]
$A_DBW[n]
$A_DBD[n]
3-76
; one-dimensional field, type INT, n: integer
; two-dimensional field, type INT, n, m: integer
; Field with 3 elements of the type INT
; The third field element (with index 2) is assigned
the value 24.
; After the 3rd field element, different values are
assigned.
; After field element [4] - all are assigned the same
value, here 2.
; data byte (8-bit value)
; data word (16-bit value)
; data double-word (32-bit value)
Programming and Operating manual, 06/2006, 6FC5398-4CP10-0BA0
Grinding

Advertisement

Table of Contents
loading

Table of Contents