A runtime system can include the implementation of a function block, function, or method (for example, from a library). If you create a POU in your application with the same name by using the “External implementation” without an implementation, then you can execute the existing implementation. Please make sure that you declare local variables only in an external function block. External functions and methods must not contain local variables.
When the application is downloading, CODESYS searches for and links the associated implementation in the runtime system for each external POU.
Objects with the property “External implementation” are postfixed with (EXT)
after the object name in the “Devices” or “POUs” view.
See also
Creating POUs with external implementation
-
Click “Project Add Object POU”.
-
Activate “Function block”, Method, or “Function” and specify the name of the associated implementation of the runtime system. Close the dialog box by clicking “Add”.
The runtime system POU is created in the “POUs” view. The name is postfixed with
(EXT)
. -
Right-click the POU and select “Properties”.
The dialog box opens.
-
Click the “Build” tab.
-
Select the “External implementation (Late link in the runtime system)” check box.
The POU is declared and you can implement a POU call.
Creating methods with external implementation
-
Select a function block in the device tree or in the POUs view.
-
Select “Add Object Method” and type the name of the associated implementation of the runtime system. Click “Add” to close the dialog box.
The method is created.
-
Right-click the method and select “Properties”.
The dialog box opens.
-
Click the “Build” tab.
-
Select the “External implementation (Late link in the runtime system)” check box.
The method is declared and you can implement a method call. The method name is postfixed with
(EXT)
in the “Devices” or “POUs” view.