CODESYS 3.5 - PLC Programming With Structures - Lesson 20 - Asset Manager Walkthrough
🔹This course is from 2023 and is now free. You can still access it ad free at https://liambee.me if you become a member or purchase the course. 🔹Download all course materials for free here: https://liambee.me/codesys-structured-programming-course-material/ In this lesson we look at how structured data and instantiated structures are passed into function blocks inside a real project. This builds directly on ideas from earlier lessons, but now we explore how this works inside a complete system with real assets, interlocks and control logic. We begin by looking at the task configurator and where this part of the logic runs in the scan cycle. After the input mapping layer completes, the inlet system runs next. Inside this POU we split the logic into two very clear regions. Control logic sits at the top and manager calls sit at the bottom. The control region contains interlocks, wash conditions and process requirements. These are the parts of the program engineers are most likely to review, so they sit at the top of the page. The managers sit below because they standardise the handling of structured data and rarely need to be modified once created. Each manager is a dedicated function block responsible for updating a specific type of structure. For example the switch manager accepts its global data structure, alarm group structures and alarm management structure via inout so everything is passed by reference. This avoids unnecessary copying, keeps scan times low and ensures every switch behaves consistently. Any alarm indexing, fail safe behaviour or debounce handling is included within the manager, which guarantees that every switch in the system is treated the same way. As we look through the inlet system you will see the same pattern repeat. Quarter turn valve managers, instrument managers and pump managers each receive their own data structures, alarm arrays and control management references. Some devices, such as analogue instruments, have multiple data sets that feed into the same manager. This allows more complex assets to use one block while still receiving additional information like SCADA parameters or extended diagnostic structures. Inside each manager the same core pattern appears. The function block reads the process structure, applies its logic, handles alarms and writes everything back into the structure. Once the manager finishes, the structure contains the updated state for any other part of the program to use. This ensures that all control decisions in the main logic always refer to a single source of truth. By keeping logic at the top and managers at the bottom, projects stay clean, readable and easy to maintain. If you need to add another device you simply instantiate another structure, drop in another manager call and all of the standardised behaviour comes with it. Your project scales without complexity and your structured data stays consistent and predictable. #AlwaysLearning #Automation #Codesys #PLC #HMI
Download
0 formatsNo download links available.