JP2007249560A - Cpu module in programmable controller - Google Patents

Cpu module in programmable controller Download PDF

Info

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
Application number
JP2006071630A
Other languages
Japanese (ja)
Inventor
Kazuto Nagatsuka
一人 永塚
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Systems Co Ltd
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 Fuji Electric Systems Co Ltd filed Critical Fuji Electric Systems Co Ltd
Priority to JP2006071630A priority Critical patent/JP2007249560A/en
Publication of JP2007249560A publication Critical patent/JP2007249560A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To secure concurrency of input/output data. <P>SOLUTION: A pulse LSI writes a data transmitted from an input module 50 in an I-data area 36, while synchronized with a cycle period, and transfers a data of an O-data area 34 to an output module 60. An I-data control driver 21 copies the data written in the I-data area 36, into an I-data bank A31 or B32, and updates an up-to-date data bank register 33. A control processor 10 reads out the data from the I-data bank A31 or B32, referring to the register 33. The control processor 10 writes an output data not in the O-data area 34 but in an O-data temporary retraction buffer 37, when an O-data area exclusive flag 35 is flagged on or when a timer 14 is counted up. <P>COPYRIGHT: (C)2007,JPO&INPIT

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 input module 140, and the output module 150 are connected to the system bus 160. In the figure, only one input module 140 and one output module 150 are shown. However, as described above, there are usually a plurality of them.

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 memory 120 shared by the control processor 110 and the bus LSI 130.
The control processor 110 passes output data to the bus LSI 130 via the shared memory 120 when outputting data. The control processor 110 receives input data from the bus LSI 130 via the shared memory 120 when data is input.

バスLSI130は、タクト周期に同期して、システムバス160を介して、各入力モジュール140から入力データを受信し、または各出力モジュール150へ出力データを送信する。これは、受信処理のときはトータルフレーム方式、送信処理のときはマルチキャスト方式で行う。このようなタクト周期に同期したシステムバス160上でのバスLSI130、入力モジュール140、出力モジュール150間のデータ入出力処理自体については、例えば本出願人による先出願(特許文献1)において説明されているので、ここでは特に詳細には説明しない。また、これより、バスLSI130、入力モジュール140、出力モジュール150の詳細な構成、動作についても、ここでは特に図示/説明しないものとする。   The bus LSI 130 receives input data from each input module 140 or transmits output data to each output module 150 via the system bus 160 in synchronization with the tact cycle. This is performed by the total frame method at the time of reception processing and by the multicast method at the time of transmission processing. The data input / output processing itself between the bus LSI 130, the input module 140, and the output module 150 on the system bus 160 synchronized with the tact cycle is described in, for example, an earlier application (Patent Document 1) by the present applicant. Therefore, it will not be described in detail here. Further, the detailed configurations and operations of the bus LSI 130, the input module 140, and the output module 150 are not particularly shown / explained here.

上記制御用プロセッサ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 memory 120. The bus LSI 130 reads out the output data stored in the O data area 121 in synchronization with the tact cycle and sends it to the system bus 160.

このとき、制御アプリケーション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 output module 150 is data that is neither data a nor data b (data a ′ in the figure).

同様に、データ入力処理においても、制御アプリケーション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 I data area 122 is performed. The timing of the tact interrupt t3 is halfway, and as a result of rewriting of the I data area 122 by the bus LSI 130, the data obtained by the control application 111 is data that is neither data b nor data c (data b 'in the figure). It becomes).

このように、従来、データ入力処理、データ出力処理のいずれにおいても、制御アプリケーション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等と呼ぶものとする。
特開平11−338523号公報
The data b, data c, etc. are actually a collection of a plurality of input data or a collection of a plurality of output data, and may be called a “data group”. b, data c, etc.
JP 11-338523 A

本発明の課題は、プログラマブルコントローラにおいて、タクト周期とは関係なく、任意のタイミングでデータ入力/出力要求が行なわれても、入力データ/出力データの同時性を保証できるようにし、更に出力順も保証できるようにする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 module 1, an input module 50, and an output module 60 are connected to a system bus 70. In the figure, each module is shown one by one, but there may be a plurality of each.

CPUモジュール1は、制御用プロセッサ10、管理用プロセッサ20、共有メモリ30、バスLSI40を有する。
制御用プロセッサ10は、制御アプリケーション11、Iデータ管理ドライバ12、Oデータ管理ドライバ13、タイマ14、ハンドラ15を備える。制御アプリケーション11は、各入力モジュール50、出力モジュール60に対する入出力制御処理や、データの演算処理等を行う。Iデータ管理ドライバ12〜ハンドラ15については、後に説明する。
The CPU module 1 includes a control processor 10, a management processor 20, a shared memory 30, and a bus LSI 40.
The control processor 10 includes a control application 11, an I data management driver 12, an O data management driver 13, a timer 14, and a handler 15. The control application 11 performs input / output control processing for each input module 50 and output module 60, data calculation processing, and the like. The I data management driver 12 to handler 15 will be described later.

尚、Iデータとは、システムバス70を介して入力モジュール50から受け取る入力データ(例えば、制御対象機器の状態データ、センサ計測データ等)のことであり、Oデータとは、システムバス70を介して出力モジュール60に渡すべき出力データ(例えば制御対象機器の位置、回転数等の設定データ等)のことである。   The I data is input data received from the input module 50 via the system bus 70 (for example, status data of the control target device, sensor measurement data, etc.), and the O data is transmitted via the system bus 70. Output data to be passed to the output module 60 (for example, setting data such as the position and rotation speed of the control target device).

管理用プロセッサ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 memory 30 is a memory shared by the control processor 10, the management processor 20, and the bus LSI 40. The shared memory 30 includes storage areas such as an I data bank A31, an I data bank B32, a latest data bank register 33, an O data area 34, an O data area exclusion flag 35, an I data area 36, and an O data temporary save buffer 37. Have.

上記各記憶領域の中で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 data bank register 33, and the I data area 36 are related to data input processing.
The I data area 36 is originally a storage area for the bus LSI 40 to write I data collected from each input module 50 and read by the control processor 10, but in this example, as described later, The control processor 10 does not read data directly from the I data area 36.

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 I data area 36 at a certain moment. The latest data bank register 33 is a register that holds data (which may be a flag) indicating which of the two I data banks A31 and B32 holds the latest I data.

これら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 data bank register 33 are performed by the I data management driver 21 of the management processor 20 at the timing when the data in the I data area 36 is updated.

また、上記制御用プロセッサ10のIデータ管理ドライバ12は、上記制御アプリケーション11から任意のときにIデータ取得要求を受ける毎に、最新データバンクレジスタ33が示すIデータバンク(A31またはB32)から、最新のIデータを読み出して制御アプリケーション11に渡す。   The I data management driver 12 of the control processor 10 receives an I data acquisition request from the control application 11 at any time from the I data bank (A31 or B32) indicated by the latest data bank register 33. The latest I data is read and passed to the control application 11.

一方、共有メモリ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 memory 30, the O data area 34, the O data area exclusion flag 35, and the O data temporary save buffer 37 are related to data output processing.
The O data area 34 is a storage area for writing the O data and reading the bus LSI 40 when the control processor 10 outputs O data to the output module 60.

Oデータ領域排他フラグ35は、Oデータ領域34へのアクセスに排他をとるために用いられる。
Oデータ一時退避バッファ37は、Oデータ領域34にOデータを書き込むことができないとき(例えば、Oデータ領域排他フラグ35がセットされているときや、タイマ14がカウントアップしているとき;詳しくは後述する)、このOデータを一時的に退避する為の、スタック構造(FIFO等)をもつバッファである(複数の要求が出力できない場合を考慮してFIFO構造となっている)。
The O data area exclusion flag 35 is used to exclude access to the O data area 34.
The O data temporary save buffer 37 cannot write O data to the O data area 34 (for example, when the O data area exclusion flag 35 is set or the timer 14 is counting up; This is a buffer having a stack structure (FIFO or the like) for temporarily saving the O data (which has a FIFO structure in consideration of the case where a plurality of requests cannot be output).

尚、バスLSI40と各入力モジュール50/出力モジュール60間のデータ入出力処理自体については、基本的には従来と略同様である。つまり、「バスの転送速度に合わせて一定周期(タクト周期)で割込みを発生させる機能」と、「このタクト割込みに同期して、各“I/Oモジュール50、60”に対するデータの入出力処理を行う機能」とを備え、受信処理のときはトータルフレーム方式、送信処理のときはマルチキャスト方式で、システムバス70上でのデータ転送を行っている。よって、これらバスLSI40、入力モジュール50、出力モジュール60の詳細な構成、機能については特に図示/説明しないものとする。   Note that the data input / output processing itself between the bus LSI 40 and each input module 50 / output module 60 is basically the same as the conventional one. That is, “a function for generating an interrupt at a constant cycle (tact cycle) according to the bus transfer rate” and “data input / output processing for each“ I / O module 50, 60 ”in synchronization with this tact interrupt” The data transfer on the system bus 70 is performed by the total frame method during the reception process and the multicast method during the transmission process. Therefore, detailed configurations and functions of the bus LSI 40, the input module 50, and the output module 60 are not particularly illustrated / explained.

以下、まず、図2、図3を参照して、上記プログラマブルコントローラのCPUモジュール1におけるデータ入力処理について説明する。
図2において、まず、バスLSI40は、タクト周期毎に、各入力モジュール50のIデータを、システムバス70を介して受け取ると、このIデータをIデータ領域36に書き込む(1)。そして、管理用プロセッサ20に対してタクト割込みを発生させる(2)。
Hereinafter, first, data input processing in the CPU module 1 of the programmable controller will be described with reference to FIGS. 2 and 3.
In FIG. 2, first, when the bus LSI 40 receives I data of each input module 50 via the system bus 70 for each tact cycle, the bus LSI 40 writes the I data in the I data area 36 (1). Then, a tact interrupt is generated for the management processor 20 (2).

管理用プロセッサ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 data bank register 33 is updated (5).

Iデータ管理ドライバ12は、制御アプリケーション11からIデータ取得要求を受けると、最新データバンクレジスタ33が示すIデータバンク(A31またはB32)からIデータを読み込んできて、制御アプリケーション11に渡す。   Upon receiving an I data acquisition request from the control application 11, the I data management driver 12 can read I data from the I data bank (A 31 or B 32) indicated by the latest data bank register 33 and pass it to the control application 11.

以上のようにすることで、もし、この読み込み処理の最中にバスLSI40によってIデータ領域36のデータが更新されることになっても、問題ないことになる。すなわち、図3に示すように、図9の場合と同様にタクト割り込み寸前で制御アプリケーション11からIデータ取得要求があった場合でも、データ読み出し処理中に、タクト割り込みによりIデータ領域36のデータは書き換えられるが、IデータバンクB32のデータ(b)は変わらないので、問題なく読み込みを行うことができる。すなわち、同時性を保つことができる(制御アプリケーションを変更することなく)。   By doing so, there is no problem if the data in the I data area 36 is updated by the bus LSI 40 during the reading process. That is, as shown in FIG. 3, even when there is an I data acquisition request from the control application 11 just before the tact interrupt, as in FIG. Although it is rewritten, the data (b) in the I data bank B32 is not changed, so that it can be read without any problem. That is, simultaneity can be maintained (without changing the control application).

次に、以下、図4〜図6を参照して、図1のプログラマブルコントローラのCPUモジュール1におけるデータ出力処理について説明する。
図4において、Oデータ管理ドライバ13は、任意のときに制御アプリケーション11からOデータ出力要求を受けると、まず、Oデータ領域排他フラグ35とタイマ14を参照し、排他フラグ35がリセット(OFF)で且つタイマ14がカウントアップしていない場合には、Oデータ領域34にデータを書き込む。
Next, data output processing in the CPU module 1 of the programmable controller in FIG. 1 will be described below with reference to FIGS.
In FIG. 4, when the O data management driver 13 receives an O data output request from the control application 11 at any time, first, the O data area exclusion flag 35 and the timer 14 are referred to, and the exclusion flag 35 is reset (OFF). If the timer 14 has not counted up, data is written in the O data area 34.

一方、排他フラグ35がセット(ON)されているか、またはタイマ14がカウントアップしている場合には、このタイミングではOデータ領域34にはデータを書き込めないと判断し、このデータをOデータ一時退避バッファ37に書き込むと共に、割込みマスク(不図示)を解除する。   On the other hand, if the exclusive flag 35 is set (ON) or the timer 14 is counting up, it is determined that data cannot be written to the O data area 34 at this timing, and this data is temporarily stored in the O data area. While writing to the save buffer 37, the interrupt mask (not shown) is released.

排他フラグ35は、バスLSI40が、タクト周期毎に、Oデータ領域34のデータをシステムバス70上に送出する処理の開始時にセットし、終了時にリセットする。よって、排他フラグ35がセットされているときにOデータ領域34のデータを書き替えるのは問題があることになる。   The exclusion flag 35 is set at the start of the process in which the bus LSI 40 sends the data in the O data area 34 to the system bus 70 every tact cycle, and reset at the end. Therefore, there is a problem in rewriting data in the O data area 34 when the exclusive flag 35 is set.

割込みマスクは、通常時には、ハンドラ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 buffer 37 so that the interrupt by the handler 15 is raised. ing. Thus, if the mask is released at the interrupt processing start timing (when the timer 14 counts up), the handler 15 transfers the data temporarily stored in the O data temporary save buffer 37 to the O data area 34. Execute interrupt processing to move to. Here, the interrupt timing by the handler 15 is assumed to be when the timer 14 counts up, but is not limited thereto.

そして、バスLSI40が、次のタクト割込みタイミングで、Oデータ領域34からデータを読み出して、これをシステムバス70上に送出し、各出力モジュール60が受け取る。   Then, the bus LSI 40 reads data from the O data area 34 at the next tact interrupt timing, sends it to the system bus 70, and each output module 60 receives it.

以上の処理により、データ出力処理において同時性が保てるようになる理由について、図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 area exclusion flag 35 is reset. However, since the timer 14 is counting up, the O data management driver 13 The output data (here, data b) is not written in the O data area 34 but temporarily stored in the O data temporary save buffer 37 and the interrupt mask is released. In the figure, it may appear as if writing to the O data temporary save buffer 37 has been performed after the next tact interrupt timing t1, but this merely represents a time lag. . There is no problem even if the tact interrupt timing occurs during the writing process to the O data temporary saving buffer 37.

そして、割込みマスクが解除された状態でハンドラ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 timer 14 counts up in this example), the handler 15 converts the data stored in the O data temporary save buffer 37 to the O data. Move to region 34. Then, an interrupt mask is set.

ここで、タイマ14は、(タクト割込み周期)−(最大出力点数処理時間)でカウントアップするように設定されている(最大出力点数処理時間;制御アプリケーション11から、出力最大点数の出力データ書き込み要求を受けたときに(つまり、システムバス70に接続されている全ての出力モジュールに対してデータ出力する場合)、Oデータ領域34へのデータ書き込みに掛かる時間)。   Here, the timer 14 is set to count up ((tact interrupt cycle) − (maximum output point processing time)) (maximum output point processing time; a request for writing output data of the maximum output points from the control application 11). (That is, the time taken to write data to the O data area 34 when data is output to all output modules connected to the system bus 70).

これにより、タイマ14がカウントアップしてから次のタクト割込みタイミング(t2 )までに“最大出力点数処理時間”が確保されるので、ハンドラ15によるOデータ領域34へのデータ書き込み処理は、必ず、タイミングt2 より前に完了することになる。   As a result, the “maximum output point processing time” is ensured between the timer 14 counting up and the next tact interrupt timing (t 2), so the data write processing to the O data area 34 by the handler 15 is always performed. It is completed before timing t2.

これより、次のタクト割込みタイミング(t2 )で、バスLSI40は、データ書き込み処理が完了しているOデータ領域34から、データ読み出して、各出力モジュール60に配信することができるので、データ出力処理において同時性が保てることになる(制御アプリケーションを変更することなく)。   Thus, at the next tact interrupt timing (t2), the bus LSI 40 can read data from the O data area 34 for which data writing processing has been completed and distribute it to each output module 60. In this case, simultaneity can be maintained (without changing the control application).

ここで、図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 timer 14 starts from the time when the data distribution processing by the bus LSI 40 is completed between the timings t1 and t2 (from the time when the O data area exclusion flag 35 is reset in the figure). Until the count is increased, as described above, when the O data management driver 13 receives an O data output request from the control application 11, the O data management driver 13 performs a process of writing data in the O data area 34. For this reason, the data for which the output request is received later (referred to as data c) is written in the O data area 34 first, and the data in the O data temporary save buffer 37 (the data b) is then stored in the O data area 34 by the handler 15. It is written in the data area 34 (when writing is performed twice within the same tact cycle, it is not rewritten but becomes an additional form). In such a case, in the data distribution process by the bus LSI 40, the output order of the O data is reversed.

図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 timer 14 counts up, interrupt processing by the handler 15 does not occur again).

ハンドラ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 data management driver 13 writes the data c in the O data area 34. As described above, in such a case, since “rewriting” is not performed, the data stored in the O data area 34 is “b + c”. In the case of FIG. 4 and FIG. 5, it becomes “c + b” and the order is reversed, but in this example, a normal output order can be guaranteed.

本例によるプログラマブルコントローラのシステム構成図である。It is a system block diagram of the programmable controller by this example. データ入力処理の流れを説明する為の図である。It is a figure for demonstrating the flow of a data input process. データ入力処理における各記憶領域のデータ書き換えのタイミング図である。It is a timing diagram of data rewriting of each storage area in the data input process. データ出力処理の流れを説明する為の図である。It is a figure for demonstrating the flow of a data output process. データ出力処理のタイミング図である。It is a timing diagram of a data output process. データ出力処理(出力順を保証)のタイミング図である。It is a timing diagram of data output processing (guaranteed output order). 従来のプログラマブルコントローラの構成の一例を、概略的に示す図である。It is a figure which shows schematically an example of a structure of the conventional programmable controller. (a)、(b)は、従来の構成におけるデータ出力処理の問題点を説明する為の図である。(A), (b) is a figure for demonstrating the problem of the data output process in the conventional structure. 従来の構成におけるデータ入力処理の問題点を説明する為の図である。It is a figure for demonstrating the problem of the data input process in the conventional structure.

符号の説明Explanation of symbols

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 data management driver 14 timer 15 handler 20 management processor 21 I data management driver 30 shared memory 31 I data bank 32 I data bank 33 latest data bank register 34 O data area 35 O data area exclusion flag 36 I data area 37 O data temporary save buffer 40 Bus LSI
50 Input module 60 Output module 70 System bus

Claims (3)

CPUモジュールと少なくとも1以上の入力モジュール/出力モジュールがバスに接続され、タクト周期に同期して該バス上でのデータ送受信が行われるプログラマブルコントローラにおける、前記タクト周期に同期して前記バスを介して受信する各入力モジュールからの入力データを入力データ記憶領域に格納するバスLSIと、任意のタイミングで該入力データ記憶領域に格納されている入力データを読み出す制御用プロセッサとを備える前記CPUモジュールであって、
第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モジュールと少なくとも1以上の入力モジュール/出力モジュールがバスに接続され、タクト周期に同期して該バス上でのデータ送受信が行われるプログラマブルコントローラにおける、各出力モジュールに渡すべき出力データを任意のタイミングで出力データ記憶領域に格納する制御用プロセッサと、前記タクト周期に同期して、該出力データ記憶領域に格納されている出力データを前記バス上に送出するバスLSIとを備える前記CPUモジュールであって、
前記制御用プロセッサが、出力データの同時性を保証できないタイミングでデータ出力するときに、前記出力データ記憶領域に格納すべきデータを一時的に退避させる出力データ退避記憶手段と、
該退避後に、出力データの同時性を保証できるタイミングとなったとき、割込み処理により、該出力データ退避記憶手段に退避されている出力データを、前記出力データ記憶領域に移す割込み処理手段と、
を備えることを特徴とするプログラマブルコントローラにおける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:
前記割込み処理手段は、前記出力データ退避記憶手段に退避されている出力データが存在するときに、前記制御用プロセッサが次のデータ出力を行なおうとする場合にも、前記割込み処理を実行することを特徴とする請求項2記載のプログラマブルコントローラにおけるCPUモジュール。   The interrupt processing means executes the interrupt processing even when there is output data saved in the output data saving storage means, even when the control processor tries to output the next data. The CPU module in the programmable controller according to claim 2.
JP2006071630A 2006-03-15 2006-03-15 Cpu module in programmable controller Withdrawn JP2007249560A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (8)

* Cited by examiner, † Cited by third party
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