I am definitely not the guy to ask about anything sonar... However, someone who does know might ask you if you're using any mods, just to be certain of what you have.
As for the gun, while on the bridge, use the binoculars (not the TBT) and look at your "target" vessel. There's a little "+" sign crosshair in there. When you have that over the target, press the space bar and you should see a little yellow up arrow light up for you, indicating target lock, and then your crew should say "Yes sir! manning the deck gun sir!..." etc. There will be a delay in them getting all the gear out, loading, aiming, etc. Just be careful you don't "mark" any friendlies, else your gun crew will carry out your instructions to the letter!...