String Operations - Siemens SINUMERIK 840D sl Programming Manual

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Example 2: ROUNDUP in the NC program
Program code
N10 X=ROUNDUP(3.5) Y=ROUNDUP(R2+2)
N15 R2=ROUNDUP($AA_IM[Y])
N20 WHEN X=100 DO Y=ROUNDUP($AA_IM[X])
...
3.1.4

String operations

Sting operations
In addition to the classic operations "assign" and "comparison" the following string operations
are possible:
● Type conversion to STRING (AXSTRING) (Page 448)
● Type conversion from STRING (NUMBER, ISNUMBER, AXNAME) (Page 448)
● Concatenation of strings (<<) (Page 449)
● Conversion to lower/upper case letters (TOLOWER, TOUPPER) (Page 450)
● Determine length of string (STRLEN) (Page 451)
● Search for character/string in the string (INDEX, RINDEX, MINDEX, MATCH) (Page 452)
● Selection of a substring (SUBSTR) (Page 453)
● Reading and writing of individual characters (Page 454)
● Formatting a string (SPRINT) (Page 455)
Special significance of the 0 character
Internally, the 0 character is interpreted as the end identifier of a string. If a character is replaced
with the 0 character, the string is truncated.
Example:
Program code
DEF STRING[20] STRG="axis . stationary"
STRG[6]="X"
MSG(STRG)
STRG[6]=0
MSG(STRG)
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
3.1 Flexible NC programming
Comment
; Supplies the message "axis X sta-
tionary".
; Supplies the message "axis".
Work preparation
447

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents