Fig.1 -Output O:2/0 is latched even if JMP is energized. Fig.2 -When Sensor Input is TRUE and JMP is energized. PLC Program to Generate Outputs Based on Equations
This is a PLC Program to Generate Outputs Based on Equations.
Problem Description The following calculation will be made when input I:1/0 is true.
x=2^y √(2+Sin y)
If the result x is between 1 and 10 then the Output 0 will be turned on. The value of x will be output as an
Analog voltage. Perform this operation in PLC using Ladder Diagram programming language.
Problem Solution
Perform tasks individually as defined below.
Assign integer number addresses to store the 16/32bit data into registers.
Use this addresses in the mathematical instructions as Source and Destination.
Use XPY (X to power Y) instruction to find the input 2y.
Use SIN instruction to find Sin y. Add this with 1 by using ADD instruction.
Square Root this 1 + Sin y by using SQR instruction and multiply the output of XPY and SQR.
Compare this data with the lower and upper limit and control output.
PLC Program Here is PLC program to Generate Outputs Based on Equations, along with program explanation and run
time test cases.
List of Inputs and Outputs
I:1/0
= Start Input
(Input)
N7:0
= Y input to SIN function
(Input)
N7:1
= Sin Y operation data
(Input)
N7:4
= Numeric Value “2” (To perform 2+Sin y) (Input)
N7:5
= Output of addition 2+Sin Y
(Input)
N7:6
= Square Root of 2+Sin Y
(Input)
N7:4
= Numeric Value “2” (To perform 2y)
(Input)
N7:3
= Output of X to power Y (2y)
(Input)
N7:7
= Lower Limit (01)
(Input)
N7:8
= Higher Limit (10)
(Input)
O:6
= Output x, multiplication of N7:6 & N7:3 (Output)
O:0
= Output 0
(Output)