A dds-based plc high-speed data distribution system and data distribution method
Patent Information
- Application Number
- CN202611004876.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-09-29
AI Technical Summary
实时以太网总线比如PROFINET(IRT)、EtherCAT等又需要解决协议开发难度高、需要使用专用通信芯片、部署成本高的问题
(1)可实现数据的同步发送。本发明将DDS中间件技术集成到PLC中,将DDS发布者和PLC的计算任务关联,每次计算之后进行数据的组包和发送,从而实现了数据的同步发送。
Smart Images

Figure CN122845409A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer communication technology, and in particular to a high-speed data distribution system for PLC based on DDS. Background Technology
[0002] High-speed data in a PLC (Programmable Logic Controller) refers to the data acquired, processed, and transmitted at extremely high frequencies by the PLC in an industrial automation control system. This data typically reflects key parameters and states in the production process. The data usually includes digital I / O signals, analog I / O signals, and measurement variables used in the logic configuration program.
[0003] Currently, achieving reliable 1ms transmission for high-speed data transmission in PLCs mainly faces the following challenges: (1) Poor real-time performance: In high-speed control processes, the data transmission latency requirement is as high as 1 millisecond or even lower to ensure that the PLC can obtain the latest data in a timely manner and make a rapid response. The real-time performance of commonly used PLC transmission protocols such as Modbus-TCP, TCP / UDP, and OPCUA is usually tens of milliseconds, and the communication latency is positively correlated with the scale of measurement point configuration. Real-time Ethernet buses such as PROFINET (IRT) and EtherCAT need to solve the problems of high protocol development difficulty, the need to use dedicated communication chips, and high deployment costs.
[0004] (2) Low reliability: Data needs to be transmitted at high speed while also dealing with packet loss and data errors that may occur in complex industrial environments. Currently used communication protocols often cannot simultaneously meet the requirements of high-speed transmission and high-speed diagnosis and retransmission.
[0005] (3) Insufficient bandwidth utilization: With the increasing level of industrial automation, the amount of data that needs to be transmitted is increasing. Under the control requirement of high speed 1ms, even if the physical bandwidth reaches 100Mbps or even 1000Mbps, the traditional communication scheme can only transmit a limited number of data bytes.
[0006] (4) Multi-node transmission: Depending on different process requirements, data may be transmitted between two PLCs or between multiple PLCs. High-speed data also needs to be read and recorded in the database of the industrial control computer by the data acquisition module. The configuration and deployment of traditional communication protocols are relatively complex and it is difficult to simultaneously meet the configuration requirements between PLCs and between PLCs and data acquisition modules. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a high-speed PLC data transmission system with better real-time performance and reliability.
[0008] To achieve the above objectives, this invention provides a high-speed PLC data distribution system based on DDS, comprising multiple PLCs, a switch, and an industrial control computer. The PLCs and industrial control computer are connected to the switch. The industrial control computer has a built-in data acquisition module and a configuration programming module. Each PLC and data acquisition module is configured as a DDS node, operating in the same DDS domain, and forming a high-speed DDS data distribution network using a peer-to-peer network architecture. The configuration programming module configures the parameters and hardware of the multiple PLCs, while the data acquisition module collects and displays data from the multiple PLCs. Each PLC includes a DDS publishing module, a DDS subscription module, and a configuration calculation module. Each PLC adds a network output table through the DDS publishing module and exports it as a network output table description file. The DDS subscription module imports the network output table description file to subscribe to the network output table. The configuration calculation module executes the PLC's task calculations and synchronizes the data to the DDS publishing module for DDS message transmission. The DDS subscription module receives DDS messages and performs real-time communication diagnostics and data copying.
[0009] DDS (Data Distribution Service) is a data distribution middleware for real-time systems, used to transmit data in distributed systems using publish-subscribe methods. DDS employs a topic-centric publish-subscribe communication structure, providing an efficient, reliable, and real-time data transmission mechanism to enable data exchange between different DDS nodes.
[0010] This invention integrates DDS middleware technology into the PLC, and achieves high-speed synchronous data transmission by associating the DDS publish and subscribe process with the PLC's periodic tasks.
[0011] The information recorded in the aforementioned network output table description file includes: DDS topic name, transmission cycle, timeout period, data address, data length, measurement point variable information, and output table checksum. Adding a network output table is used to define DDS topic data. The network output table description file can be imported into other PLCs or data acquisition modules that act as DDS nodes, enabling subscription to the network output table and updating the subscription information of the DDS subscription modules in each DDS node.
[0012] Multiple measurement point variables can be added to the network output table mentioned above. The configuration programming module automatically binds the corresponding output Q area address to each measurement point variable according to the network output table parameters set by the user.
[0013] By configuring the data address and data length in the network output table, continuous data transmission can be performed without repeatedly transmitting the names of measurement point variables. A large amount of measurement point data can be transmitted within a single cycle, thus achieving a high message data utilization rate.
[0014] Furthermore, the above configuration programming module configures parameters for multiple PLCs, including the station number and network output table parameters for each PLC; the network output table parameter configuration includes setting the starting address of the input I area for storing the corresponding measurement point variables and binding the corresponding output Q area address for each measurement point variable.
[0015] Furthermore, after the aforementioned network output table description file is imported, corresponding diagnostic variables are generated to display the real-time communication status of the network output table, including normal communication, communication timeout, and abnormal checksum. More specifically, the process of the DDS subscription module receiving DDS messages and performing real-time communication diagnostics is as follows: Upon receiving a DDS message, a match check is performed between the received message and the imported network output table description file to determine if the DDS topic name matches. If a match is found, the output table checksum in the DDS message is further checked to ensure it is consistent with the output table checksum in the network output table description file. If consistent, the measurement point data is copied to the buffer of the DDS subscription module, and communication is considered normal. If the DDS topic name does not match, no message processing is performed. If multiple instances of DDS topic name mismatch or failure to receive messages with the corresponding DDS topic name occur consecutively, and the timeout period is reached, a communication timeout is determined. If the DDS topic name matches but the output table checksum is inconsistent, the checksum is considered abnormal.
[0016] The above diagnostic variables are updated in real time and are used to provide users with information for fault diagnosis and problem investigation.
[0017] Furthermore, before executing the PLC cycle task calculation, the configuration calculation module reads the buffer of the corresponding DDS subscription module, copies the latest measurement point data into the corresponding input I area, executes the PLC cycle task calculation, and after the calculation is completed, synchronizes the data in the output Q area to the buffer of the DDS publishing module and executes a DDS message transmission.
[0018] The PLC periodic task allows setting the task's periodic time, with a minimum setting of 1ms, thereby enabling 1ms data synchronization transmission between DDS nodes.
[0019] Preferably, the DDS publishing module also includes multiple publishing channels, and the corresponding publishing channel parameters are set through the configuration programming module. The publishing channel parameters include the associated PLC cycle task and cycle multiplier factor, and are used to generate different DDS topic names in the DDS domain.
[0020] When the parameters of a publication channel change, this will cause a change in the DDS topic name. For the measurement point variable information added in the above network output table, including the variable name and variable type, if a user adds or deletes a measurement point variable, or modifies the variable name or variable type, this will cause a change in the check value of the output table of the network output variable table to which the measurement point variable belongs. A change in the DDS topic name of the PLC or the check value of the output table will cause the device subscribing to the PLC or the data acquisition module to diagnose an abnormality, and the subscription information of the DDS subscription module needs to be updated again.
[0021] Preferably, the DDS publication channels include three configurable virtual channels: high-speed, medium-speed and low-speed. The high-speed, medium-speed and low-speed channels have different cycle multiplier factors M1, M2 and M3, where M1<M2 and M2<M3. Assuming that the set task cycle is N ms and the set cycle multiplier factor is M, the DDS publication cycle of the publication channel is T=N*M, in ms.
[0022] In addition, the above-mentioned data acquisition module includes a DDS subscription module, a database reading and writing module and a data display module; the data acquisition module imports the description file of the network output table through the DDS subscription module of the data acquisition module, so as to realize data subscription from multiple PLCs; the database reading and writing module writes the received data into the database in real time and supports real-time query; it allows users to query the data of measurement point variables according to measurement point names and time intervals, and supports displaying data in a list or curve.
[0023] The present invention also provides a high-speed PLC data distribution method based on DDS, the steps of which are as follows: Parameter configuration: the configuration programming module is used to set the station number of each PLC, the publication channel parameters of the DDS publication module and the parameters of the network output table; PLC data subscription: a PLC imports the description file of the network output table through the DDS subscription module, to achieve subscription to the network output table; Communication diagnosis: after the PLC receives the DDS message through the DDS subscription module, it checks whether the DDS topic name matches according to the imported network output table description file; if they match, it further checks whether the DDS message is consistent with the output table check value in the network output table description file, if they are consistent, it copies the measurement point data to the buffer of the DDS subscription module, and determines that the communication is normal; PLC data transmission: the PLC copies the latest measurement point data to the corresponding input I area by reading the buffer of the DDS subscription module, executes the PLC cycle task calculation, after the calculation is completed, it synchronizes the data in the output Q area to the buffer of the DDS publication module, and executes one DDS message transmission; PLC Data Acquisition: The data acquisition module enables subscription, querying, and display of data from multiple PLCs.
[0024] Furthermore, the high-speed PLC data distribution system based on DDS of this invention adopts multicast communication, which can effectively reduce the network load in scenarios where multiple PLCs subscribe to the same PLC. Simultaneously, the QoS strategy employed ensures reliable transmission; in the event of packet loss or data anomalies, the retransmission function of the DDS middleware can guarantee the complete transmission of data.
[0025] Furthermore, the PLC can adjust the communication interval of the DDS publishing channel by modifying the task cycle and cycle multiplier factor of the PLC cycle task associated with the publishing channel parameters.
[0026] The present invention has the following advantages over the prior art: (1) Synchronous data transmission is possible. This invention integrates DDS middleware technology into the PLC, associates the DDS publisher with the PLC's calculation tasks, and packages and sends the data after each calculation, thereby achieving synchronous data transmission.
[0027] (2) High data transmission reliability. By utilizing the QoS strategy of reliable transmission mode, when data is lost or abnormal, the DDS middleware will automatically retransmit, thereby improving the reliability of transmission.
[0028] (3) High bandwidth utilization. Continuous data transmission is achieved by using the addresses and lengths of data in the network output table configured by the user, without repeatedly transmitting the names of measurement point variables. A large amount of measurement point data can be transmitted within a single cycle, thus achieving high message data utilization.
[0029] (4) Simple network topology. DDS supports multicast messages for data publishing and subscription, and naturally supports various scenarios such as 1-to-1, 1-to-many, PLC to industrial control computer, etc., eliminating the complex configuration of traditional communication protocols.
[0030] (5) The protocol configuration process is simple and the human-computer interaction is high. All devices participating in DDS communication are regarded as peer DDS nodes. Users only need to connect all DDS nodes to the same network, and then configure, export and import the station number, publishing channel parameters and network output table to complete all network configurations.
[0031] (6) Low network deployment cost. The PLC, industrial control computer and switch described in this invention do not require the installation of special chips or boards, and only need to run the software function modules related to DDS middleware. Attached Figure Description
[0032] Figure 1is a network topology diagram of the DDS real-time data distribution network of the present invention; Figure 2 is a functional block diagram of the DDS real-time data distribution network of the present invention. Detailed Description of the Embodiments
[0033] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for exemplary purposes only, and are not intended to limit the protection scope of the present disclosure.
[0034] Figure 1 shows a network topology diagram of a DDS-based high-speed PLC data distribution system proposed by the present invention, which comprises a plurality of PLCs numbered 1# PLC 200, 2# PLC 201 up to N# PLC 202. All PLCs are connected to a switch 203 through their own Ethernet electrical ports or optical ports. A data acquisition module 204 and a configuration programming module 205 generally run on an industrial personal computer 206, and the industrial personal computer 206 is also connected to the switch through a network port. The plurality of PLCs and the data acquisition module 204 are each integrated with a DDS middleware function, operate as DDS nodes in the same DDS domain, and are formed into a DDS high-speed data distribution network by adopting a peer-to-peer network architecture. The configuration programming module 205 is upper computer software matched with the PLCs, and supports functions such as parameter configuration, hardware configuration, logic programming, simulation and monitoring for the PLCs.
[0035] To perform data exchange between DDS nodes, the nodes generally need to run in the same DDS Domain, and then associate data through publication and subscription of DDS Topic. The PLCs and the data acquisition module 204 described in the present invention all work in the same DDS domain by default, without requiring additional configuration by a user. The publication and subscription process between nodes requires a user to operate in the configuration programming module 205 according to the following steps: (1) configuring communication parameters of a PLC, which is used to generate a unique DDS Topic Name in the network. For example, Figure 2As shown, each PLC in this invention includes a DDS publishing module 300, a DDS subscription module 301, and a configuration calculation module 302. In the configuration interface of the configuration programming module 205, the user needs to set the PLC station number, publishing channel 303 parameters, and network output table 304 parameters. To ensure that the DDS topics in the network are different, the PLC station number must not be duplicated, and the DDS topic name is calculated together with the publishing channel parameters. In this embodiment, the PLC has three publishing channels 303, defined as high-speed, medium-speed, and low-speed, which actually generate three DDS topics. The parameters that need to be set for each publishing channel 303 include: the associated PLC cycle task and the cycle multiplier factor. The PLC cycle task refers to a PLC conforming to the IEC61131-3 standard, supporting the addition of "cycle-type" tasks. The cycle multiplier factor is limited depending on the different publishing channels 303. For example, the cycle multiplier factor setting range for high-speed channels is 1~5, while that for medium-speed channels is 6~15, and for low-speed channels it is 16~50, representing different multiples of the cycle time. Assuming the PLC station number in the above configuration is 1001, the PLC cycle task name configured for high-speed channel 303 is "Task1", and the cycle multiplier factor is 1, then the DDS topic name will be "Topic1001-High-Task1-1" obtained by string concatenation. Since the cycle multiplier factor is 1, the publishing cycle time of this DDS topic is equal to 1 times the task cycle, as shown in Table 1 below.
[0036] Table 1: Example of Parameter Table for Release Channel 303
[0037] (2) Configure the PLC's network output table 304 to define the DDS topic data. Multiple network output tables 304 can be added to the publishing channel 303. The network output table 304 needs to be configured with parameters, including the data address and data length in the output Q area, such as the starting address being QB1000 and the number of bytes being 1024 bytes. Multiple measurement point variables can be added to the network output table 304, such as adding 256 variables of type DINT (DINT is a 4-byte integer). The configuration programming module 205 will automatically bind the corresponding Q area address to each measurement point variable according to the parameters set by the user in the network output table 304, namely QB1000, QB1004, QB1008...QB2020, as shown in Table 2 below.
[0038] Table 2: Examples of Network Output Table Description File 305 Information
[0039] (3) Exporting and importing network output table 304 to realize DDS topic subscription. Network output table 304 can be exported as network output table description file 305, which supports importing into other PLCs or data acquisition modules 204 to realize the subscription of network output table 304 and update the subscription information of PLC's DDS subscription module 301 or data acquisition module 204's DDS subscription module 400. Network output table description file 305 records the necessary information required by DDS subscription module 301, including DDS topic, transmission cycle, timeout time, data address, data length, measurement point variable information, and the output table check value calculated from all the above file information. The check algorithm can be CRC32, CRC64, MD5, etc. When importing network output table description file 305 into PLC, it is necessary to set the starting address of input I area for storing the corresponding measurement point variables. For example, if the data address of network output table description file 305 is QB1000 and the length is 1024 bytes, and the starting address of the input I area is set to IB1000 during import, then the subscribed data will be stored in the area with the starting address IB1000 and a length of 1024 bytes.
[0040] This invention supports real-time communication diagnostics for each imported network output table description file 305. Specifically, after the network output table description file 305 is imported, corresponding diagnostic variables are generated to display the real-time communication status of the network output table 304, including three states: normal communication, communication timeout, and abnormal checksum. The specific diagnostic method is as follows: After receiving a DDS message, the PLC's DDS subscription module 301 checks whether the DDS topic matches. If it matches, it further checks whether the output table checksum in the message is consistent with the previously imported output table checksum. If they match, the measurement point data is copied to the buffer of the DDS subscription module 301, and communication is considered normal. If the DDS topic does not match, the message will not be processed. If multiple instances of DDS topic mismatch or failure to receive messages with the corresponding DDS topic occur consecutively, and the timeout period is reached, it will be considered a communication timeout. If the DDS topic matches but the output table checksum is inconsistent, it will be considered an abnormal checksum. The diagnostic variables are updated in real time to provide users with information for fault diagnosis and problem troubleshooting.
[0041] In this invention, the specific operation of the PLC configuration calculation module 302 is as follows: before the PLC periodic task performs its calculation, it reads the buffer of the DDS subscription module 301, copies the latest data to the input I area, executes the PLC task calculation, and after the calculation is completed, synchronizes the data in the output Q area to the buffer of the DDS publishing module 300, and performs a DDS message transmission. The PLC periodic task's period time can be set, with a minimum setting of 1ms, thus achieving 1ms data synchronization transmission between DDS nodes.
[0042] This invention supports the acquisition of data from multiple PLCs via the data acquisition module 204, enabling long-term data acquisition and display. Specifically, the data acquisition module 204 includes a DDS subscription module 400, a database read / write module 401, and a data display module 402. The DDS subscription module 400 can import a network output table description file 305 to subscribe to data from multiple PLCs; the database read / write module 401 is used to write the received data into the database in real time and supports real-time querying; the data display module 402 allows users to query the data of measurement point variables based on the measurement point name and time interval, and supports display in list or curve format.
[0043] This invention can detect data source configuration modifications in real time, preventing inconsistently configured data from being stored in the PLC or data acquisition module 204. Specifically, there are two scenarios: First, if the parameters of the publishing channel 303 are modified, according to the DDS topic name generation method described above, the DDS topic name will inevitably change, causing all network output tables belonging to that publishing channel 303 to fail to receive data, and diagnostic variables will all display "communication timeout". Second, if a measurement point variable added to a network output table 304, including variable name and variable type, is added, deleted, or its name or type modified by the user, the output table checksum of the network output variable table 304 to which that variable belongs will change, causing the diagnostic variables belonging to that network output table 304 to display "checksum abnormal". When either of these two scenarios occurs, the export and import process of the network output table 304 needs to be repeated to update the subscription information of the PLC's DDS subscription module 301 or the data acquisition module 204's DDS subscription module 400.
[0044] The DDS middleware used in this invention is configured for multicast transmission, which not only adapts to one-to-one communication scenarios but also effectively reduces the network load when multiple PLCs subscribe to the same PLC. The QoS policy used is ReliabilityQosPolicy, which ensures complete data transmission through the retransmission function of the DDS middleware in the event of packet loss or data anomalies.
Claims
1. A high-speed PLC data distribution system based on DDS, comprising multiple PLCs, a switch, and an industrial computer; the multiple PLCs and the industrial computer are respectively connected to the switch; the industrial computer has a built-in data acquisition module and a configuration programming module; characterized in that: The multiple PLCs and data acquisition modules are all configured as DDS nodes, operating in the same DDS domain. They are constructed as a high-speed DDS data distribution network using a peer-to-peer network architecture. The configuration programming module configures the parameters and hardware of the multiple PLCs, while the data acquisition module collects and displays data from these PLCs. Each PLC includes a DDS publishing module, a DDS subscription module, and a configuration calculation module. Each PLC adds a network output table through the DDS publishing module and exports it as a network output table description file. The DDS subscription module imports the network output table description file to subscribe to the network output table. The configuration calculation module performs PLC periodic task calculations and synchronizes the data to the DDS publishing module for DDS message transmission. The DDS subscription module receives DDS messages and performs real-time communication diagnostics and data copying.
2. The high-speed PLC data distribution system based on DDS according to claim 1, characterized in that, The information recorded in the network output table description file includes: DDS topic name, transmission period, timeout, data address, data length, measurement point variable information, and output table check value.
3. The high-speed PLC data distribution system based on DDS according to claim 2, characterized in that, The configuration programming module configures parameters for multiple PLCs, including the station number and network output table parameters for each PLC. The network output table parameter configuration includes setting the starting address of the input I zone for storing the corresponding measurement point variables and binding the corresponding output Q zone address for each measurement point variable.
4. The high-speed PLC data distribution system based on DDS according to claim 3, characterized in that, The process of receiving DDS messages and performing real-time communication diagnostics by the DDS subscription module is as follows: Upon receiving a DDS message, a match check is performed between the received message and the imported network output table description file to determine if the DDS topic name matches. If a match is found, the output table checksum in the DDS message is further checked to ensure it is consistent with the output table checksum in the network output table description file. If consistent, the measurement point data is copied to the buffer of the DDS subscription module, and communication is considered normal. If the DDS topic name does not match, no message processing is performed. If multiple instances of DDS topic name mismatch or failure to receive messages with the corresponding DDS topic name occur consecutively, and the timeout period is reached, communication is considered to have timed out. If the DDS topic name matches but the output table checksum is inconsistent, the checksum is considered abnormal.
5. The high-speed PLC data distribution system based on DDS according to claim 4, characterized in that, Before performing PLC cycle task calculation, the configuration calculation module first reads the buffer of the corresponding DDS subscription module, copies the latest measurement point data into the corresponding input I area, performs PLC cycle task calculation, and after the calculation is completed, synchronizes the data in the output Q area to the buffer of the DDS publishing module and performs a DDS message transmission.
6. The high-speed PLC data distribution system based on DDS according to claim 5, characterized in that, The DDS publishing module also includes multiple publishing channels, and the corresponding publishing channel parameters are set through the configuration programming module. The publishing channel parameters include the associated PLC cycle task and cycle multiplier factor, and are used to generate different DDS topic names in the DDS domain.
7. The high-speed PLC data distribution system based on DDS according to claim 6, characterized in that, The DDS publishing channel includes three virtual channels with configurable parameters: high-speed, medium-speed, and low-speed.
8. The high-speed PLC data distribution system based on DDS according to claim 7, characterized in that, The data acquisition module includes a DDS subscription module, a database read / write module, and a data display module. The data acquisition module imports network output table description files through the DDS subscription module to subscribe to data from multiple PLCs. The database read / write module writes the received data into the database in real time and queries and displays the data through the data display module.
9. The PLC high-speed data distribution method of the DDS-based PLC high-speed data distribution system according to any one of claims 6 to 8, characterized in that, The PLC high-speed data distribution method includes: Parameter configuration: The station number of each PLC, the publishing channel parameters of the DDS publishing module, and the network output table parameters are set through the configuration programming module; PLC Data Subscription: The PLC imports the network output table description file through the DDS subscription module to subscribe to the network output table; Communication diagnostics: After receiving DDS messages through the DDS subscription module, the PLC checks whether the DDS topic name matches the imported network output table description file. If they match, it further checks whether the DDS message and the output table check value in the network output table description file are consistent. If they are consistent, the measurement point data is copied to the buffer of the DDS subscription module and the communication is considered normal. PLC data transmission: The PLC reads the buffer of the DDS subscription module, copies the latest measurement point data to the corresponding input I area, executes the PLC cycle task calculation, and after the calculation is completed, synchronizes the data of the output Q area to the buffer of the DDS publishing module and executes a DDS message transmission. PLC Data Acquisition: The data acquisition module enables the subscription, querying, and display of data from multiple PLCs.
10. The PLC high-speed data distribution method according to claim 9, characterized in that, The PLC adjusts the communication interval of the DDS publishing channel by modifying the task cycle and cycle multiplier factor of the PLC cycle task associated with the publishing channel parameters.