The low order bit (bit 0) of the ASCII code for the shift name toggles at every shift change, and bit 1 toggles after 2d and 4 shifts, 2d and four shifts, then 3d and four shifts. The program by needs to be tweaked: on even week's Mondays before 0600 it should yield D, not B subtracting 6 from the hour, with roll-"under" for negative results on the hour day of week and on odd-even week should fix it, and the hour comparison becomes less than 12. What platform? A-B Logix 5000? 500? Siemens? Ladder? ST? FBD? Otherwise you will need to manually do this if it is necessary to change the shift letter at the correct time. More complexity can be added with automatic daylight saving time adjustment via AOI for the PLC clock. That will add some complexity, but only depends on the PLC clock being correct. Rockwell has sample code AOIs for computing day of the week from the date elements in the WALLCLOCKTIME. (While you could avoid the GSV with a recurring 12-hour timer, this would need to be set up to deal with run-mode transitions and lost time when the PLC is not in run mode.) The watch-out will be after a program download, which may require resynchronizing the index for the current shift. This will work through a power cycle if the battery (on older processors) is good. When the index reaches 14, reset to zero. Then a one-shot on the hour equaling 6 or 18 adds one to an index. In order to do this you will need to periodically scan the GSV instruction for WALLCLOCK time, using the local time specification. The shift counter will index into the DATA array within the STRING type to pull the character corresponding to the current shift when the clock hour changes to 6 and 18. If this is a Logix 5000 platform, one approach will be to use a string whose contents is ABABCDCD. Maybe using the day of the week? Any help would be appreciated! I think there would be a better way of doing this. acc value? Then the shift will be messed up. 1 problem that I can think of is that if the PLC is powered down will the counter lose its. Doing it like this I have to have 28 EQU instuctions. If the counter.acc is equal to 2 then it is B shift.and so on If the counter.acc is equal to 1 then it is A shift Each shift in a two week period is assigned a number right now I have a counter that increments at shift change. I am trying to display the current shift on an HMI. This encompasses a two week period, after that it starts over again. The order of the shifts is AB AB CD CD AB AB AB CD CD AB AB CD CD CD So at my plant our shift schedule is 12 hour shifts 7 days a week.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |