Tracking hourly production

shoelesscraig

Member
Join Date
Apr 2009
Location
LA
Posts
382
Ok, so here's one that's been giving me a headache all day. I'm one of those guys that thinks about stuff until I get it...even off the clock.

I've got a SLC 5/03 running a production floor at our plant. I've got a limit switch counting packages as they pass by. My goal is to do the following:

I want to keep track of the best production hour. That is, the maximum packages per hour that the operators were able to run.

Sounds simple. Right? Ok, this part I DO know how to do. This part is easy. I'm counting parts and at the end of the hour I see if that number is greater than the previous record...if so, I replace it with the new record and move on. Got it.

Now, for my dilemma....

I'm looking once an hour at the number. For example, 1pm, 2pm, 3pm, etc. Well thats fine. But I want to know the most packages that they have been able to run in 1 hour, regardless of when that hour started. So lets say that between 1pm and 2pm they ran 500 packages, and between 2pm and 3pm they ran 550 packages. But...:confused:, what if they actually ran 700 packages between 1:30 and 2:30? Right now, my program just thinks that 550 is the best hour that was ran, when in fact, they actually ran 700 packages in a 1 hour period???

I've have thought all day about it, but I don't know how to make it work. Any thoughts or suggestions are welcome. I'm sure that someone has had to do this before. I'm probably overlooking something simple, but for the life of me I can't figure out what.
 
Create a FIFO. With variable length ofc.
In stead of just counting the packages, store em in the FIFO with a time stamp. On each new package, loop the entire content of the FIFO, dispose of the package falling outside the hour, count the amount of packages, compare of greater then current record.

With this you have the records and the timestamps it has been achieved in.
 
I suppose it would be kinda fun to do this and I wonder about them also. Generally what I have found to stop the show is
when you get this number what are you going to do with it?

Dan Bentler
 
if you need it dedicated to the hour period with the start of the hour then you need to look at the RTC clock I beleive the SLC 503 has one but not positive. if so then its S:40 for the hour S:41 for the minutes
 
if you need it dedicated to the hour period with the start of the hour then you need to look at the RTC clock I beleive the SLC 503 has one but not positive. if so then its S:40 for the hour S:41 for the minutes

Like I said, I've already got that. It works fine. I was just wanting option number 2!
 
I suppose it would be kinda fun to do this and I wonder about them also. Generally what I have found to stop the show is
when you get this number what are you going to do with it?

Dan Bentler

Well, I kinda had the same attitude at first. But, our production managers have started a little contest with the 3 shifts, trying to see who could run the most in an hour. Neat idea I guess. I guess sometimes we are asked to deliver things that seem pointless....life goes on.
 
Create a FIFO. With variable length ofc.
In stead of just counting the packages, store em in the FIFO with a time stamp. On each new package, loop the entire content of the FIFO, dispose of the package falling outside the hour, count the amount of packages, compare of greater then current record.

With this you have the records and the timestamps it has been achieved in.

Do you mind explaining this a little further? Variable length? I didn't know that you could make the length variable, thought it was a constant.
 
What will they do if the best hour spans two shifts?

Here's a general method:

Set up a file, I'll use N20. Set for a length of at least 64.

To initialize clear (FLL) the entire area - FLL 0, #N20:0, 64

As each item is sensed then Increment N20:59, N20:60

One-shot the minute (S:41). When this happens
If N20:60 > N20:61 (Highest) then
MOV N20:60 to N20:61
MOV S:40 to N20:62 (Hour)
MOV S:41 to N20:63 (Minute)
end if
Subtract N20:0 from N20:60
COP #N20:1, #N20:0, 59 (This shifts everything up)
CLR N20:59

What you'll get is "Highest" in N20:61 and the time (Hour, Minute) when the hour ended in N20:62, N20:63
 
Last edited:
so maybe a little clarification is in order you want to record a 1 hour period regardless of the start of the hour???
If this is a correct inperpratation then this will present a bit of a challenge even if you use the non-RTC method the counter will have a set start and complete time range. so what I propose is you use a fifo and as suggested above time stamp it. Jeebs idea is a suggestion to follow essentailly you are comparing the number each time a new product is recieved on your senser.
 
IF it was me this is how I would go at it

For me this looks like and aplication requiring a rolling average. What I mean by rolling average is each minute the average is updated based on a FIFO.

In you case your talking about 500 to 700 packages per hour. So if you devide that by 60 then your packages per minute 8.333 to 11.666. Well you know you are not producing .333 packages or .666 so your going to have some error. You need to figue out what is an accpetable error. Myself I would bump my sample window up to 10 minutes in this case.

So now I have my sample rate: Number of parts per 10 minutes

Well I know from reading clocks there are 6 10 minute intervals in one hour so the best I am going to do is 6 updates per hour.

Now the fun part: I create a FIFO with 6 data points. Every 10 minutes I move my package count into the first data point and my last drops off. Then I add the 6 together and I have my hourly rate. So every 10 minutes I can take my value and compare it to what I have previously and see when production is highest.

Bare in mind this is only every 10 minutes but it does update 6 times faster than your orginial.

The biggest thing you have to watch out for is your error. In my example above my error went from a possible 6+% error to a .6+% error. This error will always be there because your looking at a Parts per Hour figure but counting parts per 10 minutes and you can only count a complete part. You will not see it unless you compare your samples. Or the bean counters see the production level and actual parts producted and notice the discrepancy.
 
I suppose it would be kinda fun to do this and I wonder about them also. Generally what I have found to stop the show is
when you get this number what are you going to do with it?

Dan Bentler

Well, I kinda had the same attitude at first. But, our production managers have started a little contest with the 3 shifts, trying to see who could run the most in an hour. Neat idea I guess. I guess sometimes we are asked to deliver things that seem pointless....life goes on.

I hate to sidetrack the topic - but if your prod. mgr. cant leverage this data any better than 'little contests' - then he...he just needs to do better. I had a 3 page write up that I just deleted but I'll say this: if you **ever** want to increase real production, you'll first need to measure real production.

Sorry to go all lean/SS/TQL/WTFBBQ on you guys,too much college/office time I guess =)

-John.
 
you must use a time array of 1000 pieces. put a timestamp in the array +1 the pointer1 etc. another pointer2 is moving behind one hour or half an hour, if pointertime < rtc-1 then step pointer2.
count how many items in between.
so pointer1-pointer2 is number of items.
if negative then use 1000 - result.

if pointer1 >1000 then pointer1 =0
 
Not as hard as it sounds I don't think

Ok, so here's one that's been giving me a headache all day. I'm one of those guys that thinks about stuff until I get it...even off the clock.

I've got a SLC 5/03 running a production floor at our plant. I've got a limit switch counting packages as they pass by. My goal is to do the following:

I want to keep track of the best production hour. That is, the maximum packages per hour that the operators were able to run.

Sounds simple. Right? Ok, this part I DO know how to do. This part is easy. I'm counting parts and at the end of the hour I see if that number is greater than the previous record...if so, I replace it with the new record and move on. Got it.

Now, for my dilemma....

I'm looking once an hour at the number. For example, 1pm, 2pm, 3pm, etc. Well thats fine. But I want to know the most packages that they have been able to run in 1 hour, regardless of when that hour started. So lets say that between 1pm and 2pm they ran 500 packages, and between 2pm and 3pm they ran 550 packages. But...:confused:, what if they actually ran 700 packages between 1:30 and 2:30? Right now, my program just thinks that 550 is the best hour that was ran, when in fact, they actually ran 700 packages in a 1 hour period???

I've have thought all day about it, but I don't know how to make it work. Any thoughts or suggestions are welcome. I'm sure that someone has had to do this before. I'm probably overlooking something simple, but for the life of me I can't figure out what.

I don't know what your unit count per hour, minute, or second is, but assuming it is seconds, my solution looks like this:

Take pulses into counter.
On rising edge of 1 second pulse move counter value into FIFO with length 3600. (3600 seconds per hour)
Reset counter to 0.
Sum values in FIFO table into "last production hour" register.
Compare "last production hour" register to a "highest hour" register. If last is greater than highest, move last into highest, and move PLC processor date and time info into parallel register.

That should be it, unless you would reset everything at the end of the week, or day, or month etc.
 
I'd jsut lioke to comment on instruction times. Does anyone worry about that? Especially long sequences - like adding up 3600 values each second - the SLC 5/03 doesn't have a SUM command.
 
Now the fun part: I create a FIFO with 6 data points. Every 10 minutes I move my package count into the first data point and my last drops off. Then I add the 6 together and I have my hourly rate. So every 10 minutes I can take my value and compare it to what I have previously and see when production is highest.

When I read responses like this, it makes me think...why didn't I think of that? I DO understand perfectly well how FIFOs work. Thanks for the response. This seems to be the easiest method to me. I don't see any reason why I couldn't go ahead and bump it up to once every minute (having a FIFO of length 60.

My question now is...what is the best way to add 60 integers together in a SLC 5/03? As Bernie said, there is no SUM function.

Oh yeah, and the error is not a big deal. This is a very unofficial number that I'm trying to create here. If its off a little, then its not a problem.
 

Similar Topics

I am attempting to reject a bottle If the label fails. The rejection works fine at normal line speed but at low speed the rejector fires (air...
Replies
35
Views
1,148
Is it possible to gather OPC data through a 1783-NATR? Searching around, it sounds like OPC data might be blocked by any NAT... Is there any work...
Replies
2
Views
247
Hi All. I have a very specific question about tracking using an encoder and bitshift register. We would like to use a Compact or Control Logix PLC...
Replies
40
Views
1,730
Hello, I have a servo motor running a conveyor belt system. I do not have the exact circumference of the head pully and therefore I get some...
Replies
5
Views
1,392
Hello I'm currently using a guard logix L7 processor, studio 5000 v34. Our existing machine uses nest tracking for history of each part cycled...
Replies
1
Views
768
Back
Top Bottom