Symbol:
An object of the type “POU” is a Program Organization Unit in a CODESYS project. You write source code for your controller program in POUs.
There are the following types of POUs:
-
Program
-
Function
-
Function block
A “POU” object is inserted by using the command “Project Add Object” in the Device tree or in the “POUs” view. When adding a POU you define the POU type and the implementation language.
You can also add other programming objects (method, action, etc.) to these objects.
Calling POUs
Certain POUs can call other POUs. Recursions are not permitted.
When calling POUs via the namespace, CODESYS browses the project for the POU to be called in accordance with the following order:
-
Current application
-
“Library Manager” of the current application
-
“POUs” view
-
“Library Manager” in the “POUs” view
If you want to call a POU that exists with the same name in a library used in the application and as an object in the “POUs” view, note the following: There is no syntax that allows you to call the POU in the “POUs” view only by its name. In this case you must shift the library from the application's library manager to the project's library manager (in the “POUs” view). After that you can call the POU object in the “POUs” view purely by its name. If you add the namespace to the library, you can call the POU of the library.
The term “POU” is also used in CODESYS for the “POUs” view in which CODESYS manages the global objects in the project.
See also
Dialog 'Add POU'
Function: The dialog is used to configure a new POU according to the IEC 61131-3 standard. This means that a POU can be a program, a function, or a function block.
Call: “Project Add Object” menu; context menu in the “Devices” view when an application is selected; context menu in the “POUs” view
“Name” |
Name of POU |
“Program” |
|
“Function Block” |
|
“Function” |
Note: Not available when “Sequential Function Chart (SFC)” is selected as the “Implementation language”. “Return type:”: Data type of the return value |
“Implementation language” |
Implementation language of the POU |