1
04.00 Flexible NC Programming
1.9 Possible t
e conversions
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
1-45
1.9 Possible type conversions
Type conversion on assignment
The constant numeric value, variable or expression
assigned to a variable must be compatible with the
type of this variable. If this is this case, the type is
automatically converted when the value is assigned.
Possible type conversions
to
from
REAL INT BOOL CHAR STRING AXIS FRAME
REAL yes yes* yes
1)
yes* –––
INT yes yes yes
1)
yes
2)
–––
BOOL yes yes yes yes yes ––
CHAR yes yes yes
1)
yes yes ––
STRING ––yes
4)
yes
3)
yes ––
AXIS –––––yes –
FRAME ––––––yes
* On type conversion from REAL to INT, a fraction
>= 0.5 is rounded up, otherwise the fraction is
rounded down (same effect as ROUND function)
1)
Values <> 0 are TRUE, values == 0 are FALSE
2)
If the value is in the permitted value range
3)
If only 1 character
4)
String length 0 = FALSE, otherwise TRUE
If a value is greater than the target range on
conversion, an error message is generated.
Additional notes
If mixed types occur in an expression, a type
conversion is performed automatically.