Master and slave adaptation methods, master and storage media

By updating the preset object dictionary repository through a custom configuration interface, the problem of not being able to implement user-defined PDO process data mapping in the master-slave adaptation method was solved, enabling flexible communication connection between the master and slave stations and simplifying on-site configuration.

CN117459384BActive Publication Date: 2025-10-28GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311407269.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2025-10-28
Estimated Expiration
2043-10-26

AI Technical Summary

Technical Problem

In existing technologies, the method of master station adapting to slave station can realize the dynamic change mapping of conventional PDO process data, but it cannot realize the change mapping of user-defined PDO process data, and it requires configuration with the help of external devices, which makes it inconvenient to use in the field.

Method used

By obtaining the PDO process data allocation information of each slave station, it is determined whether the target PDO process data is in the preset object dictionary repository. If the location is not successful, a prompt message is generated. The user can configure the object dictionary through the custom configuration interface and update the preset object dictionary repository to realize the user-customized mapping of PDO process data changes.

Benefits of technology

It enables communication between the master station and the slave station, simplifies the on-site configuration process, reduces dependence on external devices, and improves the flexibility and efficiency of adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117459384B_ABST
    Figure CN117459384B_ABST
Patent Text Reader

Abstract

This application provides a method for adapting a master station and slave stations, as well as a master station and a storage medium. The method includes: acquiring PDO process data allocation information for each slave station; if the object dictionary of the target PDO process data on the slave station is not successfully located in a preset object dictionary repository, determining that the target PDO process data is user-defined PDO process data and generating a prompt message, which prompts the user to configure the object dictionary of the target PDO process data through a custom configuration interface; receiving and responding to the user-configured object dictionary update in the preset object dictionary repository, obtaining the updated preset object dictionary repository, and controlling the master station's program to reload the updated preset object dictionary repository to update the PDO interaction data group between the master station and slave stations, thereby establishing a communication connection between the master station and slave stations. This solves the problem of being unable to implement change mapping for user-defined PDO process data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robotics technology, and more specifically, to a method for adapting a master station and a slave station, and a master station and a storage medium. Background Technology

[0002] As factories demand higher levels of automation, industrial robots are being used more and more widely in the field of intelligent manufacturing. In actual factory applications, industrial robots are not just working as individual robots, but rather collaborating with other robots and other equipment (such as welding machines, machine tools, injection molding machines, sensors, etc.) throughout the production line or even the entire factory.

[0003] In current industrial production, EtherCAT bus is widely used due to its high speed and high bandwidth utilization. Robot motion controllers that support EtherCAT bus communication technology are generally called EtherCAT master stations (hereinafter referred to as master stations in this patent), and the corresponding drivers, sensors and other devices that communicate with it are called EtherCAT slave stations (hereinafter referred to as slave stations in this patent).

[0004] To enable connectivity between the robot and various production line equipment, the master station needs to establish communication with different slave stations to adapt to different slave devices. While existing master-slave adaptation methods can achieve dynamic mapping of conventional PDO process data, they cannot implement user-defined PDO process data mapping, thus failing to provide comprehensive coverage of PDO process data mapping. Furthermore, in actual field use, external equipment (a computer running host computer configuration software) must be used for configuration to ensure proper operation. Summary of the Invention

[0005] The main objective of this application is to provide a method for adapting a master station to a slave station, and a master station to a storage medium, so as to at least solve the problem in the related art where the method of adapting a master station to a slave station can realize the dynamic change mapping of conventional PDO process data, but cannot realize the change mapping of user-defined PDO process data.

[0006] To achieve the above objectives, according to one aspect of this application, a method for adapting a master station and a slave station is provided. The method is applied to a master station and includes: acquiring PDO process data allocation information for each slave station, the PDO process data allocation information including an object dictionary for each PDO process data of the corresponding slave station, the object dictionary including an index and sub-indexes; if the object dictionary of the target PDO process data of the slave station is not successfully located in a preset object dictionary repository, determining that the target PDO process data is user-defined PDO process data, and generating a prompt message, the prompt message prompting the user to configure the object dictionary of the target PDO process data through a custom configuration interface, the target PDO process data of the slave station being one of multiple PDO process data of the slave station; receiving and responding to the user-configured object dictionary, updating the preset object dictionary repository to obtain an updated preset object dictionary repository, and controlling the program of the master station to reload the updated preset object dictionary repository to update the PDO interaction data group between the master station and the slave station, thereby establishing a communication connection between the master station and the slave station.

[0007] Optionally, before determining that the target PDO process data is user-defined PDO process data if the object dictionary of the target PDO process data at the slave station is not successfully located in the preset object dictionary repository, the method further includes: comparing the object dictionary of the target PDO process data with the base address of the preset object dictionary repository to determine the address segment in which the object dictionary of the target PDO process data is located, wherein one address segment has one base address; and performing a binary search within the address segment to determine whether the object dictionary of the target PDO process data is located in the preset object dictionary repository.

[0008] Optionally, the method further includes: if the object dictionary of the target PDO process data of the slave station is successfully located in a preset object dictionary repository, adding a tag to the successfully located object dictionary.

[0009] Optionally, before obtaining the PDO process data allocation information of each slave station, the method further includes: the master station reading the manufacturer identification information and product code of each slave station; determining the type of the slave station based on the manufacturer identification information and the product code, wherein the manufacturer identification information is used to uniquely identify the manufacturer, and the product codes of the same type of products belonging to different manufacturers are different.

[0010] Optionally, the master station reads the manufacturer identification information and product code of each of the slave stations, including: the master station reads the EEPROM information of each of the slave stations through sequential addressing; and obtains the manufacturer identification information and product code of each of the slave stations through the EEPROM information.

[0011] Optionally, the PDO process data allocation information further includes: the number of input PDO process data entries and the number of output PDO process data entries, wherein the PDO process data includes the input PDO process data and the output PDO process data. Updating the PDO interaction data group between the master station and the slave station includes: the master station defining pointer variable names for each unique address variable in the preset object dictionary repository to establish a one-to-one correspondence between the unique address variable information and the pointer variable names; for each slave station, executing a first loop and a second loop respectively for the input PDO process data and the output PDO process data, wherein the first loop is used to point the first pointer variable to the offset address of the corresponding input PDO process data, and the second loop is used to point the second pointer variable to the offset address of the corresponding output PDO process data to establish a mapping between pointer variables and PDO process data addresses to update the PDO interaction data group between the master station and the slave station.

[0012] Optionally, executing the first loop for the input PDO process data includes: a first comparison step: comparing the index information of the input PDO process data with the index address corresponding to the first pointer variable to obtain a first comparison result, wherein the index information includes the index and the sub-index of the input PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a first pointing step: when the first comparison result indicates that the index information of the input PDO process data matches the index address, pointing the first pointer variable to the corresponding offset address of the input PDO process data; repeating the first comparison step and the first pointing step at least once in sequence until all offset addresses of the input PDO process data are mapped to the first pointer variable. The second loop for the output PDO process data includes: a second comparison step: comparing the index information of the output PDO process data with the index address corresponding to the second pointer variable to obtain a second comparison result, wherein the index information includes the index and the sub-index of the output PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a second pointing step: when the second comparison result indicates that the index information of the output PDO process data is consistent with the index address, pointing the second pointer variable to the corresponding offset address of the output PDO process data; repeating the second comparison step and the second pointing step at least once in sequence until the mapping of all offset addresses of the output PDO process data to the second pointer variable is completed.

[0013] Optionally, the custom configuration interface is integrated into the teach pendant of the main station, or the custom configuration interface is integrated into the central control monitoring interface.

[0014] According to another aspect of this application, a master station is provided, comprising: an acquisition unit, configured to acquire PDO process data allocation information of each slave station, the PDO process data allocation information including an object dictionary of each PDO process data of the corresponding slave station, the object dictionary including an index and a sub-index; a determination prompt unit, configured to determine that the target PDO process data is user-defined PDO process data when the object dictionary of the target PDO process data of the slave station is not successfully located in a preset object dictionary repository, and generate a prompt message, the prompt message being used to prompt the user to configure the object dictionary of the target PDO process data through a custom configuration interface, the target PDO process data of the slave station being one of multiple PDO process data of the slave station; and a receiving response unit, configured to receive and respond to the object dictionary configured by the user, update the preset object dictionary repository to obtain an updated preset object dictionary repository, and control the program of the master station to reload the updated preset object dictionary repository to update the PDO interaction data group that the master station interacts with the slave station to establish a communication connection between the master station and the slave station.

[0015] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the master-slave adaptation methods described above.

[0016] By applying the technical solution of this application, the PDO process data allocation information of each slave station is obtained. If the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The system receives and responds to the user-configured object dictionary, updates the preset object dictionary repository to obtain the updated preset object dictionary repository, and controls the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group between the master station and the slave station, thereby establishing a communication connection between the master station and the slave station. This solution uses the preset object dictionary repository to determine whether the PDO process data of the slave station is user-defined by judging whether the object dictionary of the slave station's PDO process data appears in the preset object dictionary repository. If so, it is configured through the custom configuration interface. The master station updates the preset object dictionary repository and adaptively adjusts the PDO interaction data group according to the configuration information to realize the change mapping of user-defined PDO process data. The method for adapting the master site to the slave site has been solved, which can realize the dynamic change mapping of conventional PDO process data, but it cannot realize the change mapping of user-defined PDO process data. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A hardware structure block diagram of a mobile terminal for implementing a master station and slave station adaptation method according to an embodiment of this application is shown.

[0019] Figure 2 A flowchart illustrating a master-slave adaptation method according to an embodiment of this application is shown.

[0020] Figure 3 A schematic diagram of a custom configuration interface provided according to an embodiment of this application is shown;

[0021] Figure 4 An automatic identification method for PDO process data is shown according to an embodiment of this application;

[0022] Figure 5 A positioning flowchart according to an embodiment of this application is shown;

[0023] Figure 6 A mapping flowchart according to an embodiment of this application is shown;

[0024] Figure 7 A structural block diagram of a master station provided according to an embodiment of this application is shown. Detailed Implementation

[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:

[0029] CoE protocol: CAN application protocol over EtherCAT, is an implementation of the EtherCAT application layer protocol. Its characteristics are that it is written according to the CiA402 protocol and uses objects and object dictionaries to realize mailbox communication. The CANopen protocol has mature and large-scale applications. Using the CoE protocol, related devices only need to be modified a little to be applied to the EtherCAT protocol, and most of the CANopen firmware can also be reused.

[0030] PDO process data: Process data is used to transmit periodic data. A PDO consists of three data buffers, similar to a FIFO. The slave station writes to the first buffer, and the master station reads from the third buffer. Note that the second buffer is not operable. The slave station uses two independent data buffers for sending and receiving PDOs. Synchronization managers control the buffers; each synchronization manager is responsible for only one function. For example, synchronization manager 2 is responsible for sending PDOs, and synchronization manager 3 is responsible for receiving PDOs.

[0031] In some adaptation schemes, due to the continuous mapping characteristics of process data, the master station ultimately needs to confirm which PDO process data interactions are required for different slave devices in actual use (changes in slave device connection topology, slave device PDO data mapping groups, etc., will all lead to changes in PDO process data). Currently, there are two most common methods. One is to directly fix the PDO process data settings in the master station program based on the configuration information in the ENI file. The problem with this method is that once the quantity or order of PDO process data changes, the master station program must add and update it again according to the actual situation. The other method is to store the object dictionary index and sub-index address of commonly used PDO process data in the master station program. The master station program matches the information stored in the program with the PDO process data index and sub-index address actually used by the slave. This method is slightly more flexible than the first method, but if the used PDO process data does not exist in the stored information, the master station program still needs to be updated.

[0032] In addition, some current solutions mainly involve mapping the SDO service data configuration PDO process data of the CANopen bus. This method is mainly for the CANopen bus, and all CANopen bus communication data requires users to manually set the SDO service data for mapping configuration. It cannot achieve the function of fully automatic matching of PDO process data, and it is not applicable to the EtherCAT bus.

[0033] In addition, some current solutions for EtherCAT master control use a network configuration module to match slave devices and extract the process data variable sets of each slave device to generate control variables. The control variables generated by this method must be preset in the image configuration module in advance. If the control variables corresponding to the process data of the slave devices are not preset, the user cannot set the control variables correctly. Furthermore, a configuration interface device must be used to convert the continuous process data image file into a file format that the master control device can recognize and download it to the master control device.

[0034] In addition, some current solutions require the use of the IEC61131-3 function library to call the CANopen mapped process data as a library file. After the slave device is replaced, the IoDrvTemplate.devdesc.xml template needs to be modified and updated. Furthermore, after manually adding the interface mapping in the industrial control software development environment, it needs to be recompiled to achieve normal communication. It cannot automatically match and adapt to all slave devices and is not applicable to the EtherCAT bus.

[0035] In addition, some current solutions identify slave devices through configuration software and rely on EDS files to parse data. This approach is not comprehensive in its application, and the parsing method is only applicable to the DeviceNet bus and cannot be applied to the EtherCAT bus.

[0036] As described in the background section and above, existing methods for adapting a master station to a slave station can achieve dynamic mapping of conventional PDO process data, but cannot achieve user-defined mapping of PDO process data. To at least solve the problem that methods for adapting a master station to a slave station can achieve dynamic mapping of conventional PDO process data, but cannot achieve user-defined mapping of PDO process data, embodiments of this application provide a master-slave station adaptation method, a master station, and a storage medium.

[0037] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.

[0038] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a master-slave adaptation method according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0039] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the master-slave adaptation method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one instance, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0040] This embodiment provides a method for adapting a master station and a slave station running on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.

[0041] Figure 2 This is a flowchart of a master station and slave station adaptation method according to an embodiment of this application. The method is applied to the master station, such as... Figure 2 As shown, the method includes the following steps:

[0042] Step S201: Obtain the PDO process data allocation information of each slave station. The PDO process data allocation information includes the object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes indexes and sub-indexes.

[0043] Specifically, the PDO process data allocation information for each slave station also includes: the total number of PDO process data entries for each slave station; the number of input PDO process data entries; the index, sub-index, and data length of each input PDO process data entry; the number of output PDO process data entries; the index, sub-index, and data length of each output PDO process data entry, etc. In other words, it includes relevant information about the PDO process data; it primarily uses the indexes and sub-indexes from the object dictionary of the PDO process data.

[0044] In the field of robotics, the slave station is the working robot (which also includes other working equipment such as welding machines, machine tools, and injection molding machines), and the master station is the control terminal. The master station and the slave station transmit data through the EtherCAT bus. To achieve complex functions, one master station generally needs to be adapted to multiple slave stations.

[0045] In step S202, if the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station.

[0046] The default object dictionary stores the index, sub-index, data type, access type, and variable definition of the object dictionary. For example, in the object dictionary for a control word, the index is 0x6040, the sub-index is 0x00, the data type is Unsigned16, the access type is RW (read / write), and the variable is defined as ControlWord.

[0047] The above means that the target PDO process data of the slave station is not located in the preset object dictionary repository if it is not successfully located in the preset object dictionary repository; otherwise, it is located in the preset object dictionary repository.

[0048] Specifically, the custom configuration interface is integrated into the teach pendant of the main station. If the user customizes the PDO process data, the user will be prompted to configure it through the custom configuration interface. This will enable the recognition and updating of the PDO process data without the need for external devices or configuration software and tools. The user's on-site operation is simple, convenient and flexible. Figure 3 A specific custom configuration interface is shown.

[0049] In addition, the custom configuration interface can also be integrated into the central control monitoring interface, and the central control operator can set it up and then send it to the main station equipment for updates via the local area network.

[0050] Step S203: Receive and respond to the user-configured object dictionary, update the preset object dictionary repository to obtain the updated preset object dictionary repository, and control the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

[0051] The master-slave adaptation method of this application obtains the PDO process data allocation information of each slave station. If the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The system receives and responds to the user-configured object dictionary, updates the preset object dictionary repository to obtain the updated preset object dictionary repository, and controls the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master and slave stations, thereby establishing a communication connection between the master and slave stations. This scheme uses the preset object dictionary repository to determine whether the PDO process data object dictionary of the slave station appears in the preset object dictionary repository. If so, it is configured through the custom configuration interface. The master station updates the preset object dictionary repository and adaptively adjusts the PDO interaction data group according to the configuration information, realizing the mapping of changes in user-defined PDO process data. The method for adapting the master site to the slave site has been solved, which can realize the dynamic change mapping of conventional PDO process data, but it cannot realize the change mapping of user-defined PDO process data.

[0052] In this embodiment of the application, before determining that the target PDO process data is user-defined PDO process data when the object dictionary of the target PDO process data at the slave station is not successfully located in the preset object dictionary repository, the method further includes:

[0053] The object dictionary of the target PDO process data is compared with the base address of the preset object dictionary repository to determine the address range where the object dictionary of the target PDO process data is located. Each address range has one base address.

[0054] A binary search method is used within the address range to locate whether the object dictionary of the target PDO process data is located in the preset object dictionary repository.

[0055] Specifically, the object dictionaries in the default object dictionary repository are arranged sequentially, and each address range has a base address. For example, the base address for the 0x6000-0x6FFF address range is 0x6000. The advantage of this is that during traversal and location, the address range can be quickly located based on the base address, and then a binary search method can be used within that range for faster positioning. Similarly, when it is determined that user-defined object dictionary information exists and needs to be added to the object dictionary repository, a binary search method can be used for the insertion.

[0056] During the positioning process, the main focus is on determining the index and sub-index, and marking the object dictionary information located in the preset object dictionary repository to facilitate subsequent mapping of PDO process data between the master station program and all slave devices.

[0057] In this embodiment of the application, the method further includes:

[0058] If the target PDO process data on the slave station is successfully located in the preset object dictionary repository, a tag is added to the successfully located object dictionary. This tagging process helps distinguish the successfully located object dictionary from those that were not located, facilitating subsequent mapping steps.

[0059] In this embodiment of the application, before obtaining the PDO process data allocation information of each slave station, the method further includes:

[0060] The master station reads the manufacturer identification information and product code of each slave station;

[0061] The type of slave station is determined based on the manufacturer identification information and the product code. The manufacturer identification information is used to uniquely identify the manufacturer, and the product codes of the same type of product belonging to different manufacturers are different.

[0062] For example, the product code of injection molding machine from manufacturer A is 0041X, and the product code of injection molding machine from manufacturer B is 0001Y. That is, the type of slave station can only be determined when both the manufacturer identification information and the product code are determined, so as to facilitate the implementation of subsequent mapping steps.

[0063] In this embodiment of the application, the master station reads the manufacturer identification information and product code of each slave station, including:

[0064] The master station reads the EEPROM information of each slave station through sequential addressing;

[0065] The manufacturer identification information and product code of each slave station are obtained through EEPROM information.

[0066] As described above, after the system powers on, the EtherCAT master station can scan all devices on the communication connection topology using sequential addressing and obtain the vendor ID (manufacturer identification information) and product code of different devices through the EEPROM access function, thereby determining the type of slave station. Then, based on the SII interface information (EEPROM information), the classification information of the process data is determined. Here, the master station can obtain the PDO process data allocation information of different slave stations through the classification information.

[0067] In this embodiment of the application, the PDO process data allocation information further includes: the number of input PDO process data entries and the number of output PDO process data entries, wherein the PDO process data includes input PDO process data and output PDO process data, and updating the PDO interaction data group for interaction between the master station and the slave station includes:

[0068] The main site defines pointer variable names for each unique address variable in the preset object dictionary repository to establish a one-to-one correspondence between unique address variable information and pointer variable names;

[0069] The above describes how the correspondence between the master program and the preset object dictionary repository is achieved by matching the pointer variable name with the address variable information in the preset object dictionary repository. Combined with the correspondence between the preset object dictionary repository and the PDO process data allocation information of the slave station, the correspondence between the master program and the PDO process data allocation information of the slave station is further achieved.

[0070] For each slave station, a first loop and a second loop are executed for the input PDO process data and the output PDO process data, respectively. The first loop is used to point the first pointer variable to the offset address of the corresponding input PDO process data, and the second loop is used to point the second pointer variable to the offset address of the corresponding output PDO process data, so as to establish a mapping between the pointer variable and the PDO process data address, and update the PDO interaction data group for interaction between the master station and the slave station.

[0071] Through the first and second loops, the second pointer variable of the master station is made to point to the input PDO process data and output PDO process data of the slave station, that is, to realize the mapping between the master station and the slave station, so as to update the PDO interaction data group for interaction between the master station and the slave station. This realizes the adaptation between the master station and the slave station.

[0072] In this embodiment, performing a first loop on the input PDO process data includes: a first comparison step: comparing the index information of the input PDO process data with the index address corresponding to the first pointer variable to obtain a first comparison result. The index information includes the index and sub-index of the input PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a first pointing step: if the first comparison result indicates that the index information of the input PDO process data matches the index address, pointing the first pointer variable to the offset address of the corresponding input PDO process data; repeating the first comparison step and the first pointing step at least once until the mapping of all offset addresses of the input PDO process data to the first pointer variable is completed;

[0073] The second loop for output PDO process data includes: a second comparison step: comparing the index information of the output PDO process data with the index address corresponding to the second pointer variable to obtain a second comparison result. The index information includes the index and sub-index of the output PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a second pointing step: if the second comparison result indicates that the index information of the output PDO process data matches the index address, pointing the second pointer variable to the offset address of the corresponding output PDO process data; repeating the second comparison step and the second pointing step at least once until the mapping of all offset addresses of the output PDO process data to the second pointer variable is completed.

[0074] The above describes how the master station and slave station were adapted by executing the first comparison step and the first pointing step, and by executing the second comparison step and the second pointing step.

[0075] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the master station and slave station adaptation method of this application will be described in detail below with reference to specific embodiments.

[0076] This embodiment relates to a specific master-slave adaptation method, applied to the automatic identification of EtherCAT process data supporting the CoE protocol, such as... Figure 4 As shown, it includes the following steps:

[0077] Reading steps: The master station reads the EEPROM information of each slave device using sequential addressing; obtains the manufacturer ID and product code of each slave device from the EEPROM information to determine the slave device type; determines the PDO process data allocation information of different slave devices; and obtains the FMMU mapping order of PDO process data for all slave devices.

[0078] Location steps: Traverse the preset object dictionary data repository to locate the object dictionary information of all PDO process data in the reading module; determine whether user-defined PDO process data exists; if so, prompt the user that there is user-defined PDO process data, and ask them to enter the index, sub-index, data type, access type, and variable definition information of the configured PDO process data through the teach pendant configuration interface, and click save to store it sequentially in the database file; update the object dictionary data repository information according to the settings, and the main station program reloads the repository information; return to the traversal steps;

[0079] If not, perform the mapping steps: The master station program updates the PDO interactive data group that needs to interact with the slave device; the master station and the slave device establish normal communication.

[0080] The specific positioning steps are as follows: Figure 5 As shown, the process includes: determining the base address of the preset object dictionary repository for the PDO process data to be located; determining the address range of the preset object dictionary repository; using a binary search method to confirm whether the object dictionary exists; if it exists, adding a tag to facilitate the implementation of the mapping steps; if it does not exist, prompting the user to add it manually and updating the preset object dictionary repository.

[0081] Specifically, assuming the index of the object dictionary to be located is 0x6040 and the sub-index is 0x00, first, it is compared with the base address to confirm the address range where the object dictionary is located. Then, a binary search method is used to quickly locate the object dictionary within this address range. Finally, it is confirmed whether the object dictionary exists in the object dictionary repository. If it does not exist, the user is prompted to add it manually. If it exists, the object dictionary is tagged to facilitate the mapping process in the mapping module.

[0082] The mapping steps are as follows: Figure 6 As shown, the process includes: after the number of slave stations, slave station type, and number of PDO process data items for each slave station have been determined in the reading step; the master station program defines a pointer variable name for each unique address variable in the preset object dictionary repository; it starts to loop through and judge the PDO process data information of each slave station, and uniquely maps the pointer variable to the process data address; if it is slave station 1, it loops through and judges all PDO process data information of slave station 1; for input PDO process data and output PDO process data, it performs different loop steps to enter the consistency judgment step of the index information of PDO process data variable and the index address corresponding to the pointer variable. If they match, the pointer variable points to the offset address of the PDO process data, until all PDO process data addresses are mapped to pointer variables, and the master station program completes the update of all PDO process data groups that interact with the slave stations.

[0083] As mentioned above, each unique address in the preset object dictionary repository has a corresponding pointer variable name in the master program. During the reading step, the master program obtains the FMMU mapping information of the PDO process data for all slave modules, that is, the starting position and offset of the PDO process data for each slave module within the entire Ethernet frame. In actual Ethernet data transmission, the PDO process data changes periodically; therefore, as long as the pointer variables in the master program can ensure that the address of the PDO process data they point to is accurate, correct master-slave communication can be established.

[0084] The reading step has already confirmed the total number of PDO process data items and the number of input / output PDO process data items for the slave station. The mapping step begins by determining which slave station it is. Assuming it's identified as a default servo drive with 24 PDO process data items (15 input and 9 output), the mapping relationship between the output process data and pointer variables in the master program needs to be determined. This requires iteratively checking all 9 output variables. For example, to confirm the control word variable, the index address of the input process data variable is checked against the address 0x6040 corresponding to the status word variable. If the addresses match, the pointer variable ControlWord is set to the offset address of that PDO process data item. All pointer variable mappings use this method. The master program only needs to execute the mapping module once before the iterative process to map the addresses of all slave device PDO process data variables to the pointer variables in the master program, thus achieving iterative process data interaction.

[0085] After the above steps, the EtherCAT master station can automatically and dynamically identify PDO process data, making it convenient for users to automatically update the master station program when updating topology or slave station information, without having to return to the developer to update the program. Furthermore, through the teach pendant user settings interface, no external equipment is needed, reducing the configuration work for on-site operators, and the operation is simple, convenient and fast.

[0086] This application addresses the problems of the master station program needing to be updated when the PDO process data of the slave device changes, the master station program being unable to recognize and update when the user-defined PDO process data changes, and the master station program needing to rely on computer-based host computer configuration software or configuration software to update the PDO process data, which is inconvenient for users on-site.

[0087] This application also provides a master station. It should be noted that the master station in this application can be used to execute the adaptation method for master and slave stations provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0088] The following describes the main station provided in the embodiments of this application.

[0089] Figure 7 This is a schematic diagram of the main station according to an embodiment of this application. For example... Figure 7 As shown, the device includes:

[0090] The acquisition unit 71 is used to acquire the PDO process data allocation information of each slave station. The PDO process data allocation information includes an object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes an index and a sub-index.

[0091] The prompting unit 72 is used to determine that the target PDO process data is user-defined PDO process data if the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, and to generate a prompt message. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station.

[0092] The receiving response unit 73 is used to receive and respond to the user-configured object dictionary, update the preset object dictionary repository to obtain the updated preset object dictionary repository, and control the master station program to reload the updated preset object dictionary repository to update the PDO interactive data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

[0093] The master station of this application acquires the PDO process data allocation information of each slave station through its acquisition unit. If the target PDO process data of the slave station cannot be located in the preset object dictionary repository, the master station determines that the target PDO process data is user-defined PDO process data and generates a prompt message. This prompt message guides the user to configure the object dictionary of the target PDO process data through a custom configuration interface. The response unit receives and responds to the user-configured object dictionary, updates the preset object dictionary repository, and controls the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group between the master station and the slave station, thereby establishing a communication connection between them. This solution uses the preset object dictionary repository to determine whether the PDO process data of the slave station is user-defined by checking if its object dictionary appears in the repository. If so, it configures it through the custom configuration interface. The master station updates the preset object dictionary repository and adaptively adjusts the PDO interaction data group based on the configuration information, thus achieving a mapping of changes in user-defined PDO process data. The method for adapting the master site to the slave site has been solved, which can realize the dynamic change mapping of conventional PDO process data, but it cannot realize the change mapping of user-defined PDO process data.

[0094] In this embodiment, the device further includes a comparison unit and a positioning unit. The comparison unit compares the object dictionary of the target PDO process data with the base address of the preset object dictionary repository before determining that the target PDO process data is user-defined PDO process data, if the object dictionary of the target PDO process data at the slave station is not successfully located in the preset object dictionary repository. This comparison determines the address segment where the object dictionary of the target PDO process data is located, with each address segment having one base address. The positioning unit uses a binary search method within the address segment to determine whether the object dictionary of the target PDO process data is located in the preset object dictionary repository. During the positioning process, the index and sub-index are mainly determined, and the object dictionary information located in the preset object dictionary repository is marked to facilitate subsequent mapping between the master station program and the PDO process data of all slave devices.

[0095] In this embodiment, the device further includes a tagging unit. The tagging unit is used to add tags to the successfully located object dictionary of the target PDO process data in the slave station, provided that the object dictionary is successfully located in a preset object dictionary repository. This tagging process facilitates differentiation from unlocated object dictionaries, simplifying subsequent mapping steps.

[0096] In this embodiment, the device further includes a reading unit and a determining unit. The reading unit is used to read the manufacturer identification information and product code of each slave station before acquiring the PDO process data allocation information of each slave station. The determining unit is used to determine the type of the slave station based on the manufacturer identification information and product code. The manufacturer identification information is used to uniquely identify the manufacturer, and the product codes of the same type of product belonging to different manufacturers are different. For example, the product code of the injection molding machine of manufacturer A is 0041X, and the product code of the injection molding machine of manufacturer B is 0001Y. That is, the type of slave station can only be determined when both the manufacturer identification information and the product code are determined, which facilitates the implementation of subsequent mapping steps.

[0097] Furthermore, the reading unit includes a reading module and an acquisition module. The reading module reads the EEPROM information of each slave station using sequential addressing; the acquisition module acquires the manufacturer identification information and product code of each slave station using the EEPROM information. As described above, after the system powers on, the EtherCAT master station can scan all devices on the communication connection topology using sequential addressing and acquire the manufacturer ID (manufacturer identification information) and product code of different devices through the EEPROM access function, thereby determining the type of slave station. Then, based on the SII interface information (EEPROM information), the classification information of the process data is determined. Here, the master station can obtain the PDO process data allocation information of different slave stations through the classification information.

[0098] Furthermore, the PDO process data allocation information also includes: the number of input PDO process data entries and the number of output PDO process data entries. The PDO process data includes both input and output PDO process data. The receiving response unit includes an update module, which updates the PDO interaction data group between the master station and the slave station. The update module includes a construction submodule and an execution submodule. The construction submodule defines pointer variable names for each unique address variable in the preset object dictionary repository to establish a one-to-one correspondence between unique address variable information and pointer variable names. The execution submodule executes a first loop and a second loop for each slave station, respectively, for the input and output PDO process data. The first loop points the first pointer variable to the offset address of the corresponding input PDO process data, and the second loop points the second pointer variable to the offset address of the corresponding output PDO process data, thus establishing a mapping between pointer variables and PDO process data addresses to update the PDO interaction data group between the master station and the slave station. Through the first and second loops, the second pointer variable of the master station is made to point to the input PDO process data and output PDO process data of the slave station, that is, to realize the mapping between the master station and the slave station, so as to update the PDO interaction data group for interaction between the master station and the slave station. This realizes the adaptation between the master station and the slave station.

[0099] The execution submodules include a first execution submodule and a second execution submodule:

[0100] The first execution submodule is used to perform a first loop for the input PDO process data, including: a first comparison step: comparing the index information of the input PDO process data with the index address corresponding to the first pointer variable to obtain a first comparison result. The index information includes the index and sub-index of the input PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a first pointing step: if the first comparison result indicates that the index information of the input PDO process data matches the index address, pointing the first pointer variable to the offset address of the corresponding input PDO process data; repeating the first comparison step and the first pointing step at least once until the mapping of all offset addresses of the input PDO process data to the first pointer variable is completed;

[0101] The second execution submodule is used to perform a second loop for the output PDO process data, including: a second comparison step: comparing the index information of the output PDO process data with the index address corresponding to the second pointer variable to obtain a second comparison result. The index information includes the index and sub-index of the output PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a second pointing step: if the second comparison result indicates that the index information of the output PDO process data matches the index address, pointing the second pointer variable to the offset address of the corresponding output PDO process data; repeating the second comparison step and the second pointing step at least once until the mapping of all offset addresses of the output PDO process data to the second pointer variable is completed.

[0102] The above describes how the master station and slave station were adapted by executing the first comparison step and the first pointing step, and by executing the second comparison step and the second pointing step.

[0103] Specifically, the custom configuration interface is integrated into the teach pendant of the main station, or the custom configuration interface is integrated into the central control monitoring interface.

[0104] The main station includes a processor and a memory. The aforementioned acquisition unit, confirmation prompt unit, and response receiving unit are all stored as program units in the memory. The processor executes these program units stored in the memory to achieve the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.

[0105] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; by adjusting kernel parameters, the problem of not being able to implement the change mapping of user-defined PDO process data can be solved.

[0106] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0107] This invention provides a computer-readable storage medium, which includes a stored program, wherein the program, when running, controls the device where the computer-readable storage medium is located to execute a master station and slave station adaptation method.

[0108] Specifically, the adaptation methods for the main site and the slave site include:

[0109] Step S201: Obtain the PDO process data allocation information of each slave station. The PDO process data allocation information includes the object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes indexes and sub-indexes.

[0110] In step S202, if the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station.

[0111] Step S203: Receive and respond to the user-configured object dictionary, update the preset object dictionary repository to obtain the updated preset object dictionary repository, and control the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

[0112] This invention provides a processor for running a program, wherein the program executes a master-slave adaptation method during runtime.

[0113] Specifically, the adaptation methods for the main site and the slave site include:

[0114] Step S201: Obtain the PDO process data allocation information of each slave station. The PDO process data allocation information includes the object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes indexes and sub-indexes.

[0115] In step S202, if the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station.

[0116] Step S203: Receive and respond to the user-configured object dictionary, update the preset object dictionary repository to obtain the updated preset object dictionary repository, and control the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

[0117] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:

[0118] Step S201: Obtain the PDO process data allocation information of each slave station. The PDO process data allocation information includes the object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes indexes and sub-indexes.

[0119] In step S202, if the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station.

[0120] Step S203: Receive and respond to the user-configured object dictionary, update the preset object dictionary repository to obtain the updated preset object dictionary repository, and control the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

[0121] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0122] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:

[0123] Step S201: Obtain the PDO process data allocation information of each slave station. The PDO process data allocation information includes the object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes indexes and sub-indexes.

[0124] In step S202, if the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station.

[0125] Step S203: Receive and respond to the user-configured object dictionary, update the preset object dictionary repository to obtain the updated preset object dictionary repository, and control the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

[0126] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0127] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0129] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0130] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0131] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0132] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0133] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0134] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0135] As can be seen from the above description, the embodiments of this application achieve the following technical effects:

[0136] 1) The master-slave adaptation method of this application obtains the PDO process data allocation information of each slave station. If the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The master station receives and responds to the user-configured object dictionary, updates the preset object dictionary repository to obtain the updated preset object dictionary repository, and controls the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, thereby establishing a communication connection between the master station and the slave station. This scheme uses the preset object dictionary repository to determine whether the object dictionary of the slave station's PDO process data appears in the preset object dictionary repository. If so, it is configured through the custom configuration interface. The master station updates the preset object dictionary repository and adaptively adjusts the PDO interaction data group according to the configuration information to realize the change mapping of user-defined PDO process data. The method for adapting the master site to the slave site has been solved, which can realize the dynamic change mapping of conventional PDO process data, but it cannot realize the change mapping of user-defined PDO process data.

[0137] 2) The master station of this application acquires the PDO process data allocation information of each slave station through its acquisition unit. If the target PDO process data of the slave station is not successfully located in the preset object dictionary repository by the prompting unit, the master station determines that the target PDO process data is user-defined PDO process data and generates a prompt message. This prompt message prompts the user to configure the object dictionary of the target PDO process data through a custom configuration interface. The receiving and responding unit receives and responds to the user-configured object dictionary, updates the preset object dictionary repository, and controls the master station program to reload the updated preset object dictionary repository to update the PDO interaction data group between the master station and the slave station, thereby establishing a communication connection between them. This solution uses the preset object dictionary repository to determine whether the PDO process data of the slave station appears in the preset object dictionary repository. If so, it configures it through the custom configuration interface. The master station updates the preset object dictionary repository and adaptively adjusts the PDO interaction data group based on the configuration information, realizing the mapping of changes in user-defined PDO process data. The method for adapting the master site to the slave site has been solved, which can realize the dynamic change mapping of conventional PDO process data, but it cannot realize the change mapping of user-defined PDO process data.

[0138] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for adapting a master station and a slave station, characterized in that, The method is applied to the main station and includes: Obtain the PDO process data allocation information of each slave station. The PDO process data allocation information includes an object dictionary of each PDO process data of the corresponding slave station. The object dictionary includes an index and sub-indexes. If the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, the target PDO process data is determined to be user-defined PDO process data, and a prompt message is generated. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station. The system receives and responds to the user-configured object dictionary, updates the preset object dictionary repository to obtain the updated preset object dictionary repository, and controls the program of the master station to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

2. The method according to claim 1, characterized in that, Before determining that the target PDO process data is user-defined PDO process data, if the object dictionary of the target PDO process data at the slave station is not successfully located in the preset object dictionary repository, the method further includes: The object dictionary of the target PDO process data is compared with the base address of the preset object dictionary repository to determine the address segment where the object dictionary of the target PDO process data is located, and each address segment has one base address; A binary search method is used to locate the target PDO process data within the address range to determine whether the object dictionary is located in the preset object dictionary repository.

3. The method according to claim 1, characterized in that, The method further includes: If the object dictionary of the target PDO process data of the slave station is successfully located in the preset object dictionary repository, the successfully located object dictionary is tagged.

4. The method according to claim 1, characterized in that, Before obtaining the PDO process data allocation information for each slave station, the method further includes: The master station reads the manufacturer identification information and product code of each slave station; The type of slave station is determined based on the manufacturer identification information and the product code, wherein the manufacturer identification information is used to uniquely identify the manufacturer, and the product codes of the same type of products belonging to different manufacturers are different.

5. The method according to claim 4, characterized in that, The master station reads the manufacturer identification information and product code of each slave station, including: The master station reads the EEPROM information of each slave station through sequential addressing; The manufacturer identification information and product code of each slave station are obtained through the EEPROM information.

6. The method according to claim 4, characterized in that, The PDO process data allocation information further includes: the number of input PDO process data entries and the number of output PDO process data entries, wherein the PDO process data includes the input PDO process data and the output PDO process data, and updating the PDO interaction data group between the master station and the slave station includes: The main station defines pointer variable names for each unique address variable in the preset object dictionary repository to establish a one-to-one correspondence between the unique address variable information and the pointer variable names; For each slave station, a first loop and a second loop are executed for the input PDO process data and the output PDO process data, respectively. The first loop is used to point the first pointer variable to the offset address of the corresponding input PDO process data, and the second loop is used to point the second pointer variable to the offset address of the corresponding output PDO process data, so as to construct a mapping between the pointer variable and the PDO process data address, and update the PDO interaction data group for interaction between the master station and the slave station.

7. The method according to claim 6, characterized in that, Executing the first loop for the input PDO process data includes: a first comparison step: comparing the index information of the input PDO process data with the index address corresponding to the first pointer variable to obtain a first comparison result, wherein the index information includes the index and the sub-index of the input PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a first pointing step: if the first comparison result indicates that the index information of the input PDO process data is consistent with the index address, pointing the first pointer variable to the corresponding offset address of the input PDO process data; repeating the first comparison step and the first pointing step at least once in sequence until the mapping of all offset addresses of the input PDO process data to the first pointer variable is completed; Executing the second loop for the output PDO process data includes: a second comparison step: comparing the index information of the output PDO process data with the index address corresponding to the second pointer variable to obtain a second comparison result, wherein the index information includes the index and the sub-index of the output PDO process data, and the index address is the address of the address variable in the preset object dictionary repository; a second pointing step: if the second comparison result indicates that the index information of the output PDO process data matches the index address, pointing the second pointer variable to the corresponding offset address of the output PDO process data; repeating the second comparison step and the second pointing step at least once in sequence until the mapping of all offset addresses of the output PDO process data to the second pointer variable is completed.

8. The method according to any one of claims 1 to 7, characterized in that, The custom configuration interface is integrated into the teach pendant of the main station, or the custom configuration interface is integrated into the central control monitoring interface.

9. A master station, characterized in that, include: The acquisition unit is used to acquire the PDO process data allocation information of each slave station. The PDO process data allocation information includes an object dictionary of the PDO process data of each slave station, and the object dictionary includes an index and a sub-index. The prompting unit is used to determine that the target PDO process data is user-defined PDO process data when the object dictionary of the target PDO process data of the slave station is not successfully located in the preset object dictionary repository, and to generate a prompt message. The prompt message is used to prompt the user to configure the object dictionary of the target PDO process data through the custom configuration interface. The target PDO process data of the slave station is one of the multiple PDO process data of the slave station. A receiving response unit is configured to receive and respond to the object dictionary configured by the user, update the preset object dictionary repository to obtain an updated preset object dictionary repository, and control the program of the master station to reload the updated preset object dictionary repository to update the PDO interaction data group for interaction between the master station and the slave station, so as to establish a communication connection between the master station and the slave station.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the master-slave adaptation method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for realizing CANopen slave station

    CN101854300A

  • Data synchronization method from main station to auxiliary stations of CANopen

    CN109587215A