Function block logic incremental updating method in industrial control system

Through the incremental update method of functional block logic, the time-consuming problem of packaging and bottoming caused by functional block logic modification in industrial control systems is solved, the independence and rapid update of functional block logic are achieved, and the trial operation and debugging efficiency is improved.

CN120122502APending Publication Date: 2025-06-10SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510177424.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In industrial control systems, the modification of functional block logic often causes the packaging and downloading of the entire system to take a long time, affecting the trial operation and debugging efficiency.

Method used

The incremental update method of functional block logic is adopted. By assigning logical entry addresses to each functional block, building block call units and address management tables, independent modification, packaging and downloading of functional block logic is realized, thereby reducing interference to other functional blocks and programs.

Benefits of technology

The relative independence of the function block logic is realized, and the logic of only the installation and modification is not affected by other logic, which improves the packaging and installation speed and reduces the project debugging time cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120122502A_ABST
    Figure CN120122502A_ABST
Patent Text Reader

Abstract

The invention discloses a function block logic incremental updating method in an industrial control system. The method comprises the following steps: distributing a corresponding logic entry address for each function block in the system; constructing a block calling unit for calling each function block in a controller memory; allocating memory spaces for the packaged functional blocks according to the logic lengths of the packaged functional blocks, and constructing an address management table based on the allocated memory addresses; calculating a logic real address of each function block according to the allocated memory address and the offset of the logic entry address after the function block is packaged, and updating the block calling unit based on the logic real address; downloading the updated block calling unit into a controller, and logically downloading the packaged function block into the controller according to an address management table; and calling the function block based on the block calling address corresponding to the block calling unit. According to the method, the downloading speed can be increased, the independence of functions is improved, and incremental updating of logic is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial control, and particularly relates to a method for incrementally updating function block logic in an industrial control system. Background Art

[0002] In an industrial control system, programs and function blocks are the core of the industrial control system. Although during the already put-into-production process, adjustments to function block logic are avoided as much as possible. However, when it is unavoidable to modify the function block logic, the user's demand is to maintain the independence of the logic as much as possible. When modifying the function block logic, it is best not to affect the logic of other function blocks and programs, and avoid abnormal changes that may lead to production shutdown.

[0003] Currently in industrial control software, usually all function block logics are encapsulated together. In this way, when the logic is modified and downloaded to the controller, it can be ensured that the downloaded logic is always the latest and most complete, that is, integrated compilation and integrated download.

[0004] However, as the industrial control process becomes more and more complex, the logic encapsulated in function blocks also becomes more and more complex. The increase in process complexity also means an increase in the frequency of logic modification. According to the current processing solution, all function block logics are encapsulated together. Even if only one function block modifies one execution logic, it is necessary to re-encapsulate and download the whole. The programs that call the function blocks are also affected by the change of the entry address. After adapting to the new entry address, they need to be modified and downloaded together. The processes of encapsulation and download both consume time. When the number of function block logics is extremely large, the whole process of encapsulation and download will be very time-consuming.

[0005] This is very time-consuming for the trial operation and debugging process before industrial formal production. Because during the trial operation process, it is impossible to ensure that all logics are normal, and there are problems of modifying the logic multiple times and repeatedly. Only in the end can the process production standard be achieved. Therefore, reducing the time consumption caused by logic modification to greatly improve the efficiency of process debugging is an urgent problem to be solved at present. Summary of the Invention

[0006] In view of the above problems, the present invention proposes a method for incrementally updating function block logic in an industrial control system, which involves supporting independent modification, encapsulation and download of function block logic, and reducing interference to other function blocks and calling programs. To solve the above technical problems, the technical solutions adopted by the present invention are as follows:

[0007] A method for incrementally updating function block logic in an industrial control system includes the following steps:

[0008] S1, allocate corresponding logic entry addresses for each function block in the system;

[0009] S2. Construct a block call unit in the controller memory to implement the call of each functional block;

[0010] S3. Allocate memory space for each functional block according to the logical length of the encapsulated functional block, and construct an address management table based on the allocated memory addresses;

[0011] S4. Calculate the logical real address of each functional block according to the offset between the memory address allocated in step S3 and the logical entry address after encapsulation of the functional block, and update the block call unit based on the logical real address;

[0012] S5. Download the updated block call unit in step S4 to the controller, and download the encapsulated functional block logic to the controller according to the address management table constructed in step S3;

[0013] S6. Call the functional block based on the block call address corresponding to the block call unit.

[0014] In step S2, before constructing the block call unit, the memory space of the controller can also be divided into several equal-length memory blocks, and the capacity of each memory block is 4K bytes.

[0015] In step S2, the block call unit includes a jump instruction and a preset address.

[0016] In step S4, updating the block call unit based on the logical real address means updating the preset address based on the logical real address, and the logical real address is obtained by calculating the sum of the memory address of the functional block and the offset of the logical entry address after encapsulation.

[0017] The address management table includes a functional block identification code, a memory length, and a corresponding memory address.

[0018] In step S6, before calling the functional block based on the block call address corresponding to the block call unit, determine whether the execution logic of the functional block is modified. If it is modified, execute steps ① and ② in sequence, otherwise, directly call the corresponding functional block based on the block call address corresponding to the block call unit;

[0019] ① Compare the logical length of the modified functional block with the memory length allocated to the functional block before modification, and determine whether to update the address management table and the block call unit according to the comparison result. If so, download the updated block call unit and the encapsulated functional block logic again, otherwise, download the encapsulated functional block logic again based on the address management table;

[0020] ② Call the corresponding functional block based on the block call address corresponding to the block call unit.

[0021] Advantages of the present invention:

[0022] 1. It allows users to arbitrarily modify and enrich the logic of function blocks according to requirements in an already put-into-production process, adjust the functions of function blocks at any time, enabling the function blocks to flexibly meet the requirements. When the logic within the function blocks is modified, the program does not need to follow the modification and download, nor will it affect other unmodified function blocks, and the unmodified function blocks do not need to follow the modification and download either. It can maintain the relative independence of the function block logic. Only the modified logic is downloaded without affecting other logics and without interfering with the running logic in the controller hardware, achieving incremental update of the logic and improving the independence of functions;

[0023] 2. During download, the data volume is small and the download speed is fast, enabling users to more quickly and flexibly adjust the function block logic, thereby reducing the time cost of engineering debugging and saving construction time;

[0024] 3. To avoid memory fragmentation, the memory size of the function block logic after encapsulation is allocated in units of 4K bytes, that is, the minimum is 4K bytes, and the allocated memory size is an integer multiple of 4K bytes;

[0025] 4. When the industrial control software version is iterated, the functions of some fixed function blocks that follow the software system update are also upgraded, and it also supports incremental update of the logic. When the software is upgraded, only the updated part of the function block logic is downloaded to achieve function version iteration with little disturbance and high speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0027] Figure 1 is the flowchart of the present invention;

[0028] Figure 2 is the schematic diagram of the initial address jump table;

[0029] Figure 3 is the schematic diagram of the space allocation of three example function blocks in memory;

[0030] Figure 4 For Figure 3 the storage schematic diagram of the three function blocks in the address management table in

[0031] Figure 5 is the schematic diagram of the calculation of the logical real address;

[0032] Figure 6 is the schematic diagram of the updated address jump table;

[0033] Figure 7 One of the schematic diagrams of the memory space allocation after the logical modification of Function Block 2 in Figure 3 ;

[0034] Figure 8 For Figure 7 the storage schematic diagram of three function blocks in the address management table in

[0035] Figure 9 For Figure 3 one of the schematic diagrams of the corresponding updated address jump table after the logical modification of Function Block 2 in

[0036] Figure 10 For Figure 3 the second schematic diagram of the memory space allocation after the logical modification of Function Block 2 in

[0037] Figure 11 The memory allocation method of the prior art;

[0038] Figure 12 The memory allocation method of the present application. Detailed implementation manners

[0039] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0040] Function block: A set of functions. The functions referred to are: a logical combination block that is relatively independent of the calling program and realizes some complete specific functions. After the function block encapsulates the logic, it can be directly called in the program, that is, it provides common logical processing and reduces repeated logical construction.

[0041] Program: The program is the carrier of the function block and also the calling source of the function block. It provides the input and output conditions for the function block, and calls a combination of single or multiple function blocks to realize more complex function logics.

[0042] Encapsulation: Pack the logic of the function block and provide the entry address of the logic. The program no longer cares about the internal logic details of the function block, but calls the encapsulated logic entry address to realize the logical processing of the input data and obtain the processed output data.

[0043] Controller: The controller is the hardware carrier of the program and the function block. It needs to allocate memory for the program and the function block to store logical data, and input and output according to the real signals executed by the logic of the program and the function block.

[0044] Download: The process of transmitting data such as programs and function blocks over the network to the controller's memory is called download. After download, the controller executes the logic according to the latest data of the program and function block.

[0045] A method for incremental update of function block logic in an industrial control system, as Figure 1 shown, includes the following steps:

[0046] S1. Assign a corresponding logical entry address to each function block according to the creation order of function blocks in the system;

[0047] In the prior art, the call of each function block is directly achieved by accessing the logical entry address corresponding to each function block.

[0048] S2. Divide the memory space of the controller into several equal-length memory blocks, and construct a block call unit for implementing the call of each function block in the controller memory;

[0049] Dividing the memory space of the controller into several memory blocks of the same size, this way of setting the minimum memory allocation size can effectively reduce the fragmentation problem after multiple memory allocations. At the same time, set the status tags of each memory block, including occupied and free.

[0050] As Figure 11 shown, the prior art adopts a memory allocation method of tight arrangement. After multiple modifications to the function blocks, it leads to multiple fragmented memories. When adding new function blocks, there is no suitable memory space available. In this embodiment, the capacity of each memory block is 4K bytes. As Figure 12 shown, the method of allocating memory in units of 4K bytes can effectively reduce the memory fragmentation problem compared with the tight arrangement memory allocation method. When adding new function blocks, there is still at least 4K of memory space available.

[0051] In the embodiment of the present application, the block call unit of each function block is 8 bytes, which includes 4 bytes of jump instructions and 4 bytes of preset addresses. All jump instructions and preset addresses form an address jump table. When initially constructing the address jump table, the preset addresses can be set randomly. The storage address of each block call unit in the controller memory space is also the block call address of each function block, and the block call unit can be called through the block call address.

[0052] S3. Independently encapsulate the logic of each function block, allocate corresponding memory blocks for it according to the logical length of the encapsulated function block, and construct an address management table based on the allocated memory addresses;

[0053] As Figure 3As shown, Function Block 1 occupies 2 memory blocks, and its memory address is Address 1. Function Block 2 occupies 2 memory blocks, and its memory address is Address 2. Function Block 3 occupies 3 memory blocks, and its memory address is Address 3.

[0054] As Figure 2 shown, the address management table includes function block identification codes, memory lengths, and corresponding memory addresses. As Figure 4 shown, it records Figure 3 the corresponding information of the three function blocks in

[0055] S4. Calculate the logical true address of each function block according to the offset between the memory address in step S3 and the logical entry address after encapsulation of the function block, and update the block call unit based on the logical true address;

[0056] Since the logical entry address of the encapsulated function block is not necessarily at the head address of the function block, but there may be a certain address offset. As Figure 5 shown, the logical true address of the function block is obtained by calculating the sum of the memory address of the function block and the offset of the logical entry address after encapsulation.

[0057] As Figure 6 shown, replace the preset address with the corresponding logical true address. In this application, the jump instruction of the function block and the logical true address are combined to form the call instruction of each function block. When the program is executed, the logical true address is no longer used, but the block call address corresponding to each block call unit is directly called. Through the jump instruction corresponding to the block call address, it jumps to the corresponding logical true address, realizing the function of calling the logical target of the function block.

[0058] S5. Download the updated block call unit in step S4 to the controller, and download the encapsulated function block logic to the controller according to the address management table in step S3;

[0059] After downloading the updated block call unit in step S4 to the controller in this application, the block call address corresponding to the block call unit remains unchanged.

[0060] S6. If the execution logic of the function block is modified, compare the logical length of the modified function block with the memory length allocated to the function block before modification. Determine whether to update the address management table and the block call unit according to the comparison result. If so, download the updated block call unit to the controller again, download the encapsulated function block logic again based on the updated address management table, and then call the function block based on the block call address corresponding to the block call unit. Otherwise, directly download the encapsulated function block logic again based on the address management table, and then call the function block based on the block call address corresponding to the block call unit;

[0061] If the logical length of the modified function block is not greater than the memory length allocated for the function block before, after the modified function block is encapsulated, the modified function block can be redownloaded to the original memory address. The address management table and the logical real address of the function block remain unchanged, and the address jump table is not updated. If the logical length of the modified function block is greater than the memory length allocated for the function block before, after the modified function block is re-encapsulated, the function block is redownloaded to the newly allocated memory address to store its logical data. Since the memory address changes, the logical real address changes, and the contents of the address management table and the address jump table need to be updated. This application only downloads the modified data and does not download the program that calls the function block, greatly reducing the download network load, and causing no disturbance to the engineering configuration that is already running on-site during the upgrade process, reducing the maintenance cost of the function block.

[0062] Figure 7 In the figure, after the function block 2 is modified, the logical length of the function block 2 increases, resulting in insufficient memory originally allocated. Therefore, a new memory address is allocated for it. As Figure 7 shown, both the memory address and the memory length of the function block 2 change. Figure 8 Based on Figure 7 to update the address management table. As Figure 9 shown, synchronously in the address jump table, the logical real address corresponding to the function block 2 is modified, while the block call address of the function block 2 remains unchanged. As Figure 10 shown, after the function block 2 is modified, although the memory occupation length of the function block 2 increases, the originally allocated memory is still sufficient. Therefore, the memory address is not re-allocated, and the address management table and the address jump table are neither updated nor redownloaded. Only the logic after the function block 2 is encapsulated needs to be downloaded.

[0063] When the function block modifies its logic, this application does not need to re-encapsulate all function blocks. Only the modified single function block needs to be encapsulated, improving the encapsulation efficiency. When the logical real address of the function block changes, if its logical real address is directly called, the program must also be modified and adapted. This application only needs to update the logical real address in the address jump table, and the block call address of the function block remains unchanged. The block call address of the function block called by the program remains unchanged, ensuring that only the modified function block and the address jump table need to be redownloaded to the controller, reducing the disturbance to other logics, reducing the amount of downloaded data, and realizing a fast and efficient modification, encapsulation, and download process.

[0064] The embodiment of this application also provides a system for incremental update of function block logic in an industrial control system, which is applied in a DCS (Distributed Control System) control system and includes:

[0065] Function block storage unit: used to respectively allocate corresponding logical entry addresses to the storage function blocks in the system, and encapsulate each function block;

[0066] Function block modification unit: connected to the function block storage unit, used to modify the logic of the function blocks stored in the function block storage unit;

[0067] Memory space management unit: used to construct block call units for implementing the call of each function block in the memory of the controller of the control system, respectively allocate corresponding memory spaces according to the logical lengths of each function block encapsulated by the function block storage unit, and construct an address management table according to the allocated memory addresses;

[0068] Update unit: used to calculate the logical real address of each function block based on the offset between the memory address allocated by the memory space management unit and the logical entry address of each function block encapsulated by the function block storage unit, and update the block call unit of the memory space management unit based on the logical real address;

[0069] Download unit: used to download the function blocks encapsulated by the function block storage unit to the controller according to the memory space allocated by the memory space management unit, and download the updated block call unit of the memory space management unit to the controller;

[0070] Function block call unit: used to call the corresponding function block based on the block call address of the block call unit constructed by the memory space management unit.

[0071] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for incrementally updating function block logic in an industrial control system, characterized in that: The steps include: S1, assign corresponding logical entry addresses to each functional block in the system; S2, constructs a block call unit in the controller memory for implementing each function block call; S3, allocating memory space to each functional block according to the logical length of the encapsulated functional block, and constructing an address management table based on the allocated memory addresses; S4, calculating the logical real address of each function block according to the memory address allocated in step S3 and the offset of the logical entry address after the function block is encapsulated, and updating the block calling unit based on the logical real address; S5, downloading the block calling unit updated in step S4 into the controller, and downloading the encapsulated function block logic into the controller according to the address management table constructed in step S3; S6, calling the function block based on the block calling address corresponding to the block calling unit.

2. The method for incrementally updating function block logic in an industrial control system according to claim 1, characterized in that: In step S2, before building the block calling unit, the memory space of the controller may be divided into a number of memory blocks of equal length, each of which has a capacity of 4K bytes.

3. The method for incrementally updating function block logic in an industrial control system according to claim 1, characterized in that: In step S2, the block calling unit includes a jump instruction and a preset address.

4. The method for incrementally updating function block logic in an industrial control system according to claim 3, characterized in that: In step S4, updating the block calling unit based on the logical real address refers to updating the preset address based on the logical real address, and the logical real address is obtained by calculating the sum of the memory address of the function block and the offset of the encapsulated logical entry address.

5. The method for incrementally updating function block logic in an industrial control system according to claim 1, characterized in that: The address management table includes a function block identification code, a memory length and a corresponding memory address.

6. The method for incrementally updating function block logic in an industrial control system according to claim 1, characterized in that: In step S6, before calling the function block based on the block calling address corresponding to the block calling unit, it is determined whether the execution logic of the function block is modified. If modified, steps ① and ② are executed in sequence. Otherwise, the corresponding function block is directly called based on the block calling address corresponding to the block calling unit. ① Compare the logic length of the modified function block with the memory length allocated to the function block before modification, and determine whether to update the address management table and the block call unit according to the comparison result. If so, re-download the updated block call unit and the encapsulated function block logic. Otherwise, re-download the encapsulated function block logic based on the address management table. ② Call the corresponding function block based on the block call address corresponding to the block call unit.