Flexible NC programming
1.10 String operations
Job planning
1-28 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
1.10.2 Type conversion of STRING
Function
The NUMBER function converts from STRING to REAL.
If ISNUMBER returns the value FALSE, the CALL of NUMBER with the same parameter will
issue an alarm.
The AXNAME function converts a string to data type AXIS. An alarm is output if the string
cannot be assigned to any configured axis identifier.
Programming
Syntax
REAL_ERG = NUMBER (STRING) Result type: REAL
BOOL_ERG = ISNUMBER (STRING) Result type: BOOL
AXIS_ERG = AXNAME (STRING) Result type: AXIS
Semantics:
NUMBER (STRING) returns the number represented by the string as a REAL.
ISNUMBER (STRING) returns TRUE, if the string is a valid REAL by the rules of the
language. It is thus possible to check whether the string can be converted to a valid number.
AXNAME (STRING) converts the specified string to an axis identifier.
Example
DEF BOOL BOOL_ERG
DEF REAL REAL_ERG
DEF AXIS AXIS_ERG
BOOL_ERG = ISNUMBER ("1234.9876Ex-7") ;Now: BOOL_ERG == TRUE
BOOL_ERG = ISNUMBER ("1234XYZ") ;Now: BOOL_ERG == FALSE
REAL_ERG = NUMBER ("1234.9876Ex-7") ;Now: REAL_ERG == 1234.9876Ex-7
AXIS_ERG = AXNAME("X") ;Now: AXIS_ERG == X
1.10.3 Concatenation of strings
Function
This functionality puts a string together out of separate components.