Flexible NC programming
1.9 String operations
Job planning
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
83
Example
Program code Comments
DEF STRING[29] ERG
ERG = SUBSTR ("ACK:10 to 99", 10, 2) ; Therefore the following
applies: ERG == "10"
1.9.8 Selection of a single character (STRINGVAR, STRINGFELD)
Function
This functionality selects a single character from a string. This applies both to read access
and write access operations.
Syntax
CHAR_ERG = STRINGVAR [IDX] ; Result type: CHAR
CHAR_ERG = STRINGFELD [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.
Program code Comments
DEF STRING [50] MESSAGE = "Axis n has reached position"
MESSAGE [6] = "X"
MSG (MESSAGE) ; Returns the 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 subprogram
calls.