Work preparation
3.1 Flexible NC programming
Meaning:
<result>:
GETVARTYP:
<name>:
Example:
Program code
DEF INT result=0
DEF STRING name="R"
result=GETVARTYP(name)
IF (result < 0) GOTOF error
The value 4 is returned as result. This corresponds to the REAL data type.
3.1.1.17
Possible type conversions
The constant numeric value, the variable, or the expression assigned to a variable must be
compatible with the variable type. If this is the case, the type is automatically converted when
the value is assigned.
Possible type conversions
from
REAL
INT
BOOL
CHAR
STRING
AXIS
FRAME
432
Data type of the specified system/user variables
Data type:
Range of val‐
ues:
Reading of the data type of a system/user variable
Name of the system/user variables
Data type:
to
REAL
INT
yes
Yes*
yes
yes
yes
yes
yes
yes
–
–
–
–
–
–
INT
1
= BOOL
2
= CHAR
3
= INT
4
= REAL
5
= STRING
6
= AXIS
7
= FRAME
In case of fault
< 0
The specified variable name has not been assigned to a sys‐
tem parameter or a user variable.
STRING
Comment
; Determine the type of the R parameter.
BOOL
CHAR
Yes
Yes*
1)
Yes
Yes
1)
2)
yes
yes
Yes
yes
1)
Yes
Yes
4)
3)
–
–
–
–
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
STRING
AXIS
–
–
–
–
yes
–
yes
–
yes
–
–
yes
–
–
NC programming
FRAME
–
–
–
–
–
–
yes