Reading Attribute Values / Data Type (Getvarphu, Getvarap, Getvarlim, Getvardim, Getvardft, Getvartyp) - Siemens SINUMERIK 840D sl Programming Manual

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Program code
DEF BOOL IS_VAR=FALSE
N100 IS_VAR=ISVAR("$MC_GCODE_RESET_VALUES[1]"
Program code
DEF BOOL IS_VAR=FALSE
N10 IS_VAR=ISVAR("$P_EP")
N20 IS_VAR=ISVAR("$P_EP[X]")
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>:
GETVARPHU:
<name>:
Example:
The NC contains the following GUD variables:
DEF CHAN REAL PHU 42 LLI 0 ULI 10000 electric
Program code
DEF INT result=0
result=GETVARPHU("electric")
IF (result < 0) GOTOF error
The value 42 is returned as result. This corresponds to the physical unit [kW].
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
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
Reading of the physical unit of a system/user variable
Name of the system/user variables
Data type:
STRING
3.1 Flexible NC programming
Comment
; Transfer parameter is a machine
data item, IS_VAR is TRUE.
Comment
; IS_VAR is in this case TRUE.
; IS_VAR is in this case TRUE.
The specified variable name has not been assigned to a
system parameter or a user variable.
Comment
; Determine the physical unit of the GUD var-
iables.
Work preparation
427

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents