Configuration file generation method and device based on EtherCAT and related medium

By analyzing slave information interface data on the EtherCAT master and generating configuration files in combination with the master configuration data, the problem of ENI file generation in the prior art relying on computer software, and flexible configuration and communication between the master and slaves of different topology are realized, reducing equipment costs and improving configuration flexibility.

CN119629221APending Publication Date: 2025-03-14GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411839883.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When generating EtherCAT master configuration files (ENI files), the existing technology needs to rely on computer master software, resulting in high equipment costs and regenerating the ENI file when replacing or adjusting the topology, which lacks configuration flexibility.

Method used

By obtaining the slave information interface data of the slave station on the master station, analyzing and processing it to obtain the slave analysis data, and combining the master station configuration data and slave process data, a configuration file is generated and stored directly in the master station for use.

Benefits of technology

It realizes that the master station can quickly establish configuration and communicate data interaction with slave stations of different topologies without relying on computer software, reducing equipment costs and no need to regenerate ENI files when replacing or adjusting the topology, improving configuration flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629221A_ABST
    Figure CN119629221A_ABST
Patent Text Reader

Abstract

The invention discloses a configuration file generation method and device based on EtherCAT and a related medium, the method and device are applied to a master station, and the method comprises the following steps: acquiring slave station information interface data of a slave station; performing analysis processing on the slave station information interface data to obtain slave station analysis data; acquiring master station configuration data and slave station process data; and combining the slave station analysis data with the master station configuration data and the slave station process data to generate a configuration file. According to the method, the acquired slave station analysis data is combined with the master station configuration data and the slave station process data to generate the configuration file, and then the generated configuration file is stored in the master station for use, so that the master station can quickly establish configuration with slave stations with different topologies and perform communication data interaction without depending on computer master station software, and the operation is simple and convenient. And the equipment cost is reduced, and the ENI file does not need to be regenerated when the topology is replaced or adjusted, so that the configuration flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a configuration file generation method and device based on EtherCAT and related media. Background Art

[0002] EtherCAT is a high-performance industrial Ethernet communication protocol widely used in the field of industrial automation. In the EtherCAT communication topology, the slave station usually needs to provide a slave station configuration file (ESI file), and the master station parses the ESI file through dedicated software (such as TwinCAT, KPA, etc.) and generates a master station configuration file (ENI file).

[0003] The traditional ENI file generation method requires connecting the EtherCAT topology to a computer, reading the ESI file and generating the ENI file through the dedicated software of the master station, and then importing the generated ENI file into the master station for use. For example, patent CN115086103A discloses a slave station identification method based on EtherCAT technology, that is, an implementation method that relies on the master station software to read the locally stored slave station configuration file (ESI file). This method reads the slave station information (VendorID and ProductCode) in the network, matches the local ESI file information, and generates the communication configuration text of the current network. Although it can complete the generation of ENI files, it still needs to rely on computer software, resulting in high equipment cost and complex operation.

[0004] For example, patent CN106789258A discloses a configuration method for industrial Ethernet, which extracts the search data packets of bus devices through an additional master microcontroller unit (MCU) to generate a simple network configuration. However, this method can only extract basic device information, and cannot obtain specific data information such as synchronization manager (SM), field memory unit mapping (FMMU), transmission process data (TxPDO), and reception process data (RxPDO) in the EtherCAT slave station, which is difficult to meet the actual needs of complex EtherCAT networks.

[0005] In summary, the existing technology has defects in generating ENI files: it needs to rely on computer master station software, which increases equipment costs, and the ENI file needs to be regenerated when the topology is replaced or adjusted, and the configuration flexibility is insufficient. Summary of the invention

[0006] The embodiment of the present invention provides a configuration file generation method, device and related media based on EtherCAT, aiming to solve the problem that the equipment cost of the prior art method for generating ENI files is high and the ENI files need to be regenerated when the topology is replaced or adjusted.

[0007] In a first aspect, an embodiment of the present invention provides a method for generating a configuration file based on EtherCAT, which is applied to a master station and includes:

[0008] Get the slave information interface data of the slave;

[0009] Parsing the slave station information interface data to obtain slave station parsed data;

[0010] Get master station configuration data and slave station process data;

[0011] The slave station parsed data is combined with the master station configuration data and the slave station process data to generate a configuration file.

[0012] In a second aspect, an embodiment of the present invention provides a configuration file generating device based on EtherCAT, which is arranged at a master station and includes:

[0013] An information acquisition unit, used for acquiring slave station information interface data of the slave station;

[0014] An information parsing unit, used for parsing the slave station information interface data to obtain slave station parsed data;

[0015] A data acquisition unit, used to acquire master station configuration data and slave station process data;

[0016] The file generating unit is used to combine the slave station parsing data with the master station configuration data and the slave station process data to generate a configuration file.

[0017] In a third aspect, an embodiment of the present invention provides a master station, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the EtherCAT-based configuration file generation method of the first aspect when executing the computer program.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the EtherCAT-based configuration file generation method of the first aspect is implemented.

[0019] The embodiment of the present invention provides a configuration file generation method based on EtherCAT, which is applied to a master station, including obtaining slave station information interface data of a slave station; parsing and processing the slave station information interface data to obtain slave station parsing data; obtaining master station configuration data and slave station process data; combining the slave station parsing data with the master station configuration data and the slave station process data to generate a configuration file. The present invention combines the obtained slave station parsing data with the master station configuration data and the slave station process data to generate a configuration file, and then stores the generated configuration file in the master station for use, so that the master station can quickly establish a configuration with slave stations of different topologies and perform communication data interaction, without relying on computer master station software, reducing equipment costs, and when changing or adjusting the topology, there is no need to regenerate the ENI file, thereby improving configuration flexibility.

[0020] The embodiment of the present invention also provides a configuration file generating device, a master station and a storage medium based on EtherCAT, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0022] Figure 1 A schematic diagram of a flow chart of a method for generating a configuration file based on EtherCAT provided in an embodiment of the present invention;

[0023] Figure 2 Another schematic diagram of a flow chart of a method for generating a configuration file based on EtherCAT provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of the structure of a master station and a slave station provided in an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of a teaching pendant interface provided by an embodiment of the present invention;

[0026] Figure 5 A schematic block diagram of a configuration file generating device based on EtherCAT provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0028] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0029] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0030] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0031] See below Figure 1 , Figure 1 A schematic flow chart of a method for generating a configuration file based on EtherCAT provided in an embodiment of the present invention specifically includes steps S101 to S104.

[0032] S101, obtaining slave station information interface data of the slave station;

[0033] S102, parsing the slave station information interface data to obtain slave station parsed data;

[0034] S103, obtaining master station configuration data and slave station process data;

[0035] S104: Combine the slave station parsed data with the master station configuration data and the slave station process data to generate a configuration file.

[0036] Combination Figure 2 and Figure 3As shown in the figure, the ENI file (EtherCAT Network Information) is an XML file that describes the entire EtherCAT network structure and configuration. It is usually generated or edited by the EtherCAT master software and is used for network initialization and dynamic configuration. SII (Slave Interface Information) records the interface information of the slave, including the name and type of the signal and the basic settings of its communication parameters. As the basis for the initial communication between the slave and the master, it can be quickly parsed by the EtherCAT master and can be used for the initial configuration and identification of the device.

[0037] In the present invention, after the EtherCAT master station is powered on, the SII information (i.e., slave station information interface data) is parsed, and the ENI file is generated by combining the master station configuration parameter file (i.e., master station configuration data) and the user-defined process data (i.e., slave station process data). Without the need for computer master station software, the master station can flexibly connect slave stations of different topological types and quickly establish EtherCAT communication. It ensures that the master station can still obtain its basic information before the complete communication configuration is established, supports the plug-and-play of the slave station, and then constructs the ENI file, and quickly establishes network connection and communication in the actual environment.

[0038] In step S101, the slave information interface data of each slave is first obtained and applied in the next step.

[0039] In one embodiment, the step S101 includes:

