RSLogix 5000 Product tracking

MartB

Lifetime Supporting Member
Join Date
Jun 2005
Location
Pinellas Park, FL
Posts
684
Product tracking based on time and position.
I'll be using a 1769-L16ER-BB1B processor. There will also be an HMI involved, but it will be for display purposes only (data will also be fed into our plant metrics system).

The scenario:
Products are loaded into a curing oven (thermal) which is essentially a continuous conveyor. An encoder tracks movement and speed of the oven. The oven conveyor can stop/start several times during the curing process.
The oven has 4 thermal zones which are individually controlled (by separate controllers external to the PLC).
The oven can accommodate approximately 1500 products. Potentially they could all be different product ID's (ID's are supplied by loading robot in the form of a string).

The requirements:
Track the position of each product in the oven.
Record the time each product spends in each zone.
Warn if the product is approaching max time in a zone.
Alarm if the product exceeds max time in zone.
During the unload process, pass the product ID and time spent in each zone to the next machine.

Initially I was thinking of just loading a FIFO for each Zone which would simply move the product through the oven.
However, I've also learned that the oven does not have a continuous supply of product and there may be gaps in the system.
So would it better to have a time based FIFO? probably not as the oven can stop or start many times during the curing process (due to downstream equipment).
So would it be better to do either or?
i.e. If product is loaded, and the encoder has moved on 'one product space' then index the FIFO
OR
If no product is loaded, and 'some' time has elapsed and the encoder has moved on 'one product space' then index the FIFO
?

Then there is the problem of tracking the time per product. I've never done anything using time comparison before. Can I just time stamp the product somehow as it enters the system and load that into a FIFO?
How can I compare current time in the system to see if I'm approaching max time?

I'm still spitballing ideas here, but I'm willing to bet someone has already done
something similar and can help guide me in the right direction.
I'm just having trouble deciding which is the best way to achieve a clean and dynamic solution. And by dynamic I mean will work regardless of oven loading (there could be several gaps in the oven, or several stops in the cycle).

Any ideas or suggestions would be most welcome.

Thanks.
 
Unfortunately the example you redirected me too doesn't solve my timestamping/comparison issue, but thanks anyway.
 
If the data could be within a few seconds of being accurate, I think I Would set up a user-defined type in the PLC (called Product_Array). It would contain all the information I needed for each product. Such as if the robot placed a product, the timestamp the product entered zone 1, 2, 3, and 4. Also, the total time in zone 1,2,3,4. Along with the system master encoder position, the product ID and any other information I would need. I would add an array of these data-types in the controller tags longer then the number of products can fit in the oven (1500+).
Then I would have the Robot load the product in the oven, but have the robot (or the PLC this program is in) index the Product_Array it loads the product information into (current time and Encoder position).
Then on each scan I would scan and index up 1 of the Product_Array and compare the position to zone start positions (Start,2,3,and 4) and the current time. From that you could tell where the product is in the oven, the time it has been in each zone, and you can reset the array once the product exits the oven.
you will have to scan all 1500+ arrays to get all the data and tell which array is next to exit and that could take a bit of time depending on what else you have happening in the code.
 
Hm. I think the FIFO idea is on the right track, but off the top of my head it seems it should be based on the encoder. Time doesn't enter the FIFO at all since you are not necessarily going to get any one product through the oven in the same time as any other. And, in fact "too long in oven" is a fault condition. So your FIFO will reliably run only off of position, which comes either from discrete inputs or the encoder count which is just another input after all.

I would approach this with, as you say, one FIFO per zone since you want to track time in zone. When a product goes into a zone, i.e. a FIFO, you write a flag to the FIFO - just a 1 or a zero. Now, you use the FIFO position as the index to a lot of other registers.

All the other registers, tied to that FIFO position, are your data. Some fixed - start time and start position. Others calculated, the time in zone (or oven) and the position in zone (or oven).

Some registers that come to mind based on what you need:

String ID of the Product
T0, time that it entered the zone
T1, time that it has been in the zone (calculated)
P0, encoder count when the product entered the zone
P1, product position (calculated)
Alarm0, flag set if product is approaching too long in zone (calculated)
Fault0, flag set if product exceeds time in zone

You can extend this to total time in oven, if needed.

So, I think what you want to do is us every encoder tick (or some number of them) to advance each FIFO. Sometimes when the FIFO advances you write a zero to it because no product entered the zone - ie, the FIFO. Sometimes product will leave. The stuff in the middle, is, in the middle.

Now, the time portion is pretty straightforward if lengthy. Every 10 seconds, or 1 second or every scan if you want! you run through subroutines on indexed arrays - 1 to whatever the FIFO count is. If the FIFO value at that position is "1" you calculate all your derived data from the initial time and initial position and update those registers. If it's zero, then nothing came in on that tick and you don't have to calculate anything. So, this accounts for your "holes" you see - there can be a gap but you don't care, the FIFO tells you it is a gap.

This will be fun of course if your FIFOs have to track 1500 parts. How many parts can you get into a FIFO in a CompactLogix, and how many words in a file etc. IDK. The typical 128/256 limits of Logix500 would make this approach a challenge for 1500 pieces of product. Is Logix5000 less limited?

Maybe this approach is one way to go.

Frankly, sounds like fun.

Paul T
 
LOL. BL got his reply in while I was doing mine, but I don't think I would try this without a FIFO of some kind keeping track of the parts for me. My first thought is that I would definitely NOT try to write a time-based logic for part tracking through the oven. Time is data in this case not control.

Paul T
 
Yep, that's pretty much what I'm working towards right now.
As far as accuracy, I'm told within 1 minute is enough, but using this system it would be accurate to within a second or two (which is better in my opinion).
The only thing I'd change is that I'm going to index the product array when the encoder has moved enough to allow one more product into the oven.
This way, if I'm not actually loading anything into the oven, I'll just put in an empty string for product ID, and let everything else move on down through the system.
I think having an individual array for each oven zone is also wise.

My dilemma is how to efficiently check each products time stamp to see if it's approaching (or exceeding) it's time in each zone though. This is the part I'm having a hard time getting my head around right now.
With up to 1500 products total in the oven I need an easy (and not time consuming) way to do it.
 
Paul, I initially thought of using a FIFO, but the requirement to check the time to see if a product is approaching max time makes me think it might be better not to use a FIFO (as I'd have to unload it and reload it to check the timestamp for each product)?
 
Paul, I initially thought of using a FIFO, but the requirement to check the time to see if a product is approaching max time makes me think it might be better not to use a FIFO (as I'd have to unload it and reload it to check the timestamp for each product)?


Well, no, because the FIFO is only holding a "1" or a "0" at each position. The time stamp (and everything else) is in another register that is associated with that FIFO position.

OK, so what follows is based on Logix500. There are probably better ways to do it in 5000 but here goes. Biggest difference in Logix5000 is the UDT maybe so that you can set up one set of indexed registers, rather than multiple files of them? Not that it matters much, the data has to be manipulated the same either way.

For the time, I'd set up a subr that simply calculated the current second of the day, 1-86400. When a product enters, look at that register and that's your time T0.

Now, each time you update your product info, you look at the current second, subtract the T0 value that was stored when the FIFO position was loaded, and you have your time in seconds that product has been in the oven.

You have to account for rollover at midnight, but that is not too hard. Same for the encoder; you log the starting count and then subtract every time you update the registers. With provision for the encoder rollover too.

Paul T
 
Last edited:
See, the key thing is that the FIFO is ONLY holding a flag, no other data. ALL the other data is off to the side in registers that you find using the FIFO position value as a pointer.

As far as accuracy, hah. It's not a guess - it's as accurate as the timers in the PLC so nearly damm perfect. That's the beauty of using the FIFO and the encoder - time doesn't enter into it, you just read it and use it. Nearly perfectly accurate. BTW, how long does it take to traverse the oven and how many encoder counts over the distance?

Also, how do you know when product enters and leaves zones? Only on encoder count or is there something else like an optical sensor?
 
Last edited:
Take a look at the FAL instruction And Using it in the incremental mode. You can make your Arrays as long as you need and use the FAL to increment the data thru the total length of the Array. No Limit on Lengths. Make your Array Lengths According To encoder pulses for the full length of the oven and the interval you need checked. You can use Multiple FAL to Track your Information or Make A UDT to hold all your data.

If you want to Track individual zone times you could make an AOI to enter data because all zone tracking should be the same. There are a lot of neat Instructions in RS5000.
Not all are Bubba Friendly and there are some here that only want to take that approach. But for me I Like the New Stuff.

good luck with your project.
 
My dilemma is how to efficiently check each products time stamp to see if it's approaching (or exceeding) it's time in each zone though. This is the part I'm having a hard time getting my head around right now.
With up to 1500 products total in the oven I need an easy (and not time consuming) way to do it.

This could be done by converting all time to Minutes. Use the GSV instruction an choose the WallClock.
MUL the current HOUR x 60 and ADD current MIN to get Total Minutes for the Time of Day. 1:15 pm would be converted to
(13x60)+15 = 795th Minute of the day. Then it's a simple compare of the time spent in a zone.
 
MartB:

There is and AOI calle Elapsed Time, I have used it to change setpoint in my process every ten minutes after process has started.
Your FIFO can be an array so that you have bar code data and time stamp data at the same time, this way you can compare actual time to time when an item entered the oven and you know how long any item has been inside the oven at any time.
The AOI can be download it from here:
http://search.rockwellautomation.co...ie=UTF-8&ud=1&exclude_apps=1&site=sample_code
 

Similar Topics

Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
95
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
109
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
101
Hi All, I've been pulling my hair out trying to fix this for a few days and need some advice. I have V19.01, v20.05, V21, V24, V30, V31, V32...
Replies
5
Views
348
Hello Friends I have a installation with v16, v17, v18, v19, v20. When I tried to open a v20 file, the enable source protection was not enabled...
Replies
1
Views
214
Back
Top Bottom