Join us today!

Calling multiple Pr...
 
Notifications
Clear all

Calling multiple Program POUs

2 Posts
2 Users
1 Reactions
469 Views
Posts: 1
Topic starter
(@ka-ba)
New Member
Joined: 2 years ago

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

Reply
Topic Tags
1 Reply
1 Reply
ilyasskure
Admin
(@ilyasskure)
Joined: 2 years ago

Member
Posts: 5

@ka-ba

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. 

 

tasks

 

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. 

oneafterother

 

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 3 Real-Time

Task Settings

TwinCAT SYSTEM Sub Node "Real-Time"

 

Reply
Share: