JPS6116085B2 - - Google Patents

Info

Publication number
JPS6116085B2
JPS6116085B2 JP55160354A JP16035480A JPS6116085B2 JP S6116085 B2 JPS6116085 B2 JP S6116085B2 JP 55160354 A JP55160354 A JP 55160354A JP 16035480 A JP16035480 A JP 16035480A JP S6116085 B2 JPS6116085 B2 JP S6116085B2
Authority
JP
Japan
Prior art keywords
word
instruction
memory
numerical data
user
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.)
Expired
Application number
JP55160354A
Other languages
Japanese (ja)
Other versions
JPS5783807A (en
Inventor
Yukio Kato
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 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 Tateisi Electronics Co filed Critical Omron Tateisi Electronics Co
Priority to JP16035480A priority Critical patent/JPS5783807A/en
Publication of JPS5783807A publication Critical patent/JPS5783807A/en
Publication of JPS6116085B2 publication Critical patent/JPS6116085B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)
  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】[Detailed description of the invention]

この発明はプログラマブル・ロジツク・コント
ローラ(以下PLCと称す)に関し、特に、ユーザ
プログラムメモリに格納された2語命令のモニタ
に係わる問題を解消する技術に関する。 周知のように、ラダーダイヤグラム式等の一般
のPLCにあつては、ロード命令、アンド命令、ス
トア命令等の多くの命令は、命令コードと素子番
号(入出力アドレス)で構成され、例えば16ビツ
トを1語とする命令語の1語でもつて表現してい
る。これに対し、タイマ命令やカウンタ命令の場
合、命令コードと、タイマ番号またはカウンタ番
号を表す素子番号の他に、タイマ命令における設
定時間またはカウンタ命令における設定カウント
数を表わす数値データがあるため、限られたビツ
ト数の1語の命令ではこれを表現できず、多くの
PLCでは、タイマ命令やカウンタ命令を次のよう
に定義した2語命令で表現している。
The present invention relates to programmable logic controllers (hereinafter referred to as PLCs), and more particularly to techniques for solving problems associated with monitoring two-word instructions stored in user program memory. As is well known, in a general PLC such as a ladder diagram type, many instructions such as a load instruction, an AND instruction, and a store instruction are composed of an instruction code and an element number (input/output address), for example, a 16-bit number. It is also expressed by one word of the command word, which is one word. On the other hand, in the case of a timer instruction or a counter instruction, in addition to the instruction code and the element number representing the timer number or counter number, there is numerical data representing the set time in the timer command or the set count number in the counter command, so there is a limit. This cannot be expressed with a single word instruction for the number of bits given, and many
In PLC, timer instructions and counter instructions are expressed as two-word instructions defined as follows.

【表】 上記のごとく、1語目には命令コードと素子番
号を入れることとして、上記ロード命令等の通常
の1語命令とフオーマツトを統一し、2語目に上
述した数値データを入れることとしている。ま
た、ユーザプログラムメモリに上記2語命令を格
納する際に、1命令を構成する2語を上記1語目
→2語目の順番でアドレス走査方向に続けて格納
することとしている。つまり、命令コードを含む
1語目をアドレス(N)に格納する場合、2語目
の数値データを次のアドレス(N+1)に格納す
る訳である。 このようなシステム構成がメモリの利用効率の
面で有利であるし、またユーザ命令を順次読取つ
て解読実行する処理を簡素化および高速化する面
で極めて有利なのである。 また周知のように、PLCでは、ユーザがコンピ
ユータ的な信号処理技術について知識がなくても
充分使いこなせるようにすることが極めて重要な
設計要素である。例えばラダーダイアグラム式の
PLCでは、接点、リレー、タイマ、カウンタ等の
シンボルで書かれるラダーダイアグラムに基づい
て容易にプログラミングができるよう種々工夫さ
れている。プログラムのモニタについても同様
で、機械語に変換されてプログラムメモリに格納
されているユーザ命令を、単に2進符号や16進符
号等の形でモニタ表示するのではなく、元のラダ
ーダイアグラムに直結する形式に逆変換して表示
したり、更にはラダーダイアグラムをCRT上に
復元して表示するような工夫がなされている。こ
の種PLCでは、ラダーダイアグラム上の各回路要
素を所定の順番でプログラミングするが、プログ
ラムモニタに関しては、単に全ユーザ命令を上記
の順番で順次モニタするだけでなく、プログラム
実行中に必要な回路要素に関するユーザ命令のみ
をモニタすることが良く行なわれるし、更には、
あるユーザ命令をモニタした後、それに関連して
その前後のユーザ命令をモニタすることも良く行
なわれる。 ここで前述した2語命令のモニタについて説明
する。プログラムメモリにおいて2語命令はアド
レス走査方向に命令コードを含む1語目→数値デ
ータである2語目の順番で並べられているので、
アドレス走査方向にモニタが進み、モニタ制御部
にアドレス(N)に格納されている2語命令中の
1語目が取込まれたとき、モニタ制御部はその1
語目の命令コードからこれらが2語命令であるこ
とを識別でき、同時に次のアドレス(N+1)に
は2語目の数値データが格納されていることが分
るので、特に問題はない。しかし、アドレス走査
方向とは逆方向にモニタを進める場合、2語命令
中の2語目の数値データが最初にモニタ制御部に
取込まれることになる。その際に、2語目の数値
データを、通常の1語命令や2語命令中の1語目
のように命令コードを含んだ命令語とは区別でき
るようなデータ構成にしておかなければ、数値デ
ータを数値データとして認識できず、正しい2語
命令のモニタ表示が行なえない。 上述した必要性から、2語命令中の2番目の数
値データと、命令コードを含んだ命令語とを区別
するために、従来は次のような対策を講じてい
る。 (イ) 命令語の1語を16ビツトとするとき、その内
の特定の1ビツトを数値データか否かの識別ビ
ツトとして割当る。 (ロ) 命令語中の命令コードが入るエリアの何ビツ
トかを、数値データでは全て“0”にする等し
て、数値データとしては命令コードのエリアを
使用しない。 上記(イ)の場合は、命令語として有効に使えるの
は15ビツトになり、命令コードの種類が半減して
しまう。上記(ロ)の場合は、数値データとして有効
に使用できるビツト数が大幅に減じ、数値データ
の設定範囲が小さくなる。いずれにしても、数値
データの区別のために、PLCとしての大幅な能力
低下を来たすのを余義なくされていた。 更に付言しておくと、上記(イ)の方式において、
命令語長を1ビツト追加して17ビツトとし、追加
した1ビツトを上記識別ビツトにすれば、実質的
な命令語長は16ビツトのままで、能力低下につな
がらないことになる。しかし、現実にPLCを回路
構成する場合に、まつたく自由に命令語長を決め
られる訳ではなく、使用する回路素子によつて大
きく制約される。周知のように、コンピユータや
PLCの命令語は8、16、24、36、………という8
の整数倍のビツト構成をとるのが通例で、それに
は大きな意味がある。そのため、一般に市場に出
回つているマイクロプロセツサ(プログラム実行
の中心となる演算制御部等として使われる)や、
ユーザプログラムメモリとして使われる不揮発性
のPROM(EPROM)等は、8ビツト単位のビツ
ト構成となつている。従つて、例えば16ビツト処
理でシステム構成されたPLCにおいて、上述の如
く命令語長を16+1=17ビツトにしようとして
も、1語17ビツトのPROMは一般に入手できず、
敢てこの方式を実行するならば1語24ビツトの
PROMを使うことになり、これは24−17=7ビツ
トを無駄にしていることになる。 この本発明は以上説明した従来の問題点に鑑み
なされたもので、その目的は、プログラムメモリ
として使うPROMで決定される命令語長を実質的
にまつたく減じることなく、2語命令を逆方向か
らモニタする場合に必要な数値データとその他の
命令語の区別が簡単に行なえるようにしたPLCを
提供することにある。 上記目的を達成するために、本発明は、ユーザ
プログラムメモリ(PROM)と少なくとも同じ語
数で1語が少なくとも1ビツトの揮発性読み書き
両用の判定信号メモリ(RAM)を、ユーザプロ
グラムメモリと並列にアドレツシングされるよう
に設け、プログラム実行前のイニシヤライズ処理
として、ユーザプログラムメモリの各命令を順番
に読出して、2語命令を構成する2語目の数値デ
ータであるか否かを逐一判定するとともに、その
判定結果を上記判定信号メモリの対応アドレスに
書込むように構成し、プログラムモニタ時に、ユ
ーザプログラムメモリから読出された命令が2語
命令を構成する2語目の数値データでるか否か
を、同時に上記判定信号メモリから読出されたデ
ータに基づいて識別するようにしたことを特徴と
する。 以下、この発明の一実施例を図面に基づいて詳
細に説明する。 ユーザプログラムメモリ1に格納されたユーザ
命令を順次解読実行するプログラム実行動作は演
算制御部2を中心に行なわれ、プログラムメモリ
1の内容およびプログラム実行中の各種データを
モニタする動作は、キーボード3および表示装置
4等が接続されたモニタ制御部5を中心に行なわ
れる。 プログラム実行時には、演算制御部2からの歩
進信号によつてプログラムカウンタ6が順次イン
クリメントされ、かつカウンタ6の出力でもつて
ユーザプログラムメモリ1がアドレス走査され
る。これによりプログラムメモリ1から順番に読
出されるユーザ命令は、命令レジスタ7に一時ス
トアされ、演算制御部2およびモニタ制御部5に
供給される他、ユーザ命令中の上述した素子番号
のデータは入出力メモリ8に入力されて、これを
アドレツシングする。演算制御部2では、命令レ
ジスタ7を介して入力されるユーザ命令を解読
し、入出力メモリ8から読出される入出力データ
(外部入出力の状態)に基づいて論理演算を行な
うとともに、その演算結果を入出力メモリ8に書
込むという、良く知られたプログラム実行処理を
行なう。また演算制御部2は、プログラムメモリ
1のアドレス走査を1巡開始するのに先だつて、
入出力回路9に起動信号を送り(図示略)、入出
力回路9と入出力メモリ8との間の高速データ転
送を行なわせる(これを入出力データの更新動作
という)。つまり、入出力データの更新により、
入出力回路9に与えられる多数の外部入力信号の
論理状態がそれぞれ入出力メモリ8の対応エリア
に書込まれるとともに、入出力メモリ8の各出力
データがそれぞれ対応する外部出力端にセツトさ
れる。 演算制御部2に対してモニタ制御部5から後述
する割込信号ILが与えられていない間は、上記
の入出力データの更新動作とプログラム実行動作
プログラムメモリ1のアドレス走査を1巡する)
とが繰返し行なわれる。なお、演算制御部2から
モニタ制御部5に対し、上記アドレス走査を1巡
終了する毎に走査終了信号SEが出力され、モニ
タ制御部5はこの走査終了信号を受けてモニタ制
御を進める。 ところで本実施例では、ユーザプログラムメモ
リ1は1語16ビツトのROMからなり、これに格
納されているユーザ命令は、前述したように通常
の1語命令の他に、タイマ命令やカウンタ命令の
ごとき2語命令が含まれる。勿論、前述のごとく
2語命令中の1語目の命令コードが含まれ、2語
目は数値データとなつている。しかし本発明にお
いては、2語命令中の2語目の数値データと、そ
の他の命令コードを含んだ命令語とを区別するた
めの、前述した(イ)または(ロ)のようなデータ構成上
の対策は講じておらず、16ビツトの命令語長をす
べて有効に使つている。従つて、本発明における
プログラムメモリ1をアドレス走査方向と逆方向
からモニタする場合には、2語命令を構成する数
値データを数値データとして認識することができ
ないことになる。これを次のような構成で解決し
ている。 9は1語1ビツトでプログラムメモリ1と同じ
語数の判別信号メモリであつて、このメモリ9は
プログラムカウンタ6の出力によつてプログラム
メモリ1と並列にアドレツシングされる。つま
り、判別信号メモリ1の各1ビツトの記憶エリア
は、プログラムメモリ1の各16ビツトの命令語と
一対一に対応付けられており、モニタ制御部5に
よる電源投入時のイニシヤライズ処理によつて、
プログラムメモリ1の各命令語が2語命令を構成
する数値データなのか否を示す1ビツトの判定信
号がメモリ9の対応するアドレスに書込まれる。 つまりモニタ制御部5は、電源投入時に演算制
御部2に割込みをかけた状態で、第2図のフロー
チヤートに示すイニシヤライザルーチンを実行す
る。まずステツプ(1)ではプログラムカウンタ6を
リセツトしてアドレス出力を「0」にする。次の
ステツプ(2)では、プログラムカウンタ6の出力で
アドレツシングされて命令レジスタ7に読出され
たユーザ命令をモニタ制御部5内に取込み、その
ユーザ命令が1語命令なのか2語命令(タイマ命
令やカウンタ命令の1語目)なのかを、その命令
コードから解読する。1語命令であつた場合には
ステツプ(3)に進み、プログラムカウンタ6の出力
でアドレツシングされている判別信号メモリ9に
判別信号“0”を書込む。次にステツプ(4)でプロ
グラムカウンタ6を歩進(1だけインクリメン
ト)し、次のステツプ(5)でプログラムカウンタ6
の出力が終了アドレスに達したか否かを判定し、
最終アドレスに達していない場合にはステツプ(2)
に戻り、プログラムメモリ1の次のアドレスから
読出されるユーザ命令について、1語命令か2語
命令かを判別する。 ステツプ(2)により2語命令の1語目の命令コー
ドが検出された場合(このときのプログラムカウ
ンタ6の出力をNとする)、ステツプ(6)に進み、
判別信号メモリ9のアドレス(N)に判別信号
“0”を書込む。次のステツプ(7)でプログラムカ
ウンタ6を歩進し、そのアドレス出力を(N+
1)にする。プログラムメモリ1のアドレス(N
+1)には、上記2語命令を構成している2語目
の数値データが格納されている。そこで次のステ
ツプ(8)において、プログラムカウンタ6の出力
(N+1)でアドレツシングされている判別信号
メモリ9に数値データであることを示す判別信号
“1”を書込む。その後、前述したステツプ(4)で
アドレスを歩進し、ステツプ(5)で最終アドレスか
否かを判別する。 以上の動作が最終アドレスまで行なわれると、
ステツプ(5)でYESと判定されてこのイニシヤラ
イザルーチンは終了する。すると、判別信号メモ
リ9には、プログラムメモリ1に格納されている
2語命令の数値データと対応するアドレスエリア
に“1”が書込まれ、その他の命令語に対応する
エリアには“0”が書込まれる。このイニシヤラ
イザルーチンは、アドレス走査を1巡するだけ
で、特に高度な処理を行なつている訳ではないの
で、極く短時間でこれを実行できる。 上記イニシヤライザルーチンを終了すると、演
算制御部2に対する割込みが解除され、上述した
入出力データの更新およびプログラム実行の動作
が行なわれる。 周知のように、プログラム実行中におけるモニ
タは、(a)モニタしたいユーザ命令を入力する場合
と、(b)モニタしたいユーザ命令の格納アドレスを
入力する場合と、(c)これら(a)または(b)によつてあ
るユーザ命令をモニタしていて、その前後のアド
レスのユーザ命令をモニタする場合等がある。モ
ニタ制御部5は、プログラム実行中におけるプロ
グラムカウンタ6のアドレス出力と、命令レジス
タ7に順次読出されるユーザ命令と、演算制御部
2から出力される入出力データが演算経過データ
等が入力される他、演算制御部2に所定のタイミ
ングで割込みをかけて、プログラムカウンタ6に
任意のアドレスをプリセツトしたり、あるいはイ
ンクリメントしたり、更にはデイクリメントする
操作を行なつて、所定のモニタ制御を行なう訳で
ある。 その際に、特に前記(c)のモニタ動作のうち、モ
ニタ中のあるユーザ命令の前のアドレスのユーザ
命令をモニタする場合、すなわちアドレス走査方
向と逆方向にモニタを進める場合、プログラムカ
ウンタ6をデイクリメントして、命令レジスタ7
からユーザ命令をモニタ制御部5に取込むと同時
に、判別信号メモリ9から読出される判別信号を
レジスタ10を介してモニタ制御部5に取込み、
この判別信号から同時に読込んだユーザ命令が2
語命令を構成する2語目の数値データか否かを認
識する。そして、判別信号が“0”であれば。そ
のユーザ命令をそのままモニタ処理し、判別信号
が“1”であれば、そのユーザ命令(数値のデー
タである)を一旦記憶しておき、プログラムカウ
ンタ6を更にデイクリメントして、その数値デー
タに対応する1語目の命令語を読出してきて、モ
ニタ処理するのである。 以上詳細に説明したように、本発明に係るPLC
では、ユーザプログラムメモリとは別にこれと並
列にアドレツシングされる揮発性の読み書き両用
のRAMからなる判別信号メモリを設け、プログ
ラム実行前のイニシヤライズ処理として、各ユー
ザ命令が2語命令の数値データか否かを示す判別
信号を上記判別信号メモリに記憶しておき、モニ
タ時の必要に応じてこの判別信号を利用するよう
に構成したので、プログラムメモリとして使用す
るPROMまたはEPROMのビツト構成で規定され
る命令語長を、2語命令識別のために利用して、
実質的な機能を大幅に低下させてしまう、という
従来の問題点を解消できるものである。なお周知
の如く、判別信号メモリとして使用するRAMに
は各種のビツト構成のものが一般の市場に多く出
回つている。 また、この発明では、プログラム実行前のイニ
ンシヤライズ処理として、ユーザプログラムメモ
リの各命令を順番に読み出して、2語命令を構成
する2語目の数値データであるか否かを逐一判定
するとともに、その判定結果を上記判定信号メモ
リの対応アドレスに書込むようにしているため、
判定信号メモリとして高価なPROM、EPROM等
の不揮発性メモリを必要とせず、安価なRAMで
足りる。 更に、3語命令、4語命令等の命令を定義する
場合には、判別信号メモリのビツト数を増し、命
令コードを含んだ1語目の命令語か、多数語命令
の2語目か、多数語命令の3語目か、多数語命令
の4語目か………を区別する判別信号をイニシヤ
ライズ処理で判別信号メモリに記憶すれば良い。
[Table] As shown above, the instruction code and element number are placed in the first word to unify the format with normal one-word instructions such as the load instruction mentioned above, and the numerical data mentioned above is placed in the second word. There is. Furthermore, when storing the two-word instruction in the user program memory, the two words constituting one instruction are stored successively in the address scanning direction in the order of the first word → second word. That is, when the first word containing the instruction code is stored at address (N), the numerical data of the second word is stored at the next address (N+1). Such a system configuration is advantageous in terms of memory utilization efficiency, and is extremely advantageous in terms of simplifying and speeding up the process of sequentially reading, decoding, and executing user instructions. Furthermore, as is well known, an extremely important design element for PLCs is to enable users to fully utilize them even without knowledge of computer-like signal processing technology. For example, a ladder diagram
PLCs have been devised in various ways to make programming easier based on ladder diagrams written with symbols such as contacts, relays, timers, and counters. The same goes for program monitoring; user instructions converted to machine language and stored in program memory are not simply displayed on the monitor in the form of binary or hexadecimal codes, but are directly linked to the original ladder diagram. Efforts have been made to display the ladder diagram by converting it back to the format shown below, or by restoring and displaying the ladder diagram on a CRT. In this type of PLC, each circuit element on the ladder diagram is programmed in a predetermined order, but the program monitor not only monitors all user instructions sequentially in the above order, but also monitors the circuit elements necessary during program execution. It is common practice to monitor only user commands related to
After monitoring a certain user command, it is also common practice to monitor user commands before and after it. Here, the above-mentioned two-word instruction monitor will be explained. In the program memory, two-word instructions are arranged in the address scanning direction in the order of the first word containing the instruction code → the second word containing numerical data.
When the monitor advances in the address scanning direction and the first word of the two-word command stored at address (N) is taken into the monitor control section, the monitor control section
There is no particular problem because it can be identified from the instruction code of the word that these are two-word instructions, and at the same time it can be seen that the numerical data of the second word is stored at the next address (N+1). However, when the monitor advances in the opposite direction to the address scanning direction, the numerical data of the second word in the two-word instruction is first taken into the monitor control section. At that time, the numerical data of the second word must be structured in such a way that it can be distinguished from an instruction word that includes an instruction code, such as the first word of a normal one-word instruction or two-word instruction. Numerical data cannot be recognized as numerical data, and correct two-word commands cannot be displayed on the monitor. Due to the above-mentioned necessity, the following measures have been conventionally taken in order to distinguish between the second numerical data in a two-word instruction and an instruction word containing an instruction code. (b) When one command word is made up of 16 bits, one specific bit is assigned as an identification bit to determine whether or not it is numerical data. (b) Do not use the instruction code area for numerical data by setting all bits in the area where the instruction code in the instruction word is to "0" for numerical data. In the case of (a) above, only 15 bits can be effectively used as an instruction word, and the number of types of instruction codes is halved. In the case of (b) above, the number of bits that can be effectively used as numerical data is significantly reduced, and the setting range of numerical data is narrowed. In any case, the ability of the PLC to distinguish between numerical data had to be significantly reduced. I would like to add that in the method (a) above,
By adding 1 bit to the instruction word length to make it 17 bits and using the added 1 bit as the above-mentioned identification bit, the actual instruction word length remains 16 bits and does not lead to a decrease in performance. However, when actually configuring a PLC circuit, the instruction word length cannot be determined freely, and is largely restricted by the circuit elements used. As is well known, computers and
PLC command words are 8, 16, 24, 36, ......
It is customary to have a bit configuration that is an integer multiple of , and this has great significance. For this reason, microprocessors (used as arithmetic control units, etc., which are the core of program execution) that are generally on the market,
A nonvolatile PROM (EPROM) used as a user program memory has a bit configuration of 8 bits. Therefore, for example, in a PLC system configured with 16-bit processing, even if you try to set the instruction word length to 16 + 1 = 17 bits as described above, PROMs with 17 bits per word are generally not available.
If you dare to use this method, you will need 24 bits per word.
PROM will be used, which means that 24-17=7 bits will be wasted. The present invention has been devised in view of the conventional problems described above, and its purpose is to transfer two-word instructions in the reverse direction without substantially reducing the instruction word length determined by the PROM used as the program memory. An object of the present invention is to provide a PLC that can easily distinguish between numerical data and other command words required when monitoring data. To achieve the above object, the present invention provides a volatile read/write decision signal memory (RAM) with at least the same number of words as the user program memory (PROM) and each word of which is at least 1 bit, which is addressed in parallel with the user program memory. As an initialization process before program execution, each instruction in the user program memory is read out in order, and it is determined one by one whether or not the numerical data is the second word of a two-word instruction. The judgment result is written to the corresponding address of the judgment signal memory, and at the time of program monitoring, it is simultaneously checked whether the instruction read from the user program memory is the numerical data of the second word constituting the two-word instruction. It is characterized in that the identification is made based on data read out from the judgment signal memory. Hereinafter, one embodiment of the present invention will be described in detail based on the drawings. The program execution operation of sequentially decoding and executing user instructions stored in the user program memory 1 is performed mainly by the arithmetic control unit 2, and the operation of monitoring the contents of the program memory 1 and various data during program execution is performed by the keyboard 3 and This is performed mainly by the monitor control unit 5 to which the display device 4 and the like are connected. When a program is executed, the program counter 6 is sequentially incremented by a step signal from the arithmetic control section 2, and the user program memory 1 is scanned for addresses using the output of the counter 6. As a result, the user instructions read out in order from the program memory 1 are temporarily stored in the instruction register 7 and supplied to the arithmetic control unit 2 and monitor control unit 5, and the data of the above-mentioned element numbers in the user instructions are input. It is input to the output memory 8 and is addressed. The arithmetic control unit 2 decodes user commands input through the instruction register 7, performs logical operations based on the input/output data (external input/output status) read from the input/output memory 8, and executes the logical operations. The well-known program execution process of writing the result into the input/output memory 8 is performed. Furthermore, before starting one round of address scanning of the program memory 1, the arithmetic control unit 2
An activation signal (not shown) is sent to the input/output circuit 9 to cause high-speed data transfer between the input/output circuit 9 and the input/output memory 8 (this is referred to as an input/output data update operation). In other words, by updating input/output data,
The logic states of a large number of external input signals applied to the input/output circuit 9 are respectively written into corresponding areas of the input/output memory 8, and each output data of the input/output memory 8 is set to the corresponding external output terminal. While the interrupt signal IL, which will be described later, is not applied to the arithmetic control unit 2 from the monitor control unit 5, the above-mentioned input/output data updating operation and program execution operation performs one round of address scanning of the program memory 1).
is repeated. Note that the arithmetic control section 2 outputs a scan end signal SE to the monitor control section 5 every time one round of address scanning is completed, and the monitor control section 5 receives this scan end signal and proceeds with the monitor control. By the way, in this embodiment, the user program memory 1 consists of a ROM with 16 bits per word, and the user instructions stored therein include normal one-word instructions as described above, as well as timer instructions and counter instructions. Contains two-word instructions. Of course, as mentioned above, the first word of the two-word instruction includes the instruction code, and the second word is numerical data. However, in the present invention, in order to distinguish between the numerical data of the second word in a two-word instruction and the instruction word containing other instruction codes, the data structure as described in (a) or (b) above is used. No countermeasures have been taken, and the entire 16-bit instruction word length is effectively used. Therefore, when the program memory 1 of the present invention is monitored from the direction opposite to the address scanning direction, the numerical data constituting the two-word instruction cannot be recognized as numerical data. This is solved with the following configuration. Reference numeral 9 denotes a discrimination signal memory having one bit per word, the same number of words as the program memory 1, and this memory 9 is addressed in parallel with the program memory 1 by the output of the program counter 6. In other words, each 1-bit storage area of the discrimination signal memory 1 is in one-to-one correspondence with each 16-bit command word of the program memory 1, and by the initialization process performed by the monitor control section 5 when the power is turned on,
A 1-bit determination signal indicating whether each instruction word in program memory 1 is numerical data constituting a two-word instruction is written to the corresponding address in memory 9. That is, the monitor control section 5 executes the initializer routine shown in the flowchart of FIG. 2 while interrupting the arithmetic control section 2 when the power is turned on. First, in step (1), the program counter 6 is reset and the address output is set to "0". In the next step (2), the user instruction addressed by the output of the program counter 6 and read out to the instruction register 7 is taken into the monitor control unit 5, and whether the user instruction is a one-word instruction or a two-word instruction (timer instruction) is read out. or the first word of a counter instruction) from the instruction code. If it is a one-word command, the program proceeds to step (3) and writes a discrimination signal "0" into the discrimination signal memory 9 addressed by the output of the program counter 6. Next, in step (4), the program counter 6 is incremented (incremented by 1), and in the next step (5), the program counter 6 is incremented.
Determine whether the output of has reached the end address,
If the final address has not been reached, step (2)
Returning to , it is determined whether the user instruction read from the next address of the program memory 1 is a one-word instruction or a two-word instruction. If the instruction code for the first word of the two-word instruction is detected in step (2) (the output of the program counter 6 at this time is N), proceed to step (6),
Write the discrimination signal "0" to the address (N) of the discrimination signal memory 9. In the next step (7), the program counter 6 is incremented and the address output is (N+
1). Program memory 1 address (N
+1) stores the numerical data of the second word constituting the two-word instruction. Therefore, in the next step (8), a discrimination signal "1" indicating that the data is numerical data is written into the discrimination signal memory 9 addressed by the output (N+1) of the program counter 6. Thereafter, the address is incremented in step (4) mentioned above, and it is determined in step (5) whether or not it is the final address. When the above operations are performed up to the final address,
The determination in step (5) is YES and this initializer routine ends. Then, in the discrimination signal memory 9, "1" is written in the address area corresponding to the numerical data of the two-word instruction stored in the program memory 1, and "0" is written in the areas corresponding to the other instruction words. is written. This initializer routine only performs one round of address scanning and does not perform any particularly sophisticated processing, so it can be executed in an extremely short time. When the initializer routine is completed, the interrupt to the arithmetic control unit 2 is canceled, and the above-described operations of updating input/output data and executing the program are performed. As is well known, monitoring during program execution involves (a) inputting a user instruction to be monitored, (b) inputting a storage address of the user instruction to be monitored, and (c) monitoring (a) or ( There are cases where a certain user command is monitored by b), and user commands at addresses before and after that command are monitored. The monitor control unit 5 receives the address output of the program counter 6 during program execution, user instructions sequentially read into the instruction register 7, input/output data output from the calculation control unit 2, calculation progress data, etc. In addition, predetermined monitor control is performed by interrupting the arithmetic control unit 2 at a predetermined timing, presetting an arbitrary address in the program counter 6, or performing operations such as incrementing or decrementing the program counter 6. This is the translation. At that time, especially in the monitoring operation (c) above, when monitoring a user instruction at an address before a certain user instruction being monitored, that is, when advancing the monitor in the opposite direction to the address scanning direction, the program counter 6 is Decrement instruction register 7
At the same time, a determination signal read from the determination signal memory 9 is received into the monitor control section 5 via the register 10,
Two user commands read simultaneously from this discrimination signal
It is recognized whether the numerical data is the second word constituting a word command. Then, if the discrimination signal is "0". The user command is monitored and processed as it is, and if the determination signal is "1", the user command (which is numerical data) is temporarily stored, and the program counter 6 is further decremented to store the numerical data. The corresponding first command word is read out and monitored. As explained in detail above, the PLC according to the present invention
In this case, a determination signal memory consisting of a volatile read/write RAM that is addressed in parallel with the user program memory is provided, and as an initialization process before program execution, it is determined whether each user command is numerical data of a two-word command or not. A discrimination signal indicating whether the Using the instruction word length to identify two-word instructions,
This solves the conventional problem of significantly reducing the actual functionality. As is well known, many RAMs used as discrimination signal memories with various bit configurations are on the market. Further, in the present invention, as an initialization process before program execution, each instruction in the user program memory is read out in order, and it is determined one by one whether or not the numerical data is the second word of a two-word instruction. Since the judgment result is written to the corresponding address of the above judgment signal memory,
There is no need for expensive non-volatile memory such as PROM or EPROM as the judgment signal memory; an inexpensive RAM is sufficient. Furthermore, when defining an instruction such as a 3-word instruction or a 4-word instruction, the number of bits in the discrimination signal memory is increased and it is determined whether the instruction word is the first instruction word containing the instruction code or the second word of a multi-word instruction. A discrimination signal for distinguishing between the third word of a multi-word instruction, the fourth word of a multi-word instruction, etc. may be stored in the discrimination signal memory in the initialization process.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例によるプログラマブ
ル・ロジツク・コントローラのブロツク図、第2
図はイニシヤライズ処理のフローチヤートであ
る。 1……ユーザプログラムメモリ、2……演算制
御部、5……モニタ制御部、6……プログラムカ
ウンタ、7……判別信号メモリ。
FIG. 1 is a block diagram of a programmable logic controller according to an embodiment of the present invention;
The figure is a flowchart of initialization processing. DESCRIPTION OF SYMBOLS 1... User program memory, 2... Arithmetic control section, 5... Monitor control section, 6... Program counter, 7... Discrimination signal memory.

Claims (1)

【特許請求の範囲】 1 ユーザ命令の1種として、1語目に命令コー
ド及び素子番号が入り、2語目に数値データが入
る2語命令が定義されたプログラマブル・ロジツ
ク・コントローラにおいて; ユーザプログラムメモリと少なくとも同じ語数
を有し、かつ1語が少なくとも1ビツトの揮発性
読み書き両用の判定信号メモリを、ユーザプログ
ラムメモリと並列にアドレツシングされるように
設け; プログラ実行前のイニシヤライズ処理として、
ユーザプログラムメモリの各命令を順番に読み出
して、2語命令を構成する2語目の数値データで
あるか否かを逐一判定するとともに、その判定結
果を上記判定信号メモリの対応アドレスに書込む
ように構成し; プログラムモニタ時に、ユーザプログラムメモ
リから読み出された命令が2語命令を構成する2
語目の数値データであるか否かを、同時に上記判
定信号メモリから読み出されたデータに基づいて
識別するようにしたことを特徴とするプログラマ
ブル・ロジツク・コントローラ。
[Claims] 1. In a programmable logic controller in which a two-word instruction is defined as one type of user instruction, in which the first word contains an instruction code and an element number, and the second word contains numerical data; A volatile read/write determination signal memory having at least the same number of words as the memory and each word of which is at least 1 bit is provided so as to be addressed in parallel with the user program memory; as an initialization process before program execution,
Each instruction in the user program memory is read out in order, and each instruction is judged one by one whether it is the numerical data of the second word constituting a two-word instruction, and the judgment result is written to the corresponding address in the judgment signal memory. When the program is monitored, the instructions read from the user program memory constitute a two-word instruction.
A programmable logic controller characterized in that whether or not the numerical data is a word is identified based on data simultaneously read out from the determination signal memory.
JP16035480A 1980-11-14 1980-11-14 Programmable logic controller Granted JPS5783807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16035480A JPS5783807A (en) 1980-11-14 1980-11-14 Programmable logic controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16035480A JPS5783807A (en) 1980-11-14 1980-11-14 Programmable logic controller

Publications (2)

Publication Number Publication Date
JPS5783807A JPS5783807A (en) 1982-05-25
JPS6116085B2 true JPS6116085B2 (en) 1986-04-28

Family

ID=15713154

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16035480A Granted JPS5783807A (en) 1980-11-14 1980-11-14 Programmable logic controller

Country Status (1)

Country Link
JP (1) JPS5783807A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56121152A (en) * 1980-02-27 1981-09-22 Hitachi Ltd Monitor system of computer program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56121152A (en) * 1980-02-27 1981-09-22 Hitachi Ltd Monitor system of computer program

Also Published As

Publication number Publication date
JPS5783807A (en) 1982-05-25

Similar Documents

Publication Publication Date Title
US4165534A (en) Digital control system with Boolean processor
US4443865A (en) Processor module for a programmable controller
US4623961A (en) Programmable controller having automatic contact line solving
US4158226A (en) Programmable controller with limit detection
US4172289A (en) Programmable controller with programmable I/O scan rate
JPS6160443B2 (en)
US4592010A (en) Memory-programmable controller
KR950009687B1 (en) High speed ladder instruction processing apparatus for programnable logic controller
US4807178A (en) Programmable sequence controller having indirect and direct input/output apparatus
CA1103364A (en) Programmable controller with integral microprocessor
JPS6116085B2 (en)
EP0461631A2 (en) Data storing device having a plurality of registers allotted for one address
EP0156162A2 (en) Programmable controller
JPS6160444B2 (en)
JPS6310445B2 (en)
JPH0634241B2 (en) Information processing equipment
JP2530585B2 (en) Program memory control device
JPH04280334A (en) One chip microcomputer
JPS5866112A (en) Computer system
JPH04365170A (en) Digital signal processing semiconductor integrated circuit
JP2618703B2 (en) High-speed operation processing method of programmable sequence controller
JPH0128416B2 (en)
JPH06348549A (en) Software processor
HU190282B (en) Arrangement for quick solving numerous logic fenction
JPS63244104A (en) Arithmetic unit for programmable controller