JPH1011117A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH1011117A
JPH1011117A JP15956296A JP15956296A JPH1011117A JP H1011117 A JPH1011117 A JP H1011117A JP 15956296 A JP15956296 A JP 15956296A JP 15956296 A JP15956296 A JP 15956296A JP H1011117 A JPH1011117 A JP H1011117A
Authority
JP
Japan
Prior art keywords
contact
data
memory
instruction
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP15956296A
Other languages
Japanese (ja)
Inventor
Jun Nagano
潤 永野
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.)
Keyence Corp
Original Assignee
Keyence Corp
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 Keyence Corp filed Critical Keyence Corp
Priority to JP15956296A priority Critical patent/JPH1011117A/en
Publication of JPH1011117A publication Critical patent/JPH1011117A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a programmable controller capable of quickly executing respective instructions related to a contact (b) even in a programmable controller utilizing a general microprocessor. SOLUTION: The programmable controller is provided with a data output circuit 500 for outputting the value of data indicating the state of a contact (a) as it is when the data are read out from a memory and inverting the value of data indicating the state of the contact (b) and outputting the inverted value when the data are read out from the memory. At the time of executing an instruction for the contact (a) selected as an object to be processed in a sequence program, the data read out from the memory are used as they are, and in the case of executing an instruction for the contact (b) selected an object to be processed, the data read out from the memory are inverted by the circuit 500 and the inverted data are used.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はプログラマブルコン
トローラに関し、特に汎用マイクロプロセッサを使用
し、制御対象である接点の内のb接点(常閉接点)に関
する命令を高速に実行し得るプログラマブルコントロー
ラに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a programmable controller, and more particularly to a programmable controller which uses a general-purpose microprocessor and can execute a command concerning a contact b (normally closed contact) among contacts to be controlled at a high speed.

【0002】[0002]

【従来の技術】プログラマブルコントローラによるシー
ケンス制御に際しては、スイッチ,コイル等の記号,機
能を表した図形,これらに関連するデータ,ラベル等
を、シーケンスに沿った順序で左右の母線内に配置する
ラダー図を応用したラダー図言語で設計する方法が広く
採用されており、設計支援用のアプリケーションプログ
ラムも市販されている。
2. Description of the Related Art When a sequence is controlled by a programmable controller, a ladder for arranging symbols such as switches and coils, graphics representing functions, related data, labels, and the like in an order along the sequence in left and right buses. A method of designing with a ladder diagram language using diagrams is widely adopted, and application programs for design support are also commercially available.

【0003】図1はそのようなラダープログラムで使用
される代表的な命令語を示す模式図であり、命令の名
称,そのラダープログラム上でのシンボル,ニモニッ
ク,機能がそれぞれ示されている。
FIG. 1 is a schematic diagram showing typical instruction words used in such a ladder program, and shows the names of instructions, symbols, mnemonics, and functions in the ladder program.

【0004】これらの命令語の内のたとえば、ニモニッ
ク”LD”で示される命令はロード命令であり、母線にa
接点、即ち常開接点(図1ではN.O.:Normal Open接点)
を接続する命令である。ニモニック”LDB ”で示される
命令はロードバー命令であり、母線にb接点、即ち常閉
接点(図1ではN.C.:Normal Close 接点) を接続する命
令である。
[0004] Of these instruction words, for example, an instruction indicated by a mnemonic "LD" is a load instruction, and a
Contact, ie normally open contact (NO: Normal Open contact in Fig. 1)
Is the instruction to connect The instruction indicated by the mnemonic "LDB" is a load bar instruction, and is an instruction for connecting the b contact, that is, a normally closed contact (NC: Normal Close contact in FIG. 1) to the bus.

【0005】ニモニック”AND ”で示される命令はアン
ド命令であり、a接点を直列に接続する命令である。ニ
モニック”ANB ”で示される命令はアンドバー命令であ
り、b接点を直列に接続する命令である。
[0005] The instruction indicated by the mnemonic "AND" is an AND instruction, which is an instruction for connecting the a contact in series. The command indicated by the mnemonic "ANB" is an AND bar command, which is a command for connecting the b contacts in series.

【0006】ニモニック”OR”で示される命令はオア命
令であり、a接点を並列に接続する命令である。ニモニ
ック”ORB ”で示される命令はオアバー命令であり、b
接点、即ち常閉接点を並列に接続する命令である。
The instruction indicated by the mnemonic "OR" is an OR instruction, and is an instruction to connect the NO contacts in parallel. The instruction indicated by the mnemonic "ORB" is an OR instruction, and b
It is a command to connect the contacts, that is, the normally closed contacts in parallel.

【0007】前述の設計支援用アプリケーションプログ
ラムがインストールされたパーソナルコンピュータを利
用することにより、上述のような各種の命令のニモニッ
クの組み合わせてラダープログラムの設計が可能であ
り、各命令に対応する図1に示されているような各シン
ボルをラダープログラムのシーケンスに沿った順序で左
右の母線内に配置してラダー図が作成される。
By using a personal computer on which the above-described design support application program is installed, a ladder program can be designed by combining mnemonics of various instructions as described above. Are arranged in the left and right buses in the order according to the sequence of the ladder program to create a ladder diagram.

【0008】上述のようにして設計されたラダープログ
ラムの実行にはプログラマブルコントローラ(Programma
ble Logic Contller:PLC) が使用されるが、それには専
用のマイクロプロセッサによる場合と汎用のマイクロプ
ロセッサによる場合とがある。前者はラダープログラム
の各種命令を処理する専用のマイクロプロセッサとして
設計されているが、後者はラダープログラムの各種命令
を汎用マイクロプロセッサが有する命令の組み合わせで
処理する。このため、前者の専用のハードウェアを使用
する場合には高速にラダープログラムの処理が可能であ
る。しかし後者では、使用する汎用マイクロプロセッサ
の命令処理速度,ラダープログラムの各命令をどのよう
な命令の組み合わせで処理するかにより異なるが、いず
れにしろ前者に比して処理速度が低速になることは否め
ない。
A ladder program designed as described above is executed by a programmable controller (Programma
ble Logic Controller (PLC) is used, and there are a case using a dedicated microprocessor and a case using a general-purpose microprocessor. The former is designed as a dedicated microprocessor for processing various instructions of a ladder program, while the latter processes various instructions of a ladder program by a combination of instructions included in a general-purpose microprocessor. Therefore, when the former dedicated hardware is used, the ladder program can be processed at high speed. However, the latter differs depending on the instruction processing speed of the general-purpose microprocessor used and the combination of instructions used to process each instruction of the ladder program. In any case, the processing speed is lower than the former. can not deny.

【0009】図1に示されている種々の命令語の内のロ
ード, アンド, オアの各命令は汎用マイクロプロセッサ
においてはそれぞれ以下のような命令により実行され
る。
Each of the load, AND, and OR instructions of the various instruction words shown in FIG. 1 is executed by the following instructions in a general-purpose microprocessor.

【0010】ロード(LD) :mem → reg アンド(AND) :reg ∧ mem → reg オア(OR) :reg ∨ mem→ regLoad (LD): mem → reg AND (AND): reg ∧ mem → reg OR (OR): reg ∨ mem → reg

【0011】具体的には、ラダープログラムのロード命
令は、汎用マイクロプロセッサではメモリ(mem) に格納
されているa接点の状態を示すデータをレジスタ(reg)
に転送して格納する命令として実現される。ラダープロ
グラムのアンド命令は、汎用マイクロプロセッサではレ
ジスタ(reg) に既に保持されているある接点の状態を示
すデータとメモリ(mem) に格納されているあるa接点の
状態を示すデータとをアンド演算 (論理積演算:∧) し
てその結果を元のレジスタ(reg) に格納する命令で実現
される。ラダープログラムのオア命令は、汎用マイクロ
プロセッサではレジスタ(reg) に既に保持されているあ
る接点の状態を示すデータとメモリ(mem) に格納されて
いるあるa接点の状態を示すデータとをオア演算 (論理
和演算:∨) してその結果を元のレジスタ(reg) に格納
する命令で実現される。
Specifically, the load instruction of the ladder program is a general-purpose microprocessor which stores data indicating the state of the contact a stored in the memory (mem) in a register (reg).
And stored as an instruction. In a general purpose microprocessor, the AND instruction of the ladder program performs an AND operation on data indicating the state of a certain contact already held in a register (reg) and data indicating the state of a certain contact stored in a memory (mem). (Logical AND operation: ∧) and the result is stored in the original register (reg). In the OR instruction of the ladder program, a general-purpose microprocessor performs an OR operation on data indicating the state of a certain contact already held in a register (reg) and data indicating the state of a certain contact stored in a memory (mem). (OR operation: ∨) and the result is stored in the original register (reg).

【0012】従って、ラダープログラムのa接点に関す
る命令であるロード命令,アンド命令及びオア命令は汎
用マイクロプロセッサでは共に一命令で処理される。し
かし、たとえば前述の図1に示されているラダープログ
ラムの命令の内のb接点に関する各命令、即ちニモニッ
ク”LDB ”で示されるロードバー命令, ニモニック”AN
B ”で示されるアンドバー命令, ニモニック”ORB ”で
示されるオアバー命令を汎用マイクロプロセッサで処理
する場合には以下のようになる。なお、以下の説明にお
いて「#」は反転(バー)記号を示している。
Therefore, a load instruction, an AND instruction, and an OR instruction, which are instructions relating to the contact a of the ladder program, are all processed by one instruction in the general-purpose microprocessor. However, for example, among the instructions of the ladder program shown in FIG. 1 above, each instruction relating to the contact b, that is, the load bar instruction indicated by the mnemonic "LDB" and the mnemonic "AN"
A general-purpose microprocessor processes an AND bar instruction indicated by "B" and an OR bar instruction indicated by mnemonic "ORB". In the following description, "#" indicates an inverted (bar) symbol. ing.

【0013】ロードバー(LDB) :mem →reg, #reg → r
eg アンドバー(ANB) :#reg→ reg, reg ∨ mem→ reg, #r
eg→ reg オアバー(ORB) :#reg→reg, reg∧ mem→ reg, #reg
→reg
Load bar (LDB): mem → reg, # reg → r
eg And bar (ANB): # reg → reg, reg ∨ mem → reg, #r
eg → reg ORB (ORB): # reg → reg, reg∧ mem → reg, #reg
→ reg

【0014】具体的には、ラダープログラムのロードバ
ー命令は、汎用マイクロプロセッサではメモリ(mem) に
格納されているあるb接点の状態を示すデータをレジス
タ(reg) に転送する命令と、レジスタ(reg) に転送され
たデータを反転(#reg)して元のレジスタ(reg) に格納す
る命令との二命令で実現される。
More specifically, the load bar instruction of the ladder program includes, in a general-purpose microprocessor, an instruction for transferring data indicating the state of a certain b-contact stored in a memory (mem) to a register (reg); This is realized by two instructions: an instruction to invert (#reg) the data transferred to (reg) and store it in the original register (reg).

【0015】ラダープログラムのアンドバー命令は、汎
用マイクロプロセッサではレジスタに既に保持されてい
るある接点の状態を示すデータを反転(#reg)してその結
果を元のレジスタ(reg) に格納する命令と、そのレジス
タ(reg) に格納された反転済みのデータとメモリ(mem)
に格納されているあるb接点の状態を示すデータとをそ
のままをオア演算 (論理和演算:∨) してその結果を元
のレジスタ(reg) に格納する命令と、そのレジスタに格
納されているデータを反転(#reg)して元のレジスタ(re
g) に格納する命令との三命令で実現される。
The ladder program and bar instruction is an instruction for inverting (#reg) data indicating the state of a certain contact already held in a register in a general-purpose microprocessor and storing the result in the original register (reg). , The inverted data and memory (mem) stored in the register (reg)
An instruction to perform an OR operation (logical addition operation: を) on the data indicating the state of the contact b stored in the register as it is and store the result in the original register (reg), and the instruction stored in the register Invert the data (#reg) to the original register (re
g) is realized by three instructions including the instruction stored in.

【0016】ラダープログラムのオアバー命令は、汎用
マイクロプロセッサではレジスタに保持されているある
接点の状態を示すデータを反転(#reg)してその結果を元
のレジスタ(reg) に格納する命令と、そのレジスタ(re
g) に格納されている反転済みのデータとメモリ(mem)
に格納されているあるb接点の状態を示すデータとをそ
のままアンド演算 (論理積演算:∧) してその結果を元
のレジスタ(reg) に格納する命令と、そのレジスタに格
納されているデータを反転(#reg)して元のレジスタ(re
g) に格納する命令との三命令で実現される。
In a general purpose microprocessor, an OR-bar instruction of a ladder program is an instruction for inverting (#reg) data indicating the state of a certain contact held in a register and storing the result in the original register (reg); That register (re
g) flipped data and memory stored in (mem)
An instruction to perform an AND operation (logical AND operation: ∧) on the data indicating the state of the contact b stored in the register and store the result in the original register (reg), and the data stored in the register Is inverted (#reg) and the original register (re
g) is realized by three instructions including the instruction stored in.

【0017】[0017]

【発明が解決しようとする課題】このように、ラダープ
ログラムのb接点に関するロードバー命令は汎用マイク
ロプロセッサでは二命令で、ラダープログラムのアンド
バー命令及びオアバー命令は汎用マイクロプロセッサで
は共に三命令で処理される。換言すれば、ラダープログ
ラムの処理のための専用マイクロプロセッサを利用した
プログラマブルコントローラでは、a接点に関するロー
ド(LD), アンド(AND),オア(OR)の各命令も、b接点に関
するロードバー(LDB),アンドバー(ANB),オアバー(ORB)
の各命令も基本的には同一の処理時間で実行可能である
が、汎用マイクロプロセッサを利用したプログラマブル
コントローラではb接点に関する各命令の処理時間はa
接点に関するそれに比して2乃至3倍程度の処理時間が
必要になるという問題がある。
As described above, the load bar instruction relating to the contact b of the ladder program is processed by two instructions in the general-purpose microprocessor, and the AND-bar instruction and the OR-bar instruction of the ladder program are processed by three instructions in the general-purpose microprocessor. You. In other words, in a programmable controller using a dedicated microprocessor for processing a ladder program, the load (LD), AND (AND), and OR (OR) instructions relating to the a-contact also require the load bar (LDB) relating to the b-contact. ), And bar (ANB), or bar (ORB)
Can be executed in basically the same processing time, but in a programmable controller using a general-purpose microprocessor, the processing time of each instruction related to the contact b is a
There is a problem that the processing time is required to be about two to three times as long as that for the contact.

【0018】しかし、専用のプログラマブルコントロー
ラとして構成されたマイクロプロセッサは高価であり、
それに比して汎用マイクロプロセッサは安価であるとい
う経済的な問題も他方ではあるため、汎用マイクロプロ
セッサを利用したプログラマブルコントローラの需要も
多い。このため、汎用マイクロプロセッサを利用したプ
ログラマブルコントローラにおいても、上述のようなb
接点に関する各命令の処理時間を高速化することが望ま
れている。
However, a microprocessor configured as a dedicated programmable controller is expensive,
On the other hand, on the other hand, there is an economical problem that a general-purpose microprocessor is inexpensive, so that there is a great demand for a programmable controller using a general-purpose microprocessor. Therefore, even in a programmable controller using a general-purpose microprocessor, b
It is desired to shorten the processing time of each instruction related to a contact.

【0019】本発明はこのような事情に鑑みてなされた
ものであり、汎用マイクロプロセッサを利用したプログ
ラマブルコントローラにおいても、b接点に関する各命
令をより高速に実行し得るプログラマブルコントローラ
の提供を目的とする。
The present invention has been made in view of such circumstances, and it is an object of the present invention to provide a programmable controller using a general-purpose microprocessor, which can execute each instruction related to the contact b at a higher speed. .

【0020】[0020]

【課題を解決するための手段】本発明に係るプログラマ
ブルコントローラは、シーケンス制御に係るa接点の非
導通状態及びb接点の導通状態を所定の値で、a接点の
導通状態及びb接点の非導通状態を所定の値とは相補関
係にある値でそれぞれ示すデータを記憶するメモリを備
え、メモリに記憶された各接点の状態を示すデータを処
理対象とするシーケンスプログラムを構成する命令を汎
用マイクロプロセッサ用命令を組み合わせて実行するこ
とによりシーケンス制御を行なうプログラマブルコント
ローラであって、a接点の状態を示すデータがメモリか
ら読み出された場合はその値をそのまま出力し、b接点
の状態を示すデータがメモリから読み出された場合はそ
の値を反転して出力するデータ出力回路を備え、a接点
を処理対象とするシーケンスプログラムの命令の実行に
際しては、メモリから読み出されたデータをそのまま使
用し、b接点を処理対象とするシーケンスプログラムの
命令の実行に際しては、メモリから読み出されたデータ
をデータ出力回路により反転したデータを使用すべくな
してあることを特徴とする。
According to the present invention, a programmable controller according to the present invention sets a non-conducting state of an a contact and a non-conducting state of a b contact to predetermined values for a non-conducting state of an a contact and a conducting state of a b contact in sequence control. A general-purpose microprocessor that includes a memory that stores data indicating a state that is complementary to a predetermined value, and that configures a sequence program that processes data indicating the state of each contact stored in the memory; Is a programmable controller that performs sequence control by combining and executing the instructions for use, and when data indicating the state of the contact a is read from the memory, the value is output as it is, and data indicating the state of the contact b is output. It has a data output circuit that inverts the value when it is read from the memory and outputs the inverted value. When executing the instructions of the sequence program, the data read from the memory is used as it is, and when executing the instructions of the sequence program targeting the b contact, the data read from the memory is used by the data output circuit. It is characterized in that inverted data is used.

【0021】また本発明に係るプログラマブルコントロ
ーラは、上述の構成に加えて、シーケンスプログラムの
各命令をコンパイルする際に、各a接点に関する命令に
含まれるメモリアドレスはそのまま、各b接点に関する
命令に含まれるメモリアドレスは所定の関係に対応付け
られたアドレスに変換するコンパイラを備え、更にデー
タ出力回路は、各命令に含まれるメモリアドレスをデコ
ードするデコード手段と、このデコード手段によるデコ
ード結果に基づいて、メモリから読み出された値をその
まま出力するか、または反転して出力する手段とを有す
ることを特徴とする。
Further, in the programmable controller according to the present invention, in addition to the above configuration, when compiling each instruction of the sequence program, the memory address included in the instruction relating to each a contact is included in the instruction relating to each b contact as it is. A memory address included in each instruction, and a data output circuit configured to decode the memory address included in each instruction. Means for outputting the value read from the memory as it is or for inverting and outputting the value.

【0022】更に本発明に係るプログラマブルコントロ
ーラは、シーケンス制御に係るa接点の非導通状態及び
b接点の導通状態を所定の値で、a接点の導通状態及び
b接点の非導通状態を所定の値とは相補関係にある値で
それぞれ示すデータを記憶するメモリと、a接点の状態
を示すデータがメモリから読み出された場合はその値を
そのまま出力し、b接点の状態を示すデータがメモリか
ら読み出された場合はその値を反転して出力するデータ
出力回路とを備え、メモリに記憶された各接点の状態を
示すデータを処理対象とするシーケンスプログラムを構
成する命令を汎用マイクロプロセッサ用命令を組み合わ
せて実行することによりシーケンス制御を行なうプログ
ラマブルコントローラであって、メモリに格納されてい
るb接点のデータをデータ出力回路で反転してレジスタ
に格納するように汎用マイクロプロセッサ用命令でプロ
グラミングすることにより、メモリに格納されているb
接点の状態を示すデータをレジスタに格納するシーケン
スプログラムのロードバー命令と、メモリに格納されて
いるb接点のデータをデータ出力回路で反転したデータ
とレジスタに格納されているデータとをアンド演算して
レジスタに格納するように汎用マイクロプロセッサ用命
令でプログラミングすることにより、メモリに格納され
ているb接点の状態を示すデータとレジスタに格納され
ているある接点の状態を示すデータとをアンド演算する
シーケンスプログラムのアンドバー命令と、メモリに格
納されているb接点のデータをデータ出力回路で反転し
たデータとレジスタに格納されているデータとをオア演
算してレジスタに格納するように汎用マイクロプロセッ
サ用命令でプログラミングすることにより、メモリに格
納されているb接点の状態を示すデータとレジスタに格
納されているある接点の状態を示すデータとをオア演算
するシーケンスプログラムのオアバー命令とを有するこ
とを特徴とする。
Further, the programmable controller according to the present invention is characterized in that the non-conducting state of the contact a and the conducting state of the contact b relating to the sequence control have a predetermined value, and the conducting state of the contact a and the non-conducting state of the contact b have a predetermined value. Is a memory that stores data indicated by values complementary to each other, and when data indicating the state of the a contact is read from the memory, the value is output as it is, and data indicating the state of the b contact is read from the memory. A data output circuit for inverting and reading out the value when read out, and a general-purpose microprocessor instruction for forming a sequence program for processing data indicating the state of each contact stored in the memory as a processing target. Is a programmable controller that performs sequence control by executing the combination of the b-contact data and the b-contact data stored in the memory. By programming a general purpose microprocessor instruction to store inverted to register the data output circuit, b stored in the memory
Performs an AND operation on a load bar instruction of a sequence program that stores data indicating the state of a contact in a register, data that is obtained by inverting data of a contact b stored in a memory by a data output circuit, and data that is stored in a register. By using a general-purpose microprocessor instruction to store the data in a register, the data indicating the state of the contact b stored in the memory and the data indicating the state of a certain contact stored in the register are AND-operated. A general-purpose microprocessor instruction that performs an OR operation on an AND bar instruction of a sequence program, data obtained by inverting data of the b-contact stored in the memory by the data output circuit, and data stored in the register, and storing the result in the register By programming the b connection stored in the memory. And having a data indicating the state of a contact that is stored in the state data and register indicating the Oaba instruction sequence program that OR operation a.

【0023】本発明では、汎用マイクロプロセッサで構
成されたプログラマブルコントローラにおいても、b接
点に関する各命令が汎用マイクロプロセッサ用の対応す
る一命令で実行可能になる。
According to the present invention, even in a programmable controller constituted by a general-purpose microprocessor, each instruction relating to the contact b can be executed by one corresponding instruction for the general-purpose microprocessor.

【0024】[0024]

【発明の実施の形態】以下、本発明をその実施の形態を
示す図面を参照して説明する。図2は本発明に係るプロ
グラマブルコントローラを含むラダープログラムの実行
のためのシステムの構成例を示すブロック図である。な
お、図2においては、本発明のPLC(プログラマブル
コントローラ)20の内部構成例を示すブロック図と、
PLC20により実行されるラダープログラムを設計し
ロードするパーソナルコンピュータ10の模式的外観図
とが併せて示されている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described with reference to the drawings showing the embodiments. FIG. 2 is a block diagram showing a configuration example of a system for executing a ladder program including the programmable controller according to the present invention. FIG. 2 is a block diagram showing an example of the internal configuration of a PLC (programmable controller) 20 of the present invention,
A schematic external view of the personal computer 10 for designing and loading a ladder program executed by the PLC 20 is also shown.

【0025】パーソナルコンピュータ10は、シーケン
スプログラムとしてのラダープログラムの編集機能、ラ
ダープログラムのシミュレーション機能、及びシミュレ
ーション状態のモニタ機能を実現する設計支援のアプリ
ケーションプログラムを、そのプログラムが記録されて
いる磁気ディスク等の記録媒体Dからロードする、等の
機能を有している。
The personal computer 10 includes a design support application program for realizing a function of editing a ladder program as a sequence program, a function of simulating a ladder program, and a function of monitoring a simulation state, such as a magnetic disk on which the program is recorded. And the like from the recording medium D.

【0026】パーソナルコンピュータ10は、ケーブル
を介して本発明のPLC20と接続されている。パーソ
ナルコンピュータ10上で設計されたラダープログラム
は、RS232C等のインターフェイス規格に則ってP
LC20に転送される。また、パーソナルコンピュータ
10にインストールされている前述の設計支援のアプリ
ケーションプログラムは、実機のスイッチ,バルブ,セ
ンサ等のデバイス30に対して、スイッチ,バルブ開閉
の制御信号等の出力、又はマニュアルスイッチの開閉状
態信号,センサの検出信号等の入力による、PLC20
のシーケンス制御の状態を定期的にポーリングして、ス
イッチ,バルブ,センサ等のデバイス30の状態の経時
変化を数値,タイムチャート等で画面表示するモニタ機
能も提供する。
The personal computer 10 is connected to the PLC 20 of the present invention via a cable. A ladder program designed on the personal computer 10 conforms to an interface standard such as RS232C.
Transferred to LC20. The above-described design support application program installed in the personal computer 10 outputs to the devices 30 such as switches, valves, and sensors of the actual machine output of control signals for opening and closing switches and valves, or opening and closing of manual switches. PLC 20 by inputting a state signal, a detection signal of a sensor, or the like.
The present embodiment also provides a monitor function for periodically polling the status of the sequence control of the device 30 and displaying a change over time in the status of the device 30 such as a switch, a valve, or a sensor on a screen with a numerical value, a time chart, or the like.

【0027】本発明のPLC20は、基本的部分は汎用
マイクロプロセッサ(MPU202)を利用しており、
パーソナルコンピュータ10との間でデータをシリアル
転送するシリアル通信インターフェイス(I/F)回路
201を有し、シリアル通信I/F回路201を介して
パーソナルコンピュータ10から転送されたラダープロ
グラムをRAM204に格納する。また、PLC20
は、ラダープログラムの実行時に入出力回路205を介
してスイッチ,バルブ,センサ等のデバイスとの間で入
出力されるデータをRAM204に格納し、パーソナル
コンピュータ10から定期的に送信されてくる要求に応
じて、RAM204に格納されているこれらのデータを
シリアル通信I/F回路201を介してパーソナルコン
ピュータ10に転送する。
The PLC 20 of the present invention basically uses a general-purpose microprocessor (MPU 202).
A serial communication interface (I / F) circuit 201 for serially transferring data to and from the personal computer 10 is provided. The ladder program transferred from the personal computer 10 via the serial communication I / F circuit 201 is stored in the RAM 204. . In addition, PLC20
Stores, in the RAM 204, data input / output to / from switches, valves, sensors, and the like via the input / output circuit 205 when the ladder program is executed, and responds to requests periodically transmitted from the personal computer 10. In response, these data stored in RAM 204 are transferred to personal computer 10 via serial communication I / F circuit 201.

【0028】PLC20のROM203には、パーソナ
ルコンピュータ10からロードされたラダープログラム
を汎用マイクロプロセッサの命令系に変換するプログラ
ム,更にそれをオブジェクトコードに変換するコンパイ
ラ等のシステムプログラムが格納されている。RAM2
04には、ラダープログラム等のユーザプログラムと、
システムプログラム,ユーザプログラムの実行に使用す
るデータがそれぞれ定められたアドレスに格納される。
The ROM 203 of the PLC 20 stores a program for converting a ladder program loaded from the personal computer 10 into an instruction system of a general-purpose microprocessor and a system program such as a compiler for converting the program into object code. RAM2
04 includes a user program such as a ladder program,
Data used for executing the system program and the user program are stored at the predetermined addresses.

【0029】PLC20のMPU202はOSに従っ
て、RAM204に格納されているラダープログラムを
実行して制御対象の実機に配されているスイッチ,バル
ブ,センサ等のデバイス30をシーケンス制御し、必要
に応じて、RAM204に格納されているデータを書き
換える。更に、PLC20は、スイッチ,バルブ,セン
サ等のデバイス30に対して、スイッチ,バルブの開閉
の制御信号等を出力し、またマニュアルスイッチの開閉
の状態信号,センサの検出信号等を入力する入出力回路
205を有する。
The MPU 202 of the PLC 20 executes a ladder program stored in the RAM 204 according to the OS to sequence-control devices 30, such as switches, valves, and sensors, arranged in the actual machine to be controlled. The data stored in the RAM 204 is rewritten. Further, the PLC 20 outputs to the devices 30 such as switches, valves, and sensors a control signal for opening and closing the switches and valves, and inputs and outputs a state signal for opening and closing the manual switches, a detection signal of the sensor, and the like. A circuit 205 is provided.

【0030】なお、PLC20のシリアル通信I/F回
路201には、ラダープログラム等のユーザプログラム
をシーケンス制御の現場等でプログラミング又は編集す
るための簡易携帯型のターミナル(図示省略)からの信
号を有線で、又は無線で入力することも可能である。な
おまた、パーソナルコンピュータ10とPLC20との
間の接続も、有線または無線によることが可能なことは
言うまでもない。
A signal from a simple portable terminal (not shown) for programming or editing a user program such as a ladder program at the site of sequence control is wired to the serial communication I / F circuit 201 of the PLC 20. Or wirelessly. Further, it goes without saying that the connection between the personal computer 10 and the PLC 20 can be made by wire or wireless.

【0031】図3は本発明のPLC20のMPU202
によるRAM204のアクセスのための回路、即ちデー
タ出力回路の構成の一例を示す論理回路図である。
FIG. 3 shows the MPU 202 of the PLC 20 of the present invention.
FIG. 2 is a logic circuit diagram showing an example of the configuration of a circuit for accessing the RAM 204, that is, a data output circuit.

【0032】図3において、参照符号202はMPU
を、204はRAMを前述の如くそれぞれ示しており、
MPU202内には制御手段としてのCPU50と、デ
コーダ51と、参照符号52乃至57で示されているイ
ンバータ,ゲート,ANDゲートが備えられている。な
お、これらの参照符号52乃至57で示されているイン
バータ,ゲート,ANDゲートとデコーダ51とでデー
タ出力回路500が構成される。
In FIG. 3, reference numeral 202 denotes an MPU.
, 204 indicates the RAM as described above, respectively.
The MPU 202 includes a CPU 50 as control means, a decoder 51, and inverters, gates, and AND gates indicated by reference numerals 52 to 57. The data output circuit 500 is composed of the inverter, the gate, the AND gate and the decoder 51 indicated by reference numerals 52 to 57.

【0033】CPU50からはアドレス信号ADDがデ
コーダ51に与えられている。また、CPU50からは
リード/ライト信号R/#Wが2入力のANDゲート5
3,54の一方の入力端子に与えられている他、ゲート
57には制御信号としてその負論理の制御端子に与えら
れている。
An address signal ADD is supplied from the CPU 50 to the decoder 51. Also, the read / write signal R / # W from the CPU 50 receives a 2-input AND gate 5
The gate 57 is provided with a negative logic control terminal as a control signal in addition to one of the input terminals 3 and 54.

【0034】ANDゲート53の他方の入力端子にはデ
コーダ51からのリードデータ反転信号#RDがインバ
ータ52により反転された上で入力されており、AND
ゲート54の他方の入力端子にはデコーダ51からのリ
ードデータ反転信号#RDがそのまま入力されている。
そして、ANDゲート53の出力信号はゲート55の制
御端子に制御信号として、ANDゲート54の出力信号
は負論理のゲート(以下、反転ゲートという)56の制
御端子に制御信号として、それぞれ与えられている。
A read data inversion signal #RD from the decoder 51 is input to the other input terminal of the AND gate 53 after being inverted by the inverter 52.
The read data inversion signal #RD from the decoder 51 is input to the other input terminal of the gate 54 as it is.
The output signal of the AND gate 53 is supplied as a control signal to a control terminal of a gate 55, and the output signal of the AND gate 54 is supplied as a control signal to a control terminal of a negative logic gate (hereinafter referred to as an inversion gate) 56. I have.

【0035】なお、デコーダ51はCPU50からアド
レス信号ADDが与えられた場合、その特定のビットの
値が”0”である場合はそのアドレス信号ADDで指定
されるメモリアドレスでRAM204の接点参照空間2
04aをアクセスすると共に、リードデータ反転信号#
RDとしてローレベル(”0”)の信号を出力する。一
方、デコーダ51はCPU50からアドレス信号ADD
が与えられた場合、その特定のビットの値が”1”であ
る場合はそのビットを”0”としたアドレス信号ADD
で指定されるメモリアドレスで接点参照空間204aを
アクセスすると共に、リードデータ反転信号#RDとし
てハイレベル(”1”)の信号を出力する。なお、この
デコーダ51から出力されるリードデータ反転信号#R
Dは前述の如く、インバータ52の入力端子及びAND
ゲート54の他方の入力端子に与えられる。
When the address signal ADD is given from the CPU 50 and the value of the specific bit is "0", the decoder 51 uses the memory address specified by the address signal ADD to store the contact reference space 2 in the RAM 204.
04a and the read data inversion signal #
A low level (“0”) signal is output as RD. On the other hand, the decoder 51 outputs the address signal ADD from the CPU 50.
Is given, when the value of the specific bit is “1”, the address signal ADD is set to “0”.
The contact reference space 204a is accessed with the memory address specified by, and a high-level (“1”) signal is output as the read data inversion signal #RD. The read data inversion signal #R output from the decoder 51
D is the input terminal of the inverter 52 and AND
The other input terminal of the gate 54 is provided.

【0036】ゲート55及び反転ゲート56は共に、R
AM204からCPU50へのデータの読み出し(リー
ド)の際に使用される。具体的には、ゲート55はCP
U50から出力されるリード/ライト信号R/#Wが”
1”である場合、即ち読み出しを指示しており、且つA
NDゲート53の出力信号が”1”である場合にRAM
204から出力されるデータの信号をそのままCPU5
0に入力し、反転ゲート56はCPU50から出力され
るリード/ライト信号R/#Wが”1”である場合、即
ち読み出しを指示しており、且つANDゲート54の出
力信号が”1”である場合にRAM204から出力され
るデータの信号を反転してCPU50に入力する。
The gate 55 and the inverting gate 56 are both R
It is used when reading data from the AM 204 to the CPU 50 (read). Specifically, the gate 55 is
The read / write signal R / # W output from U50 is "
1 ", that is, the reading is instructed, and A
When the output signal of the ND gate 53 is "1", the RAM
The data signal output from the CPU 204
0, the inverting gate 56 indicates that the read / write signal R / # W output from the CPU 50 is “1”, that is, instructs reading, and the output signal of the AND gate 54 is “1”. In some cases, the data signal output from the RAM 204 is inverted and input to the CPU 50.

【0037】一方、ゲート57はCPU50からRAM
204へのデータの書き込み(ライト)の際に使用され
る。具体的には、ゲート57はCPU50から出力され
るリード/ライト信号R/#Wが”0”である場合、即
ち書き込みを指示している場合に、CPU50から出力
されたデータ信号をRAM204に入力する。
On the other hand, the gate 57 is connected to the RAM from the CPU 50.
It is used at the time of writing data (writing) to the data 204. Specifically, the gate 57 inputs the data signal output from the CPU 50 to the RAM 204 when the read / write signal R / # W output from the CPU 50 is “0”, that is, when the write is instructed. I do.

【0038】従って、CPU50から特定のビットの値
が”0”であるアドレス信号ADDがデコーダ51に入
力されるとそのアドレス値はそのままRAM204の接
点参照空間204aに与えられてメモリアクセスが行な
われる。この際には、CPU50からは”1”のリード
/ライト信号R/#Wが出力されてANDゲート53に
入力されており、デコーダ51からは”0”のリードデ
ータ反転信号#RDが出力されている。デコーダ51か
らのリードデータ反転信号#RDはインバータ52で反
転された上でANDゲート53,54の一方の入力端子
及びゲート57の負論理の制御端子に入力されているの
で、ANDゲート53の出力信号は”1”になりゲート
55は導通状態になる。なお、ANDゲート54には”
0”のリードデータ反転信号#RDが入力されるので、
その出力信号は”0”になり、ゲート56は非導通状態
に維持される。また、ゲート57の負論理の制御端子に
は”1”のリード/ライト信号R/#Wが入力されるの
で非導通状態を維持する。従って、この場合にはゲート
55のみが導通して接点参照空間204aからアドレス
信号ADDに対応して出力されたデータの信号がそのま
まCPU50に入力される。
Therefore, when an address signal ADD having a specific bit value of "0" is input from the CPU 50 to the decoder 51, the address value is directly supplied to the contact reference space 204a of the RAM 204 to perform memory access. At this time, a read / write signal R / # W of “1” is output from the CPU 50 and input to the AND gate 53, and a read data inversion signal #RD of “0” is output from the decoder 51. ing. Since the read data inversion signal #RD from the decoder 51 is inverted by the inverter 52 and is input to one of the input terminals of the AND gates 53 and 54 and the negative logic control terminal of the gate 57, the output of the AND gate 53 is output. The signal becomes "1" and the gate 55 becomes conductive. The AND gate 54 has "
Since the read data inverted signal #RD of “0” is input,
The output signal becomes "0", and the gate 56 is maintained in a non-conductive state. Further, since the read / write signal R / # W of "1" is input to the negative logic control terminal of the gate 57, the non-conductive state is maintained. Therefore, in this case, only the gate 55 is turned on, and the data signal output from the contact reference space 204a in response to the address signal ADD is directly input to the CPU 50.

【0039】これに対して、CPU50から特定のビッ
トの値が”1”であるアドレス信号ADDがデコーダ5
1に入力されるとそのアドレス値は特定のビットの値
が”0”に変換されて接点参照空間204aに与えられ
てメモリアクセスが行なわれる。またこの際、CPU5
0からは”1”のリード/ライト信号R/#Wが出力さ
れてANDゲート53,54の一方の入力端子及びゲー
ト57の制御端子に入力されており、デコーダ51から
はこの場合には”1”のリードデータ反転信号#RDが
出力されている。デコーダ51からのリードデータ反転
信号#RDはインバータ52で反転されて”0”の信号
としてANDゲート53に入力されているので、AND
ゲート53の出力信号は”0”になりゲート55は非導
通状態を維持する。ANDゲート54には”1”のリー
ドデータ反転信号#RDが入力されるので、その出力信
号は”1”になり、ゲート56は導通状態になる。ま
た、ゲート57はその負論理の制御端子に”1”のリー
ド/ライト信号R/#Wが入力されるので非導通状態を
維持する。従って、この場合にはゲート56のみが導通
して接点参照空間204aからアドレス信号ADDに対
応して出力されたデータの信号が反転された上でCPU
50に入力される。
On the other hand, an address signal ADD whose specific bit value is “1” is supplied from the CPU 50 to the decoder 5.
When the address value is input to 1, the value of the specific bit is converted to "0" in the address value, and the converted value is applied to the contact reference space 204a to perform a memory access. At this time, the CPU 5
From 0, a read / write signal R / # W of "1" is output and input to one of the input terminals of the AND gates 53 and 54 and the control terminal of the gate 57, and the decoder 51 outputs "1" in this case. The read data inversion signal #RD of “1” is output. The read data inversion signal #RD from the decoder 51 is inverted by the inverter 52 and input to the AND gate 53 as a signal of “0”.
The output signal of the gate 53 becomes "0", and the gate 55 maintains the non-conductive state. Since the read data inversion signal #RD of "1" is input to the AND gate 54, the output signal thereof becomes "1" and the gate 56 becomes conductive. The gate 57 is kept in a non-conductive state because the read / write signal R / # W of "1" is inputted to its negative logic control terminal. Therefore, in this case, only the gate 56 becomes conductive, the data signal output from the contact reference space 204a corresponding to the address signal ADD is inverted, and the CPU
50 is input.

【0040】なお、リード/ライト信号R/#Wがデー
タの書き込み(ライト)を指示している場合にはその値
は”0”になるので、ANDゲート53,54は共にそ
の出力信号が”0”になり、ゲート55,56は共に非
導通状態になる。しかし、ゲート57はその負論理の制
御端子に”0”のリード/ライト信号R/#Wが与えら
れるので導通状態になる。従って、この場合にはゲート
57のみが導通するので、CPU50から出力されたデ
ータの信号が接点参照空間204aに入力され、同時に
CPU50から出力されているアドレス信号ADDに対
応するアドレスに書き込まれる。
When the read / write signal R / # W indicates a data write (write), the value is "0", and the output signal of both AND gates 53 and 54 is "0". 0 ", and the gates 55 and 56 are both turned off. However, the gate 57 is rendered conductive because the read / write signal R / # W of "0" is supplied to its negative logic control terminal. Therefore, in this case, since only the gate 57 is turned on, the data signal output from the CPU 50 is input to the contact reference space 204a, and is simultaneously written to the address corresponding to the address signal ADD output from the CPU 50.

【0041】MPU202は、前述のようにOSに従っ
て、RAM204のその他の空間204cに格納されて
いるラダープログラムを実行し、入出力回路205を介
して制御信号等を出力してスイッチ,バルブ,センサ等
のデバイス30をシーケンス制御し、それらとの間で入
出力されるデータを接点参照空間204aに格納する。
そして、必要に応じて、接点参照空間204aに格納さ
れているデータを書き換える。更に、MPU202は、
パーソナルコンピュータ10から定期的に送信されてく
る要求に応じて、接点参照空間204aに格納されてい
るこれらのデータはシリアル通信I/F回路201を介
してパーソナルコンピュータ10に転送される。
The MPU 202 executes the ladder program stored in the other space 204c of the RAM 204 according to the OS as described above, and outputs control signals and the like via the input / output circuit 205 to output switches, valves, sensors, and the like. Of the device 30 in sequence, and data input / output to / from the device 30 is stored in the contact reference space 204a.
Then, if necessary, the data stored in the contact reference space 204a is rewritten. Further, the MPU 202
These data stored in the contact reference space 204a are transferred to the personal computer 10 via the serial communication I / F circuit 201 in response to a request periodically transmitted from the personal computer 10.

【0042】ところで、RAM204の接点参照空間2
04aには図4に示されているように、各接点C1,C
2,C3,C4…の開閉状態を示すデータが格納されて
いる。具体的には、接点参照空間204aのアドレス”
0000”には接点C1の状態”1”が、アドレス”0
001”には接点C2の状態”0”が、アドレス”00
10”には接点C3の状態”1”が、アドレス”001
1”には接点C4の状態”1”が、というように各接点
の開閉状態を示すデータが格納されている。なお、デー
タの”0”はその接点が通常の状態であることを、即ち
a接点であれば非導通状態であることを、b接点であれ
ば導通状態であることを示し、データの”1”はその接
点が通常の状態ではないことを、即ちa接点であれば導
通状態であることを、b接点であれば非導通状態である
ことを示している。
By the way, the contact reference space 2 of the RAM 204
04a, as shown in FIG. 4, each contact C1, C
2, C3, C4... Are stored. Specifically, the address of the contact reference space 204a "
0000 ”indicates the state“ 1 ”of the contact C1 and the address“ 0 ”.
001 ”indicates the state“ 0 ”of the contact C2 and the address“ 00 ”.
10 ”, the state“ 1 ”of the contact C3 is stored in the address“ 001 ”.
Data indicating the open / closed state of each contact is stored in "1" such as the state "1" of the contact C4, and "0" in the data indicates that the contact is in a normal state, that is, A contact indicates a non-conducting state, a b contact indicates a conducting state, and data "1" indicates that the contact is not in a normal state, that is, a contact indicates a conducting state. The state indicates that the contact is non-conductive if the contact is b.

【0043】一方、上述のような接点参照空間204a
の内容がMPU202側から見て反転して見える仮想反
転接点参照空間204bを考えると、それには図4に示
されているように、各接点C1,C2,C3,C4…の
状態を示すデータを反転したデータが格納されているこ
とになる。具体的には、仮想反転接点参照空間204b
のアドレス”0000”には接点C1の反転状態”0”
が、アドレス”0001”には接点C2の反転状態”
1”が、アドレス”0010”には接点C3の反転状
態”0”が、アドレス”0011”には接点C4の反転
状態”0”が、というように各接点の開閉状態の反転状
態を示すデータが格納されていると見做すことが出来
る。
On the other hand, the contact reference space 204a as described above
Considering the virtual inversion contact reference space 204b in which the contents of the contact point appear to be inverted when viewed from the MPU 202 side, data indicating the state of each of the contacts C1, C2, C3, C4,. This means that the inverted data is stored. Specifically, the virtual inversion contact reference space 204b
Address "0000" of the contact C1 has the inverted state "0"
However, the address "0001" has an inverted state of the contact C2.
Data indicating the inverted state of the open / close state of each contact, such as 1 ", the inverted state" 0 "of the contact C3 at the address" 0010 ", the inverted state" 0 "of the contact C4 at the address" 0011 ", and so on. Is stored.

【0044】従って、仮想反転接点参照空間204bに
格納されていると見做されるデータ”0”はその接点が
通常の状態ではないことを、即ちa接点であれば導通状
態であることを、b接点であれば非導通状態であること
を示し、データの”1”はその接点が通常の状態である
ことを、即ちa接点であれば非導通状態であることを、
b接点であれば導通状態であることを示している。
Therefore, the data "0" considered to be stored in the virtual inversion contact reference space 204b indicates that the contact is not in a normal state, that is, the contact is a conductive state if the contact is a. A contact b indicates a non-conducting state, and data "1" indicates that the contact is in a normal state, that is, a contact indicates a non-conducting state.
If it is a contact b, it indicates that it is in a conductive state.

【0045】このような仮想反転接点参照空間204b
への仮想的なアクセスを可能にするための回路が前述の
図3に示されている回路である。但し、このような仮想
反転接点参照空間204bへの汎用マイクロプロセッサ
の命令実行の際のアクセスは、ニモニックを使用して記
述されたラダープログラムを汎用マイクロプロセッサの
命令系を経てオブジェクトコードにコンパイラでコンパ
イルする際に、b接点に関する命令、即ちロードバー,
アンドバー,オアバー等の命令の接点参照のためのメモ
リアドレスに関する部分を仮想反転接点参照空間204
bを参照するためのアドレスに変換しておくことにより
容易に可能である。具体的には、ロードバー,アンドバ
ー,オアバー等の命令が接点C1に関して記述されてい
る場合には、実際のアクセスアドレスをプログラム中に
記述されている実際のメモリアドレスである接点参照空
間204aのアドレス”0000”から仮想反転接点参
照空間204bを参照するためのアドレス”0100”
に変換しておけばよい。
Such a virtual inversion contact reference space 204b
The circuit for enabling virtual access to the above is the circuit shown in FIG. However, access to such a virtual inversion contact reference space 204b when a general-purpose microprocessor executes an instruction is performed by compiling a ladder program described using a mnemonic into an object code via an instruction system of the general-purpose microprocessor. In doing so, the command for the b-contact, ie, the load bar,
A portion related to a memory address for contact reference of an instruction such as an AND bar or an OR bar is stored in a virtual inverted contact reference space 204.
This can be easily performed by converting b into an address for reference. More specifically, when instructions such as a load bar, an AND bar, and an OR bar are described with respect to the contact C1, the actual access address is replaced with the address of the contact reference space 204a, which is the actual memory address described in the program. An address “0100” for referring to the virtual inversion contact reference space 204b from “0000”
Should be converted to

【0046】但し、コンパイラに代えて、命令の実行時
に個々の命令をインタプリータによりインタプリートし
てもよいことはいうまでもなく、その場合にも上述同様
の手法でアドレスの変換を行なえばよい。
However, it goes without saying that individual instructions may be interpreted by the interpreter at the time of execution of the instructions, instead of the compiler. In such a case, the address may be converted by the same method as described above.

【0047】このような接点参照空間204aに対応し
た仮想反転接点参照空間204bを仮想的にアクセスす
る場合、たとえば、接点参照空間204aのアドレス”
0000”に格納されている接点C1の状態の状態を示
すデータを読み出してレジスタに格納するラダープログ
ラムのロード命令(この場合、接点C1はa接点)は、
従来の汎用マイクロプロセッサでも本発明のPLC20
でも LD C1 :mem 0000→ reg A の一命令の実行で実現される。但し、reg Aは任意のレ
ジスタを示す。
When the virtual inversion contact reference space 204b corresponding to the contact reference space 204a is virtually accessed, for example, the address "of the contact reference space 204a"
The load instruction of the ladder program (in this case, the contact C1 is the contact a) in which the data indicating the state of the contact C1 stored in “0000” is read and stored in the register,
The PLC 20 of the present invention can be used in a conventional general-purpose microprocessor.
However, LD C1 is realized by executing one instruction of mem 0000 → reg A. Here, reg A indicates an arbitrary register.

【0048】具体的には、CPU50からRAM204
の接点参照空間204aのアドレス”0000”がデコ
ーダ51に出力されるが、デコーダ51はこのアドレス
をデコードして接点参照空間204aに対してはアドレ
スとして”0000”を出力する。その一方でデコーダ
51は”0”のリードデータ反転信号#RDを出力する
ので、前述のようにして、接点参照空間204aから読
み出されたデータ”1”がそのままゲート55を経由し
てとしてCPU50に入力される。この”1”のデータ
は接点C1の状態を示すデータとしてレジスタに格納さ
れる。従って、最終的にレジスタに格納されたデータは
a接点である接点C1の実際の状態を示すデータであ
る。
Specifically, from the CPU 50 to the RAM 204
The address "0000" of the contact reference space 204a is output to the decoder 51. The decoder 51 decodes this address and outputs "0000" as an address to the contact reference space 204a. On the other hand, since the decoder 51 outputs the read data inversion signal #RD of “0”, as described above, the data “1” read from the contact reference space 204 a passes through the gate 55 as it is, and the CPU 50 Is input to The data "1" is stored in the register as data indicating the state of the contact C1. Therefore, the data finally stored in the register is data indicating the actual state of the contact C1, which is the a contact.

【0049】しかし、接点C1がb接点である場合に
は、従来の汎用マイクロプロセッサでは実際には前述の
ようにロードバー命令になるので、 LDB C1:mem 0000→ reg A, #reg A→reg A のように二命令が必要であるが、本発明のPLC20で
はa接点の場合と同様に、 LDB C1:mem 0100→ reg A の一命令の実行で実現される。
However, when the contact C1 is a contact b, the conventional general-purpose microprocessor actually becomes a load bar instruction as described above, so that LDB C1: mem 0000 → reg A, #reg A → reg Although two instructions are required like A, the PLC 20 of the present invention is realized by executing one instruction of LDB C1: mem 0100 → reg A as in the case of the a contact.

【0050】具体的には、CPU50からRAM204
の接点参照空間204aのアドレス”0100”がデコ
ーダ51に出力されるが、デコーダ51はこのアドレス
をデコードして接点参照空間204aに対してはアドレ
スとして”0000”を出力する。その一方でデコーダ
51は”1”のリードデータ反転信号#RDを出力する
ので、前述のようにして、接点参照空間204aから読
み出されたデータ”1”がゲート56で反転されて”
0”としてCPU50に入力される。この本来は”1”
のデータを反転した”0”のデータが接点C1の状態を
示すデータとしてレジスタに格納される。従って、最終
的にレジスタに格納されたデータはb接点である接点C
1の実際の状態を示すデータと見做せるので、レジスタ
から再度読み出して反転する必要はない。
More specifically, the CPU 50 sends the RAM 204
The address "0100" of the contact reference space 204a is output to the decoder 51. The decoder 51 decodes this address and outputs "0000" as an address to the contact reference space 204a. On the other hand, since the decoder 51 outputs the read data inversion signal #RD of “1”, the data “1” read from the contact reference space 204a is inverted by the gate 56 as described above,
The data is input to the CPU 50 as "0".
The data "0" obtained by inverting the data of "1" is stored in the register as data indicating the state of the contact point C1. Therefore, the data finally stored in the register is the contact C which is the b contact.
Since it can be regarded as data indicating the actual state of 1, there is no need to read out again from the register and invert it.

【0051】またたとえば、メモリのアドレス”000
1”の接点C2の状態を読み出してレジスタに格納され
ているある接点の状態を示すデータとアンド演算を行な
い、その結果を再度レジスタに格納するラダープログラ
ムのアンド命令(接点C2はa接点)は、従来の汎用マ
イクロプロセッサでも本発明のPLC20でも AND C2:reg A ∧ mem 0001 → reg A の一命令の実行で実現される。
Further, for example, a memory address "000"
The AND instruction of the ladder program that reads the state of the contact C2 of 1 ", performs AND operation with the data indicating the state of a certain contact stored in the register, and stores the result in the register again (contact C2 is a contact a) Both the conventional general-purpose microprocessor and the PLC 20 of the present invention can be realized by executing one instruction of AND C2: reg A ∧ mem 0001 → reg A.

【0052】具体的には、CPU50からRAM204
の接点参照空間204aのアドレス”0001”がデコ
ーダ51に出力されるが、デコーダ51はこのアドレス
をデコードして接点参照空間204aに対してはアドレ
スとして”0001”を出力する。その一方でデコーダ
51は”0”のリードデータ反転信号#RDを出力する
ので、前述のようにして、接点参照空間204aから読
み出されたデータ”0”がそのままゲート55を経由し
てCPU50に入力される。この”0”のデータを接点
C2の状態を示すデータとしてそのままレジスタの内容
とアンド演算し、その結果をそのままレジスタに格納す
る。
More specifically, from the CPU 50 to the RAM 204
Is output to the decoder 51. The decoder 51 decodes this address and outputs "0001" as an address to the contact reference space 204a. On the other hand, since the decoder 51 outputs the read data inversion signal #RD of “0”, the data “0” read from the contact reference space 204 a is directly transmitted to the CPU 50 via the gate 55 as described above. Is entered. The "0" data is ANDed with the contents of the register as it is as the data indicating the state of the contact point C2, and the result is stored in the register as it is.

【0053】しかし、接点C2がb接点である場合に
は、従来の汎用マイクロプロセッサでは実際には前述の
ようにアンドバー命令になるので、 ANB C2:#reg A→reg A, reg A∨ mem 0001 →reg A, #
reg A →reg A のように三命令が必要であるが、本発明のPLC20で
は、 ANB C2:reg A ∧ mem 0101 → reg A の一命令の実行で実現される。
However, when the contact C2 is a contact b, the conventional general-purpose microprocessor actually performs an AND bar instruction as described above. ANB C2: #reg A → reg A, reg A∨mem 0001 → reg A, #
Although three instructions such as reg A → reg A are required, in the PLC 20 of the present invention, ANB C2: reg A∧mem 0101 → reg A is executed by executing one instruction.

【0054】具体的には、CPU50からRAM204
の接点参照空間204aのアドレス”0101”がデコ
ーダ51に出力されるが、デコーダ51はこのアドレス
をデコードして接点参照空間204aに対してはアドレ
スとして”0001”を出力する。その一方でデコーダ
51は”1”のリードデータ反転信号#RDを出力する
ので、前述のようにして、接点参照空間204aから読
み出されたデータ”0”がゲート56で反転されて”
1”としてCPU50に入力される。この本来は”0”
のデータを反転した”1”のデータを接点C2の状態を
示すデータとしてそのままレジスタの内容とアンド演算
し、その結果をそのままレジスタに格納する。従って、
最終的にレジスタに格納されたデータはb接点である接
点C2の実際の状態を示すデータと見做せるので、レジ
スタから再度読み出して反転する必要はない。
More specifically, from the CPU 50 to the RAM 204
The address "0101" of the contact reference space 204a is output to the decoder 51. The decoder 51 decodes this address and outputs "0001" as an address to the contact reference space 204a. On the other hand, since the decoder 51 outputs the read data inversion signal #RD of "1", the data "0" read from the contact reference space 204a is inverted by the gate 56 as described above.
The data is input to the CPU 50 as "1".
The data "1" obtained by inverting the data "1" is ANDed with the contents of the register as data indicating the state of the contact point C2, and the result is stored in the register as it is. Therefore,
The data finally stored in the register can be regarded as data indicating the actual state of the contact C2, which is the b-contact, so that there is no need to read out again from the register and invert it.

【0055】更にたとえば、メモリのアドレス”001
0”の接点C3の状態を示すデータを読み出してレジス
タのデータとオア演算を行ない、その結果を再度レジス
タに格納するラダープログラムのオア命令(接点C3は
a接点)は、従来の汎用マイクロプロセッサでも本発明
のPLC20でも OR C3 :reg A ∨ mem 0010 → reg A の一命令の実行で実現される。
Further, for example, the memory address "001"
The OR instruction of the ladder program (contact C3 is a contact) for reading data indicating the state of the contact C3 of 0 ", performing OR operation on the data of the register, and storing the result in the register again, is a conventional general-purpose microprocessor. The PLC 20 of the present invention is also realized by executing one instruction of OR C3: reg A → mem 0010 → reg A.

【0056】具体的には、CPU50からRAM204
の接点参照空間204aのアドレス”0010”がデコ
ーダ51に出力されるが、デコーダ51はこのアドレス
をデコードして接点参照空間204aに対してはアドレ
スとして”0010”を出力する。その一方でデコーダ
51は”0”のリードデータ反転信号#RDを出力する
ので、前述のようにして、接点参照空間204aから読
み出されたデータ”1”がそのままゲート55を経由し
てCPU50に入力される。この”1”のデータを接点
C3の状態を示すデータとしてそのままレジスタの内容
とオア演算し、その結果をそのままレジスタに格納す
る。
More specifically, the CPU 50 sends the RAM 204
The address "0010" of the contact reference space 204a is output to the decoder 51. The decoder 51 decodes this address and outputs "0010" as an address to the contact reference space 204a. On the other hand, since the decoder 51 outputs the read data inversion signal #RD of “0”, as described above, the data “1” read from the contact reference space 204 a is directly transmitted to the CPU 50 via the gate 55. Is entered. The data of “1” is ORed with the contents of the register as it is as the data indicating the state of the contact point C3, and the result is stored in the register as it is.

【0057】しかし、接点C3がb接点である場合に
は、従来の汎用マイクロプロセッサでは実際には前述の
ようにオアバー命令になるので、 ORB C3:#reg A→reg A, reg A∧ mem 0010 →reg A, #
reg A →reg A のように三命令が必要であるが、本発明のPLC20で
は、 ORB C3:reg A ∨ mem 0110 → reg A の一命令の実行で実現される。
However, when the contact C3 is a contact b, the conventional general-purpose microprocessor actually performs an OR instruction as described above. Therefore, ORB C3: #reg A → reg A, reg A∧ mem 0010 → reg A, #
Although three instructions such as reg A → reg A are required, the PLC 20 of the present invention is realized by executing one instruction of ORB C3: reg A∨mem 0110 → reg A.

【0058】具体的には、CPU50からRAM204
の接点参照空間204aのアドレス”0110”がデコ
ーダ51に出力されるが、デコーダ51はこのアドレス
をデコードして接点参照空間204aに対してはアドレ
スとして”0010”を出力する。その一方でデコーダ
51は”1”のリードデータ反転信号#RDを出力する
ので、前述のようにして、接点参照空間204aから読
み出されたデータ”1”がゲート56で反転されて”
0”としてCPU50に入力される。この本来は”1”
のデータを反転した”0”のデータを接点C3の状態を
示すデータとしてそのままレジスタの内容とオア演算
し、その結果をそのままレジスタに格納する。従って、
最終的にレジスタに格納されたデータはb接点である接
点C3の実際の状態を示すデータと見做せるので、レジ
スタから再度読み出して反転する必要はない。
More specifically, the CPU 50 sends the RAM 204
Is output to the decoder 51. The decoder 51 decodes this address and outputs "0010" as an address to the contact reference space 204a. On the other hand, since the decoder 51 outputs the read data inversion signal #RD of “1”, the data “1” read from the contact reference space 204a is inverted by the gate 56 as described above,
The data is input to the CPU 50 as "0".
Is ORed with the contents of the register as data indicating the state of the contact point C3, and the result is stored in the register as it is. Therefore,
Finally, the data stored in the register can be regarded as data indicating the actual state of the contact C3, which is the b-contact, so that there is no need to read the register again and invert it.

【0059】なお、前述の図3に示されているデータ出
力回路500の構成は一例であって、同様の機能を発揮
する回路であれば他の構成を採ってもよいことは言うま
でもない。
The configuration of the data output circuit 500 shown in FIG. 3 described above is merely an example, and it goes without saying that another configuration may be employed as long as the circuit exerts the same function.

【0060】また、上述の実施の形態においては、パー
ソナルコンピュータ10に接続されているPLC20に
本発明が適用されているが、パーソナルコンピュータ1
0においてはラダープログラムのシミュレーションを行
なうことが可能になっているため、このパーソナルコン
ピュータ10に本発明を適用してもよいことは言うまで
もない。
In the above-described embodiment, the present invention is applied to the PLC 20 connected to the personal computer 10.
At 0, the ladder program can be simulated, so that the present invention may be applied to the personal computer 10.

【0061】[0061]

【発明の効果】以上に詳述したように本発明によれば、
汎用マイクロプロセッサを利用したプログラマブルコン
トローラにおいても、b接点に関する各命令を一命令で
実行可能になるので、従来の汎用マイクロプロセッサを
利用する場合に比してより高速に実行し得る。
As described in detail above, according to the present invention,
Even in a programmable controller using a general-purpose microprocessor, each instruction relating to the contact b can be executed by one instruction, so that it can be executed at a higher speed than when a conventional general-purpose microprocessor is used.

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

【図1】ラダープログラムで使用される代表的な命令語
を示す模式図である。
FIG. 1 is a schematic diagram showing typical instruction words used in a ladder program.

【図2】本発明に係るプログラマブルコントローラを含
むラダープログラムの実行のためのシステムの構成例を
示すブロック図である。
FIG. 2 is a block diagram illustrating a configuration example of a system for executing a ladder program including a programmable controller according to the present invention.

【図3】本発明に係るプログラマブルコントローラのメ
モリアクセスのための回路、即ちデータ出力回路の構成
の一例を示す論理回路図である。
FIG. 3 is a logic circuit diagram showing an example of a configuration of a memory access circuit of a programmable controller according to the present invention, that is, a data output circuit.

【図4】本発明のプログラマブルコントローラのRAM
のメモリ空間の構成を示す模式図である。
FIG. 4 is a RAM of the programmable controller of the present invention.
FIG. 3 is a schematic diagram showing a configuration of a memory space of FIG.

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

20 PLC(プログラマブルコントローラ) 50 CPU 51 デコーダ 54 ANDゲート 56 反転ゲート 202 MPU 203 ROM(コンパイラ) 204 RAM 204a 接点参照空間 Reference Signs List 20 PLC (Programmable Controller) 50 CPU 51 Decoder 54 AND Gate 56 Inverting Gate 202 MPU 203 ROM (Compiler) 204 RAM 204a Contact Reference Space

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 シーケンス制御に係るa接点の非導通状
態及びb接点の導通状態を所定の値で、a接点の導通状
態及びb接点の非導通状態を前記所定の値とは相補関係
にある値でそれぞれ示すデータを記憶するメモリを備
え、前記メモリに記憶された各接点の状態を示すデータ
を処理対象とするシーケンスプログラムを構成する命令
を汎用マイクロプロセッサ用命令を組み合わせて実行す
ることによりシーケンス制御を行なうプログラマブルコ
ントローラにおいて、 a接点の状態を示すデータが前記メモリから読み出され
た場合はその値をそのまま出力し、b接点の状態を示す
データが前記メモリから読み出された場合はその値を反
転して出力するデータ出力回路を備え、 a接点を処理対象とするシーケンスプログラムの命令の
実行に際しては、前記メモリから読み出されたデータを
そのまま使用し、 b接点を処理対象とするシーケンスプログラムの命令の
実行に際しては、前記メモリから読み出されたデータを
前記データ出力回路により反転したデータを使用すべく
なしてあることを特徴とするプログラマブルコントロー
ラ。
1. A non-conducting state of an a-contact and a conducting state of a b-contact according to sequence control have a predetermined value, and a conducting state of an a-contact and a non-conducting state of a b contact have a complementary relationship with the predetermined value. A memory for storing data indicated by values, and executing a command constituting a sequence program for processing data indicating a state of each contact stored in the memory in combination with a general-purpose microprocessor command; In the programmable controller that performs control, when data indicating the state of contact a is read from the memory, the value is output as it is, and when data indicating the state of contact b is read from the memory, the value is output. A data output circuit that inverts and outputs a signal. The data read from the memory is used as it is, and the data output circuit inverts the data read from the memory when executing the sequence program instruction for processing the b contact. A programmable controller characterized by what it does.
【請求項2】 前記シーケンスプログラムの各命令をコ
ンパイルする際に、各a接点に関する命令に含まれるメ
モリアドレスはそのまま、各b接点に関する命令に含ま
れるメモリアドレスは前記所定の関係に対応付けられた
アドレスに変換するコンパイラを備え、 前記データ出力回路は、各命令に含まれるメモリアドレ
スをデコードするデコード手段と、該デコード手段によ
るデコード結果に基づいて、前記メモリから読み出され
た値をそのまま出力するか、または反転して出力する手
段とを有することを特徴とする請求項1に記載のプログ
ラマブルコントローラ。
2. When compiling each instruction of the sequence program, a memory address included in an instruction relating to each a contact is kept as it is, and a memory address included in an instruction relating to each b contact is associated with the predetermined relationship. A data output circuit that decodes a memory address included in each instruction; and outputs a value read from the memory as it is based on a decoding result by the decoding means. 2. The programmable controller according to claim 1, further comprising means for inverting and outputting.
【請求項3】 シーケンス制御に係るa接点の非導通状
態及びb接点の導通状態を所定の値で、a接点の導通状
態及びb接点の非導通状態を前記所定の値とは相補関係
にある値でそれぞれ示すデータを記憶するメモリと、a
接点の状態を示すデータが前記メモリから読み出された
場合はその値をそのまま出力し、b接点の状態を示すデ
ータが前記メモリから読み出された場合はその値を反転
して出力するデータ出力回路とを備え、前記メモリに記
憶された各接点の状態を示すデータを処理対象とするシ
ーケンスプログラムを構成する命令を汎用マイクロプロ
セッサ用命令を組み合わせて実行することによりシーケ
ンス制御を行なうプログラマブルコントローラにおい
て、 前記メモリに格納されている前記b接点のデータを前記
データ出力回路で反転してレジスタに格納するように汎
用マイクロプロセッサ用命令でプログラミングすること
により、メモリに格納されているb接点の状態を示すデ
ータを前記レジスタに格納するシーケンスプログラムの
ロードバー命令と、 前記メモリに格納されている前記b接点のデータを前記
データ出力回路で反転したデータと前記レジスタに格納
されているデータとをアンド演算して前記レジスタに格
納するように汎用マイクロプロセッサ用命令でプログラ
ミングすることにより、メモリに格納されているb接点
の状態を示すデータとレジスタに格納されているある接
点の状態を示すデータとをアンド演算するシーケンスプ
ログラムのアンドバー命令と、 前記メモリに格納されている前記b接点のデータを前記
データ出力回路で反転したデータと前記レジスタに格納
されているデータとをオア演算して前記レジスタに格納
するように汎用マイクロプロセッサ用命令でプログラミ
ングすることにより、メモリに格納されているb接点の
状態を示すデータとレジスタに格納されているある接点
の状態を示すデータとをオア演算するシーケンスプログ
ラムのオアバー命令とを有することを特徴とするプログ
ラマブルコントローラ。
3. The non-conducting state of the a-contact and the conducting state of the b-contact according to the sequence control have a predetermined value, and the conducting state of the a-contact and the non-conducting state of the b contact have a complementary relationship with the predetermined value. A memory for storing data represented by values, a
When the data indicating the state of the contact is read from the memory, the value is output as it is, and when the data indicating the state of the contact b is read from the memory, the value is inverted and output. And a programmable controller that performs sequence control by executing, in combination with a general-purpose microprocessor instruction, an instruction that constitutes a sequence program for processing data indicating the state of each contact stored in the memory. The state of the b-contact stored in the memory is indicated by programming with a general-purpose microprocessor instruction so that the data of the b-contact stored in the memory is inverted by the data output circuit and stored in a register. Load bar instruction of a sequence program for storing data in the register And a general-purpose microprocessor instruction for performing an AND operation on data obtained by inverting the data of the b-contact stored in the memory by the data output circuit and data stored in the register and storing the result in the register. By programming with, an AND bar instruction of a sequence program for performing an AND operation on the data indicating the state of the contact b stored in the memory and the data indicating the state of a certain contact stored in the register, and stored in the memory The data obtained by inverting the data at the contact b by the data output circuit and the data stored in the register are OR-operated and programmed by a general-purpose microprocessor instruction so as to store the data in the register. Data indicating the status of contact b stored in the register and stored in the register Programmable controller and having a Oaba instruction sequence program that OR operation on the data indicating the state of a contact being.
JP15956296A 1996-06-20 1996-06-20 Programmable controller Pending JPH1011117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15956296A JPH1011117A (en) 1996-06-20 1996-06-20 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15956296A JPH1011117A (en) 1996-06-20 1996-06-20 Programmable controller

Publications (1)

Publication Number Publication Date
JPH1011117A true JPH1011117A (en) 1998-01-16

Family

ID=15696449

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15956296A Pending JPH1011117A (en) 1996-06-20 1996-06-20 Programmable controller

Country Status (1)

Country Link
JP (1) JPH1011117A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006506029A (en) * 2002-11-05 2006-02-16 ソニー エレクトロニクス インク Mechanisms for protecting the transfer of digital content

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006506029A (en) * 2002-11-05 2006-02-16 ソニー エレクトロニクス インク Mechanisms for protecting the transfer of digital content
JP4716866B2 (en) * 2002-11-05 2011-07-06 ソニー エレクトロニクス インク Mechanisms for protecting the transfer of digital content

Similar Documents

Publication Publication Date Title
US4592010A (en) Memory-programmable controller
JPH1011117A (en) Programmable controller
JPS61157946A (en) Microcomputer
JPH1011286A (en) Microprocessor and programmable controller
JPH06187015A (en) Program converter for sequencer
JPH0830971B2 (en) Programmable controller
JPH0962533A (en) Test circuit for single chip microprocessor
JP2010108075A (en) Programmable controller and method for verifying its sequence program operation
JPH024010B2 (en)
JPH045217B2 (en)
US4853891A (en) Memory-programmable controller
JPS62103738A (en) Programmable controller
JPH03113659A (en) Cache memory testing method
JPH0353321A (en) Information processor
JPH0552961B2 (en)
JPH06230958A (en) Processor
JPS6320631A (en) Register selecting system
JPS6136652B2 (en)
JPH0575305B2 (en)
JPH02183332A (en) Programmed control system
JPS6362046A (en) Firmware simulator
JPS61260330A (en) Microprogram controller
JPH04338802A (en) High speed instruction processing system
JPH0319570B2 (en)
JPH03164945A (en) Data processor