JPH08272606A - Ladder instruction processor - Google Patents

Ladder instruction processor

Info

Publication number
JPH08272606A
JPH08272606A JP7111995A JP7111995A JPH08272606A JP H08272606 A JPH08272606 A JP H08272606A JP 7111995 A JP7111995 A JP 7111995A JP 7111995 A JP7111995 A JP 7111995A JP H08272606 A JPH08272606 A JP H08272606A
Authority
JP
Japan
Prior art keywords
operand
ladder instruction
address
ladder
variable area
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.)
Withdrawn
Application number
JP7111995A
Other languages
Japanese (ja)
Inventor
Yumitsuka Shigemori
弓束 重森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP7111995A priority Critical patent/JPH08272606A/en
Publication of JPH08272606A publication Critical patent/JPH08272606A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Programmable Controllers (AREA)

Abstract

PURPOSE: To provide a ladder instruction processor which can process a ladder instruction at a high speed. CONSTITUTION: A ladder instruction processor calculates the real addresses corresponding to every operand before a ladder instruction is carried out and then stores these real addresses in an operand calculation result store table 25. When the ladder instruction is carried out the value of a variable area 23 is read as the input value referring to the real addresses stored in the table 25. Then the ladder instruction is carried out.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明はプログラマブルコント
ローラに搭載されるラダー命令を実行するラダー命令処
理装置に関し、特に、ラダー命令処理を高速化するよう
に改善したラダー命令処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a ladder instruction processing device mounted on a programmable controller for executing a ladder instruction, and more particularly to a ladder instruction processing device improved to speed up ladder instruction processing.

【0002】[0002]

【従来の技術】一般に、プログラマブルコントローラに
搭載されるラダー命令は、変数エリアの値を入力値とし
て読み込み、各命令に固有な演算を行い、この演算結果
を変数エリアに書き出す処理を実行する。
2. Description of the Related Art Generally, a ladder instruction installed in a programmable controller reads a value in a variable area as an input value, performs an operation unique to each instruction, and writes the operation result in the variable area.

【0003】ここで、このラダー命令には、簡素なビッ
ト演算を行う基本命令と複雑な演算を行う応用命令とが
あり、また、ラダー命令に含まれるオペランドには、そ
れ自体が変数エリアの所望のアドレスを指す直接参照
と、他のメモリ、レジスタを参照し、その内容がまた変
数エリアの他のアドレスを指す間接参照とがある。この
オペランドが直接参照か間接参照かはラダー命令に含ま
れるオペコードのオペランド種から判定できる。
Here, the ladder instruction includes a basic instruction for performing a simple bit operation and an application instruction for performing a complicated operation, and the operand included in the ladder instruction itself has a desired variable area. There is a direct reference that points to the address of, and an indirect reference that refers to another memory or register whose content also points to another address in the variable area. Whether this operand is a direct reference or an indirect reference can be determined from the operand type of the operation code included in the ladder instruction.

【0004】図5は、プログラマブルコントローラに搭
載されるラダー命令を実行する従来のラダー命令処理装
置の処理システム構成をブロック図で示したものであ
る。図5において、プログラムエリア20には、複数の
ラダー命令を含むプログラムが格納されている。そし
て、このプログラムエリア20からラダー命令21が順
次取り出され、所望のラダー命令が実行される。
FIG. 5 is a block diagram showing a processing system configuration of a conventional ladder instruction processing device for executing a ladder instruction mounted on a programmable controller. In FIG. 5, a program area 20 stores a program including a plurality of ladder instructions. Then, the ladder instructions 21 are sequentially fetched from the program area 20 and the desired ladder instructions are executed.

【0005】ラダー命令21は、オペコード、オペラン
ド1、オペランド2、オペランド3からなる。ここで、
オペコードは、そのラダー命令の動作を指定するもので
あり、オペランド1、オペランド2、オペランド3は、
オペコードにより指定される動作の対象となるデータを
指定するものである。
The ladder instruction 21 is composed of an operation code, an operand 1, an operand 2 and an operand 3. here,
The operation code specifies the operation of the ladder instruction, and operand 1, operand 2, and operand 3 are
It specifies the data to be the target of the operation specified by the operation code.

【0006】プログラムエリア20から取り出されたラ
ダー命令21のオペランド1、オペランド2、オペラン
ド3はアドレス変換部22でその対象となるデータを格
納する変数エリア(メモリ)23のアドレスに変換され
る。
The operand 1, operand 2, and operand 3 of the ladder instruction 21 fetched from the program area 20 are converted into addresses in a variable area (memory) 23 for storing the target data in the address conversion section 22.

【0007】ここで、ラダー命令21のオペランド1お
よびオペランド2が変数エリア(メモリ)23に格納さ
れた入力データ1および入力データ2を指定し、オペラ
ンド3が変数エリア(メモリ)23に格納された出力デ
ータを指定するものであるとすると、演算処理部24
は、アドレス変換部22で変換されたアドレスに対応し
て変数エリア(メモリ)23に格納された入力データ1
および入力データ2を入力値として読み込み、この入力
データ1および入力データ2に基づき上記ラダー命令2
1のオペコードで指定される所定の演算を実行するとと
もに、その演算結果を出力値として変数エリア(メモ
リ)23の出力データに書き込む処理を実行する。
Here, the operand 1 and the operand 2 of the ladder instruction 21 specify the input data 1 and the input data 2 stored in the variable area (memory) 23, and the operand 3 is stored in the variable area (memory) 23. If the output data is specified, the arithmetic processing unit 24
Is the input data 1 stored in the variable area (memory) 23 corresponding to the address converted by the address conversion unit 22.
And the input data 2 are read as input values, and the ladder instruction 2 based on the input data 1 and the input data 2 is read.
The predetermined operation designated by the operation code 1 is executed, and the operation result is written as an output value in the output data of the variable area (memory) 23.

【0008】図6は、図5に示した従来のラダー命令処
理装置におけるラダー命令処理アルゴリスムをフローチ
ャートで示したものである。なお、上記基本命令および
応用命令はともに図6に示す処理アルゴリスムで処理さ
れる。
FIG. 6 is a flow chart showing a ladder instruction processing algorithm in the conventional ladder instruction processing apparatus shown in FIG. Both the basic instruction and the application instruction are processed by the processing algorithm shown in FIG.

【0009】図6において、まず、プログラムエリア2
0からラダー命令21を構成するオペコードおよびオペ
ランドを読み込み(ステップ11)、オペランドに対応
するオペランドアドレスの解決を行う(ステップ1
2)。
In FIG. 6, first, the program area 2
The operation code and the operand that compose the ladder instruction 21 are read from 0 (step 11), and the operand address corresponding to the operand is resolved (step 1).
2).

【0010】そして、上記ステップ12の処理により変
数エリア(メモリ)23から解決されたソースアドレス
のデータ(入力データ)をロードし(ステップ13)、
この入力データにより命令固有の演算を処理することに
より、出力データを生成する(ステップ14)。
Then, the data (input data) of the resolved source address is loaded from the variable area (memory) 23 by the processing of step 12 (step 13),
Output data is generated by processing the operation peculiar to the instruction with this input data (step 14).

【0011】その後、変数エリア(メモリ)23の解決
されたディスティネーションアドレスにステップ14で
生成した出力データをストアする(ステップ15)。
After that, the output data generated in step 14 is stored in the resolved destination address of the variable area (memory) 23 (step 15).

【0012】図7は、図5に示した従来のラダー命令処
理装置におけるアドレス変換部22で実行される変数エ
リア(メモリ)23の実アドレス獲得処理について示し
たフローチャートである。図7において、まず、ラダー
命令21のオペコードよりオペランド種を取り出し(ス
テップ31)、この取り出したオペランド種の判定を行
う(ステップ32)。
FIG. 7 is a flow chart showing the real address acquisition processing of the variable area (memory) 23 executed by the address conversion unit 22 in the conventional ladder instruction processing apparatus shown in FIG. In FIG. 7, first, the operand type is extracted from the operation code of the ladder instruction 21 (step 31), and the extracted operand type is determined (step 32).

【0013】そして、上記ステップ32で判定したオペ
ランド種が直接参照か否かを判断する(ステップ3
3)。
Then, it is determined whether or not the operand type determined in step 32 is a direct reference (step 3).
3).

【0014】ステップ33の判断で、オペランド種が間
接参照であると判断された場合は(ステップ33でYE
S)、このラダー命令のオペランドからこのオペランド
に対応する変数エリア23の実アドレスを計算し、この
実アドレスを獲得する(ステップ34)。
If it is determined in step 33 that the operand type is indirect reference (YES in step 33).
S), the real address of the variable area 23 corresponding to this operand is calculated from the operand of this ladder instruction, and this real address is acquired (step 34).

【0015】また、ステップ33の判断で、オペランド
種が直接参照でない、すなわち間接参照であると判断さ
れた場合は(ステップ33でNO)、間接参照の値をレ
ジスタまたはメモリから読み出し(ステップ35)、こ
のレジスタまたはメモリから読み出した間接参照の値に
基づきこのオペランドに対応する変数エリア23の実ア
ドレスを計算し、この実アドレスを獲得する(ステップ
36)。
If it is determined in step 33 that the operand type is not direct reference, that is, indirect reference (NO in step 33), the value of indirect reference is read from the register or memory (step 35). The real address of the variable area 23 corresponding to this operand is calculated based on the value of the indirect reference read from this register or memory, and this real address is acquired (step 36).

【0016】図8は、上記オペランド種が直接参照であ
る場合のモデルの一例を示す。すなわち、図8に示すオ
ペランド種が直接参照の場合は、オペランド1自体が変
数エリア25の実アドレスに対応しているので、オペラ
ンド1に基づき変数エリア25の実アドレスを計算する
ことにより、オペランド1に対応する目的データを得る
ことができる。
FIG. 8 shows an example of a model when the operand type is a direct reference. That is, when the operand type shown in FIG. 8 is a direct reference, since the operand 1 itself corresponds to the real address of the variable area 25, the real address of the variable area 25 is calculated based on the operand 1 to obtain the operand 1 The target data corresponding to can be obtained.

【0017】図9は、上記オペランド種が間接参照であ
る場合のモデルの一例を示す。すなわち、図9に示すオ
ペランド種が間接参照の場合は、オペランド1自体は変
数エリア25の実アドレスに対応していない。そこで、
まず、オペランド1に基づき計算した変数エリア25の
アドレスから間接データを得て、この間接データに基づ
き目的データが格納されている変数エリア25の実アド
レスを獲得する。
FIG. 9 shows an example of a model when the operand type is indirect reference. That is, when the operand type shown in FIG. 9 is indirect reference, the operand 1 itself does not correspond to the real address of the variable area 25. Therefore,
First, the indirect data is obtained from the address of the variable area 25 calculated based on the operand 1, and the real address of the variable area 25 in which the target data is stored is obtained based on this indirect data.

【0018】[0018]

【発明が解決しようとする課題】ところで、上記従来の
ラダー命令処理装置において、ラダー命令処理の高速化
が求められている。
By the way, in the conventional ladder instruction processing apparatus described above, it is required to speed up the ladder instruction processing.

【0019】ラダー命令処理を高速化する手法としては
次の2つの手法、すなわち、 1)ハードウエアロジックの実装による高速化 2)アルゴリズムの改善による高速化が考えられる。
The following two methods can be considered as methods for speeding up the ladder instruction processing: 1) Speeding up by mounting hardware logics 2) Speeding up by improving algorithms.

【0020】ここで、1)のハードウエアロジックの実
装による手法は、現状のアルゴリズムを変更することな
く高速化が図れるという利点があるが、その反面、処理
が複雑になるに従い実装が難しくなり、また、処理内容
を変更することが困難であるという欠点を持つ。
Here, the method of implementing the hardware logic of 1) has an advantage that the speed can be increased without changing the existing algorithm, but on the other hand, the implementation becomes difficult as the processing becomes complicated, In addition, it has a drawback that it is difficult to change the processing content.

【0021】つまり、この1)のハードウエアロジック
の実装による手法では、処理が複雑な応用命令には適用
が困難である。
In other words, the method of implementing the hardware logic of 1) is difficult to apply to the application instruction whose processing is complicated.

【0022】したがって、応用命令にも適用することが
できるようにするには2)のアルゴリズムの改善による
手法を採用するのが好ましい。
Therefore, in order to be applicable to the application instruction, it is preferable to adopt the method of improving the algorithm of 2).

【0023】ところで、従来のラダー命令処理において
は、各ラダー命令が発生される毎にそのラダー命令が必
ず実行されるように構成されている。ここで、もし、実
行する必要がないラダー命令の処理が存在するならば、
その処理を省くことによりラダー命令処理の高速化が期
待できるはずである。
By the way, in the conventional ladder instruction processing, each ladder instruction is executed every time it is generated. Here, if there is a ladder instruction process that does not need to be executed,
It can be expected that the ladder command processing can be speeded up by omitting the processing.

【0024】そこで、従来のラダー命令処理について検
討してみると、図7に示したように、ラダー命令のオペ
ランド種が直接参照である場合、オペランドは変数エリ
アの実アドレスに直接対応しており、またオペランドは
静的データであるので、ラダープログラムが変更されな
い限り、オペランドが同じであればこれに対応する変数
エリアの実アドレスは同一のものになる。
Considering the conventional ladder instruction processing, as shown in FIG. 7, when the operand type of the ladder instruction is a direct reference, the operand directly corresponds to the real address of the variable area. Also, since the operand is static data, the actual address of the variable area corresponding to this is the same if the operand is the same unless the ladder program is changed.

【0025】しかしながら、従来のラダー命令処理にお
いては、各ラダー命令が発生される毎にそのラダー命令
のオペランドに対応する変数エリアの実アドレスが計算
されるように構成されているので、同一のオペランドに
関しては無駄な処理が実行されることになり、この結
果、ラダー命令処理の十分な高速化が図れないという不
都合がある。
However, in the conventional ladder instruction processing, since the real address of the variable area corresponding to the operand of the ladder instruction is calculated every time each ladder instruction is generated, the same operand is used. However, there is a disadvantage in that the ladder instruction processing cannot be sufficiently speeded up as a result.

【0026】そこで、この発明は、ラダー命令処理の高
速化を図るように改善したラダー命令処理装置を提供す
ることを目的とする。
Therefore, an object of the present invention is to provide a ladder instruction processing device improved so as to speed up the ladder instruction processing.

【0027】[0027]

【課題を解決するための手段】上記目的を達成するた
め、この発明は、ラダー命令に含まれるオペランドを実
アドレスに変換し、該実アドレスに基づき変数エリアの
値を入力値として読み込むことにより上記ラダー命令に
対応するラダー命令を実行するラダー命令処理装置にお
いて、上記オペランドから変換した実アドレスを格納す
るオペランド計算結果格納テーブルと、上記ラダー命令
の実行時に、上記オペランド計算結果格納テーブルに格
納された実アドレスを参照して上記変数エリアの値を入
力値として読み込み上記ラダー命令を実行するラダー命
令実行手段と、を具備することを特徴とする。
In order to achieve the above object, the present invention converts the operand included in the ladder instruction into a real address and reads the value of the variable area as an input value based on the real address. In a ladder instruction processing device that executes a ladder instruction corresponding to a ladder instruction, an operand calculation result storage table that stores a real address converted from the operand, and an operand calculation result storage table that is stored when the ladder instruction is executed Ladder instruction executing means for reading the value of the variable area as an input value with reference to a real address and executing the ladder instruction.

【0028】[0028]

【作用】この発明のラダー命令処理装置においては、ラ
ダー命令を実行する前に、各オペランドに対応する実ア
ドレスを計算し、該計算した実アドレスをオペランド計
算結果格納テーブルに格納する。そして、ラダー命令の
実行時には、ラダー命令実行手段により、オペランド計
算結果格納テーブルに格納された実アドレスを参照して
変数エリアの値を入力値として読み込みラダー命令を実
行する。
In the ladder instruction processing device of the present invention, the real address corresponding to each operand is calculated before executing the ladder instruction, and the calculated real address is stored in the operand calculation result storage table. Then, when executing the ladder instruction, the ladder instruction executing means refers to the real address stored in the operand calculation result storage table and reads the value in the variable area as an input value to execute the ladder instruction.

【0029】ここで、上記オペランド計算結果格納テー
ブルは、上記オペランドのオペランド種が直接参照の場
合は、上記変数エリアの該オペランドに対応する実アド
レスを格納し、間接参照の場合は、上記変数エリアの不
使用アドレスに対応する所定のアドレスを格納するよう
に構成することができる。
Here, the operand calculation result storage table stores the actual address corresponding to the operand of the variable area when the operand type of the operand is direct reference, and the variable area when it is indirect reference. Can be configured to store a predetermined address corresponding to the unused address of the.

【0030】そして、上記ラダー命令実行手段は、上記
オペランド計算結果格納テーブルに格納された上記ラダ
ー命令のオペランドに対応するアドレスが実アドレスで
ある場合は、該実アドレスに基づき上記変数エリアの値
を入力値として読み込む。
When the address corresponding to the operand of the ladder instruction stored in the operand calculation result storage table is a real address, the ladder instruction executing means calculates the value of the variable area based on the real address. Read as input value.

【0031】また、上記ラダー命令実行手段は、上記オ
ペランド計算結果格納テーブルに格納された上記ラダー
命令のオペランドに対応するアドレスが上記不使用アド
レスに対応する所定のアドレスである場合は、上記間接
参照にかかわる実アドレスを計算して、該計算した実ア
ドレスに基づき上記変数エリアの値を入力値として読み
込む。
Further, the ladder instruction executing means, when the address corresponding to the operand of the ladder instruction stored in the operand calculation result storage table is a predetermined address corresponding to the unused address, the indirect reference. A real address related to the above is calculated, and the value of the variable area is read as an input value based on the calculated real address.

【0032】また、上記ラダー命令実行手段は、上記変
数エリアの値を入力値として読み込み、該入力値に基づ
き上記ラダー命令に対応する演算処理を行った後、該演
算結果を出力値として上記変数エリアに書き込むように
構成することができる。
The ladder instruction executing means reads the value in the variable area as an input value, performs arithmetic processing corresponding to the ladder instruction based on the input value, and then outputs the arithmetic result as an output value to the variable. It can be configured to write to the area.

【0033】[0033]

【実施例】以下、この発明に係わるラダー命令処理装置
の実施例を添付図面に基づいて詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment of a ladder instruction processing device according to the present invention will be described below in detail with reference to the accompanying drawings.

【0034】図1は、この発明に係わるラダー命令処理
装置の一実施例の概略システム構成を示すブロック図で
ある。なお、図1において、図5に示した従来のラダー
命令処理装置と同一の機能を果たす部分に説明の便宜上
図4で用いた符号と同一の符号を付する。
FIG. 1 is a block diagram showing a schematic system configuration of an embodiment of a ladder instruction processing device according to the present invention. Note that, in FIG. 1, the same reference numerals as those used in FIG. 4 are attached to the portions that perform the same functions as those of the conventional ladder instruction processing device shown in FIG.

【0035】図1において、プログラムエリア20に
は、複数のラダー命令を含むプログラムが格納されてい
る。そして、このプログラムエリア20からラダー命令
21が順次取り出され、所望のラダー命令が実行され
る。
In FIG. 1, a program area 20 stores a program including a plurality of ladder instructions. Then, the ladder instructions 21 are sequentially fetched from the program area 20 and the desired ladder instructions are executed.

【0036】ラダー命令21は、オペコード、オペラン
ド1、オペランド2、オペランド3からなる。ここで、
オペコードは、そのラダー命令の動作を指定するもので
あり、オペランド1、オペランド2、オペランド3は、
オペコードにより指定される動作の対象となるデータを
指定するものである。
The ladder instruction 21 is composed of an operation code, operand 1, operand 2 and operand 3. here,
The operation code specifies the operation of the ladder instruction, and operand 1, operand 2, and operand 3 are
It specifies the data to be the target of the operation specified by the operation code.

【0037】プログラムエリア20から取り出されたラ
ダー命令21のオペランド1、オペランド2、オペラン
ド3はオペランド計算結果格納テーブル25にアドレス
データとして加えられ、このオペランド計算結果格納テ
ーブル25からオペランド1、オペランド2、オペラン
ド3に対応する変数エリア(メモリ)23の実アドレス
であるアドレス1、アドレス2、アドレス3が直接読み
出される。
The operand 1, operand 2, and operand 3 of the ladder instruction 21 fetched from the program area 20 are added as address data to the operand calculation result storage table 25. From this operand calculation result storage table 25, operand 1, operand 2, Addresses 1, 2, and 3, which are real addresses of the variable area (memory) 23 corresponding to the operand 3, are directly read.

【0038】なお、オペランド計算結果格納テーブル2
5の格納データの計算手順については後に図3および図
4を参照して詳述する。
Operand calculation result storage table 2
The calculation procedure of the stored data of 5 will be described later in detail with reference to FIGS. 3 and 4.

