EasyManuals Logo

Siemens SINUMERIK 828D Programming Manual

Siemens SINUMERIK 828D
822 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #82 background imageLoading...
Page #82 background image
Flexible NC programming
1.9 String operations
Job planning
82 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
Example
Breaking up an input into path and block names
Program code Comments
DEF INT PFADIDX, PROGIDX
DEF STRING[26] INPUT
DEF INT LISTIDX
INPUT = "/_N_MPF_DIR/_N_EXECUTE_MPF"
LISTIDX = MINDEX (INPUT, "M,N,O,P") + 1 ; The value returned in LISTIDX is 3;
because "N" is the fist character in the
parameter INPUT from the selection list
starting from the beginning.
PFADIDX = INDEX (INPUT, "/") +1 ; Therefore the following applies:
PFADIDX = 1
PROGIDX = RINDEX (INPUT, "/") +1 ; Therefore the following applies:
PROGIDX = 12
The SUBSTR function introduced in the
next section can be used to break-up
variable INPUT in the components "path"
and "module":
VARIABLE = SUBSTR (INPUT, PFADIDX, PROGIDX-PFADIDX-1) ; Then returns "_N_MPF_DIR"
VARIABLE = SUBSTR (INPUT, PROGIDX) ; Then returns "_N_EXECUTE_MPF"
1.9.7 Selection of a substring (SUBSTR)
Function
This functionality extracts a substring from a string. For this purpose, the index of the first
character and the desired string length (if applicable) are specified. If no length information is
specified, then the string data refers to the remaining string.
Syntax
STRING_ERG = SUBSTR (STRING,INT) ; Result type: INT
STRING_ERG = SUBSTR(STRING,INT, INT) ; Result type: INT
Semantics
In the first case, the substring from the position specified by the second parameter is
returned up to the end of the string.
In the second case, the result string is limited to the maximum length, specified by the third
parameter.
If the initial position is after the end of the string, the empty string (" ") will be returned.
If the initial position or the length is negative, an alarm is output.

Table of Contents

Other manuals for Siemens SINUMERIK 828D

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SINUMERIK 828D and is the answer not in the manual?

Siemens SINUMERIK 828D Specifications

General IconGeneral
Control TypeCNC
Operating SystemWindows Embedded
ProcessorIntel Atom
Display10.4" color TFT display
InterfacesEthernet, USB
ProgrammingShopMill, ShopTurn
Operation Panel Size10.4"
Protection ClassIP65
PLC Memory2 MB
Spindle Capacity4 spindles
Hard DriveCompactFlash

Related product manuals