1. name the cannon something eg. mycannon
2. put a target (invisible helipads are really good) and name it something eg. mytarget
3. let the trigger start a script...
cannonfire.sqs
#loop
mycannon dotarget mytarget
~1
mycannon fire (weapons mycannon) select 0
?(mycannon ammo ((weapons mycannon) select 0)) > 0: goto "loop"
This would make the cannon fire at the target untill it is out of ammo.
The 1 second delay is representing the reload time of the weapon (this could vary from weapon to weapon but doesnt really matter in this case, the script will still work).
I hope this does work because i dont have the time to test it
If you want it to fire somewhere far away try this:
cannonfire.sqs
#loop
mycannon dowatch [getpos mytarget select 0,getpos mytarget select 1,100]
~1
mycannon fire (weapons mycannon) select 0
?(mycannon ammo ((weapons mycannon) select 0)) > 0: goto "loop"
here instead of dotarget we use dowatch and make the cannon watch a position 100 meters above the target. That should make it fire quite far...