Siemens SINUMERIK 840D sl Programming Manual page 86

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

Advertisement

Flexible NC programming
1.9 String operations
Syntax
<Character>=<string>[<index>]
<Character>=<string_array>[<array_index>,<index>]
<String>[<index>]=<character>
<String_array>[<array_index>,<index>]=<character>
Meaning
<string>
<character>
<index>
Examples
Example 1: Variable message
Program code
; 0123456789
DEF STRING [50] MESSAGE = "Axis n has reached position"
MESSAGE [6] = "X"
MSG (MESSAGE)
Example 2: Evaluating a system variable
Program code
DEF STRING[50] STRG
...
STRG = $P_MMCA
IF STRG[0] == "E" GOTO ...
Example 3: Parameter transfer "call by value" and "call by reference"
Program code
; 0123456
DEF STRING[50] STRG = "Axis X"
DEF CHAR CHR
...
EXTERN UP_VAL(ACHSE)
86
:
Any string
:
Variable of type CHAR
:
Position of the character within the string.
First character of the string: Index = 0
Range of values: 0 ... (string length - 1)
Comment
; "Axis X has reached position"
Comment
; Buffer for system variable
; Load system variable
; Evaluating the system variable
Comment
;
Definition of subprogram with
"call by value" parameters
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents