Note
GETVARPHU can be used, for example, to check whether both variables have the expected
physical units in a variable assignment a = b.
Read access right
Syntax:
<Result>=GETVARAP(<name>,<access>)
Meaning:
<result>: Protection level for the specified <access>
Data type: INT
Range of val‐
ues:
0 ... 7 See "Attribute: Access rights (APR, APW, APRP, APWP,
APRB, APWB) (Page 412)".
In case of fault
- 1 Cannot be written (only relevant for access types "WP"
and "WB")
- 2 The specified variable name has not been assigned to a
system parameter or a user variable.
- 3 Incorrect value for the parameter <access>
GETVARAP: Reading of the access right to a system/user variable
<name>: Name of the system/user variables
Data type: STRING
<access>: Type of access
Data type: STRING
Range of val‐
ues:
"RP" Read via part program
"WP" Write via part program
"RB" Read via OPI
"WB" Write via OPI
Example:
Program code Comment
DEF INT result=0
result=GETVARAP("$TC_MAP8","WB") ; Determine the access protection for the sys-
tem parameter "magazine position" with regard
to writing via OPI.
IF (result < 0) GOTOF error
The value 7 is returned as result. This corresponds to the key switch position 0 (= no access
protection).
Work preparation
3.1 Flexible NC programming
NC programming
428 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0