I just want to see if I'm thinking about this right. I'm sure there's probably an easier way.
Let's say that I wanted to monitor production per shift. The shifts change a 7am, 3pm, and 11pm. I have a totalizer in my program already as a structure ($totalizer).
I setup 3 Time Structures (FirstShiftCompare, SecondShiftCompare,and ThirdShiftCompare) as UDT0, UDT1, and UDT2.
I move the values 7 -> ThirdShiftCompare.Hours, 15 (3pm) -> FirstShiftCompare.Hours, and 23 (11pm) -> SecondShiftCompare.Hours.
I then use DTCMP to compare $Now to FirstShiftCompare, SecondShiftCompare, and ThirdShiftCompare, looking only at the hours. I use the "set if equals" bit to trigger a move. The move function will move $totalizer.ireg1 to a memory location. I can then do math on that location to calculate the production on that shift Daily, Weekly, Monthly, and Annually.
Is there an easier way to do this, or am I on the right track?