So, there were actually two issues...
1. Synchronizing the AB with the Zen
2. Modifying horn operation times
It sounds like you have the synchronizing part under control.
Now, as far as modifying horn operation times, how exactly are you changing those times?
Are you using some sort of display (HMI) to edit times?
Or are you going into the code and changing hard-coded values?
.
.
.
I created a routine that lets the operators modify system time and date. The routine is available on one of the pages on the display.
The display looks something like this...
TIME DATE
HH : MM : SS MM : DD : YY
EDIT TIME EDIT DATE
HH: __ MM: __
MM: __ DD: __
SS: __ YY: __
F1 = Update Time F10 = Update Date
F30 = Spring Ahead F40 = Fall Back
.
If you are using Daylight Saving Time at all...
Since you are using the Zen to synchronize time, the Daylight Saving Time adjustments would have to be controlled automatically by the Zen (just like it is in Windows). The Zen has to self-correct on those days.
Can the Zen handle that?
Changing Time and Date...
In my routine, the operator enters the HH, MM & SS and then presses F1 to update the time in a single action. Likewise for the date.
For Daylight Saving Time he simply presses F30 or F40, whichever is appropriate.
Now, if you are using some kind of display...
You could do something like this...
CURRENT HORN TIMES EDIT HORN TIMES
Horn-1: HH : MM : SS HH: __ MM: __ SS: __
Horn-2: HH : MM : SS HH: __ MM: __ SS: __
* *
* *
* *
Horn-X: HH : MM : SS HH: __ MM: __ SS: __
F1 = Update Horn Times F10 = Cancel (Clear Edits)
.
The HH, MM & SS values on the left are the current values for each horn time. These values exist in the hard-coded "Working Memory" locations used by the compare instructions. Notice that the "locations" are hard-coded, not the "values".
The "XX: __" values on the right side are all "Edit Memory" locations.
The initial values in the "Edit Memory" locations are equal to the current values in the corresponding "Working Memory" locations. For example, when the screen is first displayed, Horn-1 shows the following...
CURRENT HORN TIMES EDIT HORN TIMES
"Working Memory" "Edit Memory"
Horn-1: 16 : 30 : 00 HH: 16 MM: 30 SS: 00
.
Enter any changes you want into the "Edit Memory" locations on the right side of the screen for any or all horn-events. After you are satisfied that all of the Edit values are correct, then press F1 to Update Horn Times.
All of the data in the "Edit Memory" locations are written to the corresponding "Working Memory" locations. Any values that you have not changed remain the same. After the update is complete, all of the corresponding values on each side are equal.
If the memory locations are properly organized then the update operation can be as simple as a single Block-Copy from Edit-Area to Working-Area.
If horn-times occur at the same relative times from shift to shift...
(assuming three 8-hour shifts...)
shift-start = end-shift/begin-shift horn
shift-start + 2 hours = begin-break horn
shift-start + 2 hours + 10 minutes = end-break horn
shift-start + 4 hours = begin-lunch horn
shift-start + 4 hours + 30 minutes = end-lunch horn
shift-start + 6 hours = begin-break horn
shift-start + 6 hours + 10 minutes = end-break horn
.
Then you might only need to provide a single base-time entry and 6 "off-set" times. (Oh, yeah... also an entry for Day-of-Week to prevent the horn from operating on the weekend.)
If "base-time" = 07:00 then...
Shift-1 start = "base-time" = 07:00
Shift-2 start = "base-time" + 8 = 15:00
Shift-3 start = "base-time" + 16 = 23:00
Off-Set times Shift-1 Shift-2 Shift-3
shift-end/start............................... 07:00 15:00 23:00
begin break shift-start + 2 hrs + 00 min.... 09:00 17:00 01:00
end break shift-start + 2 hrs + 10 min.... 09:10 17:10 01:10
begin lunch shift-start + 4 hrs + 00 min.... 11:00 19:00 03:00
end lunch shift-start + 4 hrs + 30 min.... 11:30 19:30 03:30
begin break shift-start + 6 hrs + 00 min.... 13:00 21:00 05:00
end break shift-start + 6 hrs + 10 min.... 13:10 21:10 05:10
.
It would probably be a lot easier to simply use minutes per shift.
An 8-hour shift has 480 minutes. Use a 1-minute timer to increment a counter. Then monitor the current count.
Begin first break @ 2-Hr + 00-Min.....120 Min.
End first break @ 2-Hr + 10-Min.....130 Min.
Begin Lunch @ 4-Hr + 00-Min...........240 Min.
End Lunch @ 4-Hr + 30-Min...........270 Min.
Begin second break @ 6-Hr + 00-Min....360 Min.
End second break @ 6-Hr + 10-Min....370 Min.
End Shift, Reset Counter @ 8-Hr + 00-Min...480 Min.
.
There are many ways to play this game...
There is a general rule that many programmers just can't seem to get the hang of...
It takes a lot of code to make something appear simple. There is a "cost" associated with convenience. If you want the convenience, the "cost" must be paid.
(170)