Flexible NC Programming
1.10 String operations
searches from beginning of first parameter for character specified as second
searches from end of first parameter for character specified as second parameter.
corresponds to INDEX function except that a list of characters is transferred (as
string). The index of the first character found in this list is returned.
looks for a string within a string.
Strings can therefore be broken down according to
certain criteria, i.e. at positions with blanks or path
separator (oblique) ("/").
Example of how to break down an input into path
and module name:
DEF INT PATHIDX, PROGIDX
DEF STRING INPUT
DEF INT LISTIDX
INPUT = "/_N_MPF_DIR/_N_EXECUTE_MPF"
LISTIDX = MINDEX (INPUT, "M,N,O,P")
PATHIDX = INDEX (INPUT, "/") +1
PROGIDX = RINDEX (INPUT, "/") +1
VARIABLE = SUBSTR (INPUT, PATHIDX,
VARIABLE = SUBSTR (INPUT, PROGIDX)
3 is returned as the value in LISTIDX;
because "N" is the first character in
parameter INPUT (starting at beginning
of selection list).
; PATHIDX is therefore 1
; PROGIDX = is therefore 12
;Using the SUBSTR function introduced
in the next section, the variable INPUT
can be broken down into "Path" and
Then supplies "_N_MPF_DIR"
Then supplies "_N_EXECUTE_MPF"
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA) − 04.00 Edition
Siemens AG 2000. All rights reserved