CN108345451B - Continuous function diagram programming method - Google Patents

Continuous function diagram programming method Download PDF

Info

Publication number
CN108345451B
CN108345451B CN201810136465.8A CN201810136465A CN108345451B CN 108345451 B CN108345451 B CN 108345451B CN 201810136465 A CN201810136465 A CN 201810136465A CN 108345451 B CN108345451 B CN 108345451B
Authority
CN
China
Prior art keywords
task
function
periodic
programming
continuous
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810136465.8A
Other languages
Chinese (zh)
Other versions
CN108345451A (en
Inventor
谢冰若
郑雪洋
夏菲
高吉磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Locomotive and Car Research Institute of CARS
Beijing Zongheng Electromechanical Technology Development Co Ltd
Original Assignee
Locomotive and Car Research Institute of CARS
Beijing Zongheng Electromechanical Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Locomotive and Car Research Institute of CARS, Beijing Zongheng Electromechanical Technology Development Co Ltd filed Critical Locomotive and Car Research Institute of CARS
Priority to CN201810136465.8A priority Critical patent/CN108345451B/en
Publication of CN108345451A publication Critical patent/CN108345451A/en
Application granted granted Critical
Publication of CN108345451B publication Critical patent/CN108345451B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a continuous function diagram programming method, which comprises the following steps: when establishing a continuous functional diagram CFC project, determining the number of periodic tasks; appointing a scheduling period for each periodic task; and assigning a task type and an execution sequence number to each function block FB when programming using the continuous function graph, wherein the task type is unique and the same periodic tasks have the same task type.

Description

Continuous function diagram programming method
Technical Field
The invention relates to an industrial control programming method, in particular to a continuous function diagram programming method.
Background
Continuous Function charts (CFC-Continuous Function charts) are a graphical programming language, which has characteristics of (1) automatically generating a program by drawing a Function Chart, (2) having a powerful pre-manufactured library, (3) reducing development costs and reducing errors by simple wiring, and not only having elements typical of a Programmable logic Controller P L C (Programmable L organic Controller), such as input/output, timers, counters, symbol tables, etc., but also having characteristics of a graphical programming language, which is very suitable for process control and system engineering.
However, the programming of the continuous function chart CFC is not flexible enough to meet the actual needs of users in industrial control, and therefore, it is very necessary to provide a more flexible method for programming the continuous function chart CFC.
Disclosure of Invention
In view of the above technical problems, the present application provides a continuous function chart programming method, including: when establishing a continuous functional diagram CFC project, determining the number of periodic tasks; appointing a scheduling period for each periodic task; and assigning a task type and an execution sequence number to each function block FB when programming using the continuous function graph, wherein the task type is unique and the same periodic tasks have the same task type.
The method as described above, further comprising: when the sequential function chart program is compiled, task functions are generated by task type, and function block codes are placed in each task function by execution order number.
The method as described above, further comprising: the continuous function graph is compiled by a continuous function graph compiler into executable code that can be recognized by the target machine scheduling core.
The method as described above, further comprising: and establishing a corresponding thread on the target machine according to the task type.
The method as above, wherein the target machine comprises a plurality of threads, and the plurality of threads have respective priorities, wherein a high priority thread can interrupt a low priority thread and execute first.
The method as described above, wherein the priority of the thread corresponding to the periodic task with the shorter scheduling period is higher.
The method as described above, wherein the number of periodic tasks is 8 or a power of 8.
The method as above, wherein the task type corresponds to a scheduling period.
The method as described above, wherein each thread may call a corresponding periodic task function when the scheduling time expires.
The method as described above, wherein each thread is started when its trigger condition is satisfied.
Drawings
Preferred embodiments of the present invention will now be described in further detail with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a method of sequential functional diagram CFC programming according to one embodiment of the present invention;
FIG. 2 is a schematic illustration of periodic tasks in CFC programming according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a CFC programming creating periodic tasks according to one embodiment of the present invention;
FIG. 4a is a modified function block output connector initial value method for sequential function chart programming according to one embodiment of the present invention;
FIG. 4b is a schematic diagram of a method of implementing multiple output variables according to one embodiment of the invention;
FIG. 5a is a flow chart for setting the physical quantity M in CFC programming according to one embodiment of the present invention;
FIG. 5b is a flow chart when the physical quantity M is observed in CFC programming according to one embodiment of the present invention;
FIG. 6 is a difference processing flow diagram of sequential function map file comparison according to one embodiment of the present invention; and
FIG. 7 is a schematic diagram of a graphical display of the difference between consecutive function map files according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The continuous function graph CFC comprises a plurality of function blocks. Each functional block is capable of implementing a simple logic function. By connecting the input connectors and output connectors of different functional blocks, the continuous function chart CFC programming can achieve complex logic function control.
The user can compile after completing the writing of the project by mouse click dragging, then the CFC program is compiled in a whole, the compiled result appears in the form of SC L code, and finally ST L code is generated, and the user can execute the code by downloading the code into P L C.
In the CFC programming of the continuous function diagram, function blocks with different scheduling times are distributed in different periodic scheduling tasks, and each periodic scheduling task is set as a fixed scheduling period, so that the multi-periodic scheduling task control of the function blocks is realized. In the same functional diagram, the functional blocks of the same scheduling cycle are assigned a fixed execution order. In a plurality of successive function charts, function blocks of the same schedule cycle are executed in the order of the successive function charts.
In the existing continuous function diagram CFC programming, function blocks are scheduled according to periodic tasks. This is obviously not flexible, since some functional blocks need only be executed once before the periodic task scheduling, and do not need to be periodically scheduled in some applications.
In order to realize single scheduling and ensure the mutual matching between different continuous function diagrams, according to one embodiment of the invention, a continuous function diagram with multi-stage preset tasks is provided. For example, for a function diagram with two levels of preset tasks, before starting to execute a periodic task, the two levels of preset tasks are executed, so that the programming of the continuous function diagram CFC is more flexible.
Figure 1 is a schematic diagram of a method of continuous functional graph CFC programming according to one embodiment of the present invention. As illustrated in fig. 1, the method 100 includes: after the program starts 101, the preset class task 1 function blocks in the continuous function chart 1 are executed in step 102, then the preset class task 1 function blocks in the continuous function chart 2, … …, and so on are executed in sequence in step 103 until step 104, the preset class task 1 function blocks in the continuous function chart (k-1) are executed and the preset class task 1 function blocks in the continuous function chart k are executed in step 105, where k is the number of continuous function charts. After the preset class task 1 is completely executed, the preset class task 2 function block in the continuous function chart 1 is executed in step 106, the preset class task 2 function block in the continuous function chart 2 is executed in step 107, … …, and so on, until the preset class task 2 function block in the continuous function chart (k-1) is executed in step 108 and the preset class task 2 function block in the continuous function chart k in step 109, where k is the number of continuous function charts in the continuous function chart project. After the preset class task 2 is completely executed, the execution of the periodic class task is started in step 110.
The above example of the present invention provides a method for programming a continuous function graph with two levels of pre-set class tasks. Before the periodic task is started to be executed, the two-stage preset task is executed, so that the hardware resource of the target controller can be greatly saved, and the flexibility of continuous function diagram programming is greatly improved.
According to another embodiment of the present invention, for periodic tasks, the continuous function graph of the present invention programs a variable number of periodic tasks. The existing products supporting the programming of the continuous function diagram have fixed number of periodic tasks, and the number of the periodic tasks is generally within 5. However, this limitation on periodic tasks greatly limits the flexibility of software development, and too many periodic tasks waste system resources.
In one example of the invention, the number of periodic tasks in the programming of successive function graphs is variable and prioritized. The high priority task may be executed first, i.e. the low priority task may be interrupted and executed first. Generally, a shorter scheduling period results in higher task priority.
Figure 2 is a schematic diagram of periodic tasks in CFC programming according to one embodiment of the present invention. As shown in fig. 2, for each functional block fb (function block), it includes the following parameters: instance name, type FBTYPE, input IN, and output OUT. The inputs IN and outputs OUT of the multiple FBs are connected to each other to form a periodic task. For example, in the continuous function diagram in fig. 2, there are 8 independent FB strings in total, each FB string represents one periodic task, and thus, the number of periodic tasks is 8 in the example of fig. 2.
Further, each periodic task may include a different number of FBs. For example, n FBs are included in the first periodic task, and are FB1-FBn respectively; the second periodic task includes 3 FBs, FBA-FBC respectively. Wherein, each FB has an execution sequence number, which is a positive integer and represents the execution sequence of the FB in the periodic task. Wherein each FB also has a task type which represents the number of the periodic task in which it is located. In the present embodiment, the above parameters and numbers can be flexibly set to obtain the flexibility of CFC programming according to actual requirements. In the example of FIG. 2, a task type (T1-T8) and an execution sequence number may be specified for each function block in the sequential function diagram editor. For example, the function blocks FB1 and FB2 … … FBn in FIG. 1 belong to the T1 task, and the execution sequence numbers of the function blocks FB1 and FB2 … … FBn are 1 and 2 … … n in sequence. The other T2-T8 tasks are similar to the T1 task.
Figure 3 is a schematic diagram of creating periodic tasks in CFC programming according to one embodiment of the present invention. First, in step 301, when a continuous function diagram CFC project is established, the number of periodic tasks is determined, and the task type is determined. Taking the embodiment shown in FIG. 2 as an example, 8 task types of T1-T8 are created.
Next, in step 302, a scheduling period is specified for the T1-T8 tasks. In step 303, when programming using the sequential function diagram, each function block FB is assigned one task type and execution sequence number of T1-T8. In step 304, when compiling the sequential function chart program, T1-T8 task functions are generated according to task categories, and function block codes are placed in each task function according to the execution sequence numbers.
The following is an example of the procedure of the embodiment of fig. 2, which is only used to illustrate the technical solution of the present invention.
Figure GDA0002288674920000071
Next, in step 305, the sequential function graph is compiled by the sequential function graph compiler into executable code that is recognizable by the target machine scheduling core. At step 306, 8 threads of T1-T8 are established with priority from high to low on the target machine based on a real-time scheduling kernel (e.g., reference POSIX.1b). At step 307, the corresponding thread is activated in the project-specific scheduling cycle, and the corresponding T1-T8 task function is executed in the thread. For ease of understanding, threads may be understood as endless loops. The real-time scheduling kernel of the target machine may initiate or terminate task thread execution.
Specifically, each periodic task is compiled by the compiler into a periodic task function, T1(), T2() … … T8 (). And numbering the task functions in each period according to the execution sequence, and calling the functions corresponding to all the function blocks belonging to the task. For example, the periodic task function T1() calls FB1(), FB2() … … FBn (), respectively. The other T2-T8 task functions are similar to the T1() task function.
As shown in fig. 3, after the compiled continuous function graph program is downloaded to the target machine, the target machine scheduling core starts 8 periodic task threads, and as shown in fig. 3, the 8 threads call corresponding periodic task functions when the scheduling time is up. Specifically, 8 threads of T1-T8 run on the target machine. Each thread is satisfied with the triggering condition, namely: condition 1 equals 1, start. And then after the corresponding scheduling time T1-T8 arrives, a task function T1() -T8() of the T1-T8 is called to complete the calling of the periodic task of each T1-T8, so that the corresponding control function is realized. Taking the T1 task thread as an example, after the T1 schedule time expires, the T1 task function T1() is called. The other T2-T8 task threads are similar to the T1 task threads.
According to one embodiment of the invention, the minimum unit of memory of the current streaming controller hardware is at most 8 or power of 8 bits (bit). By adopting the scheme of 8 periodic tasks, the optimal balance of memory resources and scheduling can be achieved when a task scheduling algorithm and a task context data structure are programmed. For example, if the number of periodic tasks is less than 8, memory resources are wasted, and if more than 8, the system task scheduling load is increased. Also, the periodic task setting of 8 has higher programming flexibility.
In order to increase the flexibility of CFC programming, the invention proposes a method for continuous function graph CFC programming of the function block outputs of modifiable initial values, according to one embodiment of the invention.
In existing sequential function CFC programming block diagrams, the function blocks include a default input connector and a default output connector, where the initial value is 0 and is not modifiable. This setting is set for the periodic scheduling task in the continuous function chart. Since the value of the output connector of the functional block is periodically updated under a periodic scheduling task, it makes no sense to set or modify the initial value of the output connector.
However, within the framework of the invention, there are preset tasks in the continuous function programming in addition to the periodic scheduling task. According to one embodiment of the invention, a conditional call task is also included in the CFC programming. When the condition is satisfied, executing the calling task. When the condition is not satisfied, the function blocks within the conditional call task will not be executed. At this point, the value of the output connector of the unexecuted function block will remain the initial value for a long time, and will not be updated until the function block is executed. For this case it makes sense that the initial value of the output connector of the functional block can be modified.
FIG. 4a is a method of modifying function block output connector initial values for sequential function chart programming according to one embodiment of the present invention. As shown in fig. 4a, in the method 400, the execution of any one of the function blocks in the sequential function diagram includes:
at step 410, an input connector initial value is loaded during an initialization phase, wherein the initial value is modifiable at programming and runtime. At step 420, an initial value for the output connector is loaded during an initialization phase, wherein the initial value is modifiable both at programming and runtime. In step 430, in the task scheduling phase, the value of the input connector is read, the code of the function block FB is executed, and the value of the function block output connector is updated in the function block FB code. But since the function block FB may be subject to a conditional task, the function block FB code may never be executed when the condition is not met, and the function block FB output connector will always hold the initial value of step 420. Finally, in step 440, the value of the output variable connected to the output connector is updated using the value of the function block FB output connector.
The method for modifying the initial value of the function block output connector for programming the continuous function diagram, which is provided by the embodiment of the invention, overcomes the defect that the CFC (continuous function diagram) can not modify the initial value of the output connector, and can greatly improve the programming flexibility.
According to another embodiment of the present invention, to increase the flexibility of programming a sequential function chart, the present invention proposes a multiple output variable. The multiple output variables are global variables defined in the continuous function diagram and can be repeatedly assigned by the output variables of different function blocks.
As is known, the most basic program unit in the continuous Function diagram programming is a Function Block (FB), and its interface with the outside world is its input variables and output variables. The continuous function diagram also defines a global variable, as long as the data types are ensured to be consistent, the global variable can be assigned by an output variable of any function block of any task, and meanwhile, the global variable can also be assigned to an input variable of any function block of any task, so that data transmission among different tasks and different function blocks is realized.
However, in the current continuous function diagram, the global variable can be assigned only once by the output variable of the function block, and cannot be assigned repeatedly by the output variables of a plurality of function blocks, that is, the current continuous function diagram programming only supports a single output variable.
In order to further provide programming flexibility in view of the above problems, the present invention proposes a multiple output variable for a continuous function graph programming method. The multiple output variable is a global variable and can be defined as any data type, and as long as the output variable of any functional block of the continuous functional diagram is consistent with the data type of the output variable, the multiple output variable can be repeatedly assigned. According to one embodiment of the invention, the multi-output variable can accept the assignment of a plurality of function block output variables of the same or different tasks, and the current value of the multi-output variable is determined by the last assignment operation. In addition, the multiple output variables can also assign values to input variables of multiple functional blocks of the same or different tasks.
FIG. 4b is a diagram of a method of implementing multiple output variables according to one embodiment of the invention. As shown in FIG. 4b, the engineering of the sequential function chart programming includes tasks of T1, T2, T3 …, etc. The output variable 2 of the function block X1 in the T1 task, the output variable 1 of the function block Y1 in the T2 task, and the output variable 2 of the function block Z1 in the T3 task are all of the same data type W as the multiple output variable M. Thus, they can both be assigned to the multiple output variable M.
Meanwhile, on the premise of ensuring the same output type, the multiple output variable M may also be assigned to input variables of different function blocks of different tasks, and in fig. 4b, the input variable 1 of the function block X2 in the T1 task, the input variable 2 of the function block Y2 in the T2 task, and the input variable 1 of the function block Z2 in the T3 task are all data types a as the multiple output variable M, and they may all be assigned by the multiple output variable M.
It should be understood by those skilled in the art that fig. 4b is merely given as a specific implementation, but is not limited thereto. In a continuous function diagram programming environment, as long as the data type is consistent with the multiple output variables, different function blocks of different tasks can repeatedly assign values to the multiple output variables, and meanwhile, the multiple output variables can also assign values to input variables of different function blocks of different tasks of the same data type, so that data transmission of different function blocks of different tasks can be more flexibly realized.
In accordance with one embodiment of the present invention, within the framework of the present invention, the present invention proposes a new scalable continuous function graph data type. The data types may represent any physical quantity: the basic values and units of physical quantities and their initial physical values may be set at the time of programming. The physical value can be read directly when observing the debugging. This new data type allows for more flexibility in the programming of the CFC in a continuous functional diagram, reducing the workload on the programmer.
In the current programming of the continuous function chart, the data types include boolean, unsigned single byte integer, signed single byte integer, unsigned double byte integer, signed double byte integer, unsigned four byte integer, signed four byte integer, time type and other data types.
However, in the continuous function diagram CFC programming and debugging process, there are usually many physical quantities. If the physical quantity scaling is forced to be converted into the data type for use, great inconvenience is brought, and the programming flexibility is limited. When observation debugging is carried out, the data types must be manually converted into physical quantities. This greatly increases the complexity of programming and debugging the sequential function graph.
According to one embodiment of the invention, a scalable continuous function graph data type, physical quantity type M, is provided. For the new continuous function graph, the base value M of the data type, physical quantity type M, can be scaledjUnit MD and physical quantity initial value M0It needs to be set when the continuous function chart is programmed. And in the specific function block FB execution process, automatically converting the physical quantity into binary data according to the base value, the physical quantity value and the scaling value, wherein the scaling value represents the length of the binary data. The larger the scaling value, the larger the range of numbers that can be represented, and the higher the accuracy.
According to an embodiment of the invention, the physical quantity is set by the formula:
binary data as physical quantity/base value × 2Scaled value
The binary data is obtained by the target machine and then operated. When the target machine observes through the upper computer, the target machine sends binary data to the upper computer, the upper computer performs operation according to a base value and a calibration value of the upper computer to obtain a physical value for displaying, and the formula is as follows:
physical value being binary data/2Scaled value× base value.
Fig. 5a is a flow chart of setting a physical quantity M in CFC programming according to an embodiment of the invention and fig. 5b is a flow chart of observing the physical quantity M in CFC programming according to an embodiment of the invention. As shown in FIG. 5a, in the setting method 510, in step 511, the user inputs a base value N of an instance N of a physical quantity type on the upper computerjAnd the unit ND. In step 512, the upper computer calculates the conversion coefficient of the instance N, i.e., 2Scaled valueThe base value. In step 513, the upper computer calculates the actual physical value N according to the physical quantity Ni(i is 0,1, …) and N, and calculating the binary value of N, i.e., Ni×2Scaled valueThe base value. In step 514, the binary value of N obtained in the above step is downloaded to the target device, and the calculation is performed in the target device. Similarly, as shown in fig. 5b, in the observation method 520, in step 521, binary data of the physical quantity N is uploaded from the target machine to the host computer. In step 522, the upper computer calculates the conversion coefficient of the instance N, i.e., 2Scaled valueThe base value. In step 523, the upper computer calculates a physical value of N, i.e., a binary value/conversion coefficient of N, from the binary value of N and the conversion coefficient. In step 524, the user can easily observe the physical value of N from the upper computer.
The embodiment of the invention provides a scalable continuous function diagram data type, physical quantity M. The data types may represent any physical quantities. Data of a physical quantity type is convenient to use, and it is only necessary that base values and units of the physical quantity can be set at the time of programming. The initial physical values may be either default or set at the time of programming. In observing the debugging, the physical value can be directly read in the example of the invention. As explained in the above embodiments, the addition of the new data type, the physical quantity M, facilitates the setting and observation of the physical quantity in the programming and debugging of the continuous function diagram, makes it easier to operate, and greatly improves the programming and debugging efficiency of the continuous function diagram.
Another adjustment made to the existing sequential function chart CFC programming within the framework of the present invention is the addition of a comparison function. This functionality is very important to CFC programmers. Because the current continuous function chart programming products do not have the function of graphical comparison of continuous function chart files. However, it is difficult to accurately and comprehensively reflect the differences in software design by software design documents. This causes great inconvenience to software version management and software maintenance, increasing the workload of software developers in this regard. This also limits the flexibility of CFC programming.
The method for comparing continuous function diagrams provided according to one embodiment of the invention automatically identifies the design difference of two CFC files and outputs the difference in a text and graphical mode which is easy to compare. The method is particularly necessary when the software versions or software branch differences are compared, the workload of software design, test and maintenance personnel can be reduced, and the working efficiency is improved.
Specifically, the differences in the continuous functional diagram fall into two categories:
(1) non-functional differences, including: the content of the annotation, the placement position of the function block, and the start/end/inflection coordinates of the connecting line. Such differences do not affect the final software functions, and only affect the readability of the continuous functional diagram, referred to as N differences for short; and
(2) functional differences, including: the method comprises the steps of increasing and decreasing function block examples, changing the types of the same-name function blocks, the difference between task types and execution sequence numbers of the same-name function blocks, the connection relation of function block connectors or global signals, and the initial values of the function block connectors and the global signals. Such differences affect software functionality, referred to as F differences.
The comparison objects between successive function graph files of an example of the present invention include: function blocks, signals, comment blocks, connections. Both N and F differences are included.
The principle of comparison of successive functional diagrams for an embodiment of the invention is as follows:
the method comprises the steps of collecting information of all programming objects in two continuous function diagram files, wherein the information comprises function blocks, signals, annotation blocks and connection information, and organizing the object information of the two continuous function diagrams into two sorting tables respectively. Each object in the table carries a characteristic string. The characteristic character string of the function block and the comment block is a block name, the characteristic character string of the signal is a signal name, and the connected characteristic character string is a connection start point object (function block or signal) name plus an end point object (connector or signal) name. The objects with the same characteristic character strings are searched in the two tables, and the object information is further compared. The object of which the characteristic character string exists in only one table is directly judged as a difference object.
According to the above comparison principle, the example of the present invention makes the following settings:
1. the names of the function blocks in the continuous function graph file have uniqueness, namely, the function blocks without duplicate names;
2. the signal names in the continuous function chart have uniqueness, namely, signals without duplicate names;
3. the function block execution sequence number in each task in the continuous function diagram has uniqueness, namely two function blocks with the same sequence number in the same task are not ordered.
According to one example of the present invention, the function block information participating in the comparison includes:
1. the task type of the function block;
2. the execution sequence number of the function block;
3. a function block version number;
4. all connectors of the functional block;
5. connector initial values;
6. whether the boolean type input connector negates;
7. whether the output connector has non-volatile properties;
8. connector notes;
9. function block annotation; and
10. coordinates of function blocks
According to one example of the present invention, the signal information participating in the comparison includes:
1. the type of signal;
2. an initial value of the signal; and
3. description of the signals.
According to one example of the present invention, comment block information participating in comparison includes:
1. annotating the content text; and
2. location coordinates of the comment block;
according to one example of the present invention, the connection information participating in the comparison includes:
1. connecting the coordinates of the starting points;
2. connecting the terminal coordinates; and
3. and connecting the number of inflection points with the coordinates of each inflection point.
According to an embodiment of the present invention, for each object in the object data table, the page number and coordinate information of the object are recorded, so as to implement graphical comparison.
According to an embodiment of the present invention, all the difference information is recorded in a difference data table. And after the comparison is finished, outputting all difference information according to the entries in a text mode. In a more specific example, a user may graphically highlight a difference object in two juxtaposed panes by double-clicking on the difference text entry.
According to one example of the present invention, each difference entry in the difference data table contains the following information:
1. the difference category: non-functional differences (N) or functional differences (F);
2. a difference index; and
3. the differences describe text.
Among them, the so-called disparity index is used to locate the page number and coordinates of the disparity. According to an example of the present invention, the difference index may be a difference number, and an object corresponding to the difference may be determined according to the difference number. If a difference is that there is no corresponding object, the difference index is defined as-1.
According to an embodiment of the present invention, when a user selects or double-clicks a difference text entry, an object corresponding to the difference can be quickly determined according to the difference index; then, the page number and the coordinate of the difference are positioned according to the page number and the coordinate of the corresponding object, so that the content needing to be displayed to the user is determined, and the object corresponding to the difference is highlighted.
When the application software written by the continuous function diagram is upgraded, branched and debugged, the difference between two continuous function diagram files is often needed to be compared. Before the present invention, this work was largely limited by the use of programmer written software modification logs and version descriptions. For example, design errors introduced by programmer error during software modification are unlikely to be documented. The method for comparing the continuous function diagram files can comprehensively and intuitively reflect the design difference of the continuous function diagram software, and the automatic difference analysis has higher efficiency and more accuracy than manual comparison or binary comparison.
FIG. 6 is a difference processing flow diagram of sequential function map file comparison according to one embodiment of the present invention. As shown in fig. 6, the method includes:
firstly, all program pages, function blocks, signals, comment blocks and connection information in a first continuous function diagram file CFC1 are extracted and organized into a sorted internal data table (table 1 for short) which is easy to search quickly;
secondly, all program pages, function blocks, signals, comment blocks and connection information in the second continuous function diagram file CFC2 are extracted and organized into a sorted internal data table (table 2 for short) which is easy to search quickly; and, initially, all objects in table two are marked as the objects not compared;
next, table 1 is traversed. Objects in table 1 (simply referred to as table 1 objects) are sequentially extracted, and objects having the same characteristics are searched in table 2 according to the characteristics of the table 1 objects. If not, the table is marked as a difference, and the object is written into the difference table (for the index of the related table 1 object in table 1, if not, it is-1). If the two objects exist, the data information of the two objects is further compared, and if the two objects are the same, the two objects are respectively marked as non-difference objects; if not, the difference objects are marked respectively, and the difference information is written into the difference information table.
As shown in fig. 6, an initial value i is set to 0, and a loop is entered, i is set to i +1, i < table 1 index range. Extracting the object [ i ] in the table 1, and searching whether the object [ i ] has the characteristics of the object [ i ] in the table 2 according to the characteristics of the object [ i ] in the table 1. If not, the difference content is recorded in the difference table and the index of the difference is-1. If an object [ j ] is found, for example, in Table 2, then the object [ j ] in Table 2 is marked as having been compared. It is next determined whether the information of object [ i ] in table 1 and object [ j ] in table 2 are consistent. If so, a loop is returned, i ═ i +1, otherwise, the difference content is recorded in the difference table, and the index of the difference is the sequential number of positive integers, e.g., difference 1, difference 2, and so on. The difference number is unique and may be used as a difference index in this embodiment. The object [ i ] in table 1 and the object [ j ] in table 2 can be determined according to the difference number. And returning to the circulation, wherein i is i + 1.
Next, table 2 is traversed. The objects in table 2 that are still marked as not-compared are sequentially extracted, marked as difference objects, and written into the difference information table (for the index of the relevant table 2 object in table 2, if not, it is-1).
As shown in fig. 6, an initial value i is set to 0, and a loop is entered, i is set to i +1, i < table 1 index range. Extracting the object [ k ] in the table 2 which is still marked as not compared, judging whether the object [ k ] in the table 2 has been compared, if so, marking the object [ k ] as compared, and recording the content of the difference in the difference table, wherein the index of the difference is-1. And returning to the circulation, wherein i is i + 1.
Finally, the contents of the difference information table are output in a text format.
FIG. 7 is a schematic diagram of a graphical display of the difference between consecutive function map files according to an embodiment of the present invention. As shown in fig. 7, all difference information is textually output into the difference text output pane. Each item of difference text begins with a difference category and a number, which is also an index value for the difference entry.
As shown in FIG. 7, when the user double-clicks on the difference text, the piece of difference text is highlighted. And simultaneously, automatically extracting the difference number, and searching a table according to the difference number to extract corresponding difference objects in the first table and the second table. And determining display contents in two continuous function diagram panes according to the page numbers and the coordinates of the difference objects stored in the first table and the second table, and highlighting the corresponding difference objects.
The present invention has been described in the above embodiments to increase the flexibility of continuous function graph (CFC) programming. It should be noted that although the above embodiments each describe their respective improvements to the programming of the sequential function chart (CFC); however, these improvements are not combinable. One or more of all of the above improvements may be combined with each other to further increase the flexibility of CFC programming. Combinations or inter-combinations of these are also within the scope of the invention.
The above embodiments are provided only for illustrating the present invention and not for limiting the present invention, and those skilled in the art can make various changes and modifications without departing from the scope of the present invention, and therefore, all equivalent technical solutions should fall within the scope of the present invention.

Claims (10)

1. A method of continuous function graph programming, comprising:
when establishing a continuous functional diagram (CFC) project, determining the number of periodic tasks, wherein the number of the periodic tasks is variable;
appointing a scheduling period for each periodic task;
when programming using a continuous function diagram, assigning a task type and an execution sequence number to each function block FB of the continuous function diagram, the function blocks belonging to the same periodic task having the same task type, the task type and the execution sequence number of each function block being able to be set; and
and executing the multi-stage preset task before executing the periodic task.
2. The method of claim 1, further comprising: when the sequential function chart program is compiled, task functions are generated by task type, and function block codes are placed in each task function by execution order number.
3. The method of claim 2, further comprising: the continuous function graph is compiled by a continuous function graph compiler into executable code that can be recognized by the target machine scheduling core.
4. The method of claim 3, further comprising: and establishing a corresponding thread on the target machine according to the task type.
5. The method of claim 4, comprising including multiple threads on the target machine, the multiple threads having respective priorities, wherein a high priority thread can be executed first by interrupting a low priority thread.
6. The method of claim 5, wherein the shorter the scheduling period, the higher the priority of the thread corresponding to the periodic task.
7. The method of claim 1, wherein the number of periodic tasks is 8 or a power of 8.
8. The method of claim 1, wherein the task type corresponds to a scheduling period.
9. The method of claim 4, wherein each thread invokes a corresponding periodic task function when the scheduling time expires.
10. The method of claim 4, wherein each thread starts when its trigger condition is satisfied.
CN201810136465.8A 2014-12-30 2014-12-30 Continuous function diagram programming method Active CN108345451B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810136465.8A CN108345451B (en) 2014-12-30 2014-12-30 Continuous function diagram programming method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410841334.1A CN104503817B (en) 2014-12-30 2014-12-30 A kind of continuous function figure programmed method
CN201810136465.8A CN108345451B (en) 2014-12-30 2014-12-30 Continuous function diagram programming method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201410841334.1A Division CN104503817B (en) 2014-12-30 2014-12-30 A kind of continuous function figure programmed method

Publications (2)

Publication Number Publication Date
CN108345451A CN108345451A (en) 2018-07-31
CN108345451B true CN108345451B (en) 2020-07-14

Family

ID=52945218

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810136465.8A Active CN108345451B (en) 2014-12-30 2014-12-30 Continuous function diagram programming method
CN201410841334.1A Active CN104503817B (en) 2014-12-30 2014-12-30 A kind of continuous function figure programmed method

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201410841334.1A Active CN104503817B (en) 2014-12-30 2014-12-30 A kind of continuous function figure programmed method

Country Status (1)

Country Link
CN (2) CN108345451B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503766A (en) * 2014-12-31 2015-04-08 北京纵横机电技术开发公司 Continuous function chart (CFC) programming method
CN104503818A (en) * 2014-12-31 2015-04-08 北京纵横机电技术开发公司 Continuous function chart (CFC) programming method
CN104503765A (en) * 2014-12-31 2015-04-08 北京纵横机电技术开发公司 Continuous function chart (CFC) programming method
CN106569785B (en) * 2015-10-09 2021-03-09 阿里巴巴集团控股有限公司 Method and device for generating job form
JP6938250B2 (en) * 2017-07-05 2021-09-22 キーサイト テクノロジーズ, インク. How to program the measurement system, measurement system, and computer-readable storage medium
CN111352381B (en) * 2019-12-16 2024-03-26 常州汇邦电子有限公司 Programmable logic controller programming method, programmable logic controller and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103415819A (en) * 2011-03-15 2013-11-27 欧姆龙株式会社 Control device and system program, and recording medium
CN103562807A (en) * 2011-07-15 2014-02-05 欧姆龙株式会社 CPU unit for PLC, PLC-use system program, recording medium in which PLC-use system program is stored, PLC system, PLC support device, PLC support program, and recording medium in which PLC support program is stored

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7024665B2 (en) * 2002-07-24 2006-04-04 Smar Research Corporation Control systems and methods for translating code from one format into another format
CN101515167A (en) * 2009-04-07 2009-08-26 大连理工大学 Method for realizing IEC61499 flexible function block by using IEC61131-3 function block
EP2729855A1 (en) * 2011-07-06 2014-05-14 Abb Ag Method and device for the programming and configuration of a programmable logic controller
EP2781977B1 (en) * 2013-03-20 2016-10-12 Siemens Aktiengesellschaft Method and system for managing distributed computing in automation systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103415819A (en) * 2011-03-15 2013-11-27 欧姆龙株式会社 Control device and system program, and recording medium
CN103562807A (en) * 2011-07-15 2014-02-05 欧姆龙株式会社 CPU unit for PLC, PLC-use system program, recording medium in which PLC-use system program is stored, PLC system, PLC support device, PLC support program, and recording medium in which PLC support program is stored

Also Published As

Publication number Publication date
CN108345451A (en) 2018-07-31
CN104503817B (en) 2018-03-20
CN104503817A (en) 2015-04-08

Similar Documents

Publication Publication Date Title
CN108345451B (en) Continuous function diagram programming method
US8776016B2 (en) Integration of structured profiling data with source data in the eclipse development environment
US11232257B2 (en) Apparatuses, systems, and methods for providing a visual program for machine vision systems
CN104778124A (en) Automatic testing method for software application
US20080288928A1 (en) Methods and Systems for Converting Application Code in Turbine Control Systems
EP3647941B1 (en) Engineering apparatus, control method of engineering apparatus, and program
JP2015043198A (en) Analysis system, analysis method and analysis program
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
CN105204837B (en) Method and device for realizing logic programming
US11960925B2 (en) Program generating device, program generating method, and information storage medium
JP2019109580A (en) Industrial control system and supporting device therefor, control supporting method and program
WO2015039628A1 (en) Visualization step programming method
EP3511827A1 (en) Executable program creation device, executable program creation method, and executable program creation program
JP2008293138A (en) Software development support program and software development support method
CN112463139A (en) Programming method and device based on electronic building blocks, electronic equipment and storage medium
CN104714468B (en) A kind of comparative approach of continuous function map file
CN104503765A (en) Continuous function chart (CFC) programming method
CN109033324A (en) A kind of data processing system and method
CN104572233A (en) Continuous function chart programming method
CN115469849A (en) Service processing system, method, electronic device and storage medium
US9389838B2 (en) Method for creating a computer software compiler for client server computing
CN113010159A (en) Script-based task processing method and device
CN104035767A (en) Method for increasing parallel computing programming automation degree of computer
CN104503766A (en) Continuous function chart (CFC) programming method
CN104503818A (en) Continuous function chart (CFC) programming method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant