Join us today!
Calling multiple Program POUs
Hello everyone,
Great forum and brilliant initiative.
Assume I have two Program POUs, what is the difference between the following:
Add both Program POUs to the same Task in the order I want them to be executed.
Call one Program POU from the other.
Call both Program POUs from a master Program POU.
Thanks
Kal
Hi!
Thank you for nice words! And great question!
I believe POUs in the same Task run simultaneously. In the image below, there are 3 POUs in the PlcTask and they run at the same time and their cycle time is the same.
If you call POUs from a master program POU, they run one after other. I called two POUs from MAIN program. Prg_Counter_1() runs first and then Prg_Counter_2() runs.
Priority adjustments is between tasks, not between POUs. You can create multiple tasks, and assign your POUs to different tasks and then change the Priority for each task.
The links below are very helpful also.
TwinCAT SYSTEM Sub Node "Real-Time"
- 17 Forums
- 267 Topics
- 942 Posts
- 5 Online
- 722 Members