Method and device for managing logic blocks in industrial controller

文档序号:134482 发布日期:2021-10-22 浏览:12次 中文

阅读说明:本技术 工业控制器中管理逻辑块的方法和装置 (Method and device for managing logic blocks in industrial controller ) 是由 苏玉琰 吕大军 李文 王兆丰 邢聪聪 王朝辉 安平 于 2020-04-16 设计创作,主要内容包括:本申请实施例公开了一种工业控制器中管理逻辑块的方法和装置。所述方法包括:获取工业控制器中内部逻辑符合预设的保密判断条件的自定义逻辑块;从预先存储的逻辑块中,确定用于实现所述自定义逻辑块的功能的至少一个目标逻辑块;在预先设置的逻辑页中对至少一个目标逻辑块进行组态操作,得到自定义逻辑块。(The embodiment of the application discloses a method and a device for managing logic blocks in an industrial controller. The method comprises the following steps: acquiring a custom logic block of which the internal logic accords with a preset secrecy judgment condition in the industrial controller; determining at least one target logic block for realizing the functions of the self-defined logic block from pre-stored logic blocks; and carrying out configuration operation on at least one target logic block in a preset logic page to obtain a user-defined logic block.)

1. A method of managing logic blocks in an industrial controller, comprising:

acquiring a custom logic block of which the internal logic accords with a preset secrecy judgment condition in the industrial controller;

determining at least one target logic block for realizing the functions of the self-defined logic block from pre-stored logic blocks;

and carrying out configuration operation on at least one target logic block in a preset logic page to obtain a user-defined logic block.

2. The method of claim 1, wherein after the configuring operation is performed on at least one logic block in the preset logic page to obtain the custom logic block, the method further comprises:

carrying out configuration operation by utilizing the user-defined logic block and the logic block acquired in advance to obtain a complete target file of the internal logic of the industrial controller;

executing the complete target file in the industrial controller.

3. The method of claim 2, wherein:

after the configuring operation is performed on at least one target logic block in the preset logic page to obtain the self-defined logic block, the method further includes:

acquiring a target file corresponding to the user-defined logic block, and storing the target file into the industrial controller;

generating control information for calling the custom logic block from the industrial controller;

the obtaining of the complete target file of the internal logic of the industrial controller by using the user-defined logic block and the pre-obtained logic block for configuration operation includes:

acquiring a target file corresponding to the logic block and control information of the user-defined logic block;

and generating a completion target file of the internal logic of the industrial controller by using the target file corresponding to the logic block and the control information of the self-defined logic block.

4. The method of claim 3, wherein generating control information to invoke the custom logic block from the industrial controller comprises:

configuring a target file corresponding to the user-defined logic block as a function of a preset calling library in the industrial controller;

control information for calling the function from the industrial controller is generated.

5. The method of claim 3 or 4, wherein said executing the complete object file in the industrial controller comprises:

when the complete target file is analyzed, if the complete target file is detected not to include the target file of the logic block to be executed, acquiring the control information of the logic block to be executed;

acquiring a target file of the logic block to be executed from the industrial controller according to the control information;

creating a new logical page corresponding to the target file of the logical block to be executed on the logical page executing the complete target file;

and processing the target file of the logic block to be executed on the newly created logic page.

6. An apparatus for managing logic blocks in an industrial controller, comprising:

the acquisition module is used for acquiring a custom logic block of which the internal logic in the industrial controller meets a preset secrecy judgment condition;

the determining module is used for determining at least one target logic block for realizing the functions of the self-defined logic block from the pre-stored logic blocks;

and the management module is used for carrying out configuration operation on at least one target logic block in a preset logic page to obtain a self-defined logic block.

7. The apparatus of claim 6, further comprising:

the configuration module is used for carrying out configuration operation by utilizing the custom logic block and the logic block obtained in advance after the custom logic block is obtained, so as to obtain a complete target file of the internal logic of the industrial controller;

an execution module to execute the complete target file in the industrial controller.

8. The apparatus of claim 7, wherein:

the device further comprises:

the storage module is used for acquiring a target file corresponding to a custom logic block after the custom logic block is obtained and storing the target file into the industrial controller;

the generation module is used for generating control information for calling the custom logic block from the industrial controller;

the configuration module includes:

a first obtaining unit, configured to obtain a target file corresponding to the logic block and control information of the custom logic block;

and the first generating unit is used for generating a completion target file of the internal logic of the industrial controller by using the target file corresponding to the logic block and the control information of the self-defined logic block.

9. The apparatus of claim 8, wherein the execution module comprises:

a second obtaining unit, configured to, when the complete target file is analyzed, if it is detected that the complete target file does not include a target file of a logic block to be executed, obtain control information of the logic block to be executed;

a third obtaining unit, configured to obtain, according to the control information, a target file of the to-be-executed logical block from the industrial controller;

a creating unit, configured to create, on a logical page where the complete target file is executed, a new logical page corresponding to the target file of the to-be-executed logical block;

and the processing unit is used for processing the target file of the logic block to be executed on the newly created logic page.

10. A computer storage medium comprising a processor and a memory, the memory storing a computer program, the processor being configured to invoke the computer program to implement the method of any of claims 1 to 5.

Technical Field

The present disclosure relates to the field of information processing, and more particularly, to a method and apparatus for managing logic blocks in an industrial controller.

Background

In industrial control, engineering implementers use a function block diagram to combine specific logic blocks, configure the logic blocks into a plurality of logic pages, and then download the logic pages into a controller, and the controller executes specific codes according to the function blocks in the logic pages to realize logic.

For internal logic in an industrial controller, part of the control logic is expected to be provided for others to use as a whole, but does not want to expose the internal logic, and a way of customizing logic blocks is proposed. The user-defined logic block is used as an independently developed function block, can integrally realize a specific function, and is an independent function block, so that the internal logic of the self-defined logic block is invisible.

In the related art, the development difficulty of the custom logic block is high, and therefore, how to reduce the development difficulty of the custom logic block is an urgent problem to be solved.

Disclosure of Invention

In order to solve any technical problem, embodiments of the present application provide a method and an apparatus for managing a logic block in an industrial controller.

To achieve the purpose of the embodiments of the present application, the embodiments of the present application provide a method for managing logic blocks in an industrial controller, including:

acquiring a custom logic block of which the internal logic accords with a preset secrecy judgment condition in the industrial controller;

determining at least one target logic block for realizing the functions of the self-defined logic block from pre-stored logic blocks;

and carrying out configuration operation on at least one target logic block in a preset logic page to obtain a user-defined logic block.

In an exemplary embodiment, after the configuring operation is performed on at least one logic block in the preset logic page to obtain the custom logic block, the method further includes:

carrying out configuration operation by utilizing the user-defined logic block and the logic block acquired in advance to obtain a complete target file of the internal logic of the industrial controller;

executing the complete target file in the industrial controller.

In an exemplary embodiment, after the configuring operation is performed on at least one target logical block in the preset logical page to obtain the custom logical block, the method further includes:

acquiring a target file corresponding to the user-defined logic block, and storing the target file into the industrial controller;

generating control information for calling the custom logic block from the industrial controller;

the obtaining of the complete target file of the internal logic of the industrial controller by using the user-defined logic block and the pre-obtained logic block for configuration operation includes:

acquiring a target file corresponding to the logic block and control information of the user-defined logic block;

and generating a completion target file of the internal logic of the industrial controller by using the target file corresponding to the logic block and the control information of the self-defined logic block.

In an exemplary embodiment, the generating control information to invoke the custom logic block from the industrial controller includes:

configuring a target file corresponding to the user-defined logic block as a function of a preset calling library in the industrial controller;

control information for calling the function from the industrial controller is generated.

In an exemplary embodiment, said executing said complete object file in said industrial controller comprises:

when the complete target file is analyzed, if the complete target file is detected not to include the target file of the logic block to be executed, acquiring the control information of the logic block to be executed;

acquiring a target file of the logic block to be executed from the industrial controller according to the control information;

creating a new logical page corresponding to the target file of the logical block to be executed on the logical page executing the complete target file;

and processing the target file of the logic block to be executed on the newly created logic page.

An apparatus for managing logic blocks in an industrial controller, comprising:

the acquisition module is used for acquiring a custom logic block of which the internal logic in the industrial controller meets a preset secrecy judgment condition;

the determining module is used for determining at least one target logic block for realizing the functions of the self-defined logic block from the pre-stored logic blocks;

and the management module is used for carrying out configuration operation on at least one target logic block in a preset logic page to obtain a self-defined logic block.

In one exemplary embodiment, the apparatus further comprises:

the configuration module is used for carrying out configuration operation by utilizing the custom logic block and the logic block obtained in advance after the custom logic block is obtained, so as to obtain a complete target file of the internal logic of the industrial controller;

an execution module to execute the complete target file in the industrial controller.

In one exemplary embodiment, the apparatus further comprises:

the storage module is used for acquiring a target file corresponding to a custom logic block after the custom logic block is obtained and storing the target file into the industrial controller;

the generation module is used for generating control information for calling the custom logic block from the industrial controller;

the configuration module includes:

a first obtaining unit, configured to obtain a target file corresponding to the logic block and control information of the custom logic block;

and the first generating unit is used for generating a completion target file of the internal logic of the industrial controller by using the target file corresponding to the logic block and the control information of the self-defined logic block.

In one exemplary embodiment, the execution module includes:

a second obtaining unit, configured to, when the complete target file is analyzed, if it is detected that the complete target file does not include a target file of a logic block to be executed, obtain control information of the logic block to be executed;

a third obtaining unit, configured to obtain, according to the control information, a target file of the to-be-executed logical block from the industrial controller;

a creating unit, configured to create, on a logical page where the complete target file is executed, a new logical page corresponding to the target file of the to-be-executed logical block;

and the processing unit is used for processing the target file of the logic block to be executed on the newly created logic page.

A computer storage medium comprising a processor and a memory, the memory storing a computer program, the processor to invoke the computer program to implement the method of any of the above.

According to the embodiment provided by the application, the user-defined logic block of which the internal logic accords with the preset secrecy judgment condition in the industrial controller is obtained, at least one target logic block for realizing the function of the user-defined logic block is determined from the pre-stored logic blocks, and the configuration operation is carried out on the at least one target logic block in the preset logic page to obtain the user-defined logic block, so that the packaging of the user-defined logic block is completed by utilizing a graphical configuration mode, the development difficulty of the user-defined logic block is reduced, and the development efficiency is improved.

Additional features and advantages of the embodiments of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the application. The objectives and other advantages of the embodiments of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

Drawings

The accompanying drawings are included to provide a further understanding of the embodiments of the present application and are incorporated in and constitute a part of this specification, illustrate embodiments of the present application and together with the examples of the embodiments of the present application do not constitute a limitation of the embodiments of the present application.

FIG. 1 is a flow chart of a method for managing logic blocks in an industrial controller provided by an embodiment of the present application;

FIG. 2 is a schematic diagram of generating a custom logic block according to an embodiment of the present application;

FIG. 3 is a schematic diagram illustrating the configuration operations of custom logic and existing logic blocks provided herein;

fig. 4 is a block diagram of an apparatus for managing logic blocks in an industrial controller according to an embodiment of the present disclosure.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the embodiments of the present application, features in the embodiments and the examples may be arbitrarily combined with each other without conflict.

Fig. 1 is a flowchart of a method for managing logic blocks in an industrial controller according to an embodiment of the present disclosure.

The method shown in fig. 1, comprising:

step 101, obtaining a custom logic block of which the internal logic in the industrial controller meets a preset secrecy judgment condition;

in an exemplary embodiment, part of the control logic in the industrial control is provided for others to use as a whole, and part of the internal logic cannot be exposed due to confidentiality, so that design consideration can be given to the confidentiality, and a judgment condition for confidentiality can be set for the internal logic. And analyzing and determining the logic for keeping the internal logic secret by knowing a preset secret judgment condition, and taking the logic as a self-defined logic block.

102, determining at least one target logic block for realizing the function of the self-defined logic block from prestored logic blocks;

in the related art, the custom logic block is realized through a programming language, and then a dynamic link library is directly generated and called by a controller. The scheme has higher requirements on logic designers, requires the logic designers to have programming capability and has higher development difficulty. Different from the related technology, the method determines the composition of the function of the self-defining module, matches the function with the function of the existing logic block, and determines which logic blocks can be combined to realize the function of the self-defining module, namely determines at least one target logic block for realizing the function of the self-defining logic block, reduces the development difficulty of the self-defining logic block by means of the function of the existing logic block, and fully utilizes the existing logic block.

And 103, carrying out configuration operation on at least one target logic block in a preset logic page to obtain a custom logic block.

In an exemplary embodiment, the deployment of the functions of the target logic block is completed by means of a graphical management mechanism in the logic page, the control of input operation and output operation is realized, the function of the custom logic block is realized, and the requirements of a logic designer are reduced.

According to the method provided by the embodiment of the application, the user-defined logic block of which the internal logic accords with the preset secrecy judgment condition in the industrial controller is obtained, at least one target logic block for realizing the function of the user-defined logic block is determined from the pre-stored logic blocks, and the configuration operation is carried out on the at least one target logic block in the preset logic page to obtain the user-defined logic block, so that the packaging of the user-defined logic block is completed by utilizing a graphical configuration mode, the development difficulty of the user-defined logic block is reduced, and the development efficiency is improved.

The method provided by the embodiments of the present application is explained as follows:

in an exemplary embodiment, after the configuring operation is performed on at least one logic block in the preset logic page to obtain the custom logic block, the method further includes:

carrying out configuration operation by utilizing the user-defined logic block and the logic block acquired in advance to obtain a complete target file of the internal logic of the industrial controller;

executing the complete target file in the industrial controller.

Configuring the user-defined logic block and the common logic block together to generate a complete logic page; and downloading the target file of the logical page to the industrial controller, and executing the target file to realize the required functions.

In an exemplary embodiment, after the configuring operation is performed on at least one target logical block in the preset logical page to obtain the custom logical block, the method further includes:

acquiring a target file corresponding to the user-defined logic block, and storing the target file into the industrial controller;

generating control information for calling the custom logic block from the industrial controller;

the obtaining of the complete target file of the internal logic of the industrial controller by using the user-defined logic block and the pre-obtained logic block for configuration operation includes:

acquiring a target file corresponding to the logic block and control information of the user-defined logic block;

and generating a completion target file of the internal logic of the industrial controller by using the target file corresponding to the logic block and the control information of the self-defined logic block.

In the related art, a source file of a packaged logical block is directly in an object file of a compiled logical page, and when a logical graph includes a plurality of repeated self-defined functional blocks, the object file of the logical page becomes very large, which affects execution efficiency. The difference with the related technology is that the target file is generated by the self-defined function block and downloaded to the controller to be used as a callable library, only the identification of the self-defined function block is stored in the common logic diagram to call the target file of the self-defined logic block from the library, so that the problem of expansion of the target file of the common logic diagram can be avoided, and meanwhile, the confidentiality requirement of logic internal implementation is met because only the target file is needed by using the self-defined function block.

When the target file of the complete logical page of the industrial controller is generated, the complete target file only comprises the target file of the common logical block and does not comprise the target file of the custom logical block, so that the data volume of the complete target file corresponding to the complete logical page is effectively reduced, and the occurrence probability of file expansion is reduced; in addition, by means of the control information, the user-defined logic block can be accurately called when the user-defined logic block is executed, and the execution of the target file of the user-defined logic is ensured.

In an exemplary embodiment, the generating control information to invoke the custom logic block from the industrial controller includes:

configuring a target file corresponding to the user-defined logic block as a function of a preset calling library in the industrial controller;

control information for calling the function from the industrial controller is generated.

The calling library can adopt a link calling library to realize the calling of the target file of the custom logic block, and the aim of calling the target file of the custom logic block by using the identification information is realized by setting the corresponding relation between the target file of the custom logic block and the preset identification information.

In an exemplary embodiment, said executing said complete object file in said industrial controller comprises:

when the complete target file is analyzed, if the complete target file is detected not to include the target file of the logic block to be executed, acquiring the control information of the logic block to be executed;

acquiring a target file of the logic block to be executed from the industrial controller according to the control information;

creating a new logical page corresponding to the target file of the logical block to be executed on the logical page executing the complete target file;

and processing the target file of the logic block to be executed on the newly created logic page.

And simultaneously downloading the target files of the logic page and the custom logic block to the controller, calling the target file of the custom logic block when the controller executes the custom logic block in the logic page, generating a virtual logic page in the memory, and executing.

The method provided by the embodiments of the present application is explained as follows:

the method for managing the logic blocks in the industrial controller provided by the embodiment of the application comprises the following steps:

step A01, configuring the logic blocks acquired in advance to obtain custom logic blocks;

the logic block is pre-stored, configured by using the logic block, and packaged into a self-defined logic block.

Fig. 2 is a schematic diagram of generating a custom logic block according to an embodiment of the present application. In the schematic diagram shown in fig. 2, a logic block 1 for implementing function 1, a logic block 2 for implementing function 2, a logic block 3 for implementing function 3, and a logic block for implementing function 4 are called, and the connection relationship among the logic blocks is that the logic block 1, the logic block 2, and the logic block 3 are all connected to the logic block 4, where input data of the logic block 1 is input 1, input data of the logic block 2 is input 1 and input 2, input data of the logic block 3 is input 2, input data of the logic block 4 is output data of the logic block 1, the logic block 2, and the logic block 3, output data of the logic block is output of the custom logic module, and output data is output 1.

As can be seen from fig. 2, by means of graphical management of the logic blocks in the logic page, the generation operation of the custom logic block can be efficiently completed, the development efficiency of the custom logic block is improved, and the development difficulty is reduced.

A02, acquiring a target file of the custom logic block;

packaging the configured custom logic block into a logic block, realizing that the custom logic block can realize the logic block of the custom function 1, and acquiring data for realizing the custom function 1;

and step A03, generating the required functions in the industrial controller by utilizing the self-defined logic blocks and the logic blocks acquired in advance.

And configuring the self-defined logic block and the existing logic block together to generate a complete logic page target file.

Fig. 3 is a schematic diagram illustrating configuration operations of custom logic and existing logic blocks provided by the present application. As shown in fig. 3, the configuration of the custom logic block 1, the logic block 5 for implementing the function 5, and the logic block 6 for implementing the function 6 is defined, wherein the logic block 5 and the logic block 6 are both existing logic blocks; in practical applications, the custom logic block 1 may also be configured with other custom logic blocks, such as the custom logic block 2.

After the arrangement and deployment operations of the logic blocks and the configuration operations of the input data and the output data are completed, the setting of the function blocks of the logic pages can be obtained, the logic pages and the target files of the custom logic blocks can be downloaded to the controller at the same time, and when the controller executes the custom logic blocks in the logic pages, the target files of the custom logic blocks are called, and virtual logic pages are generated in the memory and executed.

According to the method provided by the embodiment of the application, the existing logic blocks are configured to form the new relatively independent function blocks, then the function blocks are packaged to generate the target file of the function blocks, the target file is externally represented as a new self-defined logic block and can be used in a common logic diagram, and when the logic diagram is downloaded to a controller, the target file of the function blocks is downloaded to the controller to serve as a library file called by the logic blocks, so that the execution of the target file of the self-defined logic block is realized.

Fig. 4 is a block diagram of an apparatus for managing logic blocks in an industrial controller according to an embodiment of the present disclosure.

The apparatus of fig. 4, comprising:

an obtaining module 401, configured to obtain a custom logic block in the industrial controller, where an internal logic of the custom logic block meets a preset secrecy determination condition;

a determining module 402, configured to determine, from pre-stored logic blocks, at least one target logic block for implementing the function of the custom logic block;

the management module 403 is configured to perform configuration operation on at least one target logic block in a preset logic page to obtain a custom logic block.

In one exemplary embodiment, the apparatus further comprises:

the configuration module is used for carrying out configuration operation by utilizing the custom logic block and the logic block obtained in advance after the custom logic block is obtained, so as to obtain a complete target file of the internal logic of the industrial controller;

an execution module to execute the complete target file in the industrial controller.

In one exemplary embodiment, the apparatus further comprises:

the storage module is used for acquiring a target file corresponding to a custom logic block after the custom logic block is obtained and storing the target file into the industrial controller;

the generation module is used for generating control information for calling the custom logic block from the industrial controller;

the configuration module includes:

a first obtaining unit, configured to obtain a target file corresponding to the logic block and control information of the custom logic block;

and the first generating unit is used for generating a completion target file of the internal logic of the industrial controller by using the target file corresponding to the logic block and the control information of the self-defined logic block.

In one exemplary embodiment, the generating module includes:

the configuration unit is used for configuring the target file corresponding to the user-defined logic block as a function of a preset calling library in the industrial controller;

a second generating unit for generating control information for calling the function from the industrial controller.

In one exemplary embodiment, the execution module includes:

a second obtaining unit, configured to, when the complete target file is analyzed, if it is detected that the complete target file does not include a target file of a logic block to be executed, obtain control information of the logic block to be executed;

a third obtaining unit, configured to obtain, according to the control information, a target file of the to-be-executed logical block from the industrial controller;

a creating unit, configured to create, on a logical page where the complete target file is executed, a new logical page corresponding to the target file of the to-be-executed logical block;

and the processing unit is used for processing the target file of the logic block to be executed on the newly created logic page.

The device provided by the embodiment of the application obtains the custom logic block of which the internal logic in the industrial controller meets the preset secrecy judgment condition, determines at least one target logic block for realizing the function of the custom logic block from the pre-stored logic blocks, and performs configuration operation on at least one target logic block in a preset logic page to obtain the custom logic block, so that the packaging of the custom logic block is completed by utilizing a graphical configuration mode, the development difficulty of the custom logic block is reduced, and the development efficiency is improved.

A computer storage medium comprising a processor and a memory, the memory storing a computer program, the processor to invoke the computer program to implement the method of any of the above.

It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is 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 tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies 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 includes any information delivery media as known to those skilled in the art.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种船转皮带卸料全自动取样信息流控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类