JPH0651812A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH0651812A
JPH0651812A JP20780192A JP20780192A JPH0651812A JP H0651812 A JPH0651812 A JP H0651812A JP 20780192 A JP20780192 A JP 20780192A JP 20780192 A JP20780192 A JP 20780192A JP H0651812 A JPH0651812 A JP H0651812A
Authority
JP
Japan
Prior art keywords
comparison
processing unit
program
sub
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP20780192A
Other languages
Japanese (ja)
Other versions
JP3393475B2 (en
Inventor
Shuji Otani
修史 大谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP20780192A priority Critical patent/JP3393475B2/en
Publication of JPH0651812A publication Critical patent/JPH0651812A/en
Application granted granted Critical
Publication of JP3393475B2 publication Critical patent/JP3393475B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PURPOSE:To shorten scan time by reducing the amount of a user program and labor at the time of programming. CONSTITUTION:When a table registering instruction in the user program is executed, a main processing part 1 copies a look-up table, which stores plural comparative values stored in a RAM 13 and the addresses of a sub routine program while making them correspondent, to a DP-RAM 25 of a sub processing part 2 and informs the copy and next, when a comparing instruction is executed, a comparing request is transmitted to the sub processing part 2. At the sub processing part 2, normal processing is interrupted by interruption processing, and the input value from an input i/f 24 is compared with each comparative value in the look-up table. When they are coincident, the address of the sub routine corresponding to the relevant comparative value is stored in the DP- RAM 25, and a sub routine executing request is transmitted to the main processing part 1. The main processing part 1 branches the request to the sub routine by the interruption processing.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数の比較処理が組込
まれたユーザプログラムを実行するプログラマブル・コ
ントローラ(以下、PCという)に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller (hereinafter referred to as PC) which executes a user program in which a plurality of comparison processes are incorporated.

【0002】[0002]

【従来の技術】従来、PCにおいては、ユーザプログラ
ムの実行中に、入力値とカウンタ値とを比較してその比
較結果による条件処理等を実行する場合には、比較命令
や、サブルーチンプログラム分岐命令およびリレー接点
等をユーザプログラム中に組合わせている。
2. Description of the Related Art Conventionally, in a PC, when a user program is being executed and an input value and a counter value are compared with each other and conditional processing based on the comparison result is executed, a comparison instruction or a subroutine program branch instruction is executed. And relay contacts are combined in the user program.

【0003】[0003]

【発明が解決しようとする課題】しかし、このような従
来のPCでは、多数の比較条件を含むアプリケーション
を実行する場合、その全ての比較条件について比較命令
やサブルーチン分岐命令等を組み合わせてユーザプログ
ラムをプログラミングしなければならないため、ユーザ
プログラムの量が増加し、プログラミングの手間が増え
る、という問題がある。
However, in such a conventional PC, when an application including a large number of comparison conditions is executed, a user program is combined with a comparison instruction or a subroutine branch instruction for all the comparison conditions. Since it has to be programmed, there is a problem in that the amount of user programs increases and the effort of programming increases.

【0004】また、スキャン毎に全命令が常に実行され
るため、スキャンタイムの増加の要因となり、さらにス
キャン処理にて入力値と比較値とを比較するため、スキ
ャンタイムが長くなった場合には正確な応答が得られな
いことが生じる、という問題がある。
Further, since all instructions are always executed for each scan, this causes an increase in scan time. Further, since the input value and the comparison value are compared in the scan processing, if the scan time becomes long, There is a problem that an accurate response may not be obtained.

【0005】そこで、本発明は、ユーザプログラムの量
およびプログラミング時の手間を少なくして、スキャン
タイムを短縮化できるPCを提供することを目的とす
る。
Therefore, an object of the present invention is to provide a PC which can shorten the scan time by reducing the amount of the user program and the labor at the time of programming.

【0006】[0006]

【課題を解決するための手段】上記目的を達成するた
め、請求項1記載の発明では、入力値と複数の比較値と
が一致した場合に実行すべきサブルーチンプログラムの
アドレスと上記複数の比較値とが対応して格納されたル
ックアップテーブルを記憶したテーブルメモリ、テーブ
ル登録命令および比較開始命令が組込まれたユーザプロ
グラムを記憶したプログラムメモリ、および上記サブル
ーチンプログラムを記憶したプログラムメモリを有する
メイン処理部と、上記メイン処理部と接続されるデュア
ルポートメモリ、および入力値を取入れる入力インタフ
ェースを有するサブ処理部とからなり、上記メイン処理
部は、上記ユーザプログラム中のテーブル登録命令の実
行により上記サブ処理部のデュアルポートメモリに上記
ルックアップテーブルを記憶させ、上記ユーザプログラ
ム中の比較開始命令の実行によりサブ処理部へ比較要求
を送信すると共に、上記サブ処理部からサブルーチン実
行要求を受信した場合には、割込み処理によりデュアル
ポートメモリに記憶されたアドレスのサブルーチンプロ
グラムを実行し、上記サブ処理部は、上記メイン処理部
から比較要求を受信した場合には、割込み処理により入
力インタフェースから取入れた入力値とデュアルポート
メモリに記憶された上記ルックアップテーブルの複数の
比較値とを比較し、入力値と比較値とが一致した場合に
はその比較値と対応するサブルーチンプログラムのアド
レスを上記デュアルポートメモリに記憶させると共に、
当該サブルーチンプログラムの実行要求を上記メイン処
理部へ送信することを特徴とする。
In order to achieve the above object, in the invention according to claim 1, an address of a subroutine program to be executed when an input value and a plurality of comparison values match, and the plurality of comparison values. A main processing unit having a table memory storing a look-up table stored in correspondence with each other, a program memory storing a user program incorporating a table registration command and a comparison start command, and a program memory storing the above subroutine program. And a sub processing unit having a dual port memory connected to the main processing unit and an input interface for receiving an input value. The main processing unit executes the table registration command in the user program to execute the sub processing. The above lookup table is stored in the dual port memory of the processing unit. When a comparison request is transmitted to the sub processing unit by executing the comparison start instruction in the user program, and a subroutine execution request is received from the sub processing unit, it is stored in the dual port memory by interrupt processing. When the sub-processing unit executes the subroutine program of the address, and the sub-processing unit receives the comparison request from the main processing unit, the lookup value stored in the dual port memory and the input value taken from the input interface by the interrupt processing are executed. Compare a plurality of comparison values in the table, and if the input value and the comparison value match, store the address of the subroutine program corresponding to the comparison value in the dual port memory,
It is characterized in that an execution request of the subroutine program is transmitted to the main processing unit.

【0007】請求項2記載の発明では、入力値と複数の
比較値とが一致した場合に実行すべきサブルーチンプロ
グラムのアドレスと上記複数の比較値とが対応して格納
されたルックアップテーブルを記憶したテーブルメモ
リ、テーブル登録命令および比較開始命令が組込まれた
ユーザプログラムを記憶したプログラムメモリ、および
上記サブルーチンプログラムを記憶したプログラムメモ
リを有するメイン処理部と、上記メイン処理部と接続さ
れるデュアルポートメモリ、および入力パルスをカウン
トした入力値と予め設定された比較値とを比較して両値
が一致した場合に出力を行うハードカウンタを有するサ
ブ処理部とからなり、上記メイン処理部は、上記ユーザ
プログラム中のテーブル登録命令の実行により上記サブ
処理部のデュアルポートメモリに上記ルックアップテー
ブルを記憶させ、上記ユーザプログラム中の比較開始命
令の実行によりサブ処理部へ比較要求を送信すると共
に、上記サブ処理部からサブルーチン実行要求を受信し
た場合には、割込み処理によりデュアルポートメモリに
記憶されたアドレスのサブルーチンプログラムを実行
し、上記サブ処理部は、上記メイン処理部から比較要求
があった場合には、割込み処理によりハードカウンタに
入力値と比較値との比較処理を実行させ、両値が一致し
てハードカウンタから出力があった場合には、割込み処
理により当該比較値に対応するサブルーチンプログラム
のアドレスをデュアルポートメモリに記憶させると共
に、当該サブルーチンプログラムの実行要求を上記メイ
ン処理部へ送信し、デュアルポートメモリに記憶された
ルックアップテーブルから次の比較値を読出してハード
カウンタに設定することを特徴とする。
According to another aspect of the present invention, a lookup table is stored in which the address of the subroutine program to be executed when the input value and the plurality of comparison values match and the plurality of comparison values are stored in correspondence with each other. Table memory, a program memory storing a user program in which a table registration command and a comparison start command are incorporated, and a main processing unit having a program memory storing the above subroutine program, and a dual port memory connected to the main processing unit. , And a sub-processing unit that has a hard counter that compares the input value that has counted the input pulse with a preset comparison value and outputs if the two values match. By executing the table registration command in the program, the dual port of the sub processing unit The lookup table is stored in the memory, the comparison request is transmitted to the sub processing unit by executing the comparison start instruction in the user program, and when the subroutine execution request is received from the sub processing unit, the interrupt processing is performed. When the sub-processing unit executes the subroutine program of the address stored in the dual-port memory, and the sub-processing unit receives a comparison request from the main processing unit, the sub-processing unit compares the input value and the comparison value to the hard counter by interrupt processing. If both values match and there is an output from the hardware counter, the address of the subroutine program corresponding to the comparison value is stored in the dual port memory by interrupt processing, and the execution request of the subroutine program is issued. It is sent to the main processing unit above and is stored in the dual port memory. From 憶 look-up table reads the next comparison value and setting the hard counters.

【0008】請求項3記載の発明では、入力パルスをカ
ウントした入力値と予め設定された比較値とを比較して
両値が一致した場合に出力を行うハードカウンタと、上
記入力値と複数の比較値とが一致した場合に実行すべき
サブルーチンプログラムのアドレスと上記複数の比較値
とが対応して格納されたルックアップテーブルを記憶し
たテーブルメモリと、比較開始命令が組込まれたユーザ
プログラムを記憶したユーザプログラムメモリと、上記
サブルーチンプログラムを記憶したプログラムメモリと
を有しており、上記ユーザプログラム中の比較開始命令
の実行により、ハードカウンタに入力値と比較値との比
較処理を実行させ、両値が一致してハードカウンタから
出力があった場合には、割込み処理により上記テーブル
メモリのルックアップテーブルから当該比較値に対応す
るサブルーチンプログラムのアドレスを読出して、上記
プログラムメモリに記憶された当該アドレスのサブルー
チンプログラムを実行すると共に、上記ルックアップテ
ーブルから次の比較値を読出して上記ハードカウンタに
設定することを特徴とする。
According to another aspect of the present invention, a hard counter for comparing an input value obtained by counting the input pulse with a preset comparison value and outputting when both values match, the input value and a plurality of input values are output. A table memory storing a look-up table in which the address of the subroutine program to be executed when the comparison values match and the plurality of comparison values are stored, and a user program in which a comparison start instruction is incorporated are stored. And a program memory storing the above subroutine program. By executing a comparison start instruction in the above user program, the hardware counter is caused to execute a comparison process between the input value and the comparison value. If the values match and there is an output from the hard counter, the look-up of the above table memory is performed by the interrupt processing. The address of the subroutine program corresponding to the comparison value is read from the lookup table, the subroutine program of the address stored in the program memory is executed, and the next comparison value is read from the lookup table to the hard counter. It is characterized by setting.

【0009】[0009]

【作用】請求項1記載の発明では、メイン処理部は、テ
ーブル登録命令の実行によりサブ処理部のデュアルポー
トメモリにルックアップテーブルを記憶させ、比較開始
命令の実行によりサブ処理部へ比較要求を送信する。サ
ブ処理部では、その要求を受けて割込み処理により入力
インタフェースから取入れた入力値とデュアルポートメ
モリに記憶されたルックアップテーブルの複数の比較値
とを比較し、入力値と比較値とが一致した場合にはその
比較値と対応するサブルーチンプログラムのアドレスを
デュアルポートメモリに記憶させると共に、当該サブル
ーチン実行要求をメイン処理部へ送信する。メイン処理
部は、サブ処理部からのサブルーチン実行要求により上
記デュアルポートメモリに記憶されたアドレスのサブル
ーチンプログラムを実行する。
According to the first aspect of the present invention, the main processing section stores the lookup table in the dual port memory of the sub processing section by executing the table registration instruction, and issues a comparison request to the sub processing section by executing the comparison start instruction. Send. In response to the request, the sub processing unit compares the input value taken from the input interface by the interrupt processing with the plurality of comparison values in the lookup table stored in the dual port memory, and the input value and the comparison value match. In this case, the address of the subroutine program corresponding to the comparison value is stored in the dual port memory, and the subroutine execution request is transmitted to the main processing unit. The main processing unit executes the subroutine program of the address stored in the dual port memory in response to the subroutine execution request from the sub processing unit.

【0010】請求項2記載の発明では、上記請求項1記
載の発明において、サブ処理部でメイン処理部からの比
較要求によって割込み処理を行う際、ハードカウンタが
入力パルスをカウントした入力値と比較値とを比較し、
両値が一致した場合には割込み処理によりその比較値に
対応するサブルーチンプログラムのアドレスをデュアル
ポートメモリに記憶させ、サブルーチン実行要求をメイ
ン処理部へ送信すると共に、ルックアップテーブルから
次の比較値を読出してハードカウンタに設定する。
According to a second aspect of the present invention, in the above-mentioned first aspect of the invention, when the sub processing unit performs interrupt processing in response to a comparison request from the main processing unit, the hard counter compares the input pulse with the input value counted. Compare with the value,
If the two values match, the address of the subroutine program corresponding to the comparison value is stored in the dual port memory by interrupt processing, the subroutine execution request is sent to the main processing unit, and the next comparison value is sent from the lookup table. Read and set in hard counter.

【0011】請求項3記載の発明では、ユーザプログラ
ム中の比較開始命令の実行により、ハードカウンタに入
力値と比較値との比較処理を実行させ、この両値が一致
した場合、割込み処理によりその比較値に対応するサブ
ルーチンプログラムのアドレスを読出して当該アドレス
のサブルーチンプログラムを実行すると共に、ルックア
ップテーブルから次の比較値を読出してハードカウンタ
に設定する。
According to the third aspect of the present invention, by executing the comparison start instruction in the user program, the hardware counter is caused to execute the comparison processing between the input value and the comparison value. The address of the subroutine program corresponding to the comparison value is read and the subroutine program at that address is executed, and the next comparison value is read from the lookup table and set in the hard counter.

【0012】[0012]

【実施例】以下、本発明に係るPCの実施例を図面に基
づいて説明する。
Embodiments of the PC according to the present invention will be described below with reference to the drawings.

【0013】図1はPCの第1実施例を示しており、P
Cは、メイン処理部1とサブ処理部2とがCPUバスイ
ンタフェース(i/f)3を介して構成されている。
FIG. 1 shows a first embodiment of the PC, P
In C, a main processing unit 1 and a sub processing unit 2 are configured via a CPU bus interface (i / f) 3.

【0014】メイン処理部1は、MPU11、ROM1
2およびRAM13を備えており、ROM12にはMP
U11を動作させるためのシステムプログラムおよびサ
ブルーチンプログラムが格納されており、RAM13に
はこのメイン処理部1で実行すべきユーザプログラムが
磁気記憶装置(図示せず)等から読出されて記憶されて
いると共に、詳細は後述するが複数の比較値と入力値と
が一致した場合に実行すべきサブルーチンプログラムの
アドレスと当該複数の比較値とが対応して設定されたル
ックアップテーブル(図2参照)が記憶されている。ま
た、RAM13はMPU11のワークエリアとしても働
く。なお、メイン処理部1のユーザプログラムには、後
述するようにテーブル登録命令と比較命令とが1つずつ
組み込まれている。
The main processing section 1 includes an MPU 11 and a ROM 1
2 and RAM13, and ROM12 has MP
A system program and a subroutine program for operating U11 are stored, and a user program to be executed by the main processing unit 1 is read from a magnetic storage device (not shown) or the like and stored in the RAM 13. As will be described later in detail, a look-up table (see FIG. 2) in which the address of the subroutine program to be executed when a plurality of comparison values match the input value and the plurality of comparison values are set is stored. Has been done. The RAM 13 also works as a work area for the MPU 11. It should be noted that the user program of the main processing unit 1 incorporates one table registration command and one comparison command, as will be described later.

【0015】サブ処理部2は、MPU21、ROM2
2、RAM23、入力インタフェース24およびデュア
ルポートメモリ(DP−RAM)25を備えており、デ
ュアルポートメモリ25、CPUバスi/f3を介して
メイン処理部1の内部バスi/fと接続されている。R
OM22にはMPU21のシステムプログラムおよびサ
ブルーチンプログラムが格納されており、RAM23に
はサブ処理部で実行すべきユーザプログラムが磁気記憶
装置(図示せず)等から読出されて記憶されている。ま
た、RAM23はMPU21のワークエリアとして機能
し、入力i/f24はI/O(図示せず)からの入力デ
ータを入力値として取り入れる。なお、このユーザプロ
グラムにはメイン処理部1のものと異なり、テーブル登
録命令や比較命令が組み込まれてない。
The sub processing unit 2 includes an MPU 21 and a ROM 2
2, a RAM 23, an input interface 24, and a dual port memory (DP-RAM) 25, and is connected to the internal bus i / f of the main processing unit 1 via the dual port memory 25 and the CPU bus i / f3. . R
The OM 22 stores a system program and a subroutine program of the MPU 21, and the RAM 23 stores a user program to be executed by the sub processing unit read from a magnetic storage device (not shown) or the like. Further, the RAM 23 functions as a work area of the MPU 21, and the input i / f 24 takes in input data from an I / O (not shown) as an input value. Unlike the main processing unit 1, this user program does not include a table registration command or comparison command.

【0016】図2は、メイン処理部1のRAM13に予
め記憶されているルックアップテーブル4の一例を示し
ている。ルックアップテーブル4は、予めユーザによっ
て作成され、上記入力値と比較すべき複数の比較値1,
2,3,…と、上記入力値と比較値1,2,3,…とが
一致した場合に実行すべきサブルーチンプログラムのア
ドレスA,B,C,…とが、各々対応して格納されてい
る。
FIG. 2 shows an example of the look-up table 4 stored in advance in the RAM 13 of the main processing section 1. The lookup table 4 is created in advance by the user and has a plurality of comparison values 1 to be compared with the input value.
, And the addresses A, B, C, ... Of the subroutine program to be executed when the input value and the comparison value 1, 2, 3 ,. There is.

【0017】次に、本実施例の動作を図3を参照して説
明する。
Next, the operation of this embodiment will be described with reference to FIG.

【0018】図3は、本実施例のメイン処理部1および
サブ処理部2における動作を示している。
FIG. 3 shows the operation of the main processor 1 and the sub processor 2 of this embodiment.

【0019】メイン処理部1およびサブ処理部2は、各
々のユーザプログラムを実行しており、メイン処理部1
ではテーブル登録命令および比較命令以外の通常の命令
(以下、通常命令という)を実行した場合は、各々その
命令に対応した通常処理、すなわち端末機器等に対し指
令を送出して当該端末機器の制御等を行う一方(ステッ
プ100“Yes”,ステップ110)、サブ処理部2で
はユーザプログラム中に通常命令しかないため通常命令
の実行による通常処理を行っている(ステップ20
0)。
The main processing section 1 and the sub processing section 2 execute their respective user programs, and the main processing section 1
When normal commands other than table registration commands and comparison commands (hereinafter referred to as normal commands) are executed, normal processing corresponding to each command, that is, a command is sent to the terminal device to control the terminal device. While the above is performed (step 100 “Yes”, step 110), the sub-processing unit 2 performs the normal processing by executing the normal instruction because the user program has only the normal instruction (step 20).
0).

【0020】ところで、メイン処理部1がテーブル登録
命令を実行した場合には(ステップ100“No”,1
20“テーブル登録”)、メイン処理部1は、RAM1
3に記憶していたルックアップテーブルをCPUバスi
/f3を介してサブ処理部2のデュアルポートメモリ2
5にコピーすると共に(ステップ130)、サブ処理部
2のMPU21に対してルックアップテーブルの登録が
あったことを通知し(ステップ110)、続いて次の命
令を実行する。
By the way, when the main processing unit 1 executes the table registration command (step 100 "No", 1
20 "table registration"), the main processing unit 1, RAM1
The lookup table stored in 3 is stored in the CPU bus i
Dual port memory 2 of sub processing unit 2 via / f3
5 is copied (step 130), the MPU 21 of the sub processing unit 2 is notified that the lookup table has been registered (step 110), and then the next instruction is executed.

【0021】そして、メイン処理部1は次の命令が通常
命令であれば、通常処理を行い(ステップ100“Ye
s”,110)、順次ユーザプログラムを実行して各種
通常処理を行う。なお、サブ処理部2は、ここまで通常
処理(ステップ200)を続行している。
If the next instruction is a normal instruction, the main processing section 1 performs normal processing (step 100 "Ye").
s ″, 110) and sequentially executes the user program to perform various normal processing. The sub-processing unit 2 continues the normal processing (step 200) up to this point.

【0022】一方、メイン処理部1が比較命令を実行し
た場合には(ステップ100“No”,120“比
較”)、メイン処理部1からサブ処理部2へ比較要求が
送信され(ステップ150)、サブ処理部2では、その
比較要求を受信した場合(ステップ210“Yes”)、
続いてデュアルポートメモリ25にルックアップテーブ
ルが登録されているか否かを判断する(ステップ22
0)。
On the other hand, when the main processing section 1 executes the comparison command (step 100 "No", 120 "comparison"), the main processing section 1 sends a comparison request to the sub processing section 2 (step 150). In the sub-processing unit 2, when the comparison request is received (step 210 “Yes”),
Then, it is determined whether or not a lookup table is registered in the dual port memory 25 (step 22).
0).

【0023】ルックアップテーブルが登録されてない場
合には(ステップ220“No”)、そのまま通常処理
(ステップ200)を続行するが、この場合には、ルッ
クアップテーブル登録の通知があり(ステップ14
0)、ステップ130でメイン処理部1によってルック
アップテーブルがデュアルポートメモリ25に登録され
ているため(ステップ220)、サブ処理部2は、割込
み処理により通常処理を中断して比較処理を開始する
(ステップ230)。
If the look-up table is not registered (step 220 "No"), the normal processing (step 200) is continued as it is, but in this case, the look-up table registration is notified (step 14).
0), since the look-up table is registered in the dual port memory 25 by the main processing unit 1 in step 130 (step 220), the sub processing unit 2 interrupts the normal processing by the interrupt processing and starts the comparison processing. (Step 230).

【0024】比較処理は、MPU21が入力i/f24
からの入力値と、デュアルポートメモリ25に登録され
たルックアップテーブル4(図2参照)の全比較値とを
対象にして行われ、入力値と一致する比較値がある場合
には(ステップ240)、当該比較値に対応して記憶さ
れたサブルーチンNo、すなわち一致した場合に実行す
べきサブルーチンプログラムのアドレスをデュアルポー
トメモリ25の任意のアドレスに記憶させ(ステップ2
50)、サブルーチン実行要求を当該任意のアドレスと
共にメイン処理部1へ送信する(ステップ260)。
In the comparison processing, the MPU 21 inputs the i / f24.
Input value from all the comparison values in the lookup table 4 (see FIG. 2) registered in the dual port memory 25, and if there is a comparison value that matches the input value (step 240). ), The subroutine No. stored corresponding to the comparison value, that is, the address of the subroutine program to be executed when they match is stored in an arbitrary address of the dual port memory 25 (step 2
50), the subroutine execution request is transmitted to the main processing unit 1 together with the arbitrary address (step 260).

【0025】ところで、メイン処理部1では、ステップ
150で比較要求を送信後、次の命令を実行しており、
既にテーブル登録命令と比較命令は実行済みのため、1
スキャン内では通常命令実行による通常処理を実行して
いる(ステップ160“No”,ステップ100,11
0)。
By the way, the main processing section 1 executes the next command after transmitting the comparison request in step 150,
1 because the table registration command and comparison command have already been executed
In the scan, normal processing is executed by executing a normal instruction (step 160 “No”, steps 100 and 11).
0).

【0026】そして、サブ処理部2での比較処理の結
果、入力値と比較値とが一致しない場合には、サブ処理
部2からサブルーチン実行要求が送信されてこないた
め、メイン処理部1は、このスキャン内では比較処理や
サブルーチン分岐処理もまったく行わずに、通常命令実
行による通常処理を続ける。
When the input value and the comparison value do not match as a result of the comparison processing in the sub-processing unit 2, the sub-processing unit 2 does not send a subroutine execution request. Within this scan, the normal processing by the normal instruction execution is continued without performing any comparison processing or subroutine branch processing.

【0027】一方、サブ処理部2からサブルーチン実行
要求があった場合には(ステップ160)、メイン処理
部1は、割込み処理により現在実行中の通常命令による
通常処理を中断して、その要求と共に送られたアドレス
に基づきデュアルポートメモリ25からサブルーチンN
oを読出し、そのサブルーチンNoのサブルーチン実行
処理に分岐する(ステップ170)。そして、その分岐
した処理が完了すれば、メイン処理部1は、今まで行っ
ていた元の通常処理に復帰してその通常処理を再開す
る。
On the other hand, when there is a sub-routine execution request from the sub-processing unit 2 (step 160), the main processing unit 1 interrupts the normal processing by the normal instruction currently being executed by the interrupt processing, and along with the request. Subroutine N from the dual port memory 25 based on the sent address
Then, "o" is read, and the process branches to the subroutine execution process of that subroutine No (step 170). When the branched processing is completed, the main processing unit 1 returns to the original normal processing that has been performed so far and restarts the normal processing.

【0028】従って、この第1実施例によれば、複数の
比較処理がある場合には、当該複数の比較値に対応した
サブルーチンNoをルックアップテーブルに登録して複
数の比較命令やサブルーチンプログラム分岐命令を1つ
の比較命令にまとめるようにしたため、ユーザプログラ
ム量の削減、およびユーザプログラムのプログラミング
時の手間の削減を図ることができる。
Therefore, according to the first embodiment, when there are a plurality of comparison processes, a subroutine No corresponding to the plurality of comparison values is registered in the look-up table and a plurality of comparison instructions or subroutine program branches are registered. Since the instructions are combined into one comparison instruction, it is possible to reduce the amount of the user program and the labor required for programming the user program.

【0029】また、メイン処理部1においては、複数の
比較処理が実行されることはなく、ユーザ処理部2にて
複数の比較処理を行ってその比較処理の結果、入力値と
比較値とが一致した場合にのみ割込み処理によってサブ
ルーチンプログラムへ分岐するようにしたため、比較の
結果入力値との一致が検出されなかった場合には比較処
理を行わない場合とほとんどスキャンタイムが変わらな
い程スキャンタイムに影響を与えず、また比較の結果入
力値との一致が検出された場合でも、比較処理のための
時間を要しないことによりスキャンタイムを短縮でき
る。
Further, in the main processing section 1, a plurality of comparison processings are not executed, and in the user processing section 2, a plurality of comparison processings are performed, and as a result of the comparison processings, the input value and the comparison value are compared. Since the branch to the subroutine program is made by interrupt processing only when they match, when the match with the input value is not detected as a result of the comparison, the scan time is almost the same as when the comparison is not performed and the scan time is almost the same. Even if a match with the input value is detected as a result of comparison without affecting, the scan time can be shortened by not requiring time for comparison processing.

【0030】なお、本実施例では、メイン処理部1のR
AM13に上記ルックアップテーブルを登録しておき、
テーブル登録命令の実行によりサブ処理部2のデュアル
ポートメモリ25にコピーするように説明したが、これ
に限らず、例えば上記ルックアップテーブルを予めサブ
処理部2のRAM23等に記憶するようにしておけば、
メイン処理部1で実行すべきユーザプログラム中にテー
ブル登録命令を組み込む必要がなくなり比較命令だけで
良いため、図3に示すステップ120〜140のテーブ
ル登録についての処理も必要なくなり、よりメイン処理
部1におけるユーザプログラム量の削減、およびスキャ
ンタイムの削減が図れる。
In this embodiment, R of the main processing section 1
Register the lookup table in AM13,
Although it has been described that the table registration command is executed to copy to the dual port memory 25 of the sub processing unit 2, the present invention is not limited to this, and the lookup table may be stored in the RAM 23 or the like of the sub processing unit 2 in advance. If
Since it is not necessary to incorporate the table registration instruction in the user program to be executed by the main processing unit 1 and only the comparison instruction is required, the processing for table registration in steps 120 to 140 shown in FIG. It is possible to reduce the amount of user program and the scan time in.

【0031】次に、本発明の第2実施例を説明する。Next, a second embodiment of the present invention will be described.

【0032】図4は、第2実施例に係るPCの構成を示
している。
FIG. 4 shows the configuration of the PC according to the second embodiment.

【0033】この第2実施例では、第1実施例のサブ処
理部2においてMPU21と入力i/f24との間に、
ハードカウンタ26を設けていることを特徴としてい
る。従って、他の構成要素は図1に示す第1実施例のも
のとほぼ同一機能を有するため、第1実施例のものと同
一番号を付与して説明を省略し、ハードカウンタ26の
構成を説明する。
In the second embodiment, between the MPU 21 and the input i / f 24 in the sub processing unit 2 of the first embodiment,
The feature is that a hard counter 26 is provided. Therefore, the other constituent elements have almost the same functions as those of the first embodiment shown in FIG. 1, and therefore, the same numbers as those of the first embodiment are given and their explanations are omitted, and the construction of the hard counter 26 is explained. To do.

【0034】このハードカウンタ26は、一致出力を持
つコンペアレジスタ付きのもので、入力i/f24を介
し入力するパルスをカウントし、このカウント数を入力
値としてコンペアレジスタにセットすると共に、後述す
るようにこの入力値と、MPU21によってルックアッ
プテーブルからセットされた比較値とを比較して、入力
値と比較値とが一致した場合には出力を行うように構成
されている。
The hard counter 26 is provided with a compare register having a coincidence output, counts the pulses input through the input i / f 24, sets the count number as an input value in the compare register, and will be described later. The input value is compared with the comparison value set by the MPU 21 from the look-up table, and output is performed when the input value and the comparison value match.

【0035】次に、本実施例の動作を図5を参照して説
明する。
Next, the operation of this embodiment will be described with reference to FIG.

【0036】図5は、第2実施例のメイン処理部1およ
びサブ処理部2における動作を示しており、図3に示す
第1実施例の動作とは、ステップ230のサブ処理部2
におけるメイン処理部1からの比較要求受信後の比較処
理をハードカウンタ26によって行う点が異なるだけで
ある。
FIG. 5 shows the operation of the main processor 1 and the sub processor 2 of the second embodiment. The operation of the first embodiment shown in FIG. 3 is the sub processor 2 of step 230.
The difference is that the hardware counter 26 performs the comparison processing after receiving the comparison request from the main processing unit 1 in FIG.

【0037】つまり、この第2実施例では、サブ処理部
2がメイン処理部1から比較要求を受信し、テーブルが
登録済みである場合には(ステップ210“Yes”,2
20“Yes”)、サブ処理部2では、割込み処理により
現在実行中の通常処理を中断して、ハードカウンタ26
に入力パルス数である入力値と、後述するようにして予
めセットされた比較値とを比較させる(ステップ23
0)。
That is, in the second embodiment, when the sub-processing unit 2 receives the comparison request from the main processing unit 1 and the table is already registered (step 210 "Yes", 2).
20 “Yes”), the sub-processing unit 2 interrupts the normal processing currently being executed by the interrupt processing, and the hard counter 26
The input value, which is the number of input pulses, is compared with a comparison value preset as described later (step 23).
0).

【0038】ここで、入力値と比較値とが一致している
場合には(ステップ240“Yes”)、ハードカウンタ
26から出力がされ、割込み処理により当該比較値に対
応したサブルーチンNoをデュアルポートメモリ25に
記憶させると共に(ステップ250)、メイン処理部1
に当該サブルーチンNoのサブルーチン実行要求を送信
し(ステップ260)、続いてMPU21がハードカウ
ンタ26に次の比較値をセット、すなわち例えば図2を
参照して説明すると比較値1の次には比較値2、比較値
2の次には比較値3というようにセットし(ステップ2
70)、割込み処理を終了して通常処理(ステップ20
0)に戻る。
Here, if the input value and the comparison value match (step 240 "Yes"), the hardware counter 26 outputs, and the subroutine number corresponding to the comparison value is output to the dual port by the interrupt processing. The main processing unit 1 stores the data in the memory 25 (step 250).
To the sub-routine execution request (step 260), and then the MPU 21 sets the next comparison value in the hard counter 26. That is, for example, referring to FIG. 2 and comparison value 2 are set next to comparison value 3 (step 2
70), the interrupt processing is terminated and normal processing is performed (step 20).
Return to 0).

【0039】なお、1回目の比較処理の場合には、ハー
ドカウンタ26には比較値が設定されないため、比較処
理の前にMPU21が、ハードカウンタ26にセットさ
れた現在の入力値に基づいてこの入力値より大きい値
で、かつ、最も近い比較値をデュアルポートメモリ25
に記憶されたルックアップテーブルより検索してセット
するようにし、その後はステップ270でハードカウン
タ26の一致出力時の割込み処理によって上述のように
次の比較値をセットしてテーブルの最後まで繰り返すよ
うにし、テーブルの最後まで来たら先頭の比較値に戻る
ようにセットする。ただし、比較値に対応するサブルー
チンNoに特定の値(例えば、“FFFF”)をセット
しておけば、更新時に所望の比較値へ飛ばすことができ
る。
In the case of the first comparison processing, since the comparison value is not set in the hard counter 26, the MPU 21 determines the comparison value based on the current input value set in the hard counter 26 before the comparison processing. The value that is greater than the input value and that is the closest comparison value is the dual port memory 25.
The lookup table stored in the table is searched and set. Then, in step 270, the next comparison value is set as described above by the interrupt processing at the time of coincidence output of the hard counter 26 and repeated until the end of the table. And set it so that when the end of the table is reached, it returns to the comparison value at the beginning. However, if a specific value (for example, "FFFF") is set in the subroutine No corresponding to the comparison value, it is possible to jump to the desired comparison value when updating.

【0040】従って、この第2実施例によれば、上述の
第1実施例と同様に、複数の比較処理がある場合でもル
ックアップテーブルを用いて1つの比較命令にまとめる
ことにより、ユーザプログラム量およびプログラミング
時の手間の削減を図ることができる。
Therefore, according to the second embodiment, as in the first embodiment described above, even if there are a plurality of comparison processes, they are combined into one comparison instruction by using the look-up table, so that the user program amount can be reduced. Also, the time and effort required for programming can be reduced.

【0041】また、比較処理をユーザ処理部2における
ハードカウンタ26により行うようにし、このハードカ
ウンタ26のコンペア一致出力時に、割込み処理により
メイン処理部1へサブルーチン実行要求を送信し、メイ
ン処理部1においてはそのサブルーチン実行要求を受け
た際に、割込み処理によってサブルーチンへ分岐するた
め、メイン処理部1においては比較処理やサブルーチン
分岐処理を毎スキャン実行することがなくなり、メイン
処理部1におけるスキャンタイムが短縮化される。
Further, the comparison process is performed by the hard counter 26 in the user processing unit 2, and when the compare match output of the hard counter 26 is performed, a subroutine execution request is transmitted to the main processing unit 1 by the interrupt process, and the main processing unit 1 In this case, when the sub-routine execution request is received, the main processing unit 1 does not execute the comparison process or the sub-routine branch process for each scan because the process branches to the sub-routine by the interrupt processing, and the scan time in the main processing unit 1 is reduced. It is shortened.

【0042】なお、本実施例でも、第1実施例と同様に
メイン処理部1のRAM13にルックアップテーブルを
登録しておき、テーブル登録命令の実行によりデュアル
ポートメモリ25にコピーするように説明したが、これ
に限らず、ルックアップテーブルを予めサブ処理部2の
RAM23等に記憶しておくことにより、メイン処理部
1のユーザプログラム中にはテーブル登録命令が必要が
なくなり、またそれにより図5に示すステップ120〜
140の処理も必要なくなり、よりメイン処理部1にお
けるユーザプログラム量の削減およびスキャンタイムの
削減が図れることになる。
Also in this embodiment, as in the first embodiment, the lookup table is registered in the RAM 13 of the main processing unit 1 and is copied to the dual port memory 25 by executing the table registration command. However, the present invention is not limited to this, and by storing the lookup table in the RAM 23 or the like of the sub processing unit 2 in advance, the table registration instruction is not required in the user program of the main processing unit 1, and as a result, FIG. Step 120-
The processing of 140 is also unnecessary, and the amount of user programs in the main processing unit 1 and the scan time can be further reduced.

【0043】次に、本発明の第3実施例を説明する。Next, a third embodiment of the present invention will be described.

【0044】図6は、第3実施例に係るPCの構成を示
しており、このPCでは、上述の第1および第2の実施
例とは異なり、サブ処理部を使用せずに、メイン処理部
のみで本発明の目的を達成するように構成したもので、
その処理は基本的にはサブ処理部でハードカウンタを用
いた第2実施例の場合と同様である。
FIG. 6 shows the configuration of the PC according to the third embodiment. Unlike the first and second embodiments described above, this PC does not use the sub-processing unit and does not perform the main processing. It is configured so as to achieve the object of the present invention with only a part,
The processing is basically the same as that of the second embodiment using the hard counter in the sub processing unit.

【0045】つまり、この第3実施例に係るPCは、M
PU31、ROM32、RAM33、入力i/f34、
およびハードカウンタ36を有しており、MPU31は
このメイン処理部全体を制御し、ROM12にはMPU
31が実行すべきシステムプログラムおよびサブルーチ
ンプログラムが格納されており、RAM33には磁気フ
ァイル装置(図示せず)等から読出され比較命令が1つ
組み込まれたユーザプログラム、および第1、第2実施
例と同様のルックアップテーブル(図2参照)が記憶さ
れている。
That is, the PC according to the third embodiment is M
PU31, ROM32, RAM33, input i / f34,
The MPU 31 controls the entire main processing section, and the ROM 12 has an MPU 31.
A system program and a subroutine program to be executed by 31 are stored, and a user program in which one comparison command is incorporated into the RAM 33 and read from a magnetic file device (not shown), and the first and second embodiments. A lookup table similar to that (see FIG. 2) is stored.

【0046】また、RAM33はMPU31のワークエ
リアとしても働き、入力i/f34およびハードカウン
タ36は、図5に示す第2実施例の入力i/f24およ
びハードカウンタ26と同一機能である。
The RAM 33 also functions as a work area for the MPU 31, and the input i / f 34 and the hard counter 36 have the same functions as the input i / f 24 and the hard counter 26 of the second embodiment shown in FIG.

【0047】次に、本実施例の動作を図7を参照して説
明する。
Next, the operation of this embodiment will be described with reference to FIG.

【0048】図7は、この第3実施例のPCにおける動
作を示しており、PCはユーザプログラムを実行して、
通常命令の場合にはその命令に対応した通常処理、すな
わち端末機器に対し指令を送出して当該端末機器の制御
等を行っている(ステップ300“Yes”,ステップ3
10)。
FIG. 7 shows the operation of the PC according to the third embodiment. The PC executes the user program,
In the case of a normal command, a normal process corresponding to the command, that is, a command is sent to the terminal device to control the terminal device (step 300 “Yes”, step 3).
10).

【0049】一方、ユーザプログラム中の命令を実行し
ている際に、比較命令を実行した場合には(ステップ3
00“No”)、テーブルが登録されているか否かを判
断して(ステップ320)、登録されてない場合には比
較処理を行わず次の命令を実行するが(ステップ320
“No”,300)、この場合には予めRAM33にル
ックアップテーブルが記憶されているため(ステップ3
20“Yes”)、MPU31はハードカウンタ36に指
令を送出して、入力パルスのカウント数である入力値
と、予めルックアップテーブルから後述するようにセッ
トされた比較値とを比較させる(ステップ330)。
On the other hand, if the comparison instruction is executed while executing the instruction in the user program (step 3
00 "No"), it is judged whether or not the table is registered (step 320), and if not registered, the next instruction is executed without performing the comparison process (step 320).
“No”, 300), in this case, since the lookup table is stored in the RAM 33 in advance (step 3
20 "Yes"), the MPU 31 sends a command to the hard counter 36 to compare the input value, which is the count number of the input pulse, with the comparison value previously set from the look-up table as described later (step 330). ).

【0050】ここで、入力値と比較値とが一致してハー
ドカウンタ36から出力があった場合には(ステップ3
40“Yes”)、PCは、割込み処理により当該比較値
に対応して格納されたサブルーチンNoをRAM33に
記憶すると共に(ステップ350)、当該サブルーチン
Noのサブルーチンプログラムを実行して(ステップ3
60)、続いてハードカウンタ36に次の比較値を第2
実施例の場合と同様にセットし(ステップ270)、通
常処理(ステップ300)に戻る。なお、ハードカウン
タ36における比較値の設定手順は、第2実施例の場合
と同様で入力値と比較値とが一致した場合のみ次の比較
値を設定する。
Here, when the input value and the comparison value match and there is an output from the hardware counter 36 (step 3
40 “Yes”), the PC stores the subroutine No. corresponding to the comparison value by the interrupt process in the RAM 33 (Step 350) and executes the subroutine program of the subroutine No (Step 3).
60), and then the second comparison value to the hard counter 36
The setting is performed as in the case of the embodiment (step 270), and the process returns to the normal process (step 300). The procedure for setting the comparison value in the hard counter 36 is the same as that in the second embodiment, and the next comparison value is set only when the input value and the comparison value match.

【0051】従って、この第3実施例によれば、上述の
第1、第2実施例と同様に、ユーザプログラム量および
プログラミング時の手間の削減を図ることができると共
に、比較処理をユーザプログラム中でなく割込み処理に
よるハードカウンタ36により行い、このハードカウン
タ36のコンペア一致出力時に、割込み処理によってサ
ブルーチンを実行するようにしたため、PCにおいては
比較処理やサブルーチン分岐処理を毎スキャン実行する
ことがなくなり、PCにおけるスキャンタイムが短縮化
する。
Therefore, according to the third embodiment, as in the first and second embodiments described above, the amount of user program and the labor required for programming can be reduced, and the comparison process can be performed during the user program. Instead, the hardware counter 36 performs interrupt processing, and when the hardware counter 36 outputs a compare match, the subroutine is executed by interrupt processing. Therefore, the PC does not perform comparison processing or subroutine branch processing every scan. Scan time in PC is shortened.

【0052】[0052]

【発明の効果】以上説明したように、請求項1記載の発
明では、複数の比較処理がある場合には、ルックアップ
テーブルに入力値と比較値とが一致した場合に実行すべ
きサブルーチンプログラムのアドレスを当該複数の比較
値と対応して登録しておき、複数の比較命令、サブルー
チンプログラム分岐命令を1つの比較命令にまとめるよ
うにしたため、ユーザプログラム量およびユーザプログ
ラム作成の手間を削減できる。
As described above, according to the first aspect of the present invention, when there are a plurality of comparison processes, the subroutine program to be executed when the input value and the comparison value match in the lookup table. Since the addresses are registered in association with the plurality of comparison values and the plurality of comparison instructions and the subroutine program branch instructions are combined into one comparison instruction, the amount of user program and the time and effort for creating the user program can be reduced.

