Flexible NC programming
1.3 Array definitions (DEF, SET, REP)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
1-9
Note
Variables of type FRAME are permissible and can be initialized very simply in this way.
Parameters
DEF Variable type Array definition
SET VALUE or expression Initialization with value lists for the array
definition or in the program execution
REP VALUE or expression Initialization with the same values for the array
definition or in the program execution
CHAR NAME[n,m]
INT NAME[n,m]
REAL NAME[n,m]
AXIS NAME[n,m]
FRAME NAME[n,m]
BOOL[n,m]
Variable type (CHAR, INTEGER, REAL, AXIS, FRAME, BOOL)
STRING[string_length]
NAME[m]
Data type STRING can only be defined for 1-dimensional
arrays.
The string length is specified after the data type
String.
NAME Variable name
Type VARIABLE Variable type (CHAR, INTEGER, REAL, AXIS, FRAME, BOOL)
ARRAY[n,m]= SET(value,
value,…)
Initialization of all elements of an array with the
listed values for the array definition
TYPE ARRAY[n,m] = REP(value) Initialization of all elements of an array with the
same value for the array definition
ARRAY[n,m]= SET(value,
value,…)
ARRAY[n,m]=
SET(expression,…)
Initialization of all elements of an array with the
listed values in the program execution
ARRAY[n,m]= REP(value)
ARRAY[n,m]= REP(expression)
Initialization of all elements of an array with the
same value in the program execution
ARRAY[n, m] Array index
n Array size for 1st dimension
m Array size for 2nd dimension
Maximum array size e.g. DEF INT NAME[32767]
Arrays with variables of type STRING can only be 1-dimensional.
Array_index [n,m]
Elements of an array are accessed via the array index. The array elements can either be
read or assigned values using this array index.
The first array element starts with index [0,0]; for example, for array size [3,4] the maximum
possible array index is [2,3].