Ladder Diagram to obtain output of this mathematical equation
Program Description
As we can see, step by step procedure is done.
Output of individual operations are first obtained.
Output of all these data are stored into Integer Registers.
Operation starts from the smallest function as shown in the RUNG0000 that first Sin Y(N7:0) is obtained,
then Sin Y is added with the integer 2.
Output of this 2+Sin Y is then square rooted using SQR instruction and result is stored into the register N7:6.
Then 2y is performed. This is obtained by using XPY (X to power Y) instruction where X is N7:4 (digit 2) and
Y is N7:0 (y).
Output of this both are Multiplied to finally obtain the output of the equation X (O:6).
LIM instruction is then used to compare output of the equation with its lower limit and upper limit.
Accordingly output is generated.
If O:6 is between 1 to 10, output O:0 energizes turning ON the Output 1.
Runtime Test Cases
You
can
check
output
by
varying
y
(N7:0)
input.
This program is tested and performed using RSLogix 500 Pro by Rockwell Automation
PLC Program to do Mathematical Functions
This is a PLC Program to do Mathematical Functions.
Problem Description
Implement various mathematical functions in PLC using Ladder Diagram programming language.
Problem Solution
Use all the Math Instructions to implement various Mathematical Arithmetic Functions.
Use ADD to add one piece of data to another.
Use SUB to subtract one piece of data from another.
Use MUL to multiply one piece of data by another.
Use DIV to divide one piece of data by another.
Use SQR to find the square root of a piece of data.
Use NEG to change the sign of a piece of data.
PLC Program
Here is PLC program to do Mathematical Functions, along with program explanation and run time test
cases.
List of Inputs and Outputs
I:1/0
= Input to Add
(Input)
I:1/1
= Input to Subtract
(Input)
I:1/2
= Input to Multiply
(Input)
I:1/3
= Input to Divide
(Input)
I:1/4
= Input to find Square Root
(Input)
I:1/5
= Input to change the sign of a Number
(Input)
N:7/0 to N:7/9 = Integer Number Location
(Input)
O:6
= Display
(Output)
|