【0053】また、メイン処理部では、比較処理を実行
することはなく、ユーザ処理部にて比較処理を行って入
力値と比較値とが一致した場合にのみ割込み処理により
サブルーチンプログラムを実行するようにしたため、比
較処理のための時間を要せずスキャンタイムを短縮でき
る。
Further, the main processing unit does not execute the comparison process, but the user processing unit performs the comparison process so that the subroutine program is executed by the interrupt process only when the input value and the comparison value match. Therefore, the scan time can be shortened without requiring the time for comparison processing.

【0054】また、請求項2記載の発明では、請求項1
記載の発明と同様に、複数の比較処理がある場合でもル
ックアップテーブルを用いて1つの比較命令にまとめる
ことにより、ユーザプログラム量およびプログラミング
時の手間の削減を図ることができると共に、比較処理を
ユーザ処理部におけるハードカウンタにより行い、この
ハードカウンタのコンペア一致出力時に、サブ処理部か
らメイン処理部へサブルーチン実行要求が送信され、メ
イン処理部においてはそのサブルーチン実行要求を受
け、割込み処理によってサブルーチンを実行するため、
メイン処理部においては比較処理を毎スキャン実行する
ことがなくなり、メイン処理部におけるスキャンタイム
が短縮化する。
According to the invention described in claim 2,
Similar to the invention described above, even when there are a plurality of comparison processes, by combining them into one comparison instruction using a look-up table, it is possible to reduce the amount of user program and labor at the time of programming, and to perform the comparison process. The sub-processing unit sends a subroutine execution request to the main processing unit when the hard counter in the user processing unit outputs a compare match output from the hard counter. The main processing unit receives the sub-routine execution request and executes a subroutine by interrupt processing. To run
The main processing unit does not execute the comparison process every scan, and the scan time in the main processing unit is shortened.

【0055】また、請求項3記載の発明によれば、請求
項1、請求項2記載の発明と同様に、ユーザプログラム
量およびプログラミング時の手間の削減を図ることがで
きると共に、割込み処理によるハードカウンタのコンペ
ア一致出力を用いることにより、比較処理が毎スキャン
実行されず、入力値と比較値とが一致した場合にのみ割
込み処理によってサブルーチンプログラムへ分岐するた
め、PCにおけるスキャンタイムが短縮化する。
According to the third aspect of the present invention, as in the first and second aspects of the present invention, it is possible to reduce the amount of user program and the time and effort required for programming, and at the same time, perform hardware processing by interrupt processing. By using the compare match output of the counter, the comparison process is not executed every scan, and the process branches to the subroutine program by the interrupt process only when the input value and the comparison value match, so that the scan time in the PC is shortened.

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

【図1】本発明に係るPCの第1実施例の構成を示すブ
ロック図。
FIG. 1 is a block diagram showing the configuration of a first embodiment of a PC according to the present invention.

【図2】ルックアップテーブルを示す説明図。FIG. 2 is an explanatory diagram showing a lookup table.

【図3】第1実施例の動作を示すフローチャート。FIG. 3 is a flowchart showing the operation of the first embodiment.

【図4】第2実施例の構成を示すブロック図。FIG. 4 is a block diagram showing the configuration of a second embodiment.

【図5】第2実施例の動作を示すフローチャート。FIG. 5 is a flowchart showing the operation of the second embodiment.

【図6】第3実施例の構成を示すブロック図。FIG. 6 is a block diagram showing the configuration of a third embodiment.

【図7】第3実施例の動作を示すフローチャート。FIG. 7 is a flowchart showing the operation of the third embodiment.

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

