A coupler and host computer communication method and apparatus for parametric thermal configuration

By transparently converting USB and CC-Link protocols in software and employing priority scheduling, dynamic time slot allocation, and frame header compression technologies, the rate limitation and coupler restart issues in the USB and CC-Link protocol conversion are resolved, achieving efficient parameter hot configuration and data transmission.

CN120528733BActive Publication Date: 2025-11-21NANJING SHIDIAN ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511005542.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-21
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

Existing technologies for USB to CC-Link protocol conversion suffer from issues such as communication link redundancy, speed limitations, and the need to restart the coupler for remote I/O module configuration, which cannot meet the requirements for process data object exchange.

Method used

Transparent conversion between USB and CC-Link protocols is achieved through software. Priority scheduling algorithm, dynamic time slot allocation and frame header compression technology are used, combined with CRC check module and double buffer module, to achieve hot parameter configuration without the need for a dedicated hardware converter.

Benefits of technology

In an ideal laboratory environment, the transmission rate reaches 12Mbps, and the remote IO module parameter modification takes only 2-30 seconds, which significantly improves the communication rate and management efficiency, and avoids production line downtime caused by configuration changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120528733B_ABST
    Figure CN120528733B_ABST
Patent Text Reader

Abstract

The application relates to the field of industrial automation communication, and aims at the problems of communication link redundancy, limited rate and remote IO module configuration needing to restart the coupler in the conversion of the USB and CC-Link protocols in the prior art, and provides a coupler and host computer communication method and equipment for parameter hot configuration, efficient conversion between the USB protocol of the host computer and the CC-Link protocol of the coupler is realized through dynamic time slot allocation and frame header compression technology of a protocol stack; the communication stability is guaranteed through the use of a CRC check module, a priority scheduling algorithm and a double buffering module, and dependence on a hardware converter is eliminated; parameter hot configuration of a remote IO module is supported through the construction of a hot loading USB data packet, the coupler does not need to be restarted, and the efficiency of industrial production is significantly improved; the method can be used for data exchange and management of the host computer and the CC-Link coupler.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial automation communication technology, and in particular to a communication method and device between a coupler and a host computer. Background Technology

[0002] In the field of industrial automation, the CC-Link fieldbus protocol is an open industrial network protocol based on RS-485 serial communication and high-speed Ethernet communication technologies. First proposed by Mitsubishi in 1996, this protocol features high speed, reliability, and ease of expansion, and is currently widely used in industrial scenarios such as automation equipment and distributed control systems.

[0003] Figure 1 This document demonstrates the structure of a common CC-Link network in existing technologies, comprising three parts: a CC-Link master station, CC-Link couplers, and field devices. The CC-Link master station is the core control device of the network, including a controller and a host computer. CC-Link couplers are used to expand network nodes, connecting the master station and multiple field devices via the CC-Link bus protocol. Field devices are the network's slave devices, primarily composed of remote I / O modules, servo drives, sensors, etc., responsible for executing master station commands, completing data acquisition or device control tasks, and feeding the results back to the master station. When the host computer and field devices need to communicate, since the host computer uses the USB serial protocol while the coupler uses the CC-Link protocol, a USB-to-CC-Link protocol conversion is required between the host computer and the coupler. Three common solutions exist:

[0004] The first method involves using a dedicated USB-to-CC-Link hardware adapter, such as Mitsubishi's FX-USB-AW module. This type of adapter requires specific configuration software from the manufacturer, resulting in higher costs. Furthermore, its actual conversion efficiency is affected by protocol stack processing latency, with an effective communication rate typically ≤5Mbps.

[0005] The second approach combines a software protocol stack with a virtual driver. This involves using PC software to virtualize the USB port as a CC-Link communication port, relying on the host computer's computing power to complete the protocol conversion. USB and CC-Link protocols differ significantly in three aspects: First, in terms of operating modes, USB relies on passive responses, while CC-Link supports active scheduling by the master station or peer-to-peer communication. Second, regarding data packet formats, USB uses bulk or isochronous transmission, while CC-Link uses fixed-length frames. Third, in terms of real-time performance, CC-Link communication cycles are typically 1ms-10ms, while USB's polling mechanism can lead to excessive latency. Therefore, this conversion scheme is difficult to implement and, limited by the protocol stack's processing performance, the effective communication rate is typically ≤5Mbps, making it difficult to meet the needs of process data object exchange.

[0006] Another industrial approach involves multi-stage conversion, such as HMS's Anybus gateway. This uses RS485 or Ethernet protocols as an intermediary, first transferring data from USB to RS485 or Ethernet, and then to CC-Link to achieve the USB-to-CC-Link conversion. This method is relatively low-cost and currently the mainstream approach. However, because multi-stage conversion increases communication complexity and latency, and is limited by the transmission characteristics of the intermediate protocol's physical layer and the inherent speed limit of the CC-Link protocol itself, the maximum communication rate is typically only 3Mbps, which cannot meet the needs of process data object exchange.

[0007] Meanwhile, in terms of operation, when the master station needs to modify the parameters of the remote I / O module, the current practice is to first stop the communication between the master and slave stations, modify the relevant parameters on the master station using configuration tools or software, then restart the coupler to initialize the communication link, and finally resume production. This process requires restarting the coupler and interrupting production, and based on practical experience, this process usually takes more than 2 minutes, which to some extent affects the efficiency of industrial automation. Summary of the Invention

[0008] To address the problems of communication link redundancy, speed limitation, and the need to restart the coupler for remote I / O module configuration in the prior art when converting between USB and CC-Link protocols, this invention proposes a method and device for communication between a coupler and a host computer for hot parameter configuration. It achieves transparent conversion between USB and CC-Link protocols through software, without the need for a dedicated hardware converter. In an ideal laboratory environment, the transmission rate reaches 12Mbps, and it supports hot parameter configuration without restarting the coupler.

[0009] To achieve the above objectives, the present invention proposes the following technical solution:

[0010] This technical solution provides a method for communication between a coupler and a host computer for hot-configuration of parameters. It enables data exchange and management between the host computer and the coupler and field devices via the CC-Link protocol using the USB protocol. The method is characterized by including:

[0011] S1: The user initiates a parameter hot configuration request. The host computer constructs a USB data packet containing a hot loading identifier, uses a priority scheduling algorithm to identify and prioritize the transmission of high-priority data packets, and transmits them to the coupler via the USB protocol.

[0012] S2: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates USB data packets into CC-Link frames for transmission, where the hot-load flag is allocated to the first time slot of the CC-Link frame;

[0013] S3: The coupler forwards the CC-Link frame to the field device; the field device receives the USB data packet and stores it in the spare memory area, writes the switching instruction, completes the hot-switching configuration, and returns the execution result;

[0014] S4: The coupler receives the execution result, parses the execution result into a USB data packet using the frame header compression technology of the protocol stack, adds a CRC check code, and forwards it to the host computer;

[0015] S5: The host computer receives USB data packets and parses them into raw data, and uses a double buffer module to manage the raw data;

[0016] S6: The host computer uses the CRC check module to verify the original data. If the verification is successful, it will indicate that the configuration is successful and update the version number to the configuration management database.

[0017] Specifically, in step S1, the USB data packet further includes a frame header, device address, parameter ID to be modified, new parameter value, and version number. The hot-load flag is a 1-byte status flag, located after the frame header and before the device address, indicating that there is configuration data in the current data packet that needs to be updated in real time. The hot-load flag enables the host computer, coupler, and field devices to quickly identify and prioritize the processing of configuration data that needs to be updated in real time, ensuring that field devices can quickly complete parameter modifications during operation without restarting, greatly improving the system's response speed and operating efficiency.

[0018] Specifically, the priority scheduling algorithm is implemented in the host computer, and the specific steps are as follows:

[0019] During the data uplink process, when the host computer detects event-triggered data, it prioritizes processing and transmitting the event-triggered data; when there is no event-triggered data, it processes and transmits periodic data according to a predetermined cycle.

[0020] During the data downlink process, when the host computer needs to send critical instructions, it prioritizes processing and transmitting the critical instructions; the critical instructions include control commands and hot-load configuration update instructions; when there are no critical instructions, it processes and transmits periodic data according to a predetermined cycle.

[0021] Furthermore, the data uplink process is the transmission of data from the field device to the host computer, and the data downlink process is the transmission of data from the host computer to the field device. The priority scheduling algorithm ensures that high-priority data can be transmitted quickly, meeting real-time requirements, by prioritizing the processing of hot-load flags, control commands, and event-triggered data.

[0022] Specifically, the protocol stack is located in the coupler and is used to parse USB data packets into CC-Link protocol frames, or vice versa; the CC-Link protocol frame contains address, function code, and data field information. This design makes the coupler the core node of the entire protocol conversion, which simplifies the link architecture compared to multi-level conversion methods, ensures the high efficiency of protocol conversion, and improves communication efficiency.

[0023] Furthermore, the specific steps of the dynamic time slot allocation are as follows: the protocol stack divides the CC-Link communication cycle into multiple time slots according to data priority; the data packet corresponding to the hot-load flag is forcibly allocated to the first time slot for transmission, and the remaining data types are dynamically allocated to the remaining time slots according to real-time requirements. This ensures the real-time performance of key instructions and data transmissions such as the hot-load flag, optimizes the resource utilization of the communication link, and improves the overall link efficiency of USB and CC-Link protocol conversion.

[0024] Furthermore, the specific steps of the frame header compression technology are as follows: the protocol stack performs differential encoding on the frame header fields of consecutive CC-Link frames, transmitting only the differences between adjacent frames, and compressing consecutive 0-value fields. By removing duplicate parts in consecutive frames through the compression algorithm, the amount of frame header data is reduced, achieving efficient data transmission.

[0025] Specifically, in step S4, the CRC checksum is generated by the host computer or coupler and is used to perform CRC check on the data packet to ensure data integrity; this ensures the integrity and security of data transmission and provides feedback for the quality and parameter configuration of the communication link.

[0026] Specifically, the working steps of the double buffer module are as follows:

[0027] The host computer establishes a periodic data buffer to store periodically uploaded data; and establishes an event trigger buffer to store event-triggered data.

[0028] Data is read from and parsed from the periodic data buffer or the event-triggered buffer according to functional requirements;

[0029] It provides a data buffer management interface, allowing users to configure the buffer size and update cycle parameters as needed.

[0030] By establishing periodic data buffers and event-triggered buffers, data conflicts are avoided, enabling the host computer to prioritize event-triggered data based on data type, ensuring data real-time performance. At the same time, a buffer management interface is provided, allowing users to adjust the buffer resource allocation and data update frequency according to specific application scenarios and real-time requirements, thereby optimizing the host computer's performance and response speed.

[0031] Specifically, in step S6, the host computer uses the CRC check module to verify the original data packet and determine the execution result, specifically as follows:

[0032] If the execution result is an ACK signal and the current running version number, then the execution was successful;

[0033] If the execution result is a NAK signal and an error code, the execution has failed; the error code indicates a verification failure, parameter out-of-bounds error, or version conflict. This allows for quick and easy problem identification and increases the reliability of the method.

[0034] Specifically, in step S6, if the verification result of the original data fails, the user is prompted that the configuration has failed, and the exception handling mechanism is activated:

[0035] S61: The host computer retransmits the configuration package data for the first time. If a success signal is received, it indicates that the configuration is successful and the process ends.

[0036] S62: If the first retransmission fails, the host computer will perform the following troubleshooting operations in sequence:

[0037] Check the device connection and operating status. If the device is not connected or not running, try reconnecting or restarting it.

[0038] Scan the network topology to identify and update device addresses and communication paths;

[0039] Verify the format and range of the data to be sent; if the data format or range is incorrect, correct the data and resend it.

[0040] Check the compatibility between the device firmware version and the host computer software version; if the versions are incompatible, prompt the user to update.

[0041] S63: After completing the above diagnosis, the host computer will resend the message a second time; if the second resend fails, the user will be prompted to choose to continue retrying or switch to manual configuration mode.

[0042] S64: If the user chooses to continue retrying, a third retransmission will be performed; if the three retransmissions fail, the configuration data will not be retransmitted, and the user will be prompted to contact technical support.

[0043] By using the step-by-step troubleshooting and retry mechanism of S61-S64, the causes of configuration failures are diagnosed and resolved step by step, providing clear user feedback, ensuring that problems can be discovered and handled in a timely manner, and improving the stability of the method.

[0044] The present invention also provides a master station device for communication between a coupler for hot parameter configuration and a host computer, comprising:

[0045] A processing unit, wherein the processing unit is configured to implement each step of the method for communication between a coupler and a host computer for parameter hot configuration as described in any of the preceding claims;

[0046] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for communication between a coupler and a host computer for hot-configuration of parameters as described above.

[0047] Beneficial effects:

[0048] As can be seen from the above technical solutions, the present invention addresses the problems of communication link redundancy, rate limitation, and the need to restart the coupler for remote IO module configuration in the conversion between USB and CC-Link protocols in the prior art. It proposes a method and device for communication between the coupler and the host computer for hot parameter configuration, realizing transparent conversion between USB and CC-Link protocols without the need for a dedicated hardware converter, and supporting hot parameter configuration without restarting the coupler.

[0049] The technical effects brought about by the technical solution described in this invention are as follows:

[0050] 1. In terms of communication speed, the traditional method for converting between USB protocol and CC-Link protocol usually achieves a communication speed of around 5Mbps. Based on existing technology, this method uses dynamic time slot allocation and frame header compression technology in the protocol stack to achieve data compression and efficient conversion between the host computer's USB protocol and the coupler's CC-Link protocol. Under ideal laboratory conditions, the transmission speed reaches 12Mbps, which is a significant improvement in communication speed compared to the traditional mode.

[0051] 2. Regarding the equipment configuration process, the traditional method for configuring devices such as remote I / O modules usually requires restarting the coupler, which takes more than 2 minutes. This method constructs a hot-loaded USB data packet and uses a priority scheduling algorithm to ensure that the data packet is updated and transmitted in real time. This enables the rapid modification and real-time effect of remote I / O module parameters without restarting the coupler, taking only 2-30 seconds with a latency of <100ms. This avoids production line downtime caused by configuration modifications and significantly improves management efficiency.

[0052] 3. In other aspects, this method combines a CRC check module, a priority scheduling algorithm, and a double buffer module to ensure the real-time transmission of critical data, guarantee communication stability, and meet the needs of high-speed process data exchange. It also eliminates the reliance on dedicated hardware converters, reducing usage costs.

[0053] It should be understood that all combinations of the foregoing concepts and the additional concepts described in more detail below can be considered part of the inventive subject matter of this disclosure, provided that such concepts do not contradict each other.

[0054] The foregoing and other aspects, embodiments, and features of the teachings of the present invention will be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the invention, such as features and / or beneficial effects of exemplary embodiments, will become apparent from the following description or may be learned through practice of specific embodiments according to the teachings of the present invention. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0056] Figure 1 This is a diagram illustrating the structure of a common CC-Link network in existing technologies.

[0057] Figure 2 This is a hardware communication link diagram disclosed in an embodiment of this application;

[0058] Figure 3 This is a schematic diagram of a system composition based on the method disclosed in an embodiment of this application;

[0059] Figure 4 This is a flowchart illustrating a method for communication between a coupler and a host computer for hot-configuration of parameters, as disclosed in an embodiment of this application.

[0060] Figure 5This is a time slot diagram illustrating a dynamic time slot allocation method disclosed in an embodiment of this application;

[0061] Figure 6 This is a flowchart of a process object data exchange disclosed in an embodiment of this application. Detailed Implementation

[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] Before introducing this application, the relevant technologies of this application will be introduced first.

[0064] In the field of industrial automation, the CC-Link fieldbus protocol is an open industrial network protocol based on RS-485 serial communication and high-speed Ethernet communication technologies. First proposed by Mitsubishi in 1996, this protocol features high speed, reliability, and ease of expansion, and is currently widely used in industrial scenarios such as automation equipment and distributed control systems. PDO data, or Process Data Object, is a short-frame data format used by fieldbus protocols like CC-Link to transmit real-time data from field devices. PDO data transmission can be triggered in various ways, including periodic transmission and event triggering; a PDO request refers to an operation or signal that triggers PDO data transmission. In motion control systems or distributed industrial I / O systems, large amounts of real-time control data, sensor information, and device status data are packaged and transmitted in PDO data format; therefore, bandwidth requirements in such scenarios often exceed 5Mbps.

[0065] Figure 1 This is a common structure in existing CC-Link networks, consisting of three parts: a CC-Link master station, CC-Link couplers, and field devices. The CC-Link master station is the core control device of the network, including a controller and a host computer. The CC-Link couplers are used to expand network nodes, connecting the master station and multiple field devices via the CC-Link bus protocol. The field devices are the network's slave devices, mainly composed of remote I / O modules, servo drives, sensors, etc., responsible for executing master station commands, completing data acquisition or device control tasks, and feeding the results back to the master station. When the host computer and field devices need to communicate, since the host computer uses the USB serial protocol while the coupler uses the CC-Link protocol, a USB-to-CC-Link protocol conversion is required between the host computer and the coupler.

[0066] The application scenarios of this application are described below.

[0067] Figure 2 This application discloses a hardware communication link diagram, taking the downlink data process as an example:

[0068] First, the host computer, i.e., a PC or industrial control computer, outputs communication data through a USB interface, relying on the USB CDC driver to encapsulate the data into USB data packets.

[0069] Then, a USB protocol parsing chip is placed in the middle of the link between the coupler and the host computer's USB interface. It receives USB data packets from the host computer and converts the USB data into a serial UART signal (TTL level), realizing the physical layer conversion between the USB protocol and the serial protocol. In this embodiment, the chip model used is either FTDI's FT232H or Silicon Labs' CP2102.

[0070] Secondly, the CC-Link coupler incorporates a dedicated protocol conversion chip to convert UART signals into CC-Link differential signals. Simultaneously, opto-isolation and terminating resistor matching enhance anti-interference capabilities. In this embodiment, the protocol conversion chip is a Renesas CC-Link PHY chip; the standard value of the terminating resistor is 110Ω±1%, an E96 series precision resistor; in short-distance scenarios (<20m between the host computer and the coupler), a 100-120Ω resistor is used; in long-distance scenarios (≥20m between the host computer and the coupler), a 110Ω resistor plus an adjustable potentiometer ranging from 90-150Ω is used.

[0071] Finally, there are the field devices. The remote I / O module is used to receive configuration instructions from the host computer, perform hot-loading configuration of parameters, or control sensors or actuators. The servo driver obtains and executes motion control instructions from the host computer, such as position and speed, through CC-Link.

[0072] Figure 3 This is a schematic diagram of a system composition based on the method disclosed in an embodiment of this application, including a host computer and a coupler:

[0073] The host computer includes an application function layer, a data management layer, and a physical interface; it enables modular management of data transmission and application functions, resulting in a clear system structure that is easy to manage and expand.

[0074] Furthermore, the application function layer is connected to the data management layer through a software interface. The application function layer includes a parameter configuration module, a topology discovery module, a device diagnosis module, a process data management module, and a firmware upgrade module, which are used by users to configure parameters, discover and manage network topology, diagnose device faults, manage process data, and upgrade firmware. Through modular design, the functional processing flow is optimized, making it convenient for users to configure and manage.

[0075] The data management layer is connected to the physical interface via a data bus. This layer is responsible for CRC verification, double-buffered data management, priority scheduling, and exception handling. It includes a CRC verification module, a double-buffered module, a priority scheduling module, and an exception handling state device. The CRC verification module verifies data integrity to ensure error-free data transmission. The double-buffered module manages data, providing independent storage space for periodic and event-triggered data to avoid data conflicts and loss, further optimizing data processing efficiency and communication stability. The priority scheduling module schedules data according to its importance and urgency, optimizing the transmission order. The exception handling state device handles abnormal situations during data transmission, ensuring system stability. The combination of CRC verification, double-buffered modules, priority scheduling, and exception handling ensures data integrity, optimizes transmission order, and improves communication stability and speed.

[0076] The physical interface connects to a CC-Link coupler via a USB interface and data cable. The physical interface includes a USB CDC driver, an electrical isolation circuit, and a signal shaping unit. The USB CDC driver encapsulates data into USB data packets, enabling communication between the host computer and the USB interface. The electrical isolation circuit reduces interference during signal transmission. The signal shaping unit shapes and optimizes the signal, ensuring signal integrity and transmission quality. The combination of these three components reduces interference and loss, supporting high-speed transmission.

[0077] Furthermore, the host computer receives USB data packets through a physical interface and parses them into raw data. The data management layer performs functional processing on the raw data, including transformation, mapping, encapsulation, and adding necessary metadata so that the application functional layer obtains the required data format. The metadata includes timestamps, data source identifiers, and data types. This ensures that data is transmitted to the application functional layer in a standardized format, thereby improving data readability, traceability, and usability.

[0078] The coupler includes a CRC check module and a protocol stack:

[0079] The CRC check module is responsible for generating CRC check codes and performing CRC checks on received data packets to ensure data integrity.

[0080] The protocol stack is used to implement data conversion between the USB protocol and the CC-Link protocol. The protocol stack uses frame header compression technology to parse the execution result into USB data packets, adds a CRC checksum, and forwards it to the host computer. It uses dynamically allocated time slots to encapsulate the USB data packets into CC-Link frames, with the hot-load identifier allocated to the first time slot of the CC-Link frame for transmission. Traditional methods typically require dedicated hardware converters, such as Mitsubishi's FX-USB-AW module or HMS's Anybus gateway, to achieve USB to CC-Link protocol conversion. The effective communication rate is usually ≤5Mbps, resulting in high hardware costs and requiring additional configuration and maintenance. In this invention, the coupler integrates protocol conversion and verification functions. This design simplifies the system structure and optimizes the data transmission rate. Simultaneously, the combination of a priority scheduling algorithm and a double-buffered module ensures the timeliness of critical data, improving the reliability and flexibility of USB and CC-Link protocol conversion and data management.

[0081] Figure 4 This is a flowchart illustrating a method for communication between a coupler and a host computer for hot parameter configuration, as disclosed in an embodiment of this application.

[0082] This technical solution provides a method for communication between a coupler and a host computer for hot-configuration of parameters. It enables data exchange and management between the host computer and the coupler and field devices via the CC-Link protocol using the USB protocol. The method is characterized by including:

