Programming
10.9 Arithmetic parameters (R variables), LUD and PLC variables
Surface grinding
Programming and Operating Manual, 11/2012, 6FC5398-5CP10-3BA0
279
Example:
N10 PVAR7[2]=24
;The third field element (with index 2) is assigned
the value 24.
Value assignment for field with SET instruction:
N20 PVAR5[2]=SET(1,2,3)
;After the 3rd field element, different values are
assigned.
Value assignment for field with REP instruction:
N20 PVAR7[4]=REP(2)
;After field element [4] - all are assigned the same
value, here 2.
10.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, special system variables are provided:
$A_DBB[n]
;Data byte (8-bit value)
$A_DBW[n]
;Data word (16-bit value)
$A_DBD[n]
;Data double-word (32-bit value)
$A_DBR[n]
;REAL data (32-bit value)
"n" stands here for the position offset (start of data area to start of variable) in bytes
Programming example
R1=$A_DBR[5]
;Reading a REAL value, offset 5 (starts at byte 5 of range)
Note
The reading of variables generates a preprocessing stop (internal STOPRE).