1 メイン処理部 2 ユーザ処理部 3 メイン処理部 4 ルックアップテーブル 12 ROM(プログラムメモリ) 13 RAM(ユーザプログラムメモリ、テーブルメモ
リ) 24 入力インタフェース(i/f) 25 デュアルポートメモリ(DP−RAM) 26 ハードカウンタ
1 Main Processing Unit 2 User Processing Unit 3 Main Processing Unit 4 Lookup Table 12 ROM (Program Memory) 13 RAM (User Program Memory, Table Memory) 24 Input Interface (i / f) 25 Dual Port Memory (DP-RAM) 26 Hard counter

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 入力値と複数の比較値とが一致した場合
に実行すべきサブルーチンプログラムのアドレスと上記
複数の比較値とが対応して格納されたルックアップテー
ブルを記憶したテーブルメモリ、テーブル登録命令およ
び比較開始命令が組込まれたユーザプログラムを記憶し
たプログラムメモリ、および上記サブルーチンプログラ
ムを記憶したプログラムメモリを有するメイン処理部
と、 上記メイン処理部と接続されるデュアルポートメモリ、
および入力値を取入れる入力インタフェースを有するサ
ブ処理部とからなり、 上記メイン処理部は、上記ユーザプログラム中のテーブ
ル登録命令の実行により上記サブ処理部のデュアルポー
トメモリに上記ルックアップテーブルを記憶させ、上記
ユーザプログラム中の比較開始命令の実行によりサブ処
理部へ比較要求を送信すると共に、上記サブ処理部から
サブルーチン実行要求を受信した場合には、割込み処理
によりデュアルポートメモリに記憶されたアドレスのサ
ブルーチンプログラムを実行し、 上記サブ処理部は、上記メイン処理部から比較要求を受
信した場合には、割込み処理により入力インタフェース
から取入れた入力値とデュアルポートメモリに記憶され
た上記ルックアップテーブルの複数の比較値とを比較
し、入力値と比較値とが一致した場合にはその比較値と
対応するサブルーチンプログラムのアドレスを上記デュ
アルポートメモリに記憶させると共に、当該サブルーチ
ンプログラムの実行要求を上記メイン処理部へ送信す
る、 ことを特徴とするプログラマブル・コントローラ。
1. A table memory storing a look-up table in which an address of a subroutine program to be executed when an input value and a plurality of comparison values match and the plurality of comparison values are stored, and table registration. A main processing section having a program memory storing a user program in which an instruction and a comparison start instruction are incorporated, and a program memory storing the above subroutine program; and a dual port memory connected to the main processing section,
And a sub processing unit having an input interface for receiving an input value. The main processing unit stores the lookup table in a dual port memory of the sub processing unit by executing a table registration command in the user program. , When the comparison request is transmitted to the sub processing unit by executing the comparison start instruction in the user program and the subroutine execution request is received from the sub processing unit, the address stored in the dual port memory is processed by the interrupt processing. When the sub-processing unit executes the subroutine program and the comparison request is received from the main processing unit, the sub-processing unit stores a plurality of the input values taken from the input interface by the interrupt processing and the look-up table stored in the dual port memory. Compare with the comparison value of and compare with the input value When the two match, the address of the subroutine program corresponding to the comparison value is stored in the dual port memory, and an execution request of the subroutine program is transmitted to the main processing unit. .
【請求項2】 入力値と複数の比較値とが一致した場合
に実行すべきサブルーチンプログラムのアドレスと上記
複数の比較値とが対応して格納されたルックアップテー
ブルを記憶したテーブルメモリ、テーブル登録命令およ
び比較開始命令が組込まれたユーザプログラムを記憶し
たプログラムメモリ、および上記サブルーチンプログラ
ムを記憶したプログラムメモリを有するメイン処理部
と、 上記メイン処理部と接続されるデュアルポートメモリ、
および入力パルスをカウントした入力値と予め設定され
た比較値とを比較して両値が一致した場合に出力を行う
ハードカウンタを有するサブ処理部とからなり、 上記メイン処理部は、上記ユーザプログラム中のテーブ
ル登録命令の実行により上記サブ処理部のデュアルポー
トメモリに上記ルックアップテーブルを記憶させ、上記
ユーザプログラム中の比較開始命令の実行によりサブ処
理部へ比較要求を送信すると共に、上記サブ処理部から
サブルーチン実行要求を受信した場合には、割込み処理
によりデュアルポートメモリに記憶されたアドレスのサ
ブルーチンプログラムを実行し、 上記サブ処理部は、上記メイン処理部から比較要求があ
った場合には、割込み処理によりハードカウンタに入力
値と比較値との比較処理を実行させ、両値が一致してハ
ードカウンタから出力があった場合には、割込み処理に
より当該比較値に対応するサブルーチンプログラムのア
ドレスをデュアルポートメモリに記憶させると共に、当
該サブルーチンプログラムの実行要求を上記メイン処理
部へ送信し、デュアルポートメモリに記憶されたルック
アップテーブルから次の比較値を読出してハードカウン
タに設定する、 ことを特徴とするプログラマブル・コントローラ。
2. A table memory storing a look-up table in which an address of a subroutine program to be executed when the input value and a plurality of comparison values match and the plurality of comparison values are stored, and table registration. A main processing section having a program memory storing a user program in which an instruction and a comparison start instruction are incorporated, and a program memory storing the above subroutine program; and a dual port memory connected to the main processing section,
And a sub-processing unit having a hard counter that compares the input value counted by the input pulse with a preset comparison value and outputs if the two values match, the main processing unit is the user program. The lookup table is stored in the dual port memory of the sub-processing unit by executing the table registration command in the sub-processing unit, and the comparison request is transmitted to the sub-processing unit by executing the comparison start command in the user program. When a subroutine execution request is received from the unit, the subroutine program of the address stored in the dual port memory is executed by interrupt processing, and the sub processing unit receives the comparison request from the main processing unit. Interrupt processing causes the hardware counter to execute a comparison process between the input value and the comparison value, and both values are If there is an output from the hardware counter, the address of the subroutine program corresponding to the comparison value is stored in the dual port memory by the interrupt process, and the execution request of the subroutine program is sent to the main processing unit. A programmable controller, wherein the next comparison value is read from a look-up table stored in the dual port memory and set in a hard counter.
【請求項3】 入力パルスをカウントした入力値と予め
設定された比較値とを比較して両値が一致した場合に出
力を行うハードカウンタと、上記入力値と複数の比較値
とが一致した場合に実行すべきサブルーチンプログラム
のアドレスと上記複数の比較値とが対応して格納された
ルックアップテーブルを記憶したテーブルメモリと、比
較開始命令が組込まれたユーザプログラムを記憶したユ
ーザプログラムメモリと、上記サブルーチンプログラム
を記憶したプログラムメモリとを有しており、 上記ユーザプログラム中の比較開始命令の実行により、
ハードカウンタに入力値と比較値との比較処理を実行さ
せ、両値が一致してハードカウンタから出力があった場
合には、割込み処理により上記テーブルメモリのルック
アップテーブルから当該比較値に対応するサブルーチン
プログラムのアドレスを読出して、上記プログラムメモ
リに記憶された当該アドレスのサブルーチンプログラム
を実行すると共に、上記ルックアップテーブルから次の
比較値を読出して上記ハードカウンタに設定する、 ことを特徴とするプログラマブル・コントローラ。
3. A hard counter which compares an input value counted by an input pulse with a preset comparison value and outputs when the two values match, and the input value and a plurality of comparison values match each other. In the case, a table memory storing a look-up table in which the address of the subroutine program to be executed and the plurality of comparison values are stored in correspondence with each other, a user program memory storing a user program in which a comparison start instruction is incorporated, It has a program memory storing the above subroutine program, and by executing the comparison start instruction in the above user program,
When the hard counter is made to perform a comparison process between the input value and the comparison value, and when both values match and there is an output from the hard counter, an interrupt process corresponds to the comparison value from the lookup table of the table memory. Programmable, characterized in that the address of the subroutine program is read, the subroutine program of the address stored in the program memory is executed, and the next comparison value is read from the lookup table and set in the hard counter. ·controller.
JP20780192A 1992-08-04 1992-08-04 Programmable controller Expired - Lifetime JP3393475B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20780192A JP3393475B2 (en) 1992-08-04 1992-08-04 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20780192A JP3393475B2 (en) 1992-08-04 1992-08-04 Programmable controller

Publications (2)

Publication Number Publication Date
JPH0651812A true JPH0651812A (en) 1994-02-25
JP3393475B2 JP3393475B2 (en) 2003-04-07

Family

ID=16545725

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20780192A Expired - Lifetime JP3393475B2 (en) 1992-08-04 1992-08-04 Programmable controller

Country Status (1)

Country Link
JP (1) JP3393475B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100382939B1 (en) * 2001-07-19 2003-05-09 엘지전자 주식회사 Communication control method and apparatus for slave cpu
US9116134B2 (en) 2009-12-17 2015-08-25 Nippon Steel & Sumitomo Metal Corporation Inspection apparatus for tubular product and inspection method therefor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100382939B1 (en) * 2001-07-19 2003-05-09 엘지전자 주식회사 Communication control method and apparatus for slave cpu
US9116134B2 (en) 2009-12-17 2015-08-25 Nippon Steel & Sumitomo Metal Corporation Inspection apparatus for tubular product and inspection method therefor

Also Published As

Publication number Publication date
JP3393475B2 (en) 2003-04-07

Similar Documents

Publication Publication Date Title
US5765025A (en) Digital signal processor with on board program having arithmetic instructions and direct memory access instructions for controlling direct memory access thereof
JP2526688B2 (en) Programmable controller and partial execution method of sequence program
JP3393475B2 (en) Programmable controller
JPS63142431A (en) Pipeline control system
JPH05189232A (en) Automated apparatus and operating method thereof
JPH1165623A (en) Programmable controller
JP3015793B1 (en) Programmable controller
JP2880330B2 (en) Programming device for programmable controller
JP2000029719A (en) Interrupt controller
JPS60241104A (en) Arithmetic method of digital controller
JP3139310B2 (en) Digital signal processor
JPH05334098A (en) Method and device for interruption control
JP2844624B2 (en) Data processing device
JPS61279932A (en) Automatic collective translation system for source program
JPS616704A (en) Programmable controller
JPH07104797B2 (en) System diagnostic method
JPH0115094B2 (en)
JPS6120139A (en) Interruption control system
JPH07105158A (en) Program loader
JPS62190544A (en) Higher link unit for programmable controller
JPH0399338A (en) Microprocessor
JPH08115214A (en) Digital signal processor
JPH02310662A (en) Message display suppressing system
JPH047742A (en) Controlling system for application program
JPS6258339A (en) Instruction fetching controller

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20021225

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090131

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090131

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100131

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100131

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110131

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110131

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120131

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130131

Year of fee payment: 10

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130131

Year of fee payment: 10