Panasonic FP Series Programming Manual page 694

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F334_FRINT
The function rounds off the decimal part of the real number data and returns it at output d.
Description
If the first post-decimal digit is between 0..4, the pre-decimal value is rounded down. If the first
post-decimal digit is between 5..9, the pre-decimal value is rounded up.
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
Availability of F334_FRINT (see page 1324)
PLC types
Data types
Variable
Data type
REAL
s
REAL
d
Operands
For
DWX DWY DWR
s
d
Error flags
No.
IEC address
%MX0.900.7
R9007
%MX0.900.8
R9008
%MX0.900.11
R900B
%MX0.900.9
R9009
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
In this example, the input variable input_value is declared. However, you can write a constant
directly at the input contact of the function instead.
Body
When the variable start is set to TRUE, the function is carried out. It rounds off the input_value =
1234.567 after the decimal point and returns the result (here: 1235.000) at the variable
output_value.
Rounding the first decimal point off
Function
source
destination
Relay
DWL
DSV
-
DWY DWR
DWL
DSV
Set
permanently
for an instant
to TRUE
for an instant
T/C
Register
DEV
DDT
DLD
DFL
DEV
DDT
DLD
DFL
If
 the value at input s is not a REAL
number.
 the result is 0.
 the result causes an overflow.
Conversion instructions
Constant
dec. or hex.
-
693

Advertisement

Table of Contents
loading

Table of Contents