Aug 10, 2011

Find Avg Value Of Data In PLC - Omron PLC Programming

While doing PLC Programming for applications where we have to deal with data a lot , and we have to make calculations. In Process Automation Applications we have to show a lot of Data on SCADA and there we have to do much calculations. If we have to find the average value of some data word , then we have to write a very long ladder logic for that. But in Omron PLC there is one Instruction through which we can Directly get the average value of a particular Data Word or some process Parameter.

Calculating Average Value in Omron PLC Programming :-

In dealing with Process Parameters, where we have to show many parameters on the SCADA we have to deal with many calculations. Suppose that we want to show the average hours of DG Running hours per month or Average Tank Level then OMRON PLC provide a very useful instruction AVG through which this can be easily achieved.

AVG Instruction in Omron PLC :-

Symbol :- AVG S N D
Where S - is the source word whose average value is to be found out. N - is the number of cycles for which the average value will be calculated. D is the Result word where the average value will be stored.
Every time the AVG Instruction is execute the contents of S are stored in D+2 to D+N+1 , for the first execution of AVG Instruction the value of S is stored in D+2 , for the second execution of Instruction the value of S is stored in D+3 and so on. When the Execution of Instruction reaches N times then the average value of D is stored in D.
NOTE :- N must be BCD from #0001 to #0064

Example :- Consider AVG D100 #4 D200
So when this instruction condition goes from off to on for first time then the value of D100 is stored in D202 , at Second execution it is stored in D203 , at third execution it is stored in D204 , at fourth execution it is stored in D204 and average value is also calculated and stored in D200.

We have also made a Sample PLC Program using AVG Instruction for better understanding of yours.

SAMPLE PLC PROGRAM FOR AVG INSTRUCTION.

If you have any doubt regarding this , you can write us in comment section. We will be glad to help you.
Subscribe to Automation-Talk by Email.

Advertisements :-

1 comment:

Receive all updates via Facebook. Just Click the Like Button Below