It always does the damage, but it will only knock out the weapons if it hits the Hull(or armour), if it hits the shields, it just damages them. A "clean" hit will knock out all weapons, normally for a couple of seconds. If you hit the shields, but have enough power to finish that arc off and go on to hit the Hull, then you will knock out some of the weapons, but not all. If a weapon is in the process of firing, it cannot be stopped, and I think is then unaffected (doesn't matter then of course).