CN104572233A - Continuous function chart programming method - Google Patents

Continuous function chart programming method Download PDF

Info

Publication number
CN104572233A
CN104572233A CN 201410838636 CN201410838636A CN104572233A CN 104572233 A CN104572233 A CN 104572233A CN 201410838636 CN201410838636 CN 201410838636 CN 201410838636 A CN201410838636 A CN 201410838636A CN 104572233 A CN104572233 A CN 104572233A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
function
value
connector
output
task
Prior art date
Application number
CN 201410838636
Other languages
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

Links

Abstract

The invention relates to a continuous function chart programming method. The method includes: determining a task in a continuous function chart, wherein the task includes multiple function blocks; modifying an initial value of an output connector of at least one function block; when the function block is executed, updating the initial value of the output connector.

Description

一种连续功能图编程方法 A continuous function programming method

技术领域 FIELD

[0001] 本发明涉及一种工业控制编程方法,特别地涉及连续功能图编程方法。 [0001] The present invention relates to an industrial control programming, particularly to a continuous function programming method.

背景技术 Background technique

[0002] 连续功能图(CFC-Continuous Function Chart)是一种图形化编程语言。 [0002] Continuous function chart (CFC-Continuous Function Chart) is a graphical programming language. 连续功能图编程具有以下特点:(1)通过绘制功能图表来自动生成程序;(2)拥有强大的预制程序库;(3)通过简单的连线来降低开发成本并减少错误。 Continuous function programming has the following characteristics: (1) program to automatically generate a graph by plotting functionality; (2) has a strong prefabricated libraries; (3) to reduce development costs by a simple connection and reduce errors. 连续功能图不仅仅具有可编程逻辑控制器PLC(Programmable Logic Controller)典型的元素,例如:输入/输出、定时器、 计数器、符号表等,而且具有图形化编程语言语言的特性,其非常适合于过程控制和系统工程。 FIG continuous function having only the typical elements of a programmable logic controller PLC (Programmable Logic Controller), for example: I / O, timers, counters, tables and other symbols, and the graphical programming language having a language characteristic, which is very suitable for process control and systems engineering. CFC源于IEC 61131-3标准规定,是五种编程语言之一的功能块图(Function Block Diagram)。 CFC from IEC 61131-3 standard, is a functional block diagram (Function Block Diagram) of one of the five programming languages. 连续功能图与功能块图的主要特点在于其展示出了其隶属的资源与任务。 Continuous Function Chart and main features is its function block diagram to show the resources and tasks to which they belong. 虽然连续功能图并没有相关国际标准,但在工业控制领域被广泛使用。 Although there is no continuous function chart and relevant international standards, but is widely used in industrial control.

[0003] 然而,连续功能图CFC编程不够灵活,无法满足用户在工业控制方面的实际需要, 因此,非常有必要提供一种更为灵活的连续功能图CFC编程方法。 [0003] However, the continuous function chart CFC program not flexible enough to meet the actual needs of users in the industrial control and, therefore, very necessary to provide a more flexible continuous function chart CFC programming.

发明内容 SUMMARY

[0004] 针对以上技术问题,本申请提出了一种连续功能图编程方法,包括:确定连续功能图中的任务,所述任务包括多个功能块;修改至少一个所述功能块的输出连接器的初值; 以及在执行所述功能块时,更新所述输出连接器的所述初值。 [0004] To solve the above technical problem, the present application proposes a continuous function programming method, comprising: determining a continuous function chart of tasks, the tasks including a plurality of functional blocks; modifying at least one output connector of the function block initial value; and the initial value of the functional block, when executed, updates the output connector.

[0005] 如上所述的方法,所述任务包括预置任务或条件任务。 [0005] The method described above, the preset task or tasks include task conditions.

[0006] 如上所述的方法,其中修改至少一个所述功能块的输出连接器的初值包括:加载输入连接器的可以修改的初值和加载输出连接器的可以修改的初值。 [0006] The method described above, wherein the modifying at least one initial value of the function block output connector comprising: loading the initial value of the input connector can be modified and the modified initial value loaded output connector.

[0007] 如上所述的方法,所述在执行所述功能块时,更新所述输出连接器的所述初值的步骤包括:在任务调度阶段,读输入连接器的所述初值,执行所述功能块的代码,并在所述功能块代码中更新所述功能块输出连接器的所述初值。 The initial value of the step [0007] method as described above, when the execution of the function blocks, updating the output connector comprising: task scheduling stage, the initial value read input connector, performs the function block code, and updates the function block code blocks in the functional output of the initial value of the connector.

[0008] 如上所述的方法,进一步包括使用功能块输出连接器的值更新与该输出连接器相连接的输出变量的值。 [0008] The above method, further comprising using the function block output value of the output variable value updating of the connector and the output connector connected.

[0009] 根据本发明的另一个方面,提出一种在连续功能图编程中修改功能块输出连接器的初值方法,包括:加载所述功能块的输入连接器值;加载所述功能块的输出连接器的可以修改的初值;以及更新所述功能块的所述输出连接器的所述初值。 [0009] According to another aspect of the present invention, to provide a modified continuous function programming method Initial functional blocks output connector, comprising: an input connector loading value of the function block; loading the function block you can modify the initial value of the output connector; and the initial value of the output connector of the update block.

[0010] 如上所述的方法,其中所述功能块包括在预置任务或条件任务中。 [0010] The method described above, wherein the functional block is included in a preset task or tasks conditions.

[0011] 如上所述的方法,其中更新所述功能块的所述输出连接器的所述初值步骤包括: 在任务调度阶段,读输入连接器的所述初值,执行所述功能块的代码,并在所述功能块代码中更新所述功能块输出连接器的所述初值。 [0011] The method described above, wherein updating the output connector of the initial value of the function block comprises the step of: task scheduling stage, the initial value read input connector, perform the function block codes, and updates the function block code blocks in the functional output of the initial value of the connector.

[0012] 如上所述的方法,进一步包括使用功能块输出连接器的值更新与该输出连接器相连接的输出变量的值。 [0012] The method described above, further comprising using the output value of the function block output variable value updating of the connector and the output connector connected.

[0013] 如上所述的方法,其中连接器值有可能是输入变量的值、常数或其他功能块的输出连接器的值。 [0013] The method described above, wherein the connector may be the value of the input value of the output value of the connector, constant or other function block variables.

附图说明 BRIEF DESCRIPTION

[0014] 下面,将结合附图对本发明的优选实施方式进行进一步详细的说明,其中: [0014] Next, in conjunction with the accompanying drawings of the preferred embodiments of the present invention will be described in further detail, wherein:

[0015] 图1是根据本发明的一个实施例的连续功能图CFC编程的方法示意图; [0015] FIG. 1 is a schematic functional diagram of a method for the continuous embodiment of the present invention CFC programming;

[0016] 图2是根据本发明的一个实施例的CFC编程中周期任务的示意图; [0016] FIG. 2 is a schematic diagram of a program CFC embodiment of the present invention periodic task;

[0017] 图3是根据本发明的一个实施例的CFC编程中创建周期任务的示意图; [0017] FIG. 3 is a schematic diagram of the duty cycle to create a program CFC embodiment of the embodiment according to the present invention;

[0018] 图4a是根据本发明的一个实施例的用于连续功能图编程的修改功能块输出连接器初始值方法; [0018] FIG. 4a is an initial value according to a modified method of connecting the output of function block for continuous function programming according to one embodiment of the present invention;

[0019] 图4b是根据本发明的一个实施例的多输出变量的实现方法的示意图; [0019] FIG. 4b is a schematic view of a multi-implemented method according to one embodiment of the output variable of the present invention;

[0020] 图5a是根据本发明的一个实施例在CFC编程中设置物理量M的流程图; [0020] FIG 5a is a flowchart of setting the physical quantity M in CFC programming according to one embodiment of the present invention;

[0021] 图5b是根据本发明的一个实施例在CFC编程中对物理量M进行观测时的流程图; [0021] FIG 5b is a flowchart of observation of the physical quantity M in the CFC programming according to one embodiment of the present invention;

[0022] 图6是根据本发明的一个实施例的连续功能图文件比较的差异处理流程图;以及 [0022] FIG. 6 is a functional diagram of a file The continuous embodiment of the present invention is a process flow diagram of the comparison difference; and

