8/30/2021 2:50 AM | |
Joined: 3/16/2015 Last visit: 10/10/2021 Posts: 1250 Rating: (173) |
Have a look at this link. They have a couple of manuals that are quite good. Programming guidelines and programming style guide. There maybe also templates but not sure if has exactly what you're looking for. Read them and guidelines from PLOpen at your leisure. To your question, download programming style guide and look at DA011 Rule: Continuous asynchronous execution with "enable" , and think about it. At the top of the block you can do something like this:
Basically anytime the enable tag is false the block will exit at the return instruction. Problem is that when you disable the block everything freezes at its last state; outputs that were TRUE when the block was disabled will remain TRUE. So you may want to create something like this:
Then you realize there are certain tags that need to be initialized or validated first time the block is enabled, so you add more code for rising edge of enable to initialize stuff. Ans so on, start with what you know you need and modify it as your needs change and create a template for your ideal enable code and save it in a library of your own. |
8/31/2021 3:14 PM | |
Joined: 1/17/2013 Last visit: 9/3/2024 Posts: 1103 Rating: (6) |
Dear Kal.A, Where is bit inb_Enabled , vb_Enable_Edge , tmpb_Block_Is_Enabled come from in program ? |
Best Regards, |
|
Follow us on