Example: Application Manager
Product: CODESYS Development System
The example shows how to use the CmpApp
library to fetch information about projects and applications, as well as area addresses and sizes of data types. It is also possible to start, stop, and reset an application from another application.
Description
AppAreas
: Different types of data, such as retain, input, or output are stored in specific areas of the PLC. This program is used to get the addresses and sizes of the individual areas. Depending on the PLC, an area can process different types of data.
AppInfo
: To get information about an application, the corresponding application has to be retrieved first. One way to get a specific application is to sequentially go through all of the applications, starting with the first one. Another way is to get the current application or an application by its specified name. Based on this, additional information about applications and the projects can be retrieved.
AppInteract
: Different actions (such as Start, Stop, and Reset) can be controlled within a program. To demonstrate this, App2
is controlled by App1
.
AppRetain
: Retain variables can be saved and restored from a file. To restore them, the pointer to the application has to be identical to the one used to save the data.
ExceptionDuring_InitCode
: An exception is generated in the FB_Init
method of this function block. When the FB is instantiated, this exception is thrown and no code can be downloaded to the PLC.
Main
: All other programs are called from this program. Additionally, the exception named above can be thrown by commenting out the function block in the declaration editor.
PLC_PRG
: A counter is included to see if the application was stopped or reset.
System requirements and restrictions
Programming system | CODESYS Development System (version 3.5.14.0 or higher) |
Runtime system | CODESYS Control Win (version 3.5.14.0) |
Add-on components | - |
Note
DOWNLOAD Project