Program code Comment
DEF BOOL IS_VAR=FALSE
N100 IS_VAR=ISVAR("$MC_GCODE_RESET_VALUES[1]" ; Transfer parameter is a machine
data item, IS_VAR is TRUE.
Program code Comment
DEF BOOL IS_VAR=FALSE
N10 IS_VAR=ISVAR("$P_EP") ; IS_VAR is in this case TRUE.
N20 IS_VAR=ISVAR("$P_EP[X]") ; IS_VAR is in this case TRUE.
3.1.1.16 Reading attribute values / data type (GETVARPHU, GETVARAP, GETVARLIM,
GETVARDIM, GETVARDFT, GETVARTYP)
The attribute values of system/user variables can be read with the predefined GETVARPHU,
GETVARAP, GETVARLIM, GETVARDIM and GETVARDFT functions, the data type of a
system/user variable with GETVARTYP.
Read physical unit
Syntax:
<Result>=GETVARPHU(<name>)
Meaning:
<result>: Numeric value of the physical unit
Data type: INT
Range of values: See Table in "Attribute: Physical unit (PHU) (Page 410)"
In case of fault
- 2 The specified variable name has not been assigned to a
system parameter or a user variable.
GETVARPHU: Reading of the physical unit of a system/user variable
<name>: Name of the system/user variables
Data type: STRING
Example:
The NC contains the following GUD variables:
DEF CHAN REAL PHU 42 LLI 0 ULI 10000 electric
Program code Comment
DEF INT result=0
result=GETVARPHU("electric") ; Determine the physical unit of the GUD var-
iables.
IF (result < 0) GOTOF error
The value 42 is returned as result. This corresponds to the physical unit [kW].
Work preparation
3.1 Flexible NC programming
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 427