JP3705263B2 - Sequencer - Google Patents
Sequencer Download PDFInfo
- Publication number
- JP3705263B2 JP3705263B2 JP2002333131A JP2002333131A JP3705263B2 JP 3705263 B2 JP3705263 B2 JP 3705263B2 JP 2002333131 A JP2002333131 A JP 2002333131A JP 2002333131 A JP2002333131 A JP 2002333131A JP 3705263 B2 JP3705263 B2 JP 3705263B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- instruction
- data memory
- memory
- lock
- 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 - Fee Related
Links
Images
Landscapes
- Programmable Controllers (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、ラダーシーケンスを演算するシーケンサに係り、特に、ラダープログラムのデバッグ機能を実現するための接点ロック処理に関する。
【0002】
【従来の技術】
図2はラダー回路例を示したもので、複数のメモリに対応する接点からなる。また、この回路は図3のプログラムメモリに展開され、更に図4のようなデータメモリに展開される。図4中、各数字はメモリロケーションのアドレスを示している。
【0003】
これらプログラムメモリ及びデータメモリは、図5にシーケンサをハードウェア構成で示すブロックのメモリ1、2として用意され、ラダー回路を構築するためのプログラムとデータが格納される。
【0004】
図5に示すブロック図において、命令フェッチ部3は、プログラムカウンタ3Aの値をアドレスとしてプログラムメモリ1から1つの命令をデータとしてインストラクションレジスタ3Bに読出す。
【0005】
解析部4は、インストラクションレジスタ3Bのオペコード部をデコーダ4Aで解読し、さらにはパイプラインレジスタ4Bに順次格納する。
【0006】
オペランドデータアクセス部5は、インストラクションレジスタ3Bのオペランド部を取り込み、オペランドに対応するアドレスをデータポインタ5Aに得、これをデータメモリ2のアドレスとする。このアドレス指定によりデータメモリ2から読出したデータをデータバッファ5Bからデータレジスタ6に転送する。また、データバッファ5Cのデータをデータメモリ2に書込む。
【0007】
演算部7は、パイプラインレジスタ4Bからの命令コードの解析結果にしたがってデータレジスタ6のデータを使って演算を実行する。
【0008】
パイプラインレジスタ4Bは、演算速度を向上するため、命令の実行にパイプライン処理を行うものであり、下記表にはパイプライン処理の例を示す。
【0009】
【表1】
【0010】
パイプライン処理は、命令フェッチ部3と命令解析部4とオペランドデータアクセス部5と演算部7を効率良く使用するのに有効である。上記の表において、n+2のステップに着目すると、命令Cのフェッチと命令Bの解析とオペランドデータリード及び命令Aの演算を並列に処理していることになる。
【0011】
すなわち、マイクロコード方式又はハードウェア処理方式の何れにも、現在の実行(演算)より先の命令の実行のために、予め前処理を行っておく。
【0012】
このとき、パイプラインレジスタ4Bは、前記の表1に示すように、ステップに応じて演算部7には例えば命令Aによる演算を指令し、同時にプログラムカウンタ3Aには命令Cのフェッチのためインクリメントを指令し、データポインタ5Aには命令Bのポインタ指定を行う。
【0013】
以上のようなシーケンサにおいて、ラダーシーケンスを作成してシーケンサに入力し、所定の演算を行うとき、そのデバッグ機能を実現するために、シーケンサのデータメモリ2のデータに対するロック、又はプログラムメモリ1の命令に対するロックを行う機能が用意されている場合が多い。このデータに対するロックは、接点(メモリデータ)や命令を強制的にONロックしたり、OFFロックする。
【0014】
いま、データメモリの接点に対するロックとして、図2のラダー回路で「M40」の接点をONロックする場合について考えると、「M40」のメモリ内容は例えば「0」から「1」に書き換えられる。したがって、「M40」の接点を使用している命令もその演算内容を変える必要がある。例えば図3のプログラムメモリでは、ST M40,AND M40,LD M40の三つの命令のオペランドデータとして「1」を使用する必要がある。
【0015】
従来は、この機能を実現するため、図3に示すようなプログラムメモリ1の中からM40をオペランドにしている命令を全て検索し、別コードに変えるなどして演算内容を変更していたため、大容量の命令コードを操作するには処理に相当の時間を要し、演算スキャンを乱す等の弊害を生じていた。
【0016】
この課題を解消する方式として、データメモリ1と同一メモリ容量を持ち、且つメモリロケーションも1対1に対応させたロック指定データメモリ8を別途に設け、接点ロックを行うときにはロック指定データメモリの該等メモリロケーションのデータを書き換え、ラダープログラムを実行するときにロック指定データメモリを参照することでロック指定の有無及びロック指定の種類を識別する方式としたものがある。
【0017】
この方式では、接点ロック又はその解除を行うときにはロック指定データメモリの該等メモリロケーションのデータをデバッグ機能が持つエディタ等で書き換えることで済み、従来のように命令を検索してそのコードを操作する必要がなくなり、接点ロックと解除の処理が極めて簡略化される。
【0018】
なお、演算結果をデータメモリ2に書込む命令のときは、ロック指定データメモリの当該メモリロケーションを参照することでロック指定があるか否かのチェックを行い、演算結果をデータメモリ2に書込む際にその可否を識別する。
【0019】
【発明が解決しようとする課題】
ロック指定データメモリを設けた従来方式において、演算部7が演算結果をデータメモリ2に書込む命令での処理は、ロック指定データメモリを参照してロック指定のチェックを行い、演算結果をデータメモリに書込むか否かを決定するため、演算速度が落ちる。
【0020】
例えば、下記表のパイプライン処理において、書込み命令Cは、処理内容が多いため、複数ステップに渡り実行される。この命令Cにおいて、ステップbでは命令Cのオペランド部をオペランドデータアクセス部5にリードし(読出し)、ステップcではロック指定データc’をリードし、ステップc+1ではロック指定有無の解析と命令Cのオペランド部の再リードを行い、ステップc+2で演算結果をライトする(書込む)。この再リードが必要な理由は、一般にメモリ素子が複数ビット幅をもつものが多く、演算結果1ビットのみのライトができないため、リードモディファイライトすることによる。
【0021】
【表2】
【0022】
したがって、演算結果をデータメモリ2に書込む命令では、予めリードしているオペランドデータがそのままリードモディファイライトに利用できないため、ロック指定データをリードし、そのデータを解析し、ロック指定されていないことを確認した後、演算結果をライトするため、処理に要するステップ数が増加し、演算速度が落ちる。
【0023】
本発明の目的は、演算結果をデータメモリに書込む場合の処理ステップ数を減らして演算速度を向上させるシーケンサを提供することにある。
【0024】
【課題を解決するための手段】
本発明は、データメモリの接点データを個別に強制的にオン又はオフにロック指定するロック指定データメモリを設け、ラダープログラムをパイプライン処理で実行するシーケンサにおいて、
前記パイプライン処理は、命令フェッチ後の解析結果が演算データをデータメモリに書込む命令か否かを判定し、データメモリに書込む命令のときは次のステップで前記データメモリからのデータ読出しに代えてロック指定データメモリからのロック指定データの読出しに切り替えることを特徴とする。
【0025】
【発明の実施の形態】
下記表3は、本実施形態になるパイプライン処理を示す。
【0026】
【表3】
【0027】
この表3及び前記表2にも示されるように、ステップaにおいて解析部4は命令Cの解析を実行している。この解析により、命令Cが演算結果をデータメモリ2に書込む命令であることが解析できる。
【0028】
そこで、本実施形態では、表3に示すように、解析部4がステップaで命令Cが書込み命令であると解析したときに、次のステップbでは命令Cのオペランドデータのリード(従来)に代えてロック指定データメモリ8のデータC’をリードするようオペランドデータアクセス部5に指示する。
【0029】
この指示により、解析部4ではデータバッファ5Bから読み出したロック指定データC’をデータレジスタ6から読み出すことができ、次のステップcでは解析部4ではロック指定データC’の解析を行い、これに並行してオペランドデータアクセス部5では命令Cのリードを行うことができる。
【0030】
そして、解析部4による解析結果がロック指定でなければ、次のステップc+1で演算結果をデータメモリ2にライトする。
【0031】
したがって、本実施形態では、演算結果をデータメモリ2に書込む命令であるときは、従来のパイプライン処理に比べて1ステップ減らした実行になり、演算速度を向上させることができる。
【0032】
図1は、本実施形態をハードウェア構成で実現するためのブロック図を示す。同図が図5と異なる部分は、命令フェッチ部3Bからオペランド部のオペランドデータアクセス部5のデータポインタ5Aに与えるデータの上位桁を加算器5Dを介して行い、この加算器5Dには解析部4の解析結果がデータメモリ2への書込み命令であるときにロック指定アドレス加算値をバイアス加算する点にある。
【0033】
解析部4は、命令がデータメモリ2への書込みであるときに、ロック指定アドレスの加算により、ロック指定データメモリ8から読み出したロック指定データをデータレジスタ6から取り込む。
【0034】
なお、加算器5Dに代えて、命令フェッチ後の解析でデータポインタ5Aの出力をロック指定データメモリ8に切り替える構成にもできる。
【0035】
【発明の効果】
以上のとおり、本発明によれば、ロック指定データメモリを設け、ラダープログラムをパイプライン処理で実行するにおいて、パイプライン処理は、命令フェッチ後の解析結果が演算データをデータメモリに書込む命令か否かを判定し、データメモリに書込む命令のときは次のステップで前記データメモリからのデータ読出しに代えてロック指定データメモリからのロック指定データの読出しに切り替えるようにしたため、パイプライン処理の実行ステップ数を減らして演算速度を向上させることができる。
【図面の簡単な説明】
【図1】本発明に係るシーケンサのブロック図。
【図2】シーケンサのラダー回路の例。
【図3】シーケンサのプログラムメモリの例。
【図4】シーケンサのデータメモリの例。
【図5】従来のシーケンサのブロック図。
【符号の説明】
1…プログラムメモリ
2…データメモリ
3…命令フェッチ部
4…解析部
5…オペランドデータアクセス部
5D…加算器
6…データレジスタ
7…演算部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a sequencer that calculates a ladder sequence, and more particularly, to a contact lock process for realizing a debugging function of a ladder program.
[0002]
[Prior art]
FIG. 2 shows an example of a ladder circuit, which includes contacts corresponding to a plurality of memories. This circuit is expanded in the program memory of FIG. 3, and further expanded in the data memory as shown in FIG. In FIG. 4, each number indicates an address of a memory location.
[0003]
These program memory and data memory are prepared as
[0004]
In the block diagram shown in FIG. 5, the
[0005]
The
[0006]
The operand
[0007]
The
[0008]
The
[0009]
[Table 1]
[0010]
Pipeline processing is effective in efficiently using the
[0011]
That is, in either the microcode method or the hardware processing method, preprocessing is performed in advance for execution of an instruction prior to the current execution (calculation).
[0012]
At this time, as shown in Table 1, the
[0013]
In the sequencer as described above, when a ladder sequence is created and input to the sequencer and a predetermined calculation is performed, the lock to the data in the
[0014]
Assuming that the contact of “M40” is ON-locked by the ladder circuit of FIG. 2 as the lock for the contact of the data memory, the memory content of “M40” is rewritten from “0” to “1”, for example. Therefore, it is necessary to change the calculation contents of the instruction using the contact of “M40”. For example, in the program memory of FIG. 3, it is necessary to use “1” as operand data of three instructions ST M40, AND M40, and LD M40.
[0015]
Conventionally, in order to realize this function, all the instructions having M40 as an operand are searched from the program memory 1 as shown in FIG. 3 and changed to another code. Manipulating the capacity instruction code requires a considerable amount of processing time, causing problems such as disturbing the operation scan.
[0016]
As a method for solving this problem, a lock
[0017]
In this method, when the contact is locked or released, the data in the memory location of the lock designation data memory needs to be rewritten by an editor having a debugging function, and the code is searched and operated as in the conventional method. This eliminates the need for the contact locking and releasing process.
[0018]
In the case of an instruction for writing an operation result to the
[0019]
[Problems to be solved by the invention]
In the conventional method provided with a lock designation data memory, the processing by the
[0020]
For example, in the pipeline processing shown in the table below, the write instruction C is executed over a plurality of steps because of the large amount of processing. In this instruction C, in step b, the operand part of the instruction C is read (read) to the operand
[0021]
[Table 2]
[0022]
Therefore, in the instruction for writing the operation result to the
[0023]
An object of the present invention is to provide a sequencer that improves the calculation speed by reducing the number of processing steps when writing the calculation result in a data memory.
[0024]
[Means for Solving the Problems]
The present invention provides a lock designation data memory for forcibly locking on or off the contact data of the data memory individually, and in a sequencer that executes a ladder program by pipeline processing.
The pipeline processing determines whether or not the analysis result after the instruction fetch is an instruction to write operation data to the data memory. When the instruction is to write to the data memory, the next step is to read the data from the data memory. Instead, it is switched to reading lock designation data from the lock designation data memory.
[0025]
DETAILED DESCRIPTION OF THE INVENTION
Table 3 below shows the pipeline processing according to the present embodiment.
[0026]
[Table 3]
[0027]
As shown in Table 3 and Table 2, the
[0028]
Therefore, in this embodiment, as shown in Table 3, when the
[0029]
By this instruction, the
[0030]
If the analysis result by the
[0031]
Therefore, in the present embodiment, when the instruction is to write the operation result to the
[0032]
FIG. 1 is a block diagram for realizing the present embodiment with a hardware configuration. 5 differs from FIG. 5 in that the upper digit of data given from the instruction fetch
[0033]
The
[0034]
Instead of the
[0035]
【The invention's effect】
As described above, according to the present invention, when the lock designation data memory is provided and the ladder program is executed by pipeline processing, the pipeline processing is the analysis result after the instruction fetch is an instruction for writing operation data to the data memory. In the case of an instruction to be written to the data memory, in the next step, instead of reading the data from the data memory, it is switched to reading the lock designated data from the lock designated data memory. The number of execution steps can be reduced and the calculation speed can be improved.
[Brief description of the drawings]
FIG. 1 is a block diagram of a sequencer according to the present invention.
FIG. 2 shows an example of a ladder circuit of a sequencer.
FIG. 3 shows an example of a program memory of a sequencer.
FIG. 4 shows an example of a data memory of a sequencer.
FIG. 5 is a block diagram of a conventional sequencer.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ...
Claims (1)
前記パイプライン処理は、命令フェッチ後の解析結果が演算データをデータメモリに書込む命令か否かを判定し、データメモリに書込む命令のときは次のステップで前記データメモリからのデータ読出しに代えてロック指定データメモリからのロック指定データの読出しに切り替えることを特徴とするシーケンサ。In a sequencer that provides lock designation data memory that forcibly locks the contact data of the data memory individually on or off, and executes the ladder program by pipeline processing,
The pipeline processing determines whether or not the analysis result after the instruction fetch is an instruction to write operation data to the data memory. When the instruction is to write to the data memory, the next step is to read the data from the data memory. Instead, the sequencer is switched to read lock designation data from the lock designation data memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002333131A JP3705263B2 (en) | 2002-11-18 | 2002-11-18 | Sequencer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002333131A JP3705263B2 (en) | 2002-11-18 | 2002-11-18 | Sequencer |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP27536495A Division JP3428253B2 (en) | 1995-10-24 | 1995-10-24 | Sequencer |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003177805A JP2003177805A (en) | 2003-06-27 |
JP3705263B2 true JP3705263B2 (en) | 2005-10-12 |
Family
ID=19197731
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002333131A Expired - Fee Related JP3705263B2 (en) | 2002-11-18 | 2002-11-18 | Sequencer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3705263B2 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5933504A (en) * | 1982-08-20 | 1984-02-23 | Toshiba Corp | Sequence controller |
JPS63159905A (en) * | 1986-12-24 | 1988-07-02 | Hitachi Ltd | Forcible on/off system for input/output of programmable controller |
JPH0527811A (en) * | 1991-07-24 | 1993-02-05 | Meidensha Corp | Sequencer contact lock system |
JPH06242819A (en) * | 1993-02-18 | 1994-09-02 | Fanuc Ltd | Signal state control system for programmable controller |
JPH0922307A (en) * | 1995-07-07 | 1997-01-21 | Meidensha Corp | Sequencer |
-
2002
- 2002-11-18 JP JP2002333131A patent/JP3705263B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2003177805A (en) | 2003-06-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7546442B1 (en) | Fixed length memory to memory arithmetic and architecture for direct memory access using fixed length instructions | |
US20050028148A1 (en) | Method for dynamic recompilation of a program | |
US20140223146A1 (en) | Blank Bit and Processor Instructions Employing the Blank Bit | |
JP4141112B2 (en) | Processor and processor system | |
US8484446B2 (en) | Microprocessor saving data stored in register and register saving method | |
JP3705263B2 (en) | Sequencer | |
US20070011440A1 (en) | Processor and processing method | |
JP2553200B2 (en) | Information processing device | |
KR100516214B1 (en) | A digital signal processor for parallel processing of instructions and its process method | |
JPH0954694A (en) | Pipeline processor and its processing method | |
JP3428253B2 (en) | Sequencer | |
JPH0922307A (en) | Sequencer | |
JP3012618B1 (en) | Debugging method of inspected program and its debugging method | |
JPH05274341A (en) | Vector instruction processor | |
JPH06149569A (en) | Register number changing device | |
JPH0535499A (en) | Data processing device and data processing method | |
JP5263497B2 (en) | Signal processor and semiconductor device | |
JP2001092672A (en) | Instruction code rewriting method, instruction code rewriting device, and information recording medium | |
JP3523407B2 (en) | Information processing equipment | |
JPH06301537A (en) | Instruction fetch circuit | |
JPS63276126A (en) | Instruction decoding circuit | |
JPH05250156A (en) | Risc processor | |
JPH06161778A (en) | Multiflow instruction control method and instruction processing device | |
JPH03164935A (en) | Arithmetic processor | |
JPH0553804A (en) | Parallel processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050624 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20050705 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050718 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080805 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090805 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100805 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100805 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110805 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120805 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130805 Year of fee payment: 8 |
|
LAPS | Cancellation because of no payment of annual fees |