[0040] Sequentially read the data of the first predetermined bytes of the memory of each slave station to obtain the basic information data of each slave station, and obtain the actual size of the corresponding memory according to the basic information data;

[0041] All data in the memory are read according to the actual size of the memory to obtain the slave station information interface data corresponding to the slave station.

[0042] In this embodiment, after the master station is powered on, the EEPROM (i.e., memory, the same below) of each slave station connected in the EtherCAT network is accessed to read the first predetermined byte data (such as the first 128 bytes of data) of each slave station memory in sequence. The first predetermined byte data contains the basic information of the slave station, including the VendorID, ProductCode, device type, etc. of the slave station. Then, the actual size of the memory is determined by reading the EEPROM size information stored at the 0x03E address of the EEPROM. Since the memory size of each slave station is different, but the basic information of the first 128 bytes is the same, and the data of the memory size is stored in 0x03E, it is divided into 2 times to read. The first time only reads the first 128 bytes of general data to obtain the actual size of the memory, and the second time reads the data of the entire memory range according to the actual size.

[0043] Furthermore, after obtaining the actual size of the memory, the master performs a complete data read operation on the target memory based on the actual size of the memory. Specifically, the master extracts all the contents from the memory by reading byte by byte or by block. The master integrates and processes the read complete memory data to form slave information interface data. The slave information interface data contains the slave's hardware information, communication parameters, and process data information, providing basic support for subsequent parsing and configuration file generation.

[0044] In step S102, the master station parses the acquired slave station information interface data through a parsing module, and after parsing, slave station parsing data can be obtained and applied in the next step.

[0045] In one embodiment, the step S102 includes:

[0046] Classify, analyze, process and extract the slave station information interface data according to the category information;

[0047] The extracted data is stored in the corresponding slave station structure variable to obtain the slave station parsed data.

[0048] In the present embodiment, after the master station obtains the slave station information interface data, the slave station information interface data is parsed. First, according to the data structure of SII (Slave Information Interface) in the EtherCAT specification, the slave station information interface data is classified according to categories, and the slave station information interface data is parsed one by one. After completing the classification and parsing, the master station stores the extracted various types of data information into the pre-defined slave station structure variables. For each slave station, the master station establishes a data structure in the memory, and stores the parsed data into the corresponding structure variables. The master station can manage the information of the slave station in a structured and modular manner. This data organization method facilitates the generation of subsequent configuration files and the communication management of the EtherCAT network, and improves the maintainability and scalability of the system. After completing the above-mentioned parsing steps, the master station obtains the parsed data from the slave station.

[0049] In one embodiment, the category information includes String character string information, General category information, FMMU category information, TxPDO category information, and RxPDO category information.

[0050] In this embodiment, the String string information is used to describe the readability information of the slave station, including the supplier name, device name, and device description. By reading the string field stored in the SII information, the master station can obtain and parse this information. For example: the supplier name records the name of the device manufacturer to distinguish different suppliers; the device name identifies the type or model of the slave station device; the device description provides a functional description or additional information of the slave station for easy user identification.

[0051] The General category information contains the basic identification information of the slave, which is the key data for the master to identify and configure the slave, including: VendorID, the unique identification number of the slave's vendor; Product Code, the product code of the slave, used to distinguish different devices produced by the vendor; RevisionNumber, the version number of the slave, indicating the hardware or firmware version of the device; SerialNumber, records the unique serial number of the device, used to accurately locate a certain device.

[0052] The field memory unit (FMMU) category information expresses the mapping relationship between the internal memory of the slave and the EtherCAT network process data, including: the starting address, the starting position of the FMMU in the slave memory; the length, which specifies the size of the mapped memory area; the access rights, which define the access attributes of the area, such as read-only (RO) or read-write (RW); the target offset, which is the offset between the slave data and the EtherCAT bus communication data.

[0053] The TxPDO category information expresses the data transmitted from the slave to the master, including: index number, indicating the storage location of the data object; sub-index number, subdividing the fields in the data object; variable name, the name of the transmitted data; data type, the data format of the variable, such as integer (INT), floating point (FLOAT); data length, defining the number of bytes of the transmitted data. The TxPDO category information is used to define the content and format of the data transmitted from the slave to the master. The master obtains the real-time status or measurement value of the slave device by parsing this information.

