Register operation method, system and conversion device
By using address translation and protocol adaptation technology in register operations between cloud PLC and traditional PLC, the problem of inconsistent register standards of traditional PLC is solved, and the development of a unified communication interface is realized, and the development efficiency is improved and the simplification of simplification is achieved. process.
Patent Information
- Application Number
- CN202210759968.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-06-30
AI Technical Summary
The register design and management standards of traditional PLCs are not uniform, which leads to developers who need to have an in-depth understanding of the register types, access methods and instruction formats of each PLC when developing the communication interface between cloud-based PLCs and traditional PLCs, which increases the development complexity and Inefficient.
By receiving operation instructions based on the first protocol, converting the first address into the second address using the preset address correspondence relationship, and executing operation instructions according to the protocol supported by the PLC to which the target register belongs, the development of a unified communication interface for a traditional PLC is realized.
This reduces development complexity and improves development efficiency, so that developers do not need to adapt detailed register types and protocols to each different traditional PLC, simplifying communication development between cloud PLC and traditional PLC.
Smart Images

Figure CN115033287B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of industrial Internet technology, and in particular to a register operation method, system and conversion device. Background Art
[0002] With the growing demand for intelligence, traditional programmable logic controllers (PLCs) can no longer meet the intelligent needs of industrial production, and cloud PLCs have emerged. Cloud PLCs are software-defined virtual PLCs that can run in the cloud. Cloud PLCs can directly communicate with the industrial Internet platform, realizing a transfer of industrial control from wired to wireless, and from local to cloud.
[0003] In related technologies, when cloud-based PLC is used for intelligent control of industrial production, related application programs are usually developed based on the IEC61499 standard. Summary of the invention
[0004] The inventors noticed that there are still a large number of traditional PLCs in use in industrial production. If these traditional PLCs are directly abandoned, it will lead to a large amount of asset waste. However, applications developed based on the IEC61499 standard cannot be directly deployed on traditional PLCs. Therefore, in order to utilize these traditional PLCs, cloud PLCs and traditional PLCs need to communicate to collaborate to implement the application.
[0005] In the related art, in order to realize the communication between the cloud PLC and the traditional PLC, the developers need to design an adaptive communication interface between each cloud PLC and the traditional PLC communicating with the cloud PLC during the application development process.
[0006] However, traditional PLCs access data and perform logical operations through internal registers. Different manufacturers have different standards for the design and management of the traditional PLC registers they provide. As a result, when developing applications, developers need to have an in-depth understanding of the register type, access method, instruction format and other detailed information of each traditional PLC that communicates with the cloud PLC in order to develop an adaptive communication interface, which leads to greater development complexity and low development efficiency.
[0007] In order to solve the above problems, the embodiments of the present disclosure propose the following solutions.
[0008] According to one aspect of an embodiment of the present disclosure, a register operation method is provided, including: receiving a plurality of operation instructions corresponding one-to-one to a plurality of first PLCs based on a first protocol, each operation instruction carrying a first address corresponding to a target register in the corresponding first PLC, the plurality of first PLCs supporting different second protocols from each other, the second protocol being different from the first protocol; converting the first address into a corresponding second address according to a pre-set correspondence between the first address and the second address, the second address being a physical address of the target register; performing an operation represented by the corresponding operation instruction on the target register according to the second address based on the second protocol supported by each first PLC, wherein the plurality of operation instructions come from one or more second PLCs, each second PLC being a cloud PLC.
[0009] In some embodiments, the first protocol is a MODBUS communication protocol, the first address is an address of a register of the MODBUS communication protocol, the register of the MODBUS communication protocol and the target register have consistent attributes, and the attributes include access attributes and operation units.
[0010] In some embodiments, when the target register is a bit-operated read-write register, the corresponding register of the MODBUS communication protocol is a coil register.
[0011] In some embodiments, when the target register is a read-only register operated on a bit basis, the corresponding register of the MODBUS communication protocol is a discrete quantity input register.
[0012] In some embodiments, when the target register is a read-write register operated by bytes, the corresponding register of the MODBUS communication protocol is a holding register.
[0013] In some embodiments, when the target register is a read-only register operated by bytes, the corresponding register of the MODBUS communication protocol is an input register.
[0014] In some embodiments, each second PLC is based on the IEC 61499 standard.
[0015] According to another aspect of an embodiment of the present disclosure, a conversion device is provided, including: a receiving module, configured to receive a plurality of operation instructions corresponding one-to-one to a plurality of first PLCs based on a first protocol, each operation instruction carrying a first address corresponding to a target register in the corresponding first PLC, the plurality of first PLCs being non-cloud PLCs and supporting second protocols different from each other, the second protocol being different from the first protocol; a conversion module, configured to convert the first address into a corresponding second address according to a pre-set correspondence between the first address and the second address, the second address being a physical address of the target register; an execution module, configured to perform an operation represented by the corresponding operation instruction on the target register according to the second address based on the second protocol supported by each first PLC, wherein the plurality of operation instructions come from one or more second PLCs, each second PLC being a cloud PLC.
[0016] According to another aspect of an embodiment of the present disclosure, a conversion device is provided, including: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the method described in any one of the above embodiments based on instructions stored in the memory.
[0017] According to another aspect of the embodiments of the present disclosure, a register operating system is provided, comprising: a conversion device as described in any one of the above embodiments; and one or more second PLCs, configured to send multiple operation instructions corresponding to multiple first PLCs one by one based on a first protocol, each second PLC being a cloud PLC.
[0018] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, comprising computer program instructions, wherein when the computer program instructions are executed by a processor, the method described in any one of the above embodiments is implemented.
[0019] According to another aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0020] In the embodiment of the present disclosure, for each of the multiple operation instructions received from the second PLC (i.e., cloud-based PLC) based on the first protocol, the first address corresponding to the target register carried in the operation instruction can be converted into the corresponding second address according to the preset correspondence relationship, and based on the second protocol supported by the first PLC (i.e., traditional PLC) to which the target register belongs, the operation represented by the corresponding operation instruction is performed on the target register according to the second address. In this way, even if the second protocols supported by multiple traditional PLCs are different, each cloud-based PLC can send an operation instruction to operate the target register in any traditional PLC based on the same first protocol.
[0021] Therefore, in this way, developers can develop a unified communication interface for each cloud PLC that communicates with multiple different traditional PLCs based on the first protocol during the development process, without having to develop a communication interface that is compatible with the cloud PLC based on the register type, access method, instruction format and other detailed information of these multiple different traditional PLCs, thereby reducing development complexity and improving development efficiency.
[0022] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 is a flowchart of a register operation method according to some embodiments of the present disclosure;
[0025] Figure 2 is a schematic diagram of the structure of a conversion device according to some embodiments of the present disclosure;
[0026] Figure 3 is a schematic structural diagram of a conversion device according to other embodiments of the present disclosure;
[0027] Figure 4 is a schematic structural diagram of a conversion device according to some other embodiments of the present disclosure. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0029] Unless specifically stated otherwise, the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0030] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0031] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0032] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0033] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0034] In this disclosure, unless otherwise specified, the term "PLC" refers to a non-cloudified PLC, that is, a traditional PLC.
[0035] Figure 1 is a flowchart of a register operation method according to some embodiments of the present disclosure.
[0036] In step 102, a plurality of operation instructions corresponding to a plurality of first PLCs are received based on a first protocol.
[0037] Here, the multiple operation instructions may come from one or more second PLCs, each of which may be a cloud-based PLC. Each operation instruction may carry a first address corresponding to a target register in the corresponding first PLC.
[0038] In some embodiments, the first protocol may be a MODBUS communication protocol.
[0039] In some embodiments, multiple operation instructions may be received from one or more second PLCs in the form of event triggering.
[0040] In some embodiments, the plurality of first PLCs may be conventional PLCs from different manufacturers.
[0041] In some embodiments, one or more second PLCs send multiple operation instructions corresponding to multiple first PLCs based on the same first protocol. The multiple operation instructions have the same instruction format, and each operation instruction can be a read register instruction or a write register instruction.
[0042] It should be noted that register operations mainly include register read operations and register write operations. Register read operations refer to reading the value of a single or multiple bits of a register without changing the original value of the bit. Register write operations mainly include direct assignment, multi-bit assignment, and unit assignment. Among them, direct assignment refers to modifying all values in the register, while multi-bit assignment and unit assignment refer to changing the value of a single or multiple bits in the register without changing the values of other bits.
[0043] In step 104, the first address is converted into a corresponding second address according to a preset correspondence relationship between the first address and the second address. Here, the second address is a physical address of the target register.
[0044] In some embodiments, when the first protocol is a MODBUS communication protocol, the first address may be an address of a register of the MODBUS communication protocol.
[0045] In step 106, based on the second protocol supported by each first PLC, the operation represented by the corresponding operation instruction is performed on the target register according to the second address.
[0046] Here, the plurality of first PLCs may support second protocols that are different from each other, and the second protocol is different from the first protocol.
[0047] For example, the operation instruction corresponding to the target register is a read register instruction, and the communication protocol used in the process of performing the read register operation on the target register according to the second address is the second protocol supported by the first PLC to which the target register belongs. The second protocol can be the protocol used by various manufacturers when developing PLCs.
[0048] In the above embodiment, for each of the multiple operation instructions received from the second PLC (i.e., cloud-based PLC) based on the first protocol, the first address corresponding to the target register carried in the operation instruction can be converted into the corresponding second address according to the preset correspondence relationship, and based on the second protocol supported by the first PLC (i.e., traditional PLC) to which the target register belongs, the operation represented by the corresponding operation instruction is performed on the target register according to the second address. In this way, even if the second protocols supported by multiple traditional PLCs are different, each cloud-based PLC can send operation instructions to operate the target register in any traditional PLC based on the same first protocol.
[0049] Therefore, in this way, developers can develop a unified communication interface for each cloud PLC that communicates with multiple different traditional PLCs based on the first protocol during the development process, without having to develop a communication interface that is compatible with the cloud PLC based on the register type, access method, instruction format and other detailed information of these multiple different traditional PLCs, thereby reducing development complexity and improving development efficiency.
[0050] In some embodiments, the first protocol may be a MODBUS communication protocol. In this case, the first address may be an address of a register of the MODBUS communication protocol, and the register of the MODBUS communication protocol and the target register have the same attributes, wherein the attributes may include access attributes and operation units. For example, the access attributes may include a readable and writable attribute or a read-only attribute, and the operation unit may include a bitwise operation or a bytewise operation.
[0051] In this way, it can be ensured that after the first address corresponding to the received target register is converted according to the preset corresponding relationship, the operation represented by the corresponding operation instruction can be performed on the target register according to the second address corresponding to the first address, thereby improving the reliability of the register operation.
[0052] In addition, for the physical address of any register in different traditional PLCs, the correspondence between the physical address of the register and the address of the register of the MODBUS communication protocol can be uniformly set according to the above embodiment, which is conducive to the unified development of the communication interface, further reduces the development complexity, and thus further improves the development efficiency.
[0053] The following further describes the manner of setting the corresponding relationship in conjunction with some embodiments.
[0054] In some embodiments, when the target register is a bit-operated read / write register, the corresponding register of the MODBUS communication protocol may be a coil register.
[0055] For example, the target register is an M (bit) register inside a PLC of a certain manufacturer, which is a read-write register operated by bit and can be used to store Boolean data. In this case, when setting the corresponding relationship, a segment address (i.e., the first address) in the coil register of the MODBUS communication protocol can be bit-correlated with the physical address (i.e., the second address) of the target register.
[0056] For another example, the target register is an R (bit) register inside a PLC of another manufacturer, which is also a read-write register operated on a bit basis. In this case, when setting the corresponding relationship, another address segment in the coil register of the MODBUS communication protocol can be bit-by-bit mapped to the physical address of the target register.
[0057] In some embodiments, when the target register is a read-only register operated on a bit basis, the corresponding register of the MODBUS communication protocol may be a discrete quantity input register.
[0058] In some embodiments, when the target register is a read-write register operated by bytes, the corresponding register of the MODBUS communication protocol may be a holding register.
[0059] For example, the target register is a WR (word) register inside a PLC of a certain manufacturer. This register is a read-write register operated by bytes and can be used to store integer data. In this case, when setting the corresponding relationship, a segment address in the holding register of the MODBUS communication protocol can be bit-by-bit mapped to the physical address of the target register.
[0060] In some embodiments, when the target register is a read-only register operated on a byte basis, the corresponding register of the MODBUS communication protocol may be an input register.
[0061] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the conversion device embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0062] Figure 2 is a schematic diagram of the structure of a conversion device according to some embodiments of the present disclosure.
[0063] like Figure 2 As shown, the conversion device 200 includes a receiving module 201 , a conversion module 202 and an execution module 203 .
[0064] The receiving module 201 may be configured to receive a plurality of operation instructions corresponding to a plurality of first PLCs one by one based on a first protocol, wherein each operation instruction carries a first address corresponding to a target register in a corresponding first PLC, and the plurality of first PLCs are non-cloud PLCs and support second protocols different from each other, and the second protocols are different from the first protocol.
[0065] The conversion module 202 may be configured to convert the first address into a corresponding second address according to a preset correspondence relationship between the first address and the second address, where the second address is a physical address of the target register.
[0066] The execution module 203 may be configured to perform the operation represented by the corresponding operation instruction on the target register according to the second address based on the second protocol supported by each first PLC, wherein the multiple operation instructions come from one or more second PLCs, and each second PLC is a cloud PLC.
[0067] Figure 3 It is a schematic diagram of the structure of a conversion device according to some other embodiments of the present disclosure.
[0068] like Figure 3 As shown, the conversion device 300 includes a memory 301 and a processor 302 coupled to the memory 301 , and the processor 302 is configured to execute the method of any one of the aforementioned embodiments based on the instructions stored in the memory 301 .
[0069] The memory 301 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.
[0070] The conversion device 300 may also include an input / output interface 303, a network interface 304, a storage interface 305, etc. These interfaces 303, 304, 305, and the memory 301 and the processor 302 may be connected, for example, via a bus 306. The input / output interface 303 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 304 provides a connection interface for various networked devices. The storage interface 305 provides a connection interface for external storage devices such as an SD card and a USB flash drive.
[0071] Figure 4 is a schematic structural diagram of a conversion device according to some other embodiments of the present disclosure.
[0072] like Figure 4 As shown, the conversion device 400 may include a northbound interface 401 and a southbound interface 402 .
[0073] The northbound interface 401 can serve as a unified interface for communicating with one or more cloud-based PLCs (i.e., the second PLC), and is configured to receive multiple operation instructions from one or more cloud-based PLCs based on event triggering, perform address conversion on the first address carried in each operation instruction, and then pass the converted second address to the southbound interface 402.
[0074] The southbound interface 402 can be configured to communicate with multiple traditional PLCs (i.e., first PLCs) from different manufacturers, and to uniformly manage various registers in multiple traditional PLCs that support different second protocols to achieve adaptation of multiple traditional PLCs that support different second protocols.
[0075] In some embodiments, the conversion device of any of the above embodiments may be an STM32 single-chip microcomputer, that is, the method of any of the above embodiments may be deployed and implemented on an STM32 single-chip microcomputer.
[0076] The embodiment of the present disclosure further provides a register operating system, comprising a conversion device of any one of the above embodiments (eg, conversion device 200 / 300) and one or more second PLCs.
[0077] One or more second PLCs may be configured to send multiple operation instructions corresponding one-to-one to multiple first PLCs based on the first protocol, wherein each second PLC may be a cloud-based PLC.
[0078] The embodiments of the present disclosure further provide a computer-readable storage medium, comprising computer program instructions, which implement the method of any one of the above embodiments when executed by a processor.
[0079] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the method of any one of the above embodiments is implemented.
[0080] So far, various embodiments of the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
[0081] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0082] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions specified in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0085] Although some specific embodiments of the present disclosure have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified or some technical features may be replaced by equivalents without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A register operation method, comprising: receiving a plurality of operation instructions corresponding to a plurality of first PLCs one by one based on a first protocol, each operation instruction carrying a first address corresponding to a target register in a corresponding first PLC, the plurality of first PLCs being non-cloud PLCs and supporting second protocols different from each other, the second protocols being different from the first protocol; According to a preset correspondence relationship between the first address and the second address, convert the first address into a corresponding second address, where the second address is a physical address of the target register; Based on the second protocol supported by each first PLC, performing the operation represented by the corresponding operation instruction on the target register according to the second address, The multiple operation instructions come from one or more second PLCs, and each second PLC is a cloud PLC.
2. The method according to claim 1, wherein: The first protocol is a MODBUS communication protocol, the first address is an address of a register of the MODBUS communication protocol, the register of the MODBUS communication protocol and the target register have consistent attributes, and the attributes include access attributes and operation units.
3. The method according to claim 2, wherein: In the case where the target register is a read-write register operated on a bit basis, the corresponding register of the MODBUS communication protocol is a coil register.
4. The method according to claim 2, wherein: In the case where the target register is a read-only register operated on a bit basis, the corresponding register of the MODBUS communication protocol is a discrete quantity input register.
5. The method according to claim 2, wherein: In the case where the target register is a read-write register operated by bytes, the corresponding register of the MODBUS communication protocol is a holding register.
6. The method according to claim 2, wherein: In the case where the target register is a read-only register operated by bytes, the corresponding register of the MODBUS communication protocol is an input register.
7. The method according to any one of claims 1 to 6, wherein: Each second PLC is based on the IEC61499 standard.
8. A conversion device comprising: a receiving module configured to receive, based on a first protocol, a plurality of operation instructions corresponding one to one to a plurality of first PLCs, each operation instruction carrying a first address corresponding to a target register in a corresponding first PLC, the plurality of first PLCs being non-cloud PLCs and supporting second protocols different from each other, the second protocol being different from the first protocol; a conversion module, configured to convert the first address into a corresponding second address according to a preset correspondence relationship between the first address and the second address, where the second address is a physical address of the target register; an execution module configured to execute the operation represented by the corresponding operation instruction on the target register according to the second address based on the second protocol supported by each first PLC, The multiple operation instructions come from one or more second PLCs, and each second PLC is a cloud PLC.
9. A conversion device comprising: Memory; as well as A processor coupled to the memory is configured to execute the method according to any one of claims 1 to 7 based on instructions stored in the memory.
10. A register operating system, comprising: The conversion device according to claim 8 or 9; as well as One or more second PLCs are configured to send multiple operation instructions corresponding to multiple first PLCs based on the first protocol, and each second PLC is a cloud PLC.
11. A computer-readable storage medium comprising computer program instructions, wherein: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
12. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
