Reading And Writing Plc Variables - Siemens sinumerik 802d sl Operation And Programming Manual

Hide thumbs Also See for sinumerik 802d sl:
Table of Contents

Advertisement

Programming
8.7
Arithmetic parameters R, LUD and PLC variables
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 a field having a SET instruction:
N20 PVAR5[2]=SET(1,2,3)
Value assignment for a field having a REP instruction:
N20 PVAR7[4]=REP(2)
value, here 2.
8.7.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 writ-
ten.
To this end, special system variables are provided:
$A_DBB[n]
$A_DBW[n]
$A_DBD[n]
$A_DBR[n]
bytes
Example:
R1=$A_DBR[5] ; Read REAL value, offset 5 (starts at byte 5 of the range)
Information
S The reading of variables generates a preprocessing stop (internal STOPRE).
S A maximum of 3 variables can be written simultaneously (in a block).
8-178
; Data byte (8-bit value)
; Data word (16-bit value)
; Data double-word (32-bit value)
; REAL data (32-bit value)
"n" stands for the position offset (beginning of data area to beginning of variable) in
SINUMERIK 802D sl Operation and Programming Nibbling (BP-N), 06/2006 Edition
; The third field element (with index 2) is assigned the value of 24.
; From the 3rd field element on, different values are assigned.
; Starting from field element [4], all elements are assigned the same
6FC5 398-3CP10-0BA0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents