String Operations; Type Conversion To String (Axstring) - Siemens SINUMERIK 840D sl Programming Manual

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Flexible NC programming

1.9 String operations

1.9
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 78)
● Type conversion from STRING (NUMBER, ISNUMBER, AXNAME) (Page 79)
● Concatenation of strings (<<) (Page 81)
● Conversion to lower/upper case letters (TOLOWER, TOUPPER) (Page 82)
● Determine length of string (STRLEN) (Page 83)
● Search for character/string in the string (INDEX, RINDEX, MINDEX, MATCH) (Page 83)
● Selection of a substring (SUBSTR) (Page 85)
● Reading and writing of individual characters (Page 85)
● Formatting a string (SPRINT) (Page 87)
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)
1.9.1

Type conversion to STRING (AXSTRING)

Function
Using the function "type conversion to STRING" variables of different types can be used as a
component of a message (MSG).
When using the << operator this is realized implicitly for data types INT, REAL, CHAR and
BOOL (see "Concatenation of strings (<<) (Page 81)")..
An INT value is converted to normal readable format. REAL values convert with up to 10
decimal places.
Type AXIS variables can be converted to STRING using the
78
Comment
; Supplies the message "axis X
stationary".
; Supplies the message "axis".
command.
AXSTRING
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents