MUL: Multiply (S7-1200, S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
MUL: Multiply

Description

You can use the "Multiply" instruction to multiply the value at input IN1 with the value at input IN2 and query the total at output OUT (OUT := IN1*IN2).

In its initial state the instruction box contains at least 2 inputs (IN1 and IN2). The number of inputs can be extended. The inserted inputs are numbered in ascending order in the box. When the instruction is executed, the values of all available input parameters are multiplied. The product is stored at the OUT output.

The enable output ENO has the signal state "0" if one of the following conditions applies:

  • Enable input EN has the signal state "0".

  • The result is outside the range permitted for the data type specified at output OUT.

  • A floating-point number has an invalid value.

Parameters

The following table shows the parameters of the instruction "Multiply":

Parameters

Declaration

Data type

Memory area

Description

S7-1200

S7-1500

EN

Input

BOOL

I, Q, M, D, L or constant

I, Q, M, D, L, T, C or constant

Enable input

ENO

Output

BOOL

I, Q, M, D, L

I, Q, M, D, L

Enable output

IN1

Input

Integers, floating-point numbers

I, Q, M, D, L, P or constant

I, Q, M, D, L, P or constant

First value for multiplication

IN2

Input

Integers, floating-point numbers

I, Q, M, D, L, P or constant

I, Q, M, D, L, P or constant

Second value for multiplication

INn

Input

Integers, floating-point numbers

I, Q, M, D, L, P or constant

I, Q, M, D, L, P or constant

Optional input values, which are multiplied.

OUT

Output

Integers, floating-point numbers

I, Q, M, D, L, P

I, Q, M, D, L, P

Product

You can select the data type of the instruction from the "???" drop-down list of the instruction box.

For additional information on valid data types, refer to "See also".

Example

The following example shows how the instruction works:

If the "TagIn" operand has signal state "1", the instruction is executed. The value of operand "Tag_Value1" is multiplied with the value of operand "Tag_Value2". The result of the multiplication is stored in the operand "Tag_Result". If the instruction is executed without errors, the enable output ENO has the signal state "1" and the "TagOut" output is set.