Meaning
<result>: Return value
Data type: BOOL
Range of values: 1 Variable available
0 Variable unknown
ISVAR: Checks whether the specified system/user variable is known in the NC.
<Variable>: Name of the system/user variable
Data type: STRING
<n>: Array index of the first dimension (optional)
Data type: INT
<m>: Array index of the second dimension (optional)
Data type: INT
The following checks are made in accordance with the transfer parameter:
● Is the name known?
● Is the variable an array?
● Is it a one- or two-dimensional array?
● Is the respective array index in the permissible range?
Only if all checks are positive, TRUE (1) is returned.
If a check is negative or a syntax error has occurred, FALSE (0) is returned.
Examples
Program code Comment
DEF INT VAR1
DEF BOOL IS_VAR=FALSE
N10 IS_VAR=ISVAR("VAR1") ; IS_VAR is in this case TRUE.
Program code Comment
DEF REAL VARARRAY[10,10]
DEF BOOL IS_VAR=FALSE
N10 IS_VAR=ISVAR("VARARRAY[,]") ; IS_VAR is in this case TRUE, is a two-di-
mensional array.
N20 IS_VAR=ISVAR("VARARRAY") ; IS_VAR is TRUE, variable exists.
N30 IS_VAR=ISVAR("VARARRAY[8,11]") ; IS_VAR is FALSE, array index is not per-
mitted.
N40 IS_VAR=ISVAR("VARARRAY[8,8") ; IS_VAR is FALSE, "]" missing (syntax er-
ror).
N50 IS_VAR=ISVAR("VARARRAY[,8]") ; IS_VAR is TRUE, array index is permitted.
N60 IS_VAR=ISVAR("VARARRAY[8,]") ; IS_VAR is TRUE, array index is permitted.
Work preparation
3.1 Flexible NC programming
NC programming
426 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0