JP2007249560A - Cpu module in programmable controller - Google Patents
Cpu module in programmable controller Download PDFInfo
- Publication number
- JP2007249560A JP2007249560A JP2006071630A JP2006071630A JP2007249560A JP 2007249560 A JP2007249560 A JP 2007249560A JP 2006071630 A JP2006071630 A JP 2006071630A JP 2006071630 A JP2006071630 A JP 2006071630A JP 2007249560 A JP2007249560 A JP 2007249560A
- Authority
- JP
- Japan
- Prior art keywords
- data
- output
- input
- bus
- output data
- 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.)
- Withdrawn
Links
Images
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
本発明は、プログラマブルコントローラに関する。 The present invention relates to a programmable controller.
近年、プラント、工場等では、機械や装置のシーケンス制御にプログラマブルコントローラを用い、FA(ファクトリーオートメーション)化を実現している。
このようなプログラマブルコントローラの構成の1形態として、プログラムの実行やデータの演算処理等を行うCPUモジュールや、各種制御対象機器とのプロセスデータの入出力を行うI/Oモジュール(通常、各々、複数存在する)が、バスに接続され、CPUモジュールがこのバスを介して各I/Oモジュールとのデータ入出力を行うものが、従来、存在する。
In recent years, plants, factories, etc. have realized FA (factory automation) by using programmable controllers for sequence control of machines and devices.
As one form of the configuration of such a programmable controller, a CPU module for executing a program, data arithmetic processing, and the like, and an I / O module for inputting / outputting process data to / from various control target devices (usually a plurality of each) Conventionally, there is one that is connected to a bus and a CPU module performs data input / output with each I / O module via this bus.
図7は、この従来のプログラマブルコントローラの構成の一例を、概略的に示す図である。
同図において、上記の通り、CPUモジュール100、入力モジュール140、出力モジュール150が、システムバス160に接続されている。尚、図では、入力モジュール140、出力モジュール150を各々1つのみ示しているが、上記の通り、これらは通常複数存在するものである。
FIG. 7 is a diagram schematically showing an example of the configuration of this conventional programmable controller.
In the figure, as described above, the CPU module 100, the
CPUモジュール100は、制御用プロセッサ110、バスLSI130、これら制御用プロセッサ110とバスLSI130とが共有する共有メモリ120を有する。
制御用プロセッサ110は、データ出力時には、共有メモリ120を介して、出力データをバスLSI130に渡す。また、制御用プロセッサ110は、データ入力時には、共有メモリ120を介して、バスLSI130から入力データを受け取る。
The CPU module 100 includes a control processor 110, a bus LSI 130, and a shared
The control processor 110 passes output data to the bus LSI 130 via the shared
バスLSI130は、タクト周期に同期して、システムバス160を介して、各入力モジュール140から入力データを受信し、または各出力モジュール150へ出力データを送信する。これは、受信処理のときはトータルフレーム方式、送信処理のときはマルチキャスト方式で行う。このようなタクト周期に同期したシステムバス160上でのバスLSI130、入力モジュール140、出力モジュール150間のデータ入出力処理自体については、例えば本出願人による先出願(特許文献1)において説明されているので、ここでは特に詳細には説明しない。また、これより、バスLSI130、入力モジュール140、出力モジュール150の詳細な構成、動作についても、ここでは特に図示/説明しないものとする。
The bus LSI 130 receives input data from each
上記制御用プロセッサ110内でのデータ受け渡し動作について、以下、更に詳細に説明する。
データ出力時には、まず、制御アプリケーション111が、Oデータ管理ドライバ113に対して、データ出力要求する。これに応じて、Oデータ管理ドライバ113は、この出力データを共有メモリ120内のOデータ領域121に書き込む。バスLSI130は、上記タクト周期に同期して、Oデータ領域121に格納されている出力データを読み出し、システムバス160上に送出する。
The data transfer operation in the control processor 110 will be described in more detail below.
At the time of data output, first, the control application 111 issues a data output request to the O data management driver 113. In response to this, the O data management driver 113 writes the output data in the O data area 121 in the shared
このとき、制御アプリケーション111が、タクト周期とは関係なく、任意のタイミングでデータ出力要求する構成の場合、例えば図8(a)に示すようなタイミングであれば、問題はない。 At this time, if the control application 111 is configured to request data output at an arbitrary timing regardless of the tact cycle, there is no problem if the timing is as shown in FIG.
しかしながら、図8(b)に示すようなタイミングであると、問題が生じる。すなわち、図示のように制御アプリケーション111からの出力要求が、タクト割込みt1 の少し前のタイミングで行われた場合、Oデータ領域121のデータ書き換え処理(データaからbへの書き換え)の途中でタクト割込みt1 のタイミングとなってしまい、バスLSI130によりOデータ領域121の出力データの読み出し/システムバス160上への送出処理が開始されてしまう。この為、出力モジュール150に渡されるデータは、データaでもデータbでもないデータ(図ではデータa’としている)となってしまう。
However, a problem occurs when the timing is as shown in FIG. That is, when an output request from the control application 111 is made at a timing just before the tact interrupt t1, as shown in the figure, the tact occurs in the middle of data rewriting processing (rewriting from data a to b) in the O data area 121. At the timing of the interrupt t1, the bus LSI 130 starts reading the output data in the O data area 121 / sending the data onto the system bus 160. For this reason, the data passed to the
同様に、データ入力処理においても、制御アプリケーション111からのデータ読み出し要求が、図9に示すように、タクト割込みt3 の少し前のタイミングで行われた場合、Iデータ領域122からのデータ読み出し処理の途中でタクト割込みt3 のタイミングとなってしまい、バスLSI130によりIデータ領域122の書き換えが開始される結果、制御アプリケーション111が得るデータは、データbでもデータcでもないデータ(図ではデータb’としている)となってしまう。
Similarly, in the data input process, when a data read request from the control application 111 is made at a timing slightly before the tact interrupt t3 as shown in FIG. 9, the data read process from the
このように、従来、データ入力処理、データ出力処理のいずれにおいても、制御アプリケーション111が、タクト周期とは関係なく、任意のタイミングでデータ入力/出力要求する構成の場合、Oデータ/Iデータの同時性が保証できなくなるという問題があった。 As described above, conventionally, in any of the data input process and the data output process, the control application 111 is configured to request the data input / output at an arbitrary timing regardless of the tact cycle. There was a problem that simultaneity could not be guaranteed.
尚、データb、データc等と言っているが、実際には複数の入力データの集まり又は複数の出力データの集まりであり、“データ群”と呼んだほうがよいかもしれないが、ここではデータb、データc等と呼ぶものとする。
本発明の課題は、プログラマブルコントローラにおいて、タクト周期とは関係なく、任意のタイミングでデータ入力/出力要求が行なわれても、入力データ/出力データの同時性を保証できるようにし、更に出力順も保証できるようにするCPUモジュールを提供することである。 An object of the present invention is to enable a programmable controller to guarantee the simultaneity of input data / output data even when a data input / output request is made at an arbitrary timing irrespective of the tact cycle, and also to set the output order. It is to provide a CPU module that can be guaranteed.
本発明の第1のプログラマブルコントローラにおけるCPUモジュールは、CPUモジュールと少なくとも1以上の入力モジュール/出力モジュールがバスに接続され、タクト周期に同期して該バス上でのデータ送受信が行われるプログラマブルコントローラにおける、前記タクト周期に同期して前記バスを介して受信する各入力モジュールからの入力データを入力データ記憶領域に格納するバスLSIと、任意のタイミングで該入力データ記憶領域に格納されている入力データを読み出す制御用プロセッサとを備える前記CPUモジュールであって、第1の記憶手段、第2の記憶手段と、前記入力データ記憶領域に入力データが格納される毎に、該入力データを前記第1の記憶手段、第2の記憶手段の何れか一方に交互に移す管理手段とを備え、前記制御用プロセッサは、前記入力データの読み出しを、該第1の記憶手段、第2の記憶手段の何れか一方から行うように構成する。 The CPU module in the first programmable controller of the present invention is a programmable controller in which a CPU module and at least one or more input modules / output modules are connected to a bus, and data transmission / reception is performed on the bus in synchronization with a tact cycle. , A bus LSI for storing input data from each input module received via the bus in synchronization with the tact cycle in the input data storage area, and input data stored in the input data storage area at an arbitrary timing Each time the input data is stored in the first storage means, the second storage means, and the input data storage area, the CPU module includes a control processor for reading the input data. Management means for alternately transferring to any one of the storage means and the second storage means For example, the control processor, the reading of the input data, first storage means, configured to perform the one of the second storage means.
上記構成のCPUモジュールを用いることにより、上記制御用プロセッサが任意のときに入力データの読み出しを行うタイミングが、例えばタクト割込みタイミングの直前であり当該読み出し処理中に入力データ記憶領域のデータの書き換えが行われるような場合であっても、第1の記憶手段または第2の記憶手段から読み出しを行っているので、問題なく、入力データの同時性を保証できる。 By using the CPU module configured as described above, the timing at which the control processor reads the input data at any time is, for example, immediately before the tact interrupt timing, and the data in the input data storage area is rewritten during the read processing. Even in such a case, since the data is read from the first storage means or the second storage means, the simultaneity of the input data can be guaranteed without any problem.
また、本発明の第2のプログラマブルコントローラにおけるCPUモジュールは、CPUモジュールと少なくとも1以上の入力モジュール/出力モジュールがバスに接続され、タクト周期に同期して該バス上でのデータ送受信が行われるプログラマブルコントローラにおける、各出力モジュールに渡すべき出力データを任意のタイミングで出力データ記憶領域に格納する制御用プロセッサと、前記タクト周期に同期して、該出力データ記憶領域に格納されている出力データを前記バス上に送出するバスLSIとを備える前記CPUモジュールであって、前記制御用プロセッサが、出力データの同時性を保証できないタイミングでデータ出力するときに、前記出力データ記憶領域に格納すべきデータを一時的に退避させる出力データ退避記憶手段と、該退避後に、出力データの同時性を保証できるタイミングとなったとき、割込み処理により、該出力データ退避記憶手段に退避されている出力データを、前記出力データ記憶領域に移す割込み処理手段とを備えるように構成する。 The CPU module in the second programmable controller of the present invention is a programmable module in which a CPU module and at least one or more input modules / output modules are connected to a bus, and data transmission / reception is performed on the bus in synchronization with a tact cycle. In the controller, the control processor for storing the output data to be passed to each output module in the output data storage area at an arbitrary timing, and the output data stored in the output data storage area in synchronization with the tact cycle The CPU module comprising a bus LSI for sending out on a bus, wherein the control processor outputs data to be stored in the output data storage area when outputting data at a timing at which simultaneity of output data cannot be guaranteed. Output data save memory that is temporarily saved And interrupt processing means for transferring the output data saved in the output data saving storage means to the output data storage area by interrupt processing when it is time to guarantee the output data simultaneity after the saving It comprises so that it may be provided.
上記構成のCPUモジュールによれば、もし出力データの同時性を保証できないタイミングでデータ出力を行うことになったときには、出力データ記憶領域へのデータ書き込みは行わず、一時的に出力データ退避記憶手段に書き込んでおくので、出力データの同時性を保証できる。 According to the CPU module configured as described above, if data output is to be performed at a timing at which the simultaneity of the output data cannot be guaranteed, the data is not written to the output data storage area, and the output data saving storage means is temporarily stored. Since data is written to the, the output data simultaneity can be guaranteed.
また、上記第2のプログラマブルコントローラにおけるCPUモジュールにおいて、例えば前記割込み処理手段は、前記出力データ退避記憶手段に退避されている出力データが存在するときに、前記制御用プロセッサが次のデータ出力を行なおうとする場合にも、前記割込み処理を実行するようにしてもよい。 Further, in the CPU module in the second programmable controller, for example, the interrupt processing means causes the control processor to output the next data when there is output data saved in the output data saving storage means. Also when it is going to be noted, the said interruption process may be performed.
このようにすることで、更に、データ出力順も保証できるようになる。 In this way, the data output order can be further guaranteed.
本発明のプログラマブルコントローラにおけるCPUモジュールによれば、タクト周期とは関係なく任意のタイミングでデータ入力/出力要求が行なわれても、入力データ/出力データの同時性を保証できるようになる。更に、出力順を保証できるようにすることもできる。これら効果は、制御アプリケーションを変更することなく、達成できる。 According to the CPU module of the programmable controller of the present invention, it is possible to guarantee the simultaneity of input data / output data even if a data input / output request is made at an arbitrary timing regardless of the cycle period. Furthermore, it is possible to guarantee the output order. These effects can be achieved without changing the control application.
以下、図面を参照して、本発明の実施の形態について説明する。
尚、本説明において“同時性”とは、複数の入出力データ(複数の入力モジュールからの入力データ、または複数の出力モジュールへの出力データ)を、全て同じタイミング(同一タクト周期内)で入力または出力することを意味する。
Embodiments of the present invention will be described below with reference to the drawings.
In this description, “simultaneous” means that multiple input / output data (input data from multiple input modules or output data to multiple output modules) are all input at the same timing (within the same tact cycle). Or it means output.
例えばI/Oモジュールに接続されている複数の機器の動作が互いに関連をもっている場合、制御アプリケーション11がこれら各機器に対して出力するデータ(よって、複数のデータとなる)を、各機器が同一タイミングで受け取って動作しないと、誤動作等が生じる可能性がある為、上記“同時性”を保つようにすることは重要となる。 For example, when the operations of a plurality of devices connected to the I / O module are related to each other, the data that the control application 11 outputs to each of these devices (thus becoming a plurality of data) is the same for each device. It is important to maintain the “simultaneity” because there is a possibility that a malfunction or the like may occur if the operation is not received at the timing.
図1は、本例によるプログラマブルコントローラのシステム構成図である。
同図に示すプログラマブルコントローラは、CPUモジュール1、入力モジュール50、出力モジュール60が、システムバス70に接続して成る構成となっている。尚、図では、各モジュールは1台ずつ示してあるが、これらは、各々、複数あってもよい。
FIG. 1 is a system configuration diagram of a programmable controller according to this example.
The programmable controller shown in the figure has a configuration in which a
CPUモジュール1は、制御用プロセッサ10、管理用プロセッサ20、共有メモリ30、バスLSI40を有する。
制御用プロセッサ10は、制御アプリケーション11、Iデータ管理ドライバ12、Oデータ管理ドライバ13、タイマ14、ハンドラ15を備える。制御アプリケーション11は、各入力モジュール50、出力モジュール60に対する入出力制御処理や、データの演算処理等を行う。Iデータ管理ドライバ12〜ハンドラ15については、後に説明する。
The
The control processor 10 includes a control application 11, an I
尚、Iデータとは、システムバス70を介して入力モジュール50から受け取る入力データ(例えば、制御対象機器の状態データ、センサ計測データ等)のことであり、Oデータとは、システムバス70を介して出力モジュール60に渡すべき出力データ(例えば制御対象機器の位置、回転数等の設定データ等)のことである。
The I data is input data received from the
管理用プロセッサ20は、Iデータ管理ドライバ21を備える。
共有メモリ30は、制御用プロセッサ10、管理用プロセッサ20、及びバスLSI40が、共有するメモリである。共有メモリ30は、IデータバンクA31、IデータバンクB32、最新データバンクレジスタ33、Oデータ領域34、Oデータ領域排他フラグ35、Iデータ領域36、Oデータ一時退避バッファ37等の各記憶領域を有する。
The management processor 20 includes an I data management driver 21.
The shared
上記各記憶領域の中でIデータバンクA31、IデータバンクB32、最新データバンクレジスタ33、及びIデータ領域36は、データ入力処理に関係する。
Iデータ領域36は、本来、各入力モジュール50から収集したIデータを、バスLSI40が書き込んで、これを制御用プロセッサ10が読み出す為の記憶領域であるが、本例では、後述するように、制御用プロセッサ10は、Iデータ領域36から直接データを読み出すことはしない。
Among the above storage areas, the I data bank A31, the I data bank B32, the latest
The
IデータバンクA31、IデータバンクB32は、ある瞬間の上記Iデータ領域36のデータのコピーを保持する。最新データバンクレジスタ33は、これら2つのIデータバンクA31、B32のうち、どちらが最新のIデータを保持しているのかを示すデータ(フラグでもよい)を保持するレジスタである。
The I data bank A31 and the I data bank B32 hold a copy of the data in the
これら2つのIデータバンクA31、B32へのデータコピーと、最新データバンクレジスタ33の更新は、Iデータ領域36のデータが更新されたタイミングで、管理用プロセッサ20のIデータ管理ドライバ21が行う。
The data copy to these two I data banks A31 and B32 and the update of the latest
また、上記制御用プロセッサ10のIデータ管理ドライバ12は、上記制御アプリケーション11から任意のときにIデータ取得要求を受ける毎に、最新データバンクレジスタ33が示すIデータバンク(A31またはB32)から、最新のIデータを読み出して制御アプリケーション11に渡す。
The I
一方、共有メモリ30における各記憶領域の中で、Oデータ領域34、Oデータ領域排他フラグ35、Oデータ一時退避バッファ37は、データ出力処理に関係する。
Oデータ領域34は、制御用プロセッサ10が、出力モジュール60に対してOデータ出力する際に、このOデータを書き込み、バスLSI40が読み出す為の記憶領域である。
On the other hand, in each storage area in the shared
The
Oデータ領域排他フラグ35は、Oデータ領域34へのアクセスに排他をとるために用いられる。
Oデータ一時退避バッファ37は、Oデータ領域34にOデータを書き込むことができないとき(例えば、Oデータ領域排他フラグ35がセットされているときや、タイマ14がカウントアップしているとき;詳しくは後述する)、このOデータを一時的に退避する為の、スタック構造(FIFO等)をもつバッファである(複数の要求が出力できない場合を考慮してFIFO構造となっている)。
The O data
The O data temporary save
尚、バスLSI40と各入力モジュール50/出力モジュール60間のデータ入出力処理自体については、基本的には従来と略同様である。つまり、「バスの転送速度に合わせて一定周期(タクト周期)で割込みを発生させる機能」と、「このタクト割込みに同期して、各“I/Oモジュール50、60”に対するデータの入出力処理を行う機能」とを備え、受信処理のときはトータルフレーム方式、送信処理のときはマルチキャスト方式で、システムバス70上でのデータ転送を行っている。よって、これらバスLSI40、入力モジュール50、出力モジュール60の詳細な構成、機能については特に図示/説明しないものとする。
Note that the data input / output processing itself between the
以下、まず、図2、図3を参照して、上記プログラマブルコントローラのCPUモジュール1におけるデータ入力処理について説明する。
図2において、まず、バスLSI40は、タクト周期毎に、各入力モジュール50のIデータを、システムバス70を介して受け取ると、このIデータをIデータ領域36に書き込む(1)。そして、管理用プロセッサ20に対してタクト割込みを発生させる(2)。
Hereinafter, first, data input processing in the
In FIG. 2, first, when the
管理用プロセッサ20のIデータ管理ドライバ21は、このタクト割込みを受けると、Iデータ領域36に格納されているIデータを読み出し(3)、これをIデータバンクA31、IデータバンクB32の何れか一方(前回、書き込んでいない方)に書き込むと共に(4)、最新データバンクレジスタ33を更新する(5)。
When receiving the tact interrupt, the I data management driver 21 of the management processor 20 reads the I data stored in the I data area 36 (3), and reads it out of either the I data bank A31 or the I data bank B32. On the other hand, the latest
Iデータ管理ドライバ12は、制御アプリケーション11からIデータ取得要求を受けると、最新データバンクレジスタ33が示すIデータバンク(A31またはB32)からIデータを読み込んできて、制御アプリケーション11に渡す。
Upon receiving an I data acquisition request from the control application 11, the I
以上のようにすることで、もし、この読み込み処理の最中にバスLSI40によってIデータ領域36のデータが更新されることになっても、問題ないことになる。すなわち、図3に示すように、図9の場合と同様にタクト割り込み寸前で制御アプリケーション11からIデータ取得要求があった場合でも、データ読み出し処理中に、タクト割り込みによりIデータ領域36のデータは書き換えられるが、IデータバンクB32のデータ(b)は変わらないので、問題なく読み込みを行うことができる。すなわち、同時性を保つことができる(制御アプリケーションを変更することなく)。
By doing so, there is no problem if the data in the
次に、以下、図4〜図6を参照して、図1のプログラマブルコントローラのCPUモジュール1におけるデータ出力処理について説明する。
図4において、Oデータ管理ドライバ13は、任意のときに制御アプリケーション11からOデータ出力要求を受けると、まず、Oデータ領域排他フラグ35とタイマ14を参照し、排他フラグ35がリセット(OFF)で且つタイマ14がカウントアップしていない場合には、Oデータ領域34にデータを書き込む。
Next, data output processing in the
In FIG. 4, when the O
一方、排他フラグ35がセット(ON)されているか、またはタイマ14がカウントアップしている場合には、このタイミングではOデータ領域34にはデータを書き込めないと判断し、このデータをOデータ一時退避バッファ37に書き込むと共に、割込みマスク(不図示)を解除する。
On the other hand, if the
排他フラグ35は、バスLSI40が、タクト周期毎に、Oデータ領域34のデータをシステムバス70上に送出する処理の開始時にセットし、終了時にリセットする。よって、排他フラグ35がセットされているときにOデータ領域34のデータを書き替えるのは問題があることになる。
The
割込みマスクは、通常時には、ハンドラ15による割込みが立ち上がらないようにマスクしているが、Oデータ一時退避バッファ37にデータが退避されたときのみマスク解除することで、ハンドラ15による割込みが立ち上がるようにしている。これより、ハンドラ15は、その割込み処理起動タイミング(タイマ14がカウントアップしたとき)でマスク解除されている場合には、Oデータ一時退避バッファ37に一時的に格納されたデータをOデータ領域34に移す割込み処理を実行する。尚、ハンドラ15による割込みのタイミングは、ここでは、タイマ14がカウントアップしたときとしているが、これに限るわけではない。
The interrupt mask is normally masked so that the interrupt by the handler 15 does not rise. However, the mask is released only when the data is saved in the O data temporary save
そして、バスLSI40が、次のタクト割込みタイミングで、Oデータ領域34からデータを読み出して、これをシステムバス70上に送出し、各出力モジュール60が受け取る。
Then, the
以上の処理により、データ出力処理において同時性が保てるようになる理由について、図5を参照して説明する。
図5は、本例によるデータ出力処理タイミングの一例を示す図である。
The reason why simultaneity can be maintained in the data output processing by the above processing will be described with reference to FIG.
FIG. 5 is a diagram illustrating an example of data output processing timing according to the present example.
図示の例では、図8(b)と同様に制御アプリケーション11からOデータ出力要求のタイミングが、Oデータ領域書き換え中にタクト割込みタイミングとなってしまう場合を例にしている。 In the illustrated example, as in FIG. 8B, the case where the timing of the O data output request from the control application 11 becomes the tact interrupt timing during the O data area rewriting is taken as an example.
図5において、制御アプリケーション11からOデータ出力要求が出されたタイミングでは、Oデータ領域排他フラグ35はリセットされているが、タイマ14はカウントアップしている為、Oデータ管理ドライバ13は、この出力データ(ここではデータbとする)をOデータ領域34には書き込まずに、Oデータ一時退避バッファ37に一時的に格納すると共に、割込みマスクを解除する。尚、図では、次のタクト割込みタイミングt1 を過ぎてからOデータ一時退避バッファ37への書き込みが行われているかのように見えるかもしれないが、これは単にタイムラグを表現しているだけである。Oデータ一時退避バッファ37への書き込み処理途中でタクト割込みタイミングとなってしまっても、何ら問題はない。
In FIG. 5, at the timing when the O data output request is issued from the control application 11, the O data
そして、割込みマスクが解除された状態でハンドラ15の割込み動作タイミングとなると(この例ではタイマ14がカウントアップしたとき)、ハンドラ15はOデータ一時退避バッファ37に格納されているデータを、Oデータ領域34に移す。そして、割込みマスクをセットする。
Then, when the interrupt operation timing of the handler 15 is reached with the interrupt mask released (when the
ここで、タイマ14は、(タクト割込み周期)−(最大出力点数処理時間)でカウントアップするように設定されている(最大出力点数処理時間;制御アプリケーション11から、出力最大点数の出力データ書き込み要求を受けたときに(つまり、システムバス70に接続されている全ての出力モジュールに対してデータ出力する場合)、Oデータ領域34へのデータ書き込みに掛かる時間)。
Here, the
これにより、タイマ14がカウントアップしてから次のタクト割込みタイミング(t2 )までに“最大出力点数処理時間”が確保されるので、ハンドラ15によるOデータ領域34へのデータ書き込み処理は、必ず、タイミングt2 より前に完了することになる。
As a result, the “maximum output point processing time” is ensured between the
これより、次のタクト割込みタイミング(t2 )で、バスLSI40は、データ書き込み処理が完了しているOデータ領域34から、データ読み出して、各出力モジュール60に配信することができるので、データ出力処理において同時性が保てることになる(制御アプリケーションを変更することなく)。
Thus, at the next tact interrupt timing (t2), the
ここで、図5に示す例において、タイミングt1 とt2 との間において、バスLSI40によるデータ配信処理が完了した時点(図上、Oデータ領域排他フラグ35がリセットされた時点)から、タイマ14がカウントアップするまでの間は、上記の通り、Oデータ管理ドライバ13は、制御アプリケーション11からOデータ出力要求を受けると、Oデータ領域34にデータを書き込む処理を行うことになる。この為、後から出力要求を受けたデータ(データcとする)の方が先にOデータ領域34に書き込まれ、次にハンドラ15によりOデータ一時退避バッファ37のデータ(上記データb)がOデータ領域34に書き込まれる(同一タクト周期内で2度書き込みが行われる場合は、書き換えにはならず、追加の形となる)。このような場合、バスLSI40によるデータ配信処理において、Oデータの出力順番が逆になってしまう。
Here, in the example shown in FIG. 5, the
図6は、このような場合でも正常な出力順を保証できるようにする方法について説明する為の図である。
図6において、図4、図5と異なる点は、ハンドラ15による割込み処理の発生条件を、上記の条件に加えて、“割込みマスクが解除されているときに、制御アプリケーション11からの出力要求があった場合”とした点である。
FIG. 6 is a diagram for explaining a method for ensuring a normal output order even in such a case.
6 is different from FIG. 4 and FIG. 5 in that the generation condition of the interrupt processing by the handler 15 is added to the above-described condition, and “when the interrupt mask is released, the output request from the control application 11 is This is the point that “if there was”.
これより、例えば図6に示すタイミングで制御アプリケーション11からデータcの出力要求を受けると、ハンドラ15による割込み処理の発生し、Oデータ一時退避バッファ37のデータ(上記データb)により、Oデータ領域34のデータが書き換えられる。そして、割込みマスクがセットされる(これにより、タイマ14がカウントアップしたときに再びハンドラ15による割込み処理が発生するようなことはない)。
Thus, for example, when an output request for data c is received from the control application 11 at the timing shown in FIG. 6, an interrupt process is generated by the handler 15, and the data in the O data temporary save buffer 37 (the data b above) 34 data is rewritten. Then, an interrupt mask is set (thus, when the
ハンドラ15による割込み処理が終了すると、Oデータ管理ドライバ13が、上記データcをOデータ領域34に書き込む。上記の通り、この様な場合は“書き換え”にはならないので、Oデータ領域34に格納されるデータは、「b+c」となる。図4、図5の場合は、「c+b」となってしまい、順番が逆になってしまったが、本例では正常な出力順を保証できる。
When the interrupt processing by the handler 15 ends, the O
1 CPUモジュール
10 制御用プロセッサ
11 制御アプリケーション
12 Iデータ管理ドライバ
13 Oデータ管理ドライバ
14 タイマ
15 ハンドラ
20 管理用プロセッサ
21 Iデータ管理ドライバ
30 共有メモリ
31 Iデータバンク
32 Iデータバンク
33 最新データバンクレジスタ
34 Oデータ領域
35 Oデータ領域排他フラグ
36 Iデータ領域
37 Oデータ一時退避バッファ
40 バスLSI
50 入力モジュール
60 出力モジュール
70 システムバス
1 CPU module 10 control processor 11 control application 12 I data management driver 13 O
50
Claims (3)
第1の記憶手段、第2の記憶手段と、
前記入力データ記憶領域に入力データが格納される毎に、該入力データを前記第1の記憶手段、第2の記憶手段の何れか一方に交互に移す管理手段とを備え、
前記制御用プロセッサは、前記入力データの読み出しを、該第1の記憶手段、第2の記憶手段の何れか一方から行うことを特徴とするプログラマブルコントローラにおけるCPUモジュール。 In a programmable controller in which a CPU module and at least one or more input modules / output modules are connected to a bus and data transmission / reception is performed on the bus in synchronization with the tact cycle, the CPU module is synchronized with the tact cycle via the bus. The CPU module includes a bus LSI that stores input data from each input module to be received in the input data storage area, and a control processor that reads the input data stored in the input data storage area at an arbitrary timing. And
First storage means, second storage means;
A management means for alternately transferring the input data to either the first storage means or the second storage means each time input data is stored in the input data storage area;
A CPU module in a programmable controller, wherein the control processor reads the input data from one of the first storage means and the second storage means.
前記制御用プロセッサが、出力データの同時性を保証できないタイミングでデータ出力するときに、前記出力データ記憶領域に格納すべきデータを一時的に退避させる出力データ退避記憶手段と、
該退避後に、出力データの同時性を保証できるタイミングとなったとき、割込み処理により、該出力データ退避記憶手段に退避されている出力データを、前記出力データ記憶領域に移す割込み処理手段と、
を備えることを特徴とするプログラマブルコントローラにおけるCPUモジュール。 In a programmable controller in which a CPU module and at least one or more input modules / output modules are connected to a bus and data transmission / reception is performed on the bus in synchronism with the tact cycle, output data to be passed to each output module is arbitrarily selected The CPU module comprises: a control processor for storing the output data in the output data storage area; and a bus LSI for sending the output data stored in the output data storage area onto the bus in synchronization with the tact cycle. And
Output data saving storage means for temporarily saving data to be stored in the output data storage area when the control processor outputs data at a timing at which simultaneity of output data cannot be guaranteed;
An interrupt processing means for transferring the output data saved in the output data saving storage means to the output data storage area by an interruption process when it is time to guarantee the simultaneity of the output data after the saving;
A CPU module in a programmable controller, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006071630A JP2007249560A (en) | 2006-03-15 | 2006-03-15 | Cpu module in programmable controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006071630A JP2007249560A (en) | 2006-03-15 | 2006-03-15 | Cpu module in programmable controller |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007249560A true JP2007249560A (en) | 2007-09-27 |
Family
ID=38593791
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006071630A Withdrawn JP2007249560A (en) | 2006-03-15 | 2006-03-15 | Cpu module in programmable controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007249560A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013187191A1 (en) * | 2012-06-14 | 2013-12-19 | 三菱電機株式会社 | I/o device, programmable logic controller and calculation method |
JP6419400B1 (en) * | 2018-01-18 | 2018-11-07 | 三菱電機株式会社 | PLC, network unit, CPU unit, and data transfer method |
-
2006
- 2006-03-15 JP JP2006071630A patent/JP2007249560A/en not_active Withdrawn
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013187191A1 (en) * | 2012-06-14 | 2013-12-19 | 三菱電機株式会社 | I/o device, programmable logic controller and calculation method |
JP6419400B1 (en) * | 2018-01-18 | 2018-11-07 | 三菱電機株式会社 | PLC, network unit, CPU unit, and data transfer method |
WO2019142288A1 (en) * | 2018-01-18 | 2019-07-25 | 三菱電機株式会社 | Plc, network unit, cpu unit, and data transmission method |
KR20190089155A (en) * | 2018-01-18 | 2019-07-30 | 미쓰비시덴키 가부시키가이샤 | PLC, network unit, CPU unit, and data transmission method |
KR102016629B1 (en) | 2018-01-18 | 2019-08-30 | 미쓰비시덴키 가부시키가이샤 | PLC, network unit, CPU unit, and data transfer method |
CN110278716A (en) * | 2018-01-18 | 2019-09-24 | 三菱电机株式会社 | PLC, network unit, CPU element and data transferring method |
US10656615B2 (en) | 2018-01-18 | 2020-05-19 | Mitsubishi Electric Corporation | PLC, network unit, CPU, and data transfer method |
CN110278716B (en) * | 2018-01-18 | 2020-10-27 | 三菱电机株式会社 | PLC, network unit, CPU unit, and data transfer method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5933347A (en) | Industrial controller with program synchronized updating of back-up controller | |
US20060236208A1 (en) | Soft error correction method, memory control apparatus and memory system | |
CN100430886C (en) | Data processing in which concurrently executed processes communicate via a FIFO buffer | |
US8364291B2 (en) | Method and apparatus for providing redundancy in an industrial control system | |
US8086766B2 (en) | Support for non-locking parallel reception of packets belonging to a single memory reception FIFO | |
JP2016110458A (en) | Programmable logic controller, basic unit, control method and program | |
JP5469066B2 (en) | Method and system for exchanging data | |
CN102236623A (en) | Signal control device and signal control method | |
CN107315449B (en) | Computer device, method for reading time and method for writing time | |
JP2007034392A (en) | Information processor and data processing method | |
CN100470524C (en) | Small-capacity FIFO storage device data-moving trigger and method | |
JP2007249560A (en) | Cpu module in programmable controller | |
US10505704B1 (en) | Data uploading to asynchronous circuitry using circular buffer control | |
JP6419400B1 (en) | PLC, network unit, CPU unit, and data transfer method | |
Puschner et al. | Asynchronous vs. synchronous interfacing to time-triggered communication systems | |
JPWO2004046926A1 (en) | Event notification method, device, and processor system | |
JP2016206891A (en) | Access interruption circuit, semiconductor integrated circuit, and access interruption method | |
KR100606163B1 (en) | Direct memory access device, system and method for transmitting and receiving data through direct memory access device | |
JP2006236371A (en) | Control system | |
JP2007018440A (en) | Architecture verification apparatus | |
JP6204313B2 (en) | Electronics | |
JP2923869B2 (en) | Event input circuit | |
JP2007128413A (en) | Programmable controller | |
JP5387155B2 (en) | DMA transfer control device and DMA transfer control method | |
JP2020135787A (en) | Transfer control device, information processing device and machine tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20090602 |