Mapping method of communication address and related equipment
By setting the corresponding project configuration information for the PLC manufacturer in the host computer and re-downloading it, the address mapping difference problem when changing PLC manufacturers is solved, realizing a high reuse rate of PLC projects and flexibility and economy in equipment transformation.
Patent Information
- Application Number
- CN202511927904.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-20
AI Technical Summary
The mapping relationship between the programming software device addresses and Modbus communication addresses differs among different PLC manufacturers, which leads to significant modifications required when switching PLC manufacturers, resulting in low reusability.
The system downloads the PLC project's compilation files and project configuration information to the host computer, presets the mapping relationship between communication protocol addresses and programming software device addresses for various PLC manufacturers, parses request commands to obtain programming software device addresses, and executes operations.
Significantly reduces downtime, increases the reuse rate of PLC projects, and enhances the flexibility and economy of equipment modification and production line upgrades.
Smart Images

Figure CN121704893A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control technology, specifically to a method for mapping communication addresses and related equipment. Background Technology
[0002] The core of PLC engineering is programming and control logic. Different brands of PLCs (Programmable Logic Controllers) use different programming software, but they generally conform to IEC standards and support functions such as ST language programming, ladder diagram voice programming, etc.
[0003] In existing technologies, PLCs and controlled products generally communicate via serial communication protocols. However, due to differences in the addresses of programming software components from different manufacturers, when a PLC manufacturer changes, it is necessary to significantly modify the mapping relationship between communication addresses and software component addresses in the PLC project, resulting in a low reusability of PLC projects. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method and related equipment for communication addresses, so as to improve the reusability of PLC projects.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of this invention discloses a method for mapping communication addresses, applied to a programmable logic controller (PLC), wherein the PLC is connected to a host computer and a controlled device, and the method includes:
[0007] The compiler file and project configuration information of the PLC project are downloaded from the host computer. The host computer has preset project configuration information for various PLC manufacturers. The project configuration information includes the mapping relationship between communication protocol addresses and programming software device addresses.
[0008] Receive the request command sent by the controlled device;
[0009] Parse the request command and, based on the project configuration information, obtain the address of the programming software component for the request command;
[0010] The operation of the requested command is executed based on the address of the programming software component.
[0011] Optionally, downloading the PLC project's compilation file and project configuration information from the host computer includes:
[0012] The host computer receives the PLC manufacturer information set by the user and the corresponding engineering configuration information of the PLC manufacturer;
[0013] Download the PLC project compilation file and the project configuration information from the host computer.
[0014] Optionally, downloading the PLC project's compilation file and project configuration information from the host computer includes:
[0015] The host computer receives PLC engineering data from a preset manufacturer.
[0016] The PLC project data is converted to obtain the PLC project's compilation file and the project configuration information;
[0017] Download the PLC project compilation file and the project configuration information from the host computer.
[0018] Optionally, parsing the request command and obtaining the programming software component address of the request command based on the project configuration information includes:
[0019] Parse the request command to obtain the communication protocol address of the request command;
[0020] Based on the mapping relationship in the project configuration information and the communication protocol address of the request command, the programming software component address of the request command is calculated.
[0021] Optionally, the operation of executing the request command based on the address of the programming software component includes:
[0022] The programmable software device corresponding to the address of the programmable software device is accessed through a preset API interface; the access operation includes: data reading operation and / or data writing operation.
[0023] Optionally, after executing the request command based on the programming software device address, the communication address mapping method further includes:
[0024] Determine the execution result of the requested command;
[0025] The execution result of the request command is sent to the controlled device.
[0026] Optionally, the method for mapping the communication address further includes:
[0027] Perform integrity verification on the compiled files and the project configuration information;
[0028] If the integrity verification passes, a confirmation message confirming the integrity verification passes is sent to the host computer.
[0029] If the integrity check fails, the step of downloading the PLC project compilation file and project configuration information from the host computer will be repeated.
[0030] A second aspect of this invention discloses a communication address mapping system applied to a programmable logic controller (PLC), wherein the PLC is connected to a host computer and a controlled device, and the system includes:
[0031] The download unit is used to download the compilation file and project configuration information of the PLC project from the host computer; the host computer has preset project configuration information corresponding to various PLC manufacturers, and the project configuration information includes the mapping relationship between communication protocol address and programming software component address;
[0032] A receiving unit is used to receive request commands sent by the controlled device;
[0033] A mapping unit is used to parse the request command and obtain the programming software component address of the request command based on the project configuration information;
[0034] An execution unit is used to execute the operation of the requested command based on the address of the programming software element.
[0035] A third aspect of this invention discloses a communication address mapping device, the device comprising:
[0036] Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply;
[0037] The memory is either a short-term memory or a persistent memory;
[0038] The central processing unit communicates with the memory;
[0039] The central processing unit is used to execute instructions in the memory to perform any of the communication address mapping methods disclosed in the first aspect of the embodiments of the present invention.
[0040] A fourth aspect of the present invention discloses a computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform any of the communication address mapping methods disclosed in the first aspect of the present invention.
[0041] Based on the above embodiments of the present invention, a communication address mapping method and related equipment are provided, applied to a programmable logic controller (PLC). The PLC connects to a host computer and a controlled device. The method includes: downloading the PLC project's compilation file and project configuration information from the host computer; the host computer has preset project configuration information corresponding to various PLC manufacturers, and the project configuration information includes a mapping relationship between communication protocol addresses and programming software device addresses; receiving a request command sent by the controlled device; parsing the request command, and obtaining the programming software device address of the request command based on the project configuration information; and executing the operation of the request command based on the programming software device address. In this solution, when replacing a PLC, the user only needs to set the manufacturer's corresponding project configuration information through the host computer and re-download it, significantly shortening downtime without modifying the PLC project, thereby improving the PLC project reuse rate and greatly enhancing the flexibility and economy of equipment modification and production line upgrades, showing good prospects for promotion. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 This is a schematic diagram of a communication address mapping logic disclosed in an embodiment of the present invention;
[0044] Figure 2 This is a flowchart of a communication address mapping method disclosed in an embodiment of the present invention;
[0045] Figure 3 This is a flowchart of another communication address mapping method disclosed in an embodiment of the present invention;
[0046] Figure 4 This is a flowchart of another communication address mapping method disclosed in an embodiment of the present invention;
[0047] Figure 5 This is an architecture diagram of a communication address mapping system disclosed in an embodiment of the present invention;
[0048] Figure 6 This is a schematic diagram of the structure of a communication address mapping device disclosed in an embodiment of the present invention. Detailed Implementation
[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0051] A Programmable Logic Controller (PLC) is a digital electronic device with a microprocessor, used for automation control. It can load control instructions into memory for storage and execution. A PLC consists of functional units such as a CPU, instruction and data memory, input / output interfaces, power supply, and digital-to-analog converters.
[0052] As mentioned above, in existing technologies, PLCs and controlled products generally communicate through various serial communication protocols, such as Modbus, UART, RS232, RS485, I2C, and SPI. Among these, the Modbus protocol is widely used in industrial automation due to its ease of deployment and maintenance, and has become the industry standard for industrial communication protocols. However, even if different manufacturers use the same serial communication protocol, such as Modbus, the mapping relationship between the programmed software device address and the Modbus communication address can still differ. This article uses the Modbus protocol as an example, but it is not limited to any particular protocol and applies to other serial communication protocols as well. The mapping relationship between the programmed software device address and the Modbus communication address for different manufacturers is shown in the table below:
[0053] The mapping relationship between the programming device address and the Modbus communication address of manufacturer A:
[0054] Region Type Address range (decimal / octal) MODBUS area MODBUS address range X 0–1777 (octal) 02 Function Code 0xF800–0xFBFF Y 0–1777 (octal) Function codes 01\02\05\15 0xFC00–0xFFFF M 0–7999 Function codes 01\02\05\15 0x0000–0x1F3F D 0–7999 Function code 03\06\16 0x0000–0x1F3F S 0–4095 Function codes 01\02\05\15 0xE000–0xEFFF B 0–32767 Function codes 01\02\05\15 0x5000–0xAFFF R 0–32767 Function code 03\06\16 0x5000–0xAFFF W 0–32767 Modbus access is not supported.
[0055] The mapping relationship between the programming device address and the Modbus communication address of vendor B:
[0056] Region Type Address range (decimal / octal) MODBUS area MODBUS address range X 0–377 (octal) 02 Function Code 0x0400–0x04FF Y 0–377 (octal) Function codes 01\02\05\15 0x0500–0x05FF M 0–1536 Function codes 01\02\05\15 0x0800–0x0DFF M 1537–4095 Function codes 01\02\05\15 0xB000–0xB9FF D 0–4095 Function code 03\06\16 0x1000–0x1FFF D 4096–9999 Function code 03\06\16 0x9000–0xA70F S 0–1023 Function codes 01\02\05\15 0x0000–0x03FF
[0057] In this context, the region type, or programming element, refers to a grouping of a memory region at the software level; the address range refers to the address range supported by the programming element. PLC manufacturers can implement programming elements according to their own needs, resulting in some differences between manufacturers.
[0058] As can be seen from the comparison in the table above, the addresses of soft devices from different manufacturers are not necessarily compatible. For example, when the PLC manufacturer is B, if the PLC receives a Modbus request message from the controlled device with Modbus function code 02 and communication protocol address 0x0400, it means that the device wants to read the value at soft device address X0. In the same case, if the same message is sent to manufacturer A, with function code 02 and communication protocol address 0x0400, it means that the device wants to read the value at soft device address M1024.
[0059] In summary, although different PLC manufacturers read the same message sent by the Modbus master device according to the 02 function code, the read device addresses differ. This indicates implementation differences between manufacturers. Assuming the PLC design remains unchanged, these differences can lead to errors in the device's control logic. Consequently, users must modify their PLC design when replacing it with a new manufacturer's PLC to accommodate the new manufacturer's mapping between device addresses and Modbus communication addresses. Therefore, when the PLC manufacturer changes, significant modifications to the Modbus communication address to device address mapping table are required in the PLC design, resulting in low PLC design reusability.
[0060] Therefore, this invention discloses a communication address mapping method and related equipment. The method involves downloading the compiled files and configuration information of a PLC project from a host computer. The host computer has pre-set configuration information for various PLC manufacturers, which includes a mapping relationship between communication protocol addresses and programming software device addresses. The method receives request commands from the controlled device, parses the request commands, and obtains the programming software device address of the request command based on the configuration information. Based on the programming software device address, the method executes the operation of the request command. In this solution, when replacing a PLC, the user only needs to set the corresponding manufacturer's configuration information on the host computer and download it again, significantly shortening downtime without modifying the PLC project. This improves the reusability of PLC projects, thereby greatly enhancing the flexibility and economy of equipment modification and production line upgrades, and has good prospects for widespread application.
[0061] like Figure 1 The diagram shown is a schematic diagram of a communication address mapping logic disclosed in an embodiment of the present invention.
[0062] In scenarios involving PLC replacement, if the manufacturer of the new PLC differs from the original manufacturer, the user first uses the host computer of the new PLC manufacturer as the PLC programming software. The user selects the compatible PLC manufacturer through the host computer and compiles the PLC project to run on the PLC using the host computer's programming software. After compilation, the host computer generates the PLC project's compiled file and project configuration information. The project configuration information includes the mapping relationship between the communication protocol addresses of the compatible PLC manufacturer and the addresses of the programming software components.
[0063] The host computer downloads the compilation file and project configuration information to the replaced PLC via the download function. The PLC configures its control logic based on the compilation file and configures the mapping relationship between the communication protocol address and the programming software device address based on the project configuration information. This ensures that when the configured PLC receives a request command from the controlled device, it parses the request command, obtains the programming software device address of the request command based on the project configuration information, and executes the operation of the request command based on the programming software device address. In other words, the response operation to the request command is consistent with the response operation of the PLC before the replacement.
[0064] like Figure 2 The diagram shows a flowchart of a communication address mapping method disclosed in an embodiment of the present invention. This method is applied to a programmable logic controller (PLC), where the PLC is connected to a host computer and the controlled device. The method includes the following steps:
[0065] Step S201: Download the PLC project compilation file and project configuration information from the host computer.
[0066] The host computer has pre-set engineering configuration information for various PLC manufacturers, which includes the mapping relationship between communication protocol addresses and programming software device addresses.
[0067] In step S201, the compiled file of the PLC project contains the control logic and program code required for the PLC to run, while the project configuration information records the mapping relationship between the communication protocol address and the programming soft component address, ensuring that the PLC can correctly parse and execute the request commands from the controlled device.
[0068] Understandably, when a user replaces an old PLC with a new one, the initial power-on of the new PLC means that the new PLC does not contain the compiled files and configuration information of the PLC project, which need to be downloaded from the host computer.
[0069] In another scenario, if the PLC loses its compiled files and configuration information after being powered down, the PLC will be treated as if it were its first power-on when it is powered on again, and the compiled files and configuration information will be downloaded from the host computer.
[0070] In this embodiment of the invention, when a user replaces a PLC, there is no need to modify the PLC project. The only issue is that the addresses of the programming software components from different manufacturers differ. The user can simply download the project configuration information corresponding to the PLC manufacturer from the host computer.
[0071] Step S202: Receive the request command sent by the controlled device.
[0072] In step S202, the PLC receives request commands from various controlled devices (such as sensors, buttons, limit switches, instruments, etc.) in real time through its hardware interface; these request commands are usually sent in the form of data packets, which contain communication protocol addresses and operation instructions.
[0073] It should be noted that the PLC can obtain the communication protocol address and operation instructions in the request command, and obtain the corresponding programming software device address based on the communication protocol address. Then, based on the operation instructions, it can execute the operation corresponding to the operation instructions on the programming software device pointed to by the communication protocol address.
[0074] Step S203: Parse the request command and obtain the address of the programming software component of the request command based on the project configuration information.
[0075] In step S203, the request command contains a communication protocol address. The PLC uses this address to search for the corresponding programming software device address in the mapping relationship between communication protocol addresses and programming software device addresses contained in the project configuration information. This process provides the correct programming software device address for subsequent execution of the request command, ensuring that the PLC can accurately identify the programming software device (i.e., memory unit) pointed to by the request command, and achieve precise response to the controlled device.
[0076] Step S204: Execute the request command based on the address of the programmed software component.
[0077] In step S204, the PLC accesses the corresponding programming software element through the programming software element address and executes the operation of the request command to realize the response to the controlled device.
[0078] It should be noted that a programming element refers to a memory unit in the PLC's memory that is assigned a fixed meaning and can be directly read and written using instructions. The address of a programming element is a consecutive serial number (decimal or octal) assigned to it by the PLC manufacturer. Different PLC manufacturers assign different addresses to their programming elements.
[0079] In summary, based on the above embodiments of the present invention, this solution can achieve the following beneficial effects: when replacing the PLC, the user only needs to set the corresponding engineering configuration information of the manufacturer through the host computer and download it again, which significantly shortens the downtime and does not require modification of the PLC project, thereby achieving the purpose of improving the reuse rate of the PLC project, and thus greatly improving the flexibility and economy of equipment transformation and production line upgrade, which has good prospects for promotion.
[0080] Based on the communication address mapping method disclosed in the above embodiments of the present invention, see [link to relevant documentation]. Figure 3 This is a flowchart of another communication address mapping method disclosed in an embodiment of the present invention, applied to a programmable logic controller (PLC). The PLC is connected to a host computer and the controlled device. The method includes the following steps:
[0081] Step S301: The host computer receives the PLC manufacturer information and the corresponding project configuration information set by the user, and downloads the PLC project compilation file and project configuration information from the host computer.
[0082] In the specific implementation of step S301, the user uses the host computer of the changed PLC manufacturer as the PLC programming software. The PLC programming software has an address compatibility option. When the user clicks the address compatibility option, multiple mode options are displayed. Each mode option corresponds to a PLC manufacturer. In response to the mode option selected by the user, the PLC programming software finds the project configuration information corresponding to the mode option selected by the user from the pre-configured project configuration information corresponding to each different manufacturer, and then downloads the PLC project compilation file and project configuration information from the host computer.
[0083] Optionally, after downloading the PLC project's compilation file and project configuration information from the host computer, the integrity of the PLC project's compilation file and project configuration information is verified. If the integrity verification passes, a confirmation message indicating that the integrity verification has passed is sent to the host computer. If the integrity verification fails, the step of downloading the PLC project's compilation file and project configuration information from the host computer is repeated.
[0084] In this embodiment of the invention, communication interference is prevented from causing damage to the compilation files of the PLC project or loss of project configuration information.
[0085] Step S302: Receive the request command sent by the controlled device.
[0086] Step S303: Parse the request command to obtain the communication protocol address of the request command. Based on the mapping relationship in the project configuration information and the communication protocol address of the request command, calculate the programming software device address of the request command.
[0087] In step S303, the request command can be in the form of a data packet, which contains a communication protocol address and operation instructions. When the PLC receives the data packet from the controlled device through the network port / serial port, it uses a preset protocol parser to parse the data packet into an ADU (Application Data Unit) data frame, and obtains the communication protocol address and operation instructions contained in the ADU data frame.
[0088] Optionally, the ADU data frame carries key information such as function code (i.e., operation instruction), communication protocol address, and operation length.
[0089] It should be noted that the function code in the ADU data frame is used to explicitly indicate the specific operation type of the requested command. The function code is an instruction identifier defined in the protocol, used to specify the operation that the PLC needs to perform, such as a data read operation or a data write operation.
[0090] Step S304: Execute the request command based on the address of the programmed software component.
[0091] In the specific implementation of step S304, the programming software element corresponding to the address of the programming software element is accessed through a preset API interface.
[0092] The access operations include: data read operations and / or data write operations.
[0093] Step S305: Determine the execution result of the request command and send the execution result of the request command to the controlled device.
[0094] For example, if the requested command is a data read operation, the PLC will send the read data value as the execution result to the controlled device.
[0095] In the specific implementation of step S305, after executing the request command based on the address of the programming software element, the execution result of the request command is determined through the API interface; and the execution result of the request command is sent to the controlled device.
[0096] It's easy to understand that the purpose of this process is to ensure that the controlled device can promptly understand whether the requested command was successfully executed, and the specific details of that execution. This feedback mechanism is crucial for achieving closed-loop control in automated systems.
[0097] In summary, based on the above embodiments of the present invention, this solution achieves the following beneficial effects: By setting address compatibility options and multi-mode option selection functions in the host computer, users can conveniently select engineering configuration information from different PLC manufacturers, avoiding large-scale modifications to PLC projects due to changing PLC manufacturers, and significantly improving the reusability of PLC projects; the integrity verification mechanism prevents the compilation files of PLC projects from being damaged or the engineering configuration information from being lost due to communication interference; the processing flow of request commands is optimized by using a protocol parser and API interface, improving operating efficiency; the feedback mechanism ensures that the controlled device can promptly understand whether the request command has been successfully executed.
[0098] Based on the communication address mapping method disclosed in the above embodiments of the present invention, see [link to relevant documentation]. Figure 4 This is a flowchart of another communication address mapping method disclosed in an embodiment of the present invention, applied to a programmable logic controller (PLC). The PLC is connected to a host computer and the controlled device. The method includes the following steps:
[0099] Step S401: The host computer receives the PLC project data corresponding to the preset manufacturer, converts the PLC project data, obtains the PLC project compilation file and project configuration information, and downloads the PLC project compilation file and project configuration information from the host computer.
[0100] In step S401, if the host computer does not have the engineering configuration information corresponding to the current PLC manufacturer pre-stored, it can obtain the engineering configuration information corresponding to the current PLC manufacturer by receiving the PLC engineering data corresponding to the preset manufacturer and converting it.
[0101] Optionally, after converting the PLC project data and obtaining the PLC project's compilation file and project configuration information, the preset manufacturer and project configuration information can be stored in the host computer for users to download next time.
[0102] In this embodiment of the invention, when changing PLC manufacturers, there is no need to manually rewrite the engineering configuration information. Instead, the existing PLC engineering data is converted to quickly generate engineering configuration information that is compatible with the current PLC manufacturer.
[0103] Step S402: Receive the request command sent by the controlled device.
[0104] Step S403: Parse the request command to obtain the communication protocol address of the request command. Based on the mapping relationship in the project configuration information and the communication protocol address of the request command, calculate the programming software device address of the request command.
[0105] Step S404: Execute the request command based on the address of the programmed software component.
[0106] Step S405: Determine the execution result of the request command and send the execution result of the request command to the controlled device.
[0107] For the specific implementation process and explanation of steps S402 to S405, please refer to the above embodiments of the present invention, which will not be repeated here.
[0108] In summary, based on the above embodiments of the present invention, this solution can achieve the following beneficial effects: in the scenario of changing PLC manufacturers, there is no need to manually rewrite the engineering configuration information. Instead, the existing PLC engineering data is converted to quickly generate engineering configuration information that is compatible with the current PLC manufacturer, which significantly improves the adaptation efficiency of engineering configuration information when changing PLC manufacturers.
[0109] Corresponding to the communication address mapping method disclosed in the above embodiments of the present invention, please refer to... Figure 5 This is an architecture diagram of a communication address mapping system disclosed in an embodiment of the present invention. It is applied to a programmable logic controller (PLC). The PLC is connected to a host computer and the controlled device. The system includes: a download unit 501, a receiving unit 502, a mapping unit 503, and an execution unit 504.
[0110] The download unit 501 is used to download the compilation file and project configuration information of the PLC project from the host computer. The host computer has preset project configuration information for various PLC manufacturers. The project configuration information includes the mapping relationship between communication protocol addresses and programming software device addresses.
[0111] The receiving unit 502 is used to receive request commands sent by the controlled device;
[0112] Mapping unit 503 is used to parse the request command and obtain the address of the programming software component of the request command based on the project configuration information;
[0113] The execution unit 504 is used to execute the requested command based on the address of the programmed soft element.
[0114] In one embodiment, the download unit 501 is specifically used for:
[0115] The host computer receives the PLC manufacturer information set by the user and the corresponding engineering configuration information of the PLC manufacturer;
[0116] Download the PLC project compilation file and the project configuration information from the host computer.
[0117] In one embodiment, the download unit 501 is specifically used for:
[0118] The host computer receives PLC engineering data from a preset manufacturer.
[0119] The PLC project data is converted to obtain the PLC project's compilation file and the project configuration information;
[0120] Download the PLC project compilation file and the project configuration information from the host computer.
[0121] In one embodiment, the mapping unit 503 is specifically used for:
[0122] Parse the request command to obtain the communication protocol address of the request command;
[0123] Based on the mapping relationship in the project configuration information and the communication protocol address of the request command, the programming software component address of the request command is calculated.
[0124] In one embodiment, the execution unit 504 is specifically used for:
[0125] The programmable software device corresponding to the address of the programmable software device is accessed through a preset API interface; the access operation includes: data reading operation and / or data writing operation.
[0126] In one embodiment, the communication address mapping system further includes:
[0127] A verification unit is used to perform integrity verification on the compiled file and the project configuration information;
[0128] If the integrity verification passes, a confirmation message confirming the integrity verification passes is sent to the host computer.
[0129] If the integrity check fails, the step of downloading the PLC project compilation file and project configuration information from the host computer will be repeated.
[0130] In one embodiment, the communication address mapping system further includes:
[0131] The result feedback unit determines the execution result of the request command after executing the operation of the request command based on the address of the programming software element.
[0132] The execution result of the request command is sent to the controlled device.
[0133] Based on the communication address mapping system disclosed in this invention, the following steps are taken: The system downloads the compiled files and configuration information of a PLC project from a host computer. The host computer has pre-set configuration information for various PLC manufacturers, which includes a mapping relationship between communication protocol addresses and programming software device addresses. It receives request commands from the controlled device, parses the request commands, and obtains the programming software device address of the request command based on the configuration information. Based on the programming software device address, it executes the operation of the request command. In this solution, when replacing a PLC, the user only needs to set the corresponding manufacturer's configuration information on the host computer and re-download it, significantly reducing downtime without modifying the PLC project. This improves the reusability of PLC projects, thereby greatly enhancing the flexibility and economy of equipment modification and production line upgrades, and has good prospects for widespread application.
[0134] like Figure 6 The diagram shown is a schematic diagram of a communication address mapping device disclosed in an embodiment of the present invention, including: a central processing unit 601, a memory 605, an input / output interface 604, a wired or wireless network interface 603, and a power supply 602.
[0135] Memory 605 is either a short-term storage memory or a persistent storage memory;
[0136] The central processing unit 601 communicates with the memory 605;
[0137] The central processing unit 601 is used to execute instruction operations in the memory 605 to perform any of the communication address mapping methods described in the embodiments of the present invention.
[0138] This invention also provides a chip system, which includes at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a line. The at least one processor is used to run computer programs or instructions to execute any of the communication address mapping methods described in the embodiments of this invention.
[0139] This invention also provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform any of the communication address mapping methods described in this invention.
[0140] This invention also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the communication address mapping methods described in this invention.
[0141] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0142] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0143] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for mapping communication addresses, characterized in that, The method, applied to a programmable logic controller (PLC) connected to a host computer and a controlled device, includes: The compiler file and project configuration information of the PLC project are downloaded from the host computer. The host computer has preset project configuration information for various PLC manufacturers. The project configuration information includes the mapping relationship between communication protocol addresses and programming software device addresses. Receive the request command sent by the controlled device; Parse the request command and, based on the project configuration information, obtain the address of the programming software component for the request command; The operation of the requested command is executed based on the address of the programming software component.
2. The method according to claim 1, characterized in that, The process of downloading the PLC project's compilation files and project configuration information from the host computer includes: The host computer receives the PLC manufacturer information set by the user and the corresponding engineering configuration information of the PLC manufacturer; Download the PLC project compilation file and the project configuration information from the host computer.
3. The method according to claim 1, characterized in that, The process of downloading the PLC project's compilation files and project configuration information from the host computer includes: The host computer receives PLC engineering data from a preset manufacturer. The PLC project data is converted to obtain the PLC project's compilation file and the project configuration information; Download the PLC project compilation file and the project configuration information from the host computer.
4. The method according to claim 1, characterized in that, The process of parsing the request command and obtaining the programming software address of the request command based on the project configuration information includes: Parse the request command to obtain the communication protocol address of the request command; Based on the mapping relationship in the project configuration information and the communication protocol address of the request command, the programming software component address of the request command is calculated.
5. The method according to claim 1, characterized in that, The operation of executing the request command based on the address of the programming software component includes: The programming software element corresponding to the address of the programming software element is accessed through a preset API interface; The access operations include: data read operations and / or data write operations.
6. The method according to claim 1, characterized in that, After executing the request command based on the programming software device address, the communication address mapping method further includes: Determine the execution result of the requested command; The execution result of the request command is sent to the controlled device.
7. The method according to any one of claims 1 to 6, characterized in that, The method for mapping communication addresses further includes: Perform integrity verification on the compiled files and the project configuration information; If the integrity verification passes, a confirmation message confirming the integrity verification passes is sent to the host computer. If the integrity check fails, the step of downloading the PLC project compilation file and project configuration information from the host computer will be repeated.
8. A communication address mapping system, characterized in that, A system applied to a programmable logic controller (PLC), wherein the PLC is connected to a host computer and the controlled device, the system includes: The download unit is used to download the compilation file and project configuration information of the PLC project from the host computer; the host computer has preset project configuration information corresponding to various PLC manufacturers, and the project configuration information includes the mapping relationship between communication protocol address and programming software component address; A receiving unit is used to receive request commands sent by the controlled device; A mapping unit is used to parse the request command and obtain the programming software component address of the request command based on the project configuration information; An execution unit is used to execute the operation of the requested command based on the address of the programming software element.
9. A communication address mapping device, characterized in that, The device includes: Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply; The memory is either a short-term memory or a persistent memory; The central processing unit communicates with the memory; The central processing unit is configured to execute instructions in the memory to perform the communication address mapping method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on a computer, cause the computer to perform the communication address mapping method as described in any one of claims 1 to 7.