[0083] S1: The user initiates a parameter hot configuration request. The host computer constructs a USB data packet containing a hot loading identifier, uses a priority scheduling algorithm to identify and prioritize the transmission of high-priority data packets, and transmits them to the coupler via the USB protocol.

[0084] S2: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates USB data packets into CC-Link frames for transmission, where the hot-load flag is allocated to the first time slot of the CC-Link frame;

[0085] S3: The coupler forwards the CC-Link frame to the field device; the field device receives the USB data packet and stores it in the spare memory area, writes the switching instruction, completes the hot-switching configuration, and returns the execution result;

[0086] S4: The coupler receives the execution result, parses the execution result into a USB data packet using the frame header compression technology of the protocol stack, adds a CRC check code, and forwards it to the host computer;

[0087] S5: The host computer receives USB data packets and parses them into raw data, and uses a double buffer module to manage the raw data;

[0088] S6: The host computer uses the CRC check module to verify the original data. If the verification is successful, it will indicate that the configuration is successful and update the version number to the configuration management database.

[0089] Specifically, in step S1, the USB data packet further includes a frame header, device address, parameter ID to be modified, new parameter value, and version number. The hot-load flag is a 1-byte status flag placed after the frame header and before the device address, indicating that there is configuration data in the current data packet that needs to be updated in real time. The hot-load flag enables the host computer, coupler, and field devices to quickly identify and prioritize the processing of configuration data that needs to be updated in real time, ensuring that field devices can quickly complete parameter modifications during operation without restarting, greatly improving the system's response speed and operating efficiency.

[0090] In a specific implementation, this embodiment discloses a USB data packet format:

[0091]

[0092] Specifically, the priority scheduling algorithm is implemented in the host computer, and the specific steps are as follows:

[0093] During the data uplink process, when the host computer detects event-triggered data, it prioritizes processing and transmitting the data; when there is no event-triggered data, it processes and transmits periodic data according to a predetermined cycle.

[0094] During the data downlink process, when the host computer needs to send a critical instruction, it will prioritize processing and transmitting the instruction; the critical instructions include control commands and hot-load configuration update instructions; when there are no critical instructions, periodic data will be processed and transmitted according to a predetermined cycle.

[0095] Furthermore, the data uplink process is the transmission of data from the field device to the host computer, and the data downlink process is the transmission of data from the host computer to the field device. The predetermined period is a time interval pre-set by the algorithm for processing and transmitting periodic data. In this embodiment, the predetermined period is 500ms. The priority scheduling algorithm ensures that high-priority data can be transmitted quickly by prioritizing the processing of hot-load flags, control commands, and event-triggered data, thus meeting real-time requirements.

[0096] In practical implementation, taking data uplink as an example, the above priority scheduling algorithm includes the following:

[0097] (1) The host computer receives the data packet from the coupler, temporarily stores the data packet in the queue, and waits for processing;

[0098] (2) The host computer identifies the data type of each data packet and determines its priority according to the data type, including three priorities: high, medium and low. Among them, high priority includes hot reload flag, medium priority includes control commands and event trigger data, and low priority includes periodic data.

[0099] (3) First find all high-priority data packets, such as control commands, in the queue and process them first; if there are no high-priority data packets, find all medium-priority data packets and process them; if there are no high-priority and medium-priority data packets, process the low-priority data packets.

[0100] Specifically, the protocol stack is located within the coupler and is used to parse USB data packets into CC-Link protocol frames, or vice versa. The CC-Link protocol frame contains address, function code, and data field information. This design makes the coupler the core node of the entire protocol conversion process. Compared to multi-level conversion methods, this simplifies the link architecture, ensures high efficiency in protocol conversion, and improves communication efficiency. In practical implementation, the protocol stack uses a set of function codes for operations between the host computer and the coupler. Each function code is 1 byte long and corresponds to a specific operation, including:

[0101]

[0102] This embodiment also discloses the request and response message formats of the protocol stack, taking the acquisition of IO module information at 0x02 as an example:

[0103] The request message format is as follows:

[0104]

[0105] The response message format is as follows:

[0106]

[0107] Furthermore, Figure 5 This is a time slot diagram illustrating a dynamic time slot allocation method disclosed in an embodiment of this application.

[0108] The dynamic time slot allocation refers to the protocol stack dividing the CC-Link communication cycle into multiple time slots based on data priority; the data packet corresponding to the hot-load flag is forcibly allocated to the first time slot for transmission, while other data types are dynamically allocated to the remaining time slots according to real-time requirements. This ensures the real-time performance of critical instructions and data transmissions such as the hot-load flag, optimizes resource utilization of the communication link, and improves the overall link efficiency of the USB and CC-Link protocol conversion.

[0109] In specific implementation, combined with Figure 5As shown, the protocol stack divides the CC-Link communication cycle into N time slots, each with a length of 2ms. The hot-load flag data packet has the highest priority and is forced to occupy the first time slot. Control commands, event trigger data, and multiple periodic data packets occupy time slots 2, 3, 4, and N sequentially. At a certain moment, if the protocol stack detects new high-priority event trigger data that needs to be transmitted, and time slot 3 is already occupied, the stack dynamically adjusts the time slot allocation, moving the data from time slot 3 to other time slots, such as time slot 4 or 5, and allocating the new event trigger data to time slot 3 to ensure that high-priority data is transmitted first. This ensures the real-time transmission of critical commands and data such as the hot-load flag, optimizes resource utilization of the communication link, and improves the overall link efficiency of the USB and CC-Link protocol conversion.

[0110] Furthermore, the specific steps of the frame header compression technology are as follows: the protocol stack performs differential encoding on the frame header fields of consecutive CC-Link frames, transmitting only the differences between adjacent frames and compressing consecutive 0-value fields. By removing repetitive parts in consecutive frames through the compression algorithm, the amount of frame header data is reduced, achieving efficient data transmission. This embodiment uses differential encoding or run-length encoding algorithms because: differential encoding reduces data transmission by transmitting only the differences between two consecutive headers instead of sending the entire header; run-length encoding skips 0 values ​​and only encodes the number of consecutive 0s, which is very effective for frame header data with a large number of consecutive 0 values. Compared to other compression algorithms such as Huffman coding, these two algorithms require less computational resources, are simpler to implement, and are more suitable for scenarios with high real-time requirements and limited resources, such as real-time process data transmission and hot-loading parameter configuration in industrial communication.

[0111] In practical implementation, taking the differential coding algorithm as an example, the process of compressing the frame header is as follows:

[0112] The frame header data for three consecutive frames is as follows:

[0113] Frame 1: Address = 0x01, Function Code = 0x03, Data Length = 0x00A0

[0114] Frame 2: Address = 0x01, Function Code = 0x03, Data Length = 0x00B0

[0115] Frame 3: Address = 0x01, Function Code = 0x03, Data Length = 0x00C0

[0116] In differential coding, the protocol stack only sends the parts that differ from the previous frame:

[0117] Frame 1: Sends the complete frame header, 0x010x030x000xA0

[0118] Frame 2: Only transmits the change in data length, 0x000x10, indicating that the data length has increased by 0x10.

[0119] Frame 3: Similarly, only the data length changes are sent, 0x000x10, then another 0x10 is added.

[0120] The advantage of this method is that it reduces the size of the frame header, enabling efficient data transmission and thus improving communication efficiency. In other scenarios, differential coding algorithms can also be combined with techniques such as run-length coding to further optimize the compression effect.

[0121] Specifically, in step S4, the CRC checksum is generated by the host computer or coupler and used to perform CRC verification on the data packet to ensure data integrity. This ensures the integrity and security of data transmission and provides feedback for the quality of the communication link and system parameter configuration. In a specific implementation, taking the CRC-16 algorithm as an example, if the original data is 0x12, the above CRC verification process is as follows:

[0122] (1) Initialize the CRC register to all 0x0000;

[0123] (2) Process the data byte by byte, including: XOR 0x12 with the high 8 bits of the CRC register 0x00, the result is 0x12; shift the CRC register right by 8 bits, the result is 0x0012; perform polynomial division on 0x0012 using the generator polynomial 0x8005; after polynomial division, the final result is 0x3F2B;

[0124] (3) Append the calculated CRC check code 0x3F2B to the end of the original data to form a complete data packet 0x120x340x560x780x3F0x2B, and send it to the host computer;

[0125] (4) The host computer receives the data packet and extracts the original data 0x120x340x560x78 and the received CRC checksum. The host computer recalculates the original data using the same CRC-16 algorithm and generator polynomial 0x8005, and calculates the CRC checksum as 0x3F2B.

[0126] (5) Compare the calculated CRC checksum with the received CRC checksum. If they are the same, the data is complete and the verification is successful.

[0127] The CRC verification process described above ensures the integrity and security of data during transmission, thus guaranteeing the quality of the communication link and the stability of the system.

[0128] Specifically, the working steps of the double buffer module include:

[0129] The host computer establishes a periodic data buffer to store periodically uploaded data; and establishes an event trigger buffer to store event-triggered data.

[0130] Data is read from and parsed from the periodic data buffer or the event-triggered buffer according to functional requirements;

[0131] It provides a data buffer management interface, allowing users to configure the buffer size and update cycle parameters as needed.

[0132] In practical implementation, taking data uplink as an example, the working process of the above-mentioned double buffer module includes:

[0133] (1) The host computer receives data packets from the coupler: Sequence number 1 is periodic data with low priority; Sequence number 2 is event-triggered data with medium priority; Sequence number 3 is control command with high priority; Sequence number 4 is periodic data with low priority.

[0134] (2) The host computer temporarily stores the data packets into the corresponding buffer according to the type of the data packets. For example, the periodic data with sequence number 1 is stored in the periodic data buffer, and the event-triggered data with sequence number 2 is stored in the event-triggered buffer.

[0135] (3) The host computer reads and parses data from the periodic data buffer or the event trigger buffer according to the functional requirements.

[0136] (4) The host computer provides a buffer management interface for users to configure the size and update cycle parameters of the buffer as needed.

[0137] By establishing periodic data buffers and event-triggered buffers as described above, data conflicts are avoided, enabling the system to prioritize event-triggered data based on data type, ensuring data real-time performance. Simultaneously, a buffer management interface is provided, allowing users to adjust buffer resource allocation and data update frequency according to specific application scenarios and real-time requirements, thereby optimizing system performance and response speed.

[0138] Specifically, in step S6, the host computer uses the CRC check module to verify the original data packet and determine the execution result, specifically as follows:

[0139] If the execution result is an ACK signal and the current running version number, then the execution was successful;

[0140] If the execution result is a NAK signal and an error code, the execution has failed; the error code indicates a verification failure, parameter out-of-bounds error, or version conflict. This approach facilitates quick problem identification and increases the reliability of the method.

[0141] Specifically, in step S6, if the verification result of the original data fails, the user is prompted that the configuration has failed, and the exception handling mechanism is activated:

[0142] S61: The host computer retransmits the configuration package data for the first time. If a success signal is received, it indicates that the configuration is successful and the process ends.

[0143] S62: If the first retransmission fails, the host computer will perform the following troubleshooting operations in sequence:

[0144] Check the device connection and operating status. If the device is not connected or not running, try reconnecting or restarting it.

[0145] Scan the network topology to identify and update device addresses and communication paths;

[0146] Verify the format and range of the data to be sent; if the data format or range is incorrect, correct the data and resend it.

[0147] Check the compatibility between the device firmware version and the host computer software version; if the versions are incompatible, prompt the user to update.

[0148] S63: After completing the above diagnosis, the host computer will resend the message a second time; if the second resend fails, the user will be prompted to choose to continue retrying or switch to manual configuration mode.

[0149] S64: If the user chooses to continue retrying, a third retransmission will be performed; if the three retransmissions fail, the configuration data will not be retransmitted, and the user will be prompted to contact technical support.

[0150] By using the step-by-step troubleshooting and retry mechanism of S61-S64, the causes of configuration failures are diagnosed and resolved step by step, providing clear user feedback, ensuring that problems can be detected and handled in a timely manner, and improving system stability.

[0151] This invention prioritizes the processing of hot-load flags, control commands, and event-triggered data, ensuring rapid transmission of high-priority data to meet real-time requirements and guarantee communication speed. Simultaneously, the integration of a dual-buffering module provides independent storage space for periodic and event-triggered data, preventing data conflicts and loss, further optimizing data processing efficiency and communication stability. Furthermore, the combination of the host computer's priority scheduling algorithm and the dual-buffering module ensures the timeliness of critical data while improving the reliability and flexibility of USB and CC-Link protocol communication and data management.

[0152] Figure 6 This is a flowchart of a process object data exchange disclosed in an embodiment of this application.

[0153] Furthermore, the method also supports a working mode that is executed during process data exchange. Figure 6 The data exchange process shown specifically includes:

[0154] A1: The host computer generates PDO requests through the application function layer based on user requests or predetermined cycles; the application function layer uses a double buffer module to store the PDO requests in an event trigger buffer for fast response.

[0155] A2: The protocol stack reads the PDO request from the event trigger buffer and determines the priority of the request according to the priority scheduling algorithm; the protocol stack encapsulates the PDO request into a request frame and sends it to the coupler.

[0156] A3: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates the request frame into a CC-Link frame; if the request frame has a high priority, it will be allocated to the first time slot for transmission; the coupler forwards the CC-Link frame to the field device.

[0157] A4: After receiving the acquisition command, the field device acquires the current data and generates a response frame; the field device returns the response frame to the coupler.

[0158] A5: The coupler receives the CC-Link response frame and encapsulates it for the protocol stack. The protocol stack performs CRC verification and converts it into a USB data packet.

[0159] If the CRC check is successful, the protocol stack will send the parsed data to the application interface.

[0160] If the CRC check fails, the protocol stack initiates an automatic retransmission mechanism to resend the process data object request.

[0161] A6: The application function layer displays PDO data; the application function layer uses a double buffer module to store the parsed data in a periodic data buffer for subsequent processing and analysis.

[0162] The method performs the following when hot-configuring parameters: Figure 4 The process is shown; when exchanging process data, the following steps are executed: Figure 6 The process is illustrated. Based on the above mechanism, an efficient and reliable process object data exchange mechanism can be achieved, ensuring fast and accurate transmission of data requests and responses from the host computer to field devices.

[0163] In addition, we tested the rate performance and parameter hot configuration time of the method.

[0164] Test traffic was generated using the network performance testing tool IxiaChariot, physical layer signal integrity was captured using a Keysight 3000T oscilloscope, and industrial interference was simulated using a PLC noise generator. Figure 2In the hardware scenarios, separate tests and comparative tests were conducted. The ideal laboratory environment consisted of a 1-meter cable in an interference-free environment, while the industrial environment was an EMC-tested 30-meter cable environment. The comparative tests included continuous data transmission, mixed data packet transmission, and retransmission scenarios. The continuous data transmission scenario tested performance under interference-free conditions; the mixed data packet transmission scenario tested performance when multiple data packet types, including control commands and data packets, were transmitted; and the retransmission scenario tested communication performance when data retransmission was required.

[0165] The results of this method tested individually are as follows:

[0166]

[0167] The test results comparing this method with other methods are as follows:

[0168]

[0169] Note: Traditional hardware solution refers to the Mitsubishi FX-USB-AW module, and multi-level gateway solution refers to the HMS AnybusX gateway.

[0170] Test conclusion:

[0171] This method achieved an average rate of 11.8 Mbps, a peak rate of 12.1 Mbps, and a transmission delay of 0.8 ms in an ideal laboratory environment (i.e., 1-meter cable, interference-free environment); while in an industrial field environment (i.e., EMC tested, 30-meter cable environment), the average rate was between 9.2 and 10.5 Mbps, the peak rate reached 11.3 Mbps, and the transmission delay was between 1.2 and 3.5 ms.

[0172] In comparison, traditional hardware solutions and multi-level gateway solutions have significantly lower speed performance than this invention in continuous data transmission, mixed data packet transmission, and retransmission scenarios, at 4.3Mbps / 2.7Mbps, 3.1Mbps / 1.8Mbps, and 2.3Mbps / 0.9Mbps, respectively.

[0173] Regarding the modification of IO module parameters, this method does not require restarting the coupler and takes only 2-30 seconds with a latency of <100ms. In contrast, traditional hardware solutions require restarting the coupler, which takes >2 minutes, and while multi-level gateway solutions do not require restarting the coupler, they still take 1-5 minutes. Therefore, this method is significantly superior to traditional hardware solutions and multi-level gateway solutions in terms of parameter configuration time and latency.

[0174] These data show that the average communication rate of the present invention can reach about 12Mbps under ideal conditions, and it can provide better performance in different scenarios. In particular, it shows high transmission rate and low latency in industrial automation applications, which has great advantages.

[0175] Additionally, this embodiment includes a master station device for communication between a coupler used for hot parameter configuration and a host computer, comprising:

[0176] The processing unit is used to implement the various steps of the method for communication between a coupler for hot parameter configuration and a host computer according to the present application.

[0177] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps of a method for communication between a coupler and a host computer for hot-configuration of parameters, as described in this application.

[0178] Since the processing unit and readable storage medium are both built based on the method and used to implement the method, in practical applications, they can effectively address the problems of communication link redundancy, rate limitation, and the need to restart the coupler for remote IO module configuration that occur during the conversion between USB and CC-Link protocols. This enables transparent conversion between USB and CC-Link protocols and allows for hot configuration of parameters without restarting the coupler, thereby improving production efficiency.

[0179] While the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Those skilled in the art can make various modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention shall be determined by the claims.

Claims

1. A method for communication between a coupler and a host computer for hot parameter configuration, characterized in that, include: S1: The user initiates a parameter hot configuration request. The host computer constructs a USB data packet containing a hot loading identifier, uses a priority scheduling algorithm to identify and prioritize the transmission of high-priority data packets, and transmits them to the coupler via the USB protocol. S2: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates USB data packets into CC-Link frames for transmission, where the hot-load flag is allocated to the first time slot of the CC-Link frame; S3: The coupler forwards the CC-Link frame to the field device; the field device receives the USB data packet and stores it in the spare memory area, writes the switching instruction, completes the hot-switching configuration, and returns the execution result; S4: The coupler receives the execution result, parses the execution result into a USB data packet using the frame header compression technology of the protocol stack, adds a CRC check code, and forwards it to the host computer; S5: The host computer receives USB data packets and parses them into raw data, and uses a double buffer module to manage the raw data; S6: The host computer uses the CRC check module to verify the original data. If the verification is successful, it will indicate that the configuration is successful and update the version number to the configuration management database.

2. The method for communication between a coupler and a host computer for hot parameter configuration according to claim 1, characterized in that, In step S1, the USB data packet further includes a frame header, device address, parameter ID to be modified, new parameter value, and version number; the hot-load identifier is a 1-byte status identifier, located after the frame header and before the device address.

3. The method for communication between a coupler and a host computer for hot parameter configuration according to claim 1, characterized in that, The priority scheduling algorithm is implemented in the host computer, and specifically is as follows: During the data uplink process, when the host computer detects event-triggered data, it prioritizes processing and transmitting the event-triggered data; when there is no event-triggered data, it processes and transmits periodic data according to a predetermined cycle. During the data downlink process, when the host computer needs to send critical instructions, it prioritizes processing and transmitting the critical instructions; the critical instructions include control commands and hot-load configuration update instructions; when there are no critical instructions, it processes and transmits periodic data according to a predetermined cycle.

4. The method for communication between a coupler and a host computer for hot parameter configuration according to claim 1, characterized in that, The specific steps of the dynamic time slot allocation are as follows: the protocol stack divides the CC-Link communication cycle into multiple time slots according to data priority; the data packets corresponding to the hot-load identifier are forcibly allocated to the first time slot for transmission, and the remaining data types are dynamically allocated to the remaining time slots according to real-time requirements.

5. A method for communication between a coupler and a host computer for hot-configuration of parameters according to claim 1, characterized in that, The specific steps of the frame header compression technology are as follows: the protocol stack performs differential encoding on the frame header fields of consecutive CC-Link frames, transmits only the differences between adjacent frames, and compresses consecutive 0-value fields.

6. The method for communication between a coupler and a host computer for hot-configuration of parameters according to claim 1, characterized in that, The working steps of the dual buffer module are as follows: The host computer establishes a periodic data buffer to store periodically uploaded data and an event trigger buffer to store event-triggered data. Data is read from and parsed from the periodic data buffer or the event-triggered buffer according to functional requirements; Provides a data buffer management interface for users to configure the buffer size and update cycle parameters.

7. A method for communication between a coupler and a host computer for hot parameter configuration according to claim 1, characterized in that, In step S6, the host computer uses the CRC check module to verify the original data packet and determine the execution result, specifically as follows: If the execution result is an ACK signal and the current running version number, then the execution was successful; If the execution result is a NAK signal and an error code, then the execution has failed.

8. A method for communication between a coupler for hot parameter configuration and a host computer according to claim 1, characterized in that, In step S6, if the verification result of the original data fails, the user is prompted that the configuration has failed, and the exception handling mechanism is activated. S61: The host computer retransmits the configuration package data for the first time. If a success signal is received, it indicates that the configuration is successful and the process ends. S62: If the first retransmission fails, the host computer will perform the following troubleshooting operations in sequence: Check the device connection and operating status. If the device is not connected or not running, try reconnecting or restarting it. Scan the network topology to identify and update device addresses and communication paths; Verify the format and range of the data to be sent; if the data format or range is incorrect, correct the data and resend it. Check the compatibility between the device firmware version and the host computer software version; if the versions are incompatible, prompt the user to update. S63: After completing the above diagnosis, the host computer will resend the message a second time; if the second resend fails, the user will be prompted to choose to continue retrying or switch to manual configuration mode. S64: If the user chooses to continue retrying, a third retransmission will be performed; if the three retransmissions fail, the configuration data will not be retransmitted, and the user will be prompted to contact technical support.

9. A master station device for communication between a coupler used for parameter hot configuration and a host computer, characterized in that, Include: A processing unit, the processing unit being configured to implement each step of a method for communication between a coupler and a host computer for parameter hot configuration as described in any one of claims 1 to 8; A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for communication between a coupler and a host computer for parameter hot configuration as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Remote control smart dining table system

    CN108523437A

  • KR20200123923A