[0054] The RxPDO category information expresses the data sent by the master station to the slave station, including: index number, indicating the storage location of the data object; sub-index number, subdividing the fields in the data object; variable name, the name of the received data, such as "target speed"; data type, the data format of the variable, such as integer (INT) and floating point (FLOAT); data length, defining the number of bytes of received data; RxPDO category information is used to define the control commands or set parameters issued by the master station to ensure that the slave station performs the task as required.

[0055] Combination Figure 4 As shown, in step S103, the master station obtains the master station configuration data from the default file or the user-defined configuration. If the user adjusts the process data of the slave station through the teaching pendant interface, the master station will synchronously obtain the slave station process data. The master station configuration data and the slave station process data will be integrated into a configuration parameter file, the same below.

[0056] In one embodiment, the step S103 includes:

[0057] Determine whether the slave process data has been adjusted, if it has been adjusted, obtain the adjusted slave process data; if it has not been adjusted, obtain the slave process data before the adjustment;

[0058] Determine whether the master station configuration data of the master station has been updated, if updated, obtain updated master station configuration parameters; if not updated, obtain default master station configuration data.

[0059] In this embodiment, the configuration status of the slave process data is checked by the teach pendant to determine whether there is a user adjustment operation. Specifically, the following two situations are included: First, the slave process data has been adjusted. If it is detected that the user has added, modified or deleted the slave process data in the teach pendant interface, such as adding a new process data index, adjusting the sub-index value, modifying the data length or type, etc., the master station reads the adjusted slave process data from the updated file. These data are stored in real time in the slave structure variables in the memory to ensure that subsequent file generation can reflect the latest user settings. The second is that the slave process data has not been adjusted. If no adjustment operation is detected, the master station obtains the unadjusted slave process data from the default file. At this time, the TxPDO data and RxPDO data stored by default in the slave's memory are used to ensure the consistency of the configuration process.

[0060] In addition, the master station needs to further determine whether the master station configuration data has been updated by the user, including the following two situations: First, the master station configuration data has been updated. If the user modifies the master station configuration parameters through the teach pendant interface, such as changing the communication cycle time, enabling or disabling DC mode, adjusting the target address, or setting the mailbox clock, the master station reads these new master station configuration data from the updated file. These updated master station configuration data will replace the default settings and be synchronously applied to subsequent configuration file generation. Second, the master station configuration data has not been updated. If no configuration update operation is detected, the master station reads the master station configuration data from the default file. The default master station configuration data contains the basic settings of the master station, such as name, communication cycle time, offset clock, etc., to ensure that the master station can complete network initialization according to the predetermined configuration without user intervention.

[0061] After completing the above judgment, the master station stores the slave station process data and master station configuration data in predefined memory structures to provide data support for the subsequent generation of configuration files. If both the slave station process data and the master station configuration data are adjusted or updated, the updated data is stored; if there is no adjustment or update, the default version of the data is stored.

[0062] In step S104, the master station combines the parsed data from the slave station with the acquired configuration parameter file in the processing module, organizes and optimizes the node data according to the format and standard of the EtherCAT network information file, and finally generates a configuration file (i.e., ENI file, the same below) that can reflect the current network topology and configuration requirements.

[0063] In one embodiment, the step S104 includes:

[0064] Generate master station node data according to the master station configuration data;

[0065] Based on the slave station parsing data and slave station process data, generating slave station node data, cyclic communication node data and process image data;

[0066] The configuration file is generated according to the master station node data, slave station node data, cyclic communication node data and process image data.

[0067] In this embodiment, the master station parses the master station configuration data through the processing module to generate the master station node data (i.e., Master, the same below), including: the master station name, which obtains and records the unique identification name of the master station from the master station configuration data; the communication cycle, which sets the cyclic communication cycle of the EtherCAT network according to the master station configuration parameters to ensure the real-time data exchange; the distributed clock (DC) configuration, which generates the clock synchronization configuration data of the master station according to the DC mode setting of the master station (whether enabled); the network address information, including the target address, source address and EtherType value of the master station, etc., which is used to identify the position of the master station in the network.

