A Simple Table Averaging example (Not!)

Sliver

Member
Join Date
Feb 2004
Location
Kingston, Ontario
Posts
488
Anyone want to take a crack at this?

Why will this ladder logic not work as presented in Modicon Ladder Logic Block Library User Guide ver2.1 10.10 A Simple Table Averaging example page 229


10 points to whoever gets it first (thats 8.5 points american!)

[attachment]


The average value should be found in 40301.40302


If you don't have a copy of the user guide I may be able to scan (copyright infrigement?) the page that walks you through this logic that doesn't work.
I had this subroutine running in a noncritical application for 2 years before I had to do


NO attachment came through but resend worked, look down a couple of entries.....
 
Last edited:
try again with attachment?

Anyone want to take a crack at this?

Why will this ladder logic not work as presented in Modicon Ladder Logic Block Library User Guide ver2.1 10.10 A Simple Table Averaging example page 229


10 points to whoever gets it first (thats 8.5 points american!)

[attachment]


The average value should be found in 40301.40302


If you don't have a copy of the user guide I may be able to scan (copyright infrigement?) the page that walks you through this logic that doesn't work.
I had this subroutine running in a noncritical application for 2 years before I had to use the averaging again and tackled the puzzle.

Good Luck!


(I'm new at attaching, sorry)

ladder average.jpg
 
The only thing I can see is, while the routine zeroes out 40201 - 40203 on exit for the next call, there's no guarantee that they are zeroed the first time the routine is called. This must be assured somewhere else before this routine is called the first time.
 
T->R

When the pointer value of the T->R instruction is equal to the table length the instruction stops. When the bottom node is toggled, the pointer is reset and the instruction can continue.
 
Clue 1

Modicon solves top left instruction first then solves vertically down the first column. It then starts at the top of the second column and continues solving vertically.
Kinda like reading Chinese I guess.

Second day the points go up to 20!
 
Ah, thank you. I've ben bit by the 'Modicon Scan' the few ttimes I've programmed them. Thus, if the last number added from the table causes a carry, the division will operate on an incorrect total since the division will happen before the carry increment takes place.
 
CONGRADULATIONS! we have a winner!

Excellent job Bernie,

I wish I had some crackerjack exploding firework happyfaces, but alas I don't.
Give me your credit card # and I will happily credit your account with the 10.. sorry 20 points I promised.;)

Thanks for the response Jim and everybody else for your time,

Brian
 
Last edited:

Similar Topics

Hi I've got a Micrologix 1400 and I'm using RSLogix 500 micro starter. Basically, my application required about 200-300 integer values that will...
Replies
8
Views
7,748
Hello, I´m having a problem trying to program in Ladder. An output should be trigged by two possible contacts. Take a look on the printscreen...
Replies
5
Views
120
Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
177
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
269
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
322
Back
Top Bottom