CN104503818A - Continuous function chart (CFC) programming method - Google Patents

Continuous function chart (CFC) programming method Download PDF

Info

Publication number
CN104503818A
CN104503818A CN201410852978.0A CN201410852978A CN104503818A CN 104503818 A CN104503818 A CN 104503818A CN 201410852978 A CN201410852978 A CN 201410852978A CN 104503818 A CN104503818 A CN 104503818A
Authority
CN
China
Prior art keywords
physical quantity
continuous function
variable
task
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410852978.0A
Other languages
Chinese (zh)
Inventor
郑雪洋
夏菲
高吉磊
谢冰若
马驰
殷振环
马志文
李伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201410852978.0A priority Critical patent/CN104503818A/en
Publication of CN104503818A publication Critical patent/CN104503818A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to relates to a CFC programming method. The method comprises determining periodic tasks when CFC engineering is established; determining the physical quantity in the periodic tasks; defining physical quantity type variables in the periodic tasks to reflect the physical quantity; assigning dispatching cycles to the periodic tasks.

Description

A kind of continuous function figure programmed method
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 function figure programming has following characteristics: (1) carrys out automatically generating program by drawing function chard; (2) powerful ready-made program storehouse is had; (3) reduce cost of development by simple line and reduce mistake.Continuous function figure not only has the typical element of programmable logic controller (PLC) PLC (Programmable Logic Control ler), such as: I/O, timer, counter, symbol table etc., and there is the characteristic of graphical programming language language, it is very suitable for process control and systems engineering.CFC comes from IEC 61131-3 standard regulation, is the FBD (function block diagram) (Function Block Diagram) of one of five kinds of programming languages.The principal feature of continuous function figure and FBD (function block diagram) is that it illustrates its resource be subordinate to and task.Although continuous function figure does not have associated international standards, be widely used at industrial control field.
But continuous function figure CFC programmes underaction, cannot meet the actual needs of user in Industry Control, therefore, be necessary very much to provide one continuous function figure CFC programmed method more flexibly.
Summary of the invention
For above technical matters, present applicant proposes a kind of continuous function figure programmed method, comprising: when setting up continuous function figure CFC engineering, determining periodic task; Determine the physical quantity in described periodic task; The variable of physical quantity type is defined to reflect described physical quantity in described periodic task; And be that described periodic task specifies dispatching cycle.
Method as above, comprises further: determine the base value of the variable of described physical quantity type, unit and physical quantity initial value.
Method as above, comprises further: the scaled values determining the variable of described physical quantity type.
Method as above, comprises further: described scaled values reflects the length of the binary data that the variable of described physical quantity type is corresponding.
Method as above, comprises further: adopt following formula that the magnitude of physical quantity of the variable of described physical quantity type is converted to binary data: binary data=magnitude of physical quantity/base value × 2 scaled values.
Method as above, comprises further: calculate the conversion coefficient 2 between the magnitude of physical quantity of the variable of described physical quantity type and binary data scaled values/ base value.
Method as above, host computer inputs base value and the unit of the variable of physical quantity type and calculates described conversion coefficient.
Method as above, comprises further: the magnitude of physical quantity observing the variable of described physical quantity type on host computer.
Method as above, comprises further: the binary data of the variable of described physical quantity type is uploaded to described host computer from target machine.
Method as above, comprises further: adopt following formula described binary data to be converted to the magnitude of physical quantity of the variable of described physical quantity type: magnitude of physical quantity=binary data/2 scaled values× base value.
Accompanying drawing explanation
Below, will be described in more detail the preferred embodiment of the present invention by reference to the accompanying drawings, wherein:
Fig. 1 is the method schematic diagram that continuous function figure CFC according to an embodiment of the invention programmes;
Fig. 2 is the schematic diagram of periodic duty during CFC according to an embodiment of the invention programmes;
Fig. 3 is the schematic diagram creating periodic duty during CFC according to an embodiment of the invention programmes;
Fig. 4 a is the modify feature block out connector initial value method for continuous function figure programming according to an embodiment of the invention;
Fig. 4 b is the schematic diagram of the implementation method of multi output variable according to an embodiment of the invention;
Fig. 5 a is the process flow diagram arranging physical quantity M according to one embodiment of present invention in CFC programming;
Fig. 5 b be according to one embodiment of present invention CFC programming in physical quantity M is observed time process flow diagram;
Fig. 6 is the difference processing flow 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.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Continuous function figure CFC comprises multiple functional block.Each functional block can realize a simple logic function.By being connected with out connector by the input connector of different functional blocks, continuous function figure CFC programming can realize complicated logic function and control.
Specifically, the programming interface of continuous function figure CFC is graphical interfaces.Several charts (Chart) are contained in this graphical interfaces.User graphically inserts the block woven in chart Chart, specifies the annexation between these blocks, or is these blocks distribution I/O Address.After this mode finished item dragged by mouse click holder is write, user can compile.Next, CFC program will be compiled by entirety, and the result of compiling occurs with the form of SCL code, generates STL code the most at last.These codes download in PLC and can perform by user.
In continuous function figure CFC programmes, for the functional block of different scheduling time, be distributed in different periodic scheduling tasks, each periodic scheduling task is set to the dispatching cycle fixed, and the multicycle scheduler task of practical function block controls.In same functional diagram, the functional block of identical dispatching cycle is assigned with fixing execution sequence.In multiple continuous function figure, the functional block of identical dispatching cycle performs according to the order of continuous function figure.
In existing continuous function figure CFC programmes, functional block is all dispatched according to periodic duty.This obvious underaction, because part functional block only needs to be performed once before period task scheduling in some application, and does not carry out periodic scheduling.
In order to realize single scheduling, and ensureing cooperatively interacting between different continuous function figure, according to one embodiment of present invention, proposing a kind of continuous function figure with multi-stage initialization generic task.For example, for the functional diagram of the preset task of two-stage, before beginning performance period task, first perform the preset generic task of two-stage, thus make continuous function figure CFC programming have more dirigibility.
Fig. 1 is the method schematic diagram that continuous function figure CFC according to an embodiment of the invention programmes.As described in Figure 1, method 100 comprises: after program starts 101, in step 102, perform prevalue generic task 1 functional block in continuous function Fig. 1, then step 103 perform successively prevalue generic task 1 in continuous function Fig. 2 functional block ..., by that analogy, until step 104, perform the functional block of the prevalue generic task 1 in continuous function figure (k-1) and perform the functional block of the prevalue generic task 1 in continuous function figure k in step 105, wherein k is the quantity of continuous function figure.After prevalue generic task 1 all executes, in step 106, perform prevalue generic task 2 functional block in continuous function Fig. 1, step 107 perform in continuous function Fig. 2 prevalue generic task 2 functional block ..., by that analogy, until step 108 performs the functional block of the prevalue generic task 2 in the functional block of the prevalue generic task 2 in continuous function figure (k-1) and step 109 continuous function figure k, wherein k is the quantity of continuous function figure in continuous function figure engineering.After prevalue generic task 2 all executes, start performance period generic task in step 110.
Example more than the present invention proposes a kind of continuous function figure programmed method with the preset generic task of two-stage.Before periodic duty starts to perform, perform the preset generic task of two-stage, greatly can save the hardware resource of target controller, and greatly improve the dirigibility of continuous function figure programming.
According to another embodiment of the invention, for periodic duty, continuous function figure of the present invention programmes the periodic duty of variable number.Periodic duty quantity is all fixing by the product that existing support continuous function figure programmes, generally within 5.But this restriction for periodic duty greatly constrains the dirigibility of software development, and too many periodic duty number can waste system resource.
In an example of the present invention, the quantity of the periodic task in continuous function figure programming is variable, and has priority.High-priority task can be taken the lead execution, namely can interrupt low priority task and first perform.Usually, the task priority that dispatching cycle is shorter is higher.
Fig. 2 is the schematic diagram of periodic duty during CFC according to an embodiment of the invention programmes.As shown in Figure 2, for each functional module FB (Function Block), it comprises following parameter: Instance Name, type FBTYPE, input IN and output OUT.Input IN and the output OUT of multiple FB are interconnected to form periodic duty.Such as, have 8 independently FB strings in fig. 2 in continuous function figure, each FB string represents one-period task, and therefore, in the example of Fig. 2, periodic duty number is 8.
Further, each periodic duty can comprise the FB of varying number.Such as, comprise n FB at first periodic duty, be respectively FB1-FBn; Second period task comprises 3 FB, is respectively FBA-FBC.Wherein, each FB has an execution sequence numbering, and it is positive integer, represents at the execution sequence of this FB in this periodic duty.Wherein, each FB also has a task type, which represent the numbering of the periodic duty at its place.In example of the present invention, above parameters and numbering can be arranged flexibly, with according to the actual requirements, obtain the dirigibility of CFC programming.In the example of figure 2, in continuous function Graph editor, can be each functional block appointed task type (T1-T8) and execution sequence numbering.Such as, in figure 1 functional block FB1, FB2 ... FBn is under the jurisdiction of T1 task, and their execution sequence numbering is followed successively by 1,2 ... n.Other T2-T8 tasks and T1 task class are seemingly.
Fig. 3 is the schematic diagram creating periodic duty during CFC according to an embodiment of the invention programmes.First, in step 301, when setting up continuous function figure CFC engineering, determining the quantity of periodic duty, and determining task type.For the embodiment shown in Fig. 2, namely create 8 task types of T1-T8.
Next, in step 302, for T1-T8 task specifies dispatching cycle.In step 303, when using continuous function figure to programme, for each functional block FB specifies a task type in T1-T8 and execution sequence to number.In step 304, when compiling continuous function figure program, generating T1-T8 mission function according to task classification, pressing execution sequence numbering in each mission function and placing functional block code.
Below the program example of the embodiment of Fig. 2, only in order to technical scheme of the present invention to be described.
Next, in step 305, become to be dispatched by target machine the executable code of core identification by continuous function schema compiler by continuous function schema compiler device.In step 306, on target machine, based on Real-Time Scheduling kernel (such as, with reference to POSIX.1b), according to priority set up 8 threads of T1-T8 from high to low.In step 307, specify activate its respective thread dispatching cycle by engineering, in thread, perform corresponding T1-T8 mission function.Conveniently understand, thread can be regarded as infinite loop.Startup or terminated task thread execution is endorsed in the Real-Time Scheduling of target machine.
Specifically, each periodic duty is compiled device and is compiled into one-period mission function, T1 (), T2 () ... T8 ().Press execution sequence numbering in each periodic duty function, call all functions block respective function being under the jurisdiction of this task.Such as, can call FB1 (), FB2 () successively in periodic duty function T1 () ... FBn ().Other T2-T8 mission functions and T1 () mission function similar.
As shown in Figure 3, at compiled continuous function figure download program after target machine, target machine scheduling core can start 8 periodic duty threads, and as shown in Figure 3, these 8 threads can then call corresponding periodic duty function in scheduling time.Specifically, 8 threads of T1-T8 run on target machine.Each thread is set up in trigger condition, that is:, when condition 1 equals 1, start.Then corresponding each scheduling time T1-T8 then after, mission function T1 ()-T8 () of T1-T8 can be called, the periodic duty of each T1-T8 of complete call, realize corresponding controlling functions.For T1 mission thread, after T1 scheduling time arrives, T1 mission function T1 () can be called.Other T2-T8 mission threads and T1 mission thread similar.
According to one embodiment of present invention, the storer least unit of current popular controller hardware mostly is the power position (bit) of 8 or 8.Adopting the scheme of 8 periodic duties, the optimum balance of memory resource and scheduling can be reached when writing task scheduling algorithm and task context data structure.Such as, if periodic duty number is less than 8, memory resource can be wasted, and if increase system task scheduling load more than 8 meetings.And periodic duty is set as that 8 have higher flexible in programming.
According to one embodiment of present invention, in order to increase the dirigibility of CFC programming, the method that the functional block that the present invention proposes a kind of initial value revised for continuous function figure CFC programming exports.
In existing continuous function CFC programming block diagram, input connector and acquiescence out connector are given tacit consent in comprising of functional block, and wherein initial value is 0, and cannot revise.This set arranges for the periodic scheduling task in continuous function figure.Because under periodic scheduling task, the value of functional block out connector upgrades in the cycle, so the initial value arranging or revise out connector is nonsensical.
But, under framework of the present invention, except periodic scheduling task also has preset task in continuous function programming.According to one embodiment of present invention, condition calling task is also comprised in CFC programming.When the conditions are met, calling task is performed.When condition does not meet, each functional block in condition calling task can not be performed.At this moment, the value of the out connector of the functional block be not performed will maintain the initial value longer time, just can be updated until perform this functional block.For this situation, if it will be highly significant that the initial value of the out connector of functional block can be revised.
Fig. 4 a is the modify feature block out connector initial value method for continuous function figure programming according to an embodiment of the invention.As shown in fig. 4 a, in described method 400, in continuous function figure, the execution of any one functional block comprises:
In step 410, load input connector initial value at initial phase, wherein said initial value is can when programming with revisable when running.In step 420, load the initial value of out connector at initial phase, wherein said initial value is can when programming with all revisable when running.In step 430, at task scheduling phase, the value of read input connector, the code of n-back test block FB, upgrades the value of functional block out connector in functional block FB code.But because functional block FB may be under the jurisdiction of conditioning tasks, therefore when condition does not meet, described functional block FB code may never be performed, then described functional block FB out connector will keep initial value described in step 420 always.Finally, in step 440, the value of using function block FB out connector upgrades the value of the output variable be connected with this out connector.
Propose in example of the present invention for continuous function figure programming can the method for modify feature block out connector initial value, change continuous function figure CFC before this and can not revise out connector initial value drawback, greatly can improve the dirigibility of programming.
According to another embodiment of the invention, for increasing the dirigibility of continuous function figure programming, the present invention proposes a kind of multi output variable.This multi output variable is the global variable defined in continuous function figure, can by the output variable repeated assignment of values of different functional blocks.
As is generally known, in continuous function figure programming, the most basic program element is functional block (Function Block, FB), and it is exactly its input variable and output variable with extraneous interface.Continuous function figure also defines global variable, as long as ensure that data type is consistent, this global variable can by the output variable assignment of any functional block of any task, this global variable can also give the input variable assignment of any functional block of any task simultaneously, realizes the data transmission between different task, difference in functionality block with this.
But in current continuous function figure, global variable can only by the output variable assignment of functional block once, cannot by the output variable repeated assignment of values of multiple functional block, single output variable is only supported in that is current continuous function figure programming.
For the problems referred to above, in order to provide the dirigibility of programming further, the present invention proposes a kind of multi output variable for continuous function figure programmed method.This multi output variable is a kind of global variable, can be defined as arbitrary data type, as long as the output variable of any functional block of continuous function figure is consistent with its data type, just can give this multi output variable repeated assignment of values.According to one embodiment of present invention, this multi output variable can accept the assignment of multiple functional block output variables of identical or different task, and its current value operates decision by up-to-date assignment once.In addition, this multi output variable can also give the input variable assignment of multiple functional blocks of identical or different task.
Fig. 4 b is the schematic diagram of the implementation method of multi output variable according to an embodiment of the invention.As shown in Figure 4 b, in the engineering of continuous function figure programming, containing T1, T2, T3 ... etc. task.In T1 task functional block X1 output variable 2, T2 task in functional block Y1 output variable 1, T3 task in the output variable 2 of functional block Z1, all the same with multi output variable M is data type W.Therefore, they can assignment to multi output variable M.
Simultaneously, ensureing under the prerequisite that output type is identical, the all right assignment of multi output variable M is to the input variable of the difference in functionality block of different task, in fig. 4b, in T1 task functional block X2 input variable 1, T2 task in functional block Y2 input variable 2, T3 task in the input variable 1 of functional block Z2, all the same with multi output variable M is data type first, and they can by multi output variable M assignment.
What it will be understood by those skilled in the art that Fig. 4 b only provides is a kind of specific implementation, but is not limited thereto.In continuous function figure programmed environment, as long as ensure that data type is consistent with multi output variable, the difference in functionality block of different task can to multi output variable repeated assignment of values, simultaneously, multi output variable also to the input variable assignment of the different task difference in functionality block of same data type, can realize the data transmission of different task difference in functionality block so more neatly.
According to one embodiment of present invention, under framework of the present invention, the present invention proposes a kind of scaleable continuous function diagram data type newly.This data type can represent any physical quantity: can arrange the base value of physical quantity and unit and initial physical value thereof when programming.Its physical values can be directly read when observing debugging.This new data type, can the continuous function figure CFC dirigibility of programming more, reduces the workload of programming personnel.
In current continuous function figure programming, data type has Boolean type, without symbol byte integer, have symbol byte integer, without symbol double byte integer, have symbol double byte integer, without symbol nybble integer, have the data types such as symbol nybble integer, time type.
But, programme at continuous function figure CFC and in debug process, usually can there is many physical quantitys.If by force the calibration of these physical quantitys is converted into above-mentioned data type just can use, very large inconvenience can be brought, limit the dirigibility of programming.When carrying out observation debugging, also above-mentioned data type manually must be converted into physical quantity.Which greatly increases the fussy degree of continuous function figure programming and debugging.
According to one embodiment of present invention, a kind of scaleable continuous function diagram data type is proposed, physical quantity type M.For the calibration data type of this new continuous function figure, the base value M of physical quantity type M j, unit MD and physical quantity initial value M 0need to arrange when continuous function figure programmes.And in concrete functional block FB implementation, according to base value, magnitude of physical quantity and scaled values, automatically physical quantity is converted into binary data, wherein scaled values represents the length of binary data.Scaled values is larger, and the scope of the number that can represent is larger, and precision is also higher.
According to one embodiment of present invention, when arranging physical quantity, its formula is:
Binary data=magnitude of physical quantity/base value × 2 scaled values.
This binary data obtains laggard row operation by target machine.And when being observed by host computer, binary data is sent to host computer by target machine, host computer carries out computing according to its base value and scaled values and obtains physical values and show, and its formula is:
Physical values=binary data/2 scaled values× base value.
Fig. 5 a is that in CFC programming, arrange the process flow diagram of physical quantity M and Fig. 5 b be according to one embodiment of present invention process flow diagram when observing physical quantity M in CFC programming according to one embodiment of present invention.As shown in Figure 5 a, in method to set up 510, in step 511, user inputs the base value N of an example N of physical quantity type on host computer jwith unit ND.In step 512, host computer calculates the conversion coefficient of this example N, and namely 2 scaled values/ base value.In step 513, host computer is according to the actual physics value N of physical measure N i(i=0,1 ...) with the conversion coefficient of N, calculate the binary value of N, i.e. N i× 2 scaled values/ base value.In the step 514, the binary value of the N obtained in above-mentioned steps is downloaded to target machine, in target machine, carry out computing.Similarly, as shown in Figure 5 b, in observation procedure 520, in step 521, the binary data of physical measure N is uploaded to host computer from target machine.In step 522, host computer calculates the conversion coefficient of this example N, and namely 2 scaled values/ base value.In step 523, host computer calculates the physical values of N according to the binary value of N and conversion coefficient, i.e. binary value/the conversion coefficient of N.In step 524, user just can observe the physical values of N easily from host computer.
Example of the present invention proposes a kind of scaleable continuous function diagram data type, physical quantity M.This data type can represent any physical quantity.The data of physical quantity type are very convenient in use, only need base value and the unit that can arrange physical quantity when programming.Namely initial physical value can be given tacit consent to also can the setting when programming.When observing debugging, in example of the present invention, can directly read its physical values.As above illustrated by embodiment, new data type, physical quantity M, add and facilitate the setting of physical quantity and observation in continuous function figure programming and debugging, make it more be easy to operation, substantially increase programming and the debugging efficiency of continuous function figure.
Under framework of the present invention, another adjustment done by programming to existing continuous function figure CFC is the increase in comparing function.This function is extremely important for CFC programming personnel.Because current continuous function figure programmed product does not possess the graphical comparing function of continuous function map file.But, the difference of accurately reacting all sidedly on Software for Design is difficult to by Software for Design document.This puts to no little inconvenience to software version management and software maintenance, adds software developer's workload in this respect.Which also limits the dirigibility of CFC programming.
The method that continuous function figure provided according to one embodiment of present invention compares identifies the design difference of two CFC files automatically, and difference is exported with the text and patterned way that are easy to contrast.This is particularly necessary when comparison software version or software branch otherness, can alleviate the workload of Software for Design, test, maintainer, increase work efficiency.
Specifically, continuous function figure difference divides two classes:
(1) non-functional difference, comprising: the start point/end point/flex point coordinate of the content of annotation, the putting position of functional block, connecting line.This type of difference does not affect final software function, only affects continuous function figure readable, is called for short N difference; And
(2) functional aberrancy, comprise: the difference of task classification belonging to the increase and decrease of functional block example, the change of functional block type of the same name, functional block of the same name and execution sequence numbering, the annexation of functional block connector or overall signal, functional block connector and overall signal's initial value.This type of difference can affect software function, is called for short F difference.
Comparison other between the continuous function map file of example of the present invention comprises: functional block, signal, annotation block, connection.Both include N difference, also include F difference.
The continuous function figure comparison principle of example of the present invention is as follows:
Gather the information of all programming objects in two continuous function map files, comprise functional block, signal, annotation block and link information, respectively the object information of two continuous function figure is organized in two sequencing tables.In table, each object is with feature string.Functional block is block name with the feature string of annotation block, and the feature string of signal is signal name, and the feature string of connection is that connection source object (functional block or signal) name adds terminal object (connector or signal) name.The object that search characteristics character string is identical in two tables, and compare its object information further.The object that feature string only exists in a table, directly judges that this object is as difference object.
According to above comparison principle, example of the present invention makes following setting:
1. the functional block name in continuous function map file has uniqueness, namely without the functional block of bearing the same name;
2. the signal name in continuous function figure has uniqueness, namely without the signal of bearing the same name;
3. the functional block execution sequence number in continuous function figure in each task has uniqueness, two functional blocks that namely unnumbered is identical in same task.
According to an example of the present invention, the function block information participating in comparing comprises:
1. task type belonging to functional block;
2. the execution sequence numbering 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 is with non-volatile attribute;
8. connector annotation;
9. functional block annotation; And
10. the coordinate of functional block
According to an example of the present invention, the signal message participating in comparing comprises:
1. the type of signal;
2. the initial value of signal; And
3. the description of signal.
According to an example of the present invention, the annotation block message participating in comparing comprises:
1. notes content text; And
2. annotate the position coordinates of block;
According to an example of the present invention, the link information participating in comparing comprises:
1. connection source coordinate;
2. connection endpoint coordinate; And
3. connect flex point quantity and each flex point coordinate.
According to an example of the present invention, for each object in object data table, record this object place page number and coordinate information, to realize graphical contrast.
According to an example of the present invention, all differences information is all recorded in a variance data table.After contrast terminates, export all differences information with text mode by entry.In one more specifically example, user can by double-clicking difference textual entry, in two panes arranged side by side graphically, highlighted display difference object.
According to an example of the present invention, in variance data table, each difference entry comprises following information:
1. difference classification: non-functional difference (N) or functional aberrancy (F);
2. difference index; And
3. difference describes text.
Wherein, so-called difference index is used for the page number and the coordinate of position disparity.According to an example of the present invention, difference index can be numbered for difference, can determine the object corresponding to this difference according to this difference numbering.If certain difference is there is not corresponding object, then difference index is defined as-1.
According to an example of the present invention, when user selects or double-click difference textual entry, the object can determining corresponding to this difference fast according to difference index; Then, go out the page number and the coordinate of this difference according to the page number of corresponding objects and coordinate setting, thus determine to need the content to user's display, and highlight object corresponding to this difference.
The application software upgrade of writing at continuous function figure, the difference set up branch, often needing to compare two continuous function map files except staggering the time.Before making the present invention, the software modification daily record that this part work main dependence programmer writes and imprint, very have limitation.Such as, the design mistake introduced because of programmer's error in software modification process can not be recorded in document.Continuous function map file comparative approach of the present invention can reflect the design difference of continuous function figure software comprehensively intuitively, and this automatic variance analysis than manual relatively or the efficiency that compares of scale-of-two higher, also more accurate.
Fig. 6 is the difference processing flow chart that continuous function map file according to an embodiment of the invention compares.As shown in Figure 6, the method comprises:
First, extract program page, functional block, signal, annotation block, link information all in first continuous function map file CFC1, be organized into be easy to fast search, ordering internal data table (be called for short table 1);
Secondly, extracts program page, functional block, signal, annotation block, link information all in second continuous function map file CFC2, be organized into be easy to fast search, ordering internal data table (abbreviation table 2); Further, time initial, in table two, all objects are all labeled as non-comparison other;
Next, traversal list 1.Extract the object (being called for short table 1 object) in table 1 successively, according to the feature object that search characteristics is identical in table 2 of table 1 object.If do not exist, then it is variant for marking this table one object, object write difference table (for correlation table 1 object index in Table 1, if do not exist, being-1).If exist, then compare the data message of these two objects further, if identical, be labeled as indifference object separately; If not identical, be labeled as variant object separately, and different information is write different information table.
As shown in Figure 6, initialize i=0, enters circulation, i=i+1, i< table 1 index range.Extract table 1 object [i], in the signature search table 2 according to table 1 object [i], whether have the feature of object [i].If do not found, then in difference table, record difference content, and the index of this difference is-1.If found, such as, be the object [j] in table 2, then the object [j] in table 2 be labeled as relatively mistake.Next step is determined, determines that whether table 1 object [i] is consistent with the information of object in table 2 [j].If consistent, then return circulation, i=i+1, otherwise, in difference table, record difference content, and the index of this difference is the serial number of positive integer, such as difference 1, difference 2, by that analogy.Difference numbering is unique, in the present embodiment also can as difference index.Object [j] in table 1 object [i] and table 2 can be determined according to difference numbering.Return circulation, i=i+1.
Next, traversal list 2.Still be labeled as the object do not compared in extraction table 2 successively, be labeled as difference object, and write different information table (for correlation table 2 object index in table 2, if do not exist, being-1).
As shown in Figure 6, initialize i=0, enters circulation, i=i+1, i< table 1 index range.The object [k] that being still labeled as in extraction table 2 is not compared, judge object [k] in table 2 whether relatively mistake, if be still not relatively mistake, be then labeled as relatively mistake, and in difference table, record difference content, and the index of this difference is-1.Return circulation, 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.As shown in Figure 7, all differences information all outputs in difference text output pane with text mode.Every difference text is all with difference classification and numbering beginning, and this numbering is also the index value of difference list item.
As shown in Figure 7, when user double-clicks difference text, then this difference text is highlighted.Extract difference numbering simultaneously automatically, and lookup table index can go out corresponding difference object in table 1 and table 2 according to this difference numbering.The displaying contents in two continuous function figure panes is determined, simultaneously highlighted for corresponding difference object according to the difference object page number stored in table 1 and table 2 and coordinate.
The dirigibility that the present invention programmes to improve continuous function figure (CFC) is described in above embodiment.Should be noted that, separately continuous function figure (CFC) is programmed the improvement made although above-described embodiment describes it respectively; But, these improve between be not cannot in conjunction with.The dirigibility increasing CFC programming further mutually can be combined between one or more in all above improvement.These combine or be combined with each other too within the scope of the invention.
Above-described embodiment is used for illustrative purposes only, and be not limitation of the present invention, the those of ordinary skill of relevant technical field, without departing from the present invention, can also make a variety of changes and modification, therefore, all equivalent technical schemes also should belong to category disclosed by the invention.

Claims (10)

1. a continuous function figure programmed method, comprising:
When setting up continuous function figure CFC engineering, determine periodic task;
Determine the physical quantity in described periodic task;
The variable of physical quantity type is defined to reflect described physical quantity in described periodic task; And
For described periodic task specifies dispatching cycle.
2. method according to claim 1, comprises further: determine the base value of the variable of described physical quantity type, unit and physical quantity initial value.
3. method according to claim 2, comprises further: the scaled values determining the variable of described physical quantity type.
4. method according to claim 3, comprises further: described scaled values reflects the length of the binary data that the variable of described physical quantity type is corresponding.
5. method according to claim 4, comprises further: adopt following formula that the magnitude of physical quantity of the variable of described physical quantity type is converted to binary data:
Binary data=magnitude of physical quantity/base value × 2 scaled values.
6. method according to claim 5, comprises further: calculate the conversion coefficient 2 between the magnitude of physical quantity of the variable of described physical quantity type and binary data scaled values/ base value.
7. method according to claim 6, host computer inputs base value and the unit of the variable of physical quantity type and calculates described conversion coefficient.
8. method according to claim 4, comprises further: the magnitude of physical quantity observing the variable of described physical quantity type on host computer.
9. method according to claim 8, comprises further: the binary data of the variable of described physical quantity type is uploaded to described host computer from target machine.
10. method according to claim 9, comprises further: adopt following formula described binary data to be converted to the magnitude of physical quantity of the variable of described physical quantity type:
Magnitude of physical quantity=binary data/2 scaled values× base value.
CN201410852978.0A 2014-12-31 2014-12-31 Continuous function chart (CFC) programming method Pending CN104503818A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410852978.0A CN104503818A (en) 2014-12-31 2014-12-31 Continuous function chart (CFC) programming method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410852978.0A CN104503818A (en) 2014-12-31 2014-12-31 Continuous function chart (CFC) programming method

Publications (1)

Publication Number Publication Date
CN104503818A true CN104503818A (en) 2015-04-08

Family

ID=52945219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410852978.0A Pending CN104503818A (en) 2014-12-31 2014-12-31 Continuous function chart (CFC) programming method

Country Status (1)

Country Link
CN (1) CN104503818A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110179402A1 (en) * 2010-01-15 2011-07-21 Sun Microsystems, Inc. Method and system for compiling a dynamically-typed method invocation in a statically-typed programming language
CN103064992A (en) * 2011-10-20 2013-04-24 台达电子企业管理(上海)有限公司 Routing storage structure based on directed grid points and routing method thereof
CN104503817A (en) * 2014-12-30 2015-04-08 北京纵横机电技术开发公司 Continuous functional chart programming method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110179402A1 (en) * 2010-01-15 2011-07-21 Sun Microsystems, Inc. Method and system for compiling a dynamically-typed method invocation in a statically-typed programming language
CN103064992A (en) * 2011-10-20 2013-04-24 台达电子企业管理(上海)有限公司 Routing storage structure based on directed grid points and routing method thereof
CN104503817A (en) * 2014-12-30 2015-04-08 北京纵横机电技术开发公司 Continuous functional chart programming method

Similar Documents

Publication Publication Date Title
CN104503817A (en) Continuous functional chart programming method
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
EP3304229B1 (en) Method and system for generating plc code with a connectivity model
EP2169547B1 (en) Compilation model for programmable logic controllers (PLC).
CN102541521B (en) Automatic operating instruction generating device based on structured query language and method
US20080288928A1 (en) Methods and Systems for Converting Application Code in Turbine Control Systems
US8032232B2 (en) Natively retaining project documentation in a controller
CN109918081B (en) Compiling method and compiler
US10061809B2 (en) Control device
CN104714468A (en) Method of comparison between continuous functional diagram files
CN102880462A (en) Method and device for generating configuration monitoring object based on graph mode integration
EP3647941B1 (en) Engineering apparatus, control method of engineering apparatus, and program
CN112363695B (en) PMML file and integration method of runtime environment and industrial software thereof
CN104503765A (en) Continuous function chart (CFC) programming method
CN104572233A (en) Continuous function chart programming method
CN105431790A (en) Programming device
JP6550268B2 (en) Program creation support apparatus, program and determination method
CN105204837B (en) Method and device for realizing logic programming
CN104503818A (en) Continuous function chart (CFC) programming method
CN104503766A (en) Continuous function chart (CFC) programming method
Dumitrescu et al. Model-based development of products, processes and production resources: A state-oriented approach for an integrated system model of objects, processes and systems
JP5978775B2 (en) PROGRAMMABLE CONTROLLER, ITS SUPPORT DEVICE, PROGRAM, PROGRAM TRANSFER METHOD
CN115495442B (en) Database operation file generation method, device, equipment and storage medium
WO2015145538A1 (en) Program chart creation device, program chart creation method, and program chart creation program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150408

WD01 Invention patent application deemed withdrawn after publication