Summary of the invention
Based on this, it is necessary to exist for sequence control method in general PLC and need to take bigger PLC
Memory space, the problem that control efficiency is low, it is provided that a kind of without taking bigger PLC memory space, control effect
Sequence control method and system in the PLC that rate is high.
Sequence control method in a kind of PLC, including step:
Obtain the action limitation function block of preset order functional diagram, wherein, the restriction merit of action limitation function block
Restriction time, time delay, pulse, effective set can be included, walk active homing, walk invalid setting and protect
Hold and walk invalid delay and remain 1;
Obtaining pre-set textization programming variable, pre-set textization programming variable is used in text programming language,
The function of the step in the execution step alternate orders functional diagram of storage and display program;
According to preset changeover condition, the assignment of amendment pre-set textization programming variable, call action limitation function
Block realizes the function of SFC action in text programming language.
Sequence control system in a kind of PLC, including:
First acquisition module, for obtaining the action limitation function block of preset order functional diagram, wherein, action
The limitation function of limitation function block includes restriction time, time delay, pulse, effective set, step the most again
Position, walk invalid setting holding and walk invalid delay and remain 1;
Second acquisition module, is used for obtaining pre-set textization programming variable, and pre-set textization programming variable is used for
In text programming language, store and the function of the step in the execution step alternate orders functional diagram showing program;
Calling module, for according to preset changeover condition, the assignment of amendment pre-set textization programming variable, adjusting
In text programming language, the function of SFC action is realized with action limitation function block.
Sequence control method and system in PLC of the present invention, obtain the action limitation function of preset order functional diagram
Block, the limitation function of action limitation function block include the restriction time, time delay, pulse, effective set,
Step active homing, walk invalid setting and keep, walk invalid delay and remain 1, obtaining pre-set textization programming and become
Amount, pre-set textization programming variable, in text programming language, stores and shows the execution step of program
The function of the step in alternate orders functional diagram, according to preset changeover condition, amendment pre-set textization programming variable
Assignment, call action limitation function block realizes the function of SFC action in text programming language.
During whole, use text programming language to realize the function of sequential control, sequential control can not only be met
Requirement, and owing to text programming language has the biggest simplification compared to SFC data, it is possible to overcome
SFC SFC need to take the defect of the bigger memory space of PLC, it is achieved in PLC, order is efficiently with simple
Single control.
Detailed description of the invention
In PLC, programming language includes text programming language ST and SFC SFC, wherein, sequentially merit
SFC programming language can be schemed and there is programmed readability by force, can be visually seen very much the sequence of movement of equipment, equipment
Be easy to during fault find out the position that fault is in, it is not necessary to complicated interlocking program, it is easier to design and
The advantages such as maintenance system, but, for realizing the SFC above-mentioned variation of SFC programming language, comprehensively
Its programming language of function is intended to complicated a lot compared to text programming language ST, and SFC SFC
The a lot of content of programming language is rarely employed in PLC sequential control, for overcoming SFC SFC to need
Taking the defect of the bigger memory space of PLC, the present invention considers to use in PLC sequential control text programming language
ST realizes SFC SFC, overcomes SFC SFC need to take lacking of the bigger memory space of PLC
Fall into, it is achieved in PLC, order efficiently controls with simple.
As it is shown in figure 1, sequence control method in a kind of PLC, including step:
S200: obtain the action limitation function block of preset order functional diagram, wherein, action limitation function block
Limitation function includes restriction time, time delay, pulse, effective set, walks active homing, walks invalid setting
Determine and keep, walking invalid delay and remain 1.
In realizing PLC in sequence control procedure, SFC partial function is cannot be directly at textual
Programming language includes being directly realized by without built-in instruction.Here obtain the action limit of preset order functional diagram
Functional device processed, the limitation function of action limitation function block mainly includes restriction time L, D time delay, pulse
P, effective set N, step active homing R, walk invalid setting holding and walk invalid delay and remain 1 (DS),
Call action limitation function block, realizing SFC partial function in textual programming language cannot be direct
The function realized, other functions of SFC can directly be directly realized by textual programming language.
S400: obtaining pre-set textization programming variable, pre-set textization programming variable is for programming language at text
Call the turn, store and the function of the step in the execution step alternate orders functional diagram showing program.
In text programming language, store and the step in the execution step alternate orders functional diagram showing program
Function, it is possible to clearly recording, show which step current PLC has gone to, such as current PLC holds
Row step 2, in text programming language, can store current this state of step 2 that performs, and aobvious by outside
Show that equipment demonstrates and be currently executing step 2, be so easy to programming personnel and understand practical situation.
S600: according to preset changeover condition, the assignment of amendment pre-set textization programming variable, call action limits
Functional device processed realizes the function of SFC action in text programming language.
Preset changeover condition is set in advance, such as, when receiving A data, need to perform step from 2
Going to step 3, when receiving B data, need from 3, execution step is jumped to 5, preset changeover condition can
It is set to preset according to programmer hobby, custom and present procedure application scenarios and stores to PLC.
The assignment of amendment pre-set textization programming variable can be understood as giving different numerical value, with reality to a function
Operate the most accordingly.The action limitation function block that invocation step S200 obtains, realizes in text programming language
The function of SFC action, specifically, mainly include the step action of SFC function and
The oriented line of SFC and the function of conversion.
Sequence control method in PLC of the present invention, obtains the action limitation function block of preset order functional diagram, dynamic
The limitation function being restricted functional device includes restriction time, time delay, pulse, effective set, step effectively
Reset, walk invalid setting holding and walk invalid delay and remain 1, obtain pre-set textization programming variable,
Pre-set textization programming variable, in text programming language, stores and substitutes with the execution step showing program
The function of the step in SFC, according to preset changeover condition, the tax of amendment pre-set textization programming variable
Value, call action limitation function block realizes the function of SFC action in text programming language.Whole
During, use text programming language to realize the function of sequential control, the requirement of sequential control can not only be met,
And owing to text programming language has the biggest simplification compared to SFC data, it is possible to overcome order merit
SFC can be schemed and need to take the defect of the bigger memory space of PLC, it is achieved in PLC, order efficiently controls with simple.
Explain in detail the technical scheme of sequence control method in PLC of the present invention for more one step, below simulation is counted
Calculation machine programming language processing procedure, explains in detail, it is noted that following appearance English be programming language or
Operational order.
Step one: create or call action limitation function block, P_Action, D_Action, L_Action,
N_Action, R_Action, S_Action, DS_Action.
Step 2: create or call textual programming variable, Action_Step:Int (current perform step number),
Step_Sw_Con:array [1 ... 255] of bool (step switch condition).
Step 3: be entered as 1 for Action_Step, initial step Step_Sw_Con substituting SFC owns
Element is entered as FALSE.
Step 4: judge whether to receive function on order, enters next step when receiving.
Step 5: perform by the execution step program controlling requirement, when being received again by new function on order,
Return step 2.
As in figure 2 it is shown, wherein in an embodiment, step S600 includes:
S620: according to preset changeover condition, the assignment of amendment pre-set textization programming variable, call action limits
Functional device processed realizes the function of the step action of SFC in text programming language.
S640: according to preset changeover condition, the assignment realization order function of amendment pre-set textization programming variable
The oriented line of figure and the function of conversion.
The step holding function of SFC be cannot directly in text programming language by calling stereotyped command
The function of the step action realized, to this, needs the action limitation function block obtained in invocation step S200 real
Existing.Such as when receiving A data, need from 2, execution step is gone to step 3, pre-set textization is compiled
The assignment of Cheng Bianliang is from 2 amendments to 3, and call action limitation function block is realization order merit in text programming language
The function of the step action of energy figure, goes to step 3, when receiving B data, needs to redirect execution step from 3
To 5, by the assignment of pre-set textization programming variable from 3 amendments to 5, call action limitation function block is at text
Programming language realizes the step action translation function of SFC, jumps to step 5 from step 3.
As in figure 2 it is shown, wherein in an embodiment, also include after step S620:
S630: built-in timer in PLC is resetted.
Owing to each program step being required for using timer function, in order to reduce the quantity of intervalometer, i.e. subtract
The memory headroom that few program takies, can be after step be changed, the intervalometer used in programming PLC Chinese versionization
Reset, reuse in next program step.In the present embodiment, after changing in step, to PLC
Middle intervalometer resets, the quantity of minimizing intervalometer, the memory headroom that effective minimizing program takies, the most more
Overcome SFC SFC need to take the defect of the bigger memory space of PLC further, it is achieved good effect.
As in figure 2 it is shown, wherein in an embodiment, also include before step S200:
S120: create the action limitation function block of SFC.
S140: create textual programming variable.
For ease of subsequent operation efficiently with coherent, in the present embodiment, the action creating SFC limits
Functional device also creates textual programming variable, in order to directly obtain in subsequent operation.
Wherein in an embodiment, textual programming variable is to become without 16 integers of symbol or 16 integers
Amount.
Textual programming variable is without 16 integers of symbol or 16 integer variables.
As it is shown on figure 3, sequence control system in a kind of PLC, including:
First acquisition module 200, for obtaining the action limitation function block of preset order functional diagram, wherein, dynamic
The limitation function being restricted functional device includes restriction time, time delay, pulse, effective set, step effectively
Reset, walk invalid setting holding and walk invalid delay and remain 1.
Second acquisition module 400, is used for obtaining pre-set textization programming variable, and pre-set textization programming variable is used
In in text programming language, store and the merit of the step in the execution step alternate orders functional diagram showing program
Energy.
Calling module 600, for according to preset changeover condition, amendment pre-set textization programs the assignment of variable,
Call action limitation function block realizes the function of SFC action in text programming language.
Sequence control system in PLC of the present invention, the first acquisition module 200 obtains the dynamic of preset order functional diagram
Be restricted functional device, the limitation function of action limitation function block include the restriction time, time delay, pulse,
Effectively set, walking active homing, walk invalid setting holding and walk invalid delay and remain 1, second obtains
Module 400 obtains pre-set textization programming variable, and pre-set textization programming variable is at text programming language
In, store and the function of the step in the execution step alternate orders functional diagram showing program, calling module 600
According to preset changeover condition, the assignment of amendment pre-set textization programming variable, call action limitation function block exists
Text programming language realizes the function of SFC action.During whole, use text programming language
Realize the function of sequential control, the requirement of sequential control can not only be met, and due to text programming language phase
The biggest simplification is had, it is possible to overcome SFC SFC need to take PLC bigger compared with SFC data
The defect of memory space, it is achieved in PLC, order efficiently controls with simple.
As shown in Figure 4, wherein in an embodiment, calling module 600 includes:
First call unit 620, for according to preset changeover condition, the tax of amendment pre-set textization programming variable
Value, call action limitation function block realizes the function of the step action of SFC in text programming language.
Second call unit 640, for according to preset changeover condition, the tax of amendment pre-set textization programming variable
Value realizes the oriented line of SFC and the function of conversion.
The function of the step action of SFC cannot directly realize in text programming language, to this,
The action limitation function block calling the first acquisition module 200 acquisition is needed to realize.
As shown in Figure 4, wherein in an embodiment, in PLC, sequence control system also includes:
Reset unit 630, for resetting to built-in timer in PLC.
Owing to each program step needing use timer function, mostly in order to reduce the quantity of intervalometer, i.e.
The memory headroom that minimizing program takies, can reset to intervalometer in PLC, at next after step is changed
Program step is reused.In the present embodiment, after changing in step, reset unit 630 is to fixed in PLC
Time device reset, reduce intervalometer quantity, the memory headroom that effective minimizing program takies, the most more enter one
Step overcomes SFC SFC need to take the defect of the bigger memory space of PLC, it is achieved good effect.
As shown in Figure 4, wherein in an embodiment, in PLC, sequence control system also includes:
First creation module 120, for creating the action limitation function block of SFC.
Second creation module 140, is used for creating textual programming variable.
For ease of subsequent operation efficiently with coherent, in the present embodiment, the first creation module 120 establishment order
The action limitation function block of functional diagram, the second creation module 140 creates textual programming variable, in order to rear
Continuous operation directly obtains.
Wherein in an embodiment, textual programming variable is to become without 16 integers of symbol or 16 integers
Amount.
Textual programming variable is without 16 integers of symbol or 16 integer variables.
Above example only have expressed the several embodiments of the present invention, and it describes more concrete and detailed, but
Can not therefore be construed as limiting the scope of the patent.It should be pointed out that, general for this area
For logical technical staff, without departing from the inventive concept of the premise, it is also possible to make some deformation and improvement,
These broadly fall into protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be wanted with appended right
Ask and be as the criterion.