Type Conversions - Siemens SINUMERIK 828D Function Manual

Synchronized actions
Hide thumbs Also See for SINUMERIK 828D:
Table of Contents

Advertisement

Detailed description
2.3 System variables for synchronized actions
2.3.3

Type conversions

An implicit type conversion is performed between the following data types for value
assignments and parameter transfers with different data types:
● REAL
● INT
● BOOL
Examples
Conversion: INT $AC_MARKER → REAL $AC_PARAM
Program code
$AC_MARKER[1]=561
ID=1 WHEN TRUE DO $AC_PARAM[1] = $AC_MARKER[1]
Conversion: REAL $AC_PARAM → INT $AC_MARKER
Program code
$AC_PARAM[1]=561.0
ID=1 WHEN TRUE DO $AC_MARKER[1] = $AC_PARAM[1]
22
Note
Conversion REAL to INT
For the conversion from REAL to INT, a decimal place value ≧ 0.5 rounded up to the next
higher integer. For a decimal place value < 0.5, rounding is to the next lower integer.
Behavior in accordance with the
If the REAL value is outside the INT value range, an alarm is displayed and a conversion
is not performed.
Conversion from REAL or INT to BOOL
• Value <> 0 → TRUE
• Value == 0 → FALSE
function.
ROUND
Function Manual, 07/2012, 6FC5397-5BP40-3BA0
Synchronized actions

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840d slSinumerik 840de sl

Table of Contents