CODESYS 3.5 - PLC Programming With Structures - Lesson 21 - Managing Alarms Walkthrough
Автор: Liam Bee
Загружено: 2025-11-25
Просмотров: 14
🔹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...
In this lesson we look at how alarms are built and managed inside a structured project. Rather than focusing on platform specific alarm configuration, we concentrate on the structured approach that allows you to handle alarms consistently and efficiently across an entire system. The same principles apply regardless of the PLC platform.
We begin by revisiting the inlet system where the first managers were introduced. Each device, such as a switch or a valve, has an alarm index assigned to it. This alarm index tells the global alarm manager which position in the alarm arrays should be used for that asset. Because the alarm arrays are stored inside a structure and passed via inout, the alarm system can be referenced by any number of managers without copying large amounts of data.
We look at the two key structures that support this method. The alarm group structure contains large boolean arrays for active alarms, accepted alarms and an optional status field used for SCADA diagnostics. These arrays allow the entire alarm system to be indexed by number. Element zero is reserved, and the remaining elements become available alarm slots for your project. The second structure, alarm management, contains all the operator interaction flags such as accept single, accept all, reset accepted and new alarm raised.
Inside the global alarm manager we walk through the complete alarm lifecycle. A condition becomes true, activating the alarm. The operator accepts it, updating the accepted state. When the condition clears and a reset request is received, the latch is released and the alarm returns to a cleared state. The block also updates a status value so SCADA can colour code or categorise the alarm without any extra logic.
One important point in this lesson is the scale of the data being handled. The alarm group contains large arrays, and in a typical project there can be thousands of alarm definitions in use. Passing these arrays as standard inputs and outputs would place a heavy load on the CPU. Passing them by reference through inout removes that cost entirely and allows the alarm system to be shared across any number of devices without affecting scan time.
We also look at how alarm numbers are assigned. Instead of hardcoding values, the project uses a global constants list. Each alarm number is defined once with a meaningful name, such as G11 or G12, along with a comment describing its purpose. This allows cross referencing, makes mistakes easier to detect and prevents the common issue of accidentally using the same alarm number twice. With a structured project this becomes essential, especially when alarm counts grow into the thousands.
By the end of this lesson you will understand how a single global alarm manager can support every asset in your project, how structured alarm arrays allow consistent behaviour everywhere and why passing everything by reference keeps the system efficient and scalable. Download the example project, step through the logic and try assigning a few alarms yourself. It will make the whole concept much clearer once you see it running.
#AlwaysLearning #Automation #Codesys #PLC #SCADA
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: