A chain gun is a type of machine gun or autocannon that uses an external source of power to cycle the weapon rather than diverting energy from the cartridge, and does so via a continuous loop of chain similar to that used on a motorcycle or bicycle. "Chain gun" is a registered trademark of Orbital ATK for "externally-powered machine guns". Types of chain guns are used by Allies, Axis and the Horde.
Reliability and controllability are the advantages of chain-driven weapons over their recoil-actuated counterparts. Recoil-actuated firearms depend upon the sometimes unreliable firing of a cartridge to power the cycle of action, whereas a chain gun uses an electric motor to drive a chain which moves in a rectangular circuit via four sprockets that apply tension to it. One link of the chain is connected to the bolt assembly, moving it back and forth to load, fire, extract, and eject cartridges. A misfired round does not stop the functioning of the weapon, as it might with guns that use energy from a fired cartridge to load the next round; it is simply ejected.
During each full cycle of four periods, two periods (passage along the "long" sides of the rectangle) control the time that the bolt takes to drive forward and load a round into the chamber, and how quickly it extracts it. The other two periods, when the chain moves across the "short" sides of the rectangle, sideways relative to the axis of the barrel, determine how long the breech remains locked while firing, and open to allow cartridge extraction and ventilation of fumes.
The time that the chain takes to move around a complete loop of the rectangle controls the rate of fire, so varying the motor speed allows chain guns, in principle, to fire at a rate continuously variable from single rounds to the maximum safe rate imposed by the pressure drop rates in the barrel after firing a cartridge, mechanical tolerances, and other factors. For example, the 7.62mm NATO version EX-34 was advertised to offer 570 rounds per minute, and developmental work was underway for a 1,000-rounds-per-minute version. In practice, chain guns usually have two or three set firing speeds.