Data consistency method, device and computer readable storage medium

By mapping the data of multiple IEC tasks to a continuous physical address area and adopting an inter-task communication mechanism, the data consistency problem in the execution of multiple IEC tasks is solved, and the operation efficiency and system response are improved.

CN114741238BActive Publication Date: 2025-04-04BEIJING HELISHI SYST INTEGRATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210234001.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-10
Publication Date
2025-04-04
Estimated Expiration
2042-03-10

AI Technical Summary

Technical Problem

During the multi-IEC task execution, the prior art leads to data consistency problems, inefficiency and uncertainty, resulting in waste of processor resources and delayed system response.

Method used

Data consistency is achieved by mapping the data of each IEC task as a whole to a continuous physical address area and assigning a private IQ sub-region and an M-mapping area to each IEC task. At the same time, an inter-task communication mechanism is used to pass variable values ​​to ensure cross-task data sharing and consistency.

Benefits of technology

The consistency between private data and IQ area data when multiple IEC tasks are executed in parallel is achieved, which improves the operation efficiency of multi-tasks and avoids waste of processor resources and system response delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741238B_ABST
    Figure CN114741238B_ABST
Patent Text Reader

Abstract

The present application discloses a data consistency method, device and computer storable medium based on multiple IEC tasks, which are applied to a controller, including: receiving a configuration project downloaded to the controller through a download operation; wherein the configuration project includes multiple IEC tasks; mapping all data of each IEC task as a whole to a continuous physical address area; mapping data of different IEC tasks to different continuous physical address areas; the continuous physical address area is an area of ​​the non-addressable part of the user data area of ​​the controller. The method, device and computer storable medium can achieve the consistency of private data when multiple IEC tasks are executed in parallel, and improve the efficiency of multi-task operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial control, and in particular to a data consistency method, device and computer storable medium based on multiple IEC tasks. Background Art

[0002] Traditional controllers execute a single IEC task to achieve simple closed-loop control; with the technological upgrade and expansion of the scope of application of industrial sites, it is necessary to expand the single IEC task into multiple IEC tasks. In recent years, with the development of chip technology and embedded operating systems, some controllers have emerged that can execute multiple IEC tasks. However, due to the uniqueness of the data area and control objects associated with the configuration project, it is necessary to coordinate the mutually exclusive access of each IEC task to the data area (this process is collectively referred to as data consistency), resulting in reduced efficiency of multiple IEC task execution and many additional restrictions. The principle of multiple IEC task execution of conventional controllers is as follows: Figure 1 As shown, multiple IEC tasks access the same user data area. During the access period of each IEC task, other tasks are not allowed to access. Therefore, a mutual exclusion mechanism is needed to transform the execution period of each IEC task into a critical area.

[0003] There are two main problems with the current system:

[0004] (1) Multiple IEC tasks are processed serially at the micro level, which is inefficient

[0005] When multiple IEC tasks in the existing controller are executed, due to access to the user data area, the entire IEC task execution period is the critical area, and other IEC tasks can only wait. Although such a design is multiple IEC tasks at the macro level, it is actually queued execution at the micro level. A large amount of time slices are used to wait for the release of the critical area, which wastes processor resources and is inefficient. System trigger events cannot be processed in a timely and effective manner.

[0006] (2) There is uncertainty in the access of a single IEC task to the data area

[0007] Since each IEC task is executed serially, although the consistency of data is guaranteed after accessing the data area, the data area as a whole may be modified by other IEC tasks. The data collected from the field may be modified by other IEC tasks, or the data transmitted to the field unit may no longer be the calculation result of the IEC task. Summary of the invention

[0008] The present application provides a data consistency method, device and computer storable medium, which can achieve the consistency of private data when multiple IEC tasks are executed in parallel, thereby improving the multi-task operation efficiency.

[0009] The present application provides a data consistency method, which is applied to a controller, including:

[0010] Receiving a configuration project downloaded to the controller through a download operation; wherein the configuration project includes a plurality of IEC tasks;

[0011] All data of each IEC task are mapped as a whole to a continuous physical address area; data of different IEC tasks are mapped to different continuous physical address areas; the continuous physical address area is an area of ​​the non-addressable part of the user data area of ​​the controller.

[0012] In an exemplary embodiment, an IQ sub-area is allocated to each IEC task; wherein the IQ sub-area is formed by dividing the IQ area of ​​the addressable part of the user data area of ​​the controller according to the number of master cards and the size of the IQ area occupied by each master card; each IQ sub-area corresponds one-to-one to the master card corresponding to each IEC task.

[0013] In an exemplary embodiment, an M mapping area is allocated to each IEC task; the M mapping area is a mirror image of the M area of ​​the addressable part of the user data area of ​​the controller; each M mapping area corresponds to each preset M area index; the M area index is an index to the address segment of the M area occupied by the IEC task.

[0014] In an exemplary embodiment, when multiple IEC tasks reference variables across tasks during operation, the task communication table is parsed and the variable values ​​are transferred through the inter-task communication mechanism;

[0015] The task communication table is an access mapping table composed of variables accessed across IEC tasks when the configuration software compiles the configuration project.

[0016] In an exemplary embodiment, the name of the variable accessed across IEC tasks includes the task name.

[0017] In an exemplary embodiment, the inter-task communication mechanism includes the following operations:

[0018] Any IEC task sends a variable request message to another IEC task;

[0019] After receiving the message, if the requested variable is not in a modified state, the other IEC task sends the value of the requested variable to the requester as a response to the request message.

[0020] In an exemplary embodiment, when an IEC task is completed, the data of the M mapping area corresponding to the IEC task is saved to the corresponding physical address of the M area of ​​the controller.

[0021] In an exemplary embodiment, each IEC task is an IEC task that has undergone address conflict detection and conflict restriction in the M area of ​​the configuration software.

[0022] The present application provides a data consistency device, including a memory and a processor, including:

[0023] The memory is used to store a program for the data consistency method;

[0024] The processor is used to read and execute the program for the data consistency method, and perform the following operations:

[0025] Receiving a configuration project downloaded to the controller through a download operation; wherein the configuration project includes a plurality of IEC tasks;

[0026] All data of each IEC task are mapped as a whole to a continuous physical address area; data of different IEC tasks are mapped to different continuous physical address areas; the continuous physical address area is an area of ​​the non-addressable part of the user data area of ​​the controller.

[0027] In an exemplary embodiment, an IQ sub-area is allocated to each IEC task; wherein the IQ sub-area is formed by dividing the IQ area of ​​the addressable part of the user data area of ​​the controller according to the number of master cards and the size of the IQ area occupied by each master card; each IQ sub-area corresponds one-to-one to the master card corresponding to each IEC task.

[0028] In an exemplary embodiment, an M mapping area is allocated to each IEC task; the M mapping area is a mirror image of the M area of ​​the addressable part of the user data area of ​​the controller; each M mapping area corresponds to each preset M area index; the M area index is an index to the address segment of the M area occupied by the IEC task.

[0029] In an exemplary embodiment, when multiple IEC tasks reference variables across tasks during operation, the task communication table is parsed and the variable values ​​are transferred through the inter-task communication mechanism;

[0030] The task communication table is an access mapping table composed of variables accessed across IEC tasks when the configuration software compiles the configuration project.

[0031] In an exemplary embodiment, the name of the variable accessed across IEC tasks includes the task name.

[0032] In an exemplary embodiment, the inter-task communication mechanism includes the following operations:

[0033] Any IEC task sends a variable request message to another IEC task;

[0034] After receiving the message, if the requested variable is not in a modified state, the other IEC task sends the value of the requested variable to the requester as a response to the request message.

[0035] In an exemplary embodiment, when an IEC task is completed, the data of the M mapping area corresponding to the IEC task is saved to the corresponding physical address of the M area of ​​the controller.

[0036] In an exemplary embodiment, each IEC task is an IEC task that has undergone address conflict detection and conflict restriction in the M area of ​​the configuration software.

[0037] The present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following operations are implemented:

[0038] Receiving a configuration project downloaded to the controller through a download operation; wherein the configuration project includes a plurality of IEC tasks;

[0039] All data of each IEC task are mapped as a whole to a continuous physical address area; data of different IEC tasks are mapped to different continuous physical address areas; the continuous physical address area is an area of ​​the non-addressable part of the user data area of ​​the controller.

[0040] In an exemplary embodiment, an IQ sub-area is allocated to each IEC task; wherein the IQ sub-area is formed by dividing the IQ area of ​​the addressable part of the user data area of ​​the controller according to the number of master cards and the size of the IQ area occupied by each master card; each IQ sub-area corresponds one-to-one to the master card corresponding to each IEC task.

[0041] In an exemplary embodiment, an M mapping area is allocated to each IEC task; the M mapping area is a mirror image of the M area of ​​the addressable part of the user data area of ​​the controller; each M mapping area corresponds to each preset M area index; the M area index is an index to the address segment of the M area occupied by the IEC task.

[0042] In an exemplary embodiment, when multiple IEC tasks reference variables across tasks during operation, the task communication table is parsed and the variable values ​​are transferred through the inter-task communication mechanism;

[0043] The task communication table is an access mapping table composed of variables accessed across IEC tasks when the configuration software compiles the configuration project.

[0044] In an exemplary embodiment, the name of the variable accessed across IEC tasks includes the task name.

[0045] In an exemplary embodiment, the inter-task communication mechanism includes the following operations:

[0046] Any IEC task sends a variable request message to another IEC task;

[0047] After receiving the message, if the requested variable is not in a modified state, the other IEC task sends the value of the requested variable to the requester as a response to the request message.

[0048] In an exemplary embodiment, when an IEC task is completed, the data of the M mapping area corresponding to the IEC task is saved to the corresponding physical address of the M area of ​​the controller.

[0049] In an exemplary embodiment, each IEC task is an IEC task that has undergone address conflict detection and conflict restriction in the M area of ​​the configuration software.

[0050] This application includes the following advantages:

[0051] At least one embodiment of the present application can simultaneously achieve the consistency of private data of multiple IEC tasks, thereby improving the operating efficiency of multiple tasks.

[0052] In one implementation of the embodiment of the present application, the consistency of private data and IQ area data can be achieved when multiple IEC tasks are executed in parallel, thereby improving the operating efficiency of multiple tasks.

[0053] In one implementation of the embodiment of the present application, data consistency of operations on the user data area can be achieved when multiple IEC tasks are executed in parallel, thereby improving the operating efficiency of multiple tasks.

[0054] In one implementation of the embodiment of the present application, data consistency of operations on the user data area can be achieved when multiple IEC tasks are executed in parallel, while the access method of a controller outside a certain controller to the controller is not changed.

[0055] In one implementation of the embodiment of the present application, cross-task data sharing is achieved.

[0056] Of course, any product implementing the present application does not necessarily need to achieve all of the advantages described above at the same time.

[0057] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0059] Figure 1 It is a functional block diagram of multiple IEC tasks in the prior art;

[0060] Figure 2 A flowchart of a data consistency method according to an embodiment of the present application;

[0061] Figure 3 A schematic diagram of a multi-IEC task system according to an embodiment of the present application;

[0062] Figure 4 A schematic diagram of a multi-IEC task system architecture according to an embodiment of the present application;

[0063] Figure 5 Schematic diagram of a data consistency device according to an embodiment of the present application. DETAILED DESCRIPTION

[0064] Figure 2 Flow chart of the data consistency method of the embodiment of the present application, such as Figure 2 As shown, the data consistency method of this embodiment includes steps S21-S22:

[0065] S21, receiving the configuration project downloaded to the controller through the download operation;

[0066] S22, mapping all data of each IEC task as a whole to a continuous physical address area;

[0067] In an exemplary embodiment, the configuration project includes a plurality of IEC tasks.

[0068] IEC tasks refer to tasks used to execute user-configurable projects in a programmable logic controller (hereinafter referred to as the controller). They comply with the programming specifications of the International Electrotechnical Commission IEC61131-3 standard and are referred to as IEC tasks.

[0069] Configuration software refers to a software installed on a personal computer that can compile and generate user-configurable projects (hereinafter referred to as configuration projects), configure the form and parameters of the controller system, and monitor the operation status of the configuration project online.

