Specifications
SIMATIC Instructions
9-127
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Round
The Round instruction converts the real value (IN) to a
double integer value and places the result into the
variable specified by OUT. If the fraction portion is 0.5 or
greater, the number is rounded up.
Error conditions that set ENO = 0: SM1.1 (overflow),
SM4.3 (run-time), 0006 (indirect address)
These instructions affect the following Special Memory
bits: SM1.1 (overflow)
Inputs/Outputs Operands Data Types
IN VD, ID, QD, MD, SMD, AC, LD, HC, Constant, *VD, *AC, SD, *LD REAL
OUT VD, ID, QD, MD, SMD, LD, AC, *VD, *AC, SD, *LD DINT
Truncate
The Truncate instruction converts a 32-bit real number
(IN) into a 32-bit signed integer and places the result into
the variable specified by OUT. Only the whole number
portion of the real number is converted, and the fraction
is discarded.
If the value that you are converting is not a valid real
number or is too large to be represented in the output,
then the overflow bit is set and the output is not affected.
Error conditions that set ENO = 0: SM1.1 (overflow),
SM4.3 (run-time), 0006 (indirect address)
This instruction affects the following Special Memory bits:
SM1.1 (overflow)
Inputs/Outputs Operands Data Types
IN VD, ID, QD, MD, SMD, LD, AC, Constant, *VD, *AC, SD, *LD REAL
OUT VD, ID, QD, MD, SMD, LD, AC, *VD, *AC, SD, *LD DINT
L
A
D
S
T
L
ROUND IN, OUT
F
B
D
ROUND
EN ENO
IN OUT
222 224
333
221
L
A
D
S
T
L
TRUNC IN, OUT
TRUNC
EN
IN OUT
ENO
F
B
D
222 224
333
221