July 26, 2020

Explain MOD (modulo) instruction in the PLC.

Explain MOD (modulo) instruction in the PLC.

Application:-Understand the concept of MOD instruction in the PLC. Write the PLC program using ladder diagram language to understand the concept.

Diagram:-






Explanation:-

The MOD instruction is used to divide the stored value in source A by the value stored in source B. After division, it stores the remainder in the destination.

For example Source value is 7 and source B value is 2

Then the remainder is Source A /Source B=7/2=1 (Remainder value).

PLC program:-

Write the ladder program for MOD instruction using ladder diagram language. Here for ladder logic we can use any supported PLC system like S7-1200, S7-1500 or any other PLC which can support this instruction. In our application, we have used S7-1200 PLC for reference.

M Memory:-

Source A:-MW10

Source B:-MW12

Remainder:-MW14











PLC program Explanation:-

In network 1, we have used MOD instruction. In this Source, A is divided by source b and the remainder will be stored into MW14 register.





Division of two operands using an example.

Division of two operands using an example.

Application:-DIV instruction in the PLC. Write PLC program for explanation using ladder diagram language.

Components:-Programmable logic controller, HMI panel, Ethernet cable, 24 V DC power source.

Diagram:-






Explanation:-

The subtraction DIV instruction is used for subtraction of two values for any data records to understand this instruction take one example. Consider one RTD sensor, it is giving data of temperature to the programmable logic controller in a standard format and this data is 250 degree (room temperature) so you need to calculate this value and need to divide by a factor of 10 so you will get the actual temperature.

This is a simple example for an explanation. We can use this concept in any application or any data calculation.

 

PLC program:-

Write the ladder program for DIV instruction using ladder diagram language. Here for ladder logic, we can use any supported PLC system like S7-1200, S7-1500, or any other PLC which can support this instruction. In our application, we have used S7-1200 PLC for reference.

M Memory:-

RTD reading:-MW10

Factor:-MW12

Actual value:-MW14


















PLC program Explanation:-

In-network 1 we have taken DIV instruction for our example. RTD sensor is reading data in the MW10 and factor entered in the MW12. Once DIV instruction will be executed, it will show results in the MW14.

Here RTD reading is 250 degree and factor is 10 so it will show 25 (250/10) in the actual temperature.


Multiplication of two operands using MUL instruction in the PLC.

Multiplication of two operands using MUL instruction in the PLC.

Application:-Explain MUL instruction in the PLC. Write PLC program for explanation using ladder diagram language.

Components:-Programmable logic controller, HMI panel, Ethernet cable, 24 V DC power source.

Diagram:-










Explanation:-

The MUL instruction is used for the multiplication of two values for any data records. For example, we want a multiplication of two values. We have taken HMI for entering data, here we have taken value 1 and value 2 are the data fields and result data field will show the result of the instruction.

Once the instruction is executed result will be displayed in the result output field.

 

PLC program:-

Write the ladder program for MUL instruction using ladder diagram language. Here for ladder logic, we can use any supported PLC system like S7-1200, S7-1500, or any other PLC which can support this instruction. In our application, we have used S7-1200 PLC for reference.

M Memory:-

Value 1:-MW10

Value 2:-MW12

Result:-MW14











PLC program Explanation:-

In-network 1 we have taken MUL instruction for multiplication of two different values. Value 1(MW10) will be entered from the HMI and value 2 (MW12) will be entered from the HMI. Instruction is executed and generates output in the MW 14 word.

You can use MUL instruction for any application in which you need to calculate the multiplication of two values.