The way we do it.
charge for the initial program development, and the implementation etc like you normally would.
Give the customer their program they paid for, don't lock it unless they specified that they want it locked for their own purposes.
Wait until they want to put it in a new machine they built, now charge them the time and labor it takes to put that into the new machine, test, and comission.
And this is as far as it goes, it's pretty ridiculous to think you'll end up charging the customer like 10-15% of the cost of the program development just to get a copy of it. and locking it to force them to pay just ensures you'll do about 5 machines before they find someone else to do it.
I know where you're coming from though, in a sense of software development you may charge 15% for every copy of a piece of software sold. But software these days can be serial locked by an internet connection if need be, making it so difficult to get around that people just pay to avoid the hassle of bypassing it. but let's be honest here, PLC programming is not the same as software development, they are so specific that your not going to find a generic application for one program that is going to be distributed to 10,000 different customers over the course of a month, so charging 15 bucks or 30 bucks per program isn't going to be lucrative, it'll just be a turnoff.