Meaning:
<result>: Data type of the specified system/user variables
Data type: INT
Range of val‐
ues:
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.
GETVARTYP: Reading of the data type of a system/user variable
<name>: Name of the system/user variables
Data type: STRING
Example:
Program code Comment
DEF INT result=0
DEF STRING name="R"
result=GETVARTYP(name) ; Determine the type of the R parameter.
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
to REAL INT BOOL CHAR STRING AXIS FRAME
from
REAL yes Yes* Yes
1)
Yes* – – –
INT yes yes Yes
1)
Yes
2)
– – –
BOOL yes yes yes yes yes – –
CHAR yes yes Yes
1)
yes yes – –
STRING – – Yes
4)
Yes
3)
yes – –
AXIS – – – – – yes –
FRAME – – – – – – yes
Work preparation
3.1 Flexible NC programming
NC programming
432 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0