JP2006079480A - Method for synchronizing modular programmable controller and programmable controller - Google Patents
Method for synchronizing modular programmable controller and programmable controller Download PDFInfo
- Publication number
- JP2006079480A JP2006079480A JP2004264772A JP2004264772A JP2006079480A JP 2006079480 A JP2006079480 A JP 2006079480A JP 2004264772 A JP2004264772 A JP 2004264772A JP 2004264772 A JP2004264772 A JP 2004264772A JP 2006079480 A JP2006079480 A JP 2006079480A
- Authority
- JP
- Japan
- Prior art keywords
- module
- data
- option
- control device
- plc
- 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
Links
Images
Landscapes
- Programmable Controllers (AREA)
Abstract
【課題】 オプションモジュールの実装枚数に制限を加えることなく、コントローラと制御機器間のデータの受け渡しを確実に行うことができ、オプションモジュールのデータ更新周期をPLCモジュールのサンプリング周期と異なる値に設定できるモジュール型のプログラマブルコントローラを提供する。
【解決手段】 PLCモジュールは第1の割込信号と、オプションモジュールに出力する第2の割込信号を発生させる手段とを有し、第1の割込信号が入力されると、第2の割込信号を発生させる手段を起動し、データ格納完了信号がセットされるとユーザプログラムを実行し、オプションモジュールは第3の割込信号を生成する手段を有し、第2の割込信号が入力されると、データ格納後、データ格納完了信号をセットし、第3の割込信号を生成する手段を起動し、第3の割込信号が入力されると制御機器にデータを出力するものである。
【選択図】図1PROBLEM TO BE SOLVED: To reliably transfer data between a controller and a control device without limiting the number of mounted optional modules, and to set a data update cycle of the option module to a value different from the sampling cycle of the PLC module. A modular programmable controller is provided.
The PLC module has a first interrupt signal and a means for generating a second interrupt signal to be output to the option module. When the first interrupt signal is input, The means for generating the interrupt signal is activated, and when the data storage completion signal is set, the user program is executed. The option module has means for generating the third interrupt signal, and the second interrupt signal is When input, after data storage, sets data storage completion signal, activates means to generate third interrupt signal, and outputs data to control device when third interrupt signal is input It is.
[Selection] Figure 1
Description
本発明は、モジュール型のプログラマブルコントローラ(PLC装置)に関する。 The present invention relates to a modular programmable controller (PLC device).
従来のモジュール型のPLC装置について、図を用いて説明する。図5は、一般のモジュール型PLC装置の概略構成図である。図において、モジュール型のPLC装置5は、PLCモジュール2とオプションモジュール3から構成されている。1はプログラム入力装置であり、ユーザはプログラム入力装置1を使用してユーザプログラムを作成する。2はPLCモジュールであり、ユーザプログラムにしたがい、オプションモジュール3との間で入出力データをバスを通して授受する。データの授受を行うタイミング(以下、サンプリング周期と呼ぶ)は、一般にPLCモジュール2に搭載された水晶発振子からのクロックを元にして作成される。3はオプションモジュールであり、動作の異なる複数種の中から任意のモジュールを複数枚実装できる。オプションモジュール3のなかには制御データを一定の更新周期で入出力を行うことにより、複数の制御機器を制御する種類も含まれる。この場合、サンプリング周期はオプションモジュール3に搭載された更新周期発生回路からの信号を元にして作成される。このように、サンプリング周期の作成方法には2種類ある。以下、サンプリング周期の作成方法について説明する。
A conventional modular PLC device will be described with reference to the drawings. FIG. 5 is a schematic configuration diagram of a general modular PLC device. In the figure, the module type PLC device 5 includes a
まず、PLCモジュール2に搭載された水晶発振子からのクロックを元にサンプリング周期を作成する場合のモジュール型のPLC装置の内部構成を図6に示す。図6において、2はPLCモジュールであり、一般に、外部の信号を取り込むための入力部20と、外部へ信号を出力するための出力部21と、データメモリ部22と、ユーザプログラムを記憶しているプログラムメモリ部24と、水晶発振子25と、水晶発振子25からのクロック信号で動作し、プログラムメモリ部24に格納された制御プログラムに従って演算するCPU23と、水晶発振子25からのクロック信号を元にユーザが設定したサンプリング周期を作成し、割込信号S14をCPU23へ入力するサンプリング周期発生回路26から構成される。CPU23は、割込信号S14が入力されると、割込信号S20を発生させ、オプションモジュール3との間でデータS11の授受を行う。3はオプションモジュールであり、PLCモジュール2がセットしたデータS11を自モジュール内に格納するためのメモリ35と、PLCモジュール2からのデータS11を格納するための共有メモリ30と、水晶発振子34と、水晶発振子34で動作するCPU31と、制御機器とのデータ授受をリアルタイムで行うためのデータ入出力部32から構成される。PLCモジュール2とオプションモジュール3との間の同期は、割込信号S20によって保たれる。
First, FIG. 6 shows an internal configuration of a module-type PLC device when a sampling period is created based on a clock from a crystal oscillator mounted on the
次に、オプションモジュール3に搭載された更新周期発生回路40からの信号を元にサンプリング周期を作成する場合のモジュール型のPLC装置の内部構成を図7に示す。このPLC装置は図6のPLC装置と異なり、データを入出力する周期は更新周期発生回路40により作成される。PLCモジュール2と制御機器4との間でデータの整合性をとるために、更新周期発生回路40からの割込信号S30をオプションモジュール3のCPU31とPLCモジュール2のサンプリング周期発生回路26に同時に入力する。PLCモジュール2は、自モジュール内の水晶発振子からの信号を使うことなくオプションモジュール3の更新周期発生回路40からの割込信号S30を使用してサンプリング周期を作成する。このようなモジュール型のPLC装置においては、PLCモジュールとオプションモジュールは、それぞれCPUを搭載し、そのCPUは一般に別々の発振器(水晶発振子)からのクロックで動作する。図7に示したようなオプションモジュール3では、PLCモジュール2からのデータはPLCモジュール2のサンプリング周期で確実に制御機器まで受け渡すことができる。
なお、以上説明した従来技術は特許文献1に記載されている。
The conventional technology described above is described in Patent Document 1.
一方、図7に示したようなオプションモジュール3と図6に示したPLCモジュール2とで構成されるPLC装置では、たとえ同じサンプリング周期を設定しても、PLCモジュール2とオプションモジュール3のサンプリング周期は微妙にずれてくる。そのため、PLCモジュール2からのデータをオプションモジュール3が受け取れないタイミングが生じ、PLCモジュール2からの時々刻々のデータをオプションモジュール3を介して制御機器4まで確実に受け渡すことができない。
On the other hand, in the PLC device constituted by the
この問題を図8のタイミングチャートを用いて説明する。図8において、D1〜D6はPLCモジュール2が時々刻々払い出すデータを示している。この例では、オプションモジュール3および制御機器4のデータ更新周期を2ms、PLCモジュール2のサンプリング周期を2msとしている。クロックに使用する水晶発振子の精度は、一般に100ppm程度であるため、PLCモジュール2で使用している水晶発振子25とオプションモジュール3で使用している水晶発振子34の誤差は最大200ppmである。よって、1/5000の誤差となる。2msでは、2ms±0.4μsとなり、10秒で1回分(2ms)周期が多いか少なくなる。図8は、PLCモジュール2で使用している水晶発振子25がオプションモジュール3で使用している水晶発振子34よりα分遅いと仮定したときの各モジュールの周期を表したものである。図8において、PLCモジュール2のサンプリング周期とオプションモジュール3のデータ更新周期が時刻A、時刻Bと徐々にずれていき、時刻Cでオプションモジュール3のデータ更新周期がPLCモジュール2のサンプリング周期を抜き、その結果、データD6が払い出せずデータを抜かす。時刻Cでは、本来はデータD6が制御機器4に渡されなければならないが、時刻Bと同じデータD5が制御機器4に渡されてしまう。すなわち、制御機器4に本来渡すデータは、D1→D2→D3→D4→D5→D6→・・・・・・であるのに対して、実際に制御機器4に渡されるデータは、D1→D2→D3→D4→D5→D5→D6→・・・・・・となる。
これを防ぐために、従来は図7に示したPLCモジュール2を用いて、PLCモジュール2とオプションモジュール3のサンプリング周期がずれないようにしていた。
This problem will be described with reference to the timing chart of FIG. In FIG. 8, D 1 to D 6 indicate data that the
In order to prevent this, conventionally, the
しかしながら、図7に示したPLCモジュール2の場合、図7に示した機能を持つオプションモジュール3が必ず実装されなければならないが、1枚しか搭載できないといった問題があった。また、図6に示したPLC装置では、PLCモジュール2とオプションモジュール3のサンプリング周期を同じ値にしか設定できず、PLCモジュール2のサンプリング周期を長い値に設定する場合は、オプションモジュール3のサンプリング周期も長い値に設定する必要があり、オプションモジュールと制御機器のデータの入出力を行うデータ更新周期が長くなり、一般に制御精度が低下するといった問題があった。
However, in the case of the
そこで本発明の目的は、オプションモジュールの実装枚数に制限を加えることなく、PLCモジュールと制御機器との間のデータの受け渡しを確実に行うことができ、また、オプションモジュールのデータ更新周期をPLCモジュールのサンプリング周期と異なる値に設定できるモジュール型のプログラマブルコントローラの同期方法およびプログラマブルコントローラを提供することを目的とする。 Accordingly, an object of the present invention is to reliably transfer data between the PLC module and the control device without restricting the number of mounted optional modules, and to set the data update cycle of the optional module to the PLC module. It is an object of the present invention to provide a method for synchronizing a modular programmable controller and a programmable controller that can be set to a value different from the sampling period.
上記問題を解決するため、本発明は、次のように構成したのである。
請求項1に記載の発明は、プログラマブルコントローラとしての機能を有するPLCモジュールと、制御機器とデータの入出力を行う機能を有するオプションモジュールと、を備え、前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラの同期方法において、前記PLCモジュールのCPUに第1の割込信号が入力されたとき、前記PLCモジュールは第2の割込信号を発生する手段を起動し、前記PLCモジュールからの前記第2の割込信号が前記オプションモジュールに入力されたとき、前記オプションモジュールが前記PLCモジュールのデータを格納し、データ格納完了信号を前記PLCモジュールに出力し、前記オプションモジュールと制御機器との間でデータの入出力処理を行う第3の割込信号を生成する手段を起動し、前記第3の割込信号が前記オプションモジュールのCPUに入力されたとき、前記オプションモジュールは制御機器に出力するデータを算出して、データを制御機器に出力し、前記PLCモジュールは同PLCモジュールのデータをオプションモジュールが取り込むまでは、ユーザプログラムを実行せず待機状態を保持し、前記オプションモジュールからのデータ格納完了信号により、ユーザプログラムを前記PLCモジュールが実行することにより、前記PLCモジュールと前記オプションモジュールの同期をとることを特徴とするものである。
In order to solve the above problem, the present invention is configured as follows.
The invention described in claim 1 includes a PLC module having a function as a programmable controller and an option module having a function of inputting / outputting data to / from a control device, and the option module and the control device are provided with the option. In a synchronization method of a module-type programmable controller having a function of inputting and outputting data at a constant cycle so that data from the module can be surely passed to the control device, a first interrupt signal is sent to the CPU of the PLC module Is input, the PLC module activates a means for generating a second interrupt signal. When the second interrupt signal from the PLC module is input to the option module, the option module Stores data of the PLC module and stores data A completion signal is output to the PLC module, and a means for generating a third interrupt signal for performing data input / output processing between the option module and the control device is activated, and the third interrupt signal is When input to the CPU of the option module, the option module calculates data to be output to the control device, and outputs the data to the control device. Until the option module takes in the data of the PLC module, A standby state is maintained without executing a user program, and the PLC module and the option module are synchronized by the PLC module executing the user program in response to a data storage completion signal from the option module. To do.
また、請求項2に記載の発明は、プログラマブルコントローラとしての機能を有するPLCモジュールと、制御機器とデータの入出力を行う機能を有するオプションモジュールと、前記PLCモジュールと前記オプションモジュールとの間でデータのやり取りを行う共有メモリと、を備え、前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラにおいて、前記PLCモジュールは第1の割込信号と第2の割込信号とを発生する手段を有し、前記PLCモジュールは第1の割込信号が入力されると、外部機器との入出力を行い、入出力が完了したときに前記第2の割込信号を発生する手段を起動した後、前記オプションモジュールのデータ格納完了信号待ちとなり、前記オプションモジュールからデータ格納完了信号が前記共有メモリにセットされると、ユーザプログラムを実行し、前記オプションモジュールは第3の割込信号を生成する手段を有し、前記第2の割込信号が入力されると、前記PLCモジュールが該共有メモリにセットしたデータをメモリに格納し、格納が完了すると、データ格納完了信号を前記共有メモリにセットし、前記第3の割込信号を生成する手段を起動し、前記第3の割込信号が入力されると、制御機器に出力するデータを作成し、制御機器に出力することを特徴とするものである。
The invention described in
また、請求項3に記載の発明は、プログラマブルコントローラとしての機能を有するPLCモジュールと、制御機器とデータの入出力を行う機能を有するオプションモジュールと、を備え、前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラの同期方法において、前記PLCモジュールのCPUに第1の割込信号が入力されて前記PLCモジュールからのデータ格納指令が前記オプションモジュールに入力されたとき、前記オプションモジュールが前記PLCモジュールのデータを格納し、データ格納完了信号を前記PLCモジュールに出力し、前記オプションモジュールと制御機器との間でデータの入出力処理を行う第2の割込信号を生成する手段を起動し、前記第2の割込信号が前記オプションモジュールのCPUに入力されたとき、前記オプションモジュールは制御機器に出力するデータを算出して、データを制御機器に出力し、前記PLCモジュールは同PLCモジュールのデータをオプションモジュールが取り込むまでは、ユーザプログラムを実行せず待機状態を保持し、前記オプションモジュールからのデータ格納完了信号により、ユーザプログラムを前記PLCモジュールが実行することにより、前記PLCモジュールと前記オプションモジュールの同期をとることを特徴とするものである。
The invention according to
また、請求項4に記載の発明は、プログラマブルコントローラとしての機能を有するPLCモジュールと、制御機器とデータの入出力を行う機能を有するオプションモジュールと、前記PLCモジュールと前記オプションモジュールとの間でデータのやり取りを行う共有メモリと、を備え、前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラにおいて、前記PLCモジュールは、第1の割込信号とこれと同じタイミングで同期信号を発生する手段を有し、前記PLCモジュールは、第1の割込信号が入力されると、外部機器との入出力を行い、入出力が完了したときにデータ格納指令を前記オプションモジュールの共有メモリにセットした後、前記オプションモジュールのデータ格納完了信号待ちとなり、前記オプションモジュールからデータ格納完了信号が前記共有メモリにセットされると、ユーザプログラムを実行し、前記オプションモジュールは、第2の割込信号を生成する手段を有し、前記同期信号が入力されると、データ格納指令待ちとなり、前記PLCモジュールからのデータ格納指令が前記共有メモリにセットされると、前記PLCモジュールが該共有メモリにセットしたデータをメモリに格納し、格納が完了すると、データ格納完了信号を前記共有メモリにセットし、前記第2の割込信号を生成する手段を起動し、第2の割込信号が入力されると、制御機器に出力するデータを作成し、制御機器に出力することを特徴とするものである。 According to a fourth aspect of the present invention, there is provided a PLC module having a function as a programmable controller, an option module having a function of inputting / outputting data to / from a control device, and data between the PLC module and the option module. A shared memory for exchanging data, and having a function of inputting / outputting data at regular intervals between the option module and the control device so that the data from the option module can be surely passed to the control device In the module-type programmable controller, the PLC module has a first interrupt signal and means for generating a synchronization signal at the same timing, and the PLC module receives the first interrupt signal. Input / output to / from an external device and After the data storage command is set in the shared memory of the option module, the data storage completion signal of the option module is waited, and when the data storage completion signal is set in the shared memory from the option module, the user program is executed, The option module has means for generating a second interrupt signal. When the synchronization signal is input, the option module waits for a data storage command, and the data storage command from the PLC module is set in the shared memory. The PLC module stores the data set in the shared memory in the memory, and when the storage is completed, sets the data storage completion signal in the shared memory and activates the means for generating the second interrupt signal. When the second interrupt signal is input, data to be output to the control device is created, and the controller It is characterized in that output.
請求項1または請求項3に記載の発明によると、オプションモジュールの実装枚数に制限を加えることなく、PLCモジュールと制御機器との間のデータの受け渡しを確実に行うことができ、また、オプションモジュールのデータ更新周期をPLCモジュールのサンプリング周期と異なる値に設定できるので、PLCモジュールのサンプリング周期を長い値に設定してもオプションモジュールのデータ更新周期をPLCモジュールのサンプリング周期のn分の1に設定でき、制御精度の低下を防止することができる。
According to the invention described in claim 1 or
また、請求項2または請求項4に記載の発明によると、1枚のオプションモジュールで接続可能な制御機器を超える多数の制御機器を接続する場合でも、必要枚数分のオプションモジュールを追加し、PLCモジュールに同期させることで、PLCモジュールが払い出すデータを、複数のオプションモジュールを介して確実に制御機器まで渡すことができ、複数のオプションモジュールを使用したモジュール型のPLC装置で同期制御を行うことができる。また、データを生成するPLCモジュールはプログラマブルであるため、任意のデータパターン(データの集まり)を生成することができるので、制御機器で構成される機械の動作に柔軟に対応でき、その結果、高性能、高機能な機械をPLC装置で構成することができる。
According to the invention described in
以下、本発明の実施の形態について図を参照して説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図1は、本発明のモジュール型のPLC装置の内部構成図である。図1において、2はPLCモジュールであり、プログラマブルコントローラとしての機能を有しており、外部の信号を取り込むための入力部20と、外部へ信号を出力するための出力部21と、データメモリ部22と、ユーザプログラムを記憶しているプログラムメモリ部24と、水晶発振子25と、水晶発振子25からのクロック信号で動作し、プログラムメモリ部に格納された制御プログラムにしたがって演算するCPU23と、ソフトウェアまたはハードウェアで設定された周期にしたがって、割込信号S14を出力するサンプリング周期発生回路26から構成される。サンプリング周期発生回路26の出力信号である割込信号S14がCPU23に入力されたときに、CPU23はプログラマブルコントローラの入力、出力および演算を実行する。また、データの入出力が完了したときに、オプションモジュール3に対し割込信号S20を出力する。3はオプションモジュールであり、PLCモジュール2がセットしたデータを自モジュール内に格納するためのメモリ35と、PLCモジュール2からのデータS11をメモリ35に格納したときにPLCモジュール2にデータS11の取り込みが完了したことを知らせるデータ格納完了信号S12を格納するための共有メモリ30と、水晶発振子34と、水晶発振子34で動作するCPU31と、制御機器との間でデータの入出力を行うためのデータ入出力部32と、オプションモジュール3と制御機器間のデータ更新周期を生成する更新周期発生回路40から構成される。更新周期発生回路40からの出力が割込信号S30として、オプションモジュール3のCPU31に入力される。PLCモジュール2からの出力信号である割込信号S20がCPU31に入力されると同期割込処理が実行され、その同期割込処理から出力された起動信号S16により更新周期発生回路40が起動され、更新周期発生回路40は起動された時点から水晶発振子34からのクロックを元に定周期に信号を生成し出力する。すなわち、更新周期発生回路40は同期割込処理から起動信号S16により起動され、割込信号S30を出力すると同時に、水晶発振子34からのクロックの計測を開始し、予め設定された周期に達すると割込信号S30を出力すると同時に、水晶発振子34からのクロックの計測を開始する。この動作を繰り返し行うことで定周期に信号を生成する。また、更新周期発生回路40からの出力である割込信号S30がCPU31に入力されると、制御機器との間でデータの入出力を行うデータ更新割込処理を実行する。
FIG. 1 is an internal configuration diagram of a modular PLC device according to the present invention. In FIG. 1,
本発明が従来技術と異なる部分は、更新周期発生回路40を起動する起動信号S16と、データ格納完了信号S12を備えた部分である。
The present invention is different from the prior art in that it includes a start signal S16 for starting the update
図2は、モジュール型PLC装置におけるPLCモジュールとオプションモジュールのソフトウェアの動作説明図であり、PLCモジュール2のサンプリング周期発生回路26から割込信号S14が入力されたときのPLCモジュール2のソフトウェアの動作、およびPLCモジュール2のCPU23から割込信号S20が入力されたときのオプションモジュール3のソフトウェアの動作を説明したものである。図2において、割込信号S14がPLCモジュール2のCPU23に入力されると、PLCモジュール2はまず、外部機器との入出力を行い(ステート10a)、入出力が完了したときに割込信号S20をオプションモジュール3に出力し(ステート11a)、オプションモジュール3からのデータ格納完了信号S12待ちとなる(ステート12a)。オプションモジュール3からデータ格納完了信号S12が共有メモリ30にセットされると、プログラムメモリ部24に格納されたユーザプログラムが実行され、そのユーザプログラムの中で時々刻々のデータが共有メモリ30にセットされる(ステート13a)。
FIG. 2 is a diagram for explaining the operation of the software of the PLC module and the option module in the modular PLC device. The operation of the software of the
一方、オプションモジュール3は、割込信号S20がオプションモジュール3のCPU31に入力されると、同期割込処理がCPU31により実行される。同期割込処理の処理内容は、まずPLCモジュール2が共有メモリ30にセットしたデータを自モジュール内のメモリ35に格納する。このデータを総データ量に積算して、制御機器への出力の総データ量とする(ステート20a)。次に、格納が完了すると、データ格納完了信号S12を共有メモリ30にセットして、データの取り込みが完了したことをPLCモジュール2に通知する(ステート21a)。次に、起動信号S16を出力して更新周期発生回路40を起動する(ステート22a)。更新周期発生回路40が起動されると、更新周期発生回路40から割込信号S30が出力され、オプションモジュール3のCPU31に入力され、データ更新割込処理がCPU31により実行される。データ更新割込処理では、制御機器からのデータ入力、および総データ量から今回出力するデータを作成して制御機器に出力する(ステート30a)。
On the other hand, in the
図3は、本発明のモジュール型のPLC装置の内部構成図である。図3において、2はPLCモジュールであり、プログラマブルコントローラとしての機能を有しており、外部の信号を取り込むための入力部20と、外部へ信号を出力するための出力部21と、データメモリ部22と、ユーザプログラムを記憶しているプログラムメモリ部24と、水晶発振子25と、水晶発振子25からのクロック信号で動作し、プログラムメモリ部に格納された制御プログラムにしたがって演算するCPU23と、ソフトウェアまたはハードウェアで設定された周期にしたがって、割込信号S14およびオプションモジュール3への出力信号である同期信号S15を出力するサンプリング周期発生回路26から構成される。サンプリング周期発生回路26の出力信号である割込信号S14がCPU23に入力されたときに、CPU23はプログラマブルコントローラの入力、出力および演算を実行する。データの入出力が完了したときに、オプションモジュール3に対しデータ格納指令S17がオプションモジュール3の共有メモリに格納される。3はオプションモジュールであり、PLCモジュール2がセットしたデータを自モジュール内に格納するためのメモリ35と、PLCモジュール2からのデータS11をメモリ35に格納した時にPLCモジュール2にデータS11の取り込みが完了したことを知らせるデータ格納完了信号S12を格納するための共有メモリ30と、水晶発振子34と、水晶発振子34で動作するCPU31と、制御機器との間でデータの入出力を行うためのデータ入出力部32と、オプションモジュール3と制御機器間のデータ更新周期を生成する更新周期発生回路40から構成される。更新周期発生回路40からの出力が割込信号S30として、オプションモジュール3のCPU31に入力される。更新周期発生回路40は、PLCモジュール2からの出力信号である同期信号S15がCPU31に入力されると同期割込処理が実行され、その同期割込処理から出力された起動信号S16により起動され、起動された時点から水晶発振子34からのクロックを元に定周期に信号を生成し出力する。すなわち、更新周期発生回路40は同期割込処理から起動信号S16により起動されると、割込信号S30を出力すると同時に、水晶発振子34からのクロックの計測を開始し、予め設定された周期に達すると割込信号S30を出力すると同時に、水晶発振子34からのクロックの計測を開始する。この動作を繰り返し行うことで定周期に信号を生成する。また、更新周期発生回路40からの出力である割込信号S30がCPU31に入力されると、制御機器との間でデータの入出力を行うデータ更新割込処理を実行する。
FIG. 3 is an internal configuration diagram of the module type PLC apparatus of the present invention. In FIG. 3,
本発明が従来技術と異なる部分は、オプションモジュールへの同期信号S15と、更新周期発生回路40およびその起動信号であるS16とその出力信号であるS30と、データ格納指令S17と、データ格納完了信号S12を備えた部分である。
The present invention is different from the prior art in that the synchronization signal S15 to the option module, the update
図4は、モジュール型PLC装置におけるPLCモジュールとオプションモジュールのソフトウェアの動作説明図であり、PLCモジュール2のサンプリング周期発生回路26から割込信号S14が入力された時のPLCモジュール2のソフトウェアの動作、およびPLCモジュール2のサンプリング周期発生回路26から同期信号S15が入力された時のオプションモジュール3のソフトウェアの動作を説明したものである。図4において、割込信号S14がPLCモジュール2のCPU23に入力されると、PLCモジュール2はまず、外部機器との入出力を行い(ステート10b)、入出力が完了したときにデータ格納指令S17を共有メモリ30にセットし(ステート11b)、オプションモジュール3からのデータ格納完了信号待ちとなる(ステート12b)。オプションモジュール3からデータ格納完了信号S12が共有メモリ30にセットされると、プログラムメモリ部24に格納されたユーザプログラムが実行され、そのユーザプログラムの中で時々刻々のデータが共有メモリ30にセットされる(ステート13b)。
FIG. 4 is a diagram for explaining the operation of the software of the PLC module and the option module in the modular PLC apparatus. The operation of the software of the
一方、オプションモジュール3は、同期信号S15がオプションモジュール3のCPU31に入力されると、同期割込処理がCPU31により実行される。同期割込処理の処理内容は、まずPLCモジュール2からのデータ格納指令S17待ちとなる(ステート200)。次に、PLCモジュール2からデータ格納指令S17が共有メモリ30にセットされると、PLCモジュール2が共有メモリ30にセットしたデータを自モジュール内のメモリ35に格納する。このデータを総データ量に積算して、制御機器への出力の総データ量とする(ステート20b)。格納が完了すると、データ格納完了信号S12を共有メモリ30にセットして、データの取り込みが完了したことをPLCモジュール2に通知する(ステート21b)。次に、起動信号S16を出力して更新周期発生回路40を起動する(ステート22b)。更新周期発生回路40が起動されると、更新周期発生回路40から割込信号S30が出力され、オプションモジュール3のCPU31に入力され、データ更新割込処理がCPU31により実行される。データ更新割込処理では、制御機器からのデータ入力、および総データ量から今回出力するデータを作成して制御機器に出力する(ステート30b)。
On the other hand, in the
このように、実施例1においては、PLCモジュールから出力される割込信号S20がオプションモジュールに入力されたときに、実施例2においては、PLCモジュールで定周期に生成される同期信号S15が入力されたときに制御機器への入出力を行うデータ更新割込処理を起動することにより、オプションモジュールの実装枚数に制限を加えることなく、PLCモジュールが払い出すデータを、オプションモジュールを介して確実に制御機器まで渡すことができ、また、オプションモジュールのデータ更新周期をPLCモジュールのサンプリング周期と異なる値に設定できるので、PLCモジュールのサンプリング周期を長い値に設定してもオプションモジュールのデータ更新周期をPLCモジュールのサンプリング周期のn分の1に設定でき、制御精度の低下を防止することができる。 As described above, in the first embodiment, when the interrupt signal S20 output from the PLC module is input to the option module, in the second embodiment, the synchronization signal S15 generated at a fixed period by the PLC module is input. By starting the data update interrupt processing that inputs / outputs to / from the control device when it is done, the data delivered by the PLC module can be reliably transmitted via the option module without limiting the number of installed option modules. Since the data update cycle of the option module can be set to a value different from the sampling cycle of the PLC module, the data update cycle of the option module can be set even if the sampling cycle of the PLC module is set to a long value. 1 / n of the sampling period of the PLC module Constant can, it is possible to prevent deterioration of the control accuracy.
また、1枚のオプションモジュールで接続可能な制御機器を超える多数の制御機器を接続する場合でも、必要枚数分のオプションモジュールを追加し、PLCモジュールに同期させることで、PLCモジュールが払い出すデータを、複数のオプションモジュールを介して確実に制御機器まで渡すことができ、複数のオプションモジュールを使用したモジュール型のPLC装置で同期制御を行うことができる。 Also, even when connecting many control devices that exceed the control devices that can be connected with one option module, add the required number of option modules and synchronize with the PLC module, so that the data delivered by the PLC module can be The control device can be surely passed to the control device via the plurality of option modules, and the synchronous control can be performed by the module type PLC device using the plurality of option modules.
PLCモジュールに同期した複数のオプションモジュールを使用することにより、多数の制御機器をPLCモジュールに同期させることができるので、多数の制御機器の同期を必要とする機械システムにPLC装置を適用できる。 Since a plurality of control devices can be synchronized with the PLC module by using a plurality of option modules synchronized with the PLC module, the PLC device can be applied to a mechanical system that requires synchronization of a large number of control devices.
1 プログラム入力装置
2 PLCモジュール
3 オプションモジュール
4 制御機器
5 プログラマブルコントローラ
20 入力部
21 出力部
22 データメモリ部
23 CPU
24 プログラムメモリ部
25 水晶発振子
26 サンプリング周期発生回路
30 共有メモリ
31 CPU
32 データ入出力部
34 水晶発振子
35 メモリ
40 更新周期発生回路
S11 データ
S12 データ格納完了信号
S14 割込信号
S15 割込信号
S16 起動信号
S17 データ格納指令
S20 割込信号
S30 割込信号
DESCRIPTION OF SYMBOLS 1
24
32 Data input /
Claims (4)
制御機器とデータの入出力を行う機能を有するオプションモジュールと、を備え、
前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラの同期方法において、
前記PLCモジュールのCPUに第1の割込信号が入力されたとき、前記PLCモジュールは第2の割込信号を発生する手段を起動し、
前記PLCモジュールからの前記第2の割込信号が前記オプションモジュールに入力されたとき、前記オプションモジュールが前記PLCモジュールのデータを格納し、データ格納完了信号を前記PLCモジュールに出力し、前記オプションモジュールと制御機器との間でデータの入出力処理を行う第3の割込信号を生成する手段を起動し、
前記第3の割込信号が前記オプションモジュールのCPUに入力されたとき、前記オプションモジュールは制御機器に出力するデータを算出して、データを制御機器に出力し、前記PLCモジュールは同PLCモジュールのデータをオプションモジュールが取り込むまでは、ユーザプログラムを実行せず待機状態を保持し、
前記オプションモジュールからのデータ格納完了信号により、ユーザプログラムを前記PLCモジュールが実行することにより、前記PLCモジュールと前記オプションモジュールの同期をとることを特徴とするモジュール型のプログラマブルコントローラの同期方法。 A PLC module having a function as a programmable controller;
An optional module having a function to input / output data with a control device,
In the synchronization method of the module-type programmable controller having a function of inputting and outputting data at a constant cycle so that data from the option module can be reliably passed to the control device between the option module and the control device.
When a first interrupt signal is input to the CPU of the PLC module, the PLC module activates means for generating a second interrupt signal;
When the second interrupt signal from the PLC module is input to the option module, the option module stores data of the PLC module, and outputs a data storage completion signal to the PLC module. Activating means for generating a third interrupt signal for performing data input / output processing between the control device and the control device
When the third interrupt signal is input to the CPU of the option module, the option module calculates data to be output to the control device and outputs the data to the control device, and the PLC module is connected to the PLC module. Until the option module captures data, the user program is not executed and the standby state is maintained.
A method of synchronizing a module type programmable controller, wherein the PLC module and the option module are synchronized by the PLC module executing a user program in response to a data storage completion signal from the option module.
制御機器とデータの入出力を行う機能を有するオプションモジュールと、
前記PLCモジュールと前記オプションモジュールとの間でデータのやり取りを行う共有メモリと、を備え、
前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラにおいて、
前記PLCモジュールは第1の割込信号と第2の割込信号とを発生する手段を有し、前記PLCモジュールは第1の割込信号が入力されると、外部機器との入出力を行い、入出力が完了したときに前記第2の割込信号を発生する手段を起動した後、前記オプションモジュールのデータ格納完了信号待ちとなり、前記オプションモジュールからデータ格納完了信号が前記共有メモリにセットされると、ユーザプログラムを実行し、
前記オプションモジュールは第3の割込信号を生成する手段を有し、前記第2の割込信号が入力されると、前記PLCモジュールが該共有メモリにセットしたデータをメモリに格納し、格納が完了すると、データ格納完了信号を前記共有メモリにセットし、前記第3の割込信号を生成する手段を起動し、前記第3の割込信号が入力されると、制御機器に出力するデータを作成し、制御機器に出力することを特徴とするモジュール型のプログラマブルコントローラ。 A PLC module having a function as a programmable controller;
An option module having a function of inputting / outputting data to / from the control device;
A shared memory for exchanging data between the PLC module and the option module,
In the module-type programmable controller having a function of inputting and outputting data at a constant cycle so that data from the option module can be reliably passed to the control device between the option module and the control device.
The PLC module has means for generating a first interrupt signal and a second interrupt signal, and the PLC module performs input / output with an external device when the first interrupt signal is input. After starting the means for generating the second interrupt signal when the input / output is completed, the option module waits for the data storage completion signal, and the data storage completion signal is set in the shared memory from the option module. Then run the user program,
The option module has means for generating a third interrupt signal. When the second interrupt signal is input, the data set by the PLC module in the shared memory is stored in the memory. When completed, the data storage completion signal is set in the shared memory, the means for generating the third interrupt signal is activated, and when the third interrupt signal is input, the data to be output to the control device A modular programmable controller characterized by creating and outputting to a control device.
制御機器とデータの入出力を行う機能を有するオプションモジュールと、を備え、
前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラの同期方法において、
前記PLCモジュールのCPUに第1の割込信号が入力されて前記PLCモジュールからのデータ格納指令が前記オプションモジュールに入力されたとき、前記オプションモジュールが前記PLCモジュールのデータを格納し、データ格納完了信号を前記PLCモジュールに出力し、前記オプションモジュールと制御機器との間でデータの入出力処理を行う第2の割込信号を生成する手段を起動し、
前記第2の割込信号が前記オプションモジュールのCPUに入力されたとき、前記オプションモジュールは制御機器に出力するデータを算出して、データを制御機器に出力し、前記PLCモジュールは同PLCモジュールのデータをオプションモジュールが取り込むまでは、ユーザプログラムを実行せず待機状態を保持し、前記オプションモジュールからのデータ格納完了信号により、ユーザプログラムを前記PLCモジュールが実行することにより、前記PLCモジュールと前記オプションモジュールの同期をとることを特徴とするモジュール型のプログラマブルコントローラの同期方法。 A PLC module having a function as a programmable controller;
An optional module having a function to input / output data with a control device,
In the synchronization method of the module-type programmable controller having a function of inputting and outputting data at a constant cycle so that data from the option module can be reliably passed to the control device between the option module and the control device.
When the first interrupt signal is input to the CPU of the PLC module and the data storage command from the PLC module is input to the option module, the option module stores the data of the PLC module, and the data storage is completed A means for generating a second interrupt signal for outputting a signal to the PLC module and performing data input / output processing between the option module and the control device;
When the second interrupt signal is input to the CPU of the option module, the option module calculates data to be output to the control device and outputs the data to the control device, and the PLC module is connected to the PLC module. Until the option module fetches data, the user program is not executed and the standby state is maintained, and the PLC module and the option are executed by the PLC module executing the user program in response to a data storage completion signal from the option module. A module-type programmable controller synchronization method, wherein the modules are synchronized.
制御機器とデータの入出力を行う機能を有するオプションモジュールと、
前記PLCモジュールと前記オプションモジュールとの間でデータのやり取りを行う共有メモリと、を備え、
前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュール型のプログラマブルコントローラにおいて、
前記PLCモジュールは、第1の割込信号とこれと同じタイミングで同期信号を発生する手段を有し、前記PLCモジュールは、第1の割込信号が入力されると、外部機器との入出力を行い、入出力が完了したときにデータ格納指令を前記オプションモジュールの共有メモリにセットした後、前記オプションモジュールのデータ格納完了信号待ちとなり、前記オプションモジュールからデータ格納完了信号が前記共有メモリにセットされると、ユーザプログラムを実行し、
前記オプションモジュールは、第2の割込信号を生成する手段を有し、前記同期信号が入力されると、データ格納指令待ちとなり、前記PLCモジュールからのデータ格納指令が前記共有メモリにセットされると、前記PLCモジュールが該共有メモリにセットしたデータをメモリに格納し、格納が完了すると、データ格納完了信号を前記共有メモリにセットし、前記第2の割込信号を生成する手段を起動し、第2の割込信号が入力されると、制御機器に出力するデータを作成し、制御機器に出力することを特徴とするモジュール型のプログラマブルコントローラ。 A PLC module having a function as a programmable controller;
An option module having a function of inputting / outputting data to / from the control device;
A shared memory for exchanging data between the PLC module and the option module,
In the module-type programmable controller having a function of inputting and outputting data at a constant cycle so that data from the option module can be reliably passed to the control device between the option module and the control device.
The PLC module includes a first interrupt signal and a means for generating a synchronization signal at the same timing as the first interrupt signal. When the first interrupt signal is input, the PLC module inputs / outputs from / to an external device. After the input / output is completed, the data storage command is set in the shared memory of the option module, and then the data storage completion signal of the option module is waited, and the data storage completion signal from the option module is set in the shared memory. The user program is executed,
The option module has means for generating a second interrupt signal. When the synchronization signal is input, the option module waits for a data storage command, and the data storage command from the PLC module is set in the shared memory. The PLC module stores the data set in the shared memory in the memory, and when the storage is completed, sets the data storage completion signal in the shared memory and activates the means for generating the second interrupt signal. When the second interrupt signal is input, the module type programmable controller is characterized in that data to be output to the control device is created and output to the control device.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2004264772A JP2006079480A (en) | 2004-09-13 | 2004-09-13 | Method for synchronizing modular programmable controller and programmable controller |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2004264772A JP2006079480A (en) | 2004-09-13 | 2004-09-13 | Method for synchronizing modular programmable controller and programmable controller |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2006079480A true JP2006079480A (en) | 2006-03-23 |
Family
ID=36158856
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2004264772A Pending JP2006079480A (en) | 2004-09-13 | 2004-09-13 | Method for synchronizing modular programmable controller and programmable controller |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2006079480A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023276351A1 (en) * | 2021-07-02 | 2023-01-05 | オムロン株式会社 | Control device, system program, and method |
-
2004
- 2004-09-13 JP JP2004264772A patent/JP2006079480A/en active Pending
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023276351A1 (en) * | 2021-07-02 | 2023-01-05 | オムロン株式会社 | Control device, system program, and method |
| JP7643213B2 (en) | 2021-07-02 | 2025-03-11 | オムロン株式会社 | CONTROL DEVICE, SYSTEM PROGRAM AND METHOD |
| EP4365690A4 (en) * | 2021-07-02 | 2025-07-23 | Omron Tateisi Electronics Co | CONTROL DEVICE, SYSTEM PROGRAM AND METHOD |
| US12386517B2 (en) | 2021-07-02 | 2025-08-12 | Omron Corporation | Control device, system program, and method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR101044521B1 (en) | Synchronous control device of slave devices connected to network | |
| JP6152920B2 (en) | Programmable controller system, its controller | |
| US20100199003A1 (en) | Field control system | |
| JPH11178217A (en) | Synchronization method and synchronization method for multiplex system controller | |
| US10025281B2 (en) | Control device and system program, and recording medium | |
| JP2016110458A (en) | Programmable logic controller, basic unit, control method and program | |
| JP5067670B2 (en) | Machine controller system | |
| CN107947888A (en) | A kind of task level synchronous method based on network service | |
| KR101704751B1 (en) | Apparatus for simulating of multi-core system by using timing information between modules, and method thereof | |
| JPWO2017077628A1 (en) | Functional unit and control device | |
| JP2003036101A (en) | Redundant controller | |
| JP4961589B2 (en) | Network system and slave synchronization method | |
| JP2006079480A (en) | Method for synchronizing modular programmable controller and programmable controller | |
| JP2003202907A (en) | Synchronization method between PLC module and option module | |
| EP2254012A2 (en) | Duplexed field controller | |
| JP2006048284A (en) | Programmable controller device and synchronization method with option module | |
| JP2006350768A (en) | Motion control system | |
| JP2002333905A (en) | Programmable controller that can synchronize between optional modules | |
| JP2004086431A (en) | Programmable controller that can synchronize between optional modules | |
| JP2004110120A (en) | Modular programmable controller synchronization method and modular programmable controller | |
| JP2004102791A (en) | Synchronization method of programmable controller | |
| JPH11259105A (en) | Externally Synchronizable Programmable Controller | |
| JP2004086432A (en) | Synchronization method of programmable controller | |
| JP2006260386A (en) | Programmable controller device | |
| JP2009541889A (en) | How data is processed |