[0070] Download operation refers to the configuration software downloading the configuration project to the controller through the serial port or Ethernet, and providing the controller software scheduling interface, referred to as downloading.

[0071] The controller runs background management tasks and IEC tasks. The background management tasks are automatically scheduled based on the embedded hardware and software platform. The execution of IEC tasks, while complying with the embedded hardware and software platform, also requires coordination of the reading and modification of the user data area (hereinafter referred to as the data area) of the configuration project to ensure reliable detection and control of devices other than the controller.

[0072] The control network master card refers to the software and hardware module responsible for collecting, managing and controlling the information of peripheral input and output devices under the industrial field bus protocol. It communicates with the controller through the internal protocol and communicates with the peripheral input and output devices through the specified industrial field bus. It is hereinafter referred to as the master card.

[0073] In an exemplary embodiment, the controller software maps all data of each IEC task to a continuous physical address area according to the configuration form and parameters.

[0074] In an exemplary embodiment, an IQ sub-area is allocated to each IEC task; wherein the IQ sub-area is formed by dividing the IQ area of ​​the addressable part of the user data area of ​​the controller according to the number of master cards and the size of the IQ area occupied by each master card; each IQ sub-area corresponds one-to-one to the master card corresponding to each IEC task.

[0075] In an exemplary embodiment, an M mapping area is allocated to each IEC task; the M mapping area is a mirror image of the M area of ​​the addressable part of the user data area of ​​the controller; each M mapping area corresponds to each preset M area index; the M area index is an index to the address segment of the M area occupied by the IEC task.

[0076] For example, when a user operates the configuration software on a personal computer, a certain IEC task uses an M area variable for programming, and the address bound to the variable is the corresponding index of the M area. When the configured project is downloaded to the controller, the controller software allocates an M mapping area in the memory for each task, and the physical address of the mapping area corresponds to the M area index referenced in the configuration stage.

[0077] In an exemplary embodiment, when multiple IEC tasks reference variables across tasks during operation, the task communication table is parsed and the variable values ​​are transferred through the inter-task communication mechanism;

[0078] The task communication table is an access mapping table composed of variables accessed across IEC tasks when the configuration software compiles the configuration project.

[0079] In an exemplary embodiment, the name of the variable accessed across IEC tasks includes the task name.

[0080] In an exemplary embodiment, the inter-task communication mechanism includes the following operations:

[0081] One IEC task sends a variable request message to another IEC task;

[0082] After receiving the message, if the requested variable is not in a modified state, the other IEC task sends the value of the requested variable to the requester as a response to the request message.

[0083] In an exemplary embodiment, when an IEC task is completed, the data of the M mapping area corresponding to the IEC task is saved to the corresponding physical address of the M area of ​​the controller.

[0084] In an exemplary embodiment, each IEC task is an IEC task that has undergone address conflict detection and conflict restriction in the M area of ​​the configuration software.

[0085] The embodiments of the present application include the following advantages:

[0086] At least one embodiment of the present application can simultaneously achieve the consistency of private data of multiple IEC tasks, thereby improving the operating efficiency of multiple tasks.

[0087] In one implementation of the embodiment of the present application, the consistency of private data and IQ area data can be achieved when multiple IEC tasks are executed in parallel, thereby improving the operating efficiency of multiple tasks.

[0088] In one implementation of the embodiment of the present application, data consistency of operations on the user data area can be achieved when multiple IEC tasks are executed in parallel, thereby improving the operating efficiency of multiple tasks.

[0089] In one implementation of the embodiment of the present application, data consistency of operations on the user data area can be achieved when multiple IEC tasks are executed in parallel, while the access method of a controller outside a certain controller to the controller is not changed.

[0090] In one implementation of the embodiment of the present application, cross-task data sharing is achieved.

[0091] Of course, any product implementing the present application does not necessarily need to achieve all of the advantages described above at the same time.

[0092] Figure 3 is a schematic diagram of a multi-tasking system according to an embodiment of the present application, such as Figure 3 As shown, the functions of the configuration software running in the personal computer are ① user programming and configuration part; ② configuration compilation part and ③ configuration downloading and monitoring part.

[0093] The software running in the controller is divided into multiple IEC tasks, download parsing tasks, data area management tasks and background management tasks.

[0094] The user data area of ​​the controller can be divided into two categories:

[0095] (1) Non-addressable part:

[0096] The non-addressable part of the user data area refers to the data part used for internal calculation of the IEC task inside the controller. This part of the data is not used for external output, so it has no direct connection with the field IO device. Based on this feature, this solution adopts the data area address space mapping method, which only maps the data area used by the specified IEC task to the real user data area physical address area. Its internal address connection is maintained by the controller background task, without exposing details to the outside of the controller, and does not interfere with the user's configuration work.

[0097] (2) Addressable part:

[0098] The addressable part includes the input and output area of ​​the user data area (hereinafter referred to as the IQ area) and the intermediate addressable variable area of ​​the user data area (hereinafter referred to as the M area). The IQ area is used to map the field IO devices, and the M area is used to specify the field bus communication.

[0099] In the multi-IEC task implementation scheme, task execution itself is based on the existing technology of embedded software and hardware platform, and data consistency guarantee is the key implementation part of this scheme, which includes the above two user data area consistency guarantee schemes (1) and (2) to achieve efficient and reliable operation of the controller under multi-IEC tasks.

[0100] Figure 4 For the multi-IEC task system architecture of the embodiment of the present application, the implementation of the consistency solution for the two data areas of the user data area (1) and (2) is described as follows:

[0101] (1) Mapping method of the non-addressable part of the user data area:

[0102] The non-addressable data area is private to each IEC task and is organized and compiled by the configuration software. After being downloaded to the controller, during the initial parsing, the controller software maps the private data area to the actual memory area based on the task data area statistics table downloaded by the configuration software, physically isolating the addresses and preventing them from interfering with each other. This mapping method uses the size of the private data area occupied by the IEC task as the minimum unit and performs an overall linear mapping with the actual physical memory in a one-to-one correspondence.

[0103] (2) Division method of the addressable part of the user data area:

[0104] (a) IQ zone division method.

[0105] In a typical industrial site control model, a single master card controls one or more groups of interrelated peripheral input and output devices, which requires determinism of timing and sequence, and prohibits parallel execution. However, multiple groups of peripheral input and output devices controlled by multiple master cards can be executed in parallel, and the information is unrelated.

[0106] In this scenario, the unified IQ area can be divided into multiple IQ sub-areas, corresponding to multiple main cards, which are physically isolated and do not interfere with each other. This division method is determined by the configuration software according to the user configuration form during static compilation, where the configuration form means that the configuration software automatically calculates the size of the IQ area occupied by the main card according to the main card configured by the user for the IEC task, thereby providing a basis for the IQ area division. When parsing for the first time after downloading, address association is performed inside the controller, and they are independent of each other when periodically controlling peripheral input and output devices.

[0107] (b) Division method of M area.

[0108] The data in zone M has no direct association with the main card and is used to temporarily store the intermediate status of IEC task operations. However, it can be accessed by external industrial fieldbus protocols through relative addressing.

[0109] For the external industrial fieldbus protocol, there is only one unified M zone, which does not distinguish the relationship between internal IEC tasks. Therefore, the M zone division method under the scenario requirements is as follows:

[0110] When the configuration software is performing user programming, the M area address is accessed by relative addressing;

[0111] During the configuration software compilation phase, multiple IEC tasks are checked to detect and limit conflicts in M-area addresses;

[0112] The controller reserves an independent M-area physical address for each IEC task, which is defined as the M mapping area;

[0113] The controller data area management mechanism updates the independent M mapping area content of the IEC task to the unified M area address of the controller after each IEC task is completed.

[0114] (3) Data sharing between tasks.

[0115] (a) Data sharing without data consistency requirements:

[0116] When defining global variables, specify the task to which they belong, indicating that the index of the variable to be changed belongs to a certain task for resolution; all tasks have free access.

[0117] (b) Data sharing with data consistency requirements:

[0118] When the user designs the project, it directly accesses it through the "task name.variable name" method. However, when it is compiled through the configuration software, the variable objects accessed across tasks are parsed into an access mapping table, called the task communication table, which is downloaded to the controller through the project. When the controller loads the project, it parses the task communication table, and when multiple tasks are running and referencing it, the variable values ​​are passed through the inter-task communication mechanism within the controller.

[0119] Based on the above design, the variable address in the user data area can be regarded as the virtual index address of the user IEC task rather than the actual physical address, and the address correspondence can be achieved through the above method.

[0120] This solution retains the data consistency of existing multiple IEC tasks and adopts data area mapping and partitioning technology to decouple the resource waste of waiting in critical areas between tasks, improve the utilization rate of the controller's central processor, simplify the overall system hardware architecture, and reduce equipment and engineering costs;

[0121] This scheme aims at the access mechanism of the M zone to the specified field bus, and proposes the design idea of ​​"everything is indexed" in the data zone of the programmable controller field, eliminating the limitation of the traditional physical address binding user IEC task in the M zone design.

[0122] Figure 5 Schematic diagram of a data consistency device according to an embodiment of the present application. Figure 5 As shown, a data consistency device includes a memory and a processor, including:

[0123] The memory is used to store a program for the data consistency method;

[0124] The processor is used to read and execute the program for the data consistency method based on multiple IEC tasks, and execute the data consistency method.

[0125] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0126] Any features shown and / or discussed in this application may be implemented alone or in any appropriate combination.

[0127] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of steps described herein, the method or process should not be limited to the steps in the specific order described. As will be appreciated by those of ordinary skill in the art, other sequences of steps are also possible.

[0128] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A data consistency method, applied to a controller, characterized in that: Receiving a configuration project downloaded to the controller through a download operation; wherein the configuration project includes a plurality of IEC tasks; Mapping all data of each IEC task as a whole to a continuous physical address area; mapping data of different IEC tasks to different continuous physical address areas; the different continuous physical address areas are physically isolated from each other; the continuous physical address area is an area of ​​the non-addressable part of the user data area of ​​the controller; the non-addressable part of the user data area refers to the data part inside the controller used for internal calculation of the IEC task; the non-addressable part of the user data area is private to each IEC task; An IQ sub-area is allocated to each IEC task; wherein the IQ sub-area is formed by dividing the IQ area of ​​the addressable part of the user data area of ​​the controller according to the number of master cards and the size of the IQ area occupied by each master card; each IQ sub-area corresponds to the master card corresponding to each IEC task one by one; the IQ area is an input and output area of ​​the user data area, which is used to map the field IO device; An M mapping area is allocated to each IEC task; the M mapping area is a mirror image of the M area of ​​the addressable part of the user data area of ​​the controller; each M mapping area corresponds to each preset M area index; the M area index is an index to the address segment of the M area occupied by the IEC task; the M area is an intermediate addressable variable area of ​​the user data area, which is used to temporarily store the intermediate state of the IEC task operation and to specify the field bus communication.

2. The method of claim 1, further comprising: When multiple IEC tasks reference variables across tasks during operation, the task communication table is parsed and the variable values ​​are transferred through the inter-task communication mechanism; The task communication table is an access mapping table composed of variables accessed across IEC tasks when the configuration software compiles the configuration project.

3. The method of claim 2, comprising: The name of the variable accessed across IEC tasks includes the task name.

4. The method of claim 2, comprising: The inter-task communication mechanism includes the following operations: Any IEC task sends a variable request message to another IEC task; After receiving the message, if the requested variable is not in a modified state, the other IEC task sends the value of the requested variable to the requester as a response to the request message.

5. The method of claim 1, comprising: When the operation of an IEC task is completed, the data of the M mapping area corresponding to the IEC task is saved to the corresponding physical address of the M area of ​​the controller.

6. The method of claim 1, comprising: Each IEC task is an IEC task that has undergone address conflict detection and conflict restriction in the M area of ​​the configuration software.

7. A data consistency device, comprising a memory and a processor, characterized in that: The memory is used to store a program for the data consistency method; The processor is used to read and execute the program for the data consistency method, and execute the data consistency method as described in any one of claims 1-6.

8. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data consistency method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Remote monitoring method for numerical control system based on Modbus

    CN108021096A

  • Debugging system and method

    US20070061627A1