CN108345451A - A kind of continuous function figure programmed method - Google Patents
A kind of continuous function figure programmed method Download PDFInfo
- Publication number
- CN108345451A CN108345451A CN201810136465.8A CN201810136465A CN108345451A CN 108345451 A CN108345451 A CN 108345451A CN 201810136465 A CN201810136465 A CN 201810136465A CN 108345451 A CN108345451 A CN 108345451A
- Authority
- CN
- China
- Prior art keywords
- task
- continuous function
- function
- functional block
- method described
- 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.)
- Granted
Links
Landscapes
- Programmable Controllers (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to a kind of continuous function figure programmed methods, including:When establishing continuous function figure CFC engineerings, the quantity of periodic task is determined;Dispatching cycle is specified for each periodic task;It is each functional block FB appointed tasks type and execution serial number and when being programmed using continuous function figure, wherein the task type is unique, identical periodic task task type having the same.
Description
Technical field
The present invention relates to a kind of Industry Control Programming method, particularly continuous function figure programmed method.
Background technology
Continuous function figure (CFC-Continuous Function Chart) is a kind of graphical programming language.Continuous work(
It can scheme programming to have the characteristics that:(1) by drawing function chard come automatically generating program;(2) possess powerful ready-made program
Library;(3) development cost is reduced by simple line and reduces mistake.Continuous function figure not only has programmable logic control
The typical element of device PLC (Programmable Logic Controller) processed, such as:Input/output, timer, counting
Device, symbol table etc., and the characteristic with graphical programming language language, are very suitable for process control and system engineering.
CFC is provided derived from IEC 61131-3 standards, is Function Block Diagram (the Function Block of one of five kinds of programming languages
Diagram).Continuous function figure and Function Block Diagram are mainly characterized by it and illustrate the resource and task that it is subordinate to.Although
There is no associated international standards for continuous function figure, but are widely used in industrial control field.
However, continuous function figure CFC programs underaction, actual needs of the user in terms of Industry Control is cannot be satisfied,
Therefore, it is highly desirable to provide a kind of more flexible continuous function figure CFC programmed methods.
Invention content
For the above technical problem, present applicant proposes a kind of continuous function figure programmed methods, including:Establishing continuous work(
When can scheme CFC engineerings, the quantity of periodic task is determined;Dispatching cycle is specified for each periodic task;And using company
It is each functional block FB appointed tasks type and execution serial number, wherein the task type is only when continuous function chart programming
One, identical periodic task task type having the same.
Method as described above, further comprises:When compiling continuous function figure program, task letter is generated according to Task
Number, and in each mission function function block code is placed by execution serial number.
Method as described above, further comprises:By continuous function schema compiler device by continuous function schema compiler at can quilt
Target machine dispatches the executable code of core identification.
Method as described above, further comprises:On target machine corresponding thread is established according to the task type.
Method as described above, wherein including including multiple threads on target machine, and the multiple thread is with respective
Priority, the wherein thread of high priority can be first carried out with the thread of interrupts low-priority.
Method as described above, wherein dispatching cycle, the priority of the shorter corresponding thread of periodic task was higher.
Method as described above, wherein the power that the quantity of the periodic task is 8 or 8.
Method as described above, wherein the task type is corresponding with dispatching cycle.
Method as described above, wherein each thread can then call corresponding periodic duty function in scheduling time.
Method as described above, wherein each thread starts when its trigger condition is set up.
Description of the drawings
In the following, the preferred embodiment of the present invention will be described in more detail in conjunction with attached drawing, wherein:
Fig. 1 is the method schematic diagram of continuous function figure CFC programmings according to an embodiment of the invention;
Fig. 2 is the schematic diagram of periodic duty in CFC programmings according to an embodiment of the invention;
Fig. 3 is the schematic diagram that periodic duty is created in CFC programmings according to an embodiment of the invention;
Fig. 4 a are the modification functional block output connections according to an embodiment of the invention for the programming of continuous function figure
Device initial value method;
Fig. 4 b are the schematic diagrames of the implementation method of multi output variable according to an embodiment of the invention;
Fig. 5 a are the flow charts of the setting physical quantity M in CFC programmings according to one embodiment of present invention;
Fig. 5 b are flow charts when being observed according to one embodiment of present invention to physical quantity M in CFC programmings;
Fig. 6 is the difference process chart that continuous function map file according to an embodiment of the invention compares;And
Fig. 7 is the graphical representation schematic diagram of continuous function map file difference according to an embodiment of the invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Continuous function figure CFC includes multiple functional blocks.Each functional block can realize a simple logic function.Pass through
The input connector of different functional blocks and out connector are attached, complexity may be implemented in the CFC programmings of continuous function figure
Logic function control.
Specifically, the programming interface of continuous function figure CFC is graphical interfaces.Several are contained in the graphical interfaces
Chart (Chart).User is graphically inserted into the block woven in chart Chart, between these specified blocks
Connection relation, or distribute I/O Address for these blocks.Finished item volume by way of support is dragged is clicked mouse this
After writing, user can be compiled.Next, CFC programs will be compiled integrally, the result of compiling is gone out in the form of SCL codes
It is existing, it will finally generate STL codes.User downloads to these codes i.e. executable in PLC.
In the CFC programmings of continuous function figure, for the functional block of different scheduling times, distributed in different period tune
In degree task, each periodic scheduling task is set as fixed dispatching cycle, realizes the multicycle scheduler task control of functional block.
In same functional diagram, the functional block of identical dispatching cycle, which is assigned, fixed executes sequence.In multiple continuous function figures,
The functional block of identical dispatching cycle is executed according to the sequence of continuous function figure.
In existing continuous function figure CFC programmings, functional block is all scheduled according to periodic duty.This is obviously not
It is enough flexible, because part functional block only needs to be executed once before period task scheduling in certain applications, and not carry out
Periodic scheduling.
In order to realize that single is dispatched, and ensure the mutual cooperation between different continuous function figures, one according to the present invention
A kind of embodiment, it is proposed that continuous function figure with multi-stage initialization generic task.For example, for the function of the preset task of two-stage
Figure first carries out the preset generic task of two-stage before starting to execute periodic duty, so that the CFC programmings of continuous function figure have more
There is flexibility.
Fig. 1 is the method schematic diagram of continuous function figure CFC programmings according to an embodiment of the invention.As described in Figure 1,
Method 100 includes:After program starts 101, in step 102,1 functional block of preset value generic task in continuous function Fig. 1 is executed,
Then the functional block of the preset value generic task 1 in step 103 executes continuous function Fig. 2 successively ..., and so on, until
Step 104, it executes the functional block of the preset value generic task 1 in continuous function figure (k-1) and executes continuous function in step 105
Scheme the functional block of the preset value generic task 1 in k, wherein k is the quantity of continuous function figure.It is all executed in preset value generic task 1
After complete, in step 106, execute 2 functional block of preset value generic task in continuous function Fig. 1, executes continuous function in step 107
2 functional block of preset value generic task in Fig. 2 ..., and so on, until step 108 execute it is pre- in continuous function figure (k-1)
The functional block of value generic task 2 and the functional block of the preset value generic task 2 in step 109 continuous function figure k are set, wherein k is to connect
The quantity of continuous function figure in continuous functional diagram engineering.After preset value generic task 2 has all executed, start to execute in step 110
Period generic task.
The example more than present invention proposes a kind of continuous function figure programmed method with the preset generic task of two-stage.In the period
Before task starts execution, the preset generic task of two-stage is executed, the hardware resource of target controller can be greatlyd save, and greatly
Improve the flexibility of continuous function figure programming in ground.
According to another embodiment of the invention, for periodic duty, continuous function figure of the invention programming is variable
The periodic duty of quantity.It is existing that the product of continuous function figure programming is supported all to be fixed periodic duty quantity, generally
Within 5.However, this flexibility that software development is greatlyed restrict for the limitation of periodic duty, and too many week
Phase number of tasks can waste system resource again.
In an example of the present invention, the quantity of the periodic task in the programming of continuous function figure is variable, and
There is priority.High-priority task can take the lead execution, you can be first carried out with interrupting low priority task.In general, adjusting
Spend the period it is shorter task priority it is higher.
Fig. 2 is the schematic diagram of periodic duty in CFC programmings according to an embodiment of the invention.As shown in Fig. 2, for
For each function module FB (Function Block) comprising following parameter:It is Instance Name, type FBTYPE, defeated
Enter IN and output OUT.The input IN and output OUT of multiple FB is interconnected to form periodic duty.For example, continuous work(in fig. 2
8 independent FB strings can be shared in figure, each FB strings represent a cycle task, and therefore, periodic duty number is in the example of Fig. 2
8.
Further, each periodic duty may include the FB of different number.For example, including in first periodic duty
N FB, respectively FB1-FBn;Second period task includes 3 FB, respectively FBA-FBC.Wherein, each FB has one
A execution serial number, is positive integer, represents and executes sequence in the periodic duty in the FB.Wherein, each FB also has
There are one task types, and which represent the numbers of the periodic duty where it.In the example of the present invention, above parameters
Can flexibly it be arranged with number, according to actual demand, to obtain the flexibility of CFC programmings.In the example of figure 2, in continuous work(
Can be each functional block appointed task type (T1-T8) and execution serial number in Graph editor.Such as 1 functional block in figure
FB1, FB2 ... FBn are under the jurisdiction of T1 tasks, their execution serial number is followed successively by 1,2 ... n.Other T2-T8 tasks and T1
Task is similar.
Fig. 3 is the schematic diagram that periodic duty is created in CFC programmings according to an embodiment of the invention.First, in step
In rapid 301, when establishing continuous function figure CFC engineerings, the quantity of periodic duty is determined, and determine task type.With Fig. 2 institutes
For the embodiment shown, that is, create 8 task types of T1-T8.
Next, in step 302, dispatching cycle is specified for T1-T8 tasks.In step 303, continuous function is being used
When scheming programming, the task type and execution serial number in T1-T8 are specified for each functional block FB.In step 304, exist
When compiling continuous function figure program, T1-T8 mission functions are generated according to task category, are compiled by execution sequence in each mission function
Number place function block code.
It is the program example of the embodiment of Fig. 2 below, is merely illustrative of the technical solution of the present invention.
Next, in step 305, by continuous function schema compiler device by continuous function schema compiler at can be by target machine tune
Spend the executable code of core identification.In step 306, on target machine, based on Real-Time Scheduling kernel (for example, with reference to
POSIX.1b), 8 threads of T1-T8 are according to priority established from high to low.In step 307, activation dispatching cycle is specified by engineering
Respective thread executes corresponding T1-T8 mission functions in thread.In order to facilitate understanding, thread can be regarded as Infinite Cyclic.Mesh
The Real-Time Scheduling kernel of mark machine can start or terminated task thread executes.
Specifically, each periodic duty is compiled device and is compiled into a cycle mission function, T1 (), T2 () ... T8
().By serial number is executed in each periodic duty function, all functional block respective functions for being under the jurisdiction of the task are called.Example
As FB1 (), FB2 () ... FBn () can be called in periodic duty function T1 () successively.Other T2-T8 mission functions and T1 ()
Mission function is similar.
As shown in figure 3, after compiled continuous function figure program downloads to target machine, target machine scheduling core can start 8
A periodic duty thread, as shown in figure 3, this 8 threads can then call corresponding periodic duty function in scheduling time.Specifically
For, 8 threads of T1-T8 are run on target machine.Each thread is set up in trigger condition, i.e.,:When condition 1 is equal to 1, open
It is dynamic.Then corresponding each scheduling time T1-T8 then after, mission function T1 ()-T8 () of T1-T8 can be called, complete to adjust
With the periodic duty of each T1-T8, corresponding control function is realized.By taking T1 mission threads as an example, after T1 scheduling times arrive, meeting
Call T1 mission function T1 ().Other T2-T8 mission threads are similar with T1 mission threads.
According to one embodiment of present invention, the memory least unit of current popular controller hardware is mostly 8 or 8 power
Secondary position (bit).It is reachable when writing task scheduling algorithm and task context data structure using the scheme of 8 periodic duties
To the optimum balance of memory resource and scheduling.For example, if periodic duty number is less than 8, memory resource can be wasted, and such as
More than 8 meetings of fruit, which increase system task, dispatches load.Moreover, periodic duty, which is set as 8, has higher flexible in programming.
According to one embodiment of present invention, in order to increase the flexibility of CFC programmings, the present invention proposes a kind of for continuous
The method of the functional block output for changing initial value of functional diagram CFC programmings.
In existing continuous function CFC programming block diagrams, functional block includes that acquiescence input connector and acquiescence output connect
Device is connect, wherein initial value is 0, and cannot be changed.This set is for the periodic scheduling task in continuous function figure
It is arranged.Because under periodic scheduling task, the value of functional block out connector is that the period is newer, so being arranged or changing defeated
The initial value for going out connector is nonsensical.
However under the frame of the present invention, in addition to periodic scheduling task also has preset task in continuous function programming.According to
One embodiment of the present of invention further includes condition calling task in CFC programmings.When the conditions are met, calling task is executed.Work as item
When part does not meet, each functional block in condition calling task is not performed.At this moment, the output for the functional block not being performed
The value of connector will maintain initial value longer time, until performing the functional block can just be updated.For such case, work(
If it will be meaningful that the initial value of the out connector of energy block, which can be changed,.
Fig. 4 a are the modification functional block output connections according to an embodiment of the invention for the programming of continuous function figure
Device initial value method.As shown in fig. 4 a, in the method 400, in continuous function figure the execution of any one functional block include:
In step 410, input connector initial value is loaded in initial phase, wherein the initial value be can in programming and
It is revisable when operation.In step 420, the initial value of out connector is loaded in initial phase, wherein the initial value is can be with
It is all revisable in programming and when operation.In step 430, in task scheduling phase, the value of read input connector executes function
The code of block FB updates the value of functional block out connector in functional block FB codes.But since functional block FB may be under the jurisdiction of
Conditioning tasks, therefore when condition does not meet, the functional block FB codes may be never performed, then the functional block FB outputs
Connector will be always maintained at initial value described in step 420.Finally, in step 440, using functional block FB out connectors value more
The value for the output variable being newly connected with the out connector.
Proposed in the example of the present invention for the programming of continuous function figure to change functional block out connector initial
The method of value, out connector initial value drawback cannot be changed by changing continuous function figure CFC before this, can greatly improve programming
Flexibility.
According to another embodiment of the invention, to increase the flexibility of continuous function figure programming, the present invention proposes a kind of
Multi output variable.The multi output variable is the global variable defined in continuous function figure, can be by the defeated of different functional blocks
Go out variable repeated assignment of values.
As is generally known, continuous function figure programming in, most basic program unit be functional block (Function Block,
FB), it is exactly its input variable and output variable with extraneous interface.Continuous function figure also defines global variable, as long as protecting
It is consistent to demonstrate,prove data type, which can be by the output variable assignment of any functional block of any task, while the overall situation
Variable can also give any task any functional block input variable assignment, with this realize different task, different function block it
Between data transfer.
But in current continuous function figure, global variable can only be primary by the output variable assignment of functional block, it is not possible to
By the output variable repeated assignment of values of multiple functional blocks, that is to say, that single output variable is only supported in current continuous function figure programming.
In view of the above-mentioned problems, in order to further provide for the flexibility of programming, the present invention proposes a kind of for continuous function
The multi output variable of figure programmed method.The multi output variable is a kind of global variable, can be defined as arbitrary data type, only
Want the output variable of the arbitrary functional block of continuous function figure consistent with its data type, so that it may to the multi output variable to repeat to assign
Value.According to one embodiment of present invention, which can receive multiple functional blocks output of identical or different task
The assignment of variable, current value are determined by newest primary assignment operation.In addition, the multi output variable can also give it is identical or
The input variable assignment of multiple functional blocks of different task.
Fig. 4 b are the schematic diagrames of the implementation method of multi output variable according to an embodiment of the invention.Such as Fig. 4 b institutes
Show, in the engineering of continuous function figure programming, contains T1, the tasks such as T2, T3 ....The output variable 2, T2 of functional block X1 in T1 tasks
The output variable 1 of functional block Y1 in task, the output variable 2 of functional block Z1 in T3 tasks, all be several as multi output variable M
According to type W.Therefore, they can be assigned to multi output variable M.
Meanwhile under the premise of ensureing that output type is identical, multi output variable M can also be assigned to the difference of different task
The input variable of functional block, in fig. 4b, the input variable 1 of functional block X2 in T1 tasks, the input of functional block Y2 in T2 tasks
Variable 2, the input variable 1 of functional block Z2 in T3 tasks, all be data type first as multi output variable M, they can
By multi output variable M assignment.
It will be understood by those skilled in the art that Fig. 4 b only provided is a kind of specific implementation, but not limited to this.
In continuous function figure programmed environment, as long as ensureing that data type is consistent with multi output variable, the different function block of different task is all
Can to multi output variable repeated assignment of values, meanwhile, multi output variable can also be to the different task difference work(of same data type
The input variable assignment of energy block, can realize the data transfer of different task different function block for greater flexibility in this way.
According to one embodiment of present invention, under the frame of the present invention, the present invention proposes a kind of new scaleable
Continuous function diagram data type.The data type can indicate any physical quantity:The base value of physical quantity can be set in programming
With unit and its initial physical value.Its physical values can be directly read when observing debugging.This new data type, can be more
The flexibility of continuous function figure CFC programmings, reduces the workload of programming personnel.
In current continuous function figure programming, data type have Boolean type, without symbol single byte integer, have symbol single byte
Integer, without symbol double byte integer, have symbol double byte integer, without symbol nybble integer, have symbol nybble integer, time
The data types such as type.
However, in continuous function figure CFC programmings and debugging process, it will usually there is many physical quantitys.If by force
Converting the calibration of these physical quantitys to above-mentioned data type could use, and can bring very big inconvenience, limit programming
Flexibility.When being observed debugging, it is necessary to convert above-mentioned data type to physical quantity manually.Which greatly increases
Continuous function figure programs and the fussy degree of debugging.
According to one embodiment of present invention, a kind of scaleable continuous function diagram data type, physical quantity type are proposed
M.For the new calibration data type of continuous function figure, the base value M of physical quantity type Mj, unit MD and physical quantity initial value
M0It needs to be arranged when continuous function figure programs.And in specific functional block FB implementation procedures, according to base value, magnitude of physical quantity and
Scaled values convert physical quantity to binary data automatically, and wherein scaled values indicate the length of binary data.Scaled values are got over
Greatly, the range for the number that can be indicated is bigger, and precision is also higher.
According to one embodiment of present invention, when being configured to physical quantity, formula is:
Binary data=magnitude of physical quantity/base value × 2Scaled values。
The binary data carries out operation after being obtained by target machine.And when being observed by host computer, target machine will
Binary data is sent to host computer, and host computer obtains physical values and shown according to its base value and scaled values progress operation,
Formula is:
Physical values=binary data/2Scaled values× base value.
Fig. 5 a are that the flow chart of setting physical quantity M and Fig. 5 b are roots in CFC programmings according to one embodiment of present invention
Flow chart when being observed to physical quantity M in CFC programmings according to one embodiment of the present of invention.As shown in Figure 5 a, setting side
In method 510, in step 511, user inputs the base value N of an example N of physical quantity type on host computerjWith unit ND.
Step 512, host computer calculates the conversion coefficient of example N, i.e., 2Scaled values/ base value.In step 513, host computer is according to physical measure N
Actual physics value NiThe conversion coefficient of (i=0,1 ...) and N, calculate the binary value of N, i.e. Ni×2Scaled values/ base value.In step 514
In, the binary value of the N obtained in above-mentioned steps is downloaded into target machine, operation is carried out in target machine.Similarly, such as Fig. 5 b
It is shown, in observation procedure 520, in step 521, the binary data of physical measure N is uploaded into host computer from target machine.In step
In rapid 522, host computer calculates the conversion coefficient of example N, i.e., 2Scaled values/ base value.In step 523, host computer is according to the binary system of N
Value and conversion coefficient calculate the physical values of N, i.e. binary value/conversion coefficient of N.In step 524, user can be very convenient
Ground observes the physical values of N from host computer.
The example of the present invention proposes a kind of scaleable continuous function diagram data type, physical quantity M.The data type can
To indicate any physical quantity.The data of physical quantity type are very convenient when in use, it is only necessary to physics can be arranged in programming
The base value and unit of amount.Initial physical value, which can be given tacit consent to, to be arranged in programming.When observing debugging, reality of the invention
Its physical values can be directly read in example.As illustrated by above example, new data type, physical quantity M, addition facilitate
The setting and observation of physical quantity, make it more easily operate, substantially increase continuous function during continuous function figure is programmed and debugged
The programming of figure and debugging efficiency.
Under the frame of the present invention, another adjustment made to existing continuous function figure CFC programmings is the increase in
Comparing function.This function is extremely important for CFC programming personnel.Because current continuous function figure programmed product does not have
The graphical comparing function of continuous function map file.However, being difficult accurately comprehensively to react Software for Design by Software for Design document
On difference.This puts to no little inconvenience to software version management and software maintenance, increases software developer in this respect
Workload.Which also limits the flexibilities of CFC programmings.
Two CFC files of method automatic identification that the continuous function figure provided according to one embodiment of present invention compares
Design difference, and by difference be easy to comparison text and patterned way export.This is in comparison software version or software point
It is particularly necessary when branch otherness, can mitigate Software for Design, test, maintenance personnel workload, improve working efficiency.
Specifically, continuous function figure difference is divided to two classes:
(1) non-functional difference, including:The content of annotation, the placement position of functional block, connecting line start point/end point/turn
Point coordinates.Such difference does not influence final software function, only influences continuous function figure readability, abbreviation N differences;And
(2) functional aberrancy, including:The the increasing and decreasing of functional block example, the changing of function block type of the same name, functional block of the same name institute
Belong to task category and executes the connection relation of the difference of serial number, functional block connector or overall signal, functional block connector
With overall signal's initial value.Such difference can influence software function, abbreviation F differences.
The present invention example continuous function map file between comparison other include:Functional block, annotation block, connects signal
It connects.Both included N differences, and also included F differences.
The continuous function figure comparison principle of the example of the present invention is as follows:
Acquire the information of all programming objects in two continuous function map files, including functional block, signal, annotation block and company
Information is connect, it respectively will be in the object information tissue of two continuous function figures to two sequencing tables.Each object is with spy in table
Levy character string.The feature string of functional block and annotation block is block name, and the feature string of signal is signal name, the feature of connection
Character string is that connection source object (functional block or signal) name adds terminal object (connector or signal) name.It is searched in two tables
The identical object of feature string, and further compare its object information.The feature string only object present in a table,
Directly judge the object for difference object.
According to the above comparison principle, example of the invention makes following setting:
1. the functional block name in continuous function map file has uniqueness, the i.e. functional block without duplication of name;
2. the signal name in continuous function figure has uniqueness, the i.e. signal without duplication of name;
3. the functional block in continuous function figure in each task, which executes serial number, has uniqueness, i.e., in the same task
Identical two functional blocks of unnumbered.
An example according to the present invention, the function block information for participating in comparing include:
1. the affiliated task type of functional block;
2. the execution serial number of functional block;
3. functional block version number;
4. all connectors of functional block;
5. connector initial value;
6. whether Boolean type input connector negates;
7. whether out connector carries non-volatile attribute;
8. connector annotates;
9. functional block annotates;And
10. the coordinate of functional block
An example according to the present invention, the signal message for participating in comparing include:
1. the type of signal;
2. the initial value of signal;And
3. the description of signal.
An example according to the present invention, the annotation block message for participating in comparing include:
1. notes content text;And
2. annotating the position coordinates of block;
An example according to the present invention, the link information for participating in comparing include:
1. connection source coordinate;
2. connection endpoint coordinate;And
3. connecting inflection point quantity and each inflection point coordinate.
An example according to the present invention, for each object in object data table, the page number where recording the object with
Coordinate information, to realize graphical comparison.
An example according to the present invention, all differences information are all recorded in a variance data table.It is tied in comparison
Shu Hou exports all differences information with text mode by entry.In a more specific example, user can be poor by double-clicking
Different textual entry, in two panes arranged side by side graphically, be highlighted difference object.
An example according to the present invention, each difference entry includes following information in variance data table:
1. difference classification:Non-functional difference (N) or functional aberrancy (F);
2. difference indexes;And
3. difference describes text.
Wherein, the page number and coordinate of the so-called difference index for position disparity.An example according to the present invention, difference rope
It can be that difference is numbered to draw, and the object corresponding to the difference can be determined according to difference number.If some difference is not deposit
In corresponding object, then difference index is defined as -1.
An example according to the present invention can index fast when user selects or double-clicks difference textual entry according to difference
Speed determines the object corresponding to the difference;Then, the page number and seat of the difference are gone out according to the page number of corresponding objects and coordinate setting
Mark, so that it is determined that needing the content shown to user, and highlights the corresponding object of the difference.
The application software upgrade write in continuous function figure establishes branch, is frequently necessary to compare two continuous work(except staggering the time
The difference of energy map file.Before making the present invention, this part work relies primarily on the software modification daily record and version that programmer writes
Illustrate that there is limitation very much.For example, the design mistake introduced during software modification because programmer slips up is impossible
It is recorded in document.The continuous function map file comparative approach of the present invention can intuitively reflect that continuous function figure is soft comprehensively
The design difference of part, and this automatic variance analysis is more efficient than what manual comparison or binary system were compared, it is also more acurrate.
Fig. 6 is the difference process chart that continuous function map file according to an embodiment of the invention compares.Such as Fig. 6
Shown, this method includes:
First, it extracts program page all in first continuous function map file CFC1, functional block, signal, annotation block, connect
Information is connect, internal data table (abbreviation table 1) that be easy and fast to search, ordering is organized into;
Secondly, it extracts program page all in second continuous function map file CFC2, functional block, signal, annotation block, connect
Information is connect, internal data table (abbreviation table 2) that be easy and fast to search, ordering is organized into;Also, own in table two when initial
Object is collectively labeled as non-comparison other;
Next, traversal list 1.The object (1 object of abbreviation table) in table 1 is extracted successively, according to the feature of 1 object of table in table
The identical object of search characteristics in 2.If being not present, it is variant to mark the table an object, and difference table is written (for phase in object
Index of 1 object of table in table 1 is closed, is -1 if being not present).If in the presence of the data letter of the two objects is further compared
Breath, respective label is object if identical;Respectively label is object if differing, and different information is write
Enter different information table.
As shown in fig. 6, initial value i=0 is assigned, into cycle, i=i+1, i<1 index range of table.Extract 1 object of table [i], root
Whether the feature of object [i] is had in signature search table 2 according to 1 object of table [i].It is if it is not found, then recorded in difference table
Difference content, and the index of the difference is -1.If it is found, the object [j] e.g. in table 2, then by the object in table 2
[j] is labeled as having compared.It determines in next step, determines whether 1 object of table [i] and the information of object [j] in table 2 are consistent.Such as
Fruit is consistent, then returns to cycle, otherwise i=i+1 records difference content, and the index of the difference is positive integer in difference table
Serial number, such as difference 1, difference 2, and so on.Difference number is unique, can also be used as difference in the present embodiment
Different index.Object [j] in 1 object of table [i] and table 2 is can determine according to difference number.Return to cycle, i=i+1.
Next, traversal list 2.The object not compared is still labeled as in extraction table 2 successively, is labeled as difference object, and write
Enter different information table (being -1 if being not present for index of 2 object of correlation table in table 2).
As shown in fig. 6, initial value i=0 is assigned, into cycle, i=i+1, i<1 index range of table.Still marking in extraction table 2
For the object [k] not compared, judge whether the object [k] in table 2 had compared, if being still not compare, is marked
It is denoted as and had compared, and record difference content in difference table, and the index of the difference is -1.Return to cycle, i=i+
1。
Finally, the content of difference information table is exported with text formatting.
Fig. 7 is the graphical representation schematic diagram of continuous function map file difference according to an embodiment of the invention.Such as
Shown in Fig. 7, all differences information is all output to text mode in difference text output pane.Each difference text is all with difference
Classification and number start, which is also the index value of difference list item.
As shown in fig. 7, when user double-clicks difference text, then this difference text is highlighted.Automatically extract difference simultaneously
Different number, and according to this difference number can lookup table index go out the corresponding difference object in table one and table two.According to one He of table
The difference object page number stored in table two determines the display content in two continuous function figure panes with coordinate, while corresponding
Difference object is highlighted.
The present invention is described in the above embodiment in order to improve the flexibility of continuous function figure (CFC) programming.It is necessary
Illustrate, although above-described embodiment describes it respectively respectively programs the improvement made to continuous function figure (CFC);But
These not are that can not combine between improving.Can be combined with each other between one or more of all above improvement with into
One step increases the flexibility of CFC programmings.These combine or be combined with each other similarly within the scope of the invention.
Above-described embodiment is used for illustrative purposes only, and is not limitation of the present invention, in relation to the general of technical field
Logical technical staff can also make a variety of changes and modification without departing from the present invention, therefore, all equivalent
Technical solution should also belong to scope disclosed by the invention.
Claims (10)
1. a kind of continuous function figure programmed method, including:
When establishing continuous function figure CFC engineerings, the quantity of periodic task is determined;
Dispatching cycle is specified for each periodic task;And
It is each functional block FB appointed tasks type and execution serial number when being programmed using continuous function figure, wherein described
Task type is unique, identical periodic task task type having the same.
2. according to the method described in claim 1, further comprising:When compiling continuous function figure program, given birth to according to Task
At mission function, and function block code is placed by execution serial number in each mission function.
3. according to the method described in claim 2, further comprising:By continuous function schema compiler device by continuous function schema compiler
At the executable code that can be dispatched core identification by target machine.
4. according to the method described in claim 3, further comprising:It is established according to the task type on target machine corresponding
Thread.
5. including multiple threads according to the method described in claim 4, wherein, including on target machine, and the multiple thread has
There are respective priority, the wherein thread of high priority that can be first carried out with the thread of interrupts low-priority.
6. according to the method described in claim 5, wherein, dispatching cycle the shorter corresponding thread of periodic task priority
It is higher.
7. according to the method described in claim 1, wherein, the power that the quantity of the periodic task is 8 or 8 is a.
8. according to the method described in claim 1, wherein, the task type is corresponding with dispatching cycle.
9. according to the method described in claim 4, wherein, each thread can then call corresponding periodic duty in scheduling time
Function.
10. according to the method described in claim 4, wherein, each thread starts when its trigger condition is set up.
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 true CN108345451A (en) | 2018-07-31 |
CN108345451B CN108345451B (en) | 2020-07-14 |
Family
ID=52945218
Family Applications (2)
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 |
CN201810136465.8A Active CN108345451B (en) | 2014-12-30 | 2014-12-30 | Continuous function diagram programming method |
Family Applications Before (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) | CN104503817B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104503818A (en) * | 2014-12-31 | 2015-04-08 | 北京纵横机电技术开发公司 | Continuous function chart (CFC) programming method |
CN104503766A (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)
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)
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 |
-
2014
- 2014-12-30 CN CN201410841334.1A patent/CN104503817B/en active Active
- 2014-12-30 CN CN201810136465.8A patent/CN108345451B/en active Active
Patent Citations (2)
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 |
Non-Patent Citations (1)
Title |
---|
林育兹: "《可编程序控制器原理及逻辑控制》", 31 January 2006 * |
Also Published As
Publication number | Publication date |
---|---|
CN104503817B (en) | 2018-03-20 |
CN104503817A (en) | 2015-04-08 |
CN108345451B (en) | 2020-07-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104503817B (en) | A kind of continuous function figure programmed method | |
US11743069B2 (en) | Automatic control method of generating sub-systems and sub-system arbitration from the deconstruction of a complex equipment graph | |
US11232257B2 (en) | Apparatuses, systems, and methods for providing a visual program for machine vision systems | |
CN104778124B (en) | A kind of software application automated testing method | |
US10061809B2 (en) | Control device | |
CN104714468B (en) | A kind of comparative approach of continuous function map file | |
EP3072275A1 (en) | A method and a system for replacing and commissioning of a field device | |
US11429090B2 (en) | Apparatus, method, and program | |
CN110399128A (en) | Code file generation method and device | |
CN107003664B (en) | Design of information system auxiliary tool and design of information system auxiliary program | |
CN104572233B (en) | A kind of continuous function figure programmed method | |
US10929339B2 (en) | Generation of multiple worksheet exportation | |
US20170192407A1 (en) | Method and apparatus for enabling model driven navigation | |
EP3692421B1 (en) | Apparatus, method and program for dynamic model generation | |
US20130247002A1 (en) | Abstracting benefit rules from computer code | |
CN105204837B (en) | Method and device for realizing logic programming | |
US20170168791A1 (en) | Rearrangeable code optimization modules | |
CN110221577A (en) | Numerical control device | |
JP5755389B1 (en) | Drawing software | |
CN103955429A (en) | Method and device for determining regression testing range | |
JP5508078B2 (en) | Program creation support apparatus and method, and program | |
CN104503765A (en) | Continuous function chart (CFC) programming method | |
CN112306473B (en) | Program interface parameter transmission method, system and related equipment | |
CN105241011B (en) | Air-conditioning group control system development device and method | |
CN105824684B (en) | A kind of implementation method of multi-mode big data software simulator |
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 |