Overall System Architecture Diagram: A visual representation of the central alarm system's components and their interactions, illustrating how hardware modules connect and communicate within the system.
Components of the Central Alarm System: The main hardware modules that comprise the system, including the central controller, detection devices, display units, and output modules.
Hardware Modules and Their Interactions: The physical units such as the STM32 microcontroller, UART/RS485 interface, EEPROM, LCD/OLED display, buzzer/relais, and detectors, along with the communication pathways (e.g., bus RS485) that enable data exchange and control signals among them.
Detector_t structure: A data structure representing each detector, containing fields such as address, type, state, description, zone, zone ID, last seen tick, alarm timestamp, last value, and enabled status. It encapsulates all necessary information for detector management and operation.
Configuration table for detectors: An array (detector_table) of Detector_t structures, with a maximum size defined by MAX_DETECTORS. It stores the configuration and current status of all detectors in the system, including their descriptions, zones, and operational states.
Data fields and their purposes in detector configuration:
address: Unique identifier (1-127) for each detector, used for communication.type: Specifies the detector type (smoke, heat, flame, CO, manual call), guiding response handling.state: Current operational state (normal, alarm, fault, disabled, test, offline).description: Textual description of the detector's location or purpose.zone: Name of the zone where the detector is installed.zone_id: Numeric identifier for the zone, used for zone-specific actions.last_seen_tick: Timestamp of the last received sign of life, used to detect offline status.alarm_timestamp: Timestamp of the last alarm event.last_value: Last analog value read from the detector, relevant for sensors providing analog data.enabled: Boolean indicating whether the detector is active or deactivated.Detector_t structure consolidates all relevant data for each detector, facilitating management, status updates, and communication.detector_table) is an array of Detector_t that holds all detectors' configurations and current states.address), type classification (type), operational status (state), descriptive info (description, zone), and timing info (last_seen_tick, alarm_timestamp).The Detector_t structure is the core data model for detectors, with dedicated fields for identification, status, description, and timing, stored collectively in a configuration table to enable efficient management and communication within the system.
Detector initialization process: The procedure of setting up detector parameters and states at system startup or during configuration, ensuring each detector's data is correctly loaded and ready for operation. It involves preparing the detector table with initial values, either from default settings or loaded from persistent storage (EEPROM/Flash).
Configuration setup during installation: The process carried out by the installer to define the initial parameters of detectors, such as address, type, zone, description, and enabled status. This setup is typically performed once during installation and can be stored in the detector table or saved to EEPROM/Flash for persistence.
Loading configuration from EEPROM/Flash: Retrieving previously saved detector configuration data from non-volatile memory during system startup. This process involves reading stored data, validating it (e.g., via a magic number), and populating the detector table with this data to restore system state after power cycles or resets.
Frame format: The structure of data packets exchanged over the RS485 bus, consisting of specific fields including header, address, command, length, data, and CRC.
Defined by the format: 0xAA | ADDR | CMD | LENGTH | DATA[..] | CRC.
Command codes: Numeric identifiers used by the central unit to instruct detectors or request information.
0x01: Poll (interrogation of detector status)0x02: Reset alarm0x03: Test detector0x04: Disable detectorResponse codes: Numeric identifiers sent by detectors to indicate their status or data.
0x81: Normal state0x82: Fire alarm0x83: Fault (defect)0x84: Analog valueCRC calculation and validation: A simple XOR-based checksum computed over the frame fields to ensure data integrity.
0xAA.address field uniquely identifies each detector on the bus.command field specifies the action (e.g., poll, reset).length indicates the number of data bytes (max 8).DATA[..]) contain variable information, such as sensor readings.CMD=0x01, setting the address, and computing CRC before transmission.The RS485 communication protocol uses a structured frame with specific command and response codes, combined with a simple XOR CRC for data integrity, enabling reliable command exchange and status reporting between the central unit and detectors.
Polling mechanism for detectors: A process where the central system sequentially interrogates each detector on the bus by sending a poll command and awaiting a response within a specified timeout. This ensures real-time status updates for all detectors.
Alarm processing workflow: The sequence of actions triggered when a detector reports an alarm, including updating detector state, recording the alarm in active alarms list, displaying alarm details on the LCD, activating alarm outputs (sirens, flashers), logging the event, and notifying the supervision PC via UART.
Active alarm list management: The maintenance of a list (array) that stores details of current alarms, such as address, description, zone, timestamp, and type. New alarms are added when detected, and the list can be cleared or updated as alarms are reset or cleared.
The polling loop iterates over all enabled detectors, sending a poll command via RS485 and waiting for a response (with a 100ms timeout). If no response is received, the detector is considered offline after 15 seconds of no response.
When a response indicating an alarm (RESP_ALARM) is received, the system updates the detector's state to STATE_ALARM, records the timestamp, and extracts any analog value if present.
The alarm processing involves updating the detector's data, adding an entry to the active alarms list (if space permits), displaying alarm details on the LCD, activating sirens and flashers, logging the event, and transmitting alarm info to the supervision PC.
The active alarms list is a fixed-size array (active_alarms) with a maximum of 32 entries, which is incremented each time a new alarm occurs. Resetting alarms clears this list.
The polling cycle includes a small delay (HAL_Delay(5)) between interrogations to prevent bus overload.
The polling and alarm handling engine systematically interrogates detectors, processes alarm signals, and manages active alarms to ensure timely and organized response to fire incidents.
Display_ShowAlarm: Function responsible for updating the LCD to show detailed alarm information. It displays four lines with specific alarm details, including alarm type, address, description, zone, and value.
Display_ShowFault: Function that updates the LCD to indicate a fault detected in a detector. It shows two lines with fault status and detector description.
Display_ScrollAlarms: Function that cycles through active alarms, updating the LCD with summarized alarm information such as alarm number, detector address, type, description, and zone. It enables scrolling through multiple alarms on the display.
Display_Init: Function that initializes the LCD display, clears the screen, and shows an initial message indicating system initialization.
Display_ShowNormal: Function that displays the system's normal status when no alarms are active. It shows counts of detectors, alarms, and faults, with a message indicating system normality.
LCD_Update Procedures: Methods like LCD_SetCursor, LCD_Print, LCD_Clear, LCD_BacklightOn, and LCD_BacklightOff are used to manipulate the LCD content and backlight, ensuring proper display updates and visual cues during alarm events.
Display_ShowAlarm presents detailed alarm information across four lines, including alarm type, address, description, zone, and last value, with a blinking backlight effect.Display_ShowFault and Display_ShowOffline show concise fault or offline messages on two lines.Display_ScrollAlarms enables cycling through multiple active alarms, updating the display every call to show the next alarm's summary.Display_Init) sets up the LCD and displays a startup message.Display management functions efficiently update the LCD to reflect system status, alarms, and faults, providing clear, real-time visual information and facilitating alarm scrolling for multiple active alarms.
EEPROM storage for configuration data: Non-volatile memory used to save system configuration, such as detector settings, to ensure data persists after power-off. In the source, EEPROM (specifically AT24C256) stores a header and detector records, enabling configuration recovery at startup.
Persistence of system settings: The ability of the system to retain configuration and operational data across power cycles. This is achieved by writing configuration data to EEPROM, which is read during system initialization to restore previous settings.
Data read/write operations: The processes of transferring data to and from EEPROM memory. In the source, functions like EEPROM_Write() and EEPROM_Read() handle these operations, enabling saving and loading of configuration data, including headers and detector records.
Configuration data, including detector details and system version, are stored in EEPROM with a specific structure: a header (ConfigHeader_t) containing a magic number, detector count, and version, followed by detector records.
Saving configuration involves writing the header and all detector records sequentially to EEPROM at a predefined base address (CONFIG_BASE_ADDR).
Loading configuration reads the header first; if the magic number matches, it proceeds to read detector records and initialize system variables accordingly. If the magic number does not match, default configuration is used.
Data read/write operations are performed via dedicated functions (EEPROM_Write(), EEPROM_Read()), ensuring data integrity and proper memory management.
This persistent storage mechanism guarantees that system settings survive power loss and can be restored automatically during startup, maintaining system consistency.
EEPROM storage provides a reliable, non-volatile means to save and retrieve system configuration data, ensuring persistence of settings and enabling seamless system recovery after power cycles.
UART interface for configuration: A serial communication method used to connect the central system to an external device (e.g., PC terminal) for configuring detectors. It enables sending commands and receiving responses through a UART port, facilitating user interaction with the system.
UART command protocol: A structured set of commands exchanged over UART to perform configuration tasks. Commands include actions like listing detectors, adding or modifying detector descriptions, changing zones, saving configurations, and checking status. Commands are parsed and executed by the system to modify internal data or trigger actions.
Interaction with user interface: The process by which the system communicates with the user via UART, providing feedback, displaying detector information, and accepting commands. This interaction is managed through functions that transmit strings and process received characters, enabling real-time configuration and status monitoring.
LIST, ADD, DESC, ZONE, DEL, SAVE, and STATUS are supported.CLI_SendString().CLI_ProcessCommand()) interprets commands and executes corresponding functions, such as listing detectors or updating descriptions.cmd_buffer) and an index (cmd_index) to handle incoming data.The UART configuration interface provides a simple, structured way for users to interact with and configure the system via serial commands, enabling efficient management of detectors and system settings through real-time communication.
Main Loop Operations: The continuous cycle within the main program that manages periodic tasks such as polling detectors, updating display, and handling user inputs. It ensures the system remains responsive and up-to-date by executing specific functions at defined intervals.
Polling Cycle Timing: The scheduled interval at which the system sends interrogation (poll) commands to all detectors. In the source, detectors are polled every 2000 milliseconds (2 seconds) to check their status via the AlarmEngine_PollAllDetectors() function.
Event Handling and System Refresh: The process of responding to external or internal events, such as user actions (e.g., pressing the reset button) or system conditions (e.g., alarm states). This includes debouncing inputs, resetting alarms, and updating the display accordingly. The main loop checks for button presses and updates the display every second or when alarms scroll.
while (1)), maintaining system operation.HAL_GetTick()) to control periodic tasks:
AlarmEngine_PollAllDetectors() to interrogate detectors via RS485.HAL_UART_RxCpltCallback) to process CLI commands asynchronously.The main program loop orchestrates periodic polling, display updates, and event handling to maintain system responsiveness and accurate status reporting, using timed checks and interrupt-driven inputs.
| Aspect | Description | Key Authors / References |
|---|---|---|
| Overall System Architecture | Visual diagram showing system components, hardware modules, and communication pathways (e.g., STM32, UART/RS485, EEPROM, LCD, detectors). | None |
Data Structure (Detector_t) | Struct containing fields: address, type, state, description, zone, zone_id, last_seen_tick, alarm_timestamp, last_value, enabled. Used for detector management. | None |
| Detector Initialization | Process of setting up detectors at startup, loading configuration from EEPROM/Flash, and preparing detector table for operation. | None |
| RS485 Frame Format | Fixed structure: `0xAA | ADDR |
| Polling & Alarm Handling | Sequential interrogation of detectors via RS485, updating states, managing active alarms list, and triggering outputs on alarms. | None |
state values (normal, alarm, fault, disabled, test, offline) and their handling.last_seen_tick for offline detection.0x01 poll) and response (0x81, 0x82, etc.) codes.LENGTH) in RS485 frames, leading to buffer overflows.Detector_t structure, including each data field's purpose and how it facilitates detector management.0x01 poll, 0x02 reset, etc.) and response codes (0x81 normal, 0x82 alarm, etc.).last_seen_tick.Detector_t structure, RS485 protocol, polling and alarm engine, display management, EEPROM storage, UART configuration interface, main program loop.Тествайте знанията си по Central Alarm System Architecture and Communication с 9 въпроса с множество отговори с подробни корекции.
1. How does the overall system architecture influence the system's effectiveness in detecting alarms?
2. How can the detector configuration table be effectively used during system operation to update detector parameters?
Запомнете ключовите концепции на Central Alarm System Architecture and Communication с 18 интерактивни флашкарти.
Overall System Architecture — purpose?
Visualizes components and their interactions.
Components of central alarm system?
Controller, detectors, display, communication modules.
Hardware modules — interactions?
Modules communicate via RS485 bus and interfaces.
Intelligence Artificielle
Bases de données
Bases de données
Bases de données
Импортирайте курса си и AI генерира листове, тестове и флашкарти за 30 секунди.
Генератор на листове