FIFO Array help Rslogix 5000

waterbottle

Member
Join Date
Mar 2019
Location
Florida
Posts
42
Hello all,

I need some guidance creating a FIFO array to display data into an HMI. The data will be the sum of jams of a conveyor section in an hour. The jams total to be display will have to be last hour jams and update every 5 mins so we can work with an array of 12 instead of 60. The total of jams (all time jams since logic was created) is already in the current rung in an add instruction. I will just have to make this value only display the last hour total only. Im open to any ideas on how to make this the most simple as possible.
 
Would a trend be better suited for this?


I use the FFL and FFU instruction a lot and usually have something like this.



Timer.DN
------|/|-------------------------- Timer
Timer.DN FFLControl.EN
------| |----------------|/|------- FFL
FFLControl.DN FFLControl.EN
------| |----------------|/|------- FFU


Source tag is your count

Create a dummy tag for the Dest FFU.
Then HMI tags I select the last element as the latest record to display.
 
First off I would not use a FIFO. I would use a Copy instruction to shift my data. If you copy Array[1] to Array[0] for length of 12 it will shift your data. The most current data will be in Array[11] and the oldest will be in Array[0]. Make your Array Length 13. This will let you copy data into Array[12] and shift it to Array[11]. Then you will display Array[0] thru Array[11] for your 12 sections of 5 mins. In essence you will be copying Array[1] thru Array[12] and pasting it in Array[0] thru Array[11]

Make sure you use one shots bits to do the math. Create a DINT named Oneshot. This gives you 32 bits for the ONS instructions.



XIC System Run [ONS] Oneshot.0 COP Total Jams to Current Jams.
XIC Timer_5M Done [ONS] Oneshot.1 SUB Total Jams - Current Jams = 5 Minute Jams. Copy Total Jams to Current Jams.
XIC Timer_5M Done [ONS] Oneshot.2 COP 5 Minute Jams into Array Jams[12] Copy Array Jams[1] To Array Jams[0] for length of 12.

XIC System Run XIO Timer_5M Done TON Timer_5M 300000 0

Make sure you put your timer in the last rung under your math.


If you don't care about the first hour after logic is installed. then you can add a rung using the AVG instruction and then Multiple The Average of the Array by 12 to get you Hour total.
 
CWAL61 that makes so much more sense and a lot easier. Will try it in the morning and update you with results. Again thank you so much for the brilliant idea
 
Note: If you go with the Average Instruction to get hour total then make sure you use a REAL for the Destination tag. This way you'll get a percentage for any hour where jams are less than 12.
 

Similar Topics

Hi All I am using a 42 dint array for a project. Im using a FSC instruction so if any values in the 42 dint array are lower then 32000 it will...
Replies
5
Views
1,433
I am using a distance laser to bring in an analog value. I have converted the value to inches and filling an array using FIFO using RSLogix 5000...
Replies
21
Views
5,975
Hello! New to this forum, but have read a lot of different threads. Anyway, I have a question for you all, I have played around with AB PLC's...
Replies
0
Views
4,749
Hi All Im using RSlogix 5000 and compactlogix. I need to store 2 bits of data to a register in the PLC, one is a time stamp from the wall...
Replies
12
Views
14,361
Hi everybody! I'm struggling with 2 dimensional array. The task is simple: to keep records for last 10 user log-ins (user ID# and time stamp)...
Replies
8
Views
16,656
Back
Top Bottom