Siemens SIMATIC S7-1200 Manual page 101

Easy book
Hide thumbs Also See for SIMATIC S7-1200:
Table of Contents

Advertisement

Table 6- 4
Round and Truncate instructions
LAD / FBD
SCL
out := ROUND (in);
out := TRUNC(in);
Table 6- 5
Ceiling (CEIL) and Floor instructions
LAD / FBD
SCL
out := CEIL(in);
out := FLOOR(in);
Table 6- 6
SCALE_X and NORM_X instructions
LAD / FBD
SCL
out := SCALE_X(
or
out := value (max-min) + min;
out := NORM_X(
or
out := (value-min)/(max-min);
Easy Book
Manual, 11/2011, A5E02486774-04
Description
Converts a real number (Real or LReal) to an integer. The real number
fraction is rounded to the nearest integer value (IEEE - round to
nearest). If the number is exactly one-half the span between two
integers (for example, 10.5), then the number is rounded to the even
integer. For example:
Converts a real number (Real or LReal) to an integer. The fractional
part of the real number is truncated to zero (IEEE - round to zero).
Description
Converts a real number (Real or LReal) to the closest integer greater
than or equal to the selected real number (IEEE "round to +infinity").
Converts a real number (Real or LReal) to the closest integer smaller
than or equal to the selected real number (IEEE "round to -infinity").
min,:=_undef_in_
value:=_real_in_,
max:=undef_in_);
min:=_,undef_in_
value:=_undef_in_,
max:=_undef_in_);
6.3 Powerful instructions make programming easy
ROUND (10.5) = 10
ROUND (11.5) = 12
Description
Scales the normalized real parameter VALUE where ( 0.0
<= VALUE <= 1.0 ) in the data type and value range
specified by the MIN and MAX parameters:
OUT = VALUE (MAX - MIN) + MIN
Normalizes the parameter VALUE inside the value range
specified by the MIN and MAX parameters:
OUT = (VALUE - MIN) / (MAX - MIN),
where ( 0.0 <= OUT <= 1.0 )
Programming made easy
101

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents