Method for reading and writing PLC device, electronic device and medium

By automatically identifying and enumerating PLC devices and utilizing hardware device discovery protocols and built-in communication protocols, the problem of manually modifying code when updating PLC devices is solved, realizing automated identification and data interaction of PLC devices, and improving production efficiency and adaptability.

CN121619352APending Publication Date: 2026-03-06浙江晟霖益嘉科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511738095.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In the semiconductor wafer manufacturing and packaging testing process, when PLC equipment is updated or its model is changed, the underlying software code needs to be manually modified to adapt to the parameter changes, resulting in a large workload for adaptation and affecting production efficiency.

Method used

A method for reading and writing PLC devices is provided. The method automatically identifies and enumerates PLC devices through a hardware device discovery protocol, obtains their model, MAC address and IP address, and enables plug-and-play functionality. The method also incorporates a communication protocol and data type conversion table in the host computer to automatically read and parse the process data of the PLC devices and control the status of the PLC devices in real time.

Benefits of technology

It enables automated identification and data interaction of PLC devices, reduces system maintenance complexity and cost, improves production efficiency, and enhances the flexibility and adaptability of production lines, especially significantly improving production efficiency in centralized control scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121619352A_ABST
    Figure CN121619352A_ABST
Patent Text Reader

Abstract

The invention discloses a method for reading and writing PLC equipment, electronic equipment and a medium, and relates to the technical field of semiconductor manufacturing, and the method comprises the steps: responding to an access signal of the PLC equipment, and determining a communication parameter of the PLC equipment; reading and storing the process data stored in the PLC equipment; analyzing the process data to generate display data so as to control a display interface of the upper computer to display the process data; receiving an operation instruction; converting the operation instruction into a machine instruction which can be identified by the PLC equipment; and sending the machine instruction to the PLC equipment according to the communication parameters of the PLC equipment. The method has the characteristics and advantages that the accessed multi-brand and multi-type PLC equipment is automatically identified, the data of the multi-brand and multi-type PLC equipment is read and written in real time, and the automation level of a centralized control scene of a production line is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semiconductor manufacturing technology, and in particular to a method, electronic device, and medium for reading and writing PLC devices. Background Technology

[0002] In complex production processes such as semiconductor wafer manufacturing and packaging testing, the entire production process typically requires the coordinated control of multiple Programmable Logic Controllers (PLCs). Each PLC is used to start or control a specific process chamber (such as a load-locking chamber, a transfer chamber, or a process handling chamber) to execute corresponding process tasks.

[0003] To automate production processes, a host computer is typically physically connected to multiple PLC devices, and parameters related to the PLC devices (such as communication protocols and data reading rules) are hard-coded into the software code to enable data transmission between the host computer and the PLC devices, such as sending control commands or sending back processing parameters. However, in practical applications, when the production line PLC devices are updated, the process layout is changed, or new PLC models and quantities are added, developers need to modify the underlying software code to adapt to the parameter changes. This results in a lengthy adaptation process, and the workload increases exponentially with the scale of integrated control of the production line, severely impacting production efficiency. Summary of the Invention

[0004] This invention aims to address, to a certain extent, one of the technical problems in related technologies. To this end, this invention provides a method for reading and writing PLC devices, an electronic device for executing the method, and a computer-readable medium, which has the characteristics and advantages of automatically identifying and connecting multiple brands and types of PLC devices, real-time reading and writing of data from multiple brands and types of PLC devices, and improving the automation level of centralized control scenarios on production lines.

[0005] To achieve the above objectives, as a first aspect of the present invention, a method for reading and writing PLC devices is provided, for a host computer, wherein the host computer and multiple PLC devices are located on the same local area network, wherein the method includes: In response to the access signal of the PLC device, the communication parameters of the PLC device are determined; Read and store the process data stored in the PLC device; The process data is parsed to generate display data, so as to control the display interface of the host computer to display the process data; Receive operation instructions; The operation instructions are converted into machine instructions that can be recognized by the PLC device; The machine instructions are sent to the PLC device according to the communication parameters of the PLC device.

[0006] Optionally, determining the communication parameters of the PLC device in response to the PLC device's access signal includes: The probe messages are broadcast in the local area network according to the format specified by the different hardware device discovery protocols. Upon receiving a response message from the PLC device, the response message is parsed to obtain the device model of the PLC device and its matching MAC address and IP address; The parsed MAC address and IP address are used as communication parameters for this PLC device model.

[0007] Optionally, reading and storing the process data stored in the PLC device includes: Determine the model of the PLC device to be read; The PLC device sends data packets according to a communication protocol format that matches its model; wherein the packets carry process data stored in the PLC device. The data message is parsed according to the format of the communication protocol that matches the PLC device model to obtain process data represented by the data type of the PLC device; wherein, the data type of the PLC device includes at least one of S7_INT, S7_BOOL, and S7_BYTE types; The process data represented by the data type of the PLC device is converted into process data represented by the data type of the host computer according to the data type conversion table; wherein, the data type of the host computer includes at least one of the short, float and bool types in C# language; Save the process data represented by the data type of the host computer.

[0008] Optionally, parsing the data message according to the format of the communication protocol matching the PLC device model to obtain process data represented by the data type of the PLC device includes: The data packet file is parsed to obtain the identification code of the PLC device; The data storage method of the PLC device is determined according to the identification code lookup table; In the case of the PLC device storing process data at a single point, the starting address of the stored process data is determined; Send a continuous read request to the PLC device to read process data from multiple addresses in succession, starting from the first address.

[0009] Optionally, parsing the data message according to the format of the communication protocol matching the PLC device model to obtain process data represented by the data type of the PLC device includes: When the PLC device structure stores process data, the data block number, starting offset address, and data length of the process data structure in the PLC device are determined according to the saved storage location lookup table. A structure read request is sent to the PLC device to read the process data structure corresponding to the determined data block number, starting offset address, and data length.

[0010] Optionally, converting the operation instructions into machine instructions that can be recognized by the PLC device includes: Determine the data type corresponding to the operation instruction; The data type of the operation instruction is converted to the data type corresponding to the machine instruction that matches the PLC device according to the data type conversion table.

[0011] Optionally, sending the machine instructions to the PLC device according to the communication parameters of the PLC device includes: The machine instructions are encapsulated according to the protocol format supported by the PLC device to obtain the encapsulated message. The encapsulated message is sent to the PLC device based on the PLC device's MAC address and IP address.

[0012] As a second aspect of the present invention, a method for reading and writing a PLC device is provided, for use in a PLC device, wherein the method includes: When a PLC device that supports the hardware device discovery protocol receives a probe message, it sends a response message to the host computer; wherein, the response message carries the device model, MAC address and IP address of the PLC device.

[0013] As a third aspect of the present invention, an electronic device is provided, comprising: One or more processors; A memory having stored one or more computer programs that, when executed by one or more processors, cause the one or more processors to implement the method for reading and writing a PLC device according to the first and second aspects of the present invention.

[0014] As a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for reading and writing a PLC device provided according to the first and second aspects of the present invention.

[0015] In semiconductor production line automation, each process chamber is typically controlled by an independent PLC. By deploying the host computer and various types of PLC devices on the same local area network (LAN), hardware discovery protocols can automatically enumerate and identify connected PLC devices throughout the LAN, proactively acquiring key communication parameters such as device model, MAC address, and IP address, enabling plug-and-play functionality. After establishing a communication connection between the host computer and the connected PLC devices, the host computer actively reads the process data stored by each PLC device using the communication protocol formats built into the PLC device type, thereby obtaining real-time processing data from all process chambers in the entire semiconductor production line. Considering that the PLC stores raw, low-level machine data (such as register values ​​and bit states), the host computer further parses it, converting it into data with practical engineering significance that upper-level applications (such as MES and SCADA) or the display interface can understand (such as "vacuum level: 0.001 Pa"), thus presenting the real-time operating status of the entire production line on the display interface. Furthermore, upon receiving operation instructions from the operator, the system converts these instructions (advanced instructions) into machine instructions that can be recognized and executed by the target PLC device. Based on the target PLC device's communication parameters (MAC address, IP address), the machine instructions are sent to the target PLC device in real-time and accurately to control its status (such as start / stop status, issuing processing recipes, etc.), achieving precise reverse control. The method for reading and writing PLC devices provided by this invention automatically identifies the PLC device and establishes a communication connection, actively collects and parses PLC device data, and sends instructions in real-time and accurately. This completes automated device identification and automatic data interaction, effectively solving the problem of repeatedly modifying the underlying code when facing changes in PLC devices (such as firmware updates, adding or replacing PLC device models), process layouts, and other practical production issues. Through standardized and automated interaction processes, it solves the problem of adapting to diverse underlying device models, greatly improving the flexibility and adaptability of the production line when facing process layout adjustments or equipment iterations. Especially in scenarios requiring centralized control of a large number of PLC devices, it significantly reduces system maintenance complexity and costs, effectively improves production efficiency, and realizes real-time data transmission in centralized control scenarios.

[0016] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and accompanying drawings. The preferred embodiments or means of the present invention will be shown in detail in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. In addition, each of these features, elements and components appearing in the following text and drawings is a plurality of, and different symbols or numbers are used for convenience of representation, but all represent parts with the same or similar construction or function. Attached Figure Description

[0017] The present invention will be further described below with reference to the accompanying drawings: Figure 1 This is a flowchart of the method for reading and writing PLC devices provided by the present invention; Figure 2 A flowchart illustrating one embodiment of step S110 of the method for reading and writing a PLC device provided by the present invention; Figure 3 A flowchart illustrating one embodiment of step S120 of the method for reading and writing a PLC device provided by the present invention; Figure 4 A flowchart illustrating one embodiment of step S123 of the method for reading and writing a PLC device provided by the present invention; Figure 5 A comparative diagram of conventional stationary reading and block reading of the present invention is provided for this invention; Figure 6 Flowchart of another embodiment of step S123 of the method for reading and writing PLC devices provided by the present invention; Figure 7 A flowchart illustrating one embodiment of step S150 of the method for reading and writing a PLC device provided by the present invention; Figure 8 A flowchart illustrating one embodiment of step S160 of the method for reading and writing a PLC device provided by the present invention; Figure 9 This is a flowchart of the method for reading and writing PLC devices provided by the present invention; Figure 10 This is a schematic diagram of the host computer interface corresponding to the read / write method of the present invention. Figure 11 This is a block diagram of an electronic device provided by the present invention; Figure 12 This is a schematic diagram of a computer-readable medium provided by the present invention.

[0018] Explanation of reference numerals in the attached figures Among them, 101 is the processor; 102 is the memory; 103 is the I / O interface; and 104 is the bus. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described are intended to explain the present invention and should not be construed as limiting the invention.

[0020] The terms "an embodiment," "example," or "trademark" used in this specification refer to a particular feature, structure, or characteristic described in connection with the embodiment itself that may be included in at least one embodiment disclosed in this invention. The phrase "in an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.

[0021] In complex production processes such as semiconductor wafer manufacturing and packaging, PLC devices serve as the underlying control core, responsible for the real-time control of key equipment such as lithography machines, ion implanters, and deposition equipment. In centralized control scenarios, a single host computer needs to integrate dozens of PLC devices from different manufacturers. Traditional control methods rely on developing message formats in the underlying code that match the communication protocols of different manufacturers' PLC devices, binding PLC device parameters through hard coding. This individual customization method requires redeveloping and debugging the communication interface for each PLC device when facing production line layout updates or equipment firmware upgrades, resulting in long debugging cycles and severely impacting production efficiency.

[0022] In view of this, in order to solve the above problems, as a first aspect of the present invention, a method for reading and writing PLC devices is provided, such as... Figure 1 As shown, the method includes: In step S110, in response to the access signal of the PLC device, the communication parameters of the PLC device are determined; In step S120, the process data stored in the PLC device is read and stored; In step S130, the process data is parsed to generate display data, so as to control the display interface of the host computer to display the process data; In step S140, an operation command is received; In step S150, the operation instructions are converted into machine instructions that can be recognized by the PLC device; In step S160, the machine instruction is sent to the PLC device according to the communication parameters of the PLC device.

[0023] In semiconductor production line automation, each process chamber is typically controlled by an independent PLC. By deploying the host computer and various types of PLC devices on the same local area network (LAN), hardware discovery protocols can automatically enumerate and identify connected PLC devices throughout the LAN, proactively acquiring key communication parameters such as device model, MAC address, and IP address, enabling plug-and-play functionality. After establishing a communication connection between the host computer and the connected PLC devices, the host computer actively reads the process data stored by each PLC device using the communication protocol formats built into the PLC device type, thereby obtaining real-time processing data from all process chambers in the entire semiconductor production line. Considering that the PLC stores raw, low-level machine data (such as register values ​​and bit states), the host computer further parses it, converting it into data with practical engineering significance that upper-level applications (such as MES and SCADA) or the display interface can understand (such as "vacuum level: 0.001 Pa"), thus presenting the real-time operating status of the entire production line on the display interface. Furthermore, upon receiving operation instructions from the operator, the system converts these instructions (advanced instructions) into machine instructions that can be recognized and executed by the target PLC device. Based on the target PLC device's communication parameters (MAC address, IP address), the machine instructions are sent to the target PLC device in real-time and accurately to control its status (such as start / stop status, issuing processing recipes, etc.), achieving precise reverse control. The method for reading and writing PLC devices provided by this invention automatically identifies the PLC device and establishes a communication connection, actively collects and parses PLC device data, and sends instructions in real-time and accurately. This completes automated device identification and automatic data interaction, effectively solving the problem of repeatedly modifying the underlying code when facing changes in PLC devices (such as firmware updates, adding or replacing PLC device models), process layouts, and other practical production issues. Through standardized and automated interaction processes, it solves the problem of adapting to diverse underlying device models, greatly improving the flexibility and adaptability of the production line when facing process layout adjustments or equipment iterations. Especially in scenarios requiring centralized control of a large number of PLC devices, it significantly reduces system maintenance complexity and costs, effectively improves production efficiency, and realizes real-time data transmission in centralized control scenarios.

[0024] Need to Figure 1 This plan is described in detail below. Figure 1Steps S110-S160 are executed sequentially. However, in the actual production process, step S110 aims to enable the host computer to automatically discover, identify, and establish communication with each PLC device; steps S120-S130 aim to read process data from the PLC; and steps S140-S160 are the process of writing parameters into the PLC. Establishing a communication connection is fundamental; reading and writing can be performed sequentially or individually as needed, and are not limited to a single sequential order.

[0025] To achieve automatic identification and plug-and-play functionality for different types of connected PLC devices, it is necessary to promptly identify the identity information and communication parameters of the inserted PLC device. As an optional implementation of step S110, such as... Figure 2 As shown, determining the communication parameters of the PLC device in response to the PLC device's access signal includes: In step S111, probe messages are broadcast in the local area network according to the format specified by different hardware device discovery protocols; In step S112, upon receiving a response message from the PLC device, the response message is parsed to obtain the device model of the PLC device and its matching MAC address and IP address. In step S113, the parsed MAC address and IP address are used as communication parameters for the PLC device of this model.

[0026] Traditional methods require manually configuring the device model, IP address, and MAC address of a PLC device when it is connected, and writing this information into a code that matches the PLC device model. This manual configuration method is prone to errors and has high maintenance costs. The technical solution provided by this invention utilizes hardware discovery protocols (such as EtherNet / IP Discovery, Profinet DCP, etc.). As long as the PLC device supports one of these protocol standards, it can receive probe messages sent by the host computer in the local area network. Then, it actively reports its own identity information (such as model, MAC address, IP address) by sending response messages. After being acquired and parsed by the host computer, it can establish communication connections with each PLC device, serving as the communication basis for subsequent data transmission. This method of enumerating hardware device discovery protocols can automatically discover and identify connected PLC devices, reducing maintenance costs. When the PLC devices in the network change, it can automatically detect and adapt.

[0027] After the host computer and each PLC device have established communication capabilities, reading and writing to the PLC devices can be achieved. To enable real-time reading of the process data for each chamber stored in the PLC device, as an optional implementation of step S120, such as... Figure 3 As shown, the process data read and stored in the PLC device includes: In step S121, the model of the PLC device to be read is determined; In step S122, a data message sent by the PLC device is received according to the format of the communication protocol matching the model of the PLC device; wherein the message carries process data stored by the PLC device; In step S123, the data message is parsed according to the format of the communication protocol matching the PLC device model to obtain process data represented by the data type of the PLC device; wherein, the data type of the PLC device includes at least one of S7_INT, S7_BOOL, and S7_BYTE types; In step S124, the process data represented by the data type of the PLC device is converted into process data represented by the data type of the host computer according to the data type conversion table; wherein, the data type of the host computer includes at least one of the short, float and bool types in C# language; In step S125, the process data represented by the data type of the host computer is saved.

[0028] It is necessary to explain the process data read from the PLC device in steps S121-S125 above. In actual production, multiple brands and versions of PLC devices (such as Siemens, Beckhoff, etc.) are involved. Different PLC equipment providers may use different communication protocols (such as Siemens S7) and data types. To avoid the tedious operation of repeatedly reading data according to the communication protocol and data type for the same PLC equipment in traditional methods, this invention incorporates a format and data type conversion table of the communication protocol matched to the PLC equipment model into the host computer (i.e., the host computer has the implementation code of these protocols pre-integrated; as long as the equipment model to be read is known, the protocol and data conversion table matching the equipment model can be directly selected to read the data). Furthermore, the format and data type conversion table is stored in the host computer in a hot-load manner, loading and taking effect immediately without a restart. Since the host computer has built-in mainstream communication protocol stacks such as Modbus / TCP, EtherCAT, Profinet, and CC-Link, it can quickly complete the communication link initialization by automatically matching the target protocol (tested to complete the communication link initialization and protocol matching of the target PLC equipment within 200ms). This method of protocol adaptation and type conversion eliminates the need to develop separate reading logic for each PLC, reducing code redundancy, improving compatibility with cross-brand and cross-version PLC equipment, and reducing code maintenance costs. To acquire process data from a specified chamber, the host computer first needs to determine the model of the PLC device to be read. Based on the model, it then selects the correct protocol within its internal memory to receive and parse the data packets sent by the target PLC. Since different protocols have different headers, data lengths, and byte orders, a matching protocol must be used to parse the data packets and extract the original PLC-side data. For example, S7_INT, S7_BOOL, and S7_BYTE are typical data types in the Siemens S7 protocol. Because the original PLC-side data is meaningless to the host computer's programming language (such as C#), a predefined data type conversion table can be used to convert the PLC-side data into process data that the host computer program can use for logical judgments, mathematical calculations, or display, and then save this data to the host computer. This saved data can then be parsed again to generate display data or provide a basis for subsequent data analysis and historical tracing.

[0029] To further improve the real-time performance of reading process data stored in the PLC, the method provided by this invention, after analyzing the data storage methods of various PLC devices, abandons the traditional point-by-point polling method for reading data stored at a single point (this method has an excessively long complete data acquisition cycle in medium-sized control systems containing tens of thousands of data points, and cannot meet the real-time requirements of semiconductor process control). As an optional implementation of step S123, as follows... Figure 4 As shown, parsing the data packet according to the format of the communication protocol matching the PLC device model to obtain process data represented by the data type of the PLC device includes: In step S123a, the data packet file is parsed to obtain the identification code of the PLC device; In step S123b, the data storage method of the PLC device is determined according to the identification code lookup table; In step S123c, when the PLC device stores process data at a single point, the starting address of the stored process data is determined; In step S123d, a continuous read request is sent to the PLC device to read process data from multiple addresses in the PLC device, starting from the first address.

[0030] First, the data storage method of the PLC device is determined based on the identifier lookup table. In the case of single-point storage by the PLC device, the starting address of the stored process data is determined, and multiple single-point data points within consecutive addresses following the starting address are identified. These multiple single-point data points are then read at once (block reading, i.e., automatically dividing the reading interval into blocks based on address continuity). It should be noted that for block reading, the consecutive storage address bytes are less than or equal to 256 bytes per read; the number of single-point data points stored in consecutive addresses is greater than or equal to 32. Testing shows that the read latency for single-point data using block reading is less than 50ms. Traditional point-by-point reading reads a single data point from the device each time. For large amounts of data, this requires multiple interactions with the device, resulting in long read times. The block reading method of this invention reads multiple data points from the device at once, reducing the number of interactions and improving read efficiency. It should also be noted that the identifier lookup table can be stored in the host computer via hot-loading, allowing direct determination of the PLC device's data storage method based on the device identifier, reducing repetitive determination time and further improving data read efficiency. Figure 5 A schematic diagram of traditional point-by-point reading and the block reading of this invention is given.

[0031] Furthermore, for data stored in the form of structures, traditional methods require breaking down the structure data into basic data types and reading them one by one, making it difficult to guarantee data consistency. To address the issues of poor real-time performance and data inconsistency when reading structure data, as an optional implementation of step S123, such as... Figure 6 As shown, the step of parsing the data packet according to the format of the communication protocol matching the PLC device model to obtain process data represented by the data type of the PLC device includes: In step S123a, when the process data is stored in the PLC device structure, the data block number, starting offset address and data length of the process data structure in the PLC device are determined according to the saved storage location lookup table. In step S123b, a structure read request is sent to the PLC device to read the process data structure corresponding to the determined data block number, starting offset address, and data length.

[0032] It should be noted that the process data structure includes a semiconductor equipment status monitoring structure and a wafer process parameter structure. The semiconductor equipment status monitoring structure includes, but is not limited to, vacuum level, gas flow rate, coolant temperature, alignment error flags, and wafer in-situ detection. The wafer process parameter structure includes, but is not limited to, wafer identifier, wafer batch number, current process step, etching rate, deposition layer thickness distribution, cleanroom particle count, and reaction chamber pressure. The storage location lookup table can also be saved in a hot-loaded manner.

[0033] During the data reading process, the storage location of the wafer process parameter structure in the Siemens PLC device's memory is first determined. For example, the wafer process parameter structure is stored in data block number 3 (DB3) in the Siemens PLC device, occupying a total of 128 bytes. The structure begins at the 0th byte of data block DB3. The precise location of each member within the structure is also given: the wafer identifier starts at the beginning of the structure, occupying 32 bytes; the wafer batch number starts at byte 32, occupying 4 bytes; the current process step starts at byte 36, occupying 2 bytes; and the etching rate starts at byte 38, occupying 4 bytes (to improve memory access speed, it needs to be read after 4-byte alignment). This method of reading the structure data in one go ensures the consistency of each member within the structure data compared to traditional methods. Actual testing shows that the structure data can be read within 20ms.

[0034] In the process of writing data to the PLC device, as an optional implementation of step S150, such as... Figure 7 As shown, the step of converting the operation instructions into machine instructions that can be recognized by the PLC device includes: In step S151, the data type corresponding to the operation instruction is determined; In step S152, the data type of the operation instruction is converted to the data type corresponding to the machine instruction that matches the PLC device according to the data type conversion table.

[0035] The above operating instructions include, but are not limited to, controlling the start and stop of the chamber, controlling the gas flow rate in the chamber, and issuing process formulas for designated chambers.

[0036] After the host computer converts the machine instructions into a data type that matches the target PLC device, it can send them to the target PLC device. This is an optional implementation of step S160, such as... Figure 8 As shown, sending the machine instructions to the PLC device according to the communication parameters of the PLC device includes: In step S161, the machine instructions are encapsulated according to the protocol format supported by the PLC device to obtain the encapsulated message. In step S162, the encapsulated message is sent to the PLC device according to the MAC address and IP address of the PLC device.

[0037] Compared to traditional methods of reading and writing to PLC devices, the above method does not require developing separate read / write logic for each PLC, reducing code redundancy, lowering software maintenance costs, improving compatibility with different PLC devices, and eliminating the need for fragmented read / write operations on PLC devices. It is also worth noting that the read / write operation of this invention includes data read / write error handling through an exception capture mechanism, including communication timeout retries (default 3 retries), data verification (CRC check or parity check), and error log recording.

[0038] As a second aspect of the present invention, a method for reading and writing PLC devices is provided, for use with PLC devices, such as... Figure 9 As shown, the method includes: In step S210, when a PLC device that supports the hardware device discovery protocol receives a probe message, it sends a response message to the host computer; wherein, the response message carries the device model, MAC address, and IP address of the PLC device.

[0039] To illustrate the flexibility and adaptability of this invention, Figure 10 A schematic diagram of the read / write method of the present invention on the host computer interface is provided. The above method is displayed in the form of an interface, which can complete brand configuration, protocol configuration, address configuration, IO import and parsing through the interface configuration tool; and a generalized interface platform, including IPLC interface (read / write interface), IDevice interface (device interface), IConnect interface (standardized device protocol link interface); supported devices and protocols include OMRON FINS, SIEMENS S7, BECKHOFF ADS, and mainstream PLC communication protocol stacks such as Modbus / TCP, EtherCAT, and CC-Link.

[0040] As a third aspect of the present invention, an electronic device is provided, such as... Figure 11 As shown, it includes: One or more processors 101; The memory 102 stores one or more computer programs that, when executed by the one or more processors 101, cause the one or more processors 101 to implement the method for reading and writing a PLC device according to the first and second aspects of the present invention.

[0041] The tool may also include one or more I / O interfaces 103 connected between the processor 101 and the memory 102, configured to enable information interaction between the processor 101 and the memory 102.

[0042] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit 101 (CPU); the first memory 102 is a device with data storage capabilities, including but not limited to random access memory 102 (RAM, more specifically SDRAM, DDR, etc.), read-only memory 102 (ROM), electrically erasable programmable read-only memory 102 (EEPROM), and flash memory (FLASH); the I / O interface 103 (read-write interface) is connected between the processor 101 and the memory 102, enabling information interaction between the processor 101 and the memory 102, including but not limited to a data bus 104 (Bus).

[0043] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.

[0044] Furthermore, as a fourth aspect of the present invention, a computer-readable medium is also provided having a computer program stored thereon, such as... Figure 12 As shown, when the computer program is executed by a processor, it implements the method for reading and writing PLC devices provided in the first and second aspects of the present invention.

[0045] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can implement the methods of any of the above embodiments. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0046] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.

Claims

1. A method for reading and writing PLC devices, for a host computer, said host computer being in the same local area network as a plurality of PLC devices, characterized in that, The method comprises: determining the communication parameters of the PLC device in response to an access signal of the PLC device; reading and storing the process data stored in the PLC device; parsing the process data to generate display data to control the display interface of the host computer to display the process data; receiving an operation instruction; converting the operation instruction into a machine instruction recognizable by the PLC device; sending the machine instruction to the PLC device according to the communication parameters of the PLC device.

2. The method of claim 1, wherein, The determination of the communication parameters of the PLC device in response to the access signal of the PLC device comprises: broadcasting a probe packet in the local area network according to the format specified by different hardware device discovery protocols; in the case of receiving a response packet sent by the PLC device, parsing the response packet to obtain the device model of the PLC device and the MAC address and IP address matched therewith; taking the parsed MAC address and IP address as the communication parameters of the PLC device of the device model.

3. The method of claim 1, wherein, The reading and storing of the process data stored in the PLC device comprises: determining the PLC device model to be read; receiving a data packet sent by the PLC device according to the format of the communication protocol matched with the PLC device model; wherein the packet carries the process data stored by the PLC device; parsing the data packet according to the format of the communication protocol matched with the PLC device model to obtain the process data represented in the data type of the PLC device; wherein the data type of the PLC device comprises at least one of S7_INT, S7_BOOL and S7_BYTE; converting the process data represented in the data type of the PLC device into process data represented in the data type of the host computer according to a data type conversion table; wherein the data type of the host computer comprises at least one of the short type, float type and bool type of C# language; storing the process data represented in the data type of the host computer.

4. The method of claim 3, wherein, The parsing of the data packet according to the format of the communication protocol matched with the PLC device model to obtain the process data represented in the data type of the PLC device comprises: parsing the data packet file to obtain the identification code of the PLC device; determining the data storage mode of the PLC device according to an identification code lookup table; in the case of single-point storage of process data in the PLC device, determining the starting address of the stored process data; sending a continuous reading request to the PLC device to read the process data in the PLC device from the starting address to multiple addresses.

5. The method of claim 3, wherein, The parsing of the data packet according to the format of the communication protocol matched with the PLC device model to obtain the process data represented in the data type of the PLC device comprises: in the case of structure body storage of process data in the PLC device, determining the data block number, starting offset address and data length of the process data structure body in the PLC device according to the saved storage location lookup table; Send a structure read request to the PLC device to read a process data structure corresponding to the determined data block number, start offset address and data length.

6. The method of claim 1, wherein, The converting the operation instruction into a machine instruction recognizable by the PLC device comprises: Determining a data type corresponding to the operation instruction; Converting the data type of the operation instruction into a data type corresponding to the machine instruction matched with the PLC device according to the data type conversion table.

7. The method of claim 1, wherein, The sending the machine instruction to the PLC device according to the communication parameter of the PLC device comprises: Packaging the machine instruction into a protocol format supported by the PLC device to obtain a packaged message; Sending the packaged message to the PLC device according to the MAC address and IP address of the PLC device.

8. A method of reading and writing a PLC device, for use with a PLC device, characterized by, The method comprises: In a case where a PLC device supporting a hardware device discovery protocol receives a probe message, sending a response message to a host computer, wherein the response message carries a device model, a MAC address and an IP address of the PLC device.

9. An electronic device, comprising: Comprise: One or more processors; A memory having one or more computer programs stored thereon, wherein when the one or more computer programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

10. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method according to any one of claims 1 to 8.