JP2015014934A - Memory controller and memory control method - Google Patents

Memory controller and memory control method Download PDF

Info

Publication number
JP2015014934A
JP2015014934A JP2013141563A JP2013141563A JP2015014934A JP 2015014934 A JP2015014934 A JP 2015014934A JP 2013141563 A JP2013141563 A JP 2013141563A JP 2013141563 A JP2013141563 A JP 2013141563A JP 2015014934 A JP2015014934 A JP 2015014934A
Authority
JP
Japan
Prior art keywords
bit
unit
memory
data
memory control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013141563A
Other languages
Japanese (ja)
Inventor
佐々木 通
Toru Sasaki
通 佐々木
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2013141563A priority Critical patent/JP2015014934A/en
Publication of JP2015014934A publication Critical patent/JP2015014934A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a memory controller capable of executing sequence control at high speed.SOLUTION: A bit operation table storage unit 10 holds the result of bitwise logical operation as a table in advance. A lookup table unit 19 holds one table of the bit operation table storage unit 10. A data latch unit 17 latches bit data extracted by a bit extraction/insertion unit 16, and a bit selector unit 18 selects one bit from the table held in the lookup table unit 19 in accordance with output of the bit data latched by the data latch unit 17. A read/write control unit 20 exerts control for writing back, to a device memory 6, word data in which one bit among word data read out from the device memory 6 after a write to the device memory 6 is replaced with the one bit outputted by the bit selector unit 18.

Description

この発明は、シーケンス処理のビット演算を行うプログラマブルコントローラにおけるデバイスメモリの値を制御するメモリ制御装置及びメモリ制御方法に関するものである。   The present invention relates to a memory control device and a memory control method for controlling a value of a device memory in a programmable controller that performs a bit operation of sequence processing.

従来のプログラマブルコントローラにおける論理演算処理を行う装置では、レジスタ、命令デコーダ実行部、命令処理実行部、メモリリード・ライト実行部を備え、シーケンス処理を実行する(例えば、特許文献1参照)。   An apparatus for performing logical operation processing in a conventional programmable controller includes a register, an instruction decoder execution unit, an instruction processing execution unit, and a memory read / write execution unit, and executes sequence processing (see, for example, Patent Document 1).

特開平2−75003号公報JP-A-2-75003

CPUを用いたプログラマブルコントローラでラダー図に従ったシーケンス制御を実行するにあたっては、シーケンス制御中の接点の論理演算およびコイル出力からなる回路ブロックを処理する際に1ビットの演算および1ビットのデータをワードデータから抽出、挿入する操作が必要となる。1ビットの接点データをデバイスメモリから取得する際に特定の1ビットを抽出する操作が必要となり、接点同士の論理演算においてビット演算が必要となる。また、演算した1ビットの結果をコイルとして出力するためにデバイスメモリに書き込みを行うが、このときにワードデータに1ビットを挿入するリードモディファイライトの処理が必要となる。   When executing a sequence control according to a ladder diagram with a programmable controller using a CPU, a 1-bit operation and 1-bit data are processed when processing a circuit block consisting of a logical operation of a contact and a coil output during the sequence control. Extraction and insertion from word data is required. When acquiring 1-bit contact data from the device memory, an operation of extracting a specific 1 bit is required, and a bit operation is required in a logical operation between the contacts. In addition, in order to output the calculated 1-bit result as a coil, writing to the device memory is performed. At this time, a read-modify-write process of inserting 1 bit into the word data is required.

このようなビット処理を行うための命令を備えていないCPUを用いてシーケンス制御を高速に実行することを考えた場合、CPUに対してビット演算処理用の命令回路を付加するか、CPUの既存の命令を複数組み合わせてビット処理を実行することが必要になる。既存のCPUに対して新たなビット演算処理用の命令回路を付加するといった手段の場合は、回路の大規模な修正が必要となるという問題があった。また、既存の命令を複数組み合わせてビット処理を実行するようにした場合は、ビット演算処理のために実行する命令サイクルが余分に必要となり、その結果、処理時間が長くなって、シーケンス制御を高速に実行することが困難であるという課題があった。   When thinking about performing sequence control at high speed using a CPU that does not have an instruction for performing such bit processing, an instruction circuit for bit operation processing is added to the CPU, or the existing CPU It is necessary to execute bit processing by combining a plurality of instructions. In the case of means for adding a new instruction circuit for bit arithmetic processing to an existing CPU, there has been a problem that a large-scale correction of the circuit is required. In addition, when bit processing is executed by combining multiple existing instructions, an extra instruction cycle is required for bit operation processing, resulting in longer processing time and faster sequence control. There was a problem that it was difficult to carry out.

この発明は上記のような課題を解決するためになされたもので、シーケンス制御を高速に実行することのできるメモリ制御装置及びメモリ制御方法を得ることを目的とする。   The present invention has been made to solve the above problems, and an object thereof is to obtain a memory control device and a memory control method capable of executing sequence control at high speed.

この発明に係るメモリ制御装置は、接点の論理演算からなるラダーを処理するプログラマブルコントローラにおけるデバイスメモリの値を制御するメモリ制御装置において、ビット単位の論理演算の結果を予めテーブルとして保持するビット演算テーブル格納部と、ビット演算テーブル格納部から1つのテーブルを取得して保持するルックアップテーブル部と、デバイスメモリから読み出されたワードデータからビット選択入力に基づいてビットデータを抽出するビット抽出挿入部と、ビット抽出挿入部が抽出したビットデータをラッチするデータラッチ部と、データラッチ部がラッチしたビットデータの出力に応じて、ルックアップテーブル部に保持したテーブルから1つのビットを選択するビットセレクタ部と、デバイスメモリへの書きこみに対してデバイスメモリからワードデータを読み出し、このワードデータのうち1ビットをビットセレクタ部が出力する1ビットと入れ替えたワードデータを再度デバイスメモリへ書き戻す制御を行うリードライト制御部とを備えたものである。   A memory control device according to the present invention includes a bit operation table that holds a result of a logical operation in units of bits as a table in a memory control device that controls a value of a device memory in a programmable controller that processes a ladder including logical operations of contacts. A storage unit, a lookup table unit that acquires and holds one table from the bit operation table storage unit, and a bit extraction insertion unit that extracts bit data from word data read from the device memory based on a bit selection input A data latch unit that latches the bit data extracted by the bit extraction and insertion unit, and a bit selector that selects one bit from the table held in the lookup table unit according to the output of the bit data latched by the data latch unit And writing to device memory A read / write control unit that reads out word data from the device memory and rewrites the word data in which one bit is replaced with one bit output from the bit selector unit to the device memory. It is a thing.

この発明のメモリ制御装置は、ビット単位の論理演算の結果を予めテーブルとして保持し、接点データを1ビットずつ読み出すことによりこのデータをアドレスとしてテーブルから正しい演算結果を選択し、求めた1ビットの演算結果をデバイスメモリに書き込むようにしたので、シーケンス制御の接点の論理演算のブロックに対して、ビット演算を処理実行用の複数命令を実行せずにビット演算処理が可能になり、高速なプログラマブルコントローラが実現可能となる。   The memory control device according to the present invention holds the result of bitwise logical operation as a table in advance, reads the contact data bit by bit, selects the correct operation result from the table using this data as an address, and obtains the obtained 1-bit Since the operation result is written to the device memory, bit operation processing can be performed on the logical operation block at the contact point of sequence control without executing multiple instructions for execution of bit operation. A controller can be realized.

本発明の実施の形態1によるメモリ制御装置の構成図である。It is a block diagram of the memory control apparatus by Embodiment 1 of this invention. ラダー図のa接点、b接点、コイルを示す説明図である。It is explanatory drawing which shows the a contact of a ladder diagram, b contact, and a coil. シーケンス制御のラダー図の一例を示す説明図である。It is explanatory drawing which shows an example of the ladder diagram of sequence control. コイルを3つ有するブロックの例を示す説明図である。It is explanatory drawing which shows the example of the block which has three coils. 接点が7つあるブロックの例を示す説明図である。It is explanatory drawing which shows the example of a block with seven contacts. 図5に示すブロックを分割した場合のブロックを示す説明図である。It is explanatory drawing which shows the block at the time of dividing | segmenting the block shown in FIG. 本発明の実施の形態4によるメモリ制御装置の構成図である。It is a block diagram of the memory control apparatus by Embodiment 4 of this invention. 本発明の実施の形態5によるメモリ制御装置の演算部を示す構成図である。It is a block diagram which shows the calculating part of the memory control apparatus by Embodiment 5 of this invention. 本発明の実施の形態5によるメモリ制御装置の構成図である。It is a block diagram of the memory control apparatus by Embodiment 5 of this invention. 本発明の実施の形態6によるメモリ制御装置の構成図である。It is a block diagram of the memory control apparatus by Embodiment 6 of this invention. 本発明の実施の形態6によるメモリ制御装置の命令格納部に記録される命令列の例を示す説明図である。It is explanatory drawing which shows the example of the command sequence recorded on the command storage part of the memory control apparatus by Embodiment 6 of this invention.

実施の形態1.
図1は、この発明の実施の形態1によるメモリ制御装置を示す構成図である。
図1に示すメモリ制御装置は、CPU(マイクロプロセッサ)1、CPUアドレス線2、CPUデータ線3、ライトイネーブル線4、リードイネーブル線5、デバイスメモリ6、デバイスメモリデータ線7、デバイスメモリリードイネーブル線8、デバイスメモリライトイネーブル線9、ビット演算テーブル格納部10、メモリアドレス線11、メモリデータ線12、メモリリードイネーブル線13、ビット選択線14、演算結果ビット線15、ビット抽出挿入部16、データラッチ部17、ビットセレクタ部18、ルックアップテーブル部19、リードライト制御部20、テーブルアドレス生成部21を備えている。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a memory control device according to Embodiment 1 of the present invention.
1 includes a CPU (microprocessor) 1, a CPU address line 2, a CPU data line 3, a write enable line 4, a read enable line 5, a device memory 6, a device memory data line 7, and a device memory read enable. Line 8, device memory write enable line 9, bit operation table storage unit 10, memory address line 11, memory data line 12, memory read enable line 13, bit selection line 14, operation result bit line 15, bit extraction insertion unit 16, A data latch unit 17, a bit selector unit 18, a lookup table unit 19, a read / write control unit 20, and a table address generation unit 21 are provided.

CPU1は、ラダー図の論理演算を行うと共に、これ以外の応用命令や算術演算命令等による演算処理を行うプロセッサであり、デバイスメモリ6とはCPUアドレス線2で接続され、リードライト制御部20に対しては、ライトイネーブル線4とリードイネーブル線5とが接続されている。CPUアドレス線2の信号線のうち、デバイスメモリ6とは、デバイスメモリ6の容量分の信号数が接続されている。また、CPUアドレス線2の信号線のうちいくつかがビット選択線14として取り出されてビット抽出挿入部16に接続されている。デバイスメモリ6のワードサイズが16ビットの場合に必要なビット選択線14は4本、32ビットの場合は5本となる。デバイスメモリ6のデバイスメモリデータ線7はビット抽出挿入部16に接続されている。またCPU1のリードイネーブル線5はリードライト制御部20とデータラッチ部17に接続されている。   The CPU 1 is a processor that performs logic processing of a ladder diagram and performs arithmetic processing using other application instructions, arithmetic operation instructions, and the like. The CPU 1 is connected to the device memory 6 through a CPU address line 2 and is connected to the read / write control unit 20. On the other hand, a write enable line 4 and a read enable line 5 are connected. Of the signal lines of the CPU address line 2, the device memory 6 is connected with the number of signals corresponding to the capacity of the device memory 6. Some of the signal lines of the CPU address line 2 are taken out as bit selection lines 14 and connected to the bit extraction / insertion unit 16. When the word size of the device memory 6 is 16 bits, four bit selection lines 14 are necessary, and when the word size is 32 bits, the number is five. The device memory data line 7 of the device memory 6 is connected to the bit extraction / insertion unit 16. The read enable line 5 of the CPU 1 is connected to the read / write control unit 20 and the data latch unit 17.

CPU1とテーブルアドレス生成部21とはCPUデータ線3およびライトイネーブル線4で接続されている。デバイスメモリ6は、ラダー図の接点、コイルのオンかオフかを1、0で示す情報を記憶するメモリであり、ビット抽出挿入部16とはデバイスメモリデータ線7で接続され、また、リードライト制御部20とは、デバイスメモリリードイネーブル線8およびデバイスメモリライトイネーブル線9で接続されている。ビット演算テーブル格納部10は、ラダー図におけるビット単位の論理演算の結果を予めテーブルとして保持するテーブル格納部であり、テーブルアドレス生成部21からはメモリアドレス線11を介してアドレスが与えられ、かつ、メモリリードイネーブル線13からリードの有効/無効が指定される。さらに、読み出されたテーブルはメモリデータ線12を介してルックアップテーブル部19に送出されるよう構成されている。演算結果ビット線15はビットセレクタ部18からビット抽出挿入部16に対して演算結果を送出するための信号線である。   The CPU 1 and the table address generator 21 are connected by a CPU data line 3 and a write enable line 4. The device memory 6 is a memory that stores information indicated by 1 and 0 indicating whether the coil is on or off in the ladder diagram. The device memory 6 is connected to the bit extraction / insertion unit 16 by a device memory data line 7 and is also read / write. The controller 20 is connected to the device memory read enable line 8 and the device memory write enable line 9. The bit operation table storage unit 10 is a table storage unit that preliminarily holds a result of logical operation in units of bits in the ladder diagram as a table, and an address is given from the table address generation unit 21 via the memory address line 11, and The read enable / disable is designated from the memory read enable line 13. Further, the read table is configured to be sent to the lookup table unit 19 via the memory data line 12. The operation result bit line 15 is a signal line for sending the operation result from the bit selector unit 18 to the bit extraction / insertion unit 16.

ビット抽出挿入部16は、デバイスメモリ6から読み出されたワードデータからビット選択線14のビット選択入力に基づいてビットデータを抽出するとともに、演算結果ビット線15のビットデータを入れ替えたワードデータをデバイスメモリ6に書き戻す回路である。データラッチ部17は、リードイネーブル線5の有効/無効に基づいて、ビット抽出挿入部16が出力するビットデータをラッチする回路である。ビットセレクタ部18は、データラッチ部17にラッチされた接点情報を元にルックアップテーブル部19のテーブルから演算結果の1ビットを選択して演算結果ビット線15に出力する回路である。ルックアップテーブル部19は、ビット演算テーブル格納部10のテーブルを格納する回路である。リードライト制御部20は、デバイスメモリ6への書きこみに対してデバイスメモリ6からワードデータを読み出し、このワードデータのうち1ビットをビットセレクタ部18が出力する1ビットと入れ替えたワードデータを再度デバイスメモリ6へ書き戻す制御を行うための制御部である。テーブルアドレス生成部21は、CPUデータ線3からのアドレスに基づいてビット演算テーブル格納部10におけるテーブルを選択するためのアドレスをメモリアドレス線11を介してビット演算テーブル格納部10に与えるとともに、メモリリードイネーブル線13を有効にしてビット演算テーブル格納部10からテーブルを読み出すための回路である。   The bit extraction / insertion unit 16 extracts the bit data from the word data read from the device memory 6 based on the bit selection input of the bit selection line 14, and the word data obtained by replacing the bit data of the operation result bit line 15. This is a circuit for writing back to the device memory 6. The data latch unit 17 is a circuit that latches the bit data output from the bit extraction / insertion unit 16 based on the validity / invalidity of the read enable line 5. The bit selector unit 18 is a circuit that selects one bit of the calculation result from the table of the lookup table unit 19 based on the contact information latched by the data latch unit 17 and outputs it to the calculation result bit line 15. The lookup table unit 19 is a circuit that stores the table of the bit operation table storage unit 10. The read / write control unit 20 reads word data from the device memory 6 in response to writing to the device memory 6, and again replaces the word data in which 1 bit is replaced with 1 bit output from the bit selector unit 18. It is a control unit for performing control to write back to the device memory 6. The table address generation unit 21 provides an address for selecting a table in the bit operation table storage unit 10 based on the address from the CPU data line 3 to the bit operation table storage unit 10 via the memory address line 11, and This is a circuit for enabling the read enable line 13 and reading the table from the bit operation table storage unit 10.

本発明はラダー図で示されるシーケンス制御を実行する装置である。図2に示すa接点とb接点の個数が合計5個でこれらを並列接続、直列接続で接続し、1つのコイルに接続された構成をとる組み合わせを1つのブロックとする。このような論理演算からなるブロックを含むシーケンス制御のラダー図の例を図3に示す。本装置はこのブロックの演算を実行する際に高速化の効果が得られる。   The present invention is an apparatus for executing the sequence control shown in the ladder diagram. A total of five a-contacts and b-contacts shown in FIG. 2 are connected in parallel or in series, and a combination of the configurations connected to one coil is defined as one block. FIG. 3 shows an example of a ladder diagram of sequence control including blocks composed of such logical operations. This apparatus can achieve the effect of speeding up when executing this block operation.

本装置のビット演算テーブル格納部10には、シーケンス制御を開始する前に、図2のシーケンス制御の演算結果を示すテーブルが格納される。例えば、図3に示されるブロックmでは接点は5つあるためこれらの論理演算結果のパターンは25(32)通りである。0か1かの論理値を取る接点の値Pm[0]−Pm[4]が確定すれば32通りのうち1つの演算結果を確定できる。テーブルは演算結果の32通りを32個の1、0の値で示して並べたものを1つとする。ビット演算テーブル格納部10は、シーケンス制御のブロックごとのテーブルを保持する。 The bit calculation table storage unit 10 of the present apparatus stores a table showing the calculation result of the sequence control of FIG. 2 before starting the sequence control. For example, since there are five contacts in the block m shown in FIG. 3, there are 2 5 (32) patterns of these logical operation results. If the contact value P m [0] −P m [4] that takes a logical value of 0 or 1 is determined, one of the 32 calculation results can be determined. The table is one in which 32 kinds of calculation results are arranged by 32 1 and 0 values. The bit operation table storage unit 10 holds a table for each block of sequence control.

次に、動作の一例として図3に示されるブロックmを処理する手順について説明する。
最初にこのブロックmの演算結果に該当するテーブルをビット演算テーブル格納部10より読み出すためにCPU1はライトイネーブル線4を有効にして、CPUデータ線3からビット演算テーブル格納部10のメモリに対してアドレスを出力する。ライトイネーブル線4とCPUデータ線3はテーブルアドレス生成部21に接続されており、テーブルアドレス生成部21は、ビット演算テーブル格納部10に対して、メモリアドレス線11からテーブルのアドレスを出力し、メモリリードイネーブル線13を有効にすることで演算を実行するラダーブロックのテーブルを読み出すことができる。読み出されたラダーブロックのテーブルはメモリデータ線12を介してルックアップテーブル部19に保持される。テーブルをビット演算テーブル格納部10より読み出してルックアップテーブル部19に格納する処理はCPU1のストア命令の1命令サイクルで実行可能となっている。
Next, a procedure for processing the block m shown in FIG. 3 will be described as an example of the operation.
First, in order to read the table corresponding to the operation result of block m from the bit operation table storage unit 10, the CPU 1 enables the write enable line 4, and the CPU data line 3 accesses the memory of the bit operation table storage unit 10. Output address. The write enable line 4 and the CPU data line 3 are connected to a table address generation unit 21, and the table address generation unit 21 outputs a table address from the memory address line 11 to the bit operation table storage unit 10. By enabling the memory read enable line 13, it is possible to read the ladder block table for executing the calculation. The read ladder block table is held in the lookup table unit 19 via the memory data line 12. The process of reading the table from the bit operation table storage unit 10 and storing it in the lookup table unit 19 can be executed in one instruction cycle of the store instruction of the CPU 1.

ブロックの処理を行うためにCPU1はリードイネーブル線5を有効にして、CPUアドレス線2からブロック内の接点を含むワードを読み出すためのアドレスを出力する。リードライト制御部20はリードイネーブル線5が有効でライトイネーブル線4が無効の場合にデバイスメモリリードイネーブル線8を有効にする。ビット選択線14にはそのワードのどの位置に接点の1ビットが含まれているかを示す信号を出力する。1ワードが16ビットの場合、ビット選択線14の4本の信号で任意の1ビットを選択できる。デバイスメモリ6は演算を実行する接点を含むワードデータをデバイスメモリデータ線7でビット抽出挿入部16へ出力する。ビット抽出挿入部16はビット選択線14の情報を元に演算を実行する接点の1ビットのみを抽出する。リードイネーブル線5が有効になっているため、データラッチ部17は抽出した1ビット情報をラッチする。以上の1つの接点のビットデータをデバイスメモリ6から読み出し、データラッチ部17にラッチするまでにCPU1はロード命令を1回実行する。図3に示すブロックmを演算するためにはPm[0]−Pm[4]の5つの接点の1ビット情報を読み出必要があり、CPU1はロード命令を5回実行することで5つの接点情報をデータラッチ部17に保持するができる。 In order to process the block, the CPU 1 enables the read enable line 5 and outputs an address for reading a word including a contact in the block from the CPU address line 2. The read / write control unit 20 enables the device memory read enable line 8 when the read enable line 5 is valid and the write enable line 4 is invalid. The bit selection line 14 outputs a signal indicating which position of the word contains one bit of the contact. When one word is 16 bits, any one bit can be selected by four signals on the bit selection line 14. The device memory 6 outputs word data including a contact for executing an operation to the bit extraction / insertion unit 16 through the device memory data line 7. The bit extraction / insertion unit 16 extracts only one bit of the contact for performing the operation based on the information of the bit selection line 14. Since the read enable line 5 is enabled, the data latch unit 17 latches the extracted 1-bit information. The CPU 1 executes the load instruction once until the bit data of one contact is read from the device memory 6 and latched in the data latch unit 17. In order to calculate the block m shown in FIG. 3, it is necessary to read 1-bit information of the five contacts of P m [0] -P m [4] , and the CPU 1 executes the load instruction 5 times. Two pieces of contact information can be held in the data latch unit 17.

データラッチ部17とルックアップテーブル部19はビットセレクタ部18に接続されており、ビットセレクタ部18はデータラッチ部17にラッチされた接点情報を元にルックアップテーブル部19のテーブルから演算結果の1ビットを選択して、演算結果ビット線15に出力する。   The data latch unit 17 and the lookup table unit 19 are connected to the bit selector unit 18, and the bit selector unit 18 calculates the calculation result from the table of the lookup table unit 19 based on the contact information latched by the data latch unit 17. One bit is selected and output to the operation result bit line 15.

CPU1はデバイスメモリ6の中のコイルのオン、オフ情報を示すQmを含むワードを指定するアドレスをCPUアドレス線2で指定し、ライトイネーブル線4を有効にする。ライトイネーブル線4が接続されたリードライト制御部20はリードイネーブル線5が無効、ライトイネーブル線4が有効になっている場合はデバイスメモリリードイネーブル線8を有効にし、CPUアドレス線2で指定されたワードをデバイスメモリ6から読み出し、デバイスメモリデータ線7に出力させる。次にデバイスメモリデータ線7からビット抽出挿入部16に入力されるワードのうちビット選択線14で指定するQmのビットを演算結果ビット線15の信号に置き換えたデータを生成する。そしてデバイスメモリリードイネーブル線8を無効にし、デバイスメモリライトイネーブル線9を有効に、そのデータをデバイスメモリデータ線7でデバイスメモリ6へ出力することでデバイスメモリ6のコイルQmの出力情報を演算によって変更した値を書き込む。この際、次のシーケンス制御のブロックを演算するためのテーブルをビット演算テーブル格納部10からリードするためにCPUデータ線3から、テーブルのメモリ位置を示すアドレス情報を出力する。これによってコイル情報Qmのリードモディファイライトとともに次のブロックのテーブルをルックアップテーブル部19にロードすることを同時に行うことができる。 The CPU 1 designates an address for designating a word including Q m indicating on / off information of the coil in the device memory 6 by the CPU address line 2 and enables the write enable line 4. The read / write control unit 20 connected to the write enable line 4 enables the device memory read enable line 8 when the read enable line 5 is invalid and the write enable line 4 is valid, and is designated by the CPU address line 2. The read word is read from the device memory 6 and output to the device memory data line 7. Next, data in which the bit of Q m designated by the bit selection line 14 in the word input from the device memory data line 7 to the bit extraction / insertion unit 16 is replaced with the signal of the operation result bit line 15 is generated. And Disable the device memory read enable line 8, to enable the device memory write enable lines 9, calculates the output information of the coil Q m of device memory 6 by outputting the data in the device memory data lines 7 to the device memory 6 Write the value changed by. At this time, address information indicating the memory position of the table is output from the CPU data line 3 in order to read the table for calculating the next sequence control block from the bit operation table storage unit 10. This can be done in that together with a read-modify-write coil information Q m to load the table of the next block in the look-up table unit 19 at the same time.

以上の処理を連続実行することによってシーケンス制御の中で5つの接点と1つのコイルを含むブロックの処理をCPU1のロード命令5回とストア命令1回で処理できるという効果が得られる。   By continuously executing the above processing, an effect is obtained that processing of a block including five contacts and one coil can be processed with five load instructions and one store instruction of the CPU 1 in sequence control.

以上説明したように、実施の形態1のメモリ制御装置によれば、接点の論理演算からなるラダーを処理するプログラマブルコントローラにおけるデバイスメモリの値を制御するメモリ制御装置において、ビット単位の前記論理演算の結果を予めテーブルとして保持するビット演算テーブル格納部と、ビット演算テーブル格納部から1つのテーブルを取得して保持するルックアップテーブル部と、デバイスメモリから読み出されたワードデータからビット選択入力に基づいてビットデータを抽出するビット抽出挿入部と、ビット抽出挿入部が抽出したビットデータをラッチするデータラッチ部と、データラッチ部がラッチしたビットデータの出力に応じて、ルックアップテーブル部に保持したテーブルから1つのビットを選択するビットセレクタ部と、デバイスメモリへの書きこみに対してデバイスメモリからワードデータを読み出し、このワードデータのうち1ビットをビットセレクタ部が出力する1ビットと入れ替えたワードデータを再度デバイスメモリへ書き戻す制御を行うリードライト制御部とを備えたので、シーケンス制御を構成する接点の論理演算からなるブロックに対して、テーブルをルックアップテーブル部に取り込み、デバイスメモリから接点の数だけビットデータを読み出して、コイルを含むワードをデバイスメモリに書き込むだけで処理できる。すでに演算された結果としてテーブルを持つため接点の入力データのみによって結果を選択するだけであるため、個別の論理演算用の回路は不要で簡単な回路で実現できる。   As described above, according to the memory control device of the first embodiment, in the memory control device that controls the value of the device memory in the programmable controller that processes the ladder including the logical operation of the contacts, the logical operation of the bit unit is performed. Based on a bit operation table storage unit that stores results in advance as a table, a lookup table unit that acquires and stores one table from the bit operation table storage unit, and a bit selection input from word data read from the device memory The bit extraction / insertion unit for extracting bit data, the data latch unit for latching the bit data extracted by the bit extraction / insertion unit, and the output of the bit data latched by the data latch unit are held in the lookup table unit. Bit select to select one bit from the table And word data read from the device memory in response to writing to the device memory, and the word data in which 1 bit is replaced with 1 bit output from the bit selector unit is written back to the device memory again. The read / write control unit is provided, so for the block consisting of the logical operation of the contacts constituting the sequence control, the table is taken into the lookup table unit, and the bit data is read from the device memory by the number of contacts, and the coil It can be processed simply by writing a word containing a to device memory. Since a table is already obtained as a result of calculation, the result is selected only by the input data of the contact point. Therefore, a separate circuit for logical operation is unnecessary and can be realized with a simple circuit.

また、実施の形態1のメモリ制御装置によれば、CPUが実行する命令により接点の論理演算からなるラダーを処理するとともに、ビット選択入力はCPUより与えられるようにしたので、ビット演算処理を持たないCPUを用いた場合であっても、回路の大規模な修正等も必要なく、かつ、シーケンシャル制御を高速に実行することができる。   Further, according to the memory control device of the first embodiment, the ladder composed of the logical operation of the contact is processed by the instruction executed by the CPU, and the bit selection input is given from the CPU. Even when a CPU is not used, large-scale correction of the circuit is not necessary, and sequential control can be performed at high speed.

実施の形態2.
実施の形態1ではコイルが1つのブロックに関しての実行であったが、コイルは複数あってもよい。図4に示すブロックを実行する際は3つのコイルに出力する必要があるが、実施の形態1の接点のデータラッチによって演算結果ビット線15に演算結果が出力された後、3回、対象となるコイルを含むデバイスメモリの中のワードに対する書きこみを実行すればよい。即ち、コイルが複数あるブロックに対しては、ビット抽出挿入部16からの出力を、出力すべきコイルの個数だけデバイスメモリ6に連続して書き込む。
Embodiment 2. FIG.
In the first embodiment, the coil is executed with respect to one block, but there may be a plurality of coils. When executing the block shown in FIG. 4, it is necessary to output to the three coils, but after the operation result is output to the operation result bit line 15 by the data latch of the contact in the first embodiment, the target is three times. The word in the device memory including the coil may be written. That is, for a block having a plurality of coils, the output from the bit extraction / insertion unit 16 is continuously written in the device memory 6 by the number of coils to be output.

実施の形態2では、最初の2回の書きこみでCPUデータ線3からは現在実行しているブロックのテーブルを示すアドレスを出力してルックアップテーブル部19におけるルックアップテーブルが変わらないようにして、3回目のコイルの書き込みでCPUデータ線3から次のブロックのテーブルを示すアドレスを出力すると良い。   In the second embodiment, an address indicating the table of the block currently being executed is output from the CPU data line 3 in the first two writes so that the lookup table in the lookup table unit 19 does not change. It is preferable to output an address indicating a table of the next block from the CPU data line 3 in the third writing of the coil.

以上説明したように、実施の形態2のメモリ制御方法によれば、実施の形態1に記載したメモリ制御装置を用い、コイルが複数あるブロックに対しては、ビット抽出挿入部からの出力を、出力すべきコイルの個数だけデバイスメモリに連続して書き込むようにしたので、シーケンス制御のブロックに複数コイル出力のあるブロックに対しても実施の形態1の処理を実現することができる。   As described above, according to the memory control method of the second embodiment, for the block having a plurality of coils, the output from the bit extraction / insertion unit is used for the block having a plurality of coils. Since the number of coils to be output is continuously written in the device memory, the processing of the first embodiment can be realized even for a block having a plurality of coil outputs in the sequence control block.

実施の形態3.
論理演算回路が同じであるが、接点が異なる複数ブロックに関してはビット演算テーブル格納部10に保持するテーブルを共有してもよい。例えば、図3に示されるシーケンス制御のうちブロックkとブロックtについて、接点は異なるが同じ論理演算であるため1つのテーブルを共有できる。テーブルをロードするときには当該テーブルをビット演算テーブル格納部10より読み出し、演算実行時にデータラッチ部17にラッチする接点を変更すればよい。すなわち、接点とコイルは異なるが論理回路の構成が同じブロックの処理に対しては、ルックアップテーブル部19にロードするテーブルは同じものを使用し、データラッチ部17には異なる接点をラッチし、それぞれ該当するコイルに書き込む。
このように同じ論理演算回路で異なる接点を用いるブロックに対してテーブルを共有化することでビット演算テーブル格納部10のメモリ容量を減らす効果がある。
Embodiment 3 FIG.
A table held in the bit operation table storage unit 10 may be shared for a plurality of blocks having the same logic operation circuit but different contact points. For example, the blocks k and t in the sequence control shown in FIG. 3 can share one table because they have the same logical operation although the contacts are different. When loading a table, the table may be read from the bit operation table storage unit 10 and the contact latched in the data latch unit 17 at the time of execution of the operation may be changed. That is, for the processing of the block having the same contact point and coil but the same logic circuit configuration, the same table is loaded into the look-up table unit 19, and the data latch unit 17 latches different contacts. Write to the corresponding coil respectively.
Thus, by sharing a table for blocks using different contacts in the same logical operation circuit, there is an effect of reducing the memory capacity of the bit operation table storage unit 10.

以上説明したように、実施の形態3のメモリ制御方法によれば、接点とコイルは異なるが論理回路の構成が同じブロックの処理に対しては、ルックアップテーブル部にロードするテーブルは同じものを使用し、データラッチ部には異なる接点をラッチし、それぞれ該当するブロックのコイルに書き込むようにしたので、テーブルの数を少なくすることができ、ビット演算テーブル格納部のメモリ容量を節約することができる。   As described above, according to the memory control method of the third embodiment, the same table is loaded into the look-up table unit for processing of blocks having different contacts and coils but the same logic circuit configuration. Used, latching different contacts in the data latch part and writing to the coil of the corresponding block respectively, so the number of tables can be reduced and the memory capacity of the bit operation table storage part can be saved it can.

実施の形態4.
演算を行うシーケンス制御の1ブロックの中に接点は5個に限る必要はなく任意の個数X個でよい。データラッチ部17に1ビットを保持できるレジスタの個数をX個とする。シーケンス制御の1ブロックに含まれる接点の個数がX個より少ないY個の場合は、演算結果のテーブルは2Yビットからなるが、2Yビットのデータを2X―Y個並べて2xビットとしてビット演算テーブル格納部10におく。演算結果は接点のビット情報のロードをY回実行すれば、ビット演算テーブル格納部10からルックアップテーブル部19にロードした2xビットからビットセレクタ部18が選択することができる。シーケンス制御の1ブロックに含まれる接点の個数がX個より多いブロックを処理する際は、中間データ保持変数を作り、X個ずつの接点を含むブロックに分割する。これによりブロックに含まれる接点の個数によって可変サイズのデータラッチ部17を構成する必要がなくなり、またビット演算テーブル格納部10に格納するテーブルのサイズが巨大になりすぎることを防ぐ効果が得られる。
Embodiment 4 FIG.
There is no need to limit the number of contacts in one block of the sequence control for performing the calculation, and an arbitrary number X may be used. The number of registers that can hold 1 bit in the data latch unit 17 is X. If the number of contacts included in one block of the sequence control is less Y number than X number, the result of the operation of the table consists of 2 Y bits, the 2 Y bits of data as 2 X-Y number side by side 2 x bits It is placed in the bit operation table storage unit 10. As the calculation result, if the bit information of the contact is loaded Y times, the bit selector unit 18 can select from 2 × bits loaded from the bit calculation table storage unit 10 to the lookup table unit 19. When processing a block with more than X contacts included in one block of sequence control, an intermediate data holding variable is created and divided into blocks each including X contacts. As a result, there is no need to configure the variable-size data latch unit 17 according to the number of contacts included in the block, and the effect of preventing the table size stored in the bit operation table storage unit 10 from becoming too large can be obtained.

例えば、接点の数が5より大きい7個を含むブロックを示す図5に対して、中間変数を導入することにより2つのブロックに分割した様子を図6に示す。図5に示すラダーブロックは7個の接点を含むが、中間変数としてMmを用いると図6に示すようにブロックaとブロックbの2つのブロックに分割できる。それぞれの接点が5個以下なので実施の形態1で示したメモリ制御装置によって演算が実行できるようになる。その際、実施の形態1のままではブロックaの処理完了時にMmの値をデバイスメモリ6に書き、ブロックbを処理する際に再び読み出すという手順が必要となり、ストアとロードの2回の命令サイクルを要することになる。 For example, FIG. 6 shows a state in which an intermediate variable is divided into two blocks with respect to FIG. 5 showing a block including seven contacts having a number of contacts larger than five. The ladder block shown in FIG. 5 includes seven contact points, but if M m is used as an intermediate variable, it can be divided into two blocks, block a and block b, as shown in FIG. Since each contact is 5 or less, the calculation can be performed by the memory control device shown in the first embodiment. At that time, the procedure of writing the value of M m in the device memory 6 when the processing of the block “a” is completed and reading it again when processing the block “b” is necessary in the first embodiment. It will take a cycle.

そこで、実施の形態4では、図7に示すように、演算結果ビット線15、CPUアドレス線2、ライトイネーブル線4をデータラッチ部17に接続する。そして、CPUアドレス線2で定義するアドレスに対して、データラッチ部17は演算結果ビット線15に出力されている値をライトイネーブル線4が有効なときに保持するようにする。このようにするとMmの値が確定した後、CPU1はCPUデータ線3に次のブロックのテーブルを示すアドレスを出力しライトイネーブル線4を有効にすることでルックアップテーブル部19にテーブルをロードするとともにMmをデータラッチ部17に取り込むことができる。従ってMmをデバイスメモリ6から読み出す、ロード命令サイクルが不要となり命令サイクルを2回から1回に減らす効果が得られる。なお、図7におけるその他の構成は図1に示した実施の形態1と同様である。 Therefore, in the fourth embodiment, as shown in FIG. 7, the operation result bit line 15, the CPU address line 2, and the write enable line 4 are connected to the data latch unit 17. Then, for the address defined by the CPU address line 2, the data latch unit 17 holds the value output to the operation result bit line 15 when the write enable line 4 is valid. In this way, after the value of M m is determined, the CPU 1 outputs an address indicating the table of the next block to the CPU data line 3 and loads the table into the lookup table unit 19 by enabling the write enable line 4. In addition, M m can be taken into the data latch unit 17. Thus reading the M m from the device memory 6, the effect of reducing the instruction cycle becomes unnecessary load instruction cycle from two to one is obtained. 7 is the same as that of the first embodiment shown in FIG.

以上説明したように、実施の形態4のメモリ制御方法によれば、実施の形態1のメモリ制御装置を用い、ラダーのブロックに含まれる接点の個数が、予め定めた設定値よりも多いブロックに対して、中間変数を用いてブロックを分割して処理を行うようにしたので、テーブルサイズを一定にすることができ、ブロックに含まれる接点の数に応じて指数関数的にテーブルサイズが大きくなることを防ぐことができる。   As described above, according to the memory control method of the fourth embodiment, the memory control device of the first embodiment is used, and the number of contacts included in the ladder block is larger than a predetermined set value. On the other hand, since the processing is performed by dividing the block using the intermediate variable, the table size can be made constant, and the table size increases exponentially according to the number of contacts included in the block. Can be prevented.

また、実施の形態4のメモリ制御方法によれば、ビットセレクタ部からの出力をデータラッチ部に入力し、次のテーブルをルックアップテーブル部にロードするタイミングでビットセレクタ部から出力される中間変数をデータラッチ部にラッチするようにしたので、ブロックを分割して処理する際の中間変数をデバイスメモリに書き、再度読み出してラッチする処理を不要とすることができる。   Further, according to the memory control method of the fourth embodiment, the intermediate variable output from the bit selector unit at the timing when the output from the bit selector unit is input to the data latch unit and the next table is loaded into the lookup table unit. Is latched in the data latch unit, so that it is not necessary to write the intermediate variable when the block is divided and processed into the device memory, and read and latch it again.

また、実施の形態4のメモリ制御方法によれば、ラダーのブロックに含まれる接点の数がNであり、2Nの値がテーブルのビット数Mより少ない場合、2Nビットのテーブルを並べてビット数Mに拡張したデータをテーブルとしてルックアップテーブル部にロードし、含まれる接点の値をラッチすることで演算結果を得るようにしたので、ブロックに含まれる接点数が少ない場合でも同一回路で処理を行うことができる。 Also, according to the memory control method of the fourth embodiment, when the number of contacts included in the ladder block is N and the value of 2 N is smaller than the number of bits M of the table, the 2 N- bit tables are arranged side by side. Since the data expanded to several M is loaded as a table into the lookup table section and the calculation result is obtained by latching the values of the included contacts, even if the number of contacts included in the block is small, the same circuit is used for processing. It can be performed.

実施の形態5.
図8のようにビットセレクタ部18とルックアップテーブル部19を組み合わせた演算部22を複数個備えてもよい。その場合には図9に示すように演算結果セレクタ部24とテーブルセレクタ部23を設ける。データラッチ部17でラッチした接点の値はすべて演算部22のそれぞれに入力されている。CPU1から出力するCPUデータ線3の信号によって、テーブルセレクタ部23はビット演算テーブル格納部10から得られるテーブルをどの演算部22にロードするかを決定する。また、CPU1から出力されるCPUデータ線3の信号を演算結果セレクタ部24がデコードして複数有する演算部22の結果から必要な演算結果を選択する。その他の構成は図1に示した実施の形態1の構成と同様であるため、対応する部分に同一符号を付してその説明を省略する。
Embodiment 5 FIG.
As shown in FIG. 8, a plurality of arithmetic units 22 combining the bit selector unit 18 and the lookup table unit 19 may be provided. In that case, an operation result selector unit 24 and a table selector unit 23 are provided as shown in FIG. All the values of the contacts latched by the data latch unit 17 are inputted to the respective arithmetic units 22. Based on the signal of the CPU data line 3 output from the CPU 1, the table selector unit 23 determines which calculation unit 22 is loaded with the table obtained from the bit calculation table storage unit 10. Further, the calculation result selector unit 24 decodes the signal of the CPU data line 3 output from the CPU 1 and selects a necessary calculation result from the results of the calculation unit 22 having a plurality of signals. Since other configurations are the same as those of the first embodiment shown in FIG. 1, the same reference numerals are given to corresponding portions, and descriptions thereof are omitted.

このように、実施の形態5では、シーケンス制御の論理演算のブロックと同じ数だけの演算部22を備えることにより、ビット演算テーブル格納部10からテーブルをロードするのは最初の一回で済むことになる。また、シーケンス制御に含まれる論理演算のブロックと同じ数の演算部22を持つことが回路の規模の点などから不可能であった場合でも、できるだけ多くの演算部22を持つことで連続してテーブルをロードすることができるようになる。   As described above, in the fifth embodiment, the same number of operation units 22 as the sequence control logic operation blocks are provided, so that the table is loaded from the bit operation table storage unit 10 only once. become. Further, even if it is impossible to have the same number of operation units 22 as the logical operation blocks included in the sequence control due to the scale of the circuit, etc., by having as many operation units 22 as possible, You will be able to load the table.

実施の形態1ではブロックを処理するごとに1回のテーブルをロードしていたが、連続してテーブルをロードすることができるようになると、ビット演算テーブル格納部10のメモリがフラッシュメモリやDRAM、あるいはネットワークによって接続された記録装置を使用する場合は1回のリードよりも連続してリードするほうが高速にアクセスできるため、本装置の処理性能を向上させる効果が得られる。   In the first embodiment, each time a block is processed, the table is loaded once. However, when the table can be loaded continuously, the memory of the bit operation table storage unit 10 is a flash memory, a DRAM, Alternatively, when using a recording apparatus connected by a network, it is possible to access at a higher speed by continuously reading than by one reading, so that an effect of improving the processing performance of this apparatus can be obtained.

以上説明したように、実施の形態5のメモリ制御装置によれば、ビットセレクタ部とルックアップテーブル部とからなる演算部を複数備えるとともに、複数の演算部からの出力を選択する演算結果セレクタ部と、複数の演算部の中から、テーブルをロードする演算部を選択するためのテーブルセレクタ部とを備えたので、ビット演算テーブル格納部からのテーブルのロードを連続で実行できることにより、連続アクセスが速いフラッシュメモリやDRAMで高速化の効果が得られる。また、シーケンスに含まれるすべての論理演算のブロックを演算部にロードすることができる場合は1回だけテーブルをロードするだけで処理を行うことができる。   As described above, according to the memory control device of the fifth embodiment, the operation result selector unit includes a plurality of operation units each including a bit selector unit and a lookup table unit, and selects outputs from the plurality of operation units. And a table selector unit for selecting a calculation unit to load a table from among a plurality of calculation units, so that it is possible to continuously load a table from the bit calculation table storage unit, thereby enabling continuous access. Fast flash memory and DRAM can achieve the speed-up effect. In addition, when all the logical operation blocks included in the sequence can be loaded into the operation unit, the processing can be performed by loading the table only once.

また、実施の形態5のメモリ制御方法によれば、実施の形態5のメモリ制御装置を用い、複数の演算部に連続してテーブルをロードしておき、ラダーのブロックを処理するようにしたので、ビット演算テーブル格納部からのテーブルのロードを連続で実行できることにより、連続アクセスが速いフラッシュメモリやDRAMで高速化の効果が得られる。また、シーケンスに含まれるすべての論理演算のブロックを演算部にロードすることができる場合は1回だけテーブルをロードするだけで処理を行うことができる。   Further, according to the memory control method of the fifth embodiment, the memory control device of the fifth embodiment is used, the table is loaded in succession on a plurality of arithmetic units, and the ladder block is processed. Since the table loading from the bit operation table storage unit can be executed continuously, the flash memory and DRAM with fast continuous access can achieve the effect of speeding up. In addition, when all the logical operation blocks included in the sequence can be loaded into the operation unit, the processing can be performed by loading the table only once.

また、実施の形態5のメモリ制御方法によれば、実施の形態5のメモリ制御装置を用い、複数の演算部に、シーケンスに含まれるすべてのブロックについてのテーブルをロードして、ラダーのブロックを処理するようにしたので、シーケンスに含まれるすべての論理演算のブロックを演算部にロードすることができる場合は1回だけテーブルをロードするだけで処理を行うことができる。   Further, according to the memory control method of the fifth embodiment, the memory control device of the fifth embodiment is used to load the ladder block by loading the tables for all the blocks included in the sequence into a plurality of arithmetic units. Since the processing is performed, when all the logical operation blocks included in the sequence can be loaded into the arithmetic unit, the processing can be performed by loading the table only once.

実施の形態6.
実施の形態1ではCPU1の実行するロード命令、ストア命令を使用して接点情報のロード、コイルの書き込み処理を行っていたが図10に示す実施の形態6では命令処理部35によって命令コードを記録した命令格納部32から命令コードを読み出し、シーケンス制御の論理演算のブロックを処理する。命令格納部32は図11に示すオペコードとオペランドからなる命令列が格納されているメモリである。オペコードとしてロード、オペランドとしてアドレスの組からなる命令とオペコードとしてストア、オペランドとしてアドレス、データの組みからなる命令を有する。CPU1とバス調停部38とは、CPUリードイネーブル線36、CPUライトイネーブル線37、CPUバスリクエスト線26、CPUバスアクノリジ線39、CPUアドレス線2、CPUデータ線3によって接続されている。
Embodiment 6 FIG.
In the first embodiment, the load information and the store instruction executed by the CPU 1 are used to load the contact information and the coil is written. In the sixth embodiment shown in FIG. The instruction code is read out from the instruction storage unit 32, and the block of logical operations for sequence control is processed. The instruction storage unit 32 is a memory in which an instruction sequence including an opcode and an operand shown in FIG. 11 is stored. It has a load as an opcode, an instruction consisting of a set of addresses as an operand, a store as an opcode, and an instruction consisting of a set of addresses and data as an operand. The CPU 1 and the bus arbitration unit 38 are connected by a CPU read enable line 36, a CPU write enable line 37, a CPU bus request line 26, a CPU bus acknowledge line 39, a CPU address line 2, and a CPU data line 3.

また、命令処理部35とバス調停部38とは、バスリクエスト線29、バスアクノリジ線40、バスアドレス線30で接続されている。バスアドレス線30からは、実施の形態1のCPUアドレス線2と同様に、信号線のうちいくつかがビット選択線14として取り出されてビット抽出挿入部16に接続されている。バス調停部38とデバイスメモリ6とは、デバイスメモリアドレス線25、デバイスメモリリードイネーブル線8、ビット選択線14、デバイスメモリデータ線7で接続されている。また、バス調停部38とビット抽出挿入部16とはバスデータ線41で接続されている。   The instruction processing unit 35 and the bus arbitration unit 38 are connected by a bus request line 29, a bus acknowledge line 40, and a bus address line 30. Similar to the CPU address line 2 of the first embodiment, some of the signal lines are extracted from the bus address line 30 as the bit selection line 14 and connected to the bit extraction / insertion unit 16. The bus arbitration unit 38 and the device memory 6 are connected by a device memory address line 25, a device memory read enable line 8, a bit selection line 14, and a device memory data line 7. The bus arbitration unit 38 and the bit extraction / insertion unit 16 are connected by a bus data line 41.

バス調停部38は、CPUバスリクエスト線26とバスリクエスト線29がともに有効になり、CPU1と命令処理部35の両者がデバイスメモリ6へのアクセスを要求したときにどちらか一方へアクセス許可を与える調停部である。片方しか要求がない場合はアクセス要求をしている方に許可を与える。アクセス許可はCPU1に対してはCPUバスアクノリジ線39を有効にすることで与える。命令処理部35へはバスアクノリジ線40を有効にすることで許可を与える。このバス調停部38の機能によってCPU1と命令処理部35はともにデバイスメモリ6へアクセスができるようになる。   The bus arbitration unit 38 grants access permission to one of the CPU bus request line 26 and the bus request line 29 when both the CPU 1 and the instruction processing unit 35 request access to the device memory 6. The mediation department. If there is only one request, grant permission to the requesting person. Access permission is given to the CPU 1 by enabling the CPU bus acknowledge line 39. The instruction processing unit 35 is granted permission by enabling the bus acknowledge line 40. Both the CPU 1 and the instruction processing unit 35 can access the device memory 6 by the function of the bus arbitration unit 38.

命令処理部35は、命令格納部32に収められている命令のうちどのアドレスから実行を開始するかを指定するアドレスを保持する開始アドレスレジスタ42と、どの命令まで実行するかを示すアドレスを保持する終了アドレスレジスタ43とを有している。これらのレジスタはCPU1から書きこみアクセスによって設定できる。また、命令処理部35からはライトイネーブル線4とリードイネーブル線5とがリードライト制御部20に、テーブルデータ線31がテーブルアドレス生成部21にそれぞれ接続されている。さらに、リードライト制御部20からはバス調停部38に対して、バスリードイネーブル線27とバスライトイネーブル線28とが接続されている。   The instruction processing unit 35 holds a start address register 42 that holds an address that specifies which address of the instructions stored in the instruction storage unit 32 is to be executed, and an address that indicates which instruction is to be executed. And an end address register 43. These registers can be set by writing access from the CPU 1. Further, from the instruction processing unit 35, the write enable line 4 and the read enable line 5 are connected to the read / write control unit 20, and the table data line 31 is connected to the table address generation unit 21, respectively. Further, the bus read enable line 27 and the bus write enable line 28 are connected from the read / write control unit 20 to the bus arbitration unit 38.

命令処理部35はCPU1に接続された開始イベント線34が有効になると命令格納部32から開始アドレスレジスタ42に保持されているアドレスの命令を取り出す。そして命令をデコードして実行を行う。命令実行後、アドレスをインクリメントして次の命令を命令格納部32より取り出して、命令をデコードして実行を行う。これらの命令実行の1連の処理は実施の形態1においてCPU1が実施していたものと同様の実行処理である。アドレスが終了アドレスレジスタ43と一致するところで実行を停止する。そして終了イベント線33を有効にしてCPU1に処理が完了したことを通知する。その他の構成及び動作は実施の形態1と同様である。   When the start event line 34 connected to the CPU 1 becomes valid, the instruction processing unit 35 takes out the instruction at the address held in the start address register 42 from the instruction storage unit 32. The instruction is decoded and executed. After the instruction is executed, the address is incremented, the next instruction is taken out from the instruction storage unit 32, and the instruction is decoded and executed. A series of processing for executing these instructions is the same execution processing as that performed by the CPU 1 in the first embodiment. Execution is stopped when the address matches the end address register 43. Then, the end event line 33 is validated to notify the CPU 1 that the processing is completed. Other configurations and operations are the same as those in the first embodiment.

以上の形態により、命令処理部35が論理演算のブロックを実行している間、CPU1は基本命令、応用命令を含むブロックを処理することで、並列化実行を行いシーケンス制御の高速化の効果が得られる。   With the above form, while the instruction processing unit 35 is executing a logical operation block, the CPU 1 processes a block including a basic instruction and an application instruction, thereby executing parallel execution and improving the speed of sequence control. can get.

以上説明したように、実施の形態6のメモリ制御装置によれば、接点の論理演算からなるラダーを処理するプログラマブルコントローラにおけるデバイスメモリの値を制御するメモリ制御装置において、CPUからの開始イベント通知により、接点の論理演算からなるラダーの処理を開始し、処理が終了した場合に終了イベントをCPUに通知する命令処理部と、ビット単位の論理演算の結果を予めテーブルとして保持するビット演算テーブル格納部と、ビット演算テーブル格納部から1つのテーブルを取得して保持するルックアップテーブル部と、デバイスメモリから読み出されたワードデータから、命令処理部から送出されるビット選択入力に基づいてビットデータを抽出するビット抽出挿入部と、ビット抽出挿入部が抽出したビットデータをラッチするデータラッチ部と、データラッチ部がラッチしたビットデータの出力に応じて、ルックアップテーブル部に保持したテーブルから1つのビットを選択するビットセレクタ部と、デバイスメモリへの書きこみに対してデバイスメモリからワードデータを読み出し、このワードデータのうち1ビットをビットセレクタ部が出力する1ビットと入れ替えたワードデータを再度デバイスメモリへ書き戻す制御を行うリードライト制御部と、CPUと命令処理部とのデバイスメモリへのアクセスを調停するバス調停部とを備えたので、CPUは接点の論理演算からなるラダー処理を行う必要がない。   As described above, according to the memory control device of the sixth embodiment, in the memory control device that controls the value of the device memory in the programmable controller that processes the ladder composed of the logical operations of the contacts, the start event notification from the CPU A command processing unit for starting a ladder process consisting of a logical operation of a contact and notifying the CPU of an end event when the processing is completed; and a bit operation table storage unit for holding a result of the logical operation in units of bits as a table in advance And a lookup table unit that acquires and holds one table from the bit operation table storage unit, and bit data based on a bit selection input sent from the instruction processing unit from word data read from the device memory The bit extraction / insertion unit to be extracted and the bit data extracted by the bit extraction / insertion unit A data latch unit that latches the data, a bit selector unit that selects one bit from the table held in the lookup table unit according to the output of the bit data latched by the data latch unit, and writing to the device memory On the other hand, a read / write control unit that reads out word data from the device memory and rewrites the word data in which one bit of the word data is replaced with one bit output from the bit selector unit to the device memory, and a CPU and a command Since the bus arbitration unit that arbitrates access to the device memory with the processing unit is provided, the CPU does not need to perform ladder processing including logical operation of the contacts.

また、実施の形態6のメモリ制御方法によれば、実施の形態6のメモリ制御装置を用いて、命令処理部による接点の論理演算と、CPUによる論理演算以外の処理とを並列に実行するようにしたので、例えば、命令処理部が接点の論理演算を実行している間にCPUが論理演算以外の複雑な処理を行う、といった並列処理が可能となる。   In addition, according to the memory control method of the sixth embodiment, using the memory control device of the sixth embodiment, the logical operation of the contact by the instruction processing unit and the processing other than the logical operation by the CPU are executed in parallel. Therefore, for example, parallel processing is possible in which the CPU performs complex processing other than logical operation while the instruction processing unit executes logical operation of the contacts.

なお、本願発明はその発明の範囲内において、各実施の形態の自由な組み合わせ、あるいは各実施の形態の任意の構成要素の変形、もしくは各実施の形態において任意の構成要素の省略が可能である。   In the present invention, within the scope of the invention, any combination of the embodiments, or any modification of any component in each embodiment, or omission of any component in each embodiment is possible. .

1 CPU(マイクロプロセッサ)、2 CPUアドレス線、3 CPUデータ線、4 ライトイネーブル線、5 リードイネーブル線、6 デバイスメモリ、7 デバイスメモリデータ線、8 デバイスメモリリードイネーブル線、9 デバイスメモリライトイネーブル線、10 ビット演算テーブル格納部、11 メモリアドレス線、12 メモリデータ線、13 メモリリードイネーブル線、14 ビット選択線、15 演算結果ビット線、16 ビット抽出挿入部、17 データラッチ部、18 ビットセレクタ部、19 ルックアップテーブル部、20 リードライト制御部、21 テーブルアドレス生成部、22 演算部、23 テーブルセレクタ部、24 演算結果セレクタ部、25 デバイスメモリアドレス線、26 CPUバスリクエスト線、27 バスリードイネーブル線、28 バスライトイネーブル線、29 バスリクエスト線、30 バスアドレス線、31 テーブルデータ線、32 命令格納部、33 終了イベント線、34 開始イベント線、35 命令処理部、36 CPUリードイネーブル線、37 CPUライトイネーブル線、38 バス調停部、39 CPUバスアクノリジ線、40 バスアクノリジ線、41 バスデータ線、42 開始アドレスレジスタ、43 終了アドレスレジスタ。   1 CPU (microprocessor), 2 CPU address line, 3 CPU data line, 4 write enable line, 5 read enable line, 6 device memory, 7 device memory data line, 8 device memory read enable line, 9 device memory write enable line 10-bit operation table storage unit, 11 memory address line, 12 memory data line, 13 memory read enable line, 14-bit selection line, 15 operation result bit line, 16-bit extraction / insertion unit, 17 data latch unit, 18-bit selector unit , 19 Look-up table section, 20 Read / write control section, 21 Table address generation section, 22 operation section, 23 table selector section, 24 operation result selector section, 25 device memory address line, 26 CPU bus request line 27 Bus read enable line, 28 Bus write enable line, 29 Bus request line, 30 Bus address line, 31 Table data line, 32 Instruction storage unit, 33 End event line, 34 Start event line, 35 Instruction processing unit, 36 CPU Read enable line, 37 CPU write enable line, 38 bus arbitration unit, 39 CPU bus acknowledge line, 40 bus acknowledge line, 41 bus data line, 42 start address register, 43 end address register.

Claims (12)

接点の論理演算からなるラダーを処理するプログラマブルコントローラにおけるデバイスメモリの値を制御するメモリ制御装置において、
ビット単位の前記論理演算の結果を予めテーブルとして保持するビット演算テーブル格納部と、
前記ビット演算テーブル格納部から1つのテーブルを取得して保持するルックアップテーブル部と、
前記デバイスメモリから読み出されたワードデータからビット選択入力に基づいてビットデータを抽出するビット抽出挿入部と、
前記ビット抽出挿入部が抽出したビットデータをラッチするデータラッチ部と、
前記データラッチ部がラッチしたビットデータの出力に応じて、前記ルックアップテーブル部に保持したテーブルから1つのビットを選択するビットセレクタ部と、
前記デバイスメモリへの書きこみに対して当該デバイスメモリからワードデータを読み出し、このワードデータのうち1ビットを前記ビットセレクタ部が出力する1ビットと入れ替えたワードデータを再度前記デバイスメモリへ書き戻す制御を行うリードライト制御部とを備えたことを特徴とするメモリ制御装置。
In a memory control device that controls the value of a device memory in a programmable controller that processes a ladder consisting of logical operations of contacts,
A bit operation table storage unit that holds the result of the logical operation in units of bits as a table in advance;
A lookup table unit that acquires and holds one table from the bit operation table storage unit;
A bit extraction / insertion unit for extracting bit data from the word data read from the device memory based on a bit selection input;
A data latch unit that latches the bit data extracted by the bit extraction and insertion unit;
A bit selector for selecting one bit from the table held in the lookup table in accordance with the output of the bit data latched by the data latch;
Control for reading word data from the device memory in response to writing to the device memory, and writing back the word data in which one bit is replaced with one bit output from the bit selector unit to the device memory. A memory control device comprising a read / write control unit for performing
CPUが実行する命令により前記接点の論理演算からなるラダーを処理するとともに、前記ビット選択入力は前記CPUより与えられることを特徴とする請求項1記載のメモリ制御装置。   2. The memory control device according to claim 1, wherein a ladder including logical operations of the contacts is processed by an instruction executed by a CPU, and the bit selection input is given by the CPU. 請求項1記載のメモリ制御装置を用い、コイルが複数あるブロックに対しては、前記ビット抽出挿入部からの出力を、出力すべきコイルの個数だけ前記デバイスメモリに連続して書き込むことを特徴とするメモリ制御方法。   The memory control device according to claim 1, wherein for a block having a plurality of coils, the output from the bit extraction / insertion unit is continuously written in the device memory by the number of coils to be output. Memory control method. 請求項1記載のメモリ制御装置を用い、接点とコイルは異なるが論理回路の構成が同じブロックの処理に対しては、前記ルックアップテーブル部にロードするテーブルは同じものを使用し、前記データラッチ部には異なる接点をラッチし、それぞれ該当するブロックのコイルに書き込むことを特徴とするメモリ制御方法。   2. The memory control device according to claim 1, wherein the same table is loaded into the look-up table unit for processing of blocks having different contacts and coils but the same logic circuit configuration, and the data latch A memory control method characterized in that different contacts are latched in each section and written in the coils of the corresponding blocks. 請求項1記載のメモリ制御装置を用い、ラダーのブロックに含まれる接点の個数が、予め定めた設定値よりも多いブロックに対して、中間変数を用いてブロックを分割して処理を行うことを特徴とするメモリ制御方法。   Using the memory control device according to claim 1, for a block in which the number of contacts included in the ladder block is larger than a predetermined set value, processing is performed by dividing the block using an intermediate variable. A memory control method. 前記ビットセレクタ部からの出力を前記データラッチ部に入力し、次のテーブルを前記ルックアップテーブル部にロードするタイミングで前記ビットセレクタ部から出力される中間変数を前記データラッチ部にラッチすることを特徴とする請求項5記載のメモリ制御方法。   The output from the bit selector unit is input to the data latch unit, and the intermediate variable output from the bit selector unit is latched in the data latch unit at the timing of loading the next table into the lookup table unit. 6. The memory control method according to claim 5, wherein: ラダーのブロックに含まれる接点の数がNであり、2Nの値がテーブルのビット数Mより少ない場合、2Nビットのテーブルを並べてビット数Mに拡張したデータをテーブルとして前記ルックアップテーブル部にロードし、含まれる接点の値をラッチすることで演算結果を得ることを特徴とする請求項5記載のメモリ制御方法。 When the number of contacts included in the ladder block is N and the value of 2 N is smaller than the number of bits M of the table, the lookup table unit uses the data obtained by arranging 2 N- bit tables and extending the number of bits as M as a table. 6. The memory control method according to claim 5, wherein a calculation result is obtained by loading the data into the memory and latching the value of the included contact. 前記ビットセレクタ部と前記ルックアップテーブル部とからなる演算部を複数備えるとともに、前記複数の演算部からの出力を選択する演算結果セレクタ部と、前記複数の演算部の中から、前記テーブルをロードする演算部を選択するためのテーブルセレクタ部とを備えたことを特徴とする請求項1記載のメモリ制御装置。   A plurality of operation units each including the bit selector unit and the lookup table unit are provided, and an operation result selector unit that selects an output from the plurality of operation units, and the table is loaded from the plurality of operation units. The memory control device according to claim 1, further comprising a table selector unit for selecting an arithmetic unit to perform. 請求項8記載のメモリ制御装置を用い、前記複数の演算部に連続して前記テーブルをロードしておき、ラダーのブロックを処理することを特徴とするメモリ制御方法。   9. A memory control method using the memory control device according to claim 8, wherein the table is loaded in succession on the plurality of arithmetic units, and a ladder block is processed. 請求項8記載のメモリ制御装置を用い、前記複数の演算部に、シーケンスに含まれるすべてのブロックについてのテーブルをロードして、ラダーのブロックを処理することを特徴とするメモリ制御方法。   9. A memory control method using the memory control device according to claim 8, wherein a table for all blocks included in a sequence is loaded into the plurality of arithmetic units to process ladder blocks. 接点の論理演算からなるラダーを処理するプログラマブルコントローラにおけるデバイスメモリの値を制御するメモリ制御装置において、
CPUからの開始イベント通知により、前記接点の論理演算からなるラダーの処理を開始し、処理が終了した場合に終了イベントを前記CPUに通知する命令処理部と、
ビット単位の前記論理演算の結果を予めテーブルとして保持するビット演算テーブル格納部と、
前記ビット演算テーブル格納部から1つのテーブルを取得して保持するルックアップテーブル部と、
前記デバイスメモリから読み出されたワードデータから、前記命令処理部から送出されるビット選択入力に基づいてビットデータを抽出するビット抽出挿入部と、
前記ビット抽出挿入部が抽出したビットデータをラッチするデータラッチ部と、
前記データラッチ部がラッチしたビットデータの出力に応じて、前記ルックアップテーブル部に保持したテーブルから1つのビットを選択するビットセレクタ部と、
前記デバイスメモリへの書きこみに対して当該デバイスメモリからワードデータを読み出し、このワードデータのうち1ビットを前記ビットセレクタ部が出力する1ビットと入れ替えたワードデータを再度前記デバイスメモリへ書き戻す制御を行うリードライト制御部と、
前記CPUと前記命令処理部との前記デバイスメモリへのアクセスを調停するバス調停部とを備えたことを特徴とするメモリ制御装置。
In a memory control device that controls the value of a device memory in a programmable controller that processes a ladder consisting of logical operations of contacts,
A command processing unit for starting a ladder process consisting of a logical operation of the contact by a start event notification from the CPU and notifying the CPU of an end event when the process is completed,
A bit operation table storage unit that holds the result of the logical operation in units of bits as a table in advance;
A lookup table unit that acquires and holds one table from the bit operation table storage unit;
A bit extraction / insertion unit for extracting bit data from the word data read from the device memory based on a bit selection input sent from the instruction processing unit;
A data latch unit that latches the bit data extracted by the bit extraction and insertion unit;
A bit selector for selecting one bit from the table held in the lookup table in accordance with the output of the bit data latched by the data latch;
Control for reading word data from the device memory in response to writing to the device memory, and writing back the word data in which one bit is replaced with one bit output from the bit selector unit to the device memory. A read / write control unit,
A memory control device comprising: a bus arbitration unit that arbitrates access between the CPU and the instruction processing unit to the device memory.
請求項11記載のメモリ制御装置を用い、前記命令処理部による前記接点の論理演算と、前記CPUによる当該論理演算以外の処理とを並列に実行することを特徴とするメモリ制御方法。   12. A memory control method using the memory control device according to claim 11, wherein a logical operation of the contact by the instruction processing unit and a process other than the logical operation by the CPU are executed in parallel.
JP2013141563A 2013-07-05 2013-07-05 Memory controller and memory control method Pending JP2015014934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013141563A JP2015014934A (en) 2013-07-05 2013-07-05 Memory controller and memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013141563A JP2015014934A (en) 2013-07-05 2013-07-05 Memory controller and memory control method

Publications (1)

Publication Number Publication Date
JP2015014934A true JP2015014934A (en) 2015-01-22

Family

ID=52436626

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013141563A Pending JP2015014934A (en) 2013-07-05 2013-07-05 Memory controller and memory control method

Country Status (1)

Country Link
JP (1) JP2015014934A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020024594A (en) * 2018-08-08 2020-02-13 オムロン株式会社 Support device and support program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020024594A (en) * 2018-08-08 2020-02-13 オムロン株式会社 Support device and support program
WO2020031903A1 (en) * 2018-08-08 2020-02-13 オムロン株式会社 Support device and support program
JP7070223B2 (en) 2018-08-08 2022-05-18 オムロン株式会社 Support equipment and support programs

Similar Documents

Publication Publication Date Title
US20140359225A1 (en) Multi-core processor and multi-core processor system
KR101513380B1 (en) Memories and methods for performing atomic memory operations in accordance with configuration information
CN107315566B (en) Apparatus and method for performing vector circular shift operation
US9043806B2 (en) Information processing device and task switching method
JP5994679B2 (en) Processing device and control method of processing device
CN107315575B (en) Device and method for executing vector merging operation
CN107315565B (en) Device and method for generating random vectors obeying certain distribution
JP6004463B2 (en) Storage device and control method thereof
JP6038292B2 (en) Data transfer apparatus and data transfer method
JP2015014934A (en) Memory controller and memory control method
JP2009193378A (en) Vector processing device
US7702860B2 (en) Memory access apparatus
US9798550B2 (en) Memory access for a vector processor
KR20150087982A (en) Method and appratus for processing image by thread
KR20180044893A (en) Integrated circuit devices with selectable processor cores
JP2005222519A (en) Access to bit value in data word stored in memory
CN112579481B (en) Data processing method, data processing device and computing device
JP6237241B2 (en) Processing equipment
JP2012174105A (en) Memory access control circuit
JP2012014436A (en) Direct memory access control device and method
US20150234656A1 (en) Vector processor, information processing apparatus, and overtaking control method
JP7141401B2 (en) processor and information processing system
JP2010140306A (en) Control system for boundary execution, control method for boundary execution, and control program for boundary execution
US20140281368A1 (en) Cycle sliced vectors and slot execution on a shared datapath
JP2005032020A (en) Storage device