Type Conversion Of String; Concatenation Of Strings - Siemens SINUMERIK 840D sl Programming Manual

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

Advertisement

Flexible NC programming
1.10 String operations
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)
BOOL_ERG = ISNUMBER (STRING)
AXIS_ERG = AXNAME (STRING)
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")
BOOL_ERG = ISNUMBER ("1234XYZ")
REAL_ERG = NUMBER ("1234.9876Ex-7")
AXIS_ERG = AXNAME("X")
1.10.3

Concatenation of strings

Function
This functionality puts a string together out of separate components.
1-28
Result type: REAL
Result type: BOOL
Result type: AXIS
;Now: BOOL_ERG == TRUE
;Now: BOOL_ERG == FALSE
;Now: REAL_ERG == 1234.9876Ex-7
;Now: AXIS_ERG == X
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Job planning

Advertisement

Table of Contents
loading

Table of Contents