Flexible NC programming
1.10 String operations
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
1-33
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] Result type: CHAR
CHAR_ERG = STRINGARRAY [IDX_FELD, IDX_CHAR] Result type: 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) ;returns message "Axis X has
reached position"
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] ;Evaluation of acknowledgment component