JPH0385604A - Method and device for determining arithmetic operation order for ladder diagram input part - Google Patents
Method and device for determining arithmetic operation order for ladder diagram input partInfo
- Publication number
- JPH0385604A JPH0385604A JP22401589A JP22401589A JPH0385604A JP H0385604 A JPH0385604 A JP H0385604A JP 22401589 A JP22401589 A JP 22401589A JP 22401589 A JP22401589 A JP 22401589A JP H0385604 A JPH0385604 A JP H0385604A
- Authority
- JP
- Japan
- Prior art keywords
- vertex
- ladder diagram
- state
- logical value
- logical
- 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
Links
- 238000010586 diagram Methods 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 title claims description 37
- 230000005540 biological transmission Effects 0.000 claims description 9
- 125000004122 cyclic group Chemical group 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 239000002253 acid Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001343 mnemonic effect Effects 0.000 description 1
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、ラダー図によってプログラム可能なシーケン
ス制御装置において、演算を高速化するために最適な処
理順序を決定するようにしたラダー図入力部の演算順序
決定方法及びその装置に関する。Detailed Description of the Invention (Industrial Application Field) The present invention provides a ladder diagram input unit that determines an optimal processing order to speed up calculations in a sequence control device that can be programmed using a ladder diagram. The present invention relates to a method for determining the order of operations and an apparatus therefor.
(従来の技術)
従来、ラダー図によってプログラム可能なシケンスコン
トローラ内の演算装置における制御方法は、大別すると
次の2つの制御方法に分類できる。先ず第1の制御方法
は、プール代数式を“’LOAD” 、 ”AND
” 、 ”OR” 、 ”5TORE ”等のニー
モニック命令を用いてボーランド技法によってその実行
演算を制御する方法である。また第2の制御方法は、特
開昭57−705号公報に開示されている如くラダー図
をスイッチマトリクスに対応させ、列サイクリック演算
によってラダー図入力部の最終列における論理値を求め
る方法である。(Prior Art) Conventionally, control methods for an arithmetic unit in a sequence controller that can be programmed using a ladder diagram can be broadly classified into the following two control methods. First, the first control method is to input the pool algebraic expression by "LOAD", "AND"
This method uses mnemonic commands such as ``, ``OR'', and ``5TORE'' to control the execution operations using the Borland technique.A second control method is disclosed in Japanese Patent Laid-Open No. 1987-705. In this method, a ladder diagram is made to correspond to a switch matrix, and the logical value in the last column of the ladder diagram input section is obtained by column cyclic calculation.
(発明が解決しようとする課題)
ところが、上述した従来のボーランド技法による制御方
法においては、演算結果を得るためには”LOAD”か
ら始まり’5TORE”°によって終了する一連の二−
モニック演算を全て実行しなくてはならなかった。つま
り、第11図は第5図に示すラダー図をボーランド技法
による命令群に対応させた一例であるが、仮に第5図に
おいて接点a及び接点dが導通状態にあった場合、接点
a及び接点dの状態を調べて直ちにその結果を出力する
ことができれば、それ以外の余分な演算は省略できる。(Problem to be Solved by the Invention) However, in the control method using the conventional Borland technique described above, in order to obtain the calculation result, a series of two steps starting from "LOAD" and ending with '5TORE'° are required.
All monic operations had to be performed. In other words, FIG. 11 is an example in which the ladder diagram shown in FIG. 5 corresponds to a command group using the Borland technique. If the state of d can be checked and the result can be output immediately, other unnecessary operations can be omitted.
ところが、ボーランド技法による制御方法においては、
このような演算の省略による実行速度の高速化について
は考慮されていなかった。However, in the control method using the Borland technique,
No consideration was given to increasing the execution speed by omitting such operations.
一方、列サイクリック演算による制御方法においても、
演算結果を得るためには、ラダー図をその各行1列の接
点部情報1分岐部情報が指定可能なスイッチマトリック
スに対応させ、各行1列において接点部情報に関する演
算と分岐部情報に関する演算を交互に実行していかなく
てはらなかった。即ち、この方式においても、出力結果
を得ることができるのはすべての演算が終了してからで
あった。例えば、第12図は第5図におけるラダー図を
スイッチマトリックスに対応させた例である。ここで、
垂直接続線上に置かれたスイッチは分岐部情報に対応し
、水平接続線上に置かれたスイッチは接続部情報に対応
している。On the other hand, in the control method using column cyclic operations,
In order to obtain calculation results, the ladder diagram is made to correspond to a switch matrix in which each row and column of contact information and one branch information can be specified, and calculations related to contact information and calculations related to branch information are alternately performed in each row and column. I had to carry out the following steps. That is, even in this method, the output result could be obtained only after all calculations were completed. For example, FIG. 12 is an example in which the ladder diagram in FIG. 5 is made to correspond to a switch matrix. here,
Switches placed on vertical connection lines correspond to branch information, and switches placed on horizontal connection lines correspond to connection information.
以上のように、ボーランド技法による制御方法及び列サ
イクリック?rii′sによる制御方法のいずれにおい
ても、演算に要する時間は主としてその制御形態(ハー
ドウェア)によって決まってしまい、同し制御形態(ハ
ードウェア)を取る限りそれ以上の演算の高速化が困難
であるという問題点があった。As mentioned above, the control method using the Borland technique and the column cyclic? In any of the control methods using rii's, the time required for calculation is mainly determined by the control form (hardware), and as long as the same control form (hardware) is used, it is difficult to further speed up the calculation. There was a problem.
本発明は上述のような事情から成されたものであり、本
発明の目的は、最も高速に演算結果が求まりその出力処
理を行なうことができるIA処理順序決定することが可
能なラダー図入力部の演算順序決定方法及びその装置を
提供することにある。The present invention has been made in view of the above-mentioned circumstances, and an object of the present invention is to provide a ladder diagram input unit capable of determining the IA processing order so that calculation results can be obtained at the fastest speed and output processing can be performed. An object of the present invention is to provide a method and device for determining the order of operations.
(課題を解決するための手段)
本発明は、ラダー図によってプログラム可能なシーケン
ス制御装置において、演算を高速化するために最適な処
理順序を決定するようにしたラダー図入力部の演算順序
決定方法及びその装置に関するものであり、本発明の上
記目的は、プログラム内容を表わすラダー図の垂直接続
線並びに入力部及び出力部の境界線と前記ラダー図の水
平接続線との交わりをオン/オフの情報を持つ頂点に、
前記水平接続線を左から右へのみ前記オン/オフの情報
が伝達される有向辺に、前記水平接続線上のa接点及び
b接点を前記有向辺上に置かれた前記オン/オフの情報
の伝達を制御するゲートにそれぞれ対応させることによ
り前記ラダー図を有向グラフに変換し、最も左側の垂直
接続である母線に対応した頂点と前記境界線に対応した
頂点との間において情報が伝達される可能性のあるすべ
ての通路を抽出して処理の複雑さに対応した重み付けを
行ない、前記母線に対応した頂点にはオンの状態、それ
以外の頂点にはオフの状態を初期状態として設定してお
き、前記ゲートが導通状態の場合には対応する流出する
側の頂点の情報を流入する側の頂点に伝達するという処
理を1つの通路内のすへてのゲートについて繰返して当
該通路の伝達状態を求めるという処理を重みの少ない前
記通路から順に行なうことにより、前記入力部及び出力
部の境界線に対応する頂点がオンの状態であるか否かを
求めることによって達成される。また、実行オブジェク
トが格納される格納手段と、発信及び受信頂点の論理値
が格納される頂点論理値格納手段と、有向辺上の接点の
論理値が格納される接点論理値格納手段と、前記頂点論
理値格納手段に格納された前記発信頂点の論理値と前記
接点論理値格納手段に格納された対応する前記有向辺上
の接点の論理値とに基づいて論理演算を行ない受信頂点
の論理値を求める頂点間演算手段と、全体の演算制御を
行なう制御手段とを備えることによって達成される。(Means for Solving the Problems) The present invention provides a method for determining the operation order of a ladder diagram input unit in a sequence control device that can be programmed using a ladder diagram, in which an optimal processing order is determined in order to speed up the calculations. The above-mentioned object of the present invention is to turn on/off the intersection of the vertical connection line of a ladder diagram representing program contents and the boundary line of the input section and output section with the horizontal connection line of the ladder diagram. At the top with information,
The on/off information is transmitted only from left to right on the horizontal connection line, and the a contact and the b contact on the horizontal connection line are placed on the directed side of the on/off information. The ladder diagram is converted into a directed graph by corresponding to the gates that control the transmission of information, and information is transmitted between the vertices corresponding to the bus line, which is the leftmost vertical connection, and the vertices corresponding to the boundary line. All possible paths are extracted and weighted according to the complexity of the process, and the initial state is set to the on state for the vertices corresponding to the generatrix, and the off state for the other vertices. Then, when the gate is in a conductive state, the process of transmitting the information of the corresponding outflow side vertex to the inflow side vertex is repeated for all the gates in one passage to complete the transmission of the passage. This is achieved by determining whether the vertex corresponding to the boundary line between the input section and the output section is in the on state by performing the process of determining the state in order from the path with the least weight. Further, a storage means in which the execution object is stored, a vertex logical value storage means in which the logical values of the sending and receiving vertices are stored, and a contact logical value storage means in which the logical values of the contacts on the directed edges are stored, A logical operation is performed based on the logical value of the transmitting vertex stored in the vertex logical value storage means and the logical value of the corresponding contact point on the directed edge stored in the contact logical value storage means to determine the value of the receiving vertex. This is achieved by providing inter-vertex calculation means for calculating logical values and control means for controlling the entire calculation.
(作用)
本発明にあっては、ラダー図を有向グラフに変換し、有
向グラフのオンの状態にある頂点からラダー図出力部と
結合される頂点に至る通路の中て最も演算実行時間の短
い通路から優先的に演算を実行することにより、不要な
演算を省略できるので回路演算をより高速に実行できる
。(Operation) The present invention converts a ladder diagram into a directed graph, and starts from the path with the shortest calculation execution time among the paths from the turned-on vertex of the directed graph to the vertex connected to the ladder diagram output part. By performing calculations preferentially, unnecessary calculations can be omitted, so circuit calculations can be performed faster.
(実施例)
以下、図面に基づいて本発明の実施例について詳細に説
明する。(Example) Hereinafter, an example of the present invention will be described in detail based on the drawings.
先ず、ラダー図を有向グラフに対応させる操作を具体例
を挙げて説明する。ここで、グラフとは複数の区別でき
る点または頂点とそれらの間を結ぶ辺とから構成された
図形の総称であり、有向グラフとは方向性を有する辺を
持つグラフのことをいう。First, the operation of making a ladder diagram correspond to a directed graph will be explained using a specific example. Here, a graph is a general term for a figure that is composed of a plurality of distinguishable points or vertices and edges connecting them, and a directed graph is a graph that has edges that have directionality.
第5図はラダー図゛の一例であり、このラダー図におい
ては垂直接続線を左から順O2■、■と番号を付けしで
ある。ラダー図入力部とラダー図出力部の境界がラダー
図の水平接続線と交わる点を便宜上の頂点と想定し、ラ
ダー図出力部と結合される頂点と呼ぶ。同図におけるラ
ダー図では、■の番号を付けた垂直接続線がラダー図出
力部と結合される頂点を兼ねている。ここで、ラダー図
入力部とは接点情報を水平、垂直の接続線によって結ん
で論理演算を実行する部分であり、接点情報としてはa
接点、b接点の論理値であるが、算術演算等の中で結果
が論理値で表わされるものをa接点、b接点の代りに直
接組込むことも考えられる。また、ラダー図出力部とは
、ラダー図入力部の演算結果に基づいて論理値の出力や
タイマ、カウンタあるいはその他の応用命令の実行を行
なう部分である。FIG. 5 is an example of a ladder diagram. In this ladder diagram, vertical connection lines are numbered O2■, ■ from the left. For convenience, the point where the boundary between the ladder diagram input section and the ladder diagram output section intersects with the horizontal connection line of the ladder diagram is assumed to be a vertex, and is called the vertex connected to the ladder diagram output section. In the ladder diagram shown in the same figure, the vertical connection lines numbered ■ also serve as vertices connected to the ladder diagram output section. Here, the ladder diagram input section is a section that connects contact information using horizontal and vertical connection lines to perform logical operations, and the contact information includes a
Regarding the logical values of the contacts and the b contacts, it is also conceivable to directly incorporate those whose results are expressed as logical values in arithmetic operations etc. instead of the a and b contacts. Further, the ladder diagram output section is a section that outputs a logical value and executes a timer, a counter, or other application instructions based on the calculation result of the ladder diagram input section.
第5図の例においては、a接点、b接点と水平接続線の
組合わせによる水平方向の接続は、左側の垂直接続線か
ら右側の垂直接続線への接続に限られている。しがたっ
て、垂直接続線を線分として捉えるよりもむしろ点と捉
えた方がより木質的な捉え方ができる。In the example of FIG. 5, the horizontal connection by the combination of the a contact, the b contact, and the horizontal connection line is limited to the connection from the left vertical connection line to the right vertical connection line. Therefore, rather than thinking of vertical connecting lines as line segments, it is better to think of them as points in a more wood-like way.
上述した趣旨に基づいて第5図のラダー図入力部におり
る垂直接続線を点(頂点)として捉え直したものが第6
図である。ここて、水平方向の接続線は曲線となってい
る。ところで、この水平方向の接続線を有向辺として捉
えると全体で有向グラフを形成することになるが、その
ままではラダー図との対応が不十分であるので以下の2
つの要件(八)及び(B)を付加する。Based on the above-mentioned purpose, the vertical connection line that enters the ladder diagram input section in Figure 5 is reconsidered as a point (vertex) in Figure 6.
It is a diagram. Here, the horizontal connection line is a curved line. By the way, if we consider this horizontal connection line as a directed edge, the whole will form a directed graph, but as it is, the correspondence with the ladder diagram is insufficient, so we will use the following two methods.
Add requirements (8) and (B).
(八)グラフの頂点はオンまたはオフの状態を取り、オ
ンの状態は論理値” 1 ”とし、オフの状態は論理値
゛0′′とする。(8) The vertices of the graph can be in an on or off state, with an on state having a logical value of "1" and an off state having a logical value of "0".
(B) a接点及びb接点は、頂点から頂点を結ぶ有
向辺上に置かれ情報の流れを制御するゲートの働きをす
る。(B) The a-contact and the b-contact are placed on directed edges connecting vertices and function as gates that control the flow of information.
以上の2つの要件(八)及び(B)を加えることにより
、第5図のラダー図入力部は第6図の有向グラフとその
機能において1対1に対応する。By adding the above two requirements (8) and (B), the ladder diagram input section of FIG. 5 has a one-to-one correspondence with the directed graph of FIG. 6 in terms of its functions.
上述のようにして第6図に示す有向グラフに移行された
ラダー図において、先ず頂点のオン又はオフの状態を一
時記憶しておくエリア(後述する第2図における頂点論
理値−時記憶部2に相当)を設り、母線に対応する頂点
のにのみオンの状態として論理値゛11を設定し、それ
以外の頂点の、■にはオフの状態として論理値゛0°′
を設定する。このような設定の後、2つの頂点間の演算
を第7図における(()Q−ゆ又は(ロ)〆
O+■−@あるいは(ハ)■−4→■−ゆの順番で繰返
す。この結果、頂点Oにおける論理値” 1 ”が頂点
■に伝達されれば頂点■は論理値°°1°′となり、論
理値” 1 ”が頂点■に伝達されなければ頂点■は論
理値” o ”となるので、それをラダー図入力部の演
算結果としてラダー図出力部において出力処理を行なう
。In the ladder diagram transferred to the directed graph shown in FIG. 6 as described above, first, an area for temporarily storing the on or off state of the vertex (vertex logical value-time storage unit 2 in FIG. 2, which will be described later) is created. ), and set the logical value ``11'' to indicate that only the vertex corresponding to the bus line is on, and set the logical value ``0°'' to indicate that the other vertices are in the off state.
Set. After such settings, the calculation between the two vertices is repeated in the order of (()Q-Y or (B)〆O+■-@ or (C)■-4→■-Y in Fig. 7. As a result, if the logical value "1" at the vertex O is transmitted to the vertex ■, the vertex ■ becomes the logical value °°1°', and if the logical value "1" is not transmitted to the vertex ■, the vertex ■ becomes the logical value "o" ”, so it is outputted in the ladder diagram output unit as the calculation result of the ladder diagram input unit.
第7図は、第6図における有向グラフを、頂点Oから頂
点■に至るまて選択し得る通路(イ)(0) 、 (
ハ)の3通りに分割して別々に記述したものである。こ
こで、通路とはグラフ上を辺または頂点を通っである頂
点から別の頂点まで辿って行くことのできる径路のこと
であり、2つの頂点間が複数の辺によって結ばれている
場合、辺ごとに別々の通路として区別をする。例えば、
第7図においては、頂点間o−〇における2つの有向辺
φ
を(o) (D−ユ、 (A) Q−’−@とじて区
別している。FIG. 7 shows the paths (A) (0), (
It is divided into three ways (c) and described separately. Here, a path is a path that can be followed from one vertex to another through an edge or a vertex on a graph, and if two vertices are connected by multiple edges, Each section is distinguished as a separate passage. for example,
In FIG. 7, two directed edges φ between vertices o−〇 are distinguished as (o) (D−U, (A) Q−′−@).
ところで、第7図における3通りの通路(イ)。By the way, there are three paths (a) in Fig. 7.
(ロ)、(ハ)を全て演算した後に頂点■の論理値を出
力処理すると実行オブジェクトのIA処理速度低下して
しまうので、例えば通路(イ)だけが論理値°゛1°′
を伝達してそれ以外の通路(0) 、 (ハ)は論理
値“O°′を伝達する場合、通路(イ)が論理値” t
”を伝達したことが判明した時点で、その他の通路(
ロ)、(ハ)における演算を省略して速ちに出力処理を
行なう。つまり、通路(() 、 (ロ)、(ハ)の
うちどれか1つが論理値” 1 ”を伝達したことが判
明した時点で直ちに出力処理を行なうことにより、実行
オブジェクトの処理速度を向上させる。If the logical value of the vertex ■ is output after calculating all of (b) and (c), the IA processing speed of the execution object will decrease, so for example, only the path (a) has a logical value °゛1°′
If the other paths (0) and (c) transmit the logical value "O°', the path (a) is the logical value" t
” as soon as it is determined that the
The calculations in (b) and (c) are omitted and output processing is performed quickly. In other words, the processing speed of the execution object is improved by performing output processing immediately when it is determined that one of the paths ((), (b), and (c) has transmitted the logical value "1". .
また、そのとき母線に対応する頂点からラダー図出力部
と結合される頂点に至る複数の通路のうちで、論理値の
伝達を演算するために必要とする時間の最短のものから
順番に論理値の伝達を演算する方法を取る。即ち、統計
的に考えた場合、全ての通路において論理値゛1゛を伝
達する確率と論理値” o ”を伝達する確率が一定で
あるとみなすことができるので、演算に要する時間の最
短のものから順番に論理値の伝達を演算することにより
実行オブジェクトの処理速度が更に向上する。At that time, among the multiple paths from the vertex corresponding to the bus line to the vertex connected to the ladder diagram output section, the logical values are sequentially selected starting from the path that requires the shortest time to calculate the transmission of the logical value. We take a method that calculates the transmission of . In other words, when considered statistically, the probability of transmitting the logical value "1" and the probability of transmitting the logical value "o" can be considered to be constant in all paths, so the shortest time required for the calculation is By calculating the transmission of logical values in order, the processing speed of the execution object is further improved.
第8図は、第7図における通路(() 、 IO)。FIG. 8 shows the passage ((), IO) in FIG. 7.
(ハ)のそれぞれが論理値を伝達するにあたって、下記
(■)〜(■旧の演算操作を実行する際の重み付けとし
てそれぞれl/2を掛Cづて(イ)、(ロ)。When each of (C) transmits a logical value, the following (■) to (■) are each multiplied by l/2 as weighting when executing the old arithmetic operations (A) and (B).
(ハ)の各通路の演算に必要な重みの合計を求めたもの
である。The sum of the weights required for the calculation of each path in (c) is calculated.
(1)有向辺へ流出する側の頂点の0N10FF状態を
読出す操作
(I+ )有向辺上に置かれたa接点又はb接点の論理
値と接点の左側の有向辺の論理値の論理和を取り、接点
の右側の有向辺の論理値として設定する操作
(m )有向辺上における論理値演算(I+ )が終了
した時点における論理値を有向辺か流入する例の頂点に
設定する操作
ここで、重みとは複数の通路の内から最短の実行時間で
論理値の伝達を演算することのできる通路を選択するた
めに付ける便宜上のパラメータのことであり、個別の演
算(1)、(o)、(m)のそれぞれの実行時間に比例
した数値をとる。(1) Operation to read the 0N10FF state of the vertex on the side flowing to the directed side (I+) The logical value of the a contact or b contact placed on the directed side and the logical value of the directed side to the left of the contact Operation (m) that takes the logical sum and sets it as the logical value of the directed edge on the right side of the contact point. Vertex of the example where the logical value at the time when the logical value operation (I+) on the directed edge is completed is input from the directed edge Here, the weight is a convenient parameter attached to select the path that can perform the logical value transmission in the shortest execution time from among multiple paths, and 1), (o), and (m), take numerical values proportional to their respective execution times.
上述したような演算に対する重み(t fづという概念
を用いて頂点間の演算順序を決定する手段を以下に説明
する。A means for determining the order of operations between vertices using the concept of weights (tf) for operations as described above will be described below.
第1図は頂点間の演算順序を決定する際のフローチャー
トであり、ラダー図に対応した有向グラフ上の全ての有
向辺について導通/非導通の状態をそれぞれ仮定するこ
とにより、有向グラフが取り得るあらゆる状態をシミュ
レートし、ある状態において取り得る通路のうちで重み
が最少の通路を常に選択するように演算順序を決定する
。Figure 1 is a flowchart for determining the order of operations between vertices. By assuming conductive/non-conductive states for all directed edges on the directed graph corresponding to the ladder diagram, we can The state is simulated, and the order of operations is determined so that the path with the least weight among the possible paths in a certain state is always selected.
即ち、先ず初期設定として有向グラフ上の全頂点をオフ
にしくステップSl)、ラダー図上の母線に対応する頂
点である頂点Oのみをオンにして(ステップS2)、サ
ブルーチン゛’5UBI”を呼出す(ステップS3)。That is, first, as an initial setting, all vertices on the directed graph are turned off (step S1), only vertex O, which is the vertex corresponding to the generatrix on the ladder diagram, is turned on (step S2), and the subroutine '5UBI' is called ( Step S3).
サブルーチン゛5UBI”においては、先ず不用頂点及
び不用有向辺の削除を行なう(ステップ54)。ここで
、不用頂点とは、例えばある頂点[相]から流出する有
向辺が流入する側の頂点がずへてオンの状態をとるよう
な場合、頂点[相]から流出する有向辺を通る通路を調
べることは無意味であり、また逆にある頂点@に流入す
る有向辺によって伝達された状態がすべてオフの状態で
あれば、頂点@から流出する有向辺はオ・フの状態しか
伝えることがないために演算を行なうことが無意味であ
るような頂点[相]、■をいう。不用頂点に流入又は流
出する有向辺はすべて不用有向辺であるし、オンの状態
の頂点間を結ぶ有向辺も不用有向辺である。このように
して不用な部分を省略した残りの有向グラフにおいて、
オンの状態を持つ頂点からラダー図出力部と結合される
頂点に至る通路をすべて求めてそれぞれの通路の重み付
けを行ない(ステップ55)。それらの通路の内から最
少重みの通路を選び出す(ステップS6)。次に、選び
出した最少重み通路における発信頂点。In the subroutine "5UBI", first, unnecessary vertices and unnecessary directed edges are deleted (step 54). Here, an unnecessary vertex is, for example, a vertex on the side into which a directed edge flowing out from a certain vertex [phase] flows. In such a case, it is meaningless to investigate the path through the directed edge flowing out from the vertex [phase], and conversely, the path transmitted by the directed edge flowing into a certain vertex @ is meaningless. If all the states of All directed edges that flow into or out of unnecessary vertices are unnecessary directed edges, and directed edges that connect between vertices in the on state are also unnecessary directed edges.In this way, unnecessary parts are omitted. In the remaining directed graph,
All paths from a vertex having an on state to a vertex connected to the ladder diagram output section are determined and each path is weighted (step 55). The path with the least weight is selected from among these paths (step S6). Next, the outgoing vertices in the selected least weight path.
受信頂点及びそれらを結ぶ有効辺を決定する(ステップ
57)。ここで、発信頂点は通路上でオンの状態を持つ
頂点、受信頂点は発信頂点から流出する有向辺の流入す
る頂点、有向辺は発信頂点から受信頂点への辺である。The received vertices and the effective edges connecting them are determined (step 57). Here, the transmitting vertex is the vertex that has an on state on the path, the receiving vertex is the vertex into which the directed edge flowing out from the transmitting vertex flows, and the directed edge is the edge from the transmitting vertex to the receiving vertex.
即ち、例えば最少重み通路として第7図における(口)
が選はれた場合、発信頂点Oは受信頂点は■、有有向酸
」鴇と なる。That is, for example, as the minimum weight path (mouth) in FIG.
If is selected, the sending vertex O and the receiving vertex become ■, a directed acid.
以上のステップ54〜ステツプS7を経て選び出された
発信頂点、受信頂点及び有向辺について、有向辺が導通
状態にあると仮定すると受信頂点はオンの状態を有しく
ステップS9)、有向辺が非導通状態にあると仮定する
と受信頂点はオフの状態を有する(ステップ511)。Regarding the transmitting vertex, the receiving vertex, and the directed edge selected through the above steps 54 to S7, assuming that the directed edge is in a conductive state, the receiving vertex has an on state. Assuming that the edge is in a non-conducting state, the receiving vertex has an off state (step 511).
ステップS9及びステップSllのそれぞれの仮定のも
とてサブルーチン″’5UBI”を再帰的に呼出す(ス
テップ510)ことにより、有向グラフが取り得るあら
ゆる状態をシミュレートし、ある状態において取り得る
通路のうちで重みが最少の通路を常に選択して演算順序
を決定することができる。By recursively calling the subroutine "'5UBI" based on the assumptions of step S9 and step Sll (step 510), all possible states of the directed graph are simulated, and one of the possible paths in a certain state is simulated. The operation order can be determined by always selecting the path with the least weight.
尚、ステップS8における出力IA埋の演算とは、発信
頂点としてラダー図出力部と結合される頂点しかない場
合、即ちラダー図出力部と結合される頂点がオンの状態
である場合か、あるいはラダー図出力部と結合される頂
点への通路がない場合、即ちラダー図出力部と結合され
る頂点がオフの状態しか取り得ないことが判明した場合
に、その結果をラダー図出力部において出力処理を行な
うための演算であり、ステップS5において判定するこ
とができる。Note that the output IA calculation in step S8 is performed when there is only a vertex to be connected to the ladder diagram output section as a transmission vertex, that is, when the vertex to be coupled to the ladder diagram output section is in an on state, or when the ladder diagram output section is in an ON state. When there is no path to the vertex that is connected to the diagram output section, that is, when it is found that the vertex that is connected to the ladder diagram output section can only be in the off state, the result is outputted in the ladder diagram output section. This is a calculation to be performed, and can be determined in step S5.
第9図は、第6図における有向グラフについて第1図の
フローチャートに基づいて頂点間演算の順序を2分枝木
の形式に書き出した例を示す図である。そこで、ステッ
プ521.S23.、S24.S27及び528におい
て頂点間演算を行ない、受信頂点がオンの状態をとれば
左の2分枝木、オフの状態をとれば右の2分枝木におけ
るステップの処理を実行し、出力処理のステップs22
.S2s、S2e、s29.s3o及び531における
処理を終了すると、第6図における有向グラフについて
の論理演算の結果が求まって次に有向グラフの論理演算
へと移ることができる。FIG. 9 is a diagram showing an example in which the order of operations between vertices for the directed graph in FIG. 6 is written out in the form of a two-branching tree based on the flowchart in FIG. 1. Therefore, step 521. S23. , S24. In S27 and 528, calculations between vertices are performed, and if the received vertex is on, the step in the left two-branching tree is executed, and if the received vertex is off, the step in the right two-branching tree is executed, and the output processing step is executed. s22
.. S2s, S2e, s29. When the processes at s3o and 531 are completed, the results of the logical operations on the digraph in FIG. 6 are obtained, and the next step can be carried out on the logical operations on the digraph.
ところが、第9図においては処理内容の重複するステッ
プが例えば出力処理のステップ522,525S26,
529,530及びS31のように存在している。この
出力処理のステップにおいては、第6図におけるラダー
図出力部と結合される頂点■のオン/オフ状態を第5図
におけるラダー図のコイル出力接点のアドレスgに書込
む操作が行なわれる。そこで、出力処理ステップS22
.S25,32B、S29,530及び531において
は全く同一の操作が行なわれるために、これらを1つに
まとめることができる。それは、ステップS24及びス
テップ528において不用頂点及び不用有向辺を除いた
有向グラフが全く同一のものとなることによる。However, in FIG. 9, steps with overlapping processing contents are, for example, steps 522, 525S26, and 525S26 of output processing.
529, 530 and S31. In this output processing step, an operation is performed to write the on/off state of the vertex (3) connected to the ladder diagram output section in FIG. 6 to the address g of the coil output contact in the ladder diagram in FIG. 5. Therefore, output processing step S22
.. Since exactly the same operations are performed in S25, 32B, S29, 530, and 531, these can be combined into one. This is because the directed graphs from which unnecessary vertices and unnecessary directed edges are removed in step S24 and step 528 become exactly the same.
このようにして、同一の有向グラフにおいて同一の操作
を行なうステップを1つにまとめて第9図を書き直した
ものが第1O図である。第1O図において、演算の重複
が避けられるためにシーケンスプログラムの実行オブジ
ェクトが必要以上に膨れ上ることはない。In this way, FIG. 1O is a rewrite of FIG. 9 by combining the steps of performing the same operation on the same directed graph into one. In FIG. 1O, since duplication of operations is avoided, the number of execution objects of the sequence program does not increase more than necessary.
本発明によるラダー図入力部の演算順序を決定するため
の方7去は、cpu (中央処理装置)のみによってソ
フトウェア的に実行するオブジェクトを作成する場合に
も、専用の演算回路を設けることによりハードウェアに
より実行するオブジェクトを作成する場合にも共に有効
である。The method 7 for determining the calculation order of the ladder diagram input section according to the present invention is also useful when creating an object that is executed in software only by a CPU (Central Processing Unit) by providing a dedicated calculation circuit. Both are effective when creating objects to be executed by software.
第2図は本発明における方法により作成された実行オブ
ジェクトをハードウェアで実現する場合のブロック図で
あり、第3図は第2図における頂点間演算部5の詳細回
路図であり、第4図は第3図におりる各信号の内容の説
明図である。FIG. 2 is a block diagram when the execution object created by the method of the present invention is realized in hardware, FIG. 3 is a detailed circuit diagram of the inter-vertex calculation unit 5 in FIG. 2, and FIG. 3 is an explanatory diagram of the contents of each signal in FIG. 3. FIG.
第2図のブロック図において、上述したような方法によ
り作成された実行オブジェクトがオブジェクトメモリ1
に格納され、CPII4がオブジェクトメモリ1からオ
ブジェクトを読出して演算を実行する。実行オブジェク
トにおける頂点間演算については、発信頂点の論理値を
頂点論理値−時記憶部2により読出して頂点間演算部5
に設定し、 0
また有向辺上の接点の論理値を接点論理値−時記憶部6
により読出して同様に頂点間演算部5に設定する。頂点
間演算部5は、それらに基づいて論理演算を行ない、そ
の結果の論理値を受信頂点の論理値として頂点論理値−
時記憶部2に設定し直す。またI10コンi・ロール部
3は、接点論理値−時記憶部6の内容に基づいて入出力
制御を行なう。In the block diagram of FIG. 2, the execution object created by the method described above is stored in object memory 1.
The CPII 4 reads the object from the object memory 1 and executes the calculation. For inter-vertex calculations in execution objects, the logical value of the originating vertex is read out by the vertex logical value-time storage unit 2 and the inter-vertex calculation unit 5
0, and set the logic value of the contact on the directed side to the contact logic value - time storage unit 6
is read out and similarly set in the inter-vertex calculation unit 5. The inter-vertex calculation unit 5 performs a logical operation based on these, and uses the resulting logical value as the logical value of the received vertex as the vertex logical value -
The settings are reset to the time storage unit 2. Further, the I10 control i/roll unit 3 performs input/output control based on the contents of the contact logic value-time storage unit 6.
次に、第3図における回路図の動作を説明する。図にお
いて、イネーブル(ENABLE)信号がオフのとき、
クロック(f;LOCK)信号のタイくングに合せて発
信頂点の論理値I10が信号線INを介してレジスタ1
1にセットされ、同時に有向辺上のa接点又はb接点の
論理値がレジスタ10にセットされる。ここで、a接点
又はb接点の数がレジスタlOの要素数よりも少ない場
合には、余ったレジスタには論理値°°1°°をセット
する。このようにした後、イネーブル信号をオンにする
とレジスタ10及びレジスタ11の論理内容は安定とな
るので、レジスタIO及びレジスタ11の全要素の論理
積を論理演算素子12により演算してその結果を信号線
OUTより取出すことができる。Next, the operation of the circuit diagram in FIG. 3 will be explained. In the figure, when the ENABLE signal is off,
In accordance with the timing of the clock (f; LOCK) signal, the logic value I10 of the transmitting vertex is sent to register 1 via the signal line IN.
1, and at the same time, the logical value of the a contact or b contact on the directed side is set in the register 10. Here, if the number of a-contacts or b-contacts is less than the number of elements of the register IO, the logical value °°1°° is set in the remaining register. After doing this, when the enable signal is turned on, the logical contents of register 10 and register 11 become stable, so the logical product of all the elements of register IO and register 11 is calculated by logical operation element 12, and the result is sent to the signal. It can be taken out from the line OUT.
(発明の効果)
以上のように本発明のラダー図入力部の演算順序決定方
法及びその装置によれば、ラダー図を有向グラフに変換
し、論理演算に要する時間が最少の通路から優先的に演
算していくので、シーケンスプロプラムの処理時間が実
行オブジェクト全体として高速になることを期待できる
。また、最悪の場合でも、有向グラフの全通路を演算す
ることによってラダー図出力部と結合される頂点の論理
値を必ず求めることができるので、オブジェクトの実行
速度は従来以上が保証される。(Effects of the Invention) As described above, according to the method and device for determining the operation order of the ladder diagram input section of the present invention, a ladder diagram is converted into a directed graph, and operations are performed preferentially from the path that takes the least time for logical operations. As a result, it can be expected that the processing time of the sequence program will be faster for the execution object as a whole. Furthermore, even in the worst case, the logical value of the vertex connected to the ladder diagram output section can always be obtained by calculating all paths of the directed graph, so the execution speed of the object is guaranteed to be faster than before.
第1図が本発明における演算順序を決定する際のフロー
チャート、第2図は本発明により作成された実行オブジ
ェクトをハードウェアで実現する場合のブロック図、第
3図は頂点間演算部の詳細回路図、第4図は第3図にお
ける各信号の内容の常1=オンのス不ンチ
45−Figure 1 is a flowchart for determining the order of operations according to the present invention, Figure 2 is a block diagram for realizing the execution object created according to the present invention in hardware, and Figure 3 is a detailed circuit of the inter-vertex operation unit. Figure 4 shows the content of each signal in Figure 3, which is normally 1 = ON.
Claims (1)
に入力部及び出力部の境界線と前記ラダー図の水平接続
線との交わりをオン/オフの情報を持つ頂点に、前記水
平接続線を左から右へのみ前記オン/オフの情報が伝達
される有向辺に、前記水平接続線上のa接点及びb接点
を前記有向辺上に置かれた前記オン/オフの情報の伝達
を制御するゲートにそれぞれ対応させることにより前記
ラダー図を有向グラフに変換し、最も左側の垂直接続で
ある母線に対応した頂点と前記境界線に対応した頂点と
の間において情報が伝達される可能性のあるすべての通
路を抽出して処理の複雑さに対応した重み付けを行ない
、前記母線に対応した頂点にはオンの状態、それ以外の
頂点にはオフの状態を初期状態として設定しておき、前
記ゲートが導通状態の場合には対応する流出する側の頂
点の情報を流入する側の頂点に伝達するという処理を1
つの通路内のすべてのゲートについて繰返して当該通路
の伝達状態を求めるという処理を重みの少ない前記通路
から順に行なうことにより、前記入力部及び出力部の境
界線に対応する頂点がオンの状態であるか否かを求める
ようにしたことを特徴とするラダー図入力部の演算順序
決定方法。 2、前記重みとして前記通路における演算の際に要する
演算時間に比例したパラメータを採用した請求項1に記
載のラダー入力部の演算順序決定方法。 3、前記通路における演算の結果、それまでオフの状態
であった頂点がオンの状態に変化した場合には、前記通
路における重み付けを再度やり直すようにした請求項1
に記載のラダー図入力部の演算順序決定方法。 4、実行オブジェクトが格納される格納手段と、発信及
び受信頂点の論理値が格納される頂点論理値格納手段と
、有向辺上の接点の論理値が格納される接点論理値格納
手段と、前記頂点論理値格納手段に格納された前記発信
頂点の論理値と前記接点論理値格納手段に格納された対
応する前記有向辺上の接点の論理値とに基づいて論理演
算を行ない受信頂点の論理値を求める頂点間演算手段と
、全体の演算制御を行なう制御手段とを備えるように構
成したことを特徴とするラダー図入力部の演算順序決定
装置。 5、前記頂点間演算手段は、前記有向辺へ流出する側の
頂点のオン/オフ状態を論理値1/0として記憶するレ
ジスタと、前記有向辺上に置かれた1つ以上のa接点及
びb接点のそれぞれの導通/非導通状態を論理値1/0
として記憶する1つ以上のレジスタ群と、前記レジスタ
及び前記レジスタ群に記憶された論理値を入力して論理
積の演算を行なう論理演算手段とを備えるようにした請
求項4に記載のラダー図入力部の演算順序決定装置。[Claims] 1. The intersection of the vertical connection line of the ladder diagram representing the program contents and the boundary line of the input section and the output section with the horizontal connection line of the ladder diagram is set at the vertex having on/off information. The on/off information is placed on the directed side where the on/off information is transmitted only from left to right on the horizontal connection line, and the a contact and the b contact on the horizontal connection line are placed on the directed side. The ladder diagram is converted into a directed graph by corresponding to the gates that control the transmission of information, and information is transmitted between the vertices corresponding to the bus line, which is the leftmost vertical connection, and the vertices corresponding to the boundary line. All possible paths are extracted and weighted according to the complexity of the process, and the initial state is set to the on state for the vertices corresponding to the generatrix, and the off state for the other vertices. 1, and when the gate is in a conductive state, the information of the corresponding outflow side vertex is transmitted to the inflow side vertex.
By repeating the process of determining the transmission state of the passage for all gates in one passage in order from the passage with the lowest weight, the vertex corresponding to the boundary line between the input section and the output section is in the on state. 1. A method for determining the order of operations in a ladder diagram input section, characterized in that the method determines whether or not . 2. The calculation order determination method for a ladder input section according to claim 1, wherein a parameter proportional to the calculation time required for calculation in the path is adopted as the weight. 3. As a result of the calculation in the path, when a vertex that was previously in an OFF state changes to an ON state, the weighting in the path is redone.
A method for determining the operation order of the ladder diagram input section described in . 4. storage means for storing execution objects; vertex logical value storage means for storing logical values of transmitting and receiving vertices; and contact logical value storing means for storing logical values of contacts on directed edges; A logical operation is performed based on the logical value of the transmitting vertex stored in the vertex logical value storage means and the logical value of the corresponding contact point on the directed edge stored in the contact logical value storage means to determine the value of the receiving vertex. 1. An operation order determining device for a ladder diagram input section, characterized in that it is configured to include an inter-vertex operation means for calculating logical values, and a control means for controlling the entire operation. 5. The inter-vertex calculation means includes a register that stores the on/off state of the vertex on the side flowing to the directed edge as a logical value 1/0, and one or more a registers placed on the directed edge. The conduction/nonconduction state of each contact and b contact is set to a logical value of 1/0.
5. The ladder diagram according to claim 4, further comprising: one or more register groups for storing the data as a logical product; and logical operation means for inputting the logical values stored in the register and the register group to perform an AND operation. An operation order determining device for the input section.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22401589A JPH0385604A (en) | 1989-08-30 | 1989-08-30 | Method and device for determining arithmetic operation order for ladder diagram input part |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22401589A JPH0385604A (en) | 1989-08-30 | 1989-08-30 | Method and device for determining arithmetic operation order for ladder diagram input part |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0385604A true JPH0385604A (en) | 1991-04-10 |
Family
ID=16807253
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP22401589A Pending JPH0385604A (en) | 1989-08-30 | 1989-08-30 | Method and device for determining arithmetic operation order for ladder diagram input part |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0385604A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5293525A (en) * | 1992-02-28 | 1994-03-08 | Rohm Co., Ltd. | Structure for variable electronic component |
| US5315283A (en) * | 1992-06-24 | 1994-05-24 | Rohm Co., Ltd. | Structure for variable electronic component |
| JP2024522559A (en) * | 2021-06-04 | 2024-06-21 | ベックホフ オートメーション ゲーエムベーハー | Method and programming tool for generating a control program for an automation system - Patents.com |
-
1989
- 1989-08-30 JP JP22401589A patent/JPH0385604A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5293525A (en) * | 1992-02-28 | 1994-03-08 | Rohm Co., Ltd. | Structure for variable electronic component |
| US5315283A (en) * | 1992-06-24 | 1994-05-24 | Rohm Co., Ltd. | Structure for variable electronic component |
| JP2024522559A (en) * | 2021-06-04 | 2024-06-21 | ベックホフ オートメーション ゲーエムベーハー | Method and programming tool for generating a control program for an automation system - Patents.com |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPS5819098B2 (en) | electronic computer method | |
| JPS5927930B2 (en) | Process control method and control device | |
| JPS5921056B2 (en) | Data management system data management system | |
| US4365312A (en) | Sequence controller | |
| JP2882426B2 (en) | Address generator | |
| JPH0385604A (en) | Method and device for determining arithmetic operation order for ladder diagram input part | |
| US4652991A (en) | Data transfer apparatus | |
| JP2000163384A (en) | Semiconductor device | |
| JP2007233930A (en) | Simulator for distributed control system | |
| JP2003067010A (en) | Bit operation control device and programmable logic controller having the same | |
| JPS59183434A (en) | Prefetch control system of instruction | |
| JPH06161518A (en) | Programmable controller | |
| SU920778A2 (en) | Combined computing system | |
| SU690256A1 (en) | Program-time controlled device for switching over several groups of regenerative heat exchangers | |
| JP3190945B2 (en) | Micro program control circuit | |
| JPH04184535A (en) | Parallel arithmetic units | |
| SU879564A1 (en) | Device for checking programs | |
| JP2752771B2 (en) | Programming training equipment | |
| JPH0132523B2 (en) | ||
| JPH0125094B2 (en) | ||
| JP3036754B2 (en) | Micro program controller | |
| SU871745A3 (en) | Device for programmed control of lathe sets | |
| SU690482A1 (en) | Debugging device | |
| JP2555124B2 (en) | Image processing device | |
| JPH01109405A (en) | Programmable controller |