Log OPC tag on-change of another and on the hour

My machine’s cycle count increases forever (and doesn’t reset at end of shift / batch). I want to graph the cycle count by shift with each shift starting at zero.

Shift chart

To do this efficiently I think I need to

  1. Log the count on each change of the RUN status. (That will give me each of the corner points on my graph.)
  2. At shift start / end or hourly. I can then use a script transform on the chart binding to run through the dataset and subtract the shift-start cycle-count from each value.

I know how to create an expression tag that will turn on for a minute at a certain time and how to use this as a one-shot on a transaction group.

//Turn on for one minute at 00, 15, 30 and 45 past the hour.
dateExtract(now(0), "minute") = 0
|| dateExtract(now(0), "minute") = 30

How best would I also capture the cycle counts on-change of run status? Should I set up a second transaction group for that? Or is there a much better way?