×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Step 7 FC for averaging analog values

Step 7 FC for averaging analog values

Step 7 FC for averaging analog values

(OP)
Does anybody know if there is a pre-written FC used for averaging a group of analog values on a continual basis?

I have an application where I have qty. 12, 4-20mA signals being input to the PLC (CPU 313C). I need to compare each of the values to the average of them all on a continuous basis.

I am using this as a feedback system to synchronize 12 machines by momentarily shutting off flow control valves if one machine is running faster than the average (by a predetermined amount).

RE: Step 7 FC for averaging analog values

Switch your LAD editor to STL View and try this:

CODE

L input1 //input1, input2 ... to be repleaced with actual
ITD      //addresses or symbols
//-------------
L input2
ITD
+D
//-------------
//part between dashed lines to be repeated
//until you use all inputs


L 12
/D
T average //here is your average

Regards,

Jacek

Do it right or don't do it at all.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources