JP2004110120A - Synchronization method for modular type programmable controller and modular type programmable controller - Google Patents

Synchronization method for modular type programmable controller and modular type programmable controller Download PDF

Info

Publication number
JP2004110120A
JP2004110120A JP2002268259A JP2002268259A JP2004110120A JP 2004110120 A JP2004110120 A JP 2004110120A JP 2002268259 A JP2002268259 A JP 2002268259A JP 2002268259 A JP2002268259 A JP 2002268259A JP 2004110120 A JP2004110120 A JP 2004110120A
Authority
JP
Japan
Prior art keywords
data
module
option
plc module
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.)
Abandoned
Application number
JP2002268259A
Other languages
Japanese (ja)
Inventor
Mitsunori Kuzushima
葛島 光則
Toshiyuki Miyamatsu
宮松 利行
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.)
Yaskawa Electric Corp
Original Assignee
Yaskawa 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 Yaskawa Electric Corp filed Critical Yaskawa Electric Corp
Priority to JP2002268259A priority Critical patent/JP2004110120A/en
Publication of JP2004110120A publication Critical patent/JP2004110120A/en
Abandoned legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a programmable controller device capable of surely transferring data between controllers without placing a limit on the number of mounting of open modules. <P>SOLUTION: When a data storage instruction S17 from a PLC module 100 is inputted by an interrupting signal S14, an option module 200 stores the data of the PLC module 100 into a memory 225. When the interrupting signal S14 is inputted in a data update cycle, the option module 200 calculates data to be outputted to a control unit, and outputs the data to the control unit. The PLC module 100 holds the stand-by state without executing any user program until the data of the PLC module 100 are captured by the option module 200, and the PLC module 100 executes the user program according to a data storage completion signal from the option module 200. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明はモジュール型のプログラマブルコントローラ(PLC装置)に関する。
【0002】
【従来の技術】
一般に、モジュール型のPLC装置は図4に示すように、プログラム入力装置1とPLCモジュール2とオプションモジュール3から構成されている。プログラム入力装置1はアプリケーションプログラムS1を作成する。PLCモジュール2はアプリケーションプログラムS1にしたがい、オプションモジュール3との間で入出力データS2をバスを通して授受する。データの授受を行うタイミング(以下、サンプリング周期と呼ぶ)は一般にPLCモジュール2に搭載された水晶発振子からのクロックを元にして作成される。オプションモジュール3は、動作の異なる複数種の中から任意のモジュールを複数枚実装できる。オプションモジュール3のなかには制御データS3を一定の更新周期で入出力を行うことにより、複数の制御機器4、5を制御する種類も含まれる。この場合、サンプリング周期はオプションモジュール3に搭載された更新周期発生回路からの信号を元にして作成される。このように、サンプリング周期の作成方法には2種類がある。
【0003】
図5はPLCモジュール2に搭載された水晶発振子からのクロックを元にサンプリング周期を作成する場合のPLC装置の構成を示している。
【0004】
PLCモジュール2は一般に、データメモリ部21と、アプリケーションプログラムを記憶しているプログラムメモリ部20と、水晶発振子23と、水晶発振子23からのクロック信号で動作し、プログラムメモリ部20に格納された制御プログラムにしたがって演算する演算部(CPU)22と、水晶発振子23からのクロック信号を元にユーザが設定したサンプリング周期を作成し、割込信号S5をCPU22へ入力するサンプリング周期発生回路24から構成される。CPU22は割込信号S5が入ると、割込信号S4を発生させ、オプションモジュール3との間でデータS2の授受を行う。
【0005】
オプションモジュール3は、PLCモジュール2がセットしたデータを自モジュール内に格納するためのメモリ33と、PLCモジュール2からのデータS2と、CPU22からの割込信号S4を受けるための共有メモリ30と、水晶発振子34と、水晶発振子34で動作するCPU31と、制御機器4とのデータ授受をリアルタイムで行うためのデータ入出力部32から構成される。PLCモジュール2とオプションモジュール3との間の同期は割込信号S4によって保たれる。
【0006】
図6はオプションモジュール3に搭載された更新周期発生回路36からの信号を元にしてサンプリング周期を作成する場合のPLC装置の構成を示している。このPLC装置は図5のPLC装置と異なり、データを入出力する周期は更新周期発生回路36により作成される。PLCモジュール2と制御機器4との間でデータの整合性をとるために、更新周期発生回路36からの割込信号S6をオプションモジュール3のCPU31とPLCモジュール2のサンプリング周期発生回路24に同時に入力する。PLCモジュール2は自モジュール内の水晶発振子34からの信号を使うことなくオプションモジュール3内の更新周期発生回路36からの割込信号S6を使用してサンプリング周期を作成する。
【0007】
このようなモジュール型のPLC装置においては、PLCモジュールとオプションモジュールは、それぞれCPUを搭載し、そのCPUは一般に別々の発振器(水晶発振子)からのクロックで動作する。図6に示したようなオプションモジュール3ではPLCモジュール2からのデータはPLCモジュール2のサンプリング周期で確実に制御機器4まで受け渡すことができる。
【0008】
なお、以上説明した従来技術は特許文献1に記載されている。
【0009】
【特許文献1】
特開平11−259105号公報
【0010】
【発明が解決しようとする課題】
一方、図6に示したようなオプションモジュール3と図5に示したPLCモジュール2とで構成されるPLC装置では、たとえ同じサンプリング周期を設定しても、PLCモジュール2とオプションモジュール3のサンプリング周期は微妙にずれてくる。そのため、PLCモジュール2からのデータをオプションモジュール3が受け取れないタイミングが生じ、PLCモジュール2からの時々刻々のデータをオプションモジュール3を介して制御機器4まで確実に受け渡すことができない。
【0011】
この問題を図7のタイミングチャートを用いて説明する。図7において、D〜DはPLCモジュール2が時々刻々払い出すデータを示している。この例では、オプションモジュール3および制御機器4のデータ更新周期を2ms、PLCモジュール2のサンプリング周期を2msとしている。クロックに使用する水晶発振子の精度は一般に100ppm程度であるため、PLCモジュール2で使用している水晶発振子23とオプションモジュール3で使用している水晶発振子34の誤差は最大200ppmである。よって1/5000の誤差となる。2msでは、2ms±0.4μsとなり、10秒で1回分(2ms)周期が多いか少なくなる。図7は、PLCモジュール2で使用している水晶発振子23がオプションモジュール3で使用している水晶発振子34よりα分遅いと仮定したときの各モジュールの周期を表したものである。図7において、PLCモジュール2のサンプリング周期とオプションモジュール3のデータ更新周期がt、tと徐々にずれていき、時刻tでオプションモジュール3のデータ更新周期がPLCモジュール2のサンプリング周期を抜き、その結果、データDが払い出せずデータを抜かす。時刻tでは、本来はデータDが制御機器4に送信されなければならないが、時刻tと同じデータDが制御機器4に送信されてしまう。すなわち、制御機器4に本来送信するデータは、D→D→D→D→D→D→・・・・・であるのに対して、実際に制御機器4に送信されるデータは、D→D→D→D→D→D→D・・・・・となる。
【0012】
これを防ぐために、従来は図6に示したPLCモジュール2を用いて、PLCモジュール2とオプションモジュール3のサンプリング周期がずれないようにしていた。
【0013】
しかし、図6に示したPLCモジュール2の場合、図6に示した機能を持つオプションモジュール3が必ず実装されなければならないが、1枚しか搭載できないといった問題があった。
【0014】
本発明の目的は、オプションモジュールの実装枚数に制限を加えることなく、制御機器との間のデータの受け渡しを確実に行うことができ、また、PLCモジュールのサンプリング周期を生成しているクロックと、オプションモジュールと制御機器間の更新周期を生成しているクロック差を意識する必要がないプログラマブルコントローラの周期方法およびプログラマブルコントローラを提供することにある。
【0015】
【課題を解決するための手段】
本発明は、PLCモジュールのCPUに割込信号が入力されてPLCモジュールからのデータ格納指令がオプションモジュールに入力されたとき、オプションモジュールがPLCモジュールのデータを格納し、割込信号が入力されたときにデータ更新周期であれば、オプションモジュールは制御機器に出力するデータを算出して、データを制御機器に出力し、PLCモジュールはPLCモジュールのデータをオプションモジュールが取り込むまでは、ユーザプログラムを実行せず待機状態を保持し、オプションモジュールからのデータ格納完了信号により、ユーザプログラムをPLCモジュールが実行することにより、PLCモジュールとオプションモジュールの同期をとるものである。
【0016】
【発明の実施の形態】
次に、本発明の実施の形態を図面を参照して説明する。
【0017】
図1は本発明の一実施形態のPLC装置の構成図である。PLCモジュール100はプログラマブルコントローラとしての機能を有しており、外部の信号を取り込むための入力部110と、外部へ信号を出力するための出力部111と、データメモリ部112と、ユーザプログラムを記憶しているプログラムメモリ部114と、水晶発振子115と、水晶発振子115からのクロック信号で動作し、プログラムメモリ部114に格納された制御プログラムにしたがって演算する演算部(CPU)113と、ソフトウェアまたはハードウェアで設定された周期にしたがって、割込信号S14およびオプションモジュール200への出力信号である同期信号S15を出力するサンプリング周期発生回路116で構成されている。サンプリング周期発生回路116の出力信号である割込信号S14がCPU113に入力されたときに、CPU113はプログラマブルコントローラの入力、出力および演算を実行する。データ入出力が完了したときに、オプションモジュール200に対しデータ格納指令S17がオプションモジュール200の共有メモリ220に格納される。
【0018】
オプションモジュール200は、PLCモジュール100がセットしたデータを自モジュール内に格納するためのメモリ225と、PLCモジュール100からのデータS11と、データS11をメモリ225に格納したときにPLCモジュール100にデータS11の取り込みが完了したことを知らせるデータ格納完了信号S12を格納するための共有メモリ220と、水晶発振子224と、水晶発振子224で動作するCPU221と、制御機器にデータを出力するためのデータ入出力部222と、PLCモジュール100の出力信号である同期信号S15に同期してオプションモジュール200と制御機器間の更新周期を生成する更新周期発生回路223から構成される。更新周期発生回路223は割込信号S13a、 S13b、 S13cを、オプションモジュール200のCPU221に入力する。
【0019】
図2は、本実施形態におけるPLCモジュール100からの同期信号S15に同期した更新周期を発生する更新周期発生回路223の動作を説明する図である。図2において、同期信号S15がデータ更新周期より遅い場合と速い場合に分けて説明する。遅い場合の例では同期信号S15を4ms、更新周期を2msとし、同期信号S15をデータ更新周期の2倍としている。この場合、同期信号S15に同期して割込信号S13a(同期信号S15が入力され、かつ更新周期であるときの割込信号)を発生し、この時点から2ms経過後、次の割込信号S13b(同期信号S15は入力されておらず、更新周期のみであるときの割込信号)を発生し、次の同期信号S15に同期して割込信号S13aを出力する。前記を繰り返して割込信号S13a、割込信号S13bを発生させる。更新周期は、ソフトウェアもしくはハードウェアで予め設定しておく。
【0020】
一方、速い場合の例では同期信号S15を2ms、更新周期を4msとし、同期信号S15の周期を更新周期の1/2倍としている。この場合、同期信号S15に同期して割込信号S13a(同期信号S15が入力され、かつ更新周期であるときの割込信号)を発生し、次の同期信号S15では、割込信号S13c(同期信号S15が入力され、かつ更新周期ではないときの割込信号)を発生し、次の同期信号S15に同期して割込信号S13aを出力する。前記を繰り返して割込信号S13a、割込信号S13cを発生させる。
【0021】
図3は、PLCモジュール100のサンプリング周期発生回路116から割込信号S14が入力されたときのPLCモジュール100のソフトウェアの動作、およびオプションモジュール200の更新周期発生回路223から割込信号S13a、S13b、S13cが入力されたときのオプションモジュール200のソフトウェアの動作を説明した図である。
【0022】
図3において、割込信号S14がPLCモジュール100のCPU113に入力されると、PLCモジュール100はまず、外部機器との入出力を行い(ステートST10)、入出力が完了したときにデータ格納指令S17を共有メモリ220にセットし、オプションモジュール200からのデータ格納完了待ちとなる(ステートST11)。オプションモジュール200からデータ格納完了S12が共有メモリ220にセットされると、プログラムメモリ部114に格納されたユーザプログラムが実行され、そのユーザプログラムの中で時々刻々のデータが共有メモリ220にセットされる(ステートST12)。
【0023】
一方、オプションモジュール200は、同期信号S15から更新周期発生回路223により生成された割込信号S13a、S13b、S13cがオプションモジュール200のCPU221に入力されると、それぞれの割込処理を実行する。まず、割込信号S13a(同期信号S15が入力されると、かつ更新周期であるときの割込信号)が入力された場合、PLCモジュール100からのデータ格納指令S17待ちとなる(ステートST20)。PLCモジュール100からデータ格納指令S17が共有メモリ220にセットされると、PLCモジュール100が共有メモリ220にセットしたデータを自モジュール内のメモリ225に格納する。このデータを積算して、制御機器への出力の総データ量とする(ステートST21)。格納が完了すると、データ格納完了信号S12を共有メモリ220にセットして、データの取り込みが完了したことをPLCモジュール100に知らせる(ステートST22)。次に、総データ量から今回出力するデータを作成して(ステートST23)、制御機器に出力する(ステートST24)。
【0024】
次に、割込信号S13b(同期信号S15は入力されておらず、更新周期のみであるときの割込信号)が入力された場合は、総データ量から今回出力するデータを作成して(ステートST23)、制御機器に出力する(ステートST24)。
【0025】
また、割込信号S13c(同期信号S15が入力され、かつ更新周期でないときの割込信号)が入力された場合は、PLCモジュール100からのデータ格納指令S17待ちとなる(ステートST20)。PLCモジュール100からデータ格納指令S17が共有メモリ220にセットされると、PLCモジュール100が共有メモリ220にセットしたデータを自モジュール内のメモリ225に格納する。このデータを総データ量に積算して、新たな総データ量とする(ステートST21)。格納が完了すると、データ格納完了S12を共有メモリ220にセットして、データの取り込みが完了したことをPLCモジュール100に知らせる(ステートST22)。
【0026】
【発明の効果】
以上説明したように本発明によれば、下記の効果がある。
【0027】
1)PLCモジュールが払い出すデータを、オプションモジュールを介して、確実に制御機器まで渡すことができ、モジュール型の制御装置で同期制御が可能となる。
2)また、1枚のオプションモジュールで接続可能な制御機器を超える制御装置においても、必要数分のオプションモジュールを追加し、PLCモジュールに同期させることで、PLCモジュールが払い出すデータを、複数のオプションモジュールを介して、確実に制御機器まで渡すことができ、複数のオプションモジュールを使用した多数の制御機器を使用した制御装置で同期制御が可能となる。
3)また、データを生成するPLCモジュールはプログラマブルであるため、任意のデータパターン(データの集まり)を生成することができるので、制御機器で構成される機械の動作に柔軟に対応できる。したがって、高性能、高機能な機械をPLC装置で構成することが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施形態のモジュール型PLC装置の構成図である。
【図2】図1中の更新周期発生回路223の動作を示すタイミングチャートである。
【図3】図1中の実施形態の動作を示すタイミングチャートである。
【図4】一般のモジュール型PLC装置の概略的構成図である。
【図5】PLCモジュールとオプションモジュールの従来例を示す構成図である。
【図6】PLCモジュールとオプションモジュールの他の従来例を示す構成図である。
【図7】従来例の動作を示すタイミングチャートである。
【符号の説明】
1  プログラム入力装置
2、100  PLCモジュール
3、200  オプションモジュール
4、5  制御機器
20、114  プログラムメモリ部
21、112  データメモリ部
22、113  CPU
23、115  水晶振動子
30、220  共有メモリ
31、221  CPU
32、35、222  データ入出力部
33、225  メモリ
34、224  水晶振動子
36、223  更新周期発生回路
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a modular programmable controller (PLC device).
[0002]
[Prior art]
In general, a modular PLC device includes a program input device 1, a PLC module 2, and an option module 3, as shown in FIG. The program input device 1 creates an application program S1. The PLC module 2 exchanges input / output data S2 with the option module 3 via the bus according to the application program S1. The timing for transmitting and receiving data (hereinafter, referred to as a sampling period) is generally created based on a clock from a crystal oscillator mounted on the PLC module 2. The optional module 3 can mount a plurality of arbitrary modules from a plurality of types having different operations. Some of the option modules 3 control the plurality of control devices 4 and 5 by inputting and outputting the control data S3 at a constant update cycle. In this case, the sampling cycle is created based on a signal from the update cycle generation circuit mounted on the option module 3. As described above, there are two methods for creating the sampling period.
[0003]
FIG. 5 shows a configuration of a PLC device in a case where a sampling period is created based on a clock from a crystal oscillator mounted on the PLC module 2.
[0004]
The PLC module 2 generally operates with a data memory unit 21, a program memory unit 20 storing an application program, a crystal oscillator 23, and a clock signal from the crystal oscillator 23, and is stored in the program memory unit 20. (CPU) 22 that calculates according to the control program, and a sampling period generating circuit 24 that generates a sampling period set by the user based on a clock signal from the crystal oscillator 23 and inputs an interrupt signal S5 to the CPU 22. Consists of When receiving the interrupt signal S5, the CPU 22 generates an interrupt signal S4 and exchanges data S2 with the option module 3.
[0005]
The option module 3 includes a memory 33 for storing the data set by the PLC module 2 in its own module, a shared memory 30 for receiving data S2 from the PLC module 2 and an interrupt signal S4 from the CPU 22, It comprises a crystal oscillator 34, a CPU 31 operated by the crystal oscillator 34, and a data input / output unit 32 for exchanging data with the control device 4 in real time. Synchronization between the PLC module 2 and the option module 3 is maintained by the interrupt signal S4.
[0006]
FIG. 6 shows a configuration of a PLC device in a case where a sampling cycle is created based on a signal from an update cycle generating circuit 36 mounted on the option module 3. This PLC device is different from the PLC device of FIG. 5 in that a cycle for inputting and outputting data is created by an update cycle generation circuit 36. In order to ensure data consistency between the PLC module 2 and the control device 4, the interrupt signal S6 from the update cycle generation circuit 36 is simultaneously input to the CPU 31 of the option module 3 and the sampling cycle generation circuit 24 of the PLC module 2. I do. The PLC module 2 creates a sampling cycle using the interrupt signal S6 from the update cycle generating circuit 36 in the option module 3 without using a signal from the crystal oscillator 34 in the module itself.
[0007]
In such a modular PLC device, each of the PLC module and the option module has a CPU mounted thereon, and the CPU generally operates with clocks from different oscillators (crystal oscillators). In the option module 3 as shown in FIG. 6, data from the PLC module 2 can be reliably transferred to the control device 4 at the sampling cycle of the PLC module 2.
[0008]
The conventional technique described above is described in Patent Document 1.
[0009]
[Patent Document 1]
JP-A-11-259105
[Problems to be solved by the invention]
On the other hand, in the PLC device including the option module 3 as shown in FIG. 6 and the PLC module 2 as shown in FIG. 5, even if the same sampling cycle is set, the sampling cycle of the PLC module 2 and the option module 3 is not changed. Slightly shifts. Therefore, there occurs a timing at which the option module 3 cannot receive the data from the PLC module 2, and it is impossible to reliably transfer the instantaneous data from the PLC module 2 to the control device 4 via the option module 3.
[0011]
This problem will be described with reference to the timing chart of FIG. In FIG. 7, D 1 to D 6 indicate data that the PLC module 2 pays out every moment. In this example, the data update cycle of the option module 3 and the control device 4 is 2 ms, and the sampling cycle of the PLC module 2 is 2 ms. Since the accuracy of the crystal oscillator used for the clock is generally about 100 ppm, the error between the crystal oscillator 23 used in the PLC module 2 and the crystal oscillator 34 used in the option module 3 is 200 ppm at the maximum. Therefore, the error is 1/5000. At 2 ms, it becomes 2 ms ± 0.4 μs, and the period (2 ms) for one time in 10 seconds is large or small. FIG. 7 shows the cycle of each module when it is assumed that the crystal oscillator 23 used in the PLC module 2 is later than the crystal oscillator 34 used in the option module 3 by α. 7, the data update period t A sampling period and option module 3 of the PLC module 2, gradually shifted from the t B, the data update period of the option module 3 at time t C is the sampling period of the PLC module 2 without, as a result, data D 6 is leave out the data without Haraidase. At time t C, although originally must be transmitted the data D 6 is the controlled apparatus 4, the same data D 5 to the time t B would be sent to the control device 4. That is, the data originally transmitted to the control device 4 is D 1 → D 2 → D 3 → D 4 → D 5 → D 6 →... , D 1 → D 2 → D 3 → D 4 → D 5 → D 5 → D 6 ...
[0012]
In order to prevent this, conventionally, the PLC module 2 shown in FIG. 6 was used so that the sampling cycles of the PLC module 2 and the option module 3 were not shifted.
[0013]
However, in the case of the PLC module 2 shown in FIG. 6, the option module 3 having the function shown in FIG. 6 must be mounted, but there is a problem that only one module can be mounted.
[0014]
An object of the present invention is to reliably transfer data to and from a control device without restricting the number of mounted optional modules, and to generate a sampling cycle of a PLC module with a clock, An object of the present invention is to provide a programmable controller cycle method and a programmable controller that do not need to be aware of a clock difference generating an update cycle between an option module and a control device.
[0015]
[Means for Solving the Problems]
According to the present invention, when an interrupt signal is input to the CPU of the PLC module and a data storage instruction from the PLC module is input to the option module, the option module stores the data of the PLC module and the interrupt signal is input. When the data update cycle is used, the option module calculates data to be output to the control device, outputs the data to the control device, and the PLC module executes the user program until the data of the PLC module is fetched by the option module. Instead, the PLC module executes the user program in response to the data storage completion signal from the option module, and synchronizes the PLC module with the option module.
[0016]
BEST MODE FOR CARRYING OUT THE INVENTION
Next, embodiments of the present invention will be described with reference to the drawings.
[0017]
FIG. 1 is a configuration diagram of a PLC device according to an embodiment of the present invention. The PLC module 100 has a function as a programmable controller, and stores an input unit 110 for receiving an external signal, an output unit 111 for outputting a signal to the outside, a data memory unit 112, and a user program. A program memory unit 114, a crystal oscillator 115, an operation unit (CPU) 113 which operates by a clock signal from the crystal oscillator 115, and operates according to a control program stored in the program memory unit 114, Alternatively, it is constituted by a sampling cycle generating circuit 116 that outputs an interrupt signal S14 and a synchronization signal S15 that is an output signal to the option module 200 in accordance with a cycle set by hardware. When an interrupt signal S14, which is an output signal of the sampling cycle generation circuit 116, is input to the CPU 113, the CPU 113 executes input, output, and calculation of the programmable controller. When the data input / output is completed, a data storage instruction S17 for the option module 200 is stored in the shared memory 220 of the option module 200.
[0018]
The option module 200 includes a memory 225 for storing the data set by the PLC module 100 in its own module, the data S11 from the PLC module 100, and the data S11 when the data S11 is stored in the memory 225. Memory 220 for storing a data storage completion signal S12 notifying that the capture of data has been completed, a crystal oscillator 224, a CPU 221 operated by the crystal oscillator 224, and a data input for outputting data to a control device. The output unit 222 includes an update cycle generation circuit 223 that generates an update cycle between the option module 200 and the control device in synchronization with a synchronization signal S15 that is an output signal of the PLC module 100. The update cycle generation circuit 223 inputs the interrupt signals S13a, S13b, and S13c to the CPU 221 of the option module 200.
[0019]
FIG. 2 is a diagram illustrating the operation of the update cycle generation circuit 223 that generates an update cycle synchronized with the synchronization signal S15 from the PLC module 100 in the present embodiment. In FIG. 2, the case where the synchronization signal S15 is slower and the case where the synchronization signal S15 is faster than the data update cycle will be described separately. In the case of the later case, the synchronization signal S15 is 4 ms, the update cycle is 2 ms, and the synchronization signal S15 is twice the data update cycle. In this case, an interrupt signal S13a (an interrupt signal when the synchronizing signal S15 is input and at the update cycle) is generated in synchronization with the synchronizing signal S15, and after a lapse of 2 ms from this point, the next interrupt signal S13b (An interrupt signal when the synchronizing signal S15 is not input and only in the update period) is generated, and an interrupt signal S13a is output in synchronization with the next synchronizing signal S15. By repeating the above, an interrupt signal S13a and an interrupt signal S13b are generated. The update cycle is set in advance by software or hardware.
[0020]
On the other hand, in the fast case, the synchronization signal S15 is 2 ms, the update period is 4 ms, and the period of the synchronization signal S15 is 倍 of the update period. In this case, an interrupt signal S13a (an interrupt signal when the synchronous signal S15 is input and at the update period) is generated in synchronization with the synchronous signal S15, and in the next synchronous signal S15, the interrupt signal S13c (the synchronous signal) is generated. An interrupt signal when the signal S15 is input and the update cycle is not reached) is generated, and an interrupt signal S13a is output in synchronization with the next synchronization signal S15. By repeating the above, an interrupt signal S13a and an interrupt signal S13c are generated.
[0021]
FIG. 3 shows the operation of the software of the PLC module 100 when the interrupt signal S14 is input from the sampling cycle generation circuit 116 of the PLC module 100, and the interrupt signals S13a, S13b, FIG. 14 is a diagram illustrating an operation of software of the option module 200 when S13c is input.
[0022]
In FIG. 3, when an interrupt signal S14 is input to the CPU 113 of the PLC module 100, the PLC module 100 first performs input / output with an external device (state ST10), and when the input / output is completed, a data storage instruction S17. Is set in the shared memory 220, and the completion of data storage from the option module 200 is waited (state ST11). When the data storage completion S12 is set in the shared memory 220 from the option module 200, the user program stored in the program memory unit 114 is executed, and the momentary data in the user program is set in the shared memory 220. (State ST12).
[0023]
On the other hand, when the interrupt signals S13a, S13b, and S13c generated from the synchronization signal S15 by the update cycle generation circuit 223 are input to the CPU 221 of the option module 200, the option module 200 executes the respective interrupt processing. First, when an interrupt signal S13a (an interrupt signal when the synchronization signal S15 is input and the update period is input) is input, the process waits for a data storage instruction S17 from the PLC module 100 (state ST20). When the data storage command S17 is set in the shared memory 220 from the PLC module 100, the data set in the shared memory 220 by the PLC module 100 is stored in the memory 225 in the own module. This data is integrated to obtain the total data amount output to the control device (state ST21). When the storage is completed, the data storage completion signal S12 is set in the shared memory 220 to notify the PLC module 100 that the data fetch is completed (state ST22). Next, data to be output this time is created from the total data amount (state ST23) and output to the control device (state ST24).
[0024]
Next, when an interrupt signal S13b (an interrupt signal when the synchronization signal S15 is not input but only in the update cycle) is input, data to be output this time is created from the total data amount (state). ST23), and outputs it to the control device (state ST24).
[0025]
When an interrupt signal S13c (an interrupt signal when the synchronization signal S15 is input and the update cycle is not reached) is input, the process waits for a data storage instruction S17 from the PLC module 100 (state ST20). When the data storage command S17 is set in the shared memory 220 from the PLC module 100, the data set in the shared memory 220 by the PLC module 100 is stored in the memory 225 in the own module. This data is added to the total data amount to obtain a new total data amount (state ST21). When the storage is completed, the data storage completion S12 is set in the shared memory 220 to notify the PLC module 100 that the data capture is completed (state ST22).
[0026]
【The invention's effect】
According to the present invention as described above, the following effects can be obtained.
[0027]
1) The data paid out by the PLC module can be reliably transferred to the control device via the option module, and the synchronous control can be performed by the module type control device.
2) Even in a control device that exceeds the control devices connectable with one option module, the required number of option modules are added and synchronized with the PLC module, so that the data to be paid out by the PLC module can be transmitted to a plurality of control devices. The control device can be reliably transferred to the control device via the option module, and synchronous control can be performed by a control device using a large number of control devices using a plurality of option modules.
3) Further, since the PLC module for generating data is programmable, an arbitrary data pattern (collection of data) can be generated, so that it is possible to flexibly cope with the operation of a machine including a control device. Therefore, a high-performance, high-performance machine can be configured by the PLC device.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of a modular PLC device according to an embodiment of the present invention.
FIG. 2 is a timing chart showing an operation of an update cycle generation circuit 223 in FIG.
FIG. 3 is a timing chart showing the operation of the embodiment in FIG. 1;
FIG. 4 is a schematic configuration diagram of a general modular PLC device.
FIG. 5 is a configuration diagram showing a conventional example of a PLC module and an option module.
FIG. 6 is a configuration diagram showing another conventional example of a PLC module and an option module.
FIG. 7 is a timing chart showing the operation of the conventional example.
[Explanation of symbols]
1 Program input device 2, 100 PLC module 3, 200 Option module 4, 5 Control device 20, 114 Program memory unit 21, 112 Data memory unit 22, 113 CPU
23, 115 crystal oscillator 30, 220 shared memory 31, 221 CPU
32, 35, 222 Data input / output unit 33, 225 Memory 34, 224 Quartz vibrator 36, 223 Update cycle generation circuit

Claims (2)

プログラマブルコントローラとしての機能を有するPLCモジュールと、制御機器とデータの入出力を行う機能を有するオプションモジュールを備え、前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュラ型プログラマブルコントローラにおいて、前記PLCモジュールのCPUに割込信号が入力されて前記PLCモジュールからのデータ格納指令が前記オプションモジュールに入力されたとき、前記オプションモジュールが前記PLCモジュールのデータを格納し、前記割込信号が入力されたときにデータ更新周期であれば、前記オプションモジュールは制御機器に出力するデータを算出して、データを制御機器に出力し、前記PLCモジュールはPLCモジュールのデータを前記オプションモジュールが取り込むまでは、ユーザプログラムを実行せず待機状態を保持し、前記オプションモジュールからのデータ格納完了信号により、ユーザプログラムを前記PLCモジュールが実行する、プログラマブルコントローラの同期方法。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 are provided, and data from the option module is reliably transferred to the control device between the option module and the control device. In a modular programmable controller having a function of inputting and outputting data at regular intervals, an interrupt signal is input to the CPU of the PLC module, and a data storage instruction from the PLC module is input to the option module. When the option module stores the data of the PLC module, and when the interrupt signal is input, if the data update period, the option module calculates the data to be output to the control device, and Control The PLC module outputs the data to the device, and holds the standby state without executing the user program until the option module captures the data of the PLC module. A method for synchronizing programmable controllers, performed by a module. プログラマブルコントローラとしての機能を有するPLCモジュールと、制御機器とデータの入出力を行う機能を有するオプションモジュールを備え、前記オプションモジュールと前記制御機器間は前記オプションモジュールからのデータを確実に制御機器まで渡すことができるように定周期でデータの入出力を行う機能を有するモジュラ型プログラマブルコントローラにおいて、前記PLCモジュールは、第1の割込信号とこれと同じタイミングで同期信号を発生する手段を有し、前記PLCモジュールは第1の割込信号を入力すると、外部機器との入出力を行い、入出力が完了したときにデータ格納指令を前記オプションモジュールの共有メモリにセットした後、前記オプションモジュールのデータ格納完了待ちとなり、
前記オプションモジュールは、前記同期信号を入力し、該同期信号がデータ更新周期よりも遅い場合、該同期信号に同期して第2の割込信号を発生し、この時点から一定時間に第3の割込信号を発生し、前記同期信号がデータ更新周期よりも早い場合、前記同期信号に同期して第2の割込信号を発生し、次の同期信号のタイミングで第4の割込信号を発生する手段を有し、前記オプションモジュールは第2、第4の割込信号が入力されると、前記PLCモジュールからのデータ格納指令待ちとなり、前記PLCモジュールからのデータ格納指令が前記共有メモリにセットされると、前記PLCモジュールが該共有メモリにセットしたデータをメモリに格納し、格納が完了すると、データ格納完了信号を前記共有メモリにセットし、第2、第3の割込信号が入力されると、制御機器に出力するデータを作成し、制御機器に出力することを特徴とするモジュラ型プログラマブルコントローラ。
A PLC module having a function as a programmable controller and an option module having a function of inputting and outputting data to and from a control device are provided, and data from the option module is reliably transferred to the control device between the option module and the control device. In a modular programmable controller having a function of inputting and outputting data at a fixed period so that the PLC module has a means for generating a first interrupt signal and a synchronization signal at the same timing as the first interrupt signal, When the PLC module receives the first interrupt signal, the PLC module performs input / output with an external device. When the input / output is completed, a data storage command is set in the shared memory of the option module. Waiting for storage completion,
The option module inputs the synchronization signal, and generates a second interrupt signal in synchronization with the synchronization signal when the synchronization signal is slower than a data update cycle. If an interrupt signal is generated and the synchronization signal is earlier than the data update cycle, a second interrupt signal is generated in synchronization with the synchronization signal, and a fourth interrupt signal is generated at the timing of the next synchronization signal. When the second and fourth interrupt signals are input, the option module waits for a data storage command from the PLC module, and the data storage command from the PLC module is sent to the shared memory. When set, the PLC module stores the data set in the shared memory in the memory. When the storage is completed, a data storage completion signal is set in the shared memory. When the interrupt signal is input, modular programmable controller, characterized in that to create the data to be output to the control device, to the control device.
JP2002268259A 2002-09-13 2002-09-13 Synchronization method for modular type programmable controller and modular type programmable controller Abandoned JP2004110120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002268259A JP2004110120A (en) 2002-09-13 2002-09-13 Synchronization method for modular type programmable controller and modular type programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002268259A JP2004110120A (en) 2002-09-13 2002-09-13 Synchronization method for modular type programmable controller and modular type programmable controller

Publications (1)

Publication Number Publication Date
JP2004110120A true JP2004110120A (en) 2004-04-08

Family

ID=32266526

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002268259A Abandoned JP2004110120A (en) 2002-09-13 2002-09-13 Synchronization method for modular type programmable controller and modular type programmable controller

Country Status (1)

Country Link
JP (1) JP2004110120A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5301041B2 (en) * 2010-12-16 2013-09-25 三菱電機株式会社 Sequencer system and control method thereof
US10275374B2 (en) 2016-11-14 2019-04-30 Lsis Co., Ltd. Method for controlling interrupt in inverter

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5301041B2 (en) * 2010-12-16 2013-09-25 三菱電機株式会社 Sequencer system and control method thereof
US10275374B2 (en) 2016-11-14 2019-04-30 Lsis Co., Ltd. Method for controlling interrupt in inverter

Similar Documents

Publication Publication Date Title
KR101044521B1 (en) Apparatus for controlling synchronization between slave devices connected to network
JP2010182101A (en) Field control system
JP4888741B2 (en) Distributed control system
JP2003036101A (en) Redundant controller
JP2004110120A (en) Synchronization method for modular type programmable controller and modular type programmable controller
JP2003202907A (en) Method for synchronizing plc module with option module
KR100288413B1 (en) Internal clock synchronization method and internal clock synchronization circuit
JP2006048284A (en) Programmable controller device and method for synchronizing with option module
JP2004086432A (en) Synchronous system of programmable controller
JP6272847B2 (en) Data transfer between clock domains
JP2004102791A (en) Synchronous system for programmable controller
JP2004086431A (en) Programmable controller enabling inter-option module synchronization
JP4616054B2 (en) Measuring system
JP2002333905A (en) Programmable controller apparatus in which synchronization between option modules is possible
JP2006079480A (en) Method for synchronizing module type programmable controller and programmable controller
JPH11259105A (en) Externally synchronizable programmable controller device
US6760798B1 (en) Interface mechanism and method for interfacing a real-time clock with a data processing circuit
JP2006260386A (en) Programmable controller
KR100734521B1 (en) Intellectual Property Module for System on Chip
JP3349983B2 (en) Semiconductor integrated circuit device
JP2004272794A (en) Control device and control method capable of external synchronization
JP2004007169A (en) Signal control unit and image forming apparatus
WO2004072745A1 (en) Control device and control method capable of external synchronization
WO2004031926A1 (en) Synchronous control device and synchronous control method
JP2005182693A (en) Multiplexed system and processor module

Legal Events

Date Code Title Description
A621 Written request for application examination

Effective date: 20050714

Free format text: JAPANESE INTERMEDIATE CODE: A621

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060515

A762 Written abandonment of application

Effective date: 20060517

Free format text: JAPANESE INTERMEDIATE CODE: A762