Michael Peck
Space warfare expert Paul Szymanski believes that it was possible to operate the cannon in space, but there would have been some issues, especially in fire control. "The trajectory of the fired shell would be curved, based on gravity (same as on Earth), so the aiming mechanism would have to account for this, along with the great speeds of the Almaz spacecraft and the target," he tells the The National Interest. In addition, destroying a high-speed anti-space weapon at close range might have resulted in Almaz being hit by fast debris.
On June 25, 1974, the Salyut 3 space station and its two-cosmonaut crew blasted into space. On the surface, it seemed like just another space exploration mission. The Salyuts were the Soviet counterpart to America's Skylab, civilian spacecraft designed to conduct experiments, test what happens to the human body during long-duration spaceflight and, incidentally, to garner some Cold War propaganda point,
But though the mission was called Salyut ("Salute"), it was just a cover name. In reality, Salyut 3 was the Almaz 2 military space station.
The mission of the Almaz stations was surveillance, similar to the U.S. Air Force's Manned Orbiting Laboratory in the 1960s. The idea was that a vantage point 170 miles high made for the perfect observation post. America cancelled the MOL, but the Soviets launched three Almaz spacecraft between 1973 and 1976.
However, there was something different about Salyut 3/Almaz 2. It wasn't just a military space station. It was an armed military space station. Almaz 2 was equipped with a small cannon to test whether Soviet spacecraft could protect themselves from American anti-space weapons.
http://nationalinterest.org/blog/the-buzz/was-russias-secret-plan-build-space-cannon-fight-america-22660