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.



















































Subtraction of two operands using subtract instruction in the PLC.

Subtraction of two operands using subtract instruction in the PLC.

Application:-Explain subtraction 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 instruction is used for subtraction of two values for any data records. For example, we want two subtract one value from the second value in the application like weight 1 and weight 2 and we want to show the subtraction of two weight like we want to subtract weight 1 from weight 2 and show on the HMI.

So for that, we have two take two input field in the HMI system and make weight 1 input field and weight 2 input field so the user can enter a value in the input field. And also users can monitor subtraction value in the result field.

PLC program:-

Write the ladder program for subtraction instruction using ladder diagram language. Here for ladder logic, we can use any supported PLC a 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:-

Weight 1:-MW10

Weight 2:-MW12

Actual value:-MW14



















PLC program Explanation:-

In-network 1 we have taken subtraction instruction for the subtraction of two weights. Weight 1(MW10) will be entered from the HMI and weight 2 (MW12) will be entered from the HMI. Instruction is executed and generates output in the MW 14 word. 

Addition of two operands using addition instruction in the PLC.

Addition of two operands using additional instruction in the PLC.

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

Components:-Programmable logic controller, 24 VDC power source.






















Explanation:-

The addition instruction is used for the addition of two values for any data records. For example, we want two add two weight in the application like weight 1 and weight 2 and we want to show the total weight on the HMI also.

So for that, we have two take two input field in the HMI system and make weight 1 input field and weight 2 input field so a user can enter the value in the input field.

PLC program:-

Write the ladder program to calculate instruction using ladder diagram language. Here for ladder logic, we can use any supported PLC a system like S7-1200, S7-1500 or any other PLC which can support this instruction.

M Memory:-

Weight 1:-MW10

Weight 2:-MW12

Total value:-MW14


















PLC program Explanation:-

In-network 1 we have taken additional instruction for the addition of two weights. Weight 1(MW10) will be entered from the HMI and weight 2 (MW12) will be entered from the HMI. Instruction is executed and generates output in the MW 14 word.

You can use addition instruction value for any application in which you can show the addition of two values or more than two values.








Explain to calculate instruction using an example.

Explain to calculate instruction using an example.

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

Components:-Programmable logic controller, HMI panel, 24 VDC power source.
























Explanation:-

Calculation instruction is used to define the calculation of mathematical values. Date type can be set as per the requirements. Siemens S7-1200 and S7-1500 are supporting this instruction. We can make a suitable equation by using this instruction.

For example, consider there are two values and we need to calculate the average value for these two values. In the figure, we can see 50 entered in value 1 box and enter 10 in value 2 box. Take 1 result box as shown in the figure so we can monitor the result of the instruction.

Now link these tags to calculate instruction by giving these addresses in the HMI.

PLC program:-

Write the ladder program to calculate instruction using ladder diagram language. Here for ladder logic, we can use any supported PLC a system like S7-1200, S7-1500 or any other PLC which can support this instruction.

M Memory:-

Value 1:-MW10

Value 2:-MW12

Average Value:-MW14




















PLC program Explanation:-

In-network 1 we have configured calculate instruction for the average value. In this instruction we can select data type in the box (??), here select INT for our requirement. In the box (..) we can define the equation for the calculation.

IN1 (MW10) and IN2 (MW12) are the inputs operands in which we can enter values, here these values will come from the HMI. And OUT is the output operand, here we can monitor the result of the calculation.

Here IN 1=50 and IN2 =10 so average value as per the equation (IN1+IN2/2) is 30 so in a result we will get value 30 in MW 14.






























July 25, 2020

Explain check validity instruction using the example

Explain check validity instruction using the example

Application:-.Write PLC program for an explanation using ladder diagram language in the Programmable Logic Controller (PLC).

Components:-Programmable logic controller, HMI panel, wires, 24 VDC lamp, 24 VDC power source, 24VDC temperature controller.

 

Diagram:-




Explanation:-

Check arability instruction is used to check entered values in the operands. For example, we want to make the multiplication of two values and both values are INT. Here we will check both the entered value are INT and we will ensure these via instruction.


PLC program:-

Write the ladder program for above application using ladder diagram language. Here for ladder logic we can use any supported PLC system like S7-1200, S7-300, S7-1500 or any other PLC which can support this instruction. For PLC logic we need digital inputs and outputs.

For our application lamps are digital outputs. Value 1 and value 2 are input words.

M Memory:-

Value 1:-MD20

Value 2:-MD24


Result: - MD28


















PLC program Explanation:-

In network 1, we have used check avaibility instruction in multiplication, here we are using MUL instruction for multiplication of two values. Two values are INT but we need to verify with instruction.

So here we have used two INT values in MUL instruction and OK instruction will check both the values (value 1 and value 2) are INT or other data types.

If both value in MD 20 and MD24 are INT, it will allow multiplication or not.









Explain Out range instruction or value outside range instruction using example.

Explain Out _range instruction or value outside range instruction using example.

Application:-Explain OUT_RANGE instruction using an example. Write PLC program for explanation using ladder diagram language in the Programmable Logic Controller (PLC).

Components:-Programmable logic controller, HMI panel, wires, 24 VDC lamp, 24 VDC power source, 24VDC temperature controller.

 

Diagram:-



























Explanation:-

We can use OUT_RANGE (Value outside range) instruction when the variable is not within a specific range. You can specify the value range for the MIN and MAX inputs. The OUT_RANGE instruction will compare the variable value with the values of MIN and MAX value and sends the result.

For an explanation, we can consider a simple example so we can understand easily. Assume one application in which we need to operate a green lamp if the actual temperature is not between MIN and MAX value which can be set by HMI. And if the actual temperature is not in between MIN and MX value, the alarm lamp (temp not in range) will be ON as shown in the figure. Assume analog scaling of the temperature value, so as sown in figure measured value is 10 degree and MIN limit is 20 degree and the MAX degree is 50 degrees. So for the above example temperature is not within range and the alarm lamp (temp not in range) will be ON.

PLC program:-

Write the ladder program for the above application using ladder diagram language. Here for ladder logic we can use any supported PLC system like S7-1200, S7-300, S7-1500 or any other PLC which can support this instruction. For PLC logic we need digital inputs and outputs.

For our application lamps are digital outputs. MAX and MIN values are input words.

Digital Output:-

Temp.not in range=Q0.0

M Memory:-

Actual temp. =MW2

MIN temp.:-MW10

MAX temp:-MW20













PLC program Explanation:-

In network 1, actual temperature is measured or stored in MW 2 and in MIN we can set minimum range of the temperature also in MAX we can specify the maximum applicable range of the temperature.

So here we have used OUT_RANGE instruction which will compare a variable with MIN and MAX values and if the variable value is outside range, alarm lamp (temp. out of range) will be ON.

Both instruction IN_RANGE and OUT_RANGE instructions can be used for comparison purposes.













Explain IN Range instruction or value within range instruction using example


Explain IN Range instruction or value within range instruction using example

Application:-Explain IN_RANGE instruction using an example . Write PLC program for explanation using ladder diagram language in the Programmable Logic Controller (PLC).

Components:-Programmable logic controller, HMI panel, wires, 24 VDC lamp, 24 VDC power source, 24VDC temperature controller.

 

Diagram:-















Explanation:-

We can use IN_RANGE (Value within range) instruction when the variable is within a specific range. You can specify the value range for the MIN and MAX inputs. The IN_RANGE instruction will compare the variable value with the values of MIN and MAX value and sends the result.

For an explanation, we can consider a simple example so we can understand easily. Assume one application in which we need to operate a green lamp if the actual temperature is between MIN and MAX value which can be set by HMI. And if the actual temperature is not between MIN and MX value, operate a red lamp as shown in the figure. Assume analog scaling of the temperature value, so as sown in figure measured value s 50 degrees and MIN limit is 45 degree and MAX degree is 55 degree. So for the above example temperature is within range and the green lamp should be ON.

PLC program:-

Write the ladder program for the above application using ladder diagram language. Here for ladder logic, we can use any supported PLC system like S7-1200, S7-300, S7-1500, or any other PLC which can support this instruction. For PLC logic we need digital inputs and outputs.

For our application lamps are digital outputs. MAX and MIN values are input words.

Digital Output:-

Temp OK lamp=Q0.0

Temp not ok Lamp=Q0.1

M Memory:-

Actual temp. =MW2

MIN temp.:-MW10

MAX temp:-MW20









PLC program Explanation:-

In network 1, actual temperature is measured or stored in MW 2 and in MIN we can set minimum range of the temperature also in MAX we can specify the maximum applicable range of the temperature.

So here we have used IN_RANGE instruction which will compare a variable with MIN and MAX values and if the variable value is within range, green lamp (Q0.0) will be ON and if not then red lamp (Q0.1) will be ON as shown in network 2.