【0039】ここで、ラダー命令21のオペランド1お
よびオペランド2が変数エリア(メモリ)23に格納さ
れた入力データ1および入力データ2を指定し、オペラ
ンド3が変数エリア(メモリ)23に格納された出力デ
ータを指定するものであるとすると、上記オペランド計
算結果格納テーブル25から読み出されたアドレス1、
アドレス2に対応して入力データ1および入力データ2
が変数エリア(メモリ)23から取り出される。
Here, the operand 1 and the operand 2 of the ladder instruction 21 specify the input data 1 and the input data 2 stored in the variable area (memory) 23, and the operand 3 is stored in the variable area (memory) 23. Assuming that the output data is designated, the address 1 read from the operand calculation result storage table 25,
Input data 1 and input data 2 corresponding to address 2
Are fetched from the variable area (memory) 23.

【0040】演算処理部24は、変数エリア(メモリ)
23から取り出された上記入力データ1および入力デー
タ2を入力値として読み込み、この入力データ1および
入力データ2に基づき上記ラダー命令21のオペコード
で指定される所定の演算を実行するとともに、その演算
結果を出力値としてオペランド計算結果格納テーブル2
5から読み出されたアドレス3により変数エリア(メモ
リ)23の出力データに書き込む処理を実行する。
The arithmetic processing section 24 has a variable area (memory).
The input data 1 and the input data 2 extracted from 23 are read as input values, a predetermined operation designated by the operation code of the ladder instruction 21 is executed based on the input data 1 and the input data 2, and the operation result is obtained. Operand calculation result storage table 2 using as output value
A process for writing the output data of the variable area (memory) 23 is executed by the address 3 read out from 5.

【0041】なお、ラダー命令21のオペランド1、オ
ペランド2、オペランド3に対応するオペランド計算結
果格納テーブル25の格納内容が変数エリア(メモリ)
23の不使用アドレスに対応する所定のアドレス“00
00”の場合は(この実施例においては、後述する説明
から明らかになるように、オペランド種が間接参照であ
る場合は、オペランド計算結果格納テーブル25に“0
000”が格納される)、アドレッシング解決部26に
より、原状と同様のアドレッシング解決、すなわち、従
来の間接参照の場合と同様のアドレッシング解決を行
う。
The contents stored in the operand calculation result storage table 25 corresponding to the operand 1, operand 2 and operand 3 of the ladder instruction 21 are variable areas (memory).
Predetermined address "00" corresponding to 23 unused addresses
00 "(in this embodiment, as will be apparent from the description below, when the operand type is indirect reference," 0 "is stored in the operand calculation result storage table 25).
000 "is stored), and the addressing resolution unit 26 performs the same addressing resolution as the original one, that is, the same addressing resolution as in the case of the conventional indirect reference.

【0042】図2は、図1に示したラダー命令処理装置
におけるラダー命令処理アルゴリスムをフローチャート
で示したものである。
FIG. 2 is a flow chart showing a ladder instruction processing algorithm in the ladder instruction processing device shown in FIG.

【0043】図2において、まず、プログラムエリア2
0からラダー命令21を構成するオペコードおよびオペ
ランド1、オペランド2、オペランド3を読み込み(ス
テップ101)、次に、ステップ101で読み込んだオ
ペランド1、オペランド2、オペランド3をアドレスデ
ータとしてオペランド計算結果格納テーブル25からア
ドレス1、アドレス2、アドレス3の読み込みを行う
(ステップ102)。
In FIG. 2, first, the program area 2
An operand calculation result storage table in which the operation code and operand 1, operand 2, and operand 3 that form the ladder instruction 21 are read from 0 (step 101), and the operand 1, operand 2, and operand 3 read in step 101 are used as address data. Address 1, address 2, and address 3 are read from 25 (step 102).

【0044】そして、ステップ102で読み込んだアド
レス1、アドレス2、アドレス3が“0000”か否か
を判断する(ステップ103)。
Then, it is determined whether or not the addresses 1, 2, and 3 read in step 102 are "0000" (step 103).

【0045】ステップ103の判断において、ステップ
102で読み込んだアドレス1、アドレス2、アドレス
3が“0000”でないと判断された場合は(ステップ
103でNO)、変数エリア(メモリ)23から解決さ
れたソースアドレスのデータ、すなわちステップ102
で読み込んだアドレス1、アドレス2のデータ(入力デ
ータ1、入力データ2)をロードし(ステップ10
5)、この入力データ1、入力データ2により上記ラダ
ー命令21のオペコードで指定される命令固有の演算を
処理して出力データの生成を行い(ステップ106)、
ステップ102で解決されたディスティネーションアド
レス(アドレス3)に上記生成した出力データをストア
する(ステップ107)。
When it is determined in step 103 that the address 1, address 2, and address 3 read in step 102 are not "0000" (NO in step 103), the variable area (memory) 23 is resolved. Source address data, step 102
The data of the address 1 and the address 2 (input data 1 and input data 2) read in is loaded (step 10
5), the operation peculiar to the instruction designated by the operation code of the ladder instruction 21 is processed by the input data 1 and the input data 2 to generate the output data (step 106),
The generated output data is stored in the destination address (address 3) resolved in step 102 (step 107).

【0046】ところで、この実施例においては、上記ラ
ダー命令処理に先立って、オペランド計算結果格納テー
ブル25に各オペランドに対応して変換されたアドレス
を予め格納しておき、実際のラダー命令処理において
は、上記オペランド計算結果格納テーブル25に予め格
納されたアドレスを用いて変数エリア(メモリ)23の
値を入力値として読み込むことにより処理の高速化を図
っている。
By the way, in this embodiment, prior to the above-mentioned ladder instruction processing, the converted address corresponding to each operand is stored in advance in the operand calculation result storage table 25, and in the actual ladder instruction processing, The processing speed is increased by reading the value of the variable area (memory) 23 as an input value using the address previously stored in the operand calculation result storage table 25.

【0047】図3は、オペランド計算結果格納テーブル
25を生成するシステム構成を示すブロック図である。
なお、図3において、図1に示したラダー命令処理装置
と同一の機能を果たす部分に説明の便宜上図4で用いた
符号と同一の符号を付する。
FIG. 3 is a block diagram showing a system configuration for generating the operand calculation result storage table 25.
Note that, in FIG. 3, parts having the same functions as those of the ladder instruction processing device shown in FIG. 1 are denoted by the same reference numerals as those used in FIG. 4 for convenience of description.

【0048】図3において、プログラムエリア20から
全てのラダー命令21を順次取り出し、このラダー命令
21のオペランド1、オペランド2、オペランド3をア
ドレス変換部27で該オペランド1、オペランド2、オ
ペランド3に対応する実アドレス、すなわちアドレス
1、アドレス2、アドレス3に変換する。そしてこの変
換したアドレス1、アドレス2、アドレス3を各オペラ
ンド1、オペランド2、オペランド3に対応してオペラ
ンド計算結果格納テーブル25に格納する。
In FIG. 3, all the ladder instructions 21 are sequentially fetched from the program area 20, and the operand 1, operand 2 and operand 3 of the ladder instruction 21 are corresponded to the operand 1, operand 2 and operand 3 by the address conversion unit 27. To the real address, that is, the address 1, the address 2, and the address 3. Then, the converted address 1, address 2, and address 3 are stored in the operand calculation result storage table 25 in correspondence with each operand 1, operand 2, and operand 3.

【0049】ここで、プログラムエリア20から取り出
したラダー命令21のオペコードからこのラダー命令2
1のオペランド種が間接参照である場合は、オペランド
1、オペランド2、オペランド3に対応して、この変数
エリア(メモリ)23の不使用アドレスに対応する所定
のアドレス、この実施例では“0000”を格納する。
Here, from the operation code of the ladder instruction 21 fetched from the program area 20, this ladder instruction 2
When the operand type of 1 is an indirect reference, a predetermined address corresponding to an unused address of the variable area (memory) 23 corresponding to operand 1, operand 2 and operand 3, “0000” in this embodiment. To store.

【0050】図4は、図3に示したシステム構成におけ
るオペランド計算結果格納テーブル25の格納データの
計算手順をフローチャートで示したものである。
FIG. 4 is a flow chart showing the calculation procedure of the storage data of the operand calculation result storage table 25 in the system configuration shown in FIG.

【0051】図4において、まず、各ラダー命令21を
構成するオペコードおよびオペランド1、オペランド
2、オペランド3をプログラムエリア20から読み出す
(ステップ201)。そして、ステップ201で読み出
したオペコードよりオペランド種を取り出し(ステップ
202)、オペランド種の判定を行う(ステップ20
3)。
In FIG. 4, first, the operation code and the operand 1, the operand 2, and the operand 3 which constitute each ladder instruction 21 are read from the program area 20 (step 201). Then, the operand type is extracted from the operation code read in step 201 (step 202), and the operand type is determined (step 20).
3).

【0052】そして、次に、ステップ203で判定した
オペランド種が直接参照か否かの判断を行う(ステップ
204)。
Then, it is determined whether or not the operand type determined in step 203 is a direct reference (step 204).

【0053】ステップ204の判断において、ステップ
203で判定したオペランド種が直接参照である場合は
(ステップ204でYES)、オペランド1、オペラン
ド2、オペランド3から変数エリア(メモリ)23の実
アドレスを計算し、この実アドレスをオペランド計算結
果格納テーブル25に格納し、次の命令に移行する(ス
テップ208)。
When the operand type determined in step 203 is a direct reference in the determination in step 204 (YES in step 204), the real address of the variable area (memory) 23 is calculated from the operand 1, operand 2 and operand 3. Then, this real address is stored in the operand calculation result storage table 25, and the process proceeds to the next instruction (step 208).

【0054】また、ステップ204の判断において、ス
テップ203で判定したオペランド種が直接参照でな
い、すなわち間接参照である場合は(ステップ204で
NO)、“0000”をオペランド計算結果格納テーブ
ル25に格納し、次の命令に移行する(ステップ20
8)。
If the operand type determined in step 203 is not a direct reference, that is, an indirect reference in step 204 (NO in step 204), "0000" is stored in the operand calculation result storage table 25. , Next instruction (step 20)
8).

【0055】なお、上記実施例では命令のオペランド種
が間接参照である場合は、オペランド計算結果格納テー
ブル25に“0000”を格納するように構成したが、
これに限定されずに、変数エリア(メモリ)23の不使
用アドレスに対応するアドレスであれば、他の値を用い
ても同様に構成することができる。
In the above embodiment, when the operand type of the instruction is indirect reference, "0000" is stored in the operand calculation result storage table 25.
The present invention is not limited to this, and if the address corresponds to the unused address of the variable area (memory) 23, it can be similarly configured by using other values.

【0056】[0056]

【発明の効果】以上説明したように、この発明のラダー
命令処理装置によれば、ラダー命令を実行する前に、各
オペランドに対応する実アドレスを計算して該計算した
実アドレスをオペランド計算結果格納テーブルに格納
し、ラダー命令の実行時には、オペランド計算結果格納
テーブルに格納された実アドレスを参照して変数エリア
の値を入力値として読み込みラダー命令を実行するよう
に構成したので、ラダー命令処理の高速化を図るように
改善したラダー命令処理装置および方法を提供すること
ができるともに、更に以下に示すような種々の効果を奏
する。
As described above, according to the ladder instruction processing apparatus of the present invention, the real address corresponding to each operand is calculated before executing the ladder instruction, and the calculated real address is used as the operand calculation result. The ladder instruction is processed by storing it in the storage table and executing the ladder instruction by reading the value in the variable area as an input value by referring to the real address stored in the operand calculation result storage table when executing the ladder instruction. It is possible to provide an improved ladder instruction processing device and method so as to achieve higher speed, and also to achieve various effects as described below.

【0057】1)応用命令の処理時間を短縮することが
できる。 2)ラダー命令処理時間の短縮によりラダー命令処理を
実行するMPUの処理能力を他の処理に割り当てること
ができ、資源割り当ての効率化が図れる。 3)ソフトウエア上で高速化することにより、MPU、
メモリ等の高速化に容易に追従できる。
1) The processing time of application instructions can be shortened. 2) By reducing the ladder instruction processing time, the processing capacity of the MPU that executes the ladder instruction processing can be allocated to other processing, and the efficiency of resource allocation can be improved. 3) By speeding up on software, MPU,
It is possible to easily follow the increase in the speed of memory etc.

【図面の簡単な説明】[Brief description of drawings]

【図1】この発明に係わるラダー命令処理装置の一実施
例の概略システム構成を示すブロック図。
FIG. 1 is a block diagram showing a schematic system configuration of an embodiment of a ladder instruction processing device according to the present invention.

【図2】図1に示したラダー命令処理装置におけるラダ
ー命令処理アルゴリスムを示すフローチャート。
FIG. 2 is a flowchart showing a ladder instruction processing algorithm in the ladder instruction processing device shown in FIG.

【図3】図1に示したオペランド計算結果格納テーブル
を生成するシステム構成を示すブロック図。
FIG. 3 is a block diagram showing a system configuration for generating an operand calculation result storage table shown in FIG.

【図4】図3に示したシステム構成におけるオペランド
計算結果格納テーブルの格納データの計算手順を示すフ
ローチャート。
4 is a flowchart showing a calculation procedure of stored data in an operand calculation result storage table in the system configuration shown in FIG.

【図5】プログラマブルコントローラに搭載されるラダ
ー命令を実行する従来のラダー命令処理装置の処理シス
テム構成を示すブロック図。
FIG. 5 is a block diagram showing a processing system configuration of a conventional ladder instruction processing device that executes a ladder instruction installed in a programmable controller.

【図6】図4に示した従来のラダー命令処理装置におけ
るラダー命令処理アルゴリスムを示すフローチャート。
6 is a flowchart showing a ladder instruction processing algorithm in the conventional ladder instruction processing device shown in FIG.

【図7】図5に示した従来のラダー命令処理装置におけ
るアドレス変換部で実行される変数エリア(メモリ)の
実アドレス獲得処理について示したフローチャート。
7 is a flowchart showing a real address acquisition process of a variable area (memory) executed by an address conversion unit in the conventional ladder instruction processing device shown in FIG.

【図8】オペランド種が直接参照である場合のモデルの
一例を示す図。
FIG. 8 is a diagram showing an example of a model when an operand type is direct reference.

【図9】オペランド種が間接参照である場合のモデルの
一例を示す図。
FIG. 9 is a diagram showing an example of a model when an operand type is indirect reference.

【符号の説明】[Explanation of symbols]

