Determining Shift Change

Robert J

Guest
R
Hello,
I am "trying" to write code in RSLogix500 for Micro 1500 to determine when a machine has been powered down (main power killed) on one shift and powered up on another shift. The reason for doing this is to reset data if it has went through a shift change. The biggest problem that I am having is our 3rd shift goes through midnight. This means to me that I need to account for a change in month, day and year. Our plant should never work on New Years Eve but I wanted to include it just in case. I have also thought about "cheating"/offsetting the times so that all three shifts occur during the same day. Any advice would be helpfull.

Thank you,
Robert
 
From memory you need to use the later versions of the micrologix (series C) (you can flash upgrade your earlier series if need be) with the clip in RTC (real time clock module). Then use the RTC function file (you need a late version of RSLogix) and the rest should be just compare blocks. Post back if you have any questions. Regards Alan Case
 
Thank you,

That is what I am doing. I am a rookie to programing and I thought my code was getting more complicated then it needed to be.

Thanks
Robert J
 
I must be missing something here

Why are you concerned with the date? First shift is from (say) 7AM to 7PM, second shift 7PM to 11PM, third shift 11PM to 7AM.

Even if you are doing a four shift rotation through 7 days a week, the hour of your shift CHANGE is fixed, isn't it, even if the number of the shift isn't fixed?

If you are also trying to capture the shift number as well, consider a simple counter (if the shifts rotate 1-2-3-4-1-2-3...), or a lookup table if the shifts shift. (?!?). Or a password entry system so that the PLC knows what shift is on, because an operator told it so.

FWIW
 
Thank you,

I don't have a HMI for operators to enter data and I don't know what you meant by a look up table. So, if I am understanding you about a simple counter to keep track of shifts while the PLC is powered up but what is going to index these counter or how will the PLC know how much time has passed during the time the PLC is powered down? If you power down on say 2nd shift on Monday and power back up on 2nd shift on Thursday, how will the PLC know 2 day have passed? Wouldn't I need to track the date since 3rd shift runs through midnight, unless I offset all shift times to occur on one day.

Thanks,
Robert
 
Robert J said:
If you power down on say 2nd shift on Monday and power back up on 2nd shift on Thursday, how will the PLC know 2 day have passed?

Because it 'knows' it's now Thursday!

Remember, you don't just have a time-of-day clock, you also have a calendar... đź““
[attachment]
beerchug

-Eric

rtc.gif
 
Thanks Eric,

My reply was in response to Allen and keeping track of the date. I presently have code for power down and power up. I then do a compare and for 1st, 2nd and 3rd and check for change in year, month, day and if it is a different shift. 1st, 2nd and the first part of 3rd shift are complete. I am looking to see if there is a simpler way of doing the 3rd shift change in year, month and day. The code is getting to ba a lot to me (about 50 rungs) and I may be incorrect in saying that. If anyone is interested, email me and I can email this code to you when I return to the office June 16, 2003.

Thanks,
Robert
 
daylight savings time

You are missing one piece of the puzzle. PLC does not compensate automatically for daylight savings time change. It will throw off your
shift times by one hour twice a year. I was faced with a similar problem recently, I wrote a routine that automatically changes the
hour time as needed. You can do the same. Look up all the future equinox dates, store them in the data file and then use a pointer to retrieve them.
 
If the machines are only powered down and back up at a shift change can you not use the initial power up bit to reset the data.

I think this is First Pass S:1/15 but check first.
 
Robert:

I still think that you are trying to make it more complex than it needs to be.

It seems that what you are trying to code, is to figure out what "yesterday" was, for third shift, when the month and even year barrier is crossed.

This is, I think, the wrong approach.

At the start of a shift, capture the current date (day, month, year) and the current shift number into a set of registers on a one-shot. At midnight, capture the new date and shift (=3). This one-shot event can also be used to do whatever housekeeping you do on a "Powered up at shift end"

On startup (S:1/15), calculate the current shift number (assume 3rd shift, unless time is between 1st shift times, or between 2nd shift times).

Then do a compare. If current shift number <> stored shift number, OR current date <> stored date, then the PLC was OFF during a shift change. Do whatever you need to do with this info. You'll know the shift that the PLC went off on (since it's stored), as well as the current shift (which should now also get one-shot stored - but only AFTER the compare).

There it is, in about 8 rungs of logic. Not 50.



You also asked about a look-up table. This is just a set of consecutive registers, with the sequence loaded in them. Just as I was suggesting a counter to keep track of which shift you are on, you would have some pointer that indexed with each shift change. The pointer would be used in indirect addressing to the look-up table to determine the number of the shift. When the pointer pointed to the end of the table, it would be reset to point to the beginning.

This strategy assumes that the PLC is running 100% of the time. In you first post, you said "determine when a machine has been powered down", and I thought "equipment", not PLCs. In almost all of my applications, the PLC is never powered down, especially not between shifts. MAYBE during Christmas-to-New Year's break.



Jiri has a good point about daylight savings time. Another problem I've run into is that PLCs are notoriously bad at keeping good time. I've seen them loose several minutes over the course of a few days. It may not sound like much, but after a few months, you can be off by an hour or more.

You NEED something, an HMI or SCADA, or just an RTC, that a human being can set, and which can set the PLCs clock in order to make this work the way you want it.
 
Thank you,

I think I have it. I am going to convert the date to the Julian date and then do my compare. This should make things simpler for programing and understanding. When I return from vacation on the 6/16 I will finish the code and If anyone would like it, email me and I will send.

[email protected]

Allen -Thank you for your input and explaining the look up table. Sorry that I wasn't complete in my first post. When we power down a machine, all power is kill to it. This only happens when maint. needs to work on it. I am trying to keep track of production plus other machine date. If the shift has changed while it is down, I want to clear the data so that the new shift can start from zero. Thanks again.

Jiri- Thanks for your input and reminding about daylight savings time. It has got me before and unless I am missing something I need to account for leap year on this one.

Thank again
Robert
 

Similar Topics

We are in the process of installing a new DC drive to replace a 1373 series Speedpak drive. There are 8 leads coming out of the motor -- Two for...
Replies
5
Views
843
Good morning! I am looking for a clever method to determine the number of occurrences in a series using ladder logic. What I need to determine is...
Replies
6
Views
1,255
I have my PLC and HMI connected to my local network over DHCP just like my laptop. I can upload and download including VNC to the HMI over wifi...
Replies
2
Views
1,137
We have a DC Drive (ABB DCS800) which is running a load (initially) at a fixed speed. For testing purposes, we want to simulate a different...
Replies
20
Views
6,210
ive been tasked, due to a restructure of our inventory, to find out how big our SLC programs are. specifically, we have several dozen 5/05s at...
Replies
4
Views
1,633
Back
Top Bottom