Real-Time Multi-Task Software Design for VxWorks Communication Servers
Building a communication server for power dispatch automation requires a strict balance between high reliability and deterministic real-time performance. This design leverages the VxWorks RTOS to manage protocol conversion and data forwarding on an AT 91RM9200 microprocessor.
🏗️ System Architecture and Hardware Foundation #
The hardware foundation relies on the AT 91RM9200 embedded microprocessor. The software is engineered to handle the heavy lifting of protocol conversion and data forwarding, ensuring that the power dispatch automation system receives accurate data without latency.
The software architecture is modularized into five primary functional blocks:
- System Initialization
- System Configuration
- Downstream Channel Data Request and Processing
- Upstream Channel Data Processing
- Database Management
🔄 Communication Protocols and Dual-Layer C/S Model #
A defining feature of this design is the double-layer client/server (C/S) structure. The communication server dynamically shifts its role depending on the direction of the data flow.
For downstream channels, the communication server acts as a client. It initiates requests to fetch data from protection units, specifically supporting the IEC-60870-103 protocol.
For upstream channels, the server reverses its role. It functions as a server, responding to data requests from the dispatch master station. In this mode, it supports the Cyclic Digital Transmission (CDT) protocol, as well as IEC-60870-101 and IEC-60870-104.
⚙️ Task Management and Real-Time Scheduling #
To maintain system integrity, the multi-task division follows the H.GEMMA rule. This ensures that the data stream is processed according to strict priority logic.
Task priorities are pre-determined based on the criticality of the data flow. However, the system remains flexible; developers can use the taskPrioritySet function to adjust priorities dynamically during runtime. This allows the system to adapt to varying network conditions or emergency states.
For inter-process communication (IPC), the system utilizes semaphores and message queues. These mechanisms are standard in VxWorks to ensure that task synchronization does not introduce non-deterministic delays.
📊 Data Flow and Logic #
The main program flow manages the transition between the database and the communication protocols. By isolating the database management from the direct protocol handling, the system prevents I/O bottlenecks from impacting the real-time response of the upstream and downstream channels.
The logic ensures that every request from the master station is queued and processed with the appropriate priority, while the downstream requests are polled or triggered in a manner that respects the timing constraints of the protection units.