20 プログラムエリア 21 ラダー命令 23 変数エリア(メモリ) 24 演算処理部 25 オペランド計算結果格納テーブル 26 アドレッシング解決部 27 アドレス変換部 20 Program Area 21 Ladder Instruction 23 Variable Area (Memory) 24 Arithmetic Processing Section 25 Operand Calculation Result Storage Table 26 Addressing Resolution Section 27 Address Conversion Section

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 ラダー命令に含まれるオペランドを実ア
ドレスに変換し、該実アドレスに基づき変数エリアの値
を入力値として読み込むことにより上記ラダー命令に対
応するラダー命令を実行するラダー命令処理装置におい
て、 上記オペランドから変換した実アドレスを格納するオペ
ランド計算結果格納テーブルと、 上記ラダー命令の実行時に、上記オペランド計算結果格
納テーブルに格納された実アドレスを参照して上記変数
エリアの値を入力値として読み込み上記ラダー命令を実
行するラダー命令実行手段と、 を具備することを特徴とするラダー命令処理装置。
1. A ladder instruction processing device for executing a ladder instruction corresponding to the ladder instruction by converting an operand included in the ladder instruction into a real address and reading a value of a variable area as an input value based on the real address. , The operand calculation result storage table that stores the actual address converted from the above operand, and the actual address stored in the operand calculation result storage table when the above ladder instruction is executed, and the value in the above variable area is used as the input value. A ladder instruction processing device comprising: a ladder instruction executing means for reading and executing the ladder instruction.
【請求項2】 上記オペランド計算結果格納テーブル
は、 上記ラダー命令実行手段による上記ラダー命令の実行前
に上記実アドレスを格納することを特徴とする請求項1
記載のラダー命令処理装置。
2. The operand calculation result storage table stores the real address before execution of the ladder instruction by the ladder instruction executing means.
Ladder instruction processing device described.
【請求項3】 上記オペランド計算結果格納テーブル
は、 上記オペランドのオペランド種が直接参照の場合は、上
記変数エリアの該オペランドに対応する実アドレスを格
納し、間接参照の場合は、上記変数エリアの不使用アド
レスに対応する所定のアドレスを格納することを特徴と
する請求項2記載のラダー命令処理装置。
3. The operand calculation result storage table stores a real address corresponding to the operand of the variable area when the operand type of the operand is direct reference, and stores an actual address of the variable area when indirect reference is performed. The ladder instruction processing device according to claim 2, wherein a predetermined address corresponding to an unused address is stored.
【請求項4】 上記ラダー命令実行手段は、 上記オペランド計算結果格納テーブルに格納された上記
ラダー命令のオペランドに対応するアドレスが実アドレ
スである場合は、該実アドレスに基づき上記変数エリア
の値を入力値として読み込むことを特徴とする請求項3
記載のラダー命令処理装置。
4. When the address corresponding to the operand of the ladder instruction stored in the operand calculation result storage table is a real address, the ladder instruction executing means calculates the value of the variable area based on the real address. 4. The data is read as an input value.
Ladder instruction processing device described.
【請求項5】 上記ラダー命令実行手段は、 上記オペランド計算結果格納テーブルに格納された上記
ラダー命令のオペランドに対応するアドレスが上記不使
用アドレスに対応する所定のアドレスである場合は、上
記間接参照にかかわる実アドレスを計算して、該計算し
た実アドレスに基づき上記変数エリアの値を入力値とし
て読み込むことを特徴とする請求項3記載のラダー命令
処理装置。
5. The ladder instruction executing means, when the address corresponding to the operand of the ladder instruction stored in the operand calculation result storage table is a predetermined address corresponding to the unused address, the indirect reference. 4. The ladder instruction processing device according to claim 3, wherein a real address related to the above is calculated, and the value of the variable area is read as an input value based on the calculated real address.
【請求項6】 上記ラダー命令実行手段は、 上記変数エリアの値を入力値として読み込み、該入力値
に基づき上記ラダー命令に対応する演算処理を行った
後、該演算結果を出力値として上記変数エリアに書き込
むことを特徴とする請求項1記載のラダー命令処理装
置。
6. The ladder instruction executing means reads the value of the variable area as an input value, performs arithmetic processing corresponding to the ladder instruction based on the input value, and then outputs the arithmetic result as an output value of the variable. The ladder instruction processing device according to claim 1, wherein the ladder instruction processing device writes in an area.
JP7111995A 1995-03-29 1995-03-29 Ladder instruction processor Withdrawn JPH08272606A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7111995A JPH08272606A (en) 1995-03-29 1995-03-29 Ladder instruction processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7111995A JPH08272606A (en) 1995-03-29 1995-03-29 Ladder instruction processor

Publications (1)

Publication Number Publication Date
JPH08272606A true JPH08272606A (en) 1996-10-18

Family

ID=13451368

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7111995A Withdrawn JPH08272606A (en) 1995-03-29 1995-03-29 Ladder instruction processor

Country Status (1)

Country Link
JP (1) JPH08272606A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10083498B4 (en) * 1999-10-18 2007-09-13 Fujikura Ltd. A method of producing a thin polycrystalline layer and an oxide superconducting element

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10083498B4 (en) * 1999-10-18 2007-09-13 Fujikura Ltd. A method of producing a thin polycrystalline layer and an oxide superconducting element

Similar Documents

Publication Publication Date Title
JPH08272606A (en) Ladder instruction processor
JPH08272411A (en) Ladder instruction processor
JPH06266553A (en) Computer system
JP2885197B2 (en) Arithmetic processing device and arithmetic processing method
JPH0337726A (en) Case statement optimizing system
JPS61250752A (en) Address expanding system
JP4257626B2 (en) Memory access device
JPH0553827A (en) Dynamic link optimizing system
JPH0459652B2 (en)
JPH05324316A (en) Microprocessor
JPS61250753A (en) Address expanding system
JP2002312343A (en) Method of executing fast fourier transformation and filter device
JPH04253239A (en) Virtual memory system
JPH0221331A (en) Program control system for microcomputer
JPH0844570A (en) System and method for program execution
JPS603656B2 (en) Computer memory expansion method
JPH0363847A (en) Address generating system
JP2003150575A (en) Data driving type information processor and information processing method
JPS6235991A (en) Image processing device
JPS62295138A (en) Address forming system
JPH05158507A (en) Instrumentation controller
JPH0635711A (en) Dynamic link device
JPH05126911A (en) Pattern generator for memory testing device
JP2002116951A (en) Address generation circuit
JPH05100846A (en) Accumulator designation device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20020604