I just tested it and they are working properly on the sdn version. Dont forget to click the checkbox.
The number you select is the number of cannonballs left in the cannon, not the amount of cannonballs fired.
Also keep in mind it takes at minimum 1 gametick (600ms) before your interaction is even registered in the game and it takes time to walk over and interact with the cannon and your cannon will keep shooting during that time, so if your refill threshhold is just barely above an empty cannon the cannon might go empty by the time the script actually walks over to refill.