WO2018210007A1 - Configuration debugger implementation method for use with virtual controller - Google Patents

Configuration debugger implementation method for use with virtual controller Download PDF

Info

Publication number
WO2018210007A1
WO2018210007A1 PCT/CN2018/074904 CN2018074904W WO2018210007A1 WO 2018210007 A1 WO2018210007 A1 WO 2018210007A1 CN 2018074904 W CN2018074904 W CN 2018074904W WO 2018210007 A1 WO2018210007 A1 WO 2018210007A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
breakpoint
page
virtual controller
debugger
Prior art date
Application number
PCT/CN2018/074904
Other languages
French (fr)
Chinese (zh)
Inventor
吴波
卢海松
牛洪海
徐卫峰
臧峰
Original Assignee
南京南瑞继保电气有限公司
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 南京南瑞继保电气有限公司 filed Critical 南京南瑞继保电气有限公司
Publication of WO2018210007A1 publication Critical patent/WO2018210007A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • 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]

Definitions

  • the invention belongs to the field of industrial automation control, and in particular relates to simulation debugging of a virtual controller used in an industrial process control system.
  • the virtual controller functions as a functional simulation software for industrial process controllers, and has the functions of logic configuration and basic debugging in the simulation controller.
  • the simulation debugging of complex control logic only by real-time monitoring the trend of variable changes of its operation, often the debugging efficiency is low, and it is impossible to accurately and effectively locate the defects of the logic.
  • the invention provides a configuration debugger implementation method of a virtual controller, which is based on an explanation execution mechanism of the algorithm configuration, and uses the modularity of the algorithm logic to store it as a series of logical configuration pages, each The logical configuration page consists of common module classes arranged according to the logical sequence of the algorithm. On this basis, the logical configuration page number and the in-page module sequence number are encapsulated into configuration breakpoint information, so as to design the configuration breakpoint technology and implement a series of debugging functions of the debugger.
  • the method is applicable to the virtual controller of the interpreted simulation, and can be implemented on the logic of the control algorithm configured by any programming language such as the sequential function diagram, the function block, the ladder diagram, the structured text and the instruction list, and specifically includes the following step:
  • the real-time operation monitoring function can be realized by periodically reading the module data set of the logic configuration page;
  • the breakpoint setting function of the debugger is realized by setting the configuration breakpoint information
  • e Define a list of configured breakpoints and store configuration breakpoint information; when the virtual controller performs control algorithm simulation, determine whether the breakpoint is hit or not by traversing the configured breakpoint list to determine whether the simulation is paused;
  • the debugger in the virtual controller converts it into a temporary configuration breakpoint, and implements the relevant debugging command function according to the breakpoint hit condition;
  • the debug software sends the delete breakpoint command, deletes the specified breakpoint in the configuration breakpoint list; delivers all breakpoint instructions, deletes all breakpoints in the configured breakpoint list.
  • the modular storage structure as described in the foregoing step a) supports one or more programming languages in a sequential function diagram, a function block diagram, a ladder diagram, a structured text, and/or an instruction list.
  • the logical configuration pages in the above step b) are numbered sequentially, and there may be empty pages in the middle.
  • the modules in each logical configuration page are numbered sequentially, and there is no empty module in the middle.
  • step e When a breakpoint hit in step e) above, the logic simulation will suspend execution while refreshing the start information of the simulation execution.
  • step f) above converts the page-by-page, module-by-module, and next-step debugging instructions into temporary configuration breakpoint information storage, or after the debugger receives the execution instruction, it will start from the new simulation start information. Continue the simulation.
  • step f) When the temporary breakpoint in step f) is hit, the debugger will automatically delete the temporary configuration breakpoint from the configured breakpoint list, and the logic simulation pauses execution, refreshing the start information of the simulation execution.
  • Step g) further includes: when all the breakpoints are cleared, the debugger receives the instruction to continue executing, the debugger debugging function ends, and the virtual controller enters the continuous cycle simulation running state.
  • the beneficial effects of the present invention are: based on the algorithmic explanation execution mechanism, using its inherent modularity, designing the configuration storage structure, implementing the configuration breakpoint technology, and succeeding in the virtual controller
  • the debugger function is implemented.
  • the invention does not change the source file of the algorithm configuration, and maintains the consistency before and after the logic debugging of the algorithm, not only ensures the reliability of the debugging result, but also minimizes the running disturbance of the virtual controller.
  • FIG. 1 Schematic diagram of the configuration structure of the control logic
  • Figure 2 is a schematic diagram of a list of configuration breakpoint information
  • FIG. 3 is a preprocessing flowchart of the debug instruction
  • Figure 4 shows the simulation task flow diagram embedded in the debugger.
  • control algorithm logic based on the interpretation execution mechanism in the virtual controller is organically organized into a structure based on the logical configuration page and the in-page module storage.
  • configuration breakpoint information structure is defined, and a technical method of configuring breakpoints is proposed to realize the debugger function in the virtual controller.
  • the whole method is defined from the design and implementation process, and mainly contains three parts, which are described as follows.
  • control algorithm logic in the virtual controller is generally similar to the implementation mechanism of the industrial controller. Therefore, its configuration logic is usually implemented in five programming languages based on the IEC61131-3 standard, namely sequential function diagram, function block diagram, ladder diagram, structured text and instruction list.
  • the configuration algorithm logic usually contains thousands or even tens of thousands of algorithm function blocks and connections, so in order to facilitate management editing, it is generally divided. Configure pages for multiple logics.
  • Each logical configuration page is usually composed of a wired configuration and an algorithm function block configuration.
  • each logical configuration page can be divided into sequential queues of a series of modular storage structures according to the execution order of the algorithm function blocks.
  • each logical configuration page there can be hundreds of pages of logical configuration per virtual controller, which may contain empty pages. There are 0 to hundreds of modular storage structures in each logical configuration page.
  • the virtual controller executes the sequence of the cycle trigger algorithm logic according to the clock interrupt. That is, according to the increasing order of the logical configuration page numbers, the empty pages are automatically skipped, and each logical configuration page is sequentially interpreted in the order of the modular storage structure.
  • the logical configuration page can be similar to the logical POU number, and the in-page module number is similar to the logical instruction label in the POU.
  • the virtual controller describes the control algorithm logic according to the foregoing configuration structure, which is executed in order from the front to the back of the module and the logical configuration page from small to large. Therefore, the logical configuration page number and the in-page module sequence number package are defined as the data structure for configuring the breakpoint information.
  • a list of configured breakpoint information is defined in the virtual controller, as shown in Figure 2.
  • the debug software adds and removes breakpoints by managing the list of configured breakpoint information.
  • the virtual controller executes a modular storage structure for each interpretation, and traverses the query configuration breakpoint information list according to its number to determine whether to interrupt the interrupt point, and then determines whether it needs to enter the simulation pause state. .
  • a temporary configuration breakpoint information list is specifically defined.
  • the debugger unit receives the instructions of the debug software, it converts it into configuration breakpoint information and stores it in the temporary configuration breakpoint information list.
  • the virtual controller's debugger function implementation can be divided into two sub-functions: debug instruction pre-processing and debugging functions.
  • the debugging instruction preprocessing mainly refers to that the debugger receives the debugging instruction information sent by the debugging software, and converts the preprocessing into the configuration breakpoint information and the simulation task control information.
  • the debugger's various debugging instructions can be divided into the following four categories:
  • the debugging instruction preprocessing mainly includes the following method steps: First, the debugger receives the debugging instruction information through network communication, and completes step 301. Then, according to step 302, it is judged whether it is a single step execution instruction. If the instruction is stepped, the process proceeds to step 303, otherwise, the process proceeds to step 304.
  • step 303 according to the single-step execution instruction, the simulation start position is set as the first module of the first logical configuration page, and then proceeds to step 312 to set the debug status flag, and the pre-processing of the instruction ends.
  • step 304 it is determined whether the debug instruction is a page-by-page, module-by-module execution instruction. If yes, go to step 305, otherwise go to step 306.
  • step 305 according to the position information of the last simulation exit, the instructions are executed page by page and module by module, converted into temporary configuration breakpoint information, and stored in the temporary configuration breakpoint queue. Then, proceeding to step 312, the debug status flag is set, and the pre-processing of the instruction ends.
  • Step 306 is taken to determine whether the debug command is a breakpoint setting, deletion, or all delete command. If yes, go to step 307, otherwise go to step 308.
  • step 307 according to the content of the instruction, the configuration breakpoint queue is fixedly added, deleted or cleared. Then proceed to step 312 to set the debug flag, and the pre-processing of this instruction ends.
  • Step 308 is taken to determine whether the debug instruction is to continue executing the instruction. If yes, go to step 309, otherwise it is another illegal debugging instruction, and the pre-processing of this instruction ends.
  • step 309 according to the execution of the instruction, it is determined whether the configuration breakpoint information queue is empty. If it is empty, proceed to step 313, the single-step debugging process ends, and the debug status flag is cleared. Otherwise, proceed to step 312 to set the debug status flag, and the pre-processing of this instruction ends.
  • the simulation operation task flow diagram embedded with the debugger function includes the following method steps: First, proceed to step 401 to start the loop from the simulation start position.
  • step 402 the virtual controller interprets and executes the algorithm block function according to the modular storage structure information.
  • step 403 determines whether or not the configuration breakpoint is hit. If it hits, it proceeds to step 407, otherwise it proceeds to step 404.
  • the simulation task exits the execution state, and records the exit location information, and the simulation ends.
  • step 404 if the configuration breakpoint is missed, it is further determined whether the temporary configuration breakpoint is hit. If it hits, it proceeds to step 405, otherwise it proceeds to step 406.
  • step 405 the hit temporary configuration breakpoint in the temporary configuration breakpoint information queue is deleted, and then the exit location information is recorded, and the simulation task exits the execution state, and the simulation ends.
  • step 406 if the temporary configuration breakpoint is not hit, it is further determined whether the logic simulation of the current control algorithm is executed to the last module. If the simulation has executed the last module, then step 408 is entered, otherwise proceeds to step 402 to continue the simulation execution of the next module.
  • step 408 it is determined whether the simulation needs to be continued after the simulation, in order to satisfy the page-by-page, module-by-module, and continuous execution after setting the breakpoint, the debugger can automatically jump from the last page configuration to the first time as needed. A one-page configuration continues to execute.
  • step 401 the process jumps to step 401, and the above steps are repeated. Otherwise, the simulation task exits the execution state and the simulation ends.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Manufacturing & Machinery (AREA)
  • Automation & Control Theory (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Provided in the present invention is a configuration debugger implementation method for use with a virtual controller, the method comprising: storing algorithm logic of a virtual controller as a logic configuration page and a sequence which is sequentially stored by a module in the page, and accordingly defining a configuration breakpoint data structure; defining a logic configuration page file on the basis of a modular storage structure, and monitoring real-time data of a virtual controller; on the basis of the foregoing, implementing a breakpoint configuration function of a debugger by means of issuing configuration breakpoint information; at the same time, defining a configuration breakpoint list in the virtual controller, storing the configuration breakpoint information, and when executing a control algorithm simulation, determining whether a breakpoint is hit by means of traversing the configuration breakpoint list, and deciding whether the simulation is paused; the virtual controller converting page-by-page, module-by-module, and next-step debugging instruction information which is issued by debugging software into a temporary configuration breakpoint, and implementing said debugging instruction functions according to breakpoint hit logic; when debugging ends, the debugging software issuing an instruction to clear the configuration breakpoint list in the virtual controller.

Description

一种虚拟控制器的组态调试器实现方法Configuration method of virtual controller configuration debugger 技术领域Technical field
本发明属于工业自动化控制领域,尤其涉及用于工业过程控制系统中虚拟控制器的仿真调试。The invention belongs to the field of industrial automation control, and in particular relates to simulation debugging of a virtual controller used in an industrial process control system.
背景技术Background technique
在工业过程控制领域,虚拟控制器作为工业过程控制器的功能仿真软件,具有仿真控制器内逻辑组态和基本调试的功能。然而对于复杂控制逻辑的仿真调试,仅仅通过实时监视其运算的变量变化趋势,往往调试效率偏低,无法精准有效地定位逻辑的缺陷所在。In the field of industrial process control, the virtual controller functions as a functional simulation software for industrial process controllers, and has the functions of logic configuration and basic debugging in the simulation controller. However, for the simulation debugging of complex control logic, only by real-time monitoring the trend of variable changes of its operation, often the debugging efficiency is low, and it is impossible to accurately and effectively locate the defects of the logic.
为了解决这一问题,考虑在虚拟控制器软件中新增开发调试器功能。通过引入断点设置、单步执行等单步调试功能,实现对控制算法逻辑的单步、断点调试,提高调试效率,更有效地定位查找逻辑的缺陷所在。In order to solve this problem, consider adding a new development debugger function to the virtual controller software. By introducing single-step debugging functions such as breakpoint setting and single-step execution, single-step and breakpoint debugging of the control algorithm logic is realized, the debugging efficiency is improved, and the defects of the search logic are more effectively located.
目前,有的厂家在实际控制器中设计开发了一种工业控制系统逻辑断点调试功能的实现方法,实现了调试器的部分功能。该方法基于算法组态的编译执行机制,通过在算法编译时,对每一条原子操作指令均插入桩点信息,从而在上下位机联合调试时,利用桩点信息实现运行到断点Run to、单步Step In以及单步Step out三类调试指令。该方法实现的调试器功能并不全面,而且桩点信息的插入,导致算法组态源程序在调试前后有较大变动。算法组态源程序的不一致性,不仅会导致算法调试结果的截然不同,而且对控制器的运行带来较大的扰动。At present, some manufacturers have designed and developed an implementation method of the logic breakpoint debugging function of the industrial control system in the actual controller, and realized some functions of the debugger. The method is based on the compiler execution mechanism of the algorithm configuration. When the algorithm is compiled, the pile point information is inserted into each atomic operation instruction, so that when the upper and lower machines are jointly debugged, the pile point information is used to realize the run to the breakpoint Run to, Single step Step In and single step Step out three types of debugging instructions. The debugger function implemented by this method is not comprehensive, and the insertion of the pile point information causes the algorithm configuration source program to have large changes before and after debugging. The inconsistency of the algorithm configuration source program not only causes the algorithm debugging results to be completely different, but also causes a large disturbance to the controller's operation.
此外,在现有工控厂家的虚拟控制器软件中,往往并不支持调试器功能。In addition, in the virtual controller software of existing industrial control manufacturers, the debugger function is often not supported.
发明内容Summary of the invention
本发明提供了一种虚拟控制器的组态调试器实现方法,该方法基于算法组态的解释执行机制,利用算法逻辑的模块化特性,将其存储为一系列的逻辑组态页,每个逻辑组态页由常用模块类根据算法逻辑顺序排列组成。在此基础上,将逻辑组态页编号和页内模块顺序编号,封装为组态断点信息,以此设计组态断点技术,实现调试器的一系列调试功能。The invention provides a configuration debugger implementation method of a virtual controller, which is based on an explanation execution mechanism of the algorithm configuration, and uses the modularity of the algorithm logic to store it as a series of logical configuration pages, each The logical configuration page consists of common module classes arranged according to the logical sequence of the algorithm. On this basis, the logical configuration page number and the in-page module sequence number are encapsulated into configuration breakpoint information, so as to design the configuration breakpoint technology and implement a series of debugging functions of the debugger.
该方法适用于解释型仿真的虚拟控制器中,可在由顺序功能图、功能块、梯形图、结构化文本和指令表等任一种编程语言组态的控制算法逻辑上实现,具体包含以下步骤:The method is applicable to the virtual controller of the interpreted simulation, and can be implemented on the logic of the control algorithm configured by any programming language such as the sequential function diagram, the function block, the ladder diagram, the structured text and the instruction list, and specifically includes the following step:
a)定义模块化的存储结构,将虚拟控制器中控制算法逻辑存储为逻辑组态页和页内模块顺序存储的序列;a) defining a modular storage structure, storing the control algorithm logic in the virtual controller as a sequence of logical configuration pages and sequential storage of modules within the page;
b)定义逻辑组态页编号和页内模块顺序编号为组态断点的数据结构;b) define the logical configuration page number and the in-page module sequence number as the data structure of the configured breakpoint;
c)基于所述模块化的存储结构生成逻辑组态页文件,下载到虚拟控制器中运行后,通过周期性读取逻辑组态页的模块数据集,即可实现实时运行监视功能;c) generating a logical configuration page file based on the modular storage structure, and after downloading to the virtual controller, the real-time operation monitoring function can be realized by periodically reading the module data set of the logic configuration page;
d)基于实时运行监视的前提,通过设置下发组态断点信息,实现调试器的断点设置功能;d) Based on the premise of real-time running monitoring, the breakpoint setting function of the debugger is realized by setting the configuration breakpoint information;
e)定义组态断点列表,存储组态断点信息;虚拟控制器执行控制算法仿真时,通过遍历组态断点列表,判定断点是否命中,决定仿真是否暂停;e) Define a list of configured breakpoints and store configuration breakpoint information; when the virtual controller performs control algorithm simulation, determine whether the breakpoint is hit or not by traversing the configured breakpoint list to determine whether the simulation is paused;
f)调试软件下发逐页、逐模块、下一步的调试指令信息时,虚拟控制器中调试器将其转化为临时组态断点,依据断点命中条件,实现相关调试指令功能;f) When the debugging software issues the page-by-page, module-by-module, and next-step debugging instruction information, the debugger in the virtual controller converts it into a temporary configuration breakpoint, and implements the relevant debugging command function according to the breakpoint hit condition;
g)调试软件下发删除断点指令,删除组态断点列表中指定断点;下发清除所有断点指令,删除组态断点列表中所有断点。g) The debug software sends the delete breakpoint command, deletes the specified breakpoint in the configuration breakpoint list; delivers all breakpoint instructions, deletes all breakpoints in the configured breakpoint list.
如前述步骤a)中所述的模块化存储结构,支持顺序功能图、功能块图、梯形图、结构化文本和/或指令表中的一种或多种编程语言。The modular storage structure as described in the foregoing step a) supports one or more programming languages in a sequential function diagram, a function block diagram, a ladder diagram, a structured text, and/or an instruction list.
如前述步骤a)中所述的逻辑组态页和页内模块顺序存储的序列,在采用除功能块图外的其他编程语言中,等价于逻辑POU号和POU内逻辑指令标号。The sequence of logical configuration pages and in-page module sequential storage as described in the foregoing step a), in other programming languages other than the function block diagram, is equivalent to the logical POU number and the logical instruction label in the POU.
如前述步骤b)中的逻辑组态页按顺序编号,中间可以存在空页,每个逻辑组态页内的模块,按照顺序编号,中间不存在空模块。The logical configuration pages in the above step b) are numbered sequentially, and there may be empty pages in the middle. The modules in each logical configuration page are numbered sequentially, and there is no empty module in the middle.
如前述步骤e)中的断点命中时,逻辑仿真将暂停执行,同时刷新仿真执行的起始信息。When a breakpoint hit in step e) above, the logic simulation will suspend execution while refreshing the start information of the simulation execution.
如前述步骤f)中的调试器将逐页、逐模块、下一步的调试指令转化为临时组态断点信息存储后,或者调试器接收到继续执行指令后,将从新的仿真起始信息处继续仿真。If the debugger in step f) above converts the page-by-page, module-by-module, and next-step debugging instructions into temporary configuration breakpoint information storage, or after the debugger receives the execution instruction, it will start from the new simulation start information. Continue the simulation.
如前述步骤f)中的临时断点命中时,调试器将自动从组态断点列表中删除该临时组态断点,同时逻辑仿真暂停执行,刷新仿真执行的起始信息。When the temporary breakpoint in step f) is hit, the debugger will automatically delete the temporary configuration breakpoint from the configured breakpoint list, and the logic simulation pauses execution, refreshing the start information of the simulation execution.
如前述步骤g)进一步包括:当所有断点都被清除后,调试器再接收到继续执行的指令时,调试器调试功能结束,虚拟控制器进入连续周期仿真运行状态。Step g) further includes: when all the breakpoints are cleared, the debugger receives the instruction to continue executing, the debugger debugging function ends, and the virtual controller enters the continuous cycle simulation running state.
与现有技术方法相比,本发明的有益效果是:基于算法逻辑的解释执行机制,利用其固有的模块化特性,设计组态存储结构,实现组态断点技术,在虚拟控制器中成功实现了调试器功能。本发明不改动算法组态的源文件,保持算法逻辑调试前后的一致性, 不仅可以确保调试结果的可靠性,而且对虚拟控制器的运行扰动降到了最低。Compared with the prior art method, the beneficial effects of the present invention are: based on the algorithmic explanation execution mechanism, using its inherent modularity, designing the configuration storage structure, implementing the configuration breakpoint technology, and succeeding in the virtual controller The debugger function is implemented. The invention does not change the source file of the algorithm configuration, and maintains the consistency before and after the logic debugging of the algorithm, not only ensures the reliability of the debugging result, but also minimizes the running disturbance of the virtual controller.
附图说明DRAWINGS
图1控制逻辑的组态结构示意图;Figure 1 Schematic diagram of the configuration structure of the control logic;
图2组态断点信息列表示意图;Figure 2 is a schematic diagram of a list of configuration breakpoint information;
图3调试指令预处理流程图;Figure 3 is a preprocessing flowchart of the debug instruction;
图4嵌入调试器的仿真任务流程图。Figure 4 shows the simulation task flow diagram embedded in the debugger.
具体实施方式detailed description
为使本发明的上述内容、特征和优点能够更加清晰易懂,下面结合附图对本发明的详细实施步骤做具体的说明。The detailed description of the embodiments of the present invention will be described in detail with reference to the accompanying drawings.
本发明按照模块化的方法,将虚拟控制器中基于解释执行机制的控制算法逻辑,有机组织成基于逻辑组态页及页内模块顺序存储的结构。在此基础上,定义组态断点信息结构,提出一种组态断点的技术方法,实现虚拟控制器中的调试器功能。According to the modular method, the control algorithm logic based on the interpretation execution mechanism in the virtual controller is organically organized into a structure based on the logical configuration page and the in-page module storage. On this basis, the configuration breakpoint information structure is defined, and a technical method of configuring breakpoints is proposed to realize the debugger function in the virtual controller.
整个方法从设计和实现的过程定义,主要包含三个部分内容,分别描述如下。The whole method is defined from the design and implementation process, and mainly contains three parts, which are described as follows.
一、控制逻辑的组态结构First, the configuration structure of the control logic
虚拟控制器中的控制算法逻辑,一般和工业控制器的实现机制类似。所以其组态逻辑,通常是基于IEC61131-3标准的五种编程语言实现,即顺序功能图、功能块图、梯形图、结构化文本和指令表。The control algorithm logic in the virtual controller is generally similar to the implementation mechanism of the industrial controller. Therefore, its configuration logic is usually implemented in five programming languages based on the IEC61131-3 standard, namely sequential function diagram, function block diagram, ladder diagram, structured text and instruction list.
以功能块图组态的逻辑为例,由于组态逻辑的复杂性,导致组态算法逻辑通常含有数千个甚至上万个算法功能块及连线,所以为了便于管理编辑,一般将其划分为多个逻辑组态页。Taking the logic of the function block diagram as an example, due to the complexity of the configuration logic, the configuration algorithm logic usually contains thousands or even tens of thousands of algorithm function blocks and connections, so in order to facilitate management editing, it is generally divided. Configure pages for multiple logics.
每个逻辑组态页,通常由连线组态和算法功能块组态构成。算法功能块输入端的连线,表示其输入变量的引用源。因此可将“输入端连线+算法功能块”封装定义为一个整体的模块化存储结构。Each logical configuration page is usually composed of a wired configuration and an algorithm function block configuration. The line connecting the input of the algorithm function block, indicating the reference source of its input variable. Therefore, the "input connection + algorithm function block" package can be defined as a whole modular storage structure.
基于这种方法,每个逻辑组态页,可根据算法功能块的执行顺序,划分为一系列模块化存储结构的顺序队列。Based on this method, each logical configuration page can be divided into sequential queues of a series of modular storage structures according to the execution order of the algorithm function blocks.
如图1所示,每个虚拟控制器中可有数百页逻辑组态,其中可能含有空页。每个逻辑组态页中,存在0~数百个不等的模块化存储结构。虚拟控制器在执行逻辑仿真时,根据时钟中断,周期触发算法逻辑的顺序执行。即按照逻辑组态页号的增长顺序执行,空页则自动执行跳过,每个逻辑组态页内按照模块化存储结构的顺序依次解释执行。As shown in Figure 1, there can be hundreds of pages of logical configuration per virtual controller, which may contain empty pages. There are 0 to hundreds of modular storage structures in each logical configuration page. When the virtual controller performs logic simulation, it executes the sequence of the cycle trigger algorithm logic according to the clock interrupt. That is, according to the increasing order of the logical configuration page numbers, the empty pages are automatically skipped, and each logical configuration page is sequentially interpreted in the order of the modular storage structure.
在其他几种编程语言中,逻辑组态页可类同为逻辑POU号,而页内模块编号类同为POU内逻辑指令标号。In several other programming languages, the logical configuration page can be similar to the logical POU number, and the in-page module number is similar to the logical instruction label in the POU.
二、组态断点技术Second, configure breakpoint technology
虚拟控制器按照前述组态结构描述控制算法逻辑,是按照模块从前到后、逻辑组态页从小到大的顺序依次执行的。因此将逻辑组态页编号和页内模块顺序编号封装定义为组态断点信息的数据结构。The virtual controller describes the control algorithm logic according to the foregoing configuration structure, which is executed in order from the front to the back of the module and the logical configuration page from small to large. Therefore, the logical configuration page number and the in-page module sequence number package are defined as the data structure for configuring the breakpoint information.
基于组态断点信息的数据结构,在虚拟控制器中定义组态断点信息列表,如图2所示。调试软件通过管理操纵该组态断点信息列表,来新增和删除断点。Based on the data structure of the configuration breakpoint information, a list of configured breakpoint information is defined in the virtual controller, as shown in Figure 2. The debug software adds and removes breakpoints by managing the list of configured breakpoint information.
另一方面,虚拟控制器在执行逻辑仿真时,每解释执行一个模块化存储结构,则根据其编号,遍历查询组态断点信息列表,判断是否命中断点,进而确定是否需要进入仿真暂停状态。On the other hand, when performing a logic simulation, the virtual controller executes a modular storage structure for each interpretation, and traverses the query configuration breakpoint information list according to its number to determine whether to interrupt the interrupt point, and then determines whether it needs to enter the simulation pause state. .
此外,为了实现调试器中的逐页、逐模块、下一步的调试功能,特别定义临时组态断点信息列表。调试器单元在接收到调试软件的指令,会将其转化成组态断点信息,存入临时组态断点信息列表。In addition, in order to implement the page-by-page, module-by-module, and next-step debugging functions in the debugger, a temporary configuration breakpoint information list is specifically defined. When the debugger unit receives the instructions of the debug software, it converts it into configuration breakpoint information and stores it in the temporary configuration breakpoint information list.
如此一来,这些调试指令的执行,均转换成组态断点命中规则的实现。但唯一区别之处在于,临时组态断点信息列表中的断点,一旦命中之后,则会自动删除。As a result, the execution of these debug instructions is converted to the implementation of the configuration breakpoint hit rule. The only difference is that the breakpoints in the temporary configuration breakpoint information list are automatically deleted once they are hit.
三、调试器实现方法Third, the debugger implementation method
虚拟控制器的调试器功能实现,可分为调试指令预处理及调试功能实现两个子功能。其中调试指令预处理主要是指,调试器接收调试软件下发的调试指令信息,并将其预处理转换成组态断点信息和仿真任务控制信息。The virtual controller's debugger function implementation can be divided into two sub-functions: debug instruction pre-processing and debugging functions. The debugging instruction preprocessing mainly refers to that the debugger receives the debugging instruction information sent by the debugging software, and converts the preprocessing into the configuration breakpoint information and the simulation task control information.
根据组态断点技术,调试器的各类调试指令可以分为以下四类:According to the configuration breakpoint technology, the debugger's various debugging instructions can be divided into the following four categories:
(1)单步执行;(1) Single step execution;
(2)逐页、逐模块执行;(2) page-by-page, module-by-module execution;
(3)断点设置、删除、全部删除;(3) Breakpoint setting, deletion, and deletion;
(4)继续执行。(4) Continue to execute.
如图3所示,调试指令预处理主要包含以下方法步骤:首先调试器通过网络通讯接收到调试指令信息,完成步骤301。接着按照步骤302,判断是否是单步执行指令。若是单步执行指令,则进入步骤303,否则进入步骤304。As shown in FIG. 3, the debugging instruction preprocessing mainly includes the following method steps: First, the debugger receives the debugging instruction information through network communication, and completes step 301. Then, according to step 302, it is judged whether it is a single step execution instruction. If the instruction is stepped, the process proceeds to step 303, otherwise, the process proceeds to step 304.
承接步骤303,根据单步执行指令,设置仿真起始位置为首个逻辑组态页的首个模块,接着进入步骤312,设置调试状态标记,本次指令预处理结束。In step 303, according to the single-step execution instruction, the simulation start position is set as the first module of the first logical configuration page, and then proceeds to step 312 to set the debug status flag, and the pre-processing of the instruction ends.
承接步骤304,判断调试指令是否是逐页、逐模块执行指令。若是,则进入步骤305,否则进入步骤306。In step 304, it is determined whether the debug instruction is a page-by-page, module-by-module execution instruction. If yes, go to step 305, otherwise go to step 306.
承接步骤305,根据上次仿真退出的位置信息,将逐页、逐模块执行指令,转换成临时组态断点信息,存入临时组态断点队列。随后进入步骤312,设置调试状态标记,本次指令预处理结束。In step 305, according to the position information of the last simulation exit, the instructions are executed page by page and module by module, converted into temporary configuration breakpoint information, and stored in the temporary configuration breakpoint queue. Then, proceeding to step 312, the debug status flag is set, and the pre-processing of the instruction ends.
承接步骤306,判断调试指令是否是断点设置、删除或全部删除指令。若是,则进 入步骤307,否则进入步骤308。Step 306 is taken to determine whether the debug command is a breakpoint setting, deletion, or all delete command. If yes, go to step 307, otherwise go to step 308.
承接步骤307,根据指令内容,对组态断点队列进行定点添加、删除或清空操作。随后进入步骤312,设置调试标记,本次指令预处理结束。In step 307, according to the content of the instruction, the configuration breakpoint queue is fixedly added, deleted or cleared. Then proceed to step 312 to set the debug flag, and the pre-processing of this instruction ends.
承接步骤308,判断调试指令是否是继续执行指令。若是,则进入步骤309,否则为其他非法调试指令,本次指令预处理结束。Step 308 is taken to determine whether the debug instruction is to continue executing the instruction. If yes, go to step 309, otherwise it is another illegal debugging instruction, and the pre-processing of this instruction ends.
承接步骤309,根据继续执行指令,判断组态断点信息队列是否为空。若为空,则进入步骤313,单步调试过程结束,清空调试状态标记。否则进入步骤312,设置调试状态标记,本次指令预处理结束。In step 309, according to the execution of the instruction, it is determined whether the configuration breakpoint information queue is empty. If it is empty, proceed to step 313, the single-step debugging process ends, and the debug status flag is cleared. Otherwise, proceed to step 312 to set the debug status flag, and the pre-processing of this instruction ends.
在完成调试指令预处理之后,虚拟控制器的仿真任务将被调试功能中断介入。详细流程图如图4所示。嵌入调试器功能的仿真运算任务流程图,包含以下方法步骤:首先,进入步骤401,从仿真起始位置开始循环。After the debug command pre-processing is completed, the virtual controller's simulation task will be interrupted by the debug function interrupt. The detailed flow chart is shown in Figure 4. The simulation operation task flow diagram embedded with the debugger function includes the following method steps: First, proceed to step 401 to start the loop from the simulation start position.
接着进入步骤402,虚拟控制器根据模块化存储结构信息进行解释执行算法块功能。解释执行结束后,进入步骤403,判断是否命中组态断点。若命中,则进入步骤407,否则进入步骤404。Next, proceeding to step 402, the virtual controller interprets and executes the algorithm block function according to the modular storage structure information. After the execution of the explanation is completed, the process proceeds to step 403 to determine whether or not the configuration breakpoint is hit. If it hits, it proceeds to step 407, otherwise it proceeds to step 404.
承接步骤407,命中组态断点后,仿真任务退出执行状态,记录退出位置信息,本次仿真结束。Following step 407, after hitting the configuration breakpoint, the simulation task exits the execution state, and records the exit location information, and the simulation ends.
承接步骤404,若未命中组态断点,则进一步判断是否命中临时组态断点。若命中,则进入步骤405,否则进入步骤406。In step 404, if the configuration breakpoint is missed, it is further determined whether the temporary configuration breakpoint is hit. If it hits, it proceeds to step 405, otherwise it proceeds to step 406.
承接步骤405,将临时组态断点信息队列中的已命中临时组态断点删除,然后记录退出位置信息,仿真任务退出执行状态,本次仿真结束。In step 405, the hit temporary configuration breakpoint in the temporary configuration breakpoint information queue is deleted, and then the exit location information is recorded, and the simulation task exits the execution state, and the simulation ends.
承接步骤406,若没有命中临时组态断点,则进一步判断本次控制算法逻辑仿真是否执行到最后一个模块。如果仿真已执行完最后一个模块,则进入步骤408,否则转入步骤402,继续下一个模块的仿真执行。In step 406, if the temporary configuration breakpoint is not hit, it is further determined whether the logic simulation of the current control algorithm is executed to the last module. If the simulation has executed the last module, then step 408 is entered, otherwise proceeds to step 402 to continue the simulation execution of the next module.
承接步骤408,判断本次仿真后是否需要继续仿真,目的是为了满足逐页、逐模块以及设置断点后的继续执行情况下,调试器能够根据需要自动从最后一页组态跳转到第一页组态继续执行。In step 408, it is determined whether the simulation needs to be continued after the simulation, in order to satisfy the page-by-page, module-by-module, and continuous execution after setting the breakpoint, the debugger can automatically jump from the last page configuration to the first time as needed. A one-page configuration continues to execute.
根据判断结果,若需要继续仿真,则跳转到步骤401,重复上述步骤。否则仿真任务退出执行状态,本次仿真结束。According to the judgment result, if it is necessary to continue the simulation, the process jumps to step 401, and the above steps are repeated. Otherwise, the simulation task exits the execution state and the simulation ends.

Claims (8)

  1. 一种虚拟控制器的组态调试器实现方法,其特征是,包含以下步骤:A configuration controller implementation method for a virtual controller, characterized in that the method comprises the following steps:
    a)定义模块化的存储结构,将虚拟控制器中控制算法逻辑存储为逻辑组态页和页内模块顺序存储的序列;a) defining a modular storage structure, storing the control algorithm logic in the virtual controller as a sequence of logical configuration pages and sequential storage of modules within the page;
    b)定义逻辑组态页编号和页内模块顺序编号为组态断点的数据结构;b) define the logical configuration page number and the in-page module sequence number as the data structure of the configured breakpoint;
    c)基于所述模块化的存储结构生成逻辑组态页文件,下载到虚拟控制器中运行后,通过周期性读取逻辑组态页的模块数据集,实现实时运行监视;c) generating a logical configuration page file based on the modular storage structure, downloading to the virtual controller, and periodically reading the module data set of the logical configuration page to realize real-time operation monitoring;
    d)基于实时运行监视,通过设置下发组态断点信息,实现调试器的断点设置;d) Based on the real-time running monitoring, the breakpoint setting of the debugger is realized by setting the configuration breakpoint information;
    e)定义组态断点列表,存储组态断点信息;虚拟控制器执行控制算法仿真时,通过遍历组态断点列表,判定断点是否命中,决定仿真是否暂停;e) Define a list of configured breakpoints and store configuration breakpoint information; when the virtual controller performs control algorithm simulation, determine whether the breakpoint is hit or not by traversing the configured breakpoint list to determine whether the simulation is paused;
    f)调试软件下发逐页、逐模块、下一步的调试指令信息时,虚拟控制器中调试器将其转化为临时组态断点,依据断点命中条件,实现相关调试指令功能;f) When the debugging software issues the page-by-page, module-by-module, and next-step debugging instruction information, the debugger in the virtual controller converts it into a temporary configuration breakpoint, and implements the relevant debugging command function according to the breakpoint hit condition;
    g)调试软件下发删除断点指令,删除组态断点列表中指定断点;下发清除所有断点指令,删除组态断点列表中所有断点。g) The debug software sends the delete breakpoint command, deletes the specified breakpoint in the configuration breakpoint list; delivers all breakpoint instructions, deletes all breakpoints in the configured breakpoint list.
  2. 如权利要求1所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤a)中的模块化的存储结构,支持顺序功能图、功能块图、梯形图、结构化文本和/或指令表中的一种或多种编程语言。The method for implementing a configuration debugger of a virtual controller according to claim 1, wherein: the modular storage structure in step a) supports sequential function diagram, function block diagram, ladder diagram, and structure One or more programming languages in the text and/or instruction list.
  3. 如权利要求1或2所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤a)中的逻辑组态页和页内模块顺序存储的序列,在采用除功能块图外的其他编程语言中,等价于逻辑POU号和POU内逻辑指令标号。The method for implementing a configuration debugger of a virtual controller according to claim 1 or 2, wherein the logical configuration page in step a) and the sequence stored in the module in the page are sequentially used in the function block. Among other programming languages outside the figure, it is equivalent to the logical POU number and the logical instruction label in the POU.
  4. 如权利要求1所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤b)的逻辑组态页按顺序编号,中间可存在空页,每个逻辑组态页内的模块,按照顺序编号,中间不存在空模块。The method for implementing a configuration debugger of a virtual controller according to claim 1, wherein the logical configuration page of step b) is sequentially numbered, and an empty page exists in the middle, and each logical configuration page is The modules are numbered sequentially, and there are no empty modules in the middle.
  5. 如权利要求1所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤e)的断点命中时,逻辑仿真将暂停执行,同时刷新仿真执行的起始信息。The configuration debugger implementation method of a virtual controller according to claim 1, wherein when the breakpoint of step e) is hit, the logic simulation suspends execution and refreshes the start information of the simulation execution.
  6. 如权利要求1所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤f)中的调试器将逐页、逐模块、下一步的调试指令转化为临时组态断点信息存储后,或者调试器接收到继续执行指令后,将从新的仿真起始信息处继续仿真。A configuration debugger implementation method for a virtual controller according to claim 1, wherein the debugger in step f) converts the page-by-page, module-by-module, and next-step debug instructions into temporary configuration breaks. After the point information is stored, or after the debugger receives the execution instruction, the simulation will continue from the new simulation start information.
  7. 如权利要求1所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤f)中的临时组态断点命中时,调试器将自动从组态断点列表中删除该临时断点,同时逻辑仿真暂停执行,刷新仿真执行的起始信息。The method for implementing a configuration debugger of a virtual controller according to claim 1, wherein when the temporary configuration breakpoint in step f) is hit, the debugger automatically deletes the list of configured breakpoints. The temporary breakpoint, while the logic simulation pauses execution, refreshes the start information of the simulation execution.
  8. 如权利要求1所述的一种虚拟控制器的组态调试器实现方法,其特征是:其中步骤g)进一步包括:当所有断点都被清除后,调试器再接收到继续执行的指令时,调试器调试结束,虚拟控制器进入连续周期仿真运行状态。The configuration debugger implementation method of a virtual controller according to claim 1, wherein the step g) further comprises: when all the breakpoints are cleared, the debugger receives the instruction to continue executing. After the debugger debugging ends, the virtual controller enters the continuous cycle simulation running state.
PCT/CN2018/074904 2017-05-18 2018-02-01 Configuration debugger implementation method for use with virtual controller WO2018210007A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710353053.5A CN108959058B (en) 2017-05-18 2017-05-18 Configuration debugger implementation method of virtual controller
CN201710353053.5 2017-05-18

Publications (1)

Publication Number Publication Date
WO2018210007A1 true WO2018210007A1 (en) 2018-11-22

Family

ID=64273304

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074904 WO2018210007A1 (en) 2017-05-18 2018-02-01 Configuration debugger implementation method for use with virtual controller

Country Status (2)

Country Link
CN (1) CN108959058B (en)
WO (1) WO2018210007A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111142469B (en) * 2019-12-27 2021-07-27 北京和利时智能技术有限公司 Debugging method and debugging system for PLC configuration program
CN113534682A (en) * 2020-04-16 2021-10-22 北京国电智深控制技术有限公司 Method and device for managing logic blocks in industrial controller
CN112363761B (en) * 2020-11-09 2022-08-02 西安热工研究院有限公司 Algorithm page variable reference method supporting dynamic relocation
CN113407160A (en) * 2021-05-17 2021-09-17 江苏航天七零六信息科技有限公司 Multi-language debugger design method oriented to domestic operating system and hardware platform

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101566839A (en) * 2009-06-01 2009-10-28 杭州电子科技大学 Realizing method of trapezoidal pattern embedded configuration algorithm
CN101877716A (en) * 2010-03-10 2010-11-03 艾默生网络能源有限公司 Customization method for configuration template, display method for configuration template and server
CN102279790A (en) * 2010-06-11 2011-12-14 国际商业机器公司 Distributed debugging method and system
CN103092585A (en) * 2011-11-04 2013-05-08 上海宝信软件股份有限公司 Image library configuration design system for integrated supervision software
CN104408263A (en) * 2014-12-09 2015-03-11 北京四方继保自动化股份有限公司 Graphic element grouping and ranking method for automatically processing closed loop
CN105676808A (en) * 2015-12-31 2016-06-15 北京四方继保自动化股份有限公司 Implementation method of logic breakpoint debugging function for industrial control system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9292417B2 (en) * 2013-08-07 2016-03-22 Raytheon Cyber Products, Llc System and method for hypervisor breakpoints
CN104332205A (en) * 2014-08-20 2015-02-04 中广核工程有限公司 Simulation method, device and system for sequence control function of nuclear auxiliary plant local control system
CN105095079B (en) * 2015-07-27 2018-01-12 电子科技大学 A kind of method and apparatus of hot spot module instruction trace
CN105930270B (en) * 2016-04-20 2018-12-21 杭州优稳自动化系统有限公司 A method of realizing the online configuration of algorithm, operation and debugging
CN106444607B (en) * 2016-10-09 2018-09-18 福州大学 Polyisocyanate structure industrial machine personal data communicates and control method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101566839A (en) * 2009-06-01 2009-10-28 杭州电子科技大学 Realizing method of trapezoidal pattern embedded configuration algorithm
CN101877716A (en) * 2010-03-10 2010-11-03 艾默生网络能源有限公司 Customization method for configuration template, display method for configuration template and server
CN102279790A (en) * 2010-06-11 2011-12-14 国际商业机器公司 Distributed debugging method and system
CN103092585A (en) * 2011-11-04 2013-05-08 上海宝信软件股份有限公司 Image library configuration design system for integrated supervision software
CN104408263A (en) * 2014-12-09 2015-03-11 北京四方继保自动化股份有限公司 Graphic element grouping and ranking method for automatically processing closed loop
CN105676808A (en) * 2015-12-31 2016-06-15 北京四方继保自动化股份有限公司 Implementation method of logic breakpoint debugging function for industrial control system

Also Published As

Publication number Publication date
CN108959058A (en) 2018-12-07
CN108959058B (en) 2020-07-28

Similar Documents

Publication Publication Date Title
WO2018210007A1 (en) Configuration debugger implementation method for use with virtual controller
Hermanns et al. The how and why of interactive Markov chains
CN109308213B (en) Multi-task breakpoint debugging method based on improved task scheduling mechanism
CN104898546B (en) A kind of PLC on-line debugging system and method based on SOC
JPH05224911A (en) Dynamic-instruction correcting and controlling apparatus
CN108897676B (en) Flight guidance control software reliability analysis system and method based on formalization rules
JPH02272645A (en) Method for supporting program debugging
CN104461871A (en) Deadlock detection method based on petri net
CN103679038B (en) Concurrent program shares detection method and the system of data class leak
US10466988B2 (en) Systems and methods for automatic computer code parallelization
CN101639805A (en) Method and equipment for tracing variable in program debugging
CN101685420B (en) Multithreading debugging method and device
Abdulla et al. Parameterized verification under TSO is PSPACE-complete
CN110175019A (en) A kind of interrupt-driven system verification method based on interrupt sequence figure
Corbett Modeling and analysis of real-time ada tasking programs
WO2016107299A1 (en) State machine merging method and device
CN102819419A (en) Command execution stream information processing system, device and method
CN111008133B (en) Debugging method and device for coarse-grained data flow architecture execution array
US10969429B1 (en) System and method for debugging in concurrent fault simulation
Sun et al. A hierarchical CPN model automatically generating method aiming at multithreading program algorithm error detection
CN108834427A (en) Handle vector instruction
JPH0659908A (en) Device for executing program
Yoo et al. PLC-Based safety critical software development for nuclear power plants
US20040098240A1 (en) State machine modelling
US20050015677A1 (en) Method of executing a computer program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18802071

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18802071

Country of ref document: EP

Kind code of ref document: A1