All cannons take 3 seconds to complete their cycle time.

Heavy cannons fire 2 shots over 1 second, then cooldown for 2 seconds - total 3 seconds

Dual cannons fire 4 shots over 2 seconds, then cooldown for 1 second - total 3 seconds.

from your example of dual cannons:

Mk III of the weapon states it deals 172 dps, and 129 damage per cycle.

129 x 4 = 516 damage done. divided by 3 seconds = 172 dps

Cannons can be a little misleading because of the sustaining factor. You can only chain 2 dual cannons together (continuously) due to the firing cycle time of 2 seconds (1 second CD). With MK3 the best you can sustain is therefore, 258 DPS. However the best you can sustain with heavies is 3 cannons (1 second firing cycle, 2 second CD) which actually means they can chain/sustain twice what dual cannons can because of the shorter firing cycle (still 2 shots per second). Of course at the cost of an additional hardpoint...