[0068] Furthermore, the master station generates slave node data (i.e., Slave, the same below), cyclic communication node data (i.e., Cyclic, the same below) and process image data (i.e., ProcessImage, the same below) based on the slave station parsed data combined with the slave station process data. Then, the master station integrates the master station node data, slave station node data, cyclic communication node data and process image data generated above, and generates a complete configuration file in accordance with the standard format of the EtherCAT network information file. The specific generation process includes:

[0069] Arrange the master node data and all slave node data according to the topological structure;

[0070] Perform redundancy check and format verification on cyclic communication node data and process image data, and optimize the data storage structure based on communication performance.

[0071] Generates an XML-formatted configuration file that complies with the ENI specification. The configuration file includes the structure and configuration of the entire EtherCAT network.

[0072] The generated configuration files are stored in the controller of the master station for initialization and dynamic management of the EtherCAT network. This implementation method can achieve efficient communication and automatic configuration between the master station and the slave station devices, significantly improving the flexibility and adaptability of the system.

[0073] In addition, ENI files (configuration files) have standard specifications, which can be referred to in "ETG2100_S_R_v1i0i0_SpecENI" released by ETG. The data in the memory is the information of each slave station, while the ENI file is a collection of all currently connected slave station information and the master station's own data. The extracted data needs to be extracted and analyzed according to the standard specifications, combined with the data of multiple slave stations, and calculated and processed to optimize, and finally generate a standard usable ENI file.

[0074] In one embodiment, after step S104, the following steps are included:

[0075] Loading and reading the configuration file, and automatically identifying, allocating addresses and setting communication parameters for the slave station according to the reading result, so as to automatically configure and initialize the network;

[0076] Establish an EtherCAT communication connection and data exchange with the slave station.

[0077] In this embodiment, the master station calls the generated configuration file in the processing module and loads it into the memory of the controller of the master station. After loading, the master station reads and parses the configuration file through the parsing module to extract key information: slave station topology information, including the physical connection order of the slave station in the EtherCAT network; slave station identification information, such as VendorID, Product Code, RevisionNumber, etc., used to confirm the unique identity of the slave station; slave station communication parameters, including synchronization manager (SyncManager), process data mapping (PDO) and field storage unit (FMMU) configuration, etc., used to define the communication behavior of the slave station; the master station can obtain the network structure and the detailed configuration of each slave station by reading the configuration file.

[0078] Furthermore, the master station starts the automatic identification process of the slave station according to the slave station identification information defined in the configuration file: the master station scans the EtherCAT bus, reads the information of the connected slave station devices (such as VendorID, Product Code) in turn, and compares the scan results with the slave station identification information in the configuration file to confirm whether the actually connected slave station is consistent with the configuration file definition; during the comparison process, if missing or newly added slave stations are found, the master station will prompt the user to manually adjust or regenerate the configuration file. The master station automatically assigns logical addresses and physical addresses to each slave station according to the actual topological order of the slave station and the address allocation rules in the configuration file. After the address allocation is completed, the master station writes the address information into the memory of the slave station so that the slave station can use it in subsequent communications.

[0079] Furthermore, the master station performs the following automated settings according to the communication parameter configuration in the configuration file, the SyncManager of the slave station, the field memory unit (FMMU) and the process data mapping (PDO): SyncManager configuration, the master station sets the SyncManager channel of the slave station to ensure that the data transmission direction (input or output) and the buffer size in the network meet the requirements; FMMU configuration, the master station establishes a mapping relationship between the memory address of the slave station and the process data mapping address to ensure the accurate transmission of data; PDO mapping, the master station sets the PDO index number, sub-index number, data length and type of the slave station, and defines the data interaction format between the master station and the slave station. After completing the automatic identification, address allocation and communication parameter setting of the slave station, the master station starts the initialization process of the EtherCAT network and establishes the communication connection between the master station and the slave station. If the distributed clock (DC) mode is enabled, the master station will synchronize the clocks of all slave stations in the network to ensure the real-time nature of data exchange; the master station sends an initialization command to all slave stations to start the working mode of the slave station. The master station creates a data interaction channel according to the PDO mapping configuration and exchanges data with the slave station periodically. After the communication connection is established, the master station monitors the device status in real time by reading the TxPDO data of the slave station, and sends control instructions or sets parameters to the slave station by sending RxPDO data, thus completing the dynamic configuration and normal operation of the EtherCAT network.

