[go: up one dir, main page]

CN116224826A - Control logic simulation method, system, device, and nonvolatile storage medium - Google Patents

Control logic simulation method, system, device, and nonvolatile storage medium Download PDF

Info

Publication number
CN116224826A
CN116224826A CN202211608900.5A CN202211608900A CN116224826A CN 116224826 A CN116224826 A CN 116224826A CN 202211608900 A CN202211608900 A CN 202211608900A CN 116224826 A CN116224826 A CN 116224826A
Authority
CN
China
Prior art keywords
control logic
program
determining
engineering
programming language
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211608900.5A
Other languages
Chinese (zh)
Inventor
钟世平
钟心田
张立飞
曹钲晨
黄旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Supcon Technology Co Ltd
Original Assignee
Zhejiang Supcon Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Supcon Technology Co Ltd filed Critical Zhejiang Supcon Technology Co Ltd
Priority to CN202211608900.5A priority Critical patent/CN116224826A/en
Publication of CN116224826A publication Critical patent/CN116224826A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B17/00Systems involving the use of models or simulators of said systems
    • G05B17/02Systems involving the use of models or simulators of said systems electric
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

本申请公开了一种控制逻辑的仿真方法及系统、装置、非易失性存储介质。其中,该方法包括:接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;确定控制逻辑程序集对应的高级编程语言数据结构文本;将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果。本申请解决了由于无法针对控制逻辑程序中的特定程序段进行仿真造成的对控制逻辑程序中的问题进行排查的效率较低的技术问题。

Figure 202211608900

The application discloses a control logic simulation method, a system, a device, and a nonvolatile storage medium. Wherein, the method includes: receiving a control logic program data set, wherein the control logic program data set includes: a tag table and a control logic program set, and the control logic program set includes: engineering block information, connection relationships between engineering blocks, engineering The block includes: bit number and function block; determine the high-level programming language data structure text corresponding to the control logic assembly; convert the high-level programming language data structure text corresponding to the control logic assembly into the target program, and determine the control logic to be simulated according to the target program The simulation results. The present application solves the technical problem of low efficiency in troubleshooting problems in the control logic program due to the inability to simulate specific program segments in the control logic program.

Figure 202211608900

Description

控制逻辑的仿真方法及系统、装置、非易失性存储介质Control logic simulation method, system, device, and nonvolatile storage medium

技术领域technical field

本申请涉及工业自动控制领域,具体而言,涉及一种控制逻辑的仿真方法及系统、装置、非易失性存储介质。The present application relates to the field of industrial automatic control, in particular, to a control logic simulation method, system, device, and nonvolatile storage medium.

背景技术Background technique

随着工厂规模的扩大,微处理器、计算机技术的飞速发展,自动控制逐渐渗透到几乎所有的流程工业生产领域。在这样的背景下,为了保证设计逻辑控制程序时能够实时查看程序的运行情况、验证程序的合理与稳定性,逻辑控制程序仿真系统应运而生。With the expansion of factory scale and the rapid development of microprocessor and computer technology, automatic control has gradually penetrated into almost all process industry production fields. In this context, in order to ensure that the logic control program can be viewed in real time when designing the logic control program, and to verify the rationality and stability of the program, the logic control program simulation system came into being.

目前,存在多种类型的控制逻辑的仿真系统,一类是基于电气原理图,由仿真模块根据原理图中的各种电子原器件特性,模拟电子原器件中的电势与走向,实时反馈电压电流数据,从电子电气的角度去仿真电路控制逻辑。另一类是将可视化原理图转化为工业控制装置所能识别运行的配置文件,由上位机通过以太网传输到工业控制装置上,并由工业控制装置模拟运行,然后实时返回模拟运行装置最终呈现给设计人员。At present, there are many types of control logic simulation systems, one is based on the electrical schematic diagram, the simulation module simulates the potential and direction of the electronic original device according to the characteristics of various electronic original devices in the schematic diagram, and feeds back the voltage and current in real time Data, from the electronic and electrical point of view to simulate the circuit control logic. The other is to convert the visual schematic diagram into a configuration file that can be recognized and run by the industrial control device, which is transmitted from the host computer to the industrial control device through Ethernet, and simulated by the industrial control device, and then returned to the simulated operation device in real time for final presentation to the designers.

上述两类控制逻辑仿真方法都严重依赖实施硬件(工业控制装置)的基本参数与特性,无法脱离硬件或电子原器件信息运行。而依赖硬件仿真的方式都只能采用整机仿真调试的方式,这种调试方式下,调试人员不能针对特定程序段进行测试,而这些程序段可能隐藏更多的问题。当调试过程中发现问题时,整机调试方法不能快速定位问题点,为了定位问题点需要重复进行调试,大大降低了问题排查效率。The above two types of control logic simulation methods are heavily dependent on the basic parameters and characteristics of the implementation hardware (industrial control device), and cannot operate without hardware or electronic original device information. However, the method of relying on hardware simulation can only adopt the method of whole machine simulation debugging. In this debugging method, debuggers cannot test specific program segments, and these program segments may hide more problems. When a problem is found during the debugging process, the whole machine debugging method cannot quickly locate the problem point. In order to locate the problem point, repeated debugging is required, which greatly reduces the efficiency of troubleshooting.

针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.

发明内容Contents of the invention

本申请实施例提供了一种控制逻辑的仿真方法及系统、装置、非易失性存储介质,以至少解决由于无法针对控制逻辑程序中的特定程序段进行仿真造成的对控制逻辑程序中的问题进行排查的效率较低的技术问题。The embodiment of the present application provides a control logic simulation method, system, device, and non-volatile storage medium to at least solve the problem in the control logic program caused by the inability to simulate a specific program segment in the control logic program Troubleshooting less efficient technical issues.

根据本申请实施例的一个方面,提供了一种控制逻辑的仿真方法,包括:接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;确定控制逻辑程序集对应的高级编程语言数据结构文本;将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果。According to an aspect of the embodiment of the present application, a control logic simulation method is provided, including: receiving a control logic program data set, wherein the control logic program data set includes: a bit number table and a control logic program set, and a control logic program set Including: engineering block information, connection relationship between engineering blocks, engineering block includes: bit number and function block; determine the high-level programming language data structure text corresponding to the control logic assembly; set the high-level programming language data structure corresponding to the control logic assembly The text is converted into an object program, and the simulation result of the control logic to be simulated is determined according to the object program.

可选地,确定控制逻辑程序集对应的高级编程语言数据结构文本,包括:确定位号表对应的高级编程语言数据结构文本;确定控制逻辑程序集中的目标控制逻辑程序,并确定目标控制逻辑程序中工程块的执行顺序,以及功能块对应的高级编程语言数据结构文本;根据执行顺序、位号表对应的高级编程语言数据结构文本和功能块对应的高级编程语言数据结构文本,确定目标控制逻辑程序对应的高级编程语言数据结构文本;根据目标控制逻辑程序对应的高级编程语言数据结构文本,确定控制逻辑程序集对应的高级编程语言数据结构文本。Optionally, determining the high-level programming language data structure text corresponding to the control logic assembly includes: determining the high-level programming language data structure text corresponding to the tag table; determining the target control logic program in the control logic assembly, and determining the target control logic The execution sequence of the engineering blocks in the program, and the high-level programming language data structure text corresponding to the function block; according to the execution sequence, the high-level programming language data structure text corresponding to the bit table and the high-level programming language data structure text corresponding to the function block, determine the target control The high-level programming language data structure text corresponding to the logic program; according to the high-level programming language data structure text corresponding to the target control logic program, determine the high-level programming language data structure text corresponding to the control logic program set.

可选地,确定位号表对应的高级编程语言数据结构文本,包括:确定位号表对应的目标数据存储方式的类型,其中,目标数据存储方式为高级编程语言的数据存储方式;根据位号表对应的目标数据存储方式的类型,将位号表中的位号确定为目标数据存储方式中的目标变量;根据位号表对应的目标数据存储方式的类型和目标变量,确定位号表对应的高级编程语言数据结构文本。Optionally, determining the high-level programming language data structure text corresponding to the tag table includes: determining the type of target data storage method corresponding to the tag table, wherein the target data storage method is a data storage method of a high-level programming language; The type of the target data storage method corresponding to the table, determine the tag number in the tag table as the target variable in the target data storage method; according to the type of the target data storage method and the target variable corresponding to the tag table, determine the corresponding High-level programming language data structure text.

可选地,确定目标控制逻辑程序中工程块的执行顺序,包括:根据目标控制逻辑程序,确定工程块之间的第一连接关系;步骤S1,根据第一连接关系确定第一工程块,其中,第一工程块为在第一连接关系中不存在输入源的工程块,并确定第一工程块的执行顺序为第一子执行顺序;步骤S2,去除第一工程块和第一工程块与其他工程块之间的连接关系,得到工程块之间的第二连接关系;步骤S3,根据第二连接关系确定第二工程块,其中,第二工程块为在第二连接关系中不存在输入源的工程块,并确定第二工程块的执行顺序为第二子执行顺序;重复执行步骤S1至步骤S3,直至将目标控制逻辑程序中的全部n个工程块去除,得到n个子执行顺序,其中,n为正整数;根据n个子执行顺序,确定目标控制逻辑程序中工程块的执行顺序。Optionally, determining the execution order of the engineering blocks in the target control logic program includes: determining the first connection relationship between the engineering blocks according to the target control logic program; step S1, determining the first engineering block according to the first connection relationship, wherein , the first engineering block is an engineering block that does not have an input source in the first connection relationship, and the execution order of the first engineering block is determined to be the first sub-execution order; Step S2, remove the first engineering block and the first engineering block and The connection relationship between other engineering blocks is to obtain the second connection relationship between the engineering blocks; Step S3, determine the second engineering block according to the second connection relationship, wherein the second engineering block is that there is no input in the second connection relationship source engineering block, and determine that the execution order of the second engineering block is the second sub-execution order; repeat step S1 to step S3 until all n engineering blocks in the target control logic program are removed to obtain n sub-execution orders, Wherein, n is a positive integer; according to the execution sequence of n sub-executions, the execution sequence of the engineering blocks in the target control logic program is determined.

可选地,确定功能块对应的高级编程语言数据结构文本之前,方法还包括:确定目标控制逻辑程序中的功能块的引脚信息;确定引脚信息对应的目标逻辑控制标准的符号表;根据符号表判断功能块对应的控制逻辑程序的正确性。Optionally, before determining the high-level programming language data structure text corresponding to the function block, the method also includes: determining the pin information of the function block in the target control logic program; determining the symbol table of the target logic control standard corresponding to the pin information; The symbol table judges the correctness of the control logic program corresponding to the function block.

可选地,根据目标程序确定待仿真的控制逻辑的仿真结果之后,方法还包括:将待仿真的控制逻辑的仿真结果发送至客户端。Optionally, after determining the simulation result of the control logic to be simulated according to the target program, the method further includes: sending the simulation result of the control logic to be simulated to the client.

根据本申请实施例的再一方面,还提供了一种控制逻辑的仿真系统,包括:客户端和服务端,其中,客户端与服务端通信连接,用于将位号表和控制逻辑程序集确定为控制逻辑程序数据集,并通过网络超文本传输协议将控制逻辑程序数据集发送至服务端,其中,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;服务端,用于执行以上的控制逻辑的仿真方法。According to still another aspect of the embodiment of the present application, there is also provided a control logic simulation system, including: a client and a server, wherein the client and the server are connected in communication, and are used to integrate the bit number table and the control logic assembly Determined as the control logic program data set, and send the control logic program data set to the server through the network hypertext transfer protocol, wherein the control logic program set includes: engineering block information, connection relationship between engineering blocks, engineering blocks include: Bit numbers and function blocks; server, a simulation method for executing the above control logic.

根据本申请实施例的再一方面,还提供了一种非易失性存储介质,存储介质包括存储的程序,其中,程序运行时控制存储介质所在的设备执行以上的控制逻辑的仿真方法。According to still another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium, the storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute the simulation method of the above control logic.

根据本申请实施例的再一方面,还提供了一种电子设备,包括:存储器和处理器,处理器用于运行存储在存储器中的程序,其中,程序运行时执行以上的控制逻辑的仿真方法。According to yet another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, the processor is used to run a program stored in the memory, wherein the simulation method of the above control logic is executed when the program is running.

在本申请实施例中,采用接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;确定控制逻辑程序集对应的高级编程语言数据结构文本;将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果的方式,通过确定获取到的控制逻辑程序数据集对应的高级编程语言数据结构文本,并将该高级编程语言数据结构文本转换为目标程序,达到了对控制逻辑程序中的特定程序段进行仿真的目的,从而实现了提升对控制逻辑程序中的问题进行排查的效率的技术效果,进而解决了由于无法针对控制逻辑程序中的特定程序段进行仿真造成的对控制逻辑程序中的问题进行排查的效率较低技术问题。In the embodiment of the present application, the control logic program data set is received, wherein the control logic program data set includes: bit number table and control logic program set, and the control logic program set includes: engineering block information, connection relationship between engineering blocks , the engineering block includes: bit number and function block; determine the high-level programming language data structure text corresponding to the control logic assembly; convert the high-level programming language data structure text corresponding to the control logic assembly into the target program, and determine the target program to be simulated according to the target program The method of controlling the simulation results of the logic, by determining the high-level programming language data structure text corresponding to the obtained control logic program data set, and converting the high-level programming language data structure text into the target program, achieves the specific control logic program. The purpose of simulating the program segment, thereby achieving the technical effect of improving the efficiency of checking the problems in the control logic program, and then solving the problem of the problem in the control logic program caused by the inability to simulate specific program segments in the control logic program. Troubleshooting is less efficient for troubleshooting technical issues.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:

图1是根据本申请实施例的一种控制逻辑的仿真方法的流程图;Fig. 1 is a flow chart of a simulation method of control logic according to an embodiment of the present application;

图2是根据本申请实施例的另一种控制逻辑的仿真方法的流程图;FIG. 2 is a flow chart of another control logic simulation method according to an embodiment of the present application;

图3是根据本申请实施例的一种控制逻辑程序图;FIG. 3 is a control logic program diagram according to an embodiment of the present application;

图4是根据本申请实施例的一种确定工程块执行顺序的流程图;FIG. 4 is a flowchart of determining the execution order of engineering blocks according to an embodiment of the present application;

图5是根据本申请实施例的一种确定功能块对应的高级编程语言数据结构文本的流程图;Fig. 5 is a flow chart of determining a high-level programming language data structure text corresponding to a function block according to an embodiment of the present application;

图6是根据本申请实施例的一种确定控制逻辑程序集对应的高级编程语言数据结构文本的流程图;Fig. 6 is a flow chart of determining a high-level programming language data structure text corresponding to a control logic assembly according to an embodiment of the present application;

图7是根据本申请实施例的一种客户端与服务端之间的交互示意图;FIG. 7 is a schematic diagram of interaction between a client and a server according to an embodiment of the present application;

图8是根据本申请实施例的一种控制逻辑仿真器的生成原理图;Fig. 8 is a generation schematic diagram of a control logic simulator according to an embodiment of the present application;

图9是根据本申请实施例的一种控制逻辑的仿真系统的结构图;FIG. 9 is a structural diagram of a control logic simulation system according to an embodiment of the present application;

图10是根据本申请实施例的一种控制逻辑的仿真装置的结构图;FIG. 10 is a structural diagram of a control logic simulation device according to an embodiment of the present application;

图11是根据本申请实施例提供的一种控制逻辑的仿真方法的计算机终端(或电子设备)的硬件结构框图。Fig. 11 is a block diagram of a hardware structure of a computer terminal (or electronic device) according to a control logic simulation method provided by an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

为了更好地理解本申请实施例,以下将本申请实施例中涉及的技术术语解释如下:In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

功能块:具有特定功能的计算机代码在用户操作界面上的抽象体现。Function block: the abstract embodiment of computer code with specific functions on the user interface.

ST代码:适用IEC 61131-3编程系统标准语法编写的高级语言文本。ST code: high-level language text written in the standard syntax of the IEC 61131-3 programming system.

编译器:将一种语言翻译为另一种语言的程序。由开发人员书写高级计算机语言,编译器将其翻译为计算机能够理解的机器代码。Compiler: A program that translates one language into another. Developers write high-level computer languages, and compilers translate them into machine code that computers can understand.

原理图:电路板上各器件之间连接原理的图。Schematic diagram: A diagram of the connection principle between the components on the circuit board.

上位机:发出操控命令的计算机。Host computer: A computer that issues control commands.

工业控制装置:工业生产过程中用于控制执行器。Industrial control devices: used to control actuators in industrial production processes.

位号:控制系统中的数据源或输出源,控制系统中仪表硬件的数据通过硬件连线连接到控制器中,位号就代表了仪表的输入数据或者是将要输出到仪表的数据。Bit number: the data source or output source in the control system. The data of the instrument hardware in the control system is connected to the controller through the hardware connection. The bit number represents the input data of the instrument or the data to be output to the instrument.

位号表:数据库中存在位号的列表。Tag Table: A list of tags that exist in the database.

引脚:功能块或位号中负责连接的元素,代表着数据流入或流出的通道。Pin: The element responsible for connection in a function block or tag, representing the channel through which data flows in or out.

Web用户端:即浏览器。Web client: the browser.

Web技术:开发互联网应用的技术总称。Web technology: the general term for technologies for developing Internet applications.

HTTP请求:从Web用户端到服务端端的请求消息。HTTP request: A request message from a web client to a server.

数据库:用于保存控制逻辑及相关信息的载体。Database: a carrier used to save control logic and related information.

类:高级编程语言中的一种数据存储与交互方式。Class: A way of storing and interacting with data in a high-level programming language.

在相关技术中,控制逻辑仿真系统无法利用互联网的互联互通、只能在单台电脑上安装专用的仿真软件进行仿真。因此,存在无法将仿真的系统、程序或电路与他人进行共享或协作编辑,无法通过线上商城复用他人与其应用相同或近似的系统,同时也很难以与设备供应商等第三方进行互动的问题。为了解决上诉问题,本申请实施例中提供了相关的解决方案,以下详细说明。In related technologies, the control logic simulation system cannot utilize the interconnection and intercommunication of the Internet, and can only be simulated by installing special simulation software on a single computer. Therefore, it is impossible to share or collaboratively edit the simulated system, program or circuit with others, and it is impossible to reuse the same or similar system of other people's application through the online mall, and it is also difficult to interact with third parties such as equipment suppliers. question. In order to solve the appeal problem, a related solution is provided in the embodiment of the present application, which will be described in detail below.

根据本申请实施例,提供了一种控制逻辑的仿真方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present application, a method embodiment of a control logic simulation method is provided. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.

图1是根据本申请实施例的一种控制逻辑的仿真方法的流程图,如图1所示,该方法包括如下步骤:Fig. 1 is a flow chart of a simulation method for control logic according to an embodiment of the present application. As shown in Fig. 1, the method includes the following steps:

步骤S102,接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块。Step S102, receiving the control logic program data set, wherein the control logic program data set includes: a bit number table and a control logic program set, the control logic program set includes: engineering block information, connection relationship between engineering blocks, and the engineering block includes: Tags and function blocks.

根据本申请的一个可选的实施例,接收控制逻辑程序图对应的控制逻辑程序数据集,其中,控制逻辑程序图如图3所示。例如,控制逻辑程序由两个输入位号AOR14020001、AOR14020002,一个加法功能块ADD和一个输出位号AOR14020003组成。其中工程块之间的关系为:位号AOR14020001的输出引脚连接到了ADD的输入引脚IN1;位号AOR14020002的输出引脚连接到了ADD的输入引脚IN2;功能块ADD的输出引脚OUT连接到了输出位号AOR14020003的输入引脚。According to an optional embodiment of the present application, a control logic program data set corresponding to a control logic program diagram is received, wherein the control logic program diagram is as shown in FIG. 3 . For example, the control logic program consists of two input bit numbers AOR14020001 and AOR14020002, an addition function block ADD and an output bit number AOR14020003. The relationship between the engineering blocks is: the output pin of the bit number AOR14020001 is connected to the input pin IN1 of ADD; the output pin of the bit number AOR14020002 is connected to the input pin IN2 of ADD; the output pin OUT of the function block ADD is connected to To the input pin of the output bit number AOR14020003.

步骤S104,确定控制逻辑程序集对应的高级编程语言数据结构文本。Step S104, determining the high-level programming language data structure text corresponding to the control logic assembly.

根据本申请的另一个可选的实施例,控制逻辑程序集中包括工程块之间的关系清单,遍历关系清单中的每一项关系;当连接关系是位号输出连接到功能块输入时,调用位号表中的获取值方法获取位号的值,再调用对应功能块的设置值方法,将获取到的值输入功能块。同理,当连接关系是功能块输出连接到功能块输入和/或连接关系是功能块输出连接到位号输入时,是先调用对应输入源块的获取值操作方法,再调用输出源块的设置值操作方法,实现工程块之间的数值传递。According to another optional embodiment of the present application, the control logic assembly includes a relationship list between engineering blocks, and traverses each relationship in the relationship list; when the connection relationship is that the bit number output is connected to the function block input, Call the get value method in the tag table to get the value of the tag, then call the set value method of the corresponding function block, and input the obtained value into the function block. Similarly, when the connection relationship is that the output of the function block is connected to the input of the function block and/or the connection relationship is that the output of the function block is connected to the input of the bit number, it is first to call the operation method of obtaining the value of the corresponding input source block, and then call the setting of the output source block The value operation method realizes the value transfer between engineering blocks.

可选地,将控制逻辑程序集对应的高级编程语言数据结构文本存储为高级编程语言文本文件。Optionally, the high-level programming language data structure text corresponding to the control logic assembly is stored as a high-level programming language text file.

步骤S106,将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果。Step S106, converting the high-level programming language data structure text corresponding to the control logic assembly into an object program, and determining the simulation result of the control logic to be simulated according to the object program.

服务端将根据目标程序确定得出的待仿真的控制逻辑的仿真结果发送至Web用户端,即浏览器,用户通过浏览器直接观察待仿真的控制逻辑的仿真结果,并基于该仿真结果进行下一步相关工作。The server sends the simulation result of the control logic to be simulated determined according to the target program to the web client, that is, the browser. The user directly observes the simulation result of the control logic to be simulated through the browser, and performs the following simulation based on the simulation result. One step related work.

根据上述步骤,通过确定获取到的控制逻辑程序数据集对应的高级编程语言数据结构文本,并将该高级编程语言数据结构文本转换为目标程序,达到了对控制逻辑程序中的特定程序段进行仿真的目的,从而实现了提升对控制逻辑程序中的问题进行排查的效率的技术效果。According to the above steps, by determining the high-level programming language data structure text corresponding to the obtained control logic program data set, and converting the high-level programming language data structure text into the target program, the simulation of a specific program segment in the control logic program is achieved The purpose of this method is to achieve the technical effect of improving the efficiency of checking the problems in the control logic program.

根据本申请的一个可选的实施例,确定控制逻辑程序集对应的高级编程语言数据结构文本,可以通过以下方法实现:确定位号表对应的高级编程语言数据结构文本;确定控制逻辑程序集中的目标控制逻辑程序,并确定目标控制逻辑程序中工程块的执行顺序,以及功能块对应的高级编程语言数据结构文本;根据执行顺序、位号表对应的高级编程语言数据结构文本和功能块对应的高级编程语言数据结构文本,确定目标控制逻辑程序对应的高级编程语言数据结构文本;根据目标控制逻辑程序对应的高级编程语言数据结构文本,确定控制逻辑程序集对应的高级编程语言数据结构文本。According to an optional embodiment of the present application, determining the high-level programming language data structure text corresponding to the control logic assembly can be achieved by the following methods: determining the high-level programming language data structure text corresponding to the tag table; The target control logic program, and determine the execution order of the engineering blocks in the target control logic program, as well as the high-level programming language data structure text corresponding to the function block; According to the high-level programming language data structure text corresponding to the target control logic program, determine the high-level programming language data structure text corresponding to the target control logic program; determine the high-level programming language data structure text corresponding to the control logic program set.

可选地,将生成的高级编程语言数据结构文本存储为高级编程语言文本文件。Optionally, the generated high-level programming language data structure text is stored as a high-level programming language text file.

在本申请的一些可选的实施例,确定位号表对应的高级编程语言数据结构文本,通过以下方法实现:确定位号表对应的目标数据存储方式的类型,其中,目标数据存储方式为高级编程语言的数据存储方式;根据位号表对应的目标数据存储方式的类型,将位号表中的位号确定为目标数据存储方式中的目标变量;根据位号表对应的目标数据存储方式的类型和目标变量,确定位号表对应的高级编程语言数据结构文本。In some optional embodiments of the present application, determining the high-level programming language data structure text corresponding to the tag table is achieved by the following method: determining the type of the target data storage method corresponding to the tag table, wherein the target data storage method is advanced The data storage method of the programming language; according to the type of the target data storage method corresponding to the tag table, the tag number in the tag table is determined as the target variable in the target data storage method; according to the target data storage method corresponding to the tag table The type and target variable determine the high-level programming language data structure text corresponding to the tag table.

作为本申请的一个可选的实施例,定义位号表的类名,将位号表的每一项位号定义为类中的成员变量,位号的类型根据实际系统的定义,转化定义为高级编程语言中的数据存储类型。位号数据类型为REAL类型,工程上定义REAL类型在计算机中占用4个字节的长度,所以,转化定义为高级编程语言中的数据类型也占用4个字节长度的类型,在将其转化为高级编程语言C++的情况下,即转变类型为float类型。并根据设计需求增加系统中访问所需要的位号操作方法(例如设置值、获取值)。As an optional embodiment of the present application, the class name of the tag table is defined, and each item tag of the tag table is defined as a member variable in the class. The type of the tag is defined according to the definition of the actual system, and is defined as A data storage type in high-level programming languages. The bit number data type is the REAL type, and the engineering definition of the REAL type occupies 4 bytes in the computer. Therefore, the conversion is defined as a data type in the high-level programming language that also occupies 4 bytes. After converting it In the case of high-level programming language C++, the type is changed to float type. And according to the design requirements, the bit number operation method (such as setting value and obtaining value) required for access in the system is added.

在本申请的另一些可选的实施例中,确定目标控制逻辑程序中工程块的执行顺序,包括以下步骤:根据目标控制逻辑程序,确定工程块之间的第一连接关系;步骤S1,根据第一连接关系确定第一工程块,其中,第一工程块为在第一连接关系中不存在输入源的工程块,并确定第一工程块的执行顺序为第一子执行顺序;步骤S2,去除第一工程块和第一工程块与其他工程块之间的连接关系,得到工程块之间的第二连接关系;步骤S3,根据第二连接关系确定第二工程块,其中,第二工程块为在第二连接关系中不存在输入源的工程块,并确定第二工程块的执行顺序为第二子执行顺序;重复执行步骤S1至步骤S3,直至将目标控制逻辑程序中的全部n个工程块去除,得到n个子执行顺序,其中,n为正整数;根据n个子执行顺序,确定目标控制逻辑程序中工程块的执行顺序。In other optional embodiments of the present application, determining the execution order of the engineering blocks in the target control logic program includes the following steps: according to the target control logic program, determining the first connection relationship between the engineering blocks; step S1, according to The first connection relationship determines the first engineering block, wherein the first engineering block is an engineering block that does not have an input source in the first connection relationship, and determines that the execution order of the first engineering block is the first sub-execution order; step S2, Remove the first engineering block and the connection relationship between the first engineering block and other engineering blocks to obtain the second connection relationship between the engineering blocks; step S3, determine the second engineering block according to the second connection relationship, wherein the second engineering block The block is an engineering block that does not have an input source in the second connection relationship, and the execution sequence of the second engineering block is determined to be the second sub-execution sequence; step S1 to step S3 are repeatedly executed until all n in the target control logic program are The engineering blocks are removed to obtain n sub-execution sequences, wherein n is a positive integer; according to the n sub-execution sequences, the execution sequence of the engineering blocks in the target control logic program is determined.

作为本申请的另一个可选的实施例,每一个工程块的执行在抽象意义上是存在顺序的,当工程块的连接关系是由A的输出连接到B的输入的,那么A块的执行就一定在B之前,这样A的计算结果才能正确传输给B块;根据拓扑排序算法,设定控制逻辑绘制界面的左侧输入部分的位号的顺序序号为1以及逻辑关系中没有输入源的块的顺序序号为1,删除上述块以及他们的输出连接关系,这样,会出现新的一批没有输入源的块,设置新的一批块的顺序序号为2,依次类推,直至块全部消失。此时即可获得全部工程块的执行顺序。As another optional embodiment of this application, the execution of each engineering block is sequential in an abstract sense. When the connection relationship of the engineering block is connected from the output of A to the input of B, then the execution of A block It must be before B, so that the calculation result of A can be correctly transmitted to block B; according to the topology sorting algorithm, set the sequence number of the bit number of the left input part of the control logic drawing interface to 1 and there is no input source in the logical relationship The sequence number of the block is 1, delete the above blocks and their output connections, so that a new batch of blocks without input sources will appear, set the sequence number of the new batch of blocks to 2, and so on until all blocks disappear . At this point, the execution sequence of all engineering blocks can be obtained.

在一个可选的实施例中,确定功能块对应的高级编程语言数据结构文本之前,还需要:确定目标控制逻辑程序中的功能块的引脚信息;确定引脚信息对应的目标逻辑控制标准的符号表;根据符号表判断功能块对应的控制逻辑程序的正确性。In an optional embodiment, before determining the high-level programming language data structure text corresponding to the function block, it is also necessary to: determine the pin information of the function block in the target control logic program; determine the target logic control standard corresponding to the pin information Symbol table: judge the correctness of the control logic program corresponding to the function block according to the symbol table.

根据本申请的一个可选的实施例,根据IEC61131-3编译器的要求,将功能块的引脚列表生成符号表,将符号表数据与功能块中的工业编程代码输入IEC61131-3编译器,检查工业编程代码的正确性,并输出编译结果以及高级编程语言的编译文本。According to an optional embodiment of the present application, according to the requirements of the IEC61131-3 compiler, the pin list of the function block is generated into a symbol table, and the symbol table data and the industrial programming code in the function block are input into the IEC61131-3 compiler, Check the correctness of the industrial programming code, and output the compilation result and the compiled text of the high-level programming language.

根据本申请的一个优选的实施例,根据目标程序确定待仿真的控制逻辑的仿真结果之后,还需要:将待仿真的控制逻辑的仿真结果发送至客户端。According to a preferred embodiment of the present application, after determining the simulation result of the control logic to be simulated according to the target program, it is further required to: send the simulation result of the control logic to be simulated to the client.

图2是根据本申请实施例的另一种控制逻辑的仿真方法的流程图,如图2所示,该方法包括如下步骤:Fig. 2 is a flow chart of another control logic simulation method according to an embodiment of the present application. As shown in Fig. 2, the method includes the following steps:

步骤S202:仿真器生成模块接收到控制逻辑程序数据集后,检查该控制逻辑程序数据集是否存在错误。若存在错误,生成提示信息,并将该提示信息发送至客户端;若不存在错误,创建位号表数据结构。Step S202: After receiving the control logic program data set, the emulator generating module checks whether there is an error in the control logic program data set. If there is an error, generate prompt information and send the prompt information to the client; if there is no error, create a tag table data structure.

控制逻辑程序由两个输入位号AOR14020001、AOR14020002,一个加法功能块ADD和一个输出位号AOR14020003组成。其中工程块之间的关系为:位号AOR14020001的输出引脚连接到了ADD的输入引脚IN1;位号AOR14020002的输出引脚连接到了ADD的输入引脚IN2;功能块ADD的输出引脚OUT连接到了输出位号AOR14020003的输入引脚。The control logic program consists of two input bit numbers AOR14020001 and AOR14020002, an addition function block ADD and an output bit number AOR14020003. The relationship between the engineering blocks is: the output pin of the bit number AOR14020001 is connected to the input pin IN1 of ADD; the output pin of the bit number AOR14020002 is connected to the input pin IN2 of ADD; the output pin OUT of the function block ADD is connected to To the input pin of the output bit number AOR14020003.

作为本申请的一个可选的实施例,创建位号表数据结构,数据结构中包含三个成员变量:浮点类型的AOR14020001、浮点类型的AOR14020002与浮点类型的AOR14020003;与三个设置值的方法、三个获取值的方法分别对应三个位号的取值设值方法。As an optional embodiment of the present application, create a bit number table data structure, which contains three member variables: AOR14020001 of floating point type, AOR14020002 of floating point type and AOR14020003 of floating point type; and three setting values The method and the three methods of obtaining the value correspond to the method of obtaining and setting the value of the three bit numbers respectively.

步骤S204,仿真器生成模块确定控制逻辑程序集中的目标控制逻辑程序,即程序集中的程序清单中只有一个当前定义的这一个程序,将其命名为程序1。In step S204, the emulator generating module determines the target control logic program in the control logic assembly, that is, there is only one currently defined program in the program list in the assembly, and names it as program 1 .

步骤S206,根据拓扑排序算法计算出程序1中工程块的执行顺序。Step S206, calculate the execution order of the engineering blocks in program 1 according to the topology sorting algorithm.

图4是根据本申请实施例的一种确定工程块执行顺序的流程图,如图4所示,该方法包括如下步骤:Fig. 4 is a kind of flowchart of determining the execution sequence of engineering blocks according to the embodiment of the present application, as shown in Fig. 4, the method includes the following steps:

步骤S2061,将输入位号AOR14020001与输入位号AOR14020002的执行顺序定义为1;Step S2061, define the execution sequence of the input bit number AOR14020001 and the input bit number AOR14020002 as 1;

步骤S2062,找到当前图中所有不具备输入的块,当前找到情况为:位号AOR14020001与位号AOR14020002;Step S2062, find all the blocks in the current figure that do not have input, the current found situation is: bit number AOR14020001 and bit number AOR14020002;

步骤S2063,将步骤S2062找到的块的执行顺序定义为1;Step S2063, define the execution order of the blocks found in step S2062 as 1;

步骤S2064,将位号AOR1402001与位号AOR14020002去掉;Step S2064, removing the bit number AOR1402001 and the bit number AOR14020002;

步骤S2065,将位号AOR1402001与位号AOR14020002的全部输出连接去掉。此时的块剩余了加法功能块ADD与一个输出位号AOR14020003。块与块之间的关系剩余了功能块ADD的输出引脚OUT连接到了输出位号AOR14020003的输入引脚;Step S2065, remove all output connections between the bit number AOR1402001 and the bit number AOR14020002. At this time, the remaining blocks are the addition function block ADD and an output bit number AOR14020003. The relationship between blocks remains that the output pin OUT of the function block ADD is connected to the input pin of the output bit number AOR14020003;

步骤S2066,重复步骤S2062,找到当前图中不具备输入的块,当前找到的情况为:功能块ADD;Step S2066, repeat step S2062, find the block that does not have input in the current figure, the currently found situation is: function block ADD;

步骤S2067,重复步骤S2063,将上一步找到的块(功能块ADD)的执行顺序定义为2;Step S2067, repeat step S2063, define the execution sequence of the block (function block ADD) found in the previous step as 2;

步骤S2068,重复步骤S2064,将功能块ADD去掉;Step S2068, repeat step S2064, remove the function block ADD;

步骤S2069,重复步骤S2065,将功能块ADD的全部输出连接去掉。此时的块剩余了输出位号AOR14020003;Step S2069, repeat step S2065, remove all output connections of the function block ADD. At this time, the remaining output bit number of the block is AOR14020003;

步骤S20610,重复步骤S2062,找到当前图中不具备输入的块,当前找到的情况为输出位号AOR14020003;Step S20610, repeat step S2062, find the block that does not have input in the current figure, and the currently found situation is the output bit number AOR14020003;

步骤S20611,重复步骤S2063,将当前块输出位号AOR14020003的执行顺序定义为3;Step S20611, repeat step S2063, define the execution sequence of the current block output bit number AOR14020003 as 3;

步骤S20612,将输出位号AOR14020003去掉,将输出位号AOR14020003的全部输出去掉;Step S20612, removing the output bit number AOR14020003, and removing all outputs of the output bit number AOR14020003;

步骤S20613,此时不存在块与连接关系,结束计算。Step S20613, at this time there is no relationship between blocks and connections, and the calculation ends.

根据上述步骤可得第一步先执行输入位号AOR14020001与输入位号AOR14020002。第二步执行功能块ADD。第三步执行输出位号AOR14020003。According to the above steps, the first step is to execute the input bit number AOR14020001 and the input bit number AOR14020002. The second step executes the function block ADD. The third step is to execute the output bit number AOR14020003.

步骤S208,确定功能块对应的高级编程语言数据结构文本。Step S208, determining the high-level programming language data structure text corresponding to the function block.

图5是根据本申请实施例的一种确定功能块对应的高级编程语言数据结构文本的流程图,如图5所示:整理功能块ADD的引脚,输入浮点类型引脚IN1、IN2;输出浮点类型引脚OUT;整理为符号表数据。将符号表信息和功能块ADD的信息(内部的IEC61131-3执行“OUT:=IN1+IN2;”)传输给IEC61131-3编译器,编译器编译出功能块对应的高级编程语言数据结构文本,并将该高级编程语言数据结构文本写入文件。Fig. 5 is a kind of flow chart of the high-level programming language data structure text corresponding to determining function block according to the embodiment of the present application, as shown in Fig. 5: arrange the pin of function block ADD, input floating-point type pin IN1, IN2; Output floating-point type pin OUT; organized as symbol table data. The information of the symbol table information and the function block ADD (the internal IEC61131-3 executes "OUT:=IN1+IN2; ") is transmitted to the IEC61131-3 compiler, and the compiler compiles the corresponding high-level programming language data structure text of the function block, And write the high-level programming language data structure text to the file.

步骤S210,生成程序1的高级编程语言数据结构文本。Step S210, generating the high-level programming language data structure text of program 1.

步骤S2101,执行输入位号AOR14020001与输入位号AOR14020002,并从步骤S204生成的位号表结构中获取位号AOR14020001与位号AOR14020002的值。Step S2101, execute the input tag AOR14020001 and the input tag AOR14020002, and obtain the values of the tag AOR14020001 and the tag AOR14020002 from the tag table structure generated in step S204.

步骤S2102,依据工程块之间的连接关系,将AOR1402001与AOR14020002的值输入步骤S208生成的功能块高级编程语言数据结构类中。Step S2102, input the values of AOR1402001 and AOR14020002 into the function block high-level programming language data structure class generated in step S208 according to the connection relationship between engineering blocks.

步骤S2103,执行功能块ADD中的运行方法。Step S2103, execute the running method in the function block ADD.

步骤S2104,依据工程块之间的连接关系,获取功能块ADD的输出值OUT,并将值设置进入输出位号AOR14020003中。Step S2104, according to the connection relationship between the engineering blocks, obtain the output value OUT of the function block ADD, and set the value into the output bit number AOR14020003.

步骤S2105,执行输出位号AOR14020003。Step S2105, execute and output the bit number AOR14020003.

步骤S212,根据步骤S202至步骤S210,确定控制逻辑程序集对应的高级编程语言数据结构文本,其中,该流程如图6所示。Step S212, according to steps S202 to S210, determine the high-level programming language data structure text corresponding to the control logic assembly, wherein the process is shown in FIG. 6 .

步骤S214,利用CMake将上述清单文件与位号表文件与功能块文件生成为项目。Step S214, using CMake to generate the above manifest file, tag table file and function block file as a project.

步骤S216,利用Mingw32将上述项目生成为可执行程序。Step S216, using Mingw32 to generate the above project into an executable program.

本申请结合了传统工业控制系统的特性与互联网的便捷性,舍弃了传统工业控制系统需要依赖硬件运行的特性,结合了互联网的开放协作的特性,将设计控制逻辑与仿真结合,形成一套完整的工程实施上层控制逻辑设计方案。通过本申请可以解决控制逻辑仿真系统中的如下问题:依赖硬件参数与特性或直接依赖硬件运行;无法针对单独特定程序段运行;无法通过网络进行团队协作或应用程序分享互用。This application combines the characteristics of traditional industrial control systems with the convenience of the Internet, abandons the characteristics of traditional industrial control systems that need to rely on hardware to operate, combines the characteristics of open collaboration on the Internet, and combines design control logic with simulation to form a complete set The project implements the upper layer control logic design scheme. This application can solve the following problems in the control logic simulation system: rely on hardware parameters and characteristics or directly rely on hardware to run; cannot run for a single specific program segment; cannot perform teamwork or application sharing and interoperability through the network.

图9是根据本申请实施例的一种控制逻辑的仿真系统的结构图,如图9所示,该系统包括:客户端902和服务端904,其中,FIG. 9 is a structural diagram of a control logic simulation system according to an embodiment of the present application. As shown in FIG. 9, the system includes: a client 902 and a server 904, wherein,

客户端902与服务端904通信连接,用于将位号表和控制逻辑程序集确定为控制逻辑程序数据集,并通过网络超文本传输协议将控制逻辑程序数据集发送至服务端904,其中,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块。The client 902 communicates with the server 904, and is used to determine the bit number table and the control logic program set as the control logic program data set, and send the control logic program data set to the server 904 through the network hypertext transfer protocol, wherein, The control logic assembly includes: engineering block information, the connection relationship between engineering blocks, and the engineering block includes: bit number and function block.

服务端904,用于执行控制逻辑的仿真方法。The server 904 is used to execute the simulation method of the control logic.

图7是根据本申请实施例的一种客户端与服务端之间的交互示意图,如图7所示,用户通过客户端902的浏览器进入系统后,根据所属项目工程不同的需求创建自定义功能块。在系统界面上,用户为需要创建的自定义功能块创建对外连接所需的引脚,在代码编辑框中输入工业编程代码利用创建的引脚实现该功能块目标所要实现的功能。用户在系统中的位号表中输入位号的类型与初值创建位号。完成后,客户端902利用JavaScript脚本通过网络HTTP请求将数据保存进入服务端904的数据库,其中,控制逻辑绘制界面分为三个区域,最左侧的输入区域与最右侧的输出区域以表格的形式展示用户选用的位号。中间的逻辑功能区域展示当前逻辑页的控制逻辑。控制逻辑绘制界面右侧是系统内置的与用户先前定义的功能块列表。Fig. 7 is a schematic diagram of interaction between a client and a server according to an embodiment of the present application. As shown in Fig. 7, after the user enters the system through the browser of the client 902, he creates a custom function block. On the system interface, the user creates the pins required for external connections for the custom function blocks that need to be created, and enters the industrial programming code in the code editing box to use the created pins to realize the functions that the function block targets to achieve. The user enters the type and initial value of the tag in the tag table in the system to create the tag. After completion, the client 902 uses JavaScript scripts to save the data into the database of the server 904 through a network HTTP request, wherein the control logic drawing interface is divided into three areas, the leftmost input area and the rightmost output area are in the form of to display the bit number selected by the user. The logical function area in the middle shows the control logic of the current logical page. On the right side of the control logic drawing interface is a list of function blocks built in the system and previously defined by the user.

根据本申请的一个可选的实施例,用户通过控制逻辑绘制界面上方的工具栏中的位号选择工具选用位号时,客户端902通过JavaScript向服务端904请求查询位号列表,服务端904收到请求后从数据库的位号表中将位号列表信息返回给客户端902,客户端902收到位号列表信息后,通过可视化工具在界面上绘制出位号的样式,放置在输入区域的位号每个块右侧都拥有一个可以用于连接输出的引脚。放置在输出区域的位号每个块左侧都拥有一个可以用于连接输入的引脚。用户选用功能块列表中的功能块,客户端902从服务端904获取功能块数据,将功能块绘制在界面中。当用户鼠标定位在位号或功能块输出引脚上时,可以拖拽选择引脚连线连接其他块的对应输入引脚。直至用户绘制完控制逻辑图。客户端902将功能块与位号间的连接关系,以及功能块与位号的信息通过网络HTTP请求保存为服务端904数据库中的一项程序。According to an optional embodiment of the present application, when the user selects a tag through the tag selection tool in the toolbar above the control logic drawing interface, the client 902 requests the server 904 to query the tag list through JavaScript, and the server 904 After receiving the request, return the tag list information from the tag table in the database to the client 902. After receiving the tag list information, the client 902 draws the tag pattern on the interface through a visualization tool, and places it in the input area. To the right of each block there is a pin that can be used to connect an output. Tags placed in the output area Each block to the left has a pin that can be used to connect an input. The user selects a function block in the function block list, and the client 902 obtains the function block data from the server 904, and draws the function block on the interface. When the user's mouse is positioned on the bit number or the output pin of the function block, the user can drag and drop the selected pin to connect to the corresponding input pin of other blocks. Until the user draws the control logic diagram. The client 902 saves the connection relationship between the function block and the bit number, and the information of the function block and the bit number as a program in the database of the server 904 through a network HTTP request.

当用户触发仿真时,客户端902向服务端904发起仿真请求,服务端904生成仿真任务ID通知客户端90本次的仿真任务,服务端904随即从数据库中取出需要仿真的数据集。仿真数据集中包含了位号表的信息与程序集。程序集下包含了多个程序,每个程序中又包含了多个功能块、位号以及程序中功能块位号的关系清单。When the user triggers the simulation, the client 902 initiates a simulation request to the server 904, and the server 904 generates a simulation task ID to notify the client 90 of the current simulation task, and the server 904 immediately retrieves the data set to be simulated from the database. The simulation data set contains the information and program set of the tag table. The assembly contains multiple programs, and each program contains multiple function blocks, bit numbers, and the relationship list of function block bit numbers in the program.

服务端904的控制逻辑仿真器生成原理如图8所示,服务端904中的仿真器生成模块将获取到的位号表数据,按照位号的类型以高级编程语言的形式生成高级编程语言数据结构文本:定义位号表的类名,将位号表的每一项位号定义为类中的成员变量,位号的类型根据实际系统的定义,转化定义为高级编程语言中的数据存储类型(例如:位号数据类型为REAL类型,工程上定义REAL类型在计算机中占用4个字节的长度,所以,转化定义为高级编程语言中的数据类型也必须是占用4个字节长度的类型,例如将其转化为高级编程语言C++,即转变类型为float类型)。并根据设计需求增加系统中访问所需要的位号操作方法(例如设置值、获取值)。将生成的高级编程语言数据结构文本存储为计算机中的高级编程语言文本文件。The generation principle of the control logic simulator of the server 904 is shown in FIG. 8 . The simulator generation module in the server 904 generates the high-level programming language data in the form of a high-level programming language according to the type of the bit number from the obtained tag table data. Structural text: define the class name of the tag table, define each item tag of the tag table as a member variable in the class, and convert the tag type into the data storage type in the high-level programming language according to the definition of the actual system (For example: the bit number data type is REAL type, and the REAL type defined in the project occupies 4 bytes in length in the computer. Therefore, the conversion definition into the data type in the high-level programming language must also be a type that occupies 4 bytes. , such as converting it into a high-level programming language C++, that is, converting the type into a float type). And according to the design requirements, the bit number operation method (such as setting value and obtaining value) required for access in the system is added. Store the generated high-level programming language data structure text as a high-level programming language text file in the computer.

仿真器生成模块循环遍历获取到的程序集,处理程序集中每一个程序。每一个程序再依据拓扑排序算法依序遍历程序中的每一个功能块与位号。并根据IEC61131-3编译器的要求,将功能块的引脚列表生成符号表,将符号表数据与功能块中的工业编程代码输入IEC61131-3,检查工业编程代码的正确性,并输出编译结果以及高级编程语言的编译文本。与位号表的转化同理,将功能块的名称转化定义为高级编程语言中的类名,将功能块的引脚转化定义为高级编程语言中的成员变量,将功能块的工业编程代码定义为类中的运行操作方法。The emulator generation module loops through the acquired assembly and processes each program in the assembly. Each program then traverses each function block and bit number in the program in sequence according to the topology sorting algorithm. And according to the requirements of the IEC61131-3 compiler, generate a symbol table from the pin list of the function block, input the symbol table data and the industrial programming code in the function block into IEC61131-3, check the correctness of the industrial programming code, and output the compilation result and compiled text for high-level programming languages. In the same way as the conversion of the bit number table, the name conversion of the function block is defined as the class name in the high-level programming language, the pin conversion of the function block is defined as a member variable in the high-level programming language, and the industrial programming code of the function block is defined For the run action method in the class.

解析程序中的功能块、位号关系清单,生成该程序的运行方法高级编程语言文本。Analyze the list of function blocks and bit number relationships in the program, and generate the high-level programming language text of the program's operating method.

仿真器生成模块最后将程序集运行清单转化为高级编程语言文本。The emulator generation module finally converts the assembly runlist into high-level programming language text.

仿真器生成模块使用CMAKE工具将上述生成的文件结合事先定义好的网络通讯模块整理为高级编程语言工程。再利用MINGW32工具将上述工程编译为对应的计算机可执行程序,即得到了该程序集的仿真器。The emulator generation module uses the CMAKE tool to organize the above-mentioned generated files into a high-level programming language project combined with a pre-defined network communication module. Then use the MINGW32 tool to compile the above project into a corresponding computer executable program, that is, the emulator of the program set is obtained.

服务端904运行上述生成的仿真器,仿真器通过网络模块向服务端904发送实时数据。客户端902根据仿真器收到仿真任务ID向服务端904订阅实时数据。最后将收到的实时数据显示在界面上反馈给用户。The server 904 runs the emulator generated above, and the emulator sends real-time data to the server 904 through the network module. The client 902 subscribes to the server 904 for real-time data according to the simulation task ID received by the emulator. Finally, the received real-time data is displayed on the interface and fed back to the user.

当用户需要设置某个块的值以查看新值对当前控制逻辑的影响时,在客户端902为位号或者功能块设置引脚的值,客户端902向服务端904发送网络HTTP请求。When the user needs to set the value of a certain block to check the impact of the new value on the current control logic, the client 902 sets the value of the pin for the bit number or function block, and the client 902 sends a network HTTP request to the server 904 .

图10是根据本申请实施例的一种控制逻辑的仿真装置的结构图,如图10所示,该装置包括:Fig. 10 is a structural diagram of a control logic simulation device according to an embodiment of the present application. As shown in Fig. 10, the device includes:

1002接收模块,用于接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;1002 The receiving module is used to receive the control logic program data set, wherein the control logic program data set includes: tag table and control logic program set, and the control logic program set includes: engineering block information, connection relationship between engineering blocks, engineering Blocks include: bit numbers and function blocks;

1004第一确定模块,用于确定控制逻辑程序集对应的高级编程语言数据结构文本;1004 A first determining module, configured to determine the high-level programming language data structure text corresponding to the control logic assembly;

1006第二确定模块,用于将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果。1006 A second determining module, configured to convert the high-level programming language data structure text corresponding to the control logic assembly into an object program, and determine the simulation result of the control logic to be simulated according to the object program.

需要说明的是,上述图10中的各个模块可以是程序模块(例如是实现某种特定功能的程序指令集合),也可以是硬件模块,对于后者,其可以表现为以下形式,但不限于此:上述各个模块的表现形式均为一个处理器,或者,上述各个模块的功能通过一个处理器实现。It should be noted that each module in FIG. 10 above can be a program module (for example, a set of program instructions to realize a certain function), or a hardware module. For the latter, it can be expressed in the following forms, but not limited to Here: each of the above-mentioned modules is represented by one processor, or the functions of the above-mentioned modules are realized by one processor.

图11示出了一种用于实现控制逻辑的仿真方法的计算机终端(或移动设备)的硬件结构框图。如图11所示,计算机终端110(或移动设备110)可以包括一个或多个(图中采用1102a、1102b,……,1102n来示出)处理器1102(处理器1102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器1104、以及用于通信功能的传输模块1106。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为BUS总线的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图11所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端110还可包括比图11中所示更多或者更少的组件,或者具有与图11所示不同的配置。FIG. 11 shows a block diagram of a hardware structure of a computer terminal (or mobile device) for implementing a control logic simulation method. As shown in FIG. 11 , a computer terminal 110 (or a mobile device 110) may include one or more (shown as 1102a, 1102b, ..., 1102n in the figure) processors 1102 (processors 1102 may include but are not limited to micro A processing device such as a processor MCU or a programmable logic device FPGA), a memory 1104 for storing data, and a transmission module 1106 for communication functions. In addition, it can also include: a display, an input/output interface (I/O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply, and/or or camera. Those of ordinary skill in the art can understand that the structure shown in FIG. 11 is only for illustration, and it does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 110 may also include more or fewer components than shown in FIG. 11 , or have a different configuration than that shown in FIG. 11 .

应当注意到的是上述一个或多个处理器1102和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到计算机终端110(或移动设备)中的其他元件中的任意一个内。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。It should be noted that the one or more processors 1102 and/or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuit may be implemented in whole or in part as software, hardware, firmware or other arbitrary combinations. In addition, the data processing circuit can be a single independent processing module, or be fully or partially integrated into any of the other elements in the computer terminal 110 (or mobile device). As mentioned in the embodiment of the present application, the data processing circuit is used as a processor control (for example, the selection of the terminal path of the variable resistor connected to the interface).

存储器1104可用于存储应用软件的软件程序以及模块,如本申请实施例中的控制逻辑的仿真方法对应的程序指令/数据存储装置,处理器1102通过运行存储在存储器1104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的控制逻辑的仿真方法。存储器1104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器1104可进一步包括相对于处理器1102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端110。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 1104 can be used to store software programs and modules of application software, such as the program instruction/data storage device corresponding to the control logic simulation method in the embodiment of the present application, and the processor 1102 runs the software programs and modules stored in the memory 1104, Thereby executing various functional applications and data processing, that is, realizing the simulation method of the above-mentioned control logic. The memory 1104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1104 may further include memory that is remotely located relative to the processor 1102, and these remote memories may be connected to the computer terminal 110 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

传输模块1106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端110的通信供应商提供的无线网络。在一个实例中,传输模块1106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输模块1106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。The transmission module 1106 is used to receive or send data via a network. The specific example of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 110 . In one example, the transmission module 1106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 1106 may be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.

显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与计算机终端110(或移动设备)的用户界面进行交互。The display may be, for example, a touchscreen liquid crystal display (LCD), which may enable a user to interact with a user interface of the computer terminal 110 (or mobile device).

此处需要说明的是,在一些可选实施例中,上述图11所示的计算机设备(或电子设备)可以包括硬件元件(包括电路)、软件元件(包括存储在计算机可读介质上的计算机代码)、或硬件元件和软件元件两者的结合。应当指出的是,图11仅为特定具体实例的一个实例,并且旨在示出可存在于上述计算机设备(或电子设备)中的部件的类型。It should be noted here that, in some optional embodiments, the computer equipment (or electronic equipment) shown in FIG. 11 may include hardware components (including circuits), software components (including computer code), or a combination of both hardware and software elements. It should be noted that FIG. 11 is only one example of a specific embodiment, and is intended to illustrate the types of components that may be present in the computer device (or electronic device) described above.

需要说明的是,图11所示的电子设备用于执行图1所示的控制逻辑的仿真方法,因此上述命令的执行方法中的相关解释说明也适用于该电子设备,此处不再赘述。It should be noted that the electronic device shown in FIG. 11 is used to execute the simulation method of the control logic shown in FIG. 1 , so relevant explanations in the method for executing the above commands are also applicable to the electronic device, and will not be repeated here.

本申请实施例还提供了一种非易失性存储介质,非易失性存储介质包括存储的程序,其中,程序运行时控制存储介质所在的设备执行以上的控制逻辑的仿真方法。The embodiment of the present application also provides a non-volatile storage medium, and the non-volatile storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute the simulation method of the above control logic.

非易失性存储介质执行以下功能的程序:接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;确定控制逻辑程序集对应的高级编程语言数据结构文本;将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果。The non-volatile storage medium performs the following functions: receiving control logic program data set, wherein the control logic program data set includes: tag table and control logic program set, and the control logic program set includes: engineering block information, engineering block The connection relationship between the project blocks includes: bit number and function block; determine the high-level programming language data structure text corresponding to the control logic assembly; convert the high-level programming language data structure text corresponding to the control logic assembly into the target program, according to the target program Simulation results are determined for the control logic to be simulated.

本申请实施例还提供了一种电子设备,包括:存储器和处理器,处理器用于运行存储在存储器中的程序,其中,程序运行时执行以上的控制逻辑的仿真方法。The embodiment of the present application also provides an electronic device, including: a memory and a processor, and the processor is used to run a program stored in the memory, wherein the above emulation method of the control logic is executed when the program is running.

处理器用于运行执行以下功能的程序:接收控制逻辑程序数据集,其中,控制逻辑程序数据集包括:位号表和控制逻辑程序集,控制逻辑程序集包括:工程块信息、工程块之间的连接关系,工程块包括:位号和功能块;确定控制逻辑程序集对应的高级编程语言数据结构文本;将控制逻辑程序集对应的高级编程语言数据结构文本转换为目标程序,根据目标程序确定待仿真的控制逻辑的仿真结果。The processor is used to run programs that perform the following functions: receive control logic program data sets, wherein the control logic program data sets include: tag table and control logic program sets, and the control logic program sets include: engineering block information, communication between engineering blocks Connection relationship, engineering block includes: bit number and function block; determine the high-level programming language data structure text corresponding to the control logic assembly; convert the high-level programming language data structure text corresponding to the control logic assembly into the target program, determine the target program according to the target program Simulation results for the simulated control logic.

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.

在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative. For example, the division of the units may be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务端或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of this application or the part that contributes to the related technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. Several instructions are included to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes. .

以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above description is only the preferred embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, some improvements and modifications can also be made. These improvements and modifications are also It should be regarded as the protection scope of this application.

Claims (10)

1. A method of simulating control logic, comprising:
receiving a control logic program data set, wherein the control logic program data set comprises: a bit number table and a control logic program set, the control logic program set comprising: engineering block information and connection relation among the engineering blocks, wherein the engineering blocks comprise: bit number and function block;
determining a high-level programming language data structure text corresponding to the control logic program set;
and converting the high-level programming language data structure text corresponding to the control logic program set into a target program, and determining a simulation result of the control logic to be simulated according to the target program.
2. The method of claim 1, wherein determining the high-level programming language data structure text corresponding to the set of control logic programs comprises:
determining a high-level programming language data structure text corresponding to the bit number table;
Determining a target control logic program in the control logic program set, and determining the execution sequence of the engineering blocks in the target control logic program and the high-level programming language data structure text corresponding to the functional blocks;
determining the high-level programming language data structure text corresponding to the target control logic program according to the execution sequence, the high-level programming language data structure text corresponding to the bit number table and the high-level programming language data structure text corresponding to the functional block;
and determining the high-level programming language data structure text corresponding to the control logic program set according to the high-level programming language data structure text corresponding to the target control logic program.
3. The method of claim 2, wherein determining the high-level programming language data structure text corresponding to the bit number table comprises:
determining the type of a target data storage mode corresponding to the bit number table, wherein the target data storage mode is a data storage mode of a high-level programming language;
determining the bit number in the bit number table as a target variable in the target data storage mode according to the type of the target data storage mode corresponding to the bit number table;
And determining a high-level programming language data structure text corresponding to the bit number table according to the type of the target data storage mode corresponding to the bit number table and the target variable.
4. The method of claim 2, wherein determining the order of execution of the engineering blocks in the target control logic program comprises:
determining a first connection relationship between the engineering blocks according to the target control logic program;
step S1, determining a first engineering block according to the first connection relation, wherein the first engineering block is the engineering block without an input source in the first connection relation, and determining the execution sequence of the first engineering block as a first sub-execution sequence;
step S2, removing the first engineering block and the connection relation between the first engineering block and other engineering blocks to obtain a second connection relation between the engineering blocks;
step S3, determining a second engineering block according to the second connection relation, wherein the second engineering block is the engineering block without an input source in the second connection relation, and determining the execution sequence of the second engineering block as a second sub-execution sequence;
Repeating the steps S1 to S3 until all n engineering blocks in the target control logic program are removed, so as to obtain n sub-execution sequences, wherein n is a positive integer;
and determining the execution sequence of the engineering blocks in the target control logic program according to the n sub-execution sequences.
5. The method of claim 2, wherein prior to determining the high-level programming language data structure text corresponding to the functional block, the method further comprises:
determining pin information of the functional block in the target control logic program;
determining a symbol table of a target logic control standard corresponding to the pin information;
and judging the correctness of the control logic program corresponding to the functional block according to the symbol table.
6. The method of claim 1, wherein after determining a simulation result of the control logic to be simulated according to the target program, the method further comprises: and sending the simulation result of the control logic to be simulated to a client.
7. A simulation system of control logic, comprising: a client side and a server side, wherein,
the client is in communication connection with the server and is used for determining a bit number table and a control logic program set as a control logic program data set and sending the control logic program data set to the server through a network hypertext transfer protocol, wherein the control logic program set comprises: engineering block information and connection relation among the engineering blocks, wherein the engineering blocks comprise: bit number and function block;
The server is configured to execute the simulation method of the control logic according to any one of claims 1 to 6.
8. A simulation apparatus of control logic, comprising:
a receiving module, configured to receive a control logic program data set, where the control logic program data set includes: a bit number table and a control logic program set, the control logic program set comprising: engineering block information and connection relation among the engineering blocks, wherein the engineering blocks comprise: bit number and function block;
the first determining module is used for determining a high-level programming language data structure text corresponding to the control logic program set;
and the second determining module is used for converting the high-level programming language data structure text corresponding to the control logic program set into a target program and determining a simulation result of the control logic to be simulated according to the target program.
9. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls a device in which the non-volatile storage medium is located to perform a simulation method of the control logic of any of claims 1 to 6.
10. An electronic device, comprising: a memory and a processor for running a program stored in the memory, wherein the program runs to perform the simulation method of the control logic of any one of claims 1 to 6.
CN202211608900.5A 2022-12-14 2022-12-14 Control logic simulation method, system, device, and nonvolatile storage medium Pending CN116224826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211608900.5A CN116224826A (en) 2022-12-14 2022-12-14 Control logic simulation method, system, device, and nonvolatile storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211608900.5A CN116224826A (en) 2022-12-14 2022-12-14 Control logic simulation method, system, device, and nonvolatile storage medium

Publications (1)

Publication Number Publication Date
CN116224826A true CN116224826A (en) 2023-06-06

Family

ID=86579348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211608900.5A Pending CN116224826A (en) 2022-12-14 2022-12-14 Control logic simulation method, system, device, and nonvolatile storage medium

Country Status (1)

Country Link
CN (1) CN116224826A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160098505A1 (en) * 2014-10-06 2016-04-07 Synopsys, Inc. Efficient emulation and logic analysis
CN113722563A (en) * 2021-09-01 2021-11-30 浙江中控技术股份有限公司 Method and device for displaying maps of configuration data signal streams of multi-industry control system
CN114238107A (en) * 2021-12-14 2022-03-25 北京天融信网络安全技术有限公司 Tracking debugging method, system and computer readable storage medium
CN114968347A (en) * 2021-02-20 2022-08-30 腾讯科技(深圳)有限公司 Stack restoring method and device, storage medium and electronic equipment
CN115033473A (en) * 2022-04-27 2022-09-09 交控科技股份有限公司 Testing method and device based on software downtime location

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160098505A1 (en) * 2014-10-06 2016-04-07 Synopsys, Inc. Efficient emulation and logic analysis
CN114968347A (en) * 2021-02-20 2022-08-30 腾讯科技(深圳)有限公司 Stack restoring method and device, storage medium and electronic equipment
CN113722563A (en) * 2021-09-01 2021-11-30 浙江中控技术股份有限公司 Method and device for displaying maps of configuration data signal streams of multi-industry control system
CN114238107A (en) * 2021-12-14 2022-03-25 北京天融信网络安全技术有限公司 Tracking debugging method, system and computer readable storage medium
CN115033473A (en) * 2022-04-27 2022-09-09 交控科技股份有限公司 Testing method and device based on software downtime location

Similar Documents

Publication Publication Date Title
US8577928B2 (en) Partitioning for model-based design
CN103823666B (en) Smart substation equipment visualized programming method
CN101957745B (en) Method for converting ladder diagram language into structure text language
CN102375778B (en) Method and system for automatically testing digital signal processor (DSP)
US20170132194A1 (en) Information-processing equipment based on a spreadsheet
CN106095376B (en) A kind of implementation method of quick configuration monitoring picture
CN102646035A (en) Visualized code generation method based on combination of API (application programming interface) and script definition
Pohlmann et al. Generating functional mockup units from software specifications
CN112433702B (en) Lightweight process design system and method
Sobrino et al. Into the early steps of virtual commissioning in tecnomatix plant simulation using S7-PLCSIM Advanced and STEP 7 TIA portal
CN111158680A (en) Page construction method, device, equipment and storage medium
CN102929636B (en) A kind of human-computer interaction interface creation method and device
CN102629213B (en) Analysis method and monitoring method for C language simulation model
Oppelt et al. Capability-analysis of co-simulation approaches for process industries
Preisig A graph-theory-based approach to the analysis of large-scale plants
CN116224826A (en) Control logic simulation method, system, device, and nonvolatile storage medium
CN114238072A (en) HIL requirements design method, apparatus, computer equipment and storage medium
Luder et al. Formal models for the verification of IEC 61499 function block based control applications
US12530522B2 (en) Method and system for generating an automation engineering project in a technical installation using multidisciplinary approach
Andrén et al. Towards automated engineering and validation of cyber-physical energy systems
CN112966457B (en) Graphical cloud development platform
CN113075915A (en) Em-plant based virtual simulation implementation method, system and equipment
Bezdeka et al. Sequence chart studio
CN111709118B (en) Nuclear power simulation data cooperation method and device
Kukkala et al. Performance modeling and reporting for the UML 2.0 design of embedded systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: No. 309 Liuhe Road, Binjiang District, Hangzhou City, Zhejiang Province (High tech Zone)

Applicant after: Zhongkong Technology Co.,Ltd.

Address before: No. six, No. 309, Binjiang District Road, Hangzhou, Zhejiang

Applicant before: ZHEJIANG SUPCON TECHNOLOGY Co.,Ltd.

Country or region before: China

CB02 Change of applicant information