[0023] 图7是根据本发明的一个实施例的连续功能图文件差异的图形化展示示意图。 [0023] FIG. 7 is a graphical representation of the continuous functional diagram showing the difference file according to one embodiment of the present invention.

具体实施方式 detailed description

[0024] 为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。 [0024] In order that the invention object, technical solutions, and advantages of the embodiments more clearly, the following the present invention in the accompanying drawings, technical solutions of embodiments of the present invention are clearly and completely described, obviously, the described the embodiment is an embodiment of the present invention is a part, but not all embodiments. 基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。 Based on the embodiments of the present invention, all other embodiments of ordinary skill in the art without any creative effort shall fall within the scope of the present invention.

[0025] 连续功能图CFC包括多个功能块。 [0025] FIG CFC continuous function comprising a plurality of functional blocks. 每个功能块能够实现一个简单的逻辑功能。 Each functional block can be realized a simple logic function. 通过将不同的功能块的输入连接器和输出连接器进行连接,连续功能图CFC编程可以实现复杂的逻辑功能控制。 By applying different input connector and an output connector to connect the functional blocks, continuous function chart CFC programmed to perform complex logic functions to control.

[0026] 具体而言,连续功能图CFC的编程界面为图形界面。 [0026] Specifically, FIG CFC continuous function programming interface for a graphical interface. 在该图形界面中包含了若干个图表(Chart)。 It contains several chart (the Chart) in the graphical interface. 用户在图表Chart中以图形的方式插入已经编制好的块,指定这些块之间的连接关系,或者为这些块分配输入/输出地址。 Chart Chart user to graphically inserted already prepared blocks, specify a connection relationship between these blocks, or the blocks allocated to the input / output addresses. 在这种通过鼠标点击托拽的方式完成项目编写后,用户即可进行编译。 After this drag by mouse click way to complete the preparation of the project, users can compile. 接下来,CFC程序将被整体编译,编译的结果以SCL代码的形式出现,最终将生成STL代码。 Next, CFC entire program is compiled, the compiled result in the form of SCL code, the code will eventually generate STL. 用户将这些代码下载到PLC中即可执行。 Users will be downloaded to the PLC code can be executed.

[0027] 在连续功能图CFC编程中,对于不同调度时间的功能块,将其分配在不同的周期调度任务中,每个周期调度任务设置为固定的调度周期,实现功能块的多周期调度任务控制。 [0027] In the CFC continuous function chart program, the scheduled time for the different functional blocks, which are located in different task scheduling period, each scheduled task is set to a fixed period of the scheduling period, the scheduling period multi-task function block control. 在同一张功能图中,相同调度周期的功能块被分配固定的执行顺序。 In a same function diagram, the same scheduling period are assigned a fixed function block execution order. 在多张连续功能图中,相同调度周期的功能块按照连续功能图的顺序进行执行。 In the drawing a plurality of continuous functions, the same functional blocks of the scheduling period performed in the order of a continuous function of FIG.

[0028] 在现有的连续功能图CFC编程中,功能块都是按照周期任务进行调度的。 [0028] In the conventional continuous function chart CFC programming, function blocks are scheduled by period for tasks. 这显然不够灵活,因为某些应用中部分功能块只需要在周期任务调度之前被执行一次,并不要进行周期调度。 This is clearly not flexible enough, in part because some applications function blocks need only be executed once, not to be scheduled in the period before the cycle task scheduling.

[0029] 为了实现单次调度,并保证不同连续功能图之间的相互配合,根据本发明的一个实施例,提出了一种带多级预置类任务的连续功能图。 [0029] In order to achieve a single schedule, and to ensure mutual engagement between successive different functional diagram, in accordance with one embodiment of the present invention, made with continuous functional diagram of a multi-stage pre-class tasks. 举例而言,对于两级预置任务的功能图,在开始执行周期任务之前,先执行两级预置类任务,从而使得连续功能图CFC编程更具有灵活性。 For example, for a preset function map of two tasks, task before starting the cycle, to perform two tasks preset categories, so that a continuous function map of CFC more flexible programming.

[0030] 图1是根据本发明的一个实施例的连续功能图CFC编程的方法示意图。 [0030] FIG. 1 is a schematic functional diagram of a method for the continuous embodiment of the present invention CFC programming. 如图1所述,方法100包括:在程序开始101后,在步骤102,执行连续功能图1中的预置值类任务1 功能块,然后在步骤103依次执行连续功能图2中的预置值类任务1的功能块、……、以此类推,直到步骤104,执行连续功能图(k-1)中的预置值类任务1的功能块以及在步骤105 执行连续功能图k中的预置值类任务1的功能块,其中k是连续功能图的数量。 As shown in Figure 1, the method 100 comprising: after the start of the program 101, at step 102, execution functional diagram of a successive preset value based functional block 1 the task, followed by the function performed in successive step 103 in FIG. 2 presets task class value of the functional block 1, ......, and so on until the step 104, the preset value class performs continuous function chart (k-1) of the functional block 1 the task at step 105 and continuously performs the function k of FIG. class preset value task functional block 1, where k is the number of continuous functions of FIG. 在预置值类任务1全部执行完之后,在步骤106,执行连续功能图1中的预置值类任务2功能块、在步骤107执行连续功能图2中的预置值类任务2功能块、……、以此类推,直到步骤108执行连续功能图(k-1)中的预置值类任务2的功能块以及步骤109连续功能图k中的预置值类任务2的功能块,其中k为连续功能图工程中连续功能图的数量。 After the preset value after executing all type of task 1, at step 106, execution functional diagram of a successive preset value function block type of task 2, task class preset value in Step 1072 of FIG continuous functions functional block 2 , ......, and so on until performing continuous function chart step 108 (k-1) the type of task preset value 2, and a functional block 109 continuous function chart step k preset values ​​based task functional block 2, number of continuous function is a continuous function of k in FIG Engineering wherein FIG. 预置值类任务2全部执行完之后,在步骤110开始执行周期性任务。 After all the preset value 2 executing the task category, at step 110 begins to perform the periodic task.

[0031] 本发明以上的实例提出了一种带两级预置类任务的连续功能图编程方法。 [0031] Examples of the above the invention proposes a method of continuous function programming tasks with two preset class. 在周期任务开始执行之前,执行两级预置类任务,可以大大节省目标控制器的硬件资源,并且极大地提高连续功能图编程的灵活性。 In the period before the task begins execution, the implementation of two pre-class tasks, can greatly reduce the target controller hardware resources, and greatly enhances the flexibility of continuous function chart programming.

[0032] 根据本发明的另一个实施例,在周期性任务之前也可以加入预置任务以进一步提高编程的灵活性。 [0032] According to another embodiment of the present invention, before the periodic tasks can also be added to further enhance the flexibility of pre-task programming. 具体而言,包括确定周期性任务的数量;确定周期性任务,其中至少一个周期性任务具有在执行所述周期性任务之前执行的预置任务;以及为各个周期性任务指定调度周期。 Specifically, the number of periodic tasks comprises determining; determining a periodic task, wherein the at least one periodic task with the periodic execution of the task before the preset task execution; and specifying for each periodic task scheduling period. 这样在每次执行周期性任务之前都可以先执行预置任务在开始周期性任务。 So before each execution of periodic tasks can be pre-set to perform tasks at the start of a periodic task.

[0033] 根据本发明的一个实施例,周期性任务的预置任务和连续功能图的预置任务可以共同采用以进一步增加CFC编程的灵活性。 [0033] According to one embodiment of the present invention, the preset task tasks and preset periodic task can be co-continuous function chart employed to further increase the flexibility of programming CFC.

[0034] 根据本发明的一个实施例,对于周期任务而言,本发明的连续功能图编程可变数量的周期任务。 [0034] According to one embodiment of the present invention, for periodic tasks, the functional diagram of a variable number of successive programming cycles task of the present invention. 现有的支持连续功能图编程的产品都将周期任务数量都是固定的,一般在5个以内。 Existing support continuous function chart programming cycle of the product will be the number of tasks are fixed, usually in less than five. 然而,这种对于周期任务的限制极大地制约了软件开发的灵活性,而太多的周期任务数又会浪费系统资源。 However, this task for the period of limitation has greatly restricted the flexibility of software development, but too many cycles will task a waste of system resources.

[0035] 在本发明的一个实例中,连续功能图编程中的周期性任务的数量是可变的,而且是有优先级的。 [0035] In one embodiment of the invention, the number of periodic tasks of a continuous function programming is variable, and is prioritized. 高优先级任务可以占先执行,即可以打断低优先级任务而先执行。 High-priority task can execute pre-emption, which can interrupt a low priority task to perform. 通常,调度周期越短的任务优先级越尚。 In general, the shorter the period of the scheduling priority of the task still.

[0036] 图2是根据本发明的一个实施例的CFC编程中周期任务的示意图。 [0036] FIG. 2 is a schematic diagram of a program CFC embodiment of the present invention periodic task. 如图2所示,对于每一个功能模块FB(Function Block)而言,其包括以下几个参数:实例名、类型FBTYPE、 输入IN和输出OUT。 As shown, for each function block FB (Function Block), the two parameters which include the following: the instance name, type FBTYPE, the input IN and output OUT. 多个FB的输入IN和输出OUT相互连接形成周期任务。 IN and OUT FB plurality of interconnected to form a periodic task. 例如,在图2 中连续功能图中共有8个独立的FB串,每个FB串代表一个周期任务,因此,图2的实例中周期任务数为8个。 For example, a total of continuous functions in FIG. 2 FIG. 8 independent strings FB, FB each string representing a periodic task, therefore, the number of tasks in the period 2 of FIG. Examples of eight.

[0037] 进一步地,每个周期任务可以包括不同数量的FB。 [0037] Further, each cycle may include a different number of tasks FB. 例如,在第一个周期任务中包括n个FB,分别为FBl-FBn ;第二个周期任务中包括3个FB,分别为FBA-FBC。 For example, a cycle comprising the first task of n the FB, respectively FBl-FBn; second cycle tasks includes the FB 3, respectively FBA-FBC. 其中,每个FB具有一个执行顺序编号,其为正整数,代表在该FB在该周期任务中的执行顺序。 Wherein each FB having an execution sequence number, which is a positive integer representing the order of execution of the FB in the duty cycle. 其中,每个FB还具有一个任务类型,其代表了其所在的周期任务的编号。 Wherein each FB also has a task type, which represents the number of cycles in their task. 在本发明的实例中,以上的各个参数和编号可以灵活设置,以根据实际需求,获得CFC编程的灵活性。 In the example of the present invention, each of the above parameters and the number may be set flexibly according to actual demand to obtain CFC programming flexibility. 在图2的实例中,在连续功能图编辑器中可为每个功能块指定任务类型(T1-T8)和执行顺序编号。 In the example of FIG. 2, you can specify the type of task (T1-T8) and execution order number to each function block in the continuous function chart editor. 例如图中1功能块FB1、FB2……FBn隶属于T1任务,它们的执行顺序编号依次为1、2……n。 For example in Figure 1 a functional block FB1, FB2 ...... FBn affiliated tasks T1, their execution order of sequence numbers 1,2 ...... n. 其他T2-T8任务与T1任务类似。 Other tasks T1 T2-T8 similar tasks.

[0038] 图3是根据本发明的一个实施例的CFC编程中创建周期任务的示意图。 [0038] FIG. 3 is a schematic diagram of the duty cycle created CFC programming according to one embodiment of the present invention. 首先,在步骤301中,在建立连续功能图CFC工程时,确定周期任务的数量,并且确定任务类型。 First, in step 301, when creating continuous function chart CFC project, task determining a number of cycles, and determines the type of the task. 以图2所示的实施例为例,即创建T1-T8的8个任务类型。 In the embodiment shown in FIG. 2 as an example, the task is to create eight types of T1-T8.

[0039] 接下来,在步骤302中,为T1-T8任务指定调度周期。 [0039] Next, in step 302, designated as T1-T8 task scheduling period. 在步骤303中,在使用连续功能图编程时,为每个功能块FB指定T1-T8中的一个任务类型和执行顺序编号。 In step 303, when the continuous function programming, specify a task execution order number and types T1-T8 of each function block FB. 在步骤304 中,在编译连续功能图程序时,按照任务类别生成T1-T8任务函数,每个任务函数中按执行顺序编号放置功能块代码。 In step 304, when the continuous function chart program compiler, generating categories according to the task T1-T8 task function, the function of each task execution order number placement function block code.

[0040] 以下是图2的实施例的程序实例,仅用以说明本发明的技术方案。 [0040] The following are examples of embodiments of the procedure of FIG. 2, intended to illustrate the present invention.

[0041] [0041]

[0042] [0042]

Figure CN104572233AD00061

[0043] 接下来,在步骤305中,通过连续功能图编译器将连续功能图编译成可被目标机调度核识别的可执行代码。 [0043] Next, in step 305, by continuous functions of the compiler FIG continuous function chart may be compiled into machine scheduling nucleation identified target executable code. 在步骤306,在目标机上,基于实时调度内核(例如,参考POSIX. lb),按优先级从高到低建立T1-T8的8个线程。 In step 306, on the target, based on the real-time scheduling kernel (e.g., refer to POSIX. Lb), the T1-T8 establish eight threads according to priority level. 在步骤307,按工程指定调度周期激活相应线程,在线程中执行对应的T1-T8任务函数。 At step 307, project scheduling period specified activation of the corresponding thread, T1-T8 perform tasks corresponding to the function in the thread. 为了方便理解,线程可理解为无限循环。 To facilitate understanding, the thread may be understood as an infinite loop. 目标机的实时调度内核可启动或终止任务线程执行。 Real-time scheduling kernel target unit can be activated or terminate task execution thread.

[0044] 具体而言,每个周期任务被编译器编译成一个周期任务函数,T1()、T2()…… T8 ()。 [0044] Specifically, each cycle compiler task is a periodic task to function, T1 (), T2 () ...... T8 (). 每个周期任务函数内按执行顺序编号,调用隶属于该任务的所有功能块对应函数。 Each cycle of the task execution order, the function number, calling all the blocks belonging to the corresponding function of the task. 例如周期任务函数Tl()内会依次调用FB1()、FB2()……FBn()。 For example periodic task Tl function will in turn call FB1 (), FB2 () ...... FBn () () inside. 其他T2-T8任务函数与Tl() 任务函数类似。 Other tasks function T2-T8 and Tl () function is similar to the task.

[0045] 如图3所示,在编译好的连续功能图程序下载到目标机后,目标机调度核会启动8 个周期任务线程,如图3所示,这8个线程会在调度时间到时调用相应的周期任务函数。 [0045] 3, after the continuous function chart compiled program is downloaded to the target, the target schedule starts nuclear task threads 8 cycles, as shown in FIG. 3, the eight threads to be scheduled at time when you call the corresponding period of the task function. 具体而言,T1-T8的8个线程在目标机上运行。 Specifically, T1-T8 8 threads running on the target machine. 各个线程在触发条件成立,S卩:条件1等于1 时,启动。 Each thread in the trigger conditions are met, S Jie: 1 equal to 1 when the condition started. 然后在相应的各个调度时间T1-T8到时后,会调用T1-T8的任务函数T1 () -T8 (), 完成调用各个T1-T8的周期任务,实现相应的控制功能。 Then, after T1-T8 corresponding to the respective scheduled time, the task will call the function T1 T1-T8 () -T8 (), to complete the call to the respective T1-T8 of the duty cycle to achieve the appropriate control function. 以T1任务线程为例,在T1调度时间到后,会调用T1任务函数T1 ()。 T1 to task thread, for example, after the scheduled time to the T1, T1 calls the task function T1 (). 其他T2-T8任务线程与T1任务线程类似。 T2-T8 task threads and other similar thread T1 task.

