Guest jaed Posted April 7, 2004 Report Posted April 7, 2004 Hello! Anyone have a good algorithm for handling large FIFO's? When I use the built-in FIFR function on a 20k-size array, the PLC times out... I guess it's not intented for this size of fifo... //j Quote
Sergei Troizky Posted April 9, 2004 Report Posted April 9, 2004 (edited) For large FIFO use indexed addressing and manipulate a pointer instead of moving the data registers contents. I do not have ready ladder, but here is an algorythm. Determine the FIFO array. Assign a data register for pointer. It may be an index register, or a regular data register which will be copied to the index register immediately prior to FIFO read/write operation. In the program: First initialize the FIFO registers contents, if necessary for your application. You may need to fill them with zero values, for example. Also initialize the pointer. It must be always within the FIFO addresses range. After that, at any moment the FIFO output is in the register, addressed by the pointer. When writing to the FIFO (pulse operation): - Write to the register addressed by the pointer. - Increment the pointer register. If the result is out of the FIFO addresses- write the first FIFO register number to the pointer. Edited April 9, 2004 by Sergei Troizky Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.