CN103699048A - Method for converting PLC (Programmable Logic Controller) up-counter to sequence Petri net - Google Patents
Method for converting PLC (Programmable Logic Controller) up-counter to sequence Petri net Download PDFInfo
- Publication number
- CN103699048A CN103699048A CN201310655001.5A CN201310655001A CN103699048A CN 103699048 A CN103699048 A CN 103699048A CN 201310655001 A CN201310655001 A CN 201310655001A CN 103699048 A CN103699048 A CN 103699048A
- Authority
- CN
- China
- Prior art keywords
- ctu
- transition
- add
- now
- point
- 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
- 238000000034 method Methods 0.000 title claims abstract description 50
- 230000007704 transition Effects 0.000 claims abstract description 312
- 238000005070 sampling Methods 0.000 claims abstract description 10
- 238000004088 simulation Methods 0.000 claims description 28
- 101150071238 tut1 gene Proteins 0.000 claims description 10
- 238000005096 rolling process Methods 0.000 claims description 9
- 230000000630 rising effect Effects 0.000 claims description 7
- 238000012795 verification Methods 0.000 abstract description 3
- 230000005284 excitation Effects 0.000 abstract 2
- 235000013399 edible fruits Nutrition 0.000 description 16
- 238000005516 engineering process Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000013178 mathematical model Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 1
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a method for converting a PLC (Programmable Logic Controller) up-counter to sequence Petri net model. The method comprises the following steps: constructing a sequence Petri net model according to an up-counter (CTU) defined according to IEC61131-3, respectively simulating ports by using places, simulating the change condition of the port state by transition, and simulating internal execution condition by transition according to the execution rule of the up-counter; adding sequence control places to control the transition of a firstly excited input end and a reset end to complete input sampling; controlling the interior of the up-counter to execute transition excitation, completing the execution period, finally controlling transition excitation of an output (Q) to complete the output period. The Petri net model constructed by the method fits PLC circular scanning work mode, and can dynamically simulate the execution process of the up-counter by using software, thereby completing program simulation and verification by using a computer.
Description
Technical field
The present invention relates to a kind of PLC be added to the method that counter is converted to order Petri net.
Background technology
Programmable logic controller (PLC) (Programmable Logic Controller, PLC) (also can be described as Programmable Logic Controller (Programmable Controller, PC)) be typical controller in industrial control system, PLC develops on the basis of electrical equipment control technology and computer technology, and develop into gradually and take microprocessor as core, the infant industry control device that automatic technology, computer technology, the communication technology are combined together.
At present, in the programming language of PLC, ladder diagram still accounts for leading status.Use trapezoidal pattern programming language to carry out skilled design, first will learn the courses such as relay logic, and constantly train and accumulate experience.Yet, along with PLC systemic-function from strength to strength, ladder diagram becomes and becomes increasingly complex, the frequency breaking down is also more and more.In large-scale industrial control system, the fault of generation tends to cause catastrophic consequence.
In order to solve above-mentioned engineering problem, we need to develop emulation and the verification method of PLC program, utilize computing machine to complete procedure simulation and checking work, both can reduce program development cost, can guarantee program correctness and reliability again.Therefore, need to be the mathematical model of the computer that verification tool can be identified by PLC process simulation, be about to PLC programmed instruction and be converted to a kind of mathematical model of the computer-Petri net.
Petri net is nineteen sixty Germany scientist Ka Er A Petri at his PhD dissertation < < with proposing in automat communication > >.It provides, and a kind of to take figure and mathematics be basic Formal Modeling, and the structure of descriptive system, makes it both can adopt mathematical analysis preferably, can vividly describe out by figure the operational process of system again.
Summary of the invention
The object of the present invention is to provide a kind of PLC to be added to the method that counter is converted to order Petri net, the Petri pessimistic concurrency control of structure can be simulated the implementation that adds counter, thereby utilizes computing machine to complete procedure simulation and checking work.
The present invention is a kind of adds by PLC the method that counter is converted to order Petri net, specifically comprises the steps:
Step 1.1 by the register that adds counter input end be modeled as storehouse set
p wherein
i, on, p
i, off, p
i, riserepresent respectively to add three kinds of states of the register of counter input end: high level state, low level state, from disconnecting, point to the switching state of connecting;
Step 1.2 is by the p of storehouse institute
i, offbecome the p of storehouse institute
i, onprocess simulation be transition t
i, off, on, by the p of storehouse institute
i, onbecome the p of storehouse institute
i, offprocess simulation be transition t
i, on, off, add the p of storehouse institute
i, offpoint to transition t
i, off, ondirected arc, add transition t
i, off, onpoint to the p of storehouse institute
i, ondirected arc; Add the p of storehouse institute
i, onpoint to transition t
i, on, offdirected arc, add transition t
i, on, offpoint to the p of storehouse institute
i, offdirected arc; Add transition t
i, off, onpoint to the p of storehouse institute
i, risedirected arc, the directed arc set of gained
The transition set of gained
Step 1.3, when adding counter reset terminal and be high level, adds the zero clearing of counter currency, is output as low level, and the register that adds counter reset terminal is modeled as to P that gather in storehouse
r={ p
r, on, p
r, off, the p of storehouse institute wherein
r, on, p
r, offthe two states that represents respectively reset terminal register: high level state, low level state, gather in storehouse
Step 1.4 is by the p of storehouse institute
r, offbecome the p of storehouse institute
r, onprocess simulation be transition t
r, off, on, by the p of storehouse institute
r, onbecome the p of storehouse institute
r, offprocess simulation be transition t
r, on, off, add the p of storehouse institute
r, offpoint to transition t
r, off, ondirected arc, add the p of storehouse institute
r, onpoint to transition t
r, on, offdirected arc; Add transition t
r, off, onpoint to the p of storehouse institute
r, ondirected arc, add transition t
r, on, offpoint to the p of storehouse institute
r, offdirected arc, the directed arc set of gained
wherein
F
1={ (p
r, off, t
r, off, on), (p
r, on, t
r, on, off), (t
r, off, on, p
r, on), (t
r, on, off, p
r, off), gained transition set
Step 1.5 has now completed the Petri net modeling that counter is inputted the cycle that adds that does not add scan round, is next that input end and reset terminal increase sequential control, first input end is sampled, and builds a control places S
0represent to start to deposit the state of input end in register, build a control places S
1represent that input end deposits EO in, also represent to start to deposit the state of reset terminal in register the control places set of gained simultaneously
Any one state of step 1.6 input end has two kinds of situations of change, and the input end when a upper cycle is low level, and current period can be high level, or is still low level, by low transition, is that low level process simulation is transition t
i, off, off, the process simulation that high level is converted to high level is transition t
i, on, on, add the p of storehouse institute
i, onpoint to transition t
i, on, ontwo-way arc; Add the p of storehouse institute
i, offpoint to transition t
i, off, offtwo-way arc;
The p of storehouse institute
i, on, onrepresented that when a upper cycle be that high level and current period are still high level, from control places S
0start the state of input end to be stored in register until control places S
1, add the S of storehouse institute
0point to transition t
i, off, off, t
i, on, on, t
i, off, on, t
i, on, offdirected arc, add transition t
i, off, off, t
i, on, on, t
i, off, on, t
i, on, offpoint to control places S
1directed arc; Add transition t
i, on, onpoint to the p of storehouse institute
i, on, ondirected arc, the directed arc set of gained
Wherein:
F
i,1={(t
i,on,on,p
i,on,on)},F
i,2={(t
i,on,on,p
i,on),(p
i,on,t
i,on,on)};
F
i,3={(t
i,off,off,p
i,off),(p
i,off,t
i,off,off)};
The set of gained transition
Gather in the storehouse of gained
The state of step 1.7 pair reset terminal is sampled, and builds a control places S
2represent that reset terminal sampling finishes, and namely inputs end cycle; Build transition t
r, off, off, t
r, on, onrepresent that respectively reset terminal low level becomes low level, high level becomes high level, add the p of storehouse institute
r, onpoint to transition t
r, on, ontwo-way arc; Add the p of storehouse institute
r, offpoint to transition t
r, off, offtwo-way arc, the sampling of reset terminal is from the end of input end, so add control places S
1point to transition t
r, off, off, t
r, on, on, t
r, off, on, t
i, on, offdirected arc; Add transition t
r, off, off, t
r, on, on, t
r, off, on, t
i, on, offpoint to control places S
2directed arc, the directed arc set of gained
Wherein:
F
r,1={(t
r,on,on,p
r,on,on)},F
r,2={(t
r,on,on,p
r,on),(p
r,on,t
r,on,on)};
Step 1.8 input magazine collects
transition set
Directed arc set
When reset terminal is high level, no matter what state input end is, add counter O reset;
Create a control places S
3represent that cleared condition, corresponding input end register have three kinds of situations to make to add counter and enter cleared condition: three kinds of states of input end register are respectively low level state, rising edge state, high level state, the corresponding transition of each state are respectively: t
c, on, off, t
c, on, rise, t
c, on, on;
Add control places S
2point to transition t
c, on, off, t
c, on, rise, t
c, on, ondirected arc; Add the p of storehouse institute
r, onpoint to transition t
c, on, off, t
c, on, rise, t
c, on, ontwo-way arc; Add the p of storehouse institute
i, offpoint to transition t
c, on, offtwo-way arc; Add the p of storehouse institute
i, risepoint to transition t
c, on, risedirected arc; Add the p of storehouse institute
i, on, onpoint to transition t
c, on, ondirected arc; Add transition t
c, on, off, t
c, on, rise, t
c, on, onpoint to the S of storehouse institute
3directed arc;
Create a control places S
4represent disarmed state, have two states not exert an influence to the current output state that adds counter, use transition t
c, null,1 represents that input end is that high level, reset terminal are low level; Use transition t
c, null, 2expression input end is that low level, reset terminal are low level;
Add the p of storehouse institute
i, on, onpoint to transition t
c, null, 1directed arc; Add the p of storehouse institute
i, offpoint to transition t
c, null, 2two-way arc; Add the p of storehouse institute
r, offpoint to transition t
c, null, 1, t
c, null, 2two-way arc; Add control places S
2point to transition t
c, null, 1, t
c, null, 2directed arc; Add transition t
c, null, 1, t
c, null, 2point to control places S
4directed arc; The control places set of gained:
S
c={ S
3, S
4, transition set T
c={ t
c, on, off, t
c, on, riset
c, on, on, t
c, null, 1, t
c, null, 2, directed arc set
Wherein:
Step 2.1 will add counter currency register and be modeled as two couples of p of storehouse institute
c, ctu, max, p
c, ctu, now, the p of storehouse institute wherein
c, ctu, maxrepresent to add the maximal value that counter can be counted; The p of storehouse institute
c, ctu, nowrepresent to add counter currency; When adding counter, meet while adding 1 state, from the p of storehouse institute
c, ctu, maxtake out a holder and agree be put into the p of storehouse institute
c, ctu, nowin, if the p of storehouse institute
c, ctu, nowin holder agree number and be more than or equal to while adding counter preset value PV, add counter output high level, the storehouse of gained is gathered and is
Step 2.2 is by the p of storehouse institute
c, ctu, maxtake out a holder and agree be put into the p of storehouse institute
c, ctu, nowprocess simulation be transition t
ctu, max, now, and transition excite satisfied condition to have three: input sample finishes and in reset mode, input end, is not or not rising edge state, reset terminal end are low level state;
Add the p of storehouse institute
c, ctu, maxpoint to transition t
ctu, max, nowdirected arc; Add transition t
ctu, max, nowpoint to the p of storehouse institute
c, ctu, nowdirected arc; Add control places S
2point to transition t
ctu, max, nowdirected arc; Add the p of storehouse institute
i, risepoint to transition t
ctu, max, nowdirected arc; Add the p of storehouse institute
r, offpoint to transition t
ctu, max, nowtwo-way arc; The transition set of gained
Directed arc set:
Step 2.3 adds should judge after counter often adds once that whether add counter currency is more than or equal to and adds counter preset value PV, creates a control places S
5represent that adding counter often adds state once, control places S
5also represent that current period adds rolling counters forward complete, add transition t
ctu, max, nowpoint to control places S
5directed arc, directed arc set
Control places set:
Step 2.4 is by the p of storehouse institute
c, ctu, nowinterior holder agree all take out and put into the p of storehouse institute
c, ctu, maxinterior process is called and adds counter O reset process, is modeled as transition t
ctu, now, max; Transition t
ctu, now, maxexcite a holder of taking-up to agree put into the p of storehouse institute at every turn
c, ctu, maxin, if the initial storehouse p of institute
c, ctu, nowinside there are a plurality of holders to agree, transition t
ctu, now, maxoccur repeatedly; Transition t
ctu, now, maxcondition is to add counter in cleared condition, adds control places S
3point to transition t
ctu, now, maxtwo-way arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
ctu, now, maxdirected arc; Add transition t
ctu, now, maxpoint to the p of storehouse institute
c, ctu, maxdirected arc; Create a transition t
ctu, now, nullthe judgement p of storehouse institute
c, ctu, nowinterior not holder is agree; Add and control S
3point to transition t
ctu, now, nulldirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
ctu, now, nulltwo-way arc and weights be to add the maximal value PvMax that counter can be counted;
The transition set of gained
Directed arc set
Wherein
F
now,max={(S
3,t
ctu,now,max),(p
c,ctu,now,t
ctu,now,max),(t
ctu,now,max,S
3),(t
ctu,now,max,p
c,ctu,max)};F
now,null={(S
3,t
ctu,now,null),(p
c,ctu,max,t
ctu,now,null),(t
ctu,now,null,p
c,ctu,max)};
Step 3, the output that adds counter is converted to Petri net:
Add counter and can only export high level or low level, this two states is modeled as to the p of storehouse institute
o, ctu, on, p
o, ctu, off, storehouse collects
The combinations of states of input end and reset terminal is divided into three kinds: reset mode, count status, do not affect the state that adds counter currency;
Step 3.1, when adding counter in reset mode, is output as low level, transition t
ctu, now, nullthe judgement p of storehouse institute
c, ctu, nowinterior not holder is agree, and output terminal output low level, adds transition t
ctu, now, nullpoint to the p of storehouse institute
o, ctu, offdirected arc, the set of gained directed arc
Step 3.2 is after adding rolling counters forward and finishing and arrive and add counter preset value PV, now adds counter output high level, and this situation is modeled as to transition t
o, ctu, pv, add control places S
5point to transition t
o, ctu, pvdirected arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, pvtwo-way arc and weights for adding counter preset value PV; Output terminal output high level, adds transition t
o, ctu, pvpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
Directed arc set:
Step 3.3 does not reach and adds counter preset value PV after adding rolling counters forward and finishing, and now adds counter output low level, and this situation is modeled as to transition t
o, ctu, lpv, add control places S
5point to t
o, ctu, lpvdirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
o, ctu, lpvtwo-way arc and weights be PvMax-PV+1; Due to output terminal output low level, so add transition t
o, ctu, lpvpoint to the p of storehouse institute
o, ctu, offdirected arc, gained transition set
directed arc set:
Step 3.4 is not after adding counter input sample when affecting the state that adds counter currency, and the Output rusults of current period is identical with a upper cycle, and both of these case is modeled as to transition t
o, ctu, on, t
o, ctu, off, transition t wherein
o, ctu, onrepresent upper cycle output high level; Transition t
o, ctu, offrepresent a upper cycle output low level, control places S
4just represent to add counter in this state, the p of library representation institute when a upper cycle is low level
c, ctu, maxinterior holder is agree number for PvMax-PV+1, so interpolation control places S
4point to transition t
o, ctu, offdirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
o, ctu, offtwo-way arc and weights be PvMax-PV+1; Add transition t
o, ctu, offpoint to the p of storehouse institute
o, ctu, offdirected arc, as the p of storehouse institute
c, ctu, nowinterior holder agree count to be more than or equal to add counter preset value PV, represents upper cycle output high level, so add control places S
4point to transition t
o, ctu, ondirected arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, ontwo-way arc and weights for adding counter preset value PV; Add transition t
o, ctu, onpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
directed arc set:
Step 3.5 is when adding counter when the last cycle has count down to maximal value, and current period adds counter and still meets counting condition, now adds counter and does not carry out work and output state and remain high level, and this situation is modeled as to transition t
o, ctu, full, add control places S
2point to transition t
o, ctu, fulldirected arc; Add the p of storehouse institute
i, risepoint to transition t
o, ctu, fulldirected arc; Add the p of storehouse institute
r, offpoint to transition t
o, ctu, fulltwo-way arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, fulltwo-way arc and weights be PvMax; Add transition t
o, ctu, fullpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
the set of gained directed arc:
Add the Petri net storehouse collection of counter as P=P
ctu, i∪ P
ctu∪ P
ctu, o, transition set is T=T
ctu, i∪ T
ctu∪ T
ctu, o, directed arc set is F=F
ctu, i∪ F
ctu∪ F
ctu, o, obtain a common Petri net N
ctu:=(P, T; F) and preliminary examination sign m
0.
The present invention is a kind of by the method that counter is converted to order Petri pessimistic concurrency control that adds of PLC, according to IEC61131-3 definition, add counter (CTU) Build Order Petri pessimistic concurrency control, respectively with analog port that storehouse is come, situation of change with transition analog port state, and according to the executing rule that adds counter, by transition simulated interior implementation status; Increase sequential control storehouse institute, control the transition that first excite input end, reset terminal, complete input sample; Then control to carry out and add that counter is inner to be carried out transition and excite, complete the performance period, the transition of finally controlling output (Q) excite, and complete the output cycle; The present invention is by increasing sequential control storehouse institute, and the Petri pessimistic concurrency control that makes to build meets the working method of PLC scan round; The constructed Petri pessimistic concurrency control of the present invention can be simulated the implementation that adds counter, can use its implementation of software dynamic similation, thereby can utilize computing machine to complete procedure simulation and checking work.
Accompanying drawing explanation
Fig. 1 is by the ordinary Petri net that adds counter and convert in the present invention;
Fig. 2 is the PLC trapezoid figure program schematic diagram of the embodiment of the present invention 1 fruit fixed number vanning;
Fig. 3 is the ordinary Petri net that the PLC trapezoid figure program of the embodiment of the present invention 1 correspondence converts to.
Below in conjunction with drawings and Examples, the invention will be further described.
Embodiment
The present invention has provided and a kind of PLC has been added to the method that counter is converted to order Petri net, and described order Petri net refers to by increasing sequential control storehouse institute, and the Petri pessimistic concurrency control that makes to build meets the working method of PLC scan round.
The present invention adds counter (CTU) Build Order Petri net according to IEC61131-3 definition, respectively with analog port that storehouse is come: input end (CU), reset terminal (R), export (Q), add counter currency (CV); By the situation of change of transition analog port state, and according to the executing rule that adds counter, by transition simulated interior implementation status; Increase sequential control storehouse institute, control the transition that first excite input end (CU), reset terminal (R), complete input sample; Then control to carry out and add that counter is inner to be carried out transition and excite, complete the performance period; The transition of finally controlling output (Q) excite, and complete the output cycle.
The present invention is a kind of adds by PLC the method that counter is converted to order Petri net, comprises the steps:
Step 1.1 can have countless a plurality ofly owing to adding contact on counter input path, but only has an input end, thus in order to simplify Petri net figure, by the internal register that adds counter input end be modeled as storehouse set
can ignore like this contact number on input path, only consider that it is high level or low level, wherein p that input path is transferred to input end
i, on, p
i, off, p
i, riserepresent respectively to add three kinds of states of counter input end register: high level state, low level state, from disconnecting, point to the switching state of connecting;
Step 1.2 is by the p of storehouse institute
i, offbecome the p of storehouse institute
i, onprocess simulation be transition t
i, off, on, by the p of storehouse institute
i, onbecome the p of storehouse institute
i, offprocess simulation be transition t
i, on, off, add the p of storehouse institute
i, offpoint to transition t
i, off, ondirected arc, add transition t
i, off, onpoint to the p of storehouse institute
i, ondirected arc; Add the p of storehouse institute
i, onpoint to transition t
i, on, offdirected arc, add transition t
i, on, offpoint to the p of storehouse institute
i, offdirected arc; The p of storehouse institute
i, offbecome the p of storehouse institute
i, onprocess to be input end point to from disconnecting the switching state of connecting, so also will add transition t
i, off, onpoint to the p of storehouse institute
i, risedirected arc, the directed arc set of gained
The transition set of gained
Step 1.3 is the zero clearing of CV end when adding counter reset terminal and be high level, is output as low level, and the register that adds counter reset terminal is modeled as to P that gather in storehouse
r={ p
r, on, p
r, off, because reset terminal is not effective status at rising edge state, so need not be modeled as storehouse institute, the p of storehouse institute wherein
r, on, p
r, offthe two states that represents respectively reset terminal register: high level state, low level state, gather in storehouse
Step 1.4 is by the p of storehouse institute
r, offbecome the p of storehouse institute
r, onprocess simulation be transition t
r, off, on, by the p of storehouse institute
r, onbecome the p of storehouse institute
r, offprocess simulation be transition t
r, on, off, add the p of storehouse institute
r, offpoint to transition t
r, off, ondirected arc, add the p of storehouse institute
r, onpoint to transition t
r, on, offdirected arc; Add transition t
r, off, onpoint to the p of storehouse institute
r, ondirected arc, add transition t
r, on, offpoint to the p of storehouse institute
r, offdirected arc, the directed arc set of gained
wherein
F
1={(p
r,off,t
r,off,on),(p
r,on,t
r,on,off),(t
r,off,on,p
r,on),(t
r,on,off,p
r,off)},
Gained transition set
Step 1.5 now, completed the Petri net modeling that counter is inputted the cycle that adds that does not add scan round, next be that input end and reset terminal increase sequential control, adding the input end of counter and the sampling order of reset terminal does not affect execution and the output cycle of program, because the state of sampling can be stored in input register after sampling finishes, the present invention first samples to input end, builds a control places S
0represent to start to deposit the state of input end in register, build a control places S
1represent that input end deposits EO in, also represent to start to deposit the state of reset terminal in register the control places set of gained simultaneously
Any one state of step 1.6 input end has two kinds of situations of change, and the input end when a upper cycle is low level, and current period can be high level, or is still low level, by low transition, is that low level process simulation is transition t
i, off, off, the process simulation that equally high level is converted to high level is transition t
i, on, on, add the p of storehouse institute
i, onpoint to transition t
i, on, ontwo-way arc; Add the p of storehouse institute
i, offpoint to transition t
i, off, offtwo-way arc;
Because introduced the concept of scan round, there is a state to consider: when a upper cycle, be that high level and current period are still high level, this state and a upper cycle are that low level and current period are that high level is different, the p of storehouse institute
i, oncan only represent the second state, so increase a p of storehouse institute
i, on, onrepresent the first state, next said high level all means the second situation.From control places S
0start the state of input end to be stored in register until control places S
1, add control places S
0point to transition t
i, off, off, t
i, on, on, t
i, off, on, t
i, on, offdirected arc, add transition t
i, off, off, t
i, on, on, t
i, off, on, t
i, on, offpoint to control places S
1directed arc; Add transition t
i, on, onpoint to the p of storehouse institute
i, on, ondirected arc, the directed arc set of gained
Wherein:
F
i,1={(t
i,on,on,p
i,on,on)},F
i,2={(t
i,on,on,p
i,on),(p
i,on,t
i,on,on)};
F
i,3={(t
i,off,off,p
i,off),(p
i,off,t
i,off,off)};
The set of gained transition
Gather in the storehouse of gained
The state of step 1.7 pair reset terminal is sampled, and principle and step 1.5,1.6 identical, build a control places S
2represent that reset terminal sampling finishes, and namely inputs end cycle; Build transition t
r, off, off, t
r, on, onrepresent that respectively reset terminal low level becomes low level, high level becomes high level, add the p of storehouse institute
r, onpoint to transition t
r, on, ontwo-way arc; Add the p of storehouse institute
r, offpoint to transition t
r, off, offtwo-way arc, the sampling of reset terminal is from the end of input end, so add the S of storehouse institute
1point to transition t
r, off, off, t
r, on, on, t
r, off, on, t
i, on, offdirected arc; Add transition t
r, off, off, t
r, on, on, t
r, off, on, t
i, on, offpoint to control places S
2directed arc, the directed arc set of gained
Wherein:
F
r,1={(t
r,on,on,p
r,on,on)},F
r,2={(t
r,on,on,p
r,on),(p
r,on,t
r,on,on)};
F
r, 3={ (t
r, off, off, p
r, off), (p
r, off, t
r, off, off), the set of gained transition
When reset terminal is high level, no matter what state input end is, add counter O reset;
Create a S of storehouse institute
3represent that cleared condition, corresponding input end register have three kinds of situations to make to add counter and enter cleared condition: three kinds of states of input end register are respectively low level state, rising edge state, high level state, the corresponding transition of each state are respectively: t
c, on, off, t
c, on, rise, t
c, on, on;
Add the S of storehouse institute
2point to transition t
c, on, off, t
c, on, rise, t
c, on, ondirected arc; Add the p of storehouse institute
r, onpoint to transition t
c, on, off, t
c, on, rise, t
c, on, ontwo-way arc; Add the p of storehouse institute
i, offpoint to transition t
c, on, offtwo-way arc; Add the p of storehouse institute
i, risepoint to transition t
c, on, risedirected arc; Add the p of storehouse institute
i, on, onpoint to transition t
c, on, ondirected arc; Add transition t
c, on, off, t
c, on, rise, t
c, on, onpoint to the S of storehouse institute
3directed arc;
Create a S of storehouse institute
4represent disarmed state, have two states not exert an influence to the current output state that adds counter, use transition t
c, null, 1expression input end is that high level, reset terminal are low level; Use transition t
c, null, 2expression input end is that low level, reset terminal are low level;
Add the p of storehouse institute
i, on, onpoint to transition t
c, null, 1directed arc; Add the p of storehouse institute
i, offpoint to transition t
c, null, 2two-way arc; Add the p of storehouse institute
r, offpoint to transition t
c, null, 1, t
c, null, 2two-way arc; Add the S of storehouse institute
2point to transition t
c, null, 1, t
c, null, 2directed arc; Add transition t
c, null, 1, t
c, null, 2point to the S of storehouse institute
4directed arc; Gather in the storehouse of gained:
S
c={ S
3, S
4, transition set T
c={ t
c, on, off, t
c, on, riset
c, on, on, t
c, null, 1,t
c, null, 2, directed arc set
Wherein:
Step 2.1 will add counter currency register and be modeled as two couples of p of storehouse institute
c, ctu, max, p
c, ctu, now, the p of storehouse institute wherein
c, ctu, maxrepresent to add the maximal value that counter can be counted; The p of storehouse institute
c, ctu, nowrepresent to add counter currency; Be modeled as two storehouses principle be to meet while adding one state when adding counter, from the p of storehouse institute
c, ctu, maxtake out a holder and agree be put into the p of storehouse institute
c, ctu, nowin, if the p of storehouse institute
c, ctu, nowin holder agree number and be more than or equal to while adding counter preset value PV, add counter output high level, the storehouse of gained is gathered and is:
Step 2.2 is by the p of storehouse institute
c, ctu, maxtake out a holder and agree be put into the p of storehouse institute
c, ctu, nowprocess simulation be transition t
ctu, max, now, and transition excite satisfied condition to have three: input sample finishes and in reset mode, input end, is not or not rising edge state, reset terminal end are low level state;
Add the p of storehouse institute
c, ctu, maxpoint to transition t
ctu, max, nowdirected arc; Add transition t
ctu, max, nowpoint to the p of storehouse institute
c, ctu, nowdirected arc; Add the S of storehouse institute
2point to transition t
ctu, max, nowdirected arc; Add the p of storehouse institute
i, risepoint to transition t
ctu, max, nowdirected arc; Add the p of storehouse institute
r, offpoint to transition t
ctu, max, nowtwo-way arc; The transition set of gained
Directed arc set:
Step 2.3 adds the each counting of counter should judge that whether add counter currency is more than or equal to and adds counter preset value PV, creates a S of storehouse institute after once
5represent that adding counter often adds state once, the S of storehouse institute
5also represent that current period adds rolling counters forward complete, add transition t
ctu, max, nowpoint to the S of storehouse institute
5directed arc, directed arc set
Gather in storehouse:
Step 2.4 is by the p of storehouse institute
c, ctu, nowinterior holder agree all take out and put into the p of storehouse institute
c, ctu, maxinterior process is called and adds counter O reset process, is modeled as transition t
ctu, now, max; The thought that adds the zero clearing of counter Petri net that the present invention builds is: transition t
ctu, now, maxexcite a holder of taking-up to agree put into the p of storehouse institute at every turn
c, ctu, maxin, if the initial storehouse p of institute
c, ctu, nowinside there are a plurality of holders to agree, transition t
ctu, now, maxoccur repeatedly; Transition t
ctu, now, maxcondition is to add counter in cleared condition, according to zero clearing thought, adds S
3point to transition t
ctu, now, maxtwo-way arc, guarantee like this transition t
ctu, now, maxcan excite repeatedly until the p of storehouse institute
c, ctu, nowinterior not holder is agree; Add the p of storehouse institute
c, ctu, nowpoint to transition t
ctu, now, maxdirected arc; Add transition t
ctu, now, maxpoint to the p of storehouse institute
c, ctu, maxdirected arc; Create a transition t
ctu, now, nullthe judgement p of storehouse institute
c, ctu, nowinterior not holder is agree; Add S
3point to transition t
ctu, now, nulldirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
ctu, now, nulltwo-way arc and weights be to add the maximal value PvMax that counter can be counted;
The transition set of gained
Directed arc set
Wherein
F
now,max={(S
3,t
ctu,now,max),(p
c,ctu,now,t
ctu,now,max),(t
ctu,now,max,S
3),(t
ctu,now,max,p
c,ctu,max)};
F
now,null={(S
3,t
ctu,now,null),(p
c,ctu,max,t
ctu,now,null),(t
ctu,now,null,p
c,ctu,max)};
Step 3, the output that adds counter is converted to Petri net:
Add counter and can only export high level or low level, this two states is modeled as to the p of storehouse institute
o, ctu, on, p
o, ctu, off, storehouse collects
The combinations of states of input end and reset terminal is divided into three kinds: reset mode, count status, do not affect the state that adds counter currency;
Step 3.1, when adding counter in reset mode, is output as low level, transition t
ctu, now, nullthe judgement p of storehouse institute
c, ctu, nowinterior not holder is agree, namely t
ctu, now, nullafter exciting, add counter O reset and finish, output terminal output low level, adds transition t
ctu, now, nullpoint to the p of storehouse institute
o, ctu, offdirected arc, the set of gained directed arc
Step 3.2 is after adding rolling counters forward and finishing and arrive and add counter preset value PV, now adds counter and should export high level, and this situation is modeled as to transition t
o, ctu, pv, add the S of storehouse institute
5point to transition t
o, ctu, pvdirected arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, pvtwo-way arc and weights for adding counter preset value PV; Output terminal output high level, adds transition t
o, ctu, pvpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
Directed arc set:
Step 3.3 does not reach and adds counter preset value PV after existing and adding rolling counters forward and finish, and now adds counter output low level, and this situation is modeled as to transition t
o, ctu, lpv, add the S of storehouse institute
5point to t
o, ctu, lpvdirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
o, ctu, lpvtwo-way arc and weights be PvMax-PV+ 1; Due to output terminal output low level, so add transition t
o, ctu, lpvpoint to the p of storehouse institute
o, ctu, offdirected arc, gained transition set
directed arc set:
Step 3.4 is not after adding counter input sample when affecting the state that adds counter currency, and the Output rusults of current period is identical with a upper cycle, and both of these case is modeled as to transition t
o, ctu, on, t
o, ctu, off, transition t wherein
o, ctu, onrepresent upper cycle output high level; Transition t
o, ctu, offrepresent a upper cycle output low level, the S of storehouse institute
4just represent to add counter in this state, the p of library representation institute when a upper cycle is low level
c, ctu, maxinterior holder is agree number for PvMax-PV+ 1, so the interpolation S of storehouse institute
4point to transition t
o, ctu, offdirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
o, ctu, offtwo-way arc and weights be PvMax-PV+ 1; Add transition t
o, ctu, offpoint to the p of storehouse institute
o, ctu, offdirected arc, as the p of storehouse institute
c, ctu, nowinterior holder agree count to be more than or equal to add counter preset value PV, represents upper cycle output high level, so add the S of storehouse institute
4point to transition t
o, ctu, ondirected arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, ontwo-way arc and weights for adding counter preset value PV; Add transition t
o, ctu, onpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
directed arc set:
Step 3.5 exists a kind of situation when adding counter when the last cycle has count down to maximal value, and current period adds counter and still meets counting condition, now adds counter and does not carry out work and output state and remain high level, and this situation is modeled as to transition t
o, ctu, fullso, add the S of storehouse institute
2point to transition t
o, ctu, fulldirected arc; Add the p of storehouse institute
i, risepoint to transition t
o, ctu, fulldirected arc; Add the p of storehouse institute
r, offpoint to transition t
o, ctu, fulltwo-way arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, fulltwo-way arc and weights be PvMax; Add transition t
o, ctu, fullpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
the set of gained directed arc:
Step 3.6 adds counter output transition set
Directed arc set
Add the Petri net storehouse collection of counter as P=P
ctu, i∪ P
ctu∪ P
ctu, o, transition set is T=T
ctu, i∪ T
ctu∪ T
ctu, o, directed arc set is F=F
ctu, i∪ F
ctu∪ F
ctu, o, obtain a common Petri net N
ctu:=(P, T; F) and preliminary examination sign m
0.
Example 1, take Siemens S7-200PLC counter as example
This example is the fixed number vanning of controlling fruit.When fruit case arrives assigned address, now sensor receives a signal, according to this signal enabling vanning, controls, and after starting, machine packs toward fruit case the fruit number pre-setting into, after filling predetermined number, remove fruit case and again count, this vanning that has just completed fruit is controlled.The PLC trapezoid figure program schematic diagram of writing according to controlling requirement as shown in Figure 2.I
0.0from low level, become high level and represent to pack into a fruit; Q
0.0represent that vanning finishes, and removes (Q by fruit case
0.0during high level, trigger the machine that fruit case is removed).
In this example, used and added counter.Suppose that vanning number is K, so add the preset value of counter, be made as K.When fruit case is filled K, Q
0.0for high level, now remove fruit case and will add counter and empty, wait for the arrival of next fruit case.
According to adding counter, be converted to the method that Petri nets, this example can be divided into three steps:
Step 3, the output terminal that adds counter is modeled as to P that gather in storehouse
o={ p
o, on, p
o, off, by Q
0.0state simulation by storehouse, gathered
that with step 1, analyzes is identical, state
do not exist from the flat situation that becomes high level of height, can simplify and save transition.Last according to the present invention with the principle of work of PLC timer, between corresponding transition and storehouse institute, add directed arc.
The above, it is only preferred embodiment of the present invention, not technical scope of the present invention is imposed any restrictions, therefore any trickle modification, equivalent variations and modification that every foundation technical spirit of the present invention is done above embodiment all still belong in the scope of technical solution of the present invention.
Claims (1)
1. PLC is added to the method that counter is converted to order Petri net, it is characterized in that comprising the steps:
Step 1, to adding input end and the reset terminal of counter, change:
Step 1.1 by the register that adds counter input end be modeled as storehouse set
p wherein
i, on, p
i, off, p
i, riserepresent respectively to add three kinds of states of the register of counter input end: high level state, low level state, from disconnecting, point to the switching state of connecting;
Step 1.2 is by the p of storehouse institute
i, offbecome the p of storehouse institute
i, onprocess simulation be transition t
i, off, on, by the p of storehouse institute
i, onbecome the p of storehouse institute
i, offprocess simulation be transition t
i, on, off, add the p of storehouse institute
i, offpoint to transition t
i, off, ondirected arc, add transition t
i, off, onpoint to the p of storehouse institute
i, ondirected arc; Add the p of storehouse institute
i, onpoint to transition t
i, on, offdirected arc, add transition t
i, on, offpoint to the p of storehouse institute
i, offdirected arc; Add transition t
i, off, onpoint to the p of storehouse institute
i, risedirected arc, the directed arc set of gained
The transition set of gained
Step 1.3, when adding counter reset terminal and be high level, adds the zero clearing of counter currency, is output as low level, and the register that adds counter reset terminal is modeled as to P that gather in storehouse
r={ p
r, on, p
r, off, the p of storehouse institute wherein
r, on, p
r, offthe two states that represents respectively reset terminal register: high level state, low level state, gather in storehouse
Step 1.4 is by the p of storehouse institute
r, offbecome the p of storehouse institute
r, onprocess simulation be transition t
r, off, on, by the p of storehouse institute
r, onbecome the p of storehouse institute
r, offprocess simulation be transition t
r, on, off, add the p of storehouse institute
r, offpoint to transition t
r, off, ondirected arc, add the p of storehouse institute
r, onpoint to transition t
r, on, offdirected arc; Add transition t
r, off, onpoint to the p of storehouse institute
r, ondirected arc, add transition t
r, on, offpoint to the p of storehouse institute
r, offdirected arc, the directed arc set of gained
wherein
F
1={(p
r,off,t
r,off,on),(p
r,on,t
r,on,off),(t
r,off,on,p
r,on),(t
r,on,off,p
r,off)},
Gained transition set
Step 1.5 has now completed the Petri net modeling that counter is inputted the cycle that adds that does not add scan round, is next that input end and reset terminal increase sequential control, first input end is sampled, and builds a control places S
0represent to start to deposit the state of input end in register, build a control places S
1represent that input end deposits EO in, also represent to start to deposit the state of reset terminal in register the control places set of gained simultaneously
Any one state of step 1.6 input end has two kinds of situations of change, and the input end when a upper cycle is low level, and current period can be high level, or is still low level, by low transition, is that low level process simulation is transition t
i, off, off, the process simulation that high level is converted to high level is transition t
i, on, on, add the p of storehouse institute
i, onpoint to transition t
i, on, ontwo-way arc; Add the p of storehouse institute
i, offpoint to transition t
i, off, offtwo-way arc;
Storehouse institute
pi, on, onrepresented that when a upper cycle be that high level and current period are still high level, from control places S
0start the state of input end to be stored in register until control places S
1, add the S of storehouse institute
0point to transition t
i, off, off, t
i, on, on, t
i, off, on, t
i, on, offdirected arc, add transition t
i, off, off, t
i, on, on, t
i, off, on, t
i, on, offpoint to control places S
1directed arc; Add transition t
i, on, onpoint to the p of storehouse institute
i, on, ondirected arc, the directed arc set of gained
Wherein:
F
i,1={(t
i,on,on,p
i,on,on)},F
i,2={(t
i,on,on,p
i,on),(p
i,on,t
i,on,on)};
F
i,3={(t
i,off,off,p
i,off),(p
i,off,t
i,off,off)};
The set of gained transition
Gather in the storehouse of gained
The state of step 1.7 pair reset terminal is sampled, and builds a control places S
2represent that reset terminal sampling finishes, and namely inputs end cycle; Build transition t
r, off, off, t
r, on, onrepresent that respectively reset terminal low level becomes low level, high level becomes high level, add the p of storehouse institute
r, onpoint to transition t
r, on, ontwo-way arc; Add the p of storehouse institute
r, offpoint to transition t
r, off, offtwo-way arc, the sampling of reset terminal is from the end of input end, so add control places S
1point to transition t
r, off, off, t
r, on, on, t
r, off, on, t
i, on, offdirected arc; Add transition t
r, off, off, t
r, on, on, t
r, off, on, t
i, on, offpoint to control places S
2directed arc, the directed arc set of gained
Wherein:
F
r,1={(t
r,on,on,p
r,on,on)},F
r,2={(t
r,on,on,p
r,on),(p
r,on,t
r,on,on)};
F
r, 3={ (t
r, off, off, p
r, off), (p
r, off, t
r, off, off), the set of gained transition
Step 2, to adding counter operating part, change:
When reset terminal is high level, no matter what state input end is, add counter O reset;
Create a control places S
3represent that cleared condition, corresponding input end register have three kinds of situations to make to add counter and enter cleared condition: three kinds of states of input end register are respectively low level state, rising edge state, high level state, the corresponding transition of each state are respectively: t
c, on, off, t
c, on, rise, t
c, on, on;
Add control places S
2point to transition t
c, on, off, t
c, on, rise, t
c, on, ondirected arc; Add the p of storehouse institute
r, onpoint to transition t
c, on, off, t
c, on, rise, t
c, on, ontwo-way arc; Add the p of storehouse institute
i, offpoint to transition t
c, on, offtwo-way arc; Add storehouse institute
pi, risepoint to transition t
c, on, risedirected arc; Add the p of storehouse institute
i, on, onpoint to transition t
c, on, ondirected arc; Add transition t
c, on, off, t
c, on, rise, t
c, on, onpoint to the S of storehouse institute
3directed arc;
Create a control places S
4represent disarmed state, have two states not exert an influence to the current output state that adds counter, use transition t
c, null, 1expression input end is that high level, reset terminal are low level; Use transition t
c, null, 2expression input end is that low level, reset terminal are low level;
Add the p of storehouse institute
i, on, onpoint to transition t
c, null, 1directed arc; Add the p of storehouse institute
i, offpoint to transition t
c, null, 2two-way arc; Add the p of storehouse institute
r, offpoint to transition t
c, null, 1, t
c, null, 2two-way arc; Add control places S
2point to transition t
c, null, 1, t
c, null, 2directed arc; Add transition t
c, null, 1,
tc, null, 2point to control places S
4directed arc; The control places set of gained:
S
c={ S
3, S
4, transition set T
c={ t
c, on, off, t
c, on, riset
c, on, on, t
c, null, 1, t
c, null, 2, directed arc set
Wherein:
Step 2.1 will add counter currency register and be modeled as two pairs of storehouse institutes
pc, ctu, max,
pc, ctu, now, storehouse institute wherein
pc, ctu, maxrepresent to add the maximal value that counter can be counted; Storehouse institute
pc, ctu, nowrepresent to add counter currency; When adding counter, meet while adding 1 state, from storehouse institute
pc, ctu, maxtake out a holder and agree be put into storehouse institute
pc, ctu, nowin, if storehouse institute
pc, ctu, nowin holder agree number and be more than or equal to while adding counter preset value PV, add counter output high level, the storehouse of gained is gathered and is
Step 2.2 is by the p of storehouse institute
c, ctu, maxtake out a holder and agree be put into the p of storehouse institute
c, ctu, nowprocess simulation be transition t
ctu, max, now, and transition excite satisfied condition to have three: input sample finishes and in reset mode, input end, is not or not rising edge state, reset terminal end are low level state;
Add the p of storehouse institute
c, ctu, maxpoint to transition t
ctu, max, nowdirected arc; Add transition t
ctu, max, nowpoint to the p of storehouse institute
c, ctu, nowdirected arc; Add control places S
2point to transition t
ctu, max, nowdirected arc; Add the p of storehouse institute
i, risepoint to transition t
ctu, max, nowdirected arc; Add the p of storehouse institute
r, offpoint to transition t
ctu, max, nowtwo-way arc; The transition set of gained
Directed arc set:
Step 2.3 adds should judge after counter often adds once that whether add counter currency is more than or equal to and adds counter preset value PV, creates a control places S
5represent that adding counter often adds state once, control places S
5also represent that current period adds rolling counters forward complete, add transition t
ctu, max, nowpoint to control places S
5directed arc, directed arc set
Control places set:
Step 2.4 is by the p of storehouse institute
c, ctu, nowinterior holder agree all take out and put into the p of storehouse institute
c, ctu, maxinterior process is called and adds counter O reset process, is modeled as transition t
ctu, now, max; Transition t
ctu, now, maxexcite a holder of taking-up to agree put into the p of storehouse institute at every turn
c, ctu, maxin, if the initial storehouse p of institute
c, ctu, nowinside there are a plurality of holders to agree, transition t
ctu, now, maxoccur repeatedly; Transition t
ctu, now, maxcondition is to add counter in cleared condition, adds control places S
3point to transition t
ctu, now, maxtwo-way arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
ctu, now, maxdirected arc; Add transition t
ctu, now, maxpoint to the p of storehouse institute
c, ctu, maxdirected arc; Create a transition t
ctu, now, nullthe judgement p of storehouse institute
c, ctu, nowinterior not holder is agree; Add and control S
3point to transition t
ctu, now, nulldirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
ctu, now, nulltwo-way arc and weights be to add the maximal value PvMax that counter can be counted;
The transition set of gained
Directed arc set
Wherein
F
now,max={(S
3,t
ctu,now,max),(p
c,ctu,now,t
ctu,now,max),(t
ctu,now,max,S
3),(t
ctu,now,max,p
c,ctu,max)};
F
now,null={(S
3,t
ctu,now,null),(p
c,ctu,max,t
ctu,now,null),(t
ctu,now,null,p
c,ctu,max)};
Step 2.5 adds counter internal library and gathers
transition set
Directed arc set
Step 3, the output that adds counter is converted to Petri net:
Add counter and can only export high level or low level, this two states is modeled as to the p of storehouse institute
o, ctu, on, p
o, ctu, off, storehouse collects
The combinations of states of input end and reset terminal is divided into three kinds: reset mode, count status, do not affect the state that adds counter currency;
Step 3.1, when adding counter in reset mode, is output as low level, transition t
ctu, now, nullthe judgement p of storehouse institute
c, ctu, nowinterior not holder is agree, and output terminal output low level, adds transition t
ctu, now, nullpoint to the p of storehouse institute
o, ctu, offdirected arc, the set of gained directed arc
Step 3.2 is after adding rolling counters forward and finishing and arrive and add counter preset value PV, now adds counter output high level, and this situation is modeled as to transition t
o, ctu, pv, add control places S
5point to transition t
o, ctu, pvdirected arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, pvtwo-way arc and weights for adding counter preset value PV; Output terminal output high level, adds transition t
o, ctu, pvpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
Directed arc set:
Step 3.3 does not reach and adds counter preset value PV after adding rolling counters forward and finishing, and now adds counter output low level, and this situation is modeled as to transition t
o, ctu, lpv, add control places S
5point to t
o, ctu, lpvdirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
o, ctu, lpvtwo-way arc and weights be PvMax-PV+1; Due to output terminal output low level, so add transition t
o, ctu, lpvpoint to the p of storehouse institute
o, ctu, offdirected arc, gained transition set
directed arc set:
Step 3.4 is not after adding counter input sample when affecting the state that adds counter currency, and the Output rusults of current period is identical with a upper cycle, and both of these case is modeled as to transition t
o, ctu, on, t
o, ctu, off, transition t wherein
o, ctu, onrepresent upper cycle output high level; Transition t
o, ctu, offrepresent a upper cycle output low level, control places S
4just represent to add counter in this state, the p of library representation institute when a upper cycle is low level
c, ctu, maxinterior holder is agree number for PvMax-PV+1, so interpolation control places S
4point to transition t
o, ctu, offdirected arc; Add the p of storehouse institute
c, ctu, maxpoint to transition t
o, ctu, offtwo-way arc and weights be PvMax-PV+1; Add transition t
o, ctu, offpoint to the p of storehouse institute
o, ctu, offdirected arc, as the p of storehouse institute
c, ctu, nowinterior holder agree count to be more than or equal to add counter preset value PV, represents upper cycle output high level, so add control places S
4point to transition t
o, ctu, ondirected arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, ontwo-way arc and weights for adding counter preset value PV; Add transition t
o, ctu, onpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
directed arc set:
Step 3.5 is when adding counter when the last cycle has count down to maximal value, and current period adds counter and still meets counting condition, now adds counter and does not carry out work and output state and remain high level, and this situation is modeled as to transition t
o, ctu, full, add control places S
2point to transition t
o, ctu, fulldirected arc; Add the p of storehouse institute
i, risepoint to transition t
o, ctu, fulldirected arc; Add the p of storehouse institute
r, offpoint to transition t
o, ctu, fulltwo-way arc; Add the p of storehouse institute
c, ctu, nowpoint to transition t
o, ctu, fulltwo-way arc and weights be PvMax; Add transition t
o, ctu, fullpoint to the p of storehouse institute
o, ctu, ondirected arc, gained transition set
the set of gained directed arc:
Step 4, output add the Petri pessimistic concurrency control of counter:
Add the Petri net storehouse collection of counter as P=P
ctu, i∪ P
ctu∪ P
ctu, o, transition set is T=T
ctu, i∪ T
ctu∪ T
ctu, o, directed arc set is F=F
ctu, i∪ F
ctu∪ F
ctu, o, obtain a common Petri net N
ctu:=(P, T; F) and preliminary examination sign m
0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310655001.5A CN103699048B (en) | 2013-12-06 | 2013-12-06 | A kind of method that PLC counter is converted to order Petri network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310655001.5A CN103699048B (en) | 2013-12-06 | 2013-12-06 | A kind of method that PLC counter is converted to order Petri network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103699048A true CN103699048A (en) | 2014-04-02 |
CN103699048B CN103699048B (en) | 2016-08-17 |
Family
ID=50360615
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310655001.5A Expired - Fee Related CN103699048B (en) | 2013-12-06 | 2013-12-06 | A kind of method that PLC counter is converted to order Petri network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103699048B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108681445A (en) * | 2018-04-16 | 2018-10-19 | 华中科技大学 | A kind of PLC program design method based on Timed Automata |
CN110794758A (en) * | 2018-08-03 | 2020-02-14 | 发那科株式会社 | Tracking device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010204737A (en) * | 2009-02-27 | 2010-09-16 | Fuji Electric Systems Co Ltd | Control system for programmable controller and control program execution method for programmable controller |
CN102411330A (en) * | 2011-08-25 | 2012-04-11 | 华侨大学 | Method for converting PLC program into common Petri net |
CN103019233A (en) * | 2012-12-21 | 2013-04-03 | 华侨大学 | Method for detecting whether race condition exists in PLC (programmable logic controller) ladder diagram program or not |
CN103092753A (en) * | 2012-12-29 | 2013-05-08 | 华侨大学 | Method for converting programmable logic controller (PLC) instruction list program into ordinary Petri network |
CN103092573A (en) * | 2013-01-16 | 2013-05-08 | 清华大学 | C program to register transfer level (RTL) comprehensive method of pipeline division and module parallel optimization |
-
2013
- 2013-12-06 CN CN201310655001.5A patent/CN103699048B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010204737A (en) * | 2009-02-27 | 2010-09-16 | Fuji Electric Systems Co Ltd | Control system for programmable controller and control program execution method for programmable controller |
CN102411330A (en) * | 2011-08-25 | 2012-04-11 | 华侨大学 | Method for converting PLC program into common Petri net |
CN103019233A (en) * | 2012-12-21 | 2013-04-03 | 华侨大学 | Method for detecting whether race condition exists in PLC (programmable logic controller) ladder diagram program or not |
CN103092753A (en) * | 2012-12-29 | 2013-05-08 | 华侨大学 | Method for converting programmable logic controller (PLC) instruction list program into ordinary Petri network |
CN103092573A (en) * | 2013-01-16 | 2013-05-08 | 清华大学 | C program to register transfer level (RTL) comprehensive method of pipeline division and module parallel optimization |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108681445A (en) * | 2018-04-16 | 2018-10-19 | 华中科技大学 | A kind of PLC program design method based on Timed Automata |
CN108681445B (en) * | 2018-04-16 | 2020-07-24 | 华中科技大学 | P L C program design method based on time automaton |
CN110794758A (en) * | 2018-08-03 | 2020-02-14 | 发那科株式会社 | Tracking device |
CN110794758B (en) * | 2018-08-03 | 2023-06-02 | 发那科株式会社 | Tracking device |
Also Published As
Publication number | Publication date |
---|---|
CN103699048B (en) | 2016-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102411330B (en) | Method for converting PLC program into common Petri net | |
US11720730B2 (en) | Method for configuring a co-simulation for a total system | |
EP2745380B1 (en) | Diagnosis of communication based on the goose protocol | |
CN109918805A (en) | A kind of member impacts analysis method, device and equipment based on BIM model | |
CN104615071A (en) | PLC (programmable logic controller) programming method for automatic stereoscopic warehouse system based on Petri net | |
CN103699048A (en) | Method for converting PLC (Programmable Logic Controller) up-counter to sequence Petri net | |
Santiago et al. | A practical approach for automated test case generation using statecharts | |
US20110301725A1 (en) | Synchronization of execution of sequential function charts using transition groups | |
CN108959058B (en) | Configuration debugger implementation method of virtual controller | |
Sacha | Automatic code generation for PLC controllers | |
CN103064300B (en) | The autonomous interpretation treating apparatus of satellite closed cycle test macro data and disposal route thereof | |
CN103093046B (en) | A kind of method FPGA Hardware Description Language VHDL being converted into ordinary Petri net | |
CN104267936A (en) | Semantic tree based asynchronous dynamic push-down network reachability analysis method | |
KR20130079046A (en) | A simulation system of communication between hmi simulator and plc simulator | |
CN110611312A (en) | On-line simulation system and method for panoramic data of substation bay level | |
CN103092753B (en) | A kind of method PLC instruction catalogue program being converted to ordinary Petri net | |
CN103761387A (en) | Formal verification method for sequencing specification of FPGA (field programmable gate array) combinatorial logic system | |
Shoaei et al. | Automatic generation of controllers for collision-free flexible manufacturing systems | |
CN111709138B (en) | CPS space-time property oriented hybrid AADL modeling and model conversion method | |
CN104380115A (en) | Pipetting robot | |
CN103226503B (en) | A kind of module modeling automatic testing method integrated with model inspection | |
Nozhenkova et al. | Creation of the base of a simulation model’s precedents for analysis of the spacecraft onboard equipment testing results | |
Krzywicki et al. | SoC research and development platform for distributed embedded systems | |
Colombo et al. | Petri nets for designing manufacturing systems | |
Signoret | Dependability & safety modeling and calculation: Petri nets |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160817 |