1
Flexible NC Programming 04.00
1.10 Strin
o
erations
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
1-48
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
Conversion from STRING
The NUMBER function converts from STRING to REAL.
If ISNUMBER returns the value FALSE, an alarm is
output when NUMBER is CALLED with the same
parameter.
A string can be converted to data type AXIS with the
AXNAME function. An alarm is output if the string
cannot be assigned to any configured axis identifier.
Syntax
BOOL_ERG = ISNUMBER (STRING)
Result type: BOOL
REAL_ERG = NUMBER (STRING)
Result type: REAL
STRING_ERG = AXSTRING (AXIS)
Result type: STRING
AXIS_ERG = AXNAME (STRING)
Result type: AXIS
Semantics:
ISNUMBER (STRING) returns TRUE if the string
represents a semantically valid REAL number. It is
thus possible to check whether the string can be
converted to a valid number.
NUMBER (STRING) returns the value represented
by the string as a REAL value.
AXSTRING (AXIS) supplies the specified axis
identifier as a string.
AXNAME (STRING) converts the specified string
into an axis identifier.
Examples
DEF BOOL BOOL_ERG
DEF REAL REAL_ERG
DEF AXIS AXIS_ERG
DEF STRING[32] STRING_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
STRING_ERG = AXSTRING(X)
;now: STRING_ERG == "X"
AXIS_ERG = AXNAME("X")
;now: AXIS_ERG == X