Selection Of A Single Character - Siemens SINUMERIK 840D sl Programming Manual

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

Advertisement

1.10.8

Selection of a single character

Function
This functionality selects a single character from a string. This applies both to read access
and write access operations.
Programming
Syntax
CHAR_ERG = STRINGVAR [IDX]
CHAR_ERG = STRINGARRAY [IDX_FELD, IDX_CHAR]
semantics
The character at the specified position is read/written within the string. If the position
parameter is negative or greater than the string, then an alarm is output.
Example messages:
Insertion of an axis identifier into a prepared string.
DEF STRING [50] MESSAGE = "Axis n has
reached position"
MESSAGE [6] = "X"
MSG (MESSAGE)
Parameters
Single character access is possible only to user-defined variables
(LUD, GUD, and PUD data).
This type of access is also possible only for "call-by-value" type parameters in subroutine
calls.
Example: single character access to a system, machine data, ...:
DEF STRING [50] STRG
DEF CHAR ACK
...
STRG = $P_MMCA
ACK = STRG [0]
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Flexible NC programming
Result type: CHAR
Result type: CHAR
;returns message "Axis X has
reached position"
;Evaluation of acknowledgment component
1.10 String operations
1-33

Advertisement

Table of Contents
loading

Table of Contents