EasyManuals Logo
Home>Siemens>Control Systems>SINUMERIK ONE MCP 2400.4c

Siemens SINUMERIK ONE MCP 2400.4c Programming Manual

Siemens SINUMERIK ONE MCP 2400.4c
1334 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 #454 background imageLoading...
Page #454 background image
3.1.4.8 Reading and writing of individual characters
Individual characters can be read and written within a string.
The following supplementary conditions must be observed:
Only possible with user-defined variables, not with system variables
Individual characters of a string are only transferred "call by value" for subprogram calls
Syntax
<Character>=<string>[<index>]
<Character>=<string_array>[<array_index>,<index>]
<String>[<index>]=<character>
<String_array>[<array_index>,<index>]=<character>
Meaning
<string>: Any string
<character>: Variable of type CHAR
<index>: Position of the character within the string.
First character of the string: Index = 0
Range of values: 0 ... (string length - 1)
Examples
Example 1: Variable message
Program code Comment
; 0123456789
DEF STRING [50] MESSAGE = "Axis n has reached position"
MESSAGE [6] = "X"
MSG (MESSAGE) ; "Axis X has reached position"
Example 2: Evaluating a system variable
Program code Comment
DEF STRING[50] STRG ; Buffer for system variable
...
STRG = $P_MMCA ; Load system variable
IF STRG[0] == "E" GOTO ... ; Evaluating the system variable
Example 3: Parameter transfer "call by value" and "call by reference"
Program code Comment
; 0123456
DEF STRING[50] STRG = "Axis X"
DEF CHAR CHR
...
Work preparation
3.1 Flexible NC programming
NC programming
454 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Table of Contents

Other manuals for Siemens SINUMERIK ONE MCP 2400.4c

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SINUMERIK ONE MCP 2400.4c and is the answer not in the manual?

Siemens SINUMERIK ONE MCP 2400.4c Specifications

General IconGeneral
BrandSiemens
ModelSINUMERIK ONE MCP 2400.4c
CategoryControl Systems
LanguageEnglish

Related product manuals