Siemens sinumerik 840d Programming Manual page 52

Hide thumbs Also See for sinumerik 840d:
Table of Contents

Advertisement

Flexible NC Programming
1
1.10 String operations
840D
840D
NCU 571
NCU 572
NCU 573
INDEX
searches from beginning of first parameter for character specified as second
parameter.
RINDEX
searches from end of first parameter for character specified as second parameter.
MINDEX
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.
MATCH
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) ("/").
Programming example
Example of how to break down an input into path
and module name:
DEF INT PATHIDX, PROGIDX
DEF STRING[26] 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,
PROGIDX-PATHIDX-1)
VARIABLE = SUBSTR (INPUT, PROGIDX)
1-52
FM-NC
810D
840Di
+ 1
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
"Module":
Then supplies "_N_MPF_DIR"
Then supplies "_N_EXECUTE_MPF"
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA) − 04.00 Edition
04.00
1
 Siemens AG 2000. All rights reserved

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik fm-ncSinumerik 840diSinumerik 810d

Table of Contents