[0046] 根据本发明的一个实施例,当前流行控制器硬件的存储器最小单位多为8或8的幂次位(bit)。 [0046] According to one embodiment of the present invention, the popular memory controller hardware minimum unit of a power of a multi-bit ( 'bit) of 8, or 8. 采用8个周期任务的方案,在编写任务调度算法和任务上下文数据结构时可达到存储器资源与调度的最佳平衡。 8 cycles using the task programs, the task scheduling algorithm in the preparation and task context data structure to achieve the best balance memory resources and scheduling. 例如,如果周期任务数少于8个,会浪费存储器资源, 而如果多于8个会增加系统任务调度负荷。 For example, if the task is less than 8 cycles, wastes memory resources, and if more than 8 task scheduling system load will increase. 而且,周期任务设定为8个具有更高的编程灵活性。 Moreover, periodic tasks set at 8 with a higher programming flexibility.

[0047] 根据本发明的一个实施例,为了增加CFC编程的灵活性,本发明提出一种用于连续功能图CFC编程的可修改初始值的功能块输出的方法。 [0047] According to an embodiment of the present invention, in order to increase the flexibility of CFC programming, the present invention provides a functional diagram for a continuous modification method may be programmed CFC block output initial value.

[0048] 在现有的连续功能CFC编程框图中,功能块的包括默认输入连接器和默认输出连接器,其中初始值是〇,且是不可以修改的。 [0048] In the conventional continuous functional block diagram of programming in CFC, the default function block comprises an input connector and an output connector default, the initial value of which is square, and can not be amended. 这种设置是针对连续功能图中的周期调度任务设置的。 This arrangement is a functional diagram for successive periods of scheduled task set. 因为在周期调度任务下,功能块输出连接器的值是周期更新的,所以设置或修改输出连接器的初值没有意义。 Because the task scheduling cycle, the value of the function block output connector is a periodic update, so the output connector set or modify initial value meaningless.

[0049] 然而,在本发明的框架下,连续功能编程中除了周期调度任务还有预置任务。 [0049] However, in the framework of the invention, in addition to the continuous functional programming tasks optional preset period schedule tasks. 根据本发明的一个实施例,CFC编程中还包括条件调用任务。 According to an embodiment of the present invention, CFC programming further includes a condition calling task. 当条件满足时,执行调用任务。 When the conditions are met, the calling task. 当条件没有满足时,条件调用任务内的各功能块将不会被执行。 When the conditions are not met, the functional blocks within the conditions of the calling task will not be executed. 这时,未被执行的功能块的输出连接器的值将会维持初值较长的时间,直至执行了该功能块才会被更新。 In this case, the value of the output connector is not performed functional blocks will be maintained for a long time to the initial value, until the execution of the function block will be updated. 针对这种情况,功能块的输出连接器的初值如果可以修改将是很有意义的。 For this case, the initial value of the output connectors of the function blocks may if modifications will be meaningful.

[0050] 图4a是根据本发明的一个实施例的用于连续功能图编程的修改功能块输出连接器初始值方法。 [0050] FIG. 4a is an initial value according to a modified method of connecting the output of function block for continuous function programming according to one embodiment of the present invention. 如图4a所示,在所述方法400中,连续功能图中任意一个功能块的执行包括: 4a, in the method 400, any continuous function chart performs a function block comprises:

[0051] 在步骤410,在初始化阶段加载输入连接器初值,其中所述初值是可以在编程时和运行时可修改的。 [0051] In step 410, an input connector loading the initial value in the initialization phase, wherein the initial value can be modified during programming and operation. 在步骤420,在初始化阶段加载输出连接器的初值,其中所述初值是可以在编程时和运行时都可修改的。 In step 420, the output of the initial value is loaded during the initialization phase connector, wherein the initial value can be modified during programming and runtime. 在步骤430,在任务调度阶段,读输入连接器的值,执行功能块FB的代码,在功能块FB代码中更新功能块输出连接器的值。 In step 430, the task scheduling stage, reading input connector, perform the function block FB code, updating the value of the function block output connector of the function block FB code. 但由于功能块FB可能隶属于条件任务,因此在条件未满足时,所述功能块FB代码可能从未被执行,则所述功能块FB 输出连接器将一直保持步骤420所述初始值。 However, since the function block FB under the conditions in the mission may, therefore when the condition is not satisfied, the function block FB code may never be executed, then the function block FB output connector will remain the initial value in step 420. 最后,在步骤440,使用功能块FB输出连接器的值更新与该输出连接器相连接的输出变量的值。 Finally, at step 440, using the value of the output variable function block FB updates the value of the output connector and the output connector connected.

[0052] 本发明的实例中所提出的用于连续功能图编程的可修改功能块输出连接器初始值的方法,改变了此前连续功能图CFC不能修改输出连接器初值弊端,可以极大地提高编程的灵活性。 [0052] Examples of the method initial values ​​proposed in the present invention may be modified for continuous function programming function block output connector, FIG changed after continuous CFC function can not modify the initial value of the output connector drawbacks, can greatly improve the programming flexibility.

[0053] 根据本发明的另一个实施例,为增加连续功能图编程的灵活性,本发明提出一种多输出变量。 [0053] According to another embodiment of the present invention, to increase the flexibility of the continuous function programming, the present invention provides a multi-output variables. 该多输出变量为在连续功能图中定义的全局变量,可以被不同的功能块的输出变量重复赋值。 The multi-output variable is defined in a global variable continuous function chart, the output variable may be repeatedly assigned to different functional blocks.

[0054] 如所周知的,连续功能图编程中,最基本的程序单元是功能块(Function Block, FB),其与外界的接口就是其输入变量和输出变量。 [0054] As well known, continuous function chart program, the basic program unit is a functional block (Function Block, FB), which is an interface with the outside of the input and output variables. 连续功能图还定义了全局变量,只要保证数据类型一致,该全局变量可以由任何任务的任何功能块的输出变量赋值,同时该全局变量还可以给任何任务的任何功能块的输入变量赋值,以此实现不同任务、不同功能块之间的数据传递。 Continuous functional diagram also defines a global variable, as long as the data type consistency, the global variables may be assigned by the output variable of any function block any task, while the global variables may also be given any task of any input variables of the function block assigned to this implementation of different tasks, the data is transmitted between different functional blocks.

[0055] 但是,目前的连续功能图中,全局变量只能被功能块的输出变量赋值一次,不可以被多个功能块的输出变量重复赋值,也就是说目前的连续功能图编程只支持单输出变量。 [0055] However, current continuous function chart, the global variables can be assigned a function block output variable, an output variable can not be assigned repeated a plurality of functional blocks, i.e. continuous function programming currently only supports single output variables.

[0056] 针对上述问题,为了进一步提供编程的灵活性,本发明提出了一种用于连续功能图编程方法的多输出变量。 [0056] In response to these problems, in order to further provide programming flexibility, the present invention proposes a continuous multi-output variable functions for programming method of FIG. 该多输出变量是一种全局变量,可以定义为任意的数据类型,只要连续功能图的任意功能块的输出变量与其数据类型一致,就可以给该多输出变量重复赋值。 The multi-output variable is a global variable can be defined as any data type, as long as the coincidence output variable of any continuous function block functional diagram of the data type thereof, can be repeated for the multiple output variable assignment. 根据本发明的一个实施例,该多输出变量可以接受相同或不同任务的多个功能块输出变量的赋值,其当前的值由最新一次的赋值操作决定。 According to one embodiment of the present invention, the multi-output variable can accept a task assignment same or different functional blocks of the output variables, by the latest value of its current time assignment decisions. 另外,该多输出变量还可以给相同或不同任务的多个功能块的输入变量赋值。 Further, the multi-output variables may also be identical to or different tasks plurality of function blocks of the input variable.

[0057] 图4b是根据本发明的一个实施例的多输出变量的实现方法的示意图。 [0057] FIG. 4b is a schematic view of a multi-implemented method according to one embodiment of the output variable of the present invention. 如图4b所示,连续功能图编程的工程中,含有Tl,T2, T3…等任务。 4b, the continuous function programming project, comprising Tl, T2, T3 ... and other tasks. T1任务中功能块XI的输出变量2,T2任务中功能块Y1的输出变量1,T3任务中功能块Z1的输出变量2,都与多输出变量M 一样是数据类型W。 XI task T1 output variables function block 2, functional block T2 task Y1 output variables 1, T3 task function block 2 Z1 output variables, output variables are the same and M is a multi-data type W. 因此,它们都可以赋值给多输出变量M。 Therefore, they can be assigned to multiple output variable M.

[0058] 同时,在保证输出类型相同的前提下,多输出变量M还可以赋值给不同任务的不同功能块的输入变量,在图4b中,T1任务中功能块X2的输入变量1,T2任务中功能块Y2 的输入变量2, T3任务中功能块Z2的输入变量1,都与多输出变量M -样是数据类型甲,它们都可以被多输出变量M赋值。 [0058] Meanwhile, at the same guarantee that the output type of premise, multi-output variable M also can be assigned input variables different functional blocks to different tasks, in FIG. 4b, T1 task function block X2 input variables 1, T2 task input variables Y2 of the function block 2, the task T3 input variables Z2 is a functional block, and the multi-output variable M are - like the data type a, which can be assigned multiple output variables M.

[0059] 本领域技术人员应当了解,图4b仅仅给出的是一种具体实现方式,但不限于此。 [0059] Those skilled in the art will appreciate, it is given in Figure 4b only a specific implementation, but is not limited thereto. 在连续功能图编程环境中,只要保证数据类型与多输出变量一致,不同任务的不同功能块都可以向多输出变量重复赋值,同时,多输出变量也可以向相同数据类型的不同任务不同功能块的输入变量赋值,这样可以更灵活地实现不同任务不同功能块的数据传递。 In a continuous function programming environment, as long as consistent with the data type of multiple output variables, different tasks of different functional blocks can be repeated assigned to multiple output variables, while multiple output variables may be different functional blocks to the various tasks of the same data type assigning input variables, which can more flexibly pass data different functional blocks of different tasks.

[0060] 根据本发明的一个实施例,在本发明的框架下,本发明提出了一种新的可定标的连续功能图数据类型。 [0060] According to an embodiment of the present invention, within the framework of the present invention, the present invention provides a new continuous scaling function may map data types. 该数据类型可以表示任何的物理量:在编程时可设置物理量的基值和单位及其初始物理值。 The data type may represent any physical quantity: programming may be provided in the base value and the physical quantity units and their initial physical value. 在观测调试时可直接读取其物理值。 Physical values ​​which can be read directly at the time of observation debugging. 这种新的数据类型,可以更加连续功能图CFC编程的灵活性,减少编程人员的工作量。 This new data types, more continuous programming flexibility CFC FIG function, to reduce the workload of the programmer.

[0061] 目前的连续功能图编程中,数据类型有布尔型、无符号单字节整型、有符号单字节整型、无符号双字节整型、有符号双字节整型、无符号四字节整型、有符号四字节整型、时间类型等数据类型。 [0061] Current continuous function chart program, a Boolean data types, single byte unsigned integer, single-byte signed integer, unsigned integer-byte, two-byte signed integer, no symbol four-byte integer, signed four-byte integer, type, etc. time data type.

[0062] 然而,在连续功能图CFC编程和调试过程中,通常会存在许多的物理量。 [0062] However, in the continuous function diagram CFC programming and debugging process, there are often a number of physical quantities. 如果强行将这些物理量定标转化为上述数据类型才能进行使用,会带来非常大的不便,限制了编程的灵活性。 If forced these quantities scaled into the above-mentioned data type to be used it will bring great inconvenience, limiting the flexibility of programming. 在进行观测调试时,还必须将上述数据类型手动转化为物理量。 Observed during debugging, the above data must be converted to manually type the physical quantity. 这极大地增加了连续功能图编程和调试的繁琐程度。 This greatly increases the continuous function chart programming and debugging cumbersome degree.

[0063] 根据本发明的一个实施例,提出一种可定标的连续功能图数据类型,物理量类型M。 [0063] According to one embodiment of the present invention, it can be scaled to provide a continuous function chart data type, quantity type M. 对于该新的连续功能图可定标数据类型,物理量类型M的基值%、单位MD和物理量初始值凡需要在连续功能图编程时设置。 This new feature for continuous view of the calibration data type, the type of physical quantity base value of M% MD and physical units where the need for the initial values ​​set in the continuous function programming. 而在具体的功能块FB执行过程中,根据基值、物理量值和定标值,自动将物理量转化为二进制数据,其中定标值表示二进制数据的长度。 In the specific implementation process function blocks FB, according to the base value, the value of the physical magnitude, and scaling automatically the physical quantity into binary data, wherein the scaling value indicates the length of the binary data. 定标值越大,所能表示的数的范围越大,精度也越高。 The larger scaling value, the greater the number range that can be represented by the higher accuracy.

[0064] 根据本发明的一个实施例,对物理量进行设置时,其公式为: [0064] According to one embodiment of the present invention, when setting the physical quantity, the formula is:

[0065] 二进制数据=物理量值/基值X2®e«。 [0065] = binary data of a physical quantity value / base value X2®e «.

[0066] 该二进制数据由目标机获取后进行运算。 [0066] The binary data after the operation target acquisition. 而在通过上位机进行观测时,目标机将二进制数据发送给上位机,上位机根据其基值和定标值进行运算得到物理值进行显示,其公式为: When observed by the host computer, the target transmits the binary data to the host computer, the host computer calculates physical values ​​obtained are displayed according to their base value and the scaling value, the formula is:

[0067] 物理值=二进制数据X基值。 [0067] The physical values ​​of the binary data X = the base value.

[0068] 图5a是根据本发明的一个实施例在CFC编程中设置物理量M的流程图和图5b是根据本发明的一个实施例在CFC编程中对物理量M进行观测时的流程图。 [0068] FIG 5a is a diagram provided quantity M in the CFC and programming flowchart according to one embodiment of the present invention, FIG. 5b is a flowchart of the embodiment in the observation of the physical quantity M CFC programming according to one embodiment of the present invention. 如图5a所示,设置方法510中,在步骤511,用户在上位机上输入物理量类型的一个实例N的基值Nj和单位ND。 Shown, method 510 is provided in Figure 5a, in step 511, the user inputs a type of example of the physical quantity in the host computer base value Nj and N units of ND. 在步骤512,上位机计算该实例N的转换系数,即/基值。 In step 512, the host computer calculates the transform coefficients example N, i.e. / base value. 在步骤513,上位机根据物理量N的实际物理值队(i = 0, 1,…)与N的转换系数,计算N的二进制值,即队X 2® 基值。 In step 513, the host computer the actual value of the physical quantities team of N (i = 0, 1, ...) conversion coefficient and N, N calculated binary value, i.e., the base value X 2® team. 在步骤514中,将上述步骤中得到的N的二进制值下载到目标机,在目标机中进行运算。 In step 514, the binary value N obtained in the above step is downloaded to the target machine, for operation in the target machine. 同样地,如图5b所示,在观测方法520中,在步骤521,将物理量N的二进制数据从目标机上传到上位机。 Similarly, as shown in Figure 5b, in the observation method 520, at step 521, the binary data of N physical uploaded from the target to the host computer. 在步骤522中,上位机计算该实例N的转换系数,即/基值。 In step 522, the host computer calculates the transform coefficients example N, i.e. / base value. 在步骤523,上位机根据N的二进制值和转换系数计算N的物理值,即N的二进制值/转换系数。 In 523, the host computer calculated from the N binary values ​​and the physical value conversion coefficient N steps, i.e., a binary value of N / conversion factor. 在步骤524中,用户就可以很方便地从上位机观测到N的物理值。 In step 524, the user can easily observe from the host computer to the physical value of N.

[0069] 本发明的实例提出了一种可定标的连续功能图数据类型,物理量M。 [0069] Examples of the present invention proposes a continuous scaling function map data types, quantities M. 该数据类型可以表示任何的物理量。 This data can represent any type of physical quantities. 物理量类型的数据在使用时非常方便,仅需要在编程时可设置物理量的基值和单位。 Physical type of data is very convenient in use, may be only necessary to set the base value and the physical unit at the time of programming. 初始物理值即可以默认也可以在编程时设置。 The initial default physical value which can be set during programming. 在观测调试时,本发明的实例中可直接读取其物理值。 When debugging observation, examples of the present invention, the physical value can be read directly. 如上面实施例所说明的,新的数据类型,物理量M,的加入方便了连续功能图编程和调试中物理量的设置和观测,使其更加易于操作,大大提高了连续功能图的编程和调试效率。 The illustrated embodiment as described above, new data types, quantities M, is added to facilitate the continuous function programming and debugging settings and observing the physical quantity, to make it more easy to operate, greatly improving the efficiency of programming and debugging continuous function diagram .

[0070] 在本发明的框架下,对现有的连续功能图CFC编程所作出的另一个调整是增加了比较功能。 [0070] In the framework of the present invention, a functional diagram of a conventional continuous adjustment CFC another programming is made that a comparison function. 这一功能对于CFC编程人员非常重要。 This feature is very important for CFC programmers. 因为当前的连续功能图编程产品都不具备连续功能图文件图形化比较功能。 Because the current continuous function chart programming products do not have continuous function chart graphical file compare function. 然而,通过软件设计文档很难准确全面地反应软件设计上的差异。 However, accurate and comprehensive reflect differences in software design software design documentation is difficult. 这对软件版本管理和软件维护造成很大不便,增加了软件开发人员在这方面的工作量。 This maintenance caused great inconvenience to the software version management and software, increases the workload of software developers in this regard. 这也限制了CFC编程的灵活性。 It also limits the flexibility CFC programming.

[0071] 根据本发明的一个实施例所提供的连续功能图比较的方法自动识别两个CFC文件的设计差异,并将差异以易于对比的文本和图形化方式输出。 [0071] Automatic identification CFC design differences between the two files according to the method embodiment of FIG continuous function provided by a comparison of the embodiment of the present invention, and for ease of comparison the difference in text and graphical output mode. 这在对比软件版本或软件分支差异性时尤为必要,可减轻软件设计、测试、维护人员的工作量,提高工作效率。 This is especially necessary when comparing software version or software differences branches, reduce software design, testing, maintenance staff workload, improve work efficiency.

[0072] 具体而言,连续功能图差异分两类: [0072] Specifically, FIG continuous functional differences fall into two categories:

[0073] (1)非功能性差异,包括:注释的内容、功能块的摆放位置、连接线的起点/终点/ 拐点坐标。 [0073] (1) non-functional differences, comprising: a content annotation, the placement of function blocks, the starting point of the connecting line / end / inflection point coordinates. 此类差异不影响最终的软件功能,仅影响连续功能图可读性,简称N差异;以及 Such differences do not affect the final software function only affects the readability FIG continuous function, referred to as N differences; and

[0074] (2)功能性差异,包括:功能块实例的增减、同名功能块类型的变化、同名功能块所属任务类别和执行顺序编号的差异,功能块连接器或全局信号的连接关系,功能块连接器与全局信号初始值。 [0074] (2) functional differences, comprising: a connection relationship changes in function block instance, the block type of the same name change, the difference of the same name and function block execution task categories relevant to the sequence number, the function block or a global signal connector, function block is connected with the global signal initial value. 此类差异会影响软件功能,简称F差异。 Such differences can affect the software function, referred to as F difference.

[0075] 本发明的实例的连续功能图文件之间的比较对象包括:功能块、信号、注释块、连接。 Comparison between successive functional diagram of an example of a file [0075] the present invention comprises: a functional block, signal, comment block, is connected. 既包括了N差异,也包括了F差异。 Both the N differences, including differences in the F.

[0076] 本发明的实例的连续功能图比较原理如下: [0076] FIG continuous function comparative example of the invention works as follows:

[0077] 采集两个连续功能图文件中所有编程对象的信息,包括功能块、信号、注释块与连接信息,分别将两个连续功能图的对象信息组织到两个排序表中。 [0077] All programming objects collected two continuous function chart files, including functional blocks, signal, connection information and comment blocks, respectively, the object information will be organized into two consecutive functional diagram of two sort tables. 表中每个对象都带有特征字符串。 Each object in the table with a feature character string. 功能块与注释块的特征字符串为块名,信号的特征字符串为信号名,连接的特征字符串为连接起点对象(功能块或信号)名加终点对象(连接器或信号)名。 Characterized string function blocks and the block name for the comment block, the signal characteristics of the signal string name, string concatenation feature for connecting the start point object (or a function block signal) were added to the end of the object (or a signal connector) names. 在两个表中搜索特征字符串相同的对象,并进一步比较其对象信息。 Searching for the same string in the object feature two tables, and further compare the object information. 特征字符串仅在一个表中存在的对象,直接判定该对象为差异对象。 Wherein a string is only present in the object list, the object is directly determined difference object.

[0078] 根据以上比较原理,本发明的实例做出如下设定: [0078] According to the principles of the above comparison, examples of the present invention to set the following:

[0079] 1.连续功能图文件中的功能块名具有唯一性,即无重名的功能块; [0079] 1. Function Block Name continuous function chart files unique, i.e. no duplicate names of the functional blocks;

[0080] 2.连续功能图中的信号名具有唯一性,即无重名的信号; [0080] 2. The signal names continuous function chart has a unique, i.e. no duplicate names signal;

[0081] 3.连续功能图中每个任务里的功能块执行顺序号具有唯一性,即在同一个任务中无序号相同的两个功能块。 [0081] 3. FIG continuous functions of each task execution in the functional block sequence number is unique, i.e. no two function blocks of the same number in the same task.

[0082] 根据本发明的一个实例,参与比较的功能块信息包括: [0082] According to an embodiment of the invention, the functional blocks involved in comparing the information comprises:

[0083] 1.功能块所属任务类型; [0083] 1. Function block belongs task type;

[0084] 2.功能块的执行顺序编号; Execution sequence [0084] 2. The number of functional blocks;

[0085] 3.功能块版本号; [0085] 3. The function block version number;

[0086] 4.功能块所有连接器; [0086] 4. All the functional block connector;

[0087] 5.连接器初始值; [0087] The initial value of the connector;

[0088] 6.布尔类型输入连接器是否求反; [0088] 6. The Boolean input connector is negated;

[0089] 7.输出连接器是否带有非易失属性; [0089] 7. The connector is output with a non-volatile property;

[0090] 8.连接器注释; [0090] 8. The connector annotations;

[0091] 9.功能块注释;以及 [0091] 9. The annotation function block; and

[0092] 10.功能块的坐标 Coordinates [0092] 10. The function block

[0093] 根据本发明的一个实例,参与比较的信号信息包括: [0093] According to an embodiment of the invention, the information involved in the signal comparison comprises:

[0094] L信号的类型; [0094] Type L signal;

[0095] 2.信号的初始值;以及 [0095] 2. The initial value of the signal;

[0096] 3.信号的描述。 [0096] 3. Description of the signal.

[0097] 根据本发明的一个实例,参与比较的注释块信息包括: [0097] According to an embodiment of the invention, the comparison involved in the comment block information comprising:

[0098] 1.注释内容文本;以及 [0098] 1. text annotation content; and

[0099] 2.注释块的位置坐标; [0099] 2. The comment block position coordinates;

[0100] 根据本发明的一个实例,参与比较的连接信息包括: [0100] According to an embodiment of the invention, the comparison involved in the connection information comprises:

[0101] 1•连接起点坐标; [0101] 1 • connecting the start coordinate;

[0102] 2.连接终点坐标;以及 [0102] 2. The connector end coordinates; and

[0103] 3.连接拐点数量与每个拐点坐标。 [0103] 3. The number of inflection points is connected to each of the inflection point coordinates.

[0104] 根据本发明的一个实例,对于对象数据表中的每个对象,记录该对象所在页码与坐标信息,以便实现图形化对比。 [0104] According to an embodiment of the invention, the object data table for each object, the object record page numbers and coordinate information in order to achieve a graphical comparison.

[0105] 根据本发明的一个实例,所有差异信息都被记录到一个差异数据表中。 [0105] According to an example of the present invention, all the difference information is recorded into a difference data table. 在对比结束后,以文本方式按条目输出所有差异信息。 After the end of the comparison, output as text entry by all difference information. 在一个更具体的实例中,用户可以通过双击差异文本条目,在两个并列的窗格中图形化地、高亮显示差异对象。 In a more specific example, the user can double-click on text entries difference, in two parallel pane graphically highlight differences object.

[0106] 根据本发明的一个实例,差异数据表中每个差异条目包含以下信息: [0106] According to an embodiment of the invention, each of the difference data in the difference table entry contains the following information:

[0107] 1.差异类别:非功能性差异(N)或功能性差异(F); [0107] 1. Differences Type: Non functional differences (N) or functional differences (F.);

[0108] 2.差异索引;以及 [0108] 2. The difference index; and

[0109] 3•差异描述文本。 [0109] 3 • difference descriptive text.

[0110] 其中,所谓差异索引用于定位差异的页码和坐标。 [0110] wherein, for a so-called page index difference and the difference of the coordinate positioning. 根据本发明的一个实例,差异索引可以为差异编号,根据该差异编号可以确定该差异所对应的对象。 According to one embodiment of the invention, the difference may be a difference in the index number, the subject number can be determined based on the differences corresponding to the difference. 如果某个差异为不存在对应的对象,则差异索引定义为-1。 If a difference of the corresponding object does not exist, the index difference is defined as -1.

[0111] 根据本发明的一个实例,当用户选择或双击差异文本条目时,可依据差异索引快速确定该差异所对应的对象;然后,根据对应对象的页码和坐标定位出该差异的页码和坐标,从而确定需要向用户显示的内容,并突出显示该差异对应的对象。 [0111] According to an embodiment of the invention, when the user selects or double differences of text entries, the difference index to quickly determine objects that difference corresponding basis; then, according to the page number and coordinates of the corresponding object locate the page number and coordinates of the difference , thereby determining the content displayed to the user needs, and highlight the object corresponding to the difference.

[0112] 在连续功能图编写的应用软件升级、建立分支、除错时经常需要比较两个连续功能图文件的差异。 [0112] In the continuous function chart prepared by the application software upgrades, the establishment of branches, often need to compare the differences of two successive function chart files when debugging. 在本发明之前,这部分工作主要依靠程序员编写的软件修改日志和版本说明,非常具有局限性。 Prior to this invention, this part of the work rely mainly on software written by programmers modify the log and release notes, very limited. 例如,在软件修改过程中因程序员失误而引入的设计错误是不可能记录到文档中的。 For example, a design error in the software modification process due to programmer error introduced is not possible to record to the document. 本发明的连续功能图文件比较方法可以全面直观地反映出连续功能图软件的设计差异,并且这种自动差异分析比手工比较或二进制比较的效率更高,也更准确。 FIG continuous function file comparison process of the invention may be fully continuous directly reflect differences in the design of FIG software function, and this difference automatically analyze more efficient than manual comparison binary comparison or, more accurately.

[0113] 图6是根据本发明的一个实施例的连续功能图文件比较的差异处理流程图。 [0113] FIG. 6 is a functional diagram of a file The continuous embodiment of the present invention, the difference comparison process flowchart. 如图6所示,该方法包括: 6, the method comprising:

[0114] 首先,提取第一个连续功能图文件CFC1中所有的程序页、功能块、信号、注释块、 连接信息,组织成易于快速搜索的、已排序的内部数据表(简称表1); [0114] First, a continuous extraction function map file CFC1 all page program, function blocks, signals, comment block, connection information, easily and quickly organized into search, sorted internal data table (referred to Table 1);

[0115] 其次,提取第二个连续功能图文件CFC2中所有的程序页、功能块、信号、注释块、 连接信息,组织成易于快速搜索的、已排序的内部数据表(简称表2);并且,初始时表二中所有对象都标记为未比较对象; [0115] Next, extracts a second continuous function chart program file CFC2 all pages, the function blocks, signals, comment block, connection information, easily and quickly organized into search, sorted internal data table (referred Table 2); and, when the initial table II all objects not marked as a comparison target;

[0116] 接下来,遍历表1。 [0116] Next, traverse the table 1. 依次提取表1中的对象(简称表1对象),根据表1对象的特征在表2中搜索特征相同的对象。 Table 1 sequentially extracted object (the object referred to in Table 1), according to Table 1 wherein the object search feature in Table 2 of the same objects. 若不存在,则标记该表一对象为有差异,对象写入差异表(对于相关表1对象在表1中的索引,若不存在则为-1)。 If not, the table is marked as a difference of an object, the object writing difference table (Table 1 for the relevant objects in the index table 1, if there -1). 若存在,则进一步比较这两个对象的数据信息,若相同则各自标记为无差异对象;若不相同则各自标记为有差异对象,并将差异彳目息与入差异彳目息表。 If present, further compare the two data objects, each flag if the same is subject to no difference; if the same are different are each marked object and the difference information with the difference between left foot left foot mesh mesh information table.

[0117] 如图6所示,赋初值i = 0,进入循环,i = i+1,i〈表1索引范围。 [0117] As shown in FIG. 6, the initial value i = 0, enter the circulation, i = i + 1, i <Table 1 index range. 提取表1对象 Table 1 extract objects

[i],根据表1对象[i]的特征搜索表2中是否有对象[i]的特征。 [I], [i] whether a characteristic feature object search table [i] in accordance with Table 1 object 2. 如果没有找到,则在差异表中记录差异内容,并且该差异的索引为-1。 If none is found, the differences are differences in the content of the table, and the index difference is -1. 如果找到,例如是表2中的对象[j],则将表2中的对象[j]标记为已经比较过。 If found, for example, the target 2 [j] Table 2 Object [j] will have compared labeled table. 下一步确定,确定表1对象[i]和表2中对象[j]的信息是否一致。 Next determination, a target determination table [i] and the object [j] of Table 2 are the same information. 如果一致,则返回循环,i = i+1,否则,在差异表中记录差异内容,并且该差异的索引为正整数的顺序编号,例如差异1,差异2,以此类推。 If yes, return to the cycle, i = i + 1, otherwise, the differences are differences in the content of the table, and the index difference of the sequence numbers is a positive integer, for example the difference 1, difference 2, and so on. 差异编号是唯一的,在本实施例中也可以作为差异索引。 The only difference is the number, in the present embodiment, the difference may be used as an index. 根据差异编号能够确定表1对象[i]和表2中对象[j]。 Table 1 is able to determine the object [i] and Table 2 Object [j] based on a difference number. 返回循环,i = i+1。 Return cycle, i = i + 1.

[0118] 接下来,遍历表2。 [0118] Next, table 2 traverse. 依次提取表2中仍标记为未比较的对象,标记为差异对象,并写入差异信息表(对于相关表2对象在表2中的索引,若不存在则为-1)。 Table 2 sequentially extracted still object is not marked as compared, marked differences in the object, and writes the difference information table (Table 2 related to the object index in Table 2, if there -1).

[0119] 如图6所示,赋初值i = 0,进入循环,i = i+1,i〈表1索引范围。 [0119] As shown in FIG. 6, the initial value i = 0, enter the circulation, i = i + 1, i <Table 1 index range. 提取表2中的仍标记为未比较的对象[k],判断表2中的对象[k]是否已经比较过,如果仍为未比较过,则将其标记为已经比较过,并且在差异表中记录差异内容,并且该差异的索引为-1。 Table 2 Extraction of the object being marked [k] is not the comparison, determines whether the objects in Table 2 [k] have compared, if still not been compared, then it is marked as having been been compared, and the difference in the table recording the content difference, and the difference index is -1. 返回循环,i = i+l〇 Return cycle, i = i + l〇

[0120] 最后,以文本格式输出差异信息表的内容。 [0120] Finally, the output difference information table content in a text format.

[0121] 图7是根据本发明的一个实施例的连续功能图文件差异的图形化展示示意图。 [0121] FIG. 7 is a graphical representation of the continuous functional diagram showing the difference file according to one embodiment of the present invention. 如图7所示,所有差异信息都以文本方式输出到差异文本输出窗格中。 As shown in FIG 7, all differences in text information output to the difference in the output text pane. 每项差异文本都以差异类别和编号开头,该编号也是差异表项的索引值。 Each text differences are beginning to differentiate categories and number, which is the difference between the value of the index entry.

[0122] 如图7所示,当用户双击差异文本,则此条差异文本被高亮显示。 [0122] As shown in FIG 7, when the user double differences of text, the text is highlighted differences in the entry. 同时自动提取差异编号,并且根据此项差异编号可查表索引出表一和表二中的相应差异对象。 No difference while automatically extracted, and the look-up table index number corresponding to the difference between the object tables I and II in accordance with this difference. 根据表一和表二中存储的差异对象页码与坐标来确定两个连续功能图窗格内的显示内容,同时把相应差异对象尚壳。 Determining a display content in the functional diagram of two consecutive windows according to the difference in Tables I and II stored in the page number and coordinates of the object, while the object is still the difference corresponding shell.

[0123] 在以上的实施例中介绍了本发明为了提高连续功能图(CFC)编程的灵活性。 [0123] In order to improve the continuous function described in FIG flexibility (CFC) of the present invention is programmed in the above embodiment. 必须说明的是,虽然上述实施例分别介绍了其各自对连续功能图(CFC)编程做出的改进;但是, 这些改进之间并不是无法结合的。 It must be noted that, although the above embodiments were described to improve its respective continuous function diagram (CFC) programming made; however, not between these improvements are not binding. 所有以上的改进中的一个或多个之间可以相互组合以进一步增加CFC编程的灵活性。 CFC may be combined to further increase the flexibility of programming all of the above each other in one or more improved. 这些组合或相互结合也同样在本发明的范围内。 Bonded to each other or a combination of these is also within the scope of the present invention.

[0124] 上述实施例仅供说明本发明之用,而并非是对本发明的限制,有关技术领域的普通技术人员,在不脱离本发明范围的情况下,还可以做出各种变化和变型,因此,所有等同的技术方案也应属于本发明公开的范畴。 [0124] the above-described embodiments are merely illustrative of the present invention, and are not restrictive of the invention, relating to ordinary skill in the art, without departing from the scope of the present invention, can make various changes and further modifications, Therefore, all equivalent technical solutions should belong to the scope of the present disclosure.

Claims (10)

  1. 1. 一种连续功能图编程方法,包括: 确定连续功能图中的任务,所述任务包括多个功能块; 修改至少一个所述功能块的输出连接器的初值;W及在执行所述功能块时,更新所述输出连接器的所述初值。 1. A continuous function programming method, comprising: determining a continuous function chart of tasks, the tasks including a plurality of functional blocks; the initial value of the output connector to modify at least one of said functional block; and W is performed in the when the functional blocks, updating the initial value of the output connector.
  2. 2. 根据权利要求1所述的方法,所述任务包括预置任务或条件任务。 2. The method according to claim 1, comprising a pre-set task or tasks the task conditions.
  3. 3. 根据权利要求1所述的方法,其中修改至少一个所述功能块的输出连接器的初值包括;加载输入连接器的可W修改的初值和加载输出连接器的可W修改的初值。 3. The method according to claim 1, wherein modifying the at least one initial value of the output connector includes functional blocks; W may be modified load input connector can modify the initial value of W and the initial load output connector value.
  4. 4. 根据权利要求3所述的方法,所述在执行所述功能块时,更新所述输出连接器的所述初值的步骤包括:在任务调度阶段,读输入连接器的所述初值,执行所述功能块的代码, 并在所述功能块代码中更新所述功能块输出连接器的所述初值。 4. The method according to claim 3, when the execution of the function blocks, the step of updating the initial value of the output connector comprising: task scheduling stage, the read initial value of the input connector performing the function block code, and updating the initial value of the function block output connector in the functional block code.
  5. 5. 根据权利要求4所述的方法,进一步包括使用功能块输出连接器的值更新与该输出连接器相连接的输出变量的值。 5. The method as claimed in claim 4, further comprising using the value of the output variable function block updates the value of the output connector and the output connector connected.
  6. 6. -种在连续功能图编程中修改功能块输出连接器的初值方法,包括: 加载所述功能块的输入连接器值; 加载所述功能块的输出连接器的可W修改的初值;W及更新所述功能块的所述输出连接器的所述初值。 6. - Initial modifications connector block output method in a continuous function programming, comprising: loading an input connector of the functional block value; W may be modified output connector loading the initial value of the function block ; the output connector W and updating the initial value of the functional blocks.
  7. 7. 根据权利要求6所述的方法,其中所述功能块包括在预置任务或条件任务中。 7. The method according to claim 6, wherein the functional block is included in a preset task or tasks conditions.
  8. 8. 根据权利要求6所述的方法,其中更新所述功能块的所述输出连接器的所述初值步骤包括:在任务调度阶段,读输入连接器的所述初值,执行所述功能块的代码,并在所述功能块代码中更新所述功能块输出连接器的所述初值。 8. The method according to claim 6, wherein said initial value of said step of updating the output connector of the function block comprises: task scheduling stage, the initial value read input connector, perform the functions block codes, and updates the function block code blocks in the functional output of the initial value of the connector.
  9. 9. 根据权利要求8所述的方法,进一步包括使用功能块输出连接器的值更新与该输出连接器相连接的输出变量的值。 9. The method according to claim 8, further comprising using the value of the output variable function block updates the value of the output connector and the output connector connected.
  10. 10. 根据权利要求6所述的方法,其中连接器值有可能是输入变量的值、常数或其他功能块的输出连接器的值。 10. The method according to claim 6, wherein the connector may be the value of the input variable values, constants, or other output connector block.
CN 201410838636 2014-12-30 2014-12-30 Continuous function chart programming method CN104572233A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201410838636 CN104572233A (en) 2014-12-30 2014-12-30 Continuous function chart programming method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201410838636 CN104572233A (en) 2014-12-30 2014-12-30 Continuous function chart programming method

Publications (1)

Publication Number Publication Date
CN104572233A true true CN104572233A (en) 2015-04-29

Family

ID=53088390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201410838636 CN104572233A (en) 2014-12-30 2014-12-30 Continuous function chart programming method

Country Status (1)

Country Link
CN (1) CN104572233A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503765A (en) * 2014-12-31 2015-04-08 北京纵横机电技术开发公司 Continuous function chart (CFC) programming method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030046657A1 (en) * 2001-08-15 2003-03-06 Jason White Creating a graphical program to configure one or more switch devices
CN1619443A (en) * 2003-09-05 2005-05-25 费舍-柔斯芒特系统股份有限公司 State machine function block with a user modifiable output configuration database
CN101334653A (en) * 2007-06-29 2008-12-31 发那科株式会社 Sequence program editing apparatus
CN103995682A (en) * 2013-02-20 2014-08-20 西门子公司 Program display system of programmable logic controller and programmable logic controller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030046657A1 (en) * 2001-08-15 2003-03-06 Jason White Creating a graphical program to configure one or more switch devices
CN1619443A (en) * 2003-09-05 2005-05-25 费舍-柔斯芒特系统股份有限公司 State machine function block with a user modifiable output configuration database
CN101334653A (en) * 2007-06-29 2008-12-31 发那科株式会社 Sequence program editing apparatus
CN103995682A (en) * 2013-02-20 2014-08-20 西门子公司 Program display system of programmable logic controller and programmable logic controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503765A (en) * 2014-12-31 2015-04-08 北京纵横机电技术开发公司 Continuous function chart (CFC) programming method

Similar Documents

Publication Publication Date Title
Harel et al. Synthesis revisited: Generating statechart models from scenario-based requirements
US5956479A (en) Demand based generation of symbolic information
US6381737B1 (en) Automatic adapter/stub generator
US5875331A (en) System and method for generating target language code utilizing an object oriented code generator
US5202996A (en) Software structuring system and method by data table translation
US5339435A (en) Heterogenous software configuration management apparatus
US6675377B1 (en) Program conversion apparatus
US20070233645A1 (en) System and Method for Building an XQuery Using a Model-Based XQuery Building Tool
US20110029967A1 (en) Model driven deployment of composite applications
US20020199170A1 (en) Collection makefile generator
US20120174061A1 (en) Code suggestion in a software development tool
US7228527B1 (en) Method and system for structuring a procedure
Pratt-Szeliga et al. Rootbeer: Seamlessly using gpus from java
US20120166963A1 (en) Converting desktop applications to web applications
US20120096444A1 (en) Control flow analysis methods and computing devices for converting cobol-sourced programs to object-oriented program structures
US20090172637A1 (en) Markup-based language for manifests
US20080288928A1 (en) Methods and Systems for Converting Application Code in Turbine Control Systems
US7499956B1 (en) Annotation processing from source files and class files
US20160357519A1 (en) Natural Language Engine for Coding and Debugging
US7565364B1 (en) Annotation processor discovery
Rödiger et al. RKWard: a comprehensive graphical user interface and integrated development environment for statistical analysis with R
US20070050380A1 (en) Nullable and late binding
US20120054722A1 (en) Trace generating unit, system, and program of the same
CN101329638A (en) Method and system for analyzing parallelism of program code
Fauth Beyond tool-specific machine descriptions

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination