Do a search in fswiki for "ballistic primaries". You will need the Pbank capacity variable in ships.tbl, and the flags in both weapons.tbl and ships.tbl.
I'm not sure how to setup a model for rotating barrels. I'm pretty sure that you will need the barrel to be a separate subobject, though, and then use the animation stuffs to set the trigger for it. I don't know if there's a trigger for the actual firing of a weapon, though.
Unfortunately there is very little focus on making SCP features accessible to the end user, you must generally search through the forums or piece together information from the wiki. Although I think that you asking may make more people realize just how difficult it is to actually learn to use some of these features.