These is the main loop. It is timed by the clock to execute at one-second intervals.
Each time the current is measured and the values accumulated. When there sufficient accumulation, an increment is subtracted which measures an element of charge. There are two selectable shunts, 5.1 ohms and 0.85 ohms. The increments are 1 and 10 watt-minute respectively. These are also counted.
Each minute a record is transmitted. The record contains current, voltage, and count, separated by commas.