Multiply Integer To Double Integer And Divide Integer With Remainder - Siemens SIMATIC S7-200 System Manual

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

S7-200 Programmable Controller System Manual

Multiply Integer to Double Integer and Divide Integer with Remainder

Multiply Integer to Double Integer
IN1 * IN2 = OUT
IN1 * OUT = OUT
The Multiply Integer to Double Integer instruction (MUL)
multiplies two 16-bit integers and produces a 32-bit product.
In the STL MUL instruction, the least-significant word (16
bits) of the 32-bit OUT is used as one of the factors.
Divide Integer with Remainder
IN1 / IN2 = OUT
OUT / IN1 = OUT
The Divide Integer with Remainder instruction (DIV) divides
two 16-bit integers and produces a 32-bit result consisting of
a 16-bit remainder (the most-significant word) and a 16-bit
quotient (the least-significant word).
In STL, the least-significant word (16 bits) of the 32-bit OUT is used as the dividend.
SM Bits and ENO
For both of the instructions on this page, Special Memory (SM) bits indicate errors and illegal
values. If SM1.3 (divide by zero) is set during a divide operation, then the other math status bits
are left unchanged. Otherwise, all supported math status bits contain valid status upon
completion of the math operation.
Error conditions that set ENO = 0
H SM1.1 (overflow)
H SM1.3 (divide by zero)
H 0006 (indirect address)
Table 6-40
Valid Operands for Multiply Integer to Double Integer and Divide Integer with
Remainder
Inputs/Outputs
IN1, IN2
OUT
Example: Multiply Integer to Double Integer Instruction and Divide Integer with Remainder Instruction
Note: VD100 contains: VW100 and VW102, and VD200 contains: VW200 and VW202.
142
LAD and FBD
STL
LAD and FBD
STL
Data Types
Operands
INT
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AIW, *VD, *LD, *AC,
Constant
DINT
ID, QD, VD, MD, SMD, SD, LD, AC, *VD, *LD, *AC
Network 1
LD
MUL
DIV
Special Memory bits affected
H SM1.0 (zero)
H SM1.1 (overflow)
H SM1.2 (negative)
H SM1.3 (divide by zero)
I0.0
AC1, VD100
VW10, VD200
Multiply Integer to
400
Double Integer
AC1
Divide Integer
4000
with Remainder
VW202
*
200
=
80000
VW102
VD100
rem.
quot.
41
23
97
/
=
VW200
VW202
VW10
VD200

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents