Work preparation
3.10 Kinematic chains
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:
<SysVar>:
<Name>:
<NoAlarm>:
<RetVal>:
Example
Program code
DEF INT INDEX
$NP_PROT_NAME[27]="Cover"
...
INDEX = NAMETOINT("$NP_PROT_NAME","Cover")
724
Determining the system variable index
Name of the system variable array of typeSTRING
Data type:
STRING
Range of val‐
Name of all NC system variable arrays of type STRING
ues:
Character string or name for which the system variable index is to be determined.
Data type:
STRING
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.
System variable index or error message
Data type:
INT
Range of val‐
-1 ≤ x ≤ (max. number of configured components -1)
ues:
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.
Comment
; INDEX == 27
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming