3.10.2 Index determination by means of names (NAMETOINT)
User-specific names are entered in the system variable arrays of type STRING. Based on the
identifier of the system variables and the name, the NAMETOINT() function determines the
index value belonging to the name under which it is stored in the system variable array.
Syntax
<RetVal> = NAMETOINT(<SysVar>,<Name>[,<NoAlarm>])
Meaning
NAMETOINT: Determining the system variable index
<SysVar>: Name of the system variable array of typeSTRING
Data type: STRING
Range of val‐
ues:
Name of all NC system variable arrays of type STRING
<Name>: Character string or name for which the system variable index is to be determined.
Data type: STRING
<NoAlarm>: Alarm suppression (optional)
Data type: BOOL
Default value: FALSE
Value Meaning
TRUE In the event of an error, the program processing is not stopped and
no alarm displayed.
Application: User-specific reaction corresponding to the return
value
FALSE In the event of an error (<RetVal> < 0), program processing is
stopped and an alarm displayed.
<RetVal>: System variable index or error message
Data type: INT
Range of val‐
ues:
-1 ≤ x ≤ (max. number of configured components -1)
Value Meaning
≥ 0 The sought name has been found under the specified system
variable index.
-1 The sought name has not been found or an error has occurred.
Example
Program code Comment
DEF INT INDEX
$NP_PROT_NAME[27]="Cover"
...
INDEX = NAMETOINT("$NP_PROT_NAME","Cover") ; INDEX == 27
Work preparation
3.10 Kinematic chains
NC programming
724 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0