[0080] The ENI file information is different in different slave stations. In the memory of the slave station, the SII information has stored the data information of the slave station, such as the basic information of the equipment, FMMU, SM, DC, process data, etc. After the master station controller is powered on, the SII information of the corresponding size in the memory of each slave station is extracted and parsed through the parsing module, and the user can add or modify the slave station process data and the basic configuration data of the master station in the teach pendant interface. The controller of the master station generates the ENI file of the corresponding topology in the processing module according to the master station configuration data and the required node information, and directly stores it in the controller of the master station for use, so that the master station can quickly establish configurations with slave stations of different topologies and exchange communication data.

[0081] The master station of the present invention can parse the SII information of the memory corresponding to different slave stations, and can flexibly generate ENI files corresponding to different topologies through the processing module, and the user can flexibly configure the slave process data and the master configuration data on the teach pendant. Through the master station's parsing of the SII information of the connected slave station and the generation and update of the ENI file, the EtherCAT system realizes a high degree of automation from slave station identification, configuration to network initialization, reducing the time and cost of system integration and maintenance. The flexibility of this architecture is reflected in that whether it is equipment replacement, network expansion or system upgrade, the master station only needs to re-power on to regenerate the ENI file to achieve reconfiguration of the network, improving the scalability and dynamic adaptability of the system. At the same time, the high bandwidth and low latency characteristics of the EtherCAT system ensure the real-time and data integrity of the system communication, and provide technical support for application scenarios that require highly precise control, such as servo drive, safety control, etc.

[0082] Combination Figure 5 As shown, Figure 5 A schematic block diagram of a configuration file generating device based on EtherCAT provided in an embodiment of the present invention is provided in a master station. The configuration file generating device based on EtherCAT 500 includes:

[0083] The information acquisition unit 501 is used to acquire the slave station information interface data of the slave station;

[0084] The information parsing unit 502 is used to parse the slave station information interface data to obtain slave station parsed data;

[0085] The data acquisition unit 503 is used to acquire the master station configuration data and the slave station process data;

[0086] The file generating unit 504 is used to combine the slave station parsing data with the master station configuration data and the slave station process data to generate a configuration file.

[0087] In this embodiment, the information acquisition unit 501 acquires the slave station information interface data of the slave station; the information parsing unit 502 parses and processes the slave station information interface data to obtain slave station parsed data; the data acquisition unit 503 acquires the master station configuration data and the slave station process data; the file generation unit 504 combines the slave station parsed data with the master station configuration data and the slave station process data to generate a configuration file.

[0088] In one embodiment, the information acquisition unit 501 includes:

[0089] A predetermined reading unit, used for sequentially reading the data of the first predetermined bytes of the memory of each slave station, obtaining the basic information data of each slave station, and obtaining the actual size of the corresponding memory according to the basic information data;

[0090] The actual reading unit is used to read all the data in the corresponding memory according to the actual size of the memory, and obtain the slave station information interface data corresponding to the slave station.

[0091] In one embodiment, the information parsing unit 502 includes:

[0092] An interface analysis unit, used for classifying, parsing, processing and extracting the slave station information interface data according to category information; wherein the category information includes String character string information, General category information, FMMU category information, TxPDO category information and RxPDO category information;

[0093] The data storage unit is used to store the extracted data into the corresponding slave station structure variable to obtain the slave station parsed data.

[0094] In one embodiment, the data acquisition unit 503 includes:

[0095] The first judgment unit is used to judge whether the slave station process data has been adjusted, and if so, to obtain the adjusted slave station process data; if not, to obtain the slave station process data before adjustment;

[0096] The second judgment unit is used to judge whether the master station configuration data of the master station has been updated, and if so, to obtain the updated master station configuration parameters; if not, to obtain the default master station configuration data.

[0097] In one embodiment, the file generating unit 504 includes:

[0098] A first generating unit, configured to generate master station node data according to the master station configuration data;

[0099] A second generating unit, configured to generate slave node data, cyclic communication node data and process image data based on the slave parsing data and the slave process data;

[0100] The data combining unit is used to generate the configuration file according to the master station node data, the slave station node data, the cyclic communication node data and the process image data.

[0101] In one embodiment, the EtherCAT-based configuration file generating device 500 further includes:

[0102] A configuration loading unit, used to load and read the configuration file, and automatically identify, allocate addresses and set communication parameters for the slave station according to the reading result, so as to automatically configure and initialize the network;

[0103] The data interaction unit is used to establish an EtherCAT communication connection and data interaction with the slave station.

[0104] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0105] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0106] The embodiment of the present invention also provides a master station, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the computer device may also include various network interfaces, power supplies and other components.

[0107] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0108] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A configuration file generation method based on EtherCAT, applied to a master station, characterized in that: include: Get the slave information interface data of the slave; Parsing the slave station information interface data to obtain slave station parsed data; Get master station configuration data and slave station process data; The slave station parsed data is combined with the master station configuration data and the slave station process data to generate a configuration file.

2. The method for generating a configuration file based on EtherCAT according to claim 1, characterized in that: The combining and processing the slave station parsed data with the master station configuration data and the slave station process data to generate a configuration file includes: Generate master station node data according to the master station configuration data; Based on the slave station parsing data and slave station process data, generating slave station node data, cyclic communication node data and process image data; The configuration file is generated according to the master station node data, slave station node data, cyclic communication node data and process image data.

3. The method for generating a configuration file based on EtherCAT according to claim 1, characterized in that: The step of parsing the slave station information interface data to obtain slave station parsed data includes: Classify, analyze, process and extract the slave station information interface data according to the category information; The extracted data is stored in the corresponding slave station structure variable to obtain the slave station parsed data.

4. The method for generating a configuration file based on EtherCAT according to claim 3, characterized in that: The category information includes String character string information, General category information, FMMU category information, TxPDO category information and RxPDO category information.

5. The method for generating a configuration file based on EtherCAT according to claim 1, characterized in that: The step of obtaining slave station information interface data of the slave station includes: Sequentially read the data of the first predetermined bytes of the memory of each slave station to obtain the basic information data of each slave station, and obtain the actual size of the corresponding memory according to the basic information data; All data in the memory are read according to the actual size of the memory to obtain the slave station information interface data corresponding to the slave station.

6. The method for generating a configuration file based on EtherCAT according to claim 1, characterized in that: The obtaining of master station configuration data and slave station process data includes: Determine whether the slave process data has been adjusted, if it has been adjusted, obtain the adjusted slave process data; if it has not been adjusted, obtain the slave process data before the adjustment; Determine whether the master station configuration data of the master station has been updated, if updated, obtain updated master station configuration parameters; if not updated, obtain default master station configuration data.

7. The method for generating a configuration file based on EtherCAT according to claim 1, characterized in that: After the slave station parsed data is combined with the master station configuration data and the slave station process data to generate a configuration file, the method includes: Loading and reading the configuration file, and automatically identifying, allocating addresses and setting communication parameters for the slave station according to the reading result, so as to automatically configure and initialize the network; Establish an EtherCAT communication connection and data exchange with the slave station.

8. A configuration file generating device based on EtherCAT, arranged at a master station, characterized in that: include: An information acquisition unit, used for acquiring slave station information interface data of the slave station; An information parsing unit, used for parsing the slave station information interface data to obtain slave station parsed data; A data acquisition unit, used to acquire master station configuration data and slave station process data; The file generating unit is used to combine the slave station parsing data with the master station configuration data and the slave station process data to generate a configuration file.

9. A master station, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating a configuration file based on EtherCAT as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a configuration file based on EtherCAT according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Configuration method of industrial Ethernet

    CN106789258A