Siemens SINUMERIK 802D Programming And Operating Manual page 307

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

Advertisement

DEF STRING[string length]
varname41
Each data type requires its own program line. However, several variables of the same type
can be defined in one line.
Example:
DEF INT PVAR1, PVAR2, PVAR3=12, PVAR4
Example for STRING type with assignment:
DEF STRING[12] PVAR="Hello"
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
elements.
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)
Cylindrical grinding
Programming and Operating Manual, 07/2009, 6FC5398-4CP10-2BA0
10.9 Arithmetic parameters, LUD and PLC variables
;(8 decimal places, arithmetic sign and decimal point)
or
;Exponential notation: ± (10 to power of -300 ... 10 to
power of +300)
; STRING type, [string length]: Maximum number of
characters
;4 type INT variables
; Define variable PVAR with a maximum of
12 characters and assign string "Hello"
;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.
Programming
307

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents