So at my plant our shift schedule is 12 hour shifts 7 days a week.
There is 4 shifts A,B,C,D.
A and C are the day shifts. 6am to 6pm
B and D are the night shifts. 6pm to 6am
The order of the shifts is AB AB CD CD AB AB AB CD CD AB AB CD CD CD
This encompasses a two week period, after that it starts over again.
I am trying to display the current shift on an HMI.
- right now I have a counter that increments at shift change.
-If the hour equals 6 then shift change
-If the hour equals 18 then shift change
-Each shift in a two week period is assigned a number
A=1 B=2 A=3 B=4 C=5 D=6 C=7 D=8.......
-If the counter.acc is equal to 1 then it is A shift
-If the counter.acc is equal to 2 then it is B shift....and so on
-Doing it like this I have to have 28 EQU instuctions. 7 for each shift.
-1 problem that I can think of is that if the PLC is powered down will the counter lose its .acc value? Then the shift will be messed up.
-I think there would be a better way of doing this. Maybe using the day of the week? Any help would be appreciated!
There is 4 shifts A,B,C,D.
A and C are the day shifts. 6am to 6pm
B and D are the night shifts. 6pm to 6am
The order of the shifts is AB AB CD CD AB AB AB CD CD AB AB CD CD CD
This encompasses a two week period, after that it starts over again.
I am trying to display the current shift on an HMI.
- right now I have a counter that increments at shift change.
-If the hour equals 6 then shift change
-If the hour equals 18 then shift change
-Each shift in a two week period is assigned a number
A=1 B=2 A=3 B=4 C=5 D=6 C=7 D=8.......
-If the counter.acc is equal to 1 then it is A shift
-If the counter.acc is equal to 2 then it is B shift....and so on
-Doing it like this I have to have 28 EQU instuctions. 7 for each shift.
-1 problem that I can think of is that if the PLC is powered down will the counter lose its .acc value? Then the shift will be messed up.
-I think there would be a better way of doing this. Maybe using the day of the week? Any help would be appreciated!
Last edited: