Coupler and upper computer communication method and device for parameter thermal configuration

Through the software transparent conversion of USB and CC-Link protocols, priority scheduling, dynamic slot allocation and frame head compression technology are adopted to solve the problem of rate limitation and restart coupler in the conversion of USB and CC-Link protocols, and efficient data transmission and parameter hot configuration are realized, meeting the needs of process data object exchange.

CN120528733AActive Publication Date: 2025-08-22NANJING SHIDIAN ELECTRONIC TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the USB and CC-Link protocol conversion has problems such as redundancy in communication links, limited rate and remote IO module configuration that requires restarting the coupler, which cannot meet the needs of process data object exchange.

Method used

The transparent conversion between the USB protocol and the CC-Link protocol is realized through software, and the priority scheduling algorithm, dynamic slot allocation and frame head compression technology are adopted, combined with the CRC verification module and the double buffering module to achieve efficient data transmission and parameter hot configuration without the need for a dedicated hardware converter.

Benefits of technology

It significantly improves the communication rate to 12Mbps, shortens the remote IO module parameter modification time to 2-30 seconds, avoids production line downtime, reduces usage costs, and improves system response speed and management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120528733A_ABST
    Figure CN120528733A_ABST
Patent Text Reader

Abstract

The invention relates to the field of industrial automation communication, and provides a coupler and upper computer communication method and equipment for parameter thermal configuration in order to solve the problems that communication link redundancy and rate limitation exist in USB and CC-Link protocol conversion and a coupler needs to be restarted in remote IO module configuration in the prior art. Efficient conversion between a USB protocol of an upper computer and a CC-Link protocol of a coupler is realized through a dynamic time slot distribution and frame header compression technology of a protocol stack; through the application of a CRC verification module, a priority scheduling algorithm and a double-buffer module, the communication stability is ensured, and the dependence on a hardware converter is avoided; parameter hot configuration of the remote IO module is supported by constructing the hot loading USB data packet, a coupler does not need to be restarted, and the industrial production efficiency is remarkably improved; the method can be used for data exchange and management between an upper computer and the CC-Link coupler.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial automation communication, and in particular to a communication method and device between a coupler and a host computer. Background Art

[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 Corporation in 1996, the protocol boasts high speed, reliability, and ease of scalability, and is currently widely used in industrial scenarios such as automation equipment and distributed control systems.

[0003] Figure 1 The structure of a common CC-Link network in existing technologies is demonstrated, including three parts: the CC-Link master station, the CC-Link coupler, 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 coupler is used to expand network nodes and connect the master station and multiple field devices through the CC-Link bus protocol; the field device is the slave station or terminal device of the network, mainly composed of remote IO modules, servo drives, sensors and other devices, responsible for executing the master station's instructions, completing tasks such as data acquisition or device control, and feeding back the results to the master station. When the host computer and the field device need to communicate, because the host computer uses the USB serial port protocol and the coupler uses the CC-Link protocol, the host computer and the coupler need to implement USB to CC-Link protocol conversion. There are three common solutions: The first method involves converting USB to CC-Link using a dedicated USB-to-CC-Link hardware adapter, such as the Mitsubishi FX-USB-AW module. This hardware adapter requires vendor-specific configuration software, resulting in high costs. Furthermore, actual conversion efficiency is affected by protocol stack processing latency, resulting in effective communication rates typically ≤5 Mbps.

[0004] The second approach is to combine a software protocol stack with a virtual driver. PC software virtualizes the USB port into a CC-Link communication port, relying on the computing power of the host computer to complete the protocol conversion. There are significant differences between the USB and CC-Link protocols, including three aspects: First, in terms of operating mode, USB relies on passive response, while CC-Link supports active scheduling by the master station or peer-to-peer communication. Second, in terms of data packet format, USB uses batch or isochronous transmission, while CC-Link uses fixed-length frames. Third, in terms of real-time performance, the CC-Link communication cycle is typically 1ms-10ms, while the USB polling mechanism may cause excessive delays. Therefore, this conversion solution is difficult to implement and is also limited by the processing performance of the protocol stack. The effective communication rate is usually ≤5Mbps, which makes it difficult to meet the needs of process data object exchange.

[0005] Another industrial approach is multi-stage conversion, such as HMS's Anybus gateway, which uses RS485 or Ethernet as a transition, first converting USB data to RS485 or Ethernet, and then to CC-Link to achieve USB-to-CC-Link conversion. This approach is low-cost and currently the mainstream method, but multi-stage conversion increases communication complexity and latency. Furthermore, due to the transmission characteristics of the intermediate protocol physical layer and the upper limit of the CC-Link protocol itself, this approach typically has a maximum communication rate of only 3 Mbps, which cannot meet the requirements of process data object exchange.

[0006] When a master needs to modify remote I / O module parameters, the current practice is to first stop communication between the master and slave, modify the relevant parameters using a configuration tool or software on the master, then restart the coupler to initialize the communication link and resume production. This process requires restarting the coupler and interrupting production. Based on practical experience, this process typically takes over two minutes, significantly impacting industrial automation efficiency. Summary of the Invention

[0007] To address the problems of communication link redundancy, rate limitation, and coupler restart required for remote IO module configuration in the prior art of USB to CC-Link protocol conversion, the present invention proposes a coupler and host computer communication method and device for parameter hot configuration. The method achieves transparent conversion between the USB protocol and the CC-Link protocol through software without the need for a dedicated hardware converter, achieves a transmission rate of 12Mbps under ideal laboratory conditions, and supports parameter hot configuration without the need to restart the coupler.

[0008] To achieve the above objectives, the present invention proposes the following technical solutions: This technical solution provides a method for communicating between a coupler and a host computer for parameter hot configuration, which is used to implement data exchange and management between the host computer and the coupler and the CC-Link protocol of field equipment via the USB protocol. The method is characterized by: S1: The user initiates a parameter hot configuration request. The host computer constructs a USB data packet containing a hot loading flag, uses a priority scheduling algorithm to identify and transmit high-priority data packets first, and transmits them to the coupler via the USB protocol. S2: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates the USB data packet into a CC-Link frame 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 backup memory area, writes the switching instruction, completes the hot switch configuration and returns the execution result; S4: The coupler receives the execution result, parses the execution result into a USB data packet through 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 the USB data packet and parses it into raw data, and uses a double buffer module to manage the raw data; S6: The host computer uses the CRC check module to check the result of the original data. If the check passes, it will prompt that the configuration is successful and update the version number to the configuration management database.

[0009] Specifically, in S1, the USB data packet also includes a frame header, a device address, a parameter ID to be modified, a new parameter value, and a version number. The hot reload flag is a 1-byte status flag, located after the frame header and before the device address, indicating that configuration data in the current data packet needs to be updated in real time. The hot reload flag enables the host computer, coupler, and field devices to quickly identify and prioritize configuration data that requires real-time updating, ensuring that field devices can quickly complete parameter modifications during operation without requiring a reboot, significantly improving system response speed and operational efficiency.

[0010] Specifically, the priority scheduling algorithm is set in the host computer, and the specific steps are: During the data uplink process, when the host computer detects event-triggered data, it will prioritize processing and transmitting the event-triggered data; when there is no event-triggered data, it will process and transmit the periodic data according to the predetermined cycle; During the data downlink process, when the host computer needs to send key instructions, the key instructions are processed and transmitted first; the key instructions include control commands and hot loading configuration update instructions; when there are no key instructions, periodic data is processed and transmitted according to the predetermined cycle.

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

[0012] Specifically, the protocol stack, housed in the coupler, parses USB data packets into CC-Link protocol frames, or vice versa. CC-Link protocol frames contain address, function code, and data field information. This design makes the coupler the core node for protocol conversion. Compared to multi-stage conversion methods, it simplifies the link architecture, ensures efficient protocol conversion, and improves communication efficiency.

[0013] Furthermore, the dynamic timeslot allocation specifically involves the following steps: the protocol stack divides the CC-Link communication cycle into multiple timeslots based on data priority; packets corresponding to the hot reload flag are forcibly assigned to the first timeslot for transmission, while other data types are dynamically assigned to the remaining timeslots based on real-time requirements. This ensures the real-time transmission of key instructions and data, such as the hot reload flag, optimizes communication link resource utilization, and improves the overall link efficiency of USB and CC-Link protocol conversion.

[0014] Furthermore, the header compression technology specifically involves the protocol stack performing differential encoding on the header fields of consecutive CC-Link frames, transmitting only the differences between adjacent frames and compressing fields with consecutive zero values. This compression algorithm removes repeated portions of consecutive frames, reducing the amount of header data and enabling efficient data transmission.

[0015] Specifically, in S4, the CRC check code is generated by the host computer or coupler and is used to perform CRC check on the data packet to ensure data integrity; this can ensure the integrity and security of data transmission and provide feedback on the quality and parameter configuration of the communication link.

[0016] Specifically, the working steps of the double buffer module are as follows: The host computer establishes a periodic data buffer for storing periodically uploaded data; and establishes an event trigger buffer for storing event-triggered data; Read and parse data from the periodic data buffer or event trigger buffer according to functional requirements; Provides a data buffer management interface, allowing users to configure the buffer size and update cycle parameters as needed.

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

[0018] Specifically, in S6, the host computer uses the CRC check module to check the original data packet and determine the execution result, specifically: If the execution result is an ACK signal and the current running version number, the execution is successful; If the execution result is a NAK signal and an error code, the execution fails; the error code is verification failure, parameter out of range, or version conflict. This makes it easy to quickly locate the problem and increase the reliability of the method.

[0019] Specifically, in 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 resends 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 performs the following troubleshooting operations in sequence: Check the device connection and operation status. If the device is not connected or not running, try to reconnect or restart it. Scan network topology, confirm and update device addresses and communication paths; Verify the format and range of the data being sent; if the data format or range is incorrect, correct the data and resend it; Check the compatibility of 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 performs a second resend; if the second resend fails, the user is prompted to choose to continue retrying or switch to manual configuration mode; S64: When the user chooses to continue retrying, the configuration data is resent for the third time; if the three retransmissions fail, the configuration data is no longer resent, and the user is prompted to contact technical support.

[0020] Through the step-by-step troubleshooting and retry mechanism of S61-S64, the causes of configuration failures are gradually diagnosed and resolved, providing clear user feedback to ensure that problems can be discovered and resolved in a timely manner, thereby improving the stability of the method.

[0021] The present invention also provides a master station device for communicating between a coupler and a host computer for parameter hot configuration, comprising: A processing unit, the processing unit being configured to implement each step of any one of the above-mentioned methods for communicating between a coupler and a host computer for parameter thermal configuration; A readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the steps of any one of the above-mentioned methods for communication between a coupler and a host computer for parameter thermal configuration.

[0022] Beneficial effects: As can be seen from the above technical solutions, the present invention addresses the problems in the prior art of USB and CC-Link protocol conversion, such as communication link redundancy, rate limitation, and the need to restart the coupler for remote IO module configuration. A method and device for communicating between a coupler and a host computer for hot parameter configuration are proposed to achieve transparent conversion between the USB protocol and the CC-Link protocol without the need for a dedicated hardware converter, and to support hot parameter configuration without restarting the coupler.

[0023] Through the technical solution described in the present invention, the technical effects brought about by the present invention are: 1. In terms of communication speed, the traditional method of converting USB protocol to CC-Link protocol is usually around 5Mbps. Based on existing technologies, the protocol stack of this method adopts dynamic time slot allocation and frame header compression technology to achieve data compression and efficient conversion between the host computer USB protocol and the coupler CC-Link protocol. Under ideal laboratory conditions, the transmission rate reaches 12Mbps, which significantly improves the communication speed compared with the traditional mode.

[0024] 2. In terms of the device configuration process, the traditional method usually requires restarting the coupler when configuring devices such as remote I / O modules, 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 allows remote I / O module parameters to be quickly modified and take effect in real time without restarting the coupler. This takes only 2-30 seconds and has a delay of less than 100ms, avoiding production line downtime caused by configuration changes and significantly improving management efficiency.

[0025] 3. In other aspects, this method combines the use of a CRC check module, a priority scheduling algorithm, and a double buffer module to ensure the real-time transmission of critical data and guarantee communication stability, meeting the needs of high-speed process data exchange. At the same time, it eliminates the reliance on dedicated hardware converters and reduces the cost of use.

[0026] It should be appreciated that all combinations of the foregoing concepts, as well as additional concepts described in greater detail below, to the extent such concepts are not mutually inconsistent, can be considered to be part of the inventive subject matter of this disclosure.

[0027] The foregoing and other aspects, embodiments, and features of the present invention will be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as features and / or beneficial effects of the exemplary embodiments, will become apparent from the following description or through practice of specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0029] Figure 1 This is a diagram of the structure of a common CC-Link network in the prior art; Figure 2 A hardware communication link diagram disclosed in an embodiment of the present application; Figure 3 This is a schematic diagram of the system composition based on the present method disclosed in the embodiment of the present application; Figure 4 This is a flow chart of a method for communicating between a coupler and a host computer for parameter hot configuration disclosed in an embodiment of the present application; Figure 5 A schematic diagram of a time slot for dynamic time slot allocation disclosed in an embodiment of the present application; Figure 6 This is a flowchart of process object data exchange disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0031] Before introducing this application, the related technologies of this application are first introduced.

[0032] 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 Corporation in 1996, the protocol boasts high speed, reliability, and ease of scalability, 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 to transmit real-time data from field devices during the operation of fieldbus protocols such as CC-Link. PDO data transmission can be triggered in a variety of ways, including periodic transmission and event triggering. A PDO request is 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 as PDO data. Therefore, bandwidth requirements in such scenarios often exceed 5Mbps.

[0033] Figure 1The CC-Link network commonly found in existing technology consists of three parts: a CC-Link master station, a CC-Link coupler, and field devices. The CC-Link master station is the network's core control device, comprising a controller and a host computer. The CC-Link coupler is used to expand network nodes, connecting the master station to multiple field devices via the CC-Link bus protocol. Field devices are the network's slave stations, or terminal devices, primarily consisting of remote I / O modules, servo drivers, sensors, and other equipment. They are responsible for executing master station instructions, completing tasks such as data acquisition and device control, and feeding the results back to the master station. When communication between the host computer and field devices is required, USB to CC-Link protocol conversion is required between the host computer and the coupler, as the host computer uses the USB serial port protocol while the coupler uses the CC-Link protocol.

[0034] The following is an introduction to the application scenarios of this application.

[0035] Figure 2 This is a hardware communication link diagram disclosed in an embodiment of the present application, taking the data downlink process as an example: First, the host computer, i.e., a PC or industrial computer, outputs communication data through the USB interface and relies on the USB CDC driver to encapsulate the data into USB data packets.

[0036] The USB protocol parsing chip is then placed between the coupler and the host computer's USB interface, receiving USB data packets from the host computer and converting the USB data into serial UART signals, i.e., TTL levels, to achieve physical layer conversion between the USB protocol and the serial protocol. In this embodiment, the chip used is the FTDI FT232H or Silicon Labs CP2102.

[0037] Secondly, the CC-Link coupler has a built-in dedicated protocol conversion chip that converts UART signals into CC-Link differential signals. Optical isolation and terminal resistor matching enhance anti-interference capabilities. In this embodiment, the protocol conversion chip used is a Renesas CC-Link PHY chip. The standard terminal resistor value is 110Ω ± 1%, using E96 series precision resistors. For short distances between the host computer and the coupler (less than 20m), a 100-120Ω resistor is used. For long distances between the host computer and the coupler (≥20m), a 110Ω resistor plus a 90-150Ω potentiometer is used.

[0038] Finally, the field equipment, the remote IO module is used to receive configuration instructions from the host computer, perform parameter hot-loading configuration, or control sensors or actuators; the servo drive obtains and executes motion control instructions such as position and speed from the host computer through CC-Link.

[0039] Figure 3This is a schematic diagram of the system composition based on the present method disclosed in an embodiment of the present application, including a host computer and a coupler: The host computer includes application function layer, data management layer and physical interface; it can realize modular management of data transmission and application functions, making the system structure clear, easy to manage and expand.

[0040] 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 to facilitate user configuration and management.

[0041] The data management layer is connected to the physical interface via a data bus and is responsible for data 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 machine. The CRC verification module is responsible for data integrity verification to ensure error-free data transmission. The double-buffered module is used to manage data, providing independent storage space for periodic data and event-triggered data to avoid data conflicts and loss, further optimizing data processing efficiency and communication stability. The priority scheduling module is used to schedule data based on its importance and urgency, optimizing the transmission sequence. The exception handling state machine is responsible for handling exceptions in data transmission to ensure system stability. The combination of CRC verification, double-buffered modules, priority scheduling, and exception handling can ensure data integrity, optimize the transmission sequence, and improve communication stability and speed.

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

[0043] Furthermore, the host computer receives USB data packets through the physical interface and parses them into raw data. The data management layer then processes this raw data, including conversion, mapping, encapsulation, and the addition of necessary metadata, so that the application layer can obtain the required data format. This metadata includes timestamps, data source identifiers, and data types. This ensures that data is delivered to the application layer in a standardized format, improving data readability, traceability, and usability.

[0044] The coupler includes a CRC check module and a protocol stack: The CRC check module is responsible for generating a CRC check code and performing a CRC check on the received data packets to ensure the integrity of the data.

[0045] The protocol stack is used to realize data conversion between USB protocol and CC-Link protocol; the protocol stack parses the execution result into USB data packet through frame header compression technology, attaches CRC check code, and forwards it to the host computer; utilizes dynamic allocation of time slots to encapsulate USB data packet into CC-Link frame, wherein the hot loading identifier is allocated to the first time slot of CC-Link frame for transmission. Traditional methods usually require the use of dedicated hardware converters such as Mitsubishi's FX-USB-AW module or HMS's Anybus gateway to realize the conversion between USB and CC-Link protocols. The effective communication rate is usually ≤5Mbps, the hardware cost is high and requires additional configuration and maintenance; the coupler in the present invention integrates protocol conversion and verification functions. This design simplifies the system structure and optimizes the data transmission rate. At the same time, the combination of priority scheduling algorithm and double buffer module can ensure the timeliness of key data and improve the reliability and flexibility of USB and CC-Link protocol conversion and data management.

[0046] Figure 4 This is a flow chart of a method for communicating between a coupler and a host computer for parameter thermal configuration disclosed in an embodiment of the present application.

[0047] This technical solution provides a method for communicating between a coupler and a host computer for parameter hot configuration, which is used to implement data exchange and management between the host computer and the coupler and the CC-Link protocol of field equipment via the USB protocol. The method is characterized by: S1: The user initiates a parameter hot configuration request. The host computer constructs a USB data packet containing a hot loading flag, uses a priority scheduling algorithm to identify and transmit high-priority data packets first, and transmits them to the coupler via the USB protocol. S2: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates the USB data packet into a CC-Link frame 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 backup memory area, writes the switching instruction, completes the hot switch configuration and returns the execution result; S4: The coupler receives the execution result, parses the execution result into a USB data packet through 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 the USB data packet and parses it into raw data, and uses a double buffer module to manage the raw data; S6: The host computer uses the CRC check module to check the result of the original data. If the check passes, it will prompt that the configuration is successful and update the version number to the configuration management database.

[0048] Specifically, in S1, the USB data packet also includes a frame header, a device address, a parameter ID to be modified, a new parameter value, and a version number. The hot reload flag is a 1-byte status flag, located after the frame header and before the device address, and is used to indicate that configuration data in the current data packet needs to be updated in real time. The hot reload flag enables the host computer, coupler, and field devices to quickly identify and prioritize configuration data that requires real-time updating, ensuring that field devices can quickly complete parameter modifications during operation without requiring a restart, significantly improving system response speed and operational efficiency.

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

[0050] Specifically, the priority scheduling algorithm is set in the host computer, and the specific steps are: During the data uplink process, when the host computer detects event-triggered data, it will prioritize processing and transmitting the data; when there is no event-triggered data, it will process and transmit periodic data according to the predetermined cycle; During the data downlink process, when the host computer needs to send a key instruction, the instruction is processed and transmitted first; the key instruction includes a control command and a hot load configuration update instruction; when there is no key instruction, the periodic data is processed and transmitted according to a predetermined cycle.

[0051] Furthermore, the data uplink process is the process of transmitting data from the field device to the host computer, and the data downlink process is the process of transmitting data from the host computer to the field device. The predetermined period is the time interval preset 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 hot reload flags, control commands, and event-triggered data, meeting real-time requirements.

[0052] In specific implementation, taking data upload as an example, the above priority scheduling algorithm includes the following contents: (1) The host computer receives the data packet from the coupler and temporarily stores the data packet in the queue, waiting for processing; (2) The host computer identifies the data type of each data packet and determines its priority based on the data type, including high, medium, and low priorities; high priority includes hot loading identification, medium priority includes control commands and event trigger data, and low priority includes periodic data; (3) First find all high-priority data packets from the queue, such as control commands, 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 low-priority data packets.

[0053] Specifically, the protocol stack is located in the coupler and is used to parse USB data packets into CC-Link protocol frames, or parse CC-Link protocol frames into USB data packets; the CC-Link protocol frames contain address, function code, and data field information. This design makes the coupler the core node of the entire protocol conversion. Compared with the multi-stage conversion method, it simplifies the link architecture, ensures the efficiency of protocol conversion, and improves communication efficiency. In specific 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:

[0054] This embodiment also discloses the request message and response message formats of the protocol stack, taking 0x02 to obtain IO module information as an example: The request message format is as follows:

[0055] The response message format is as follows:

[0056] Further, Figure 5 A schematic diagram of a time slot for dynamic time slot allocation disclosed in an embodiment of the present application.

[0057] Dynamic timeslot allocation means the protocol stack divides the CC-Link communication cycle into multiple timeslots based on data priority. Data packets corresponding to the hot reload flag are forcibly assigned to the first timeslot for transmission, while other data types are dynamically assigned to the remaining timeslots based on real-time requirements. This ensures real-time transmission of critical instructions and data, such as the hot reload flag, optimizes communication link resource utilization, and improves overall link efficiency for USB and CC-Link protocol conversion.

[0058] In specific implementation, combined with Figure 5As shown in the figure, the protocol stack divides the CC-Link communication cycle into N time slots, each 2ms long. The hot reload indicator packet has the highest priority and is forced to occupy the first time slot. Control commands, event-triggered data, and multiple periodic data occupy time slots 2, 3, 4, and N, respectively. At a certain moment, if the protocol stack detects that new high-priority event-triggered data needs to be transmitted while time slot 3 is already occupied, the protocol stack dynamically adjusts the time slot allocation, moving the data originally in time slot 3 to other time slots, such as time slot 4 or 5, and allocating the new event-triggered data to time slot 3, ensuring that high-priority data is transmitted first. This ensures the real-time transmission of key instructions and data, such as the hot reload indicator, optimizes resource utilization of the communication link, and improves the overall link efficiency of the USB and CC-Link protocol conversion.

[0059] 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, only transmits the difference between adjacent frames, and compresses the continuous 0 value fields. The repeated parts in the continuous frames are removed by the compression algorithm, so as to reduce the amount of frame header data and achieve efficient transmission of data. The compression algorithm adopted in this embodiment is differential coding or run-length coding algorithm. The reason is that differential coding reduces the amount of data transmission by transmitting only the difference between two consecutive headers instead of sending the entire header; run-length coding skips the 0 value 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 with other compression algorithms such as Huffman coding, these two algorithms occupy less computing resources and are simpler to implement. They are more suitable for scenarios with high real-time requirements and limited resources such as real-time process data transmission and parameter hot loading configuration in industrial communications.

[0060] In specific implementation, taking the differential coding algorithm as an example, the process of compressing the frame header is as follows: The frame header data of three consecutive frames are as follows: Frame 1: Address = 0x01, Function Code = 0x03, Data Length = 0x00A0 Frame 2: Address = 0x01, Function Code = 0x03, Data Length = 0x00B0 Frame 3: Address = 0x01, Function Code = 0x03, Data Length = 0x00C0 In differential encoding, the protocol stack sends only the parts that are different from the previous frame: Frame 1: Send the complete frame header, 0x010x030x000xA0 Frame 2: Only the change in data length is sent, 0x000x10, indicating that the data length increases by 0x10 Frame 3: Also sends only the change in data length, 0x000x10, and increases by 0x10 again The benefit 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, the differential encoding algorithm can also be combined with techniques such as run-length encoding to further optimize the compression effect.

[0061] Specifically, in S4, the CRC check code is generated by the host computer or coupler and is used to perform a CRC check on the data packet to ensure data integrity. This ensures the integrity and security of data transmission and provides feedback on the quality of the communication link and system parameter configuration. In specific implementation, taking the CRC-16 algorithm as an example, if the original data is 0x12, the CRC check process is as follows: (1) Initialize the CRC register to all 0x0000; (2) Process the data byte by byte, including: performing an XOR operation on 0x12 and the upper 8 bits of the CRC register 0x00, the result is 0x12; shifting the CRC register right by 8 bits, the result is 0x0012; performing polynomial division on 0x0012, using the generating polynomial 0x8005; after the polynomial division, the final result is 0x3F2B; (3) The calculated CRC check code 0x3F2B is appended to the end of the original data to form a complete data packet 0x120x340x560x780x3F0x2B, which is sent to the host computer; (4) The host computer receives the data packet and extracts the original data 0x120x340x560x78 and the received CRC check code; the host computer uses the same CRC-16 algorithm and the generating polynomial 0x8005 to recalculate the original data and calculates the CRC check code to be 0x3F2B (5) Compare the calculated CRC check code with the received CRC check code to see if they are the same. If they are the same, it means that the data is complete and the check passes.

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

[0063] Specifically, the working steps of the double buffer module include: The host computer establishes a periodic data buffer for storing periodically uploaded data; and establishes an event trigger buffer for storing event-triggered data; Read and parse data from the periodic data buffer or event trigger buffer according to functional requirements; Provides a data buffer management interface, allowing users to configure the buffer size and update cycle parameters as needed.

[0064] In specific implementation, taking data uplink as an example, the working process of the double buffer module includes: (1) The host computer receives data packets from the coupler: Sequence number 1 is periodic data, low priority; Sequence number 2 is event trigger data, medium priority; Sequence number 3 is control command, high priority; Sequence number 4 is periodic data, low priority; (2) The host computer temporarily stores the data packet in the corresponding buffer according to the type of the data packet, such as serial number 1 periodic data is stored in the periodic data buffer, and serial number 2 event trigger data is stored in the event trigger buffer; (3) The host computer reads and parses data from the periodic data buffer or event trigger buffer according to functional requirements.

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

[0066] By establishing the negotiation between the periodic data buffer and the event-triggered buffer as described above, data conflicts are avoided, and the system can prioritize event-triggered data according to the data type, ensuring the real-time nature of the data. At the same time, a buffer management interface is provided, so that users can adjust the buffer's resource allocation and data update frequency according to specific application scenarios and real-time requirements, thereby optimizing the system's performance and response speed.

[0067] Specifically, in S6, the host computer uses the CRC check module to check the original data packet and determine the execution result, specifically: If the execution result is an ACK signal and the current running version number, the execution is successful; If the execution result is a NAK signal and an error code, the execution fails; the error code is verification failure, parameter out of range or version conflict. This has the advantage of facilitating and quickly locating the problem and increasing the reliability of the method.

[0068] Specifically, in 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 resends 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 performs the following troubleshooting operations in sequence: Check the device connection and operation status. If the device is not connected or not running, try to reconnect or restart it. Scan network topology, confirm and update device addresses and communication paths; Verify the format and range of the data being sent; if the data format or range is incorrect, correct the data and resend it; Check the compatibility of 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 performs a second resend; if the second resend fails, the user is prompted to choose to continue retrying or switch to manual configuration mode; S64: When the user chooses to continue retrying, the configuration data is resent for the third time; if the three retransmissions fail, the configuration data is no longer resent, and the user is prompted to contact technical support.

[0069] Through the step-by-step troubleshooting and retry mechanism of S61-S64, the causes of configuration failures are gradually diagnosed and resolved, providing clear user feedback to ensure that problems can be discovered and resolved in a timely manner, thereby improving system stability.

[0070] This invention prioritizes hot-load flags, control commands, and event-triggered data, ensuring rapid transmission of high-priority data, meeting real-time requirements and guaranteeing communication speed. Furthermore, a dual-buffer module provides independent storage for periodic and event-triggered data, preventing data conflicts and loss, further optimizing data processing efficiency and communication stability. Furthermore, the combination of a host computer priority scheduling algorithm and a dual-buffer module ensures the timely delivery of critical data, while also improving the reliability and flexibility of USB and CC-Link protocol communication and data management.

[0071] Figure 6 This is a flowchart of process object data exchange disclosed in an embodiment of the present application.

[0072] Furthermore, the method also supports a working mode in which the process data is exchanged. Figure 6 The data exchange process shown includes: 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 PDO requests in the event trigger buffer for quick response.

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

[0074] A3: The coupler uses the protocol stack to dynamically allocate time slots and encapsulate 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.

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

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

[0077] If the CRC check succeeds, the protocol stack will send the parsed data to the application function interface.

[0078] If the CRC check fails, the protocol stack starts the automatic retransmission mechanism and resends the process data object request.

[0079] 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.

[0080] The method is executed as follows when performing parameter hot configuration: Figure 4 The process shown in the figure is as follows; when exchanging process data, Figure 6 Based on the above mechanism, an efficient and reliable process object data exchange mechanism can be implemented to ensure the fast and accurate transmission of data requests and responses from the host computer to the field devices.

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

[0082] The network performance test tool IxiaChariot was used to generate test traffic, the physical layer signal integrity was captured through the Keysight 3000T oscilloscope, and industrial interference was simulated through the PLC noise generator. Figure 2 Individual and comparative tests were conducted in different hardware scenarios. The ideal laboratory environment was an interference-free environment with a 1-meter cable, while the industrial field environment was an EMC-tested environment with a 30-meter cable. The comparative tests covered continuous data transmission, mixed data packet transmission, and scenarios with retransmission. The continuous data scenario tested continuous data transmission performance in an interference-free environment; the mixed data packet transmission scenario tested performance when mixed transmission included multiple data packet types, including control commands and data packets; and the retransmission scenario tested communication performance when data retransmission was required.

[0083] The test results of this method alone are as follows:

[0084] The comparison test results of this method with other methods are as follows:

[0085] Note: The traditional hardware solution refers to the Mitsubishi FX-USB-AW module, and the multi-level gateway solution refers to the HMS Anybus X gateway Test conclusion: 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., a 1-meter cable, no interference). In an industrial field environment (i.e., an 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.

[0086] In comparison, the traditional hardware solution and multi-level gateway solution have significantly lower rate performance in continuous data transmission, mixed data packet transmission and retransmission scenarios than the present invention, which are 4.3Mbps / 2.7Mbps, 3.1Mbps / 1.8Mbps and 2.3Mbps / 0.9Mbps respectively.

[0087] In terms of IO module parameter modification, this method does not require restarting the coupler for parameter modification, takes only 2-30 seconds, and has a delay of less than 100ms; the traditional hardware solution requires restarting the coupler, which takes more than 2 minutes. Although the multi-level gateway solution does not require restarting the coupler, it takes 1-5 minutes. Therefore, the time and delay of parameter configuration of this method are significantly better than those of traditional hardware solutions and multi-level gateway solutions.

[0088] 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 exhibits higher transmission rate and lower latency in applications in the field of industrial automation, and has great advantages.

[0089] In addition, this embodiment includes a master station device for communicating between a coupler for parameter hot configuration and a host computer, including: A processing unit is used to implement each step of a method for communication between a coupler and a host computer for parameter thermal configuration of the present application.

[0090] A readable storage medium stores a computer program thereon, which, when executed by a processor, implements the various steps of a method for communication between a coupler and a host computer for parameter thermal configuration of the present application.

[0091] Since the processing unit and the readable storage medium are both constructed based on the method and used to implement the method, in actual application, they can also effectively deal with the problems of communication link redundancy, rate limitation, and the need to restart the coupler for remote IO module configuration that arise in the conversion between USB and CC-Link protocols, realize transparent conversion between USB protocol and CC-Link protocol, and simultaneously perform parameter hot configuration without restarting the coupler, thereby improving production efficiency.

[0092] While the present invention has been disclosed above with reference to preferred embodiments, this is not intended to limit the present invention. Persons skilled in the art will readily appreciate that various modifications and variations can be made without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the claims.

Claims

1. A method for communicating between a coupler and a host computer for parameter hot 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 flag, uses a priority scheduling algorithm to identify and transmit high-priority data packets first, and transmits them to the coupler via the USB protocol. S2: The coupler uses the protocol stack to dynamically allocate time slots and encapsulates the USB data packet into a CC-Link frame 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 backup memory area, writes the switching instruction, completes the hot switch configuration and returns the execution result; S4: The coupler receives the execution result, parses the execution result into a USB data packet through 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 the USB data packet and parses it into raw data, and uses a double buffer module to manage the raw data; S6: The host computer uses the CRC check module to check the result of the original data. If the check passes, it will prompt that the configuration is successful and update the version number to the configuration management database.

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

3. The method for communicating between a coupler and a host computer for parameter hot configuration according to claim 1, characterized in that: The priority scheduling algorithm is set in the host computer, specifically: During the data uplink process, when the host computer detects event-triggered data, it will prioritize processing and transmitting the event-triggered data; when there is no event-triggered data, it will process and transmit the periodic data according to the predetermined cycle; During the data downlink process, when the host computer needs to send key instructions, the key instructions are processed and transmitted first; the key instructions include control commands and hot loading configuration update instructions; when there are no key instructions, periodic data is processed and transmitted according to the predetermined cycle.

4. The method for communicating between a coupler and a host computer for parameter hot 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 packet corresponding to the hot loading identifier 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.

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

6. The method for communicating between a coupler and a host computer for parameter hot configuration according to claim 1, characterized in that: The working steps of the double buffer module are: The host computer establishes a periodic data buffer for storing periodically uploaded data and an event trigger buffer for storing event-triggered data; Read and parse data from the periodic data buffer or event trigger buffer according to functional requirements; Provides a data buffer management interface for users to configure the buffer size and update cycle parameters.

7. The method for communicating between a coupler and a host computer for parameter hot configuration according to claim 1, characterized in that: In S6, the host computer uses the CRC check module to check the original data packet and determine the execution result, specifically: If the execution result is an ACK signal and the current running version number, the execution is successful; If the execution result is a NAK signal and an error code, the execution fails.

8. The method for communicating between a coupler and a host computer for parameter hot configuration according to claim 1, characterized in that: In 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 resends 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 performs the following troubleshooting operations in sequence: Check the device connection and operation status. If the device is not connected or not running, try to reconnect or restart it. Scan network topology, confirm and update device addresses and communication paths; Verify the format and range of the data being sent; if the data format or range is incorrect, correct the data and resend it; Check the compatibility of 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 performs a second resend; if the second resend fails, the user is prompted to choose to continue retrying or switch to manual configuration mode; S64: When the user chooses to continue retrying, the configuration data is resent for the third time; if the three retransmissions fail, the configuration data is no longer resent, and the user is prompted to contact technical support.

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

Citation Information

Patent Citations

  • Remote control smart dining table system

    CN108523437A

  • Artificial turf system for reducing microplastics and its manufacturing method

    KR102411875B1

  • Controlling modular measurement cartridges that convey interface information with cartridge controllers

    US20060184335A1

  • Controlling an I / O MMU

    US20070038839A1

  • Unified network interface for industrial networks

    US20210157758A1

Cited By

  • Upper computer communication method supporting multi-protocol coupler

    CN122204979A