OK Lancie, thank you for your input on the debouncing logic. I was looking into it for the wrong reason.
Alex, about your logic in your 4D and 4E versions: carefully compare your logic in Rung 0002 with my last version. Do you see a major difference?
You are locking out the buttons, when really you should not care how many times the customer presses a button. The only thing you want to lock out is the effect of the button (the relays that the buttons control) You only want one Flavor-bit relay to be capable of being turned on for each Coin_Accept_Solenoid ON. One way will work, the other will allow multiple selections for the same price. You choose.
I will put your version in LogixPro and see if I am correct.
I tested it, and your method doesn't work at all. If two buttons happens to be pressed at the exact same time, the customer gets nothing! On the other hand, if within the 2-second period, the customer manages to push from 1 to 4 buttons in series, he gets 4 drinks for the price of one.
Please quit screwing around with this and fix it so it works. Use the Flavor bits, not the buttons, to do the interlocks on Rung 0002.
You don't need a subroutine for this short program. But if you did, a subroutine is called on the very rung where you place the JSR, and the PLC scan goes to the subroutine, runs through it, then returns to the rung below the JSR rung.