Object ‘POU’¶
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 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
Note
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.
Note
The term “POU” is also used in CODESYS for the POUs view in which CODESYS manages the global objects in the project.
See also
‘Add POU’ dialog
Function: This dialog box serves the configuration of a new POU compliant with the IEC 61131-3 standard. This means that a POU can be a program, a function or a function block.
Call: Menu Devices view; if an application is selected, context menu in POUs view.
, context menu inName | Name of the POU |
Program | |
Function block |
|
Function | Please note: not available if the language Sequential Function Chart (SFC) is selected in the Implementation language selection list. Return type: selection list for the data type of the return value |
Implementation language | Selection list for the implementation language of the POU |
See also