drbitboy
Lifetime Supporting Member
Clear the next month's total (which is also the oldest month's total), and increment the current month's total, every scan.
Either this routine will be executed only when DeltaHours is greater than 0, or DeltaHours will be 0 on most scans.
January's total is in MotorRunHoursByMonth[0], February's in [2], ..., Decembers's in [11].
The previous ten months' totals are maintained; this month's total is in MotorRunHoursByMonth[ThisMonthOffset].
GSV WallClockTime LocalDateTime YmdHMS MOV YmdHMS[1] NextMonthOffset SUB NextMonthOffset 1 ThisMonthOffset GRT NextMonthOffset 11 CLR NextMonthOffset
CLR MotorRunHoursByMonth[NextMonthOffset] ADD MotorRunHoursByMonth[ThisMonthOffset] DeltaHours Motor RunHoursByMonth[ThisMonthOffset]
January's total is in MotorRunHoursByMonth[0], February's in [2], ..., Decembers's in [11].
The previous ten months' totals are maintained; this month's total is in MotorRunHoursByMonth[ThisMonthOffset].
Last edited: