JP2008198148A - Programmable controller - Google Patents

Programmable controller Download PDF

Info

Publication number
JP2008198148A
JP2008198148A JP2007035601A JP2007035601A JP2008198148A JP 2008198148 A JP2008198148 A JP 2008198148A JP 2007035601 A JP2007035601 A JP 2007035601A JP 2007035601 A JP2007035601 A JP 2007035601A JP 2008198148 A JP2008198148 A JP 2008198148A
Authority
JP
Japan
Prior art keywords
data
module
bus
modules
programmable controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007035601A
Other languages
Japanese (ja)
Inventor
Takeshi Saito
剛 斎藤
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa 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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP2007035601A priority Critical patent/JP2008198148A/en
Publication of JP2008198148A publication Critical patent/JP2008198148A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that it takes time to update IO data so that a scan time can not be shortened because an IO module reads data from all IO modules regardless of whether data obtained from the outside is updated in a programmable controller which successively performs program execution and IO data update processing and repeats scanning. <P>SOLUTION: A bit with a different bus is allocated in each IO module, when data obtained from the outside is updated during one scanning, the bit is set to "0" and a CPU module issues an inquiry cycle for reading the allocated bit before IO data update processing, specifies an IO module in which data is updated to read only the specified IO module. Since the number of times for reading IO modules can be reduced, a time needed for updating IO data can be shortened so that a scan time can be shortened. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、ストアードプログラムによる繰り返し演算方式のプログラマブルコントローラに関し、IOデータの更新処理を高速化することができるプログラマブルコントローラに関するものである。   The present invention relates to a programmable controller of a repetitive calculation method using a stored program, and relates to a programmable controller capable of speeding up an IO data update process.

図4にプログラマブルコントローラの構成を示す。プログラマブルコントローラはその内部に格納されたプログラムを実行するCPUモジュール10と、外部との入出力を行うIOチャンネルを内蔵したIOモジュール11、12、および高機能IOモジュール13、14で構成されており、これらのモジュールはバス15で接続されている。なお、高機能IOモジュールを含んでいない場合もある。   FIG. 4 shows the configuration of the programmable controller. The programmable controller is composed of a CPU module 10 for executing a program stored therein, IO modules 11 and 12 having IO channels for input / output to / from the outside, and high-function IO modules 13 and 14. These modules are connected by a bus 15. In some cases, a high-function IO module is not included.

高機能IOモジュール13、14はIOモジュール11、12と同じく外部との入出力を行うIOチャンネルを有しているが、その内部に演算機能を具備しているモジュールである。以下、IOモジュールには高機能IOモジュールも含まれているものとする。   Like the IO modules 11 and 12, the high-function IO modules 13 and 14 have IO channels that perform input and output with the outside, and are modules that have an arithmetic function therein. Hereinafter, it is assumed that the IO module includes a high-function IO module.

図5にプログラマブルコントローラの動作を示す。プログラマブルコンローラは、内部に格納されたプログラムを実行するプログラム実行処理と、IOモジュール11〜14からデータを読み出し、またこれらのモジュールにデータを書き込むIOデータ更新処理を交互に繰り返す。プログラム実行処理とそれに引き続いて行われるIOデータ更新処理をまとめてスキャンという。プログラマブルコントローラはこのスキャンを繰り返し実行する。すなわち、プログラム実行処理の後には必ずIOデータ更新処理が行われる。   FIG. 5 shows the operation of the programmable controller. The programmable controller alternately repeats a program execution process for executing a program stored therein and an IO data update process for reading data from the IO modules 11 to 14 and writing data to these modules. The program execution process and the subsequent IO data update process are collectively called scan. The programmable controller repeatedly executes this scan. That is, the IO data update process is always performed after the program execution process.

図6にIOデータ更新テーブルの構成を示す。図6において、20a〜20nはIOモジュール番号であり、図4のIOモジュール11〜14に対応している。21a〜21nはIOチャンネル番号であり、IOモジュール21bに内蔵されているIOチャンネルに対応して設けられる。図示していないが、20b以外のIOモジュール番号20a〜20nに対しても、内蔵されているIOチャンネルに対応してIOチャンネル番号が設けられている。   FIG. 6 shows the configuration of the IO data update table. 6, 20a to 20n are IO module numbers, which correspond to the IO modules 11 to 14 in FIG. 21a to 21n are IO channel numbers, which are provided corresponding to the IO channels built in the IO module 21b. Although not shown, IO channel numbers other than 20b are also provided with IO channel numbers corresponding to the built-in IO channels.

IOモジュール番号20a〜20n、IOチャンネル番号21a〜21nは固有の番号であり、CPUモジュール10が実行するプログラムはこの固有番号を使用してIOモジュール、IOチャンネルにアクセスする。例えば、入力データの更新処理では、CPUモジュール10はバス15を介してIOモジュール11〜14からデータを読み出し、CPUモジュール10内部のメモリにこのデータを書き込む。   The IO module numbers 20a to 20n and the IO channel numbers 21a to 21n are unique numbers, and the program executed by the CPU module 10 accesses the IO modules and the IO channels using the unique numbers. For example, in the input data update process, the CPU module 10 reads data from the IO modules 11 to 14 via the bus 15 and writes this data in the memory inside the CPU module 10.

CPUモジュール10が実行するプログラムでアクセスされる可能性のあるIOモジュールおよびIOチャンネルは全てこのIOデータ更新テーブルに登録される。CPUモジュール10はIOデータ更新処理で、このIOデータ更新テーブルに登録された全てのIOモジュール、IOチャンネルについて更新処理を行う。   All IO modules and IO channels that may be accessed by a program executed by the CPU module 10 are registered in this IO data update table. The CPU module 10 performs an update process for all the IO modules and IO channels registered in the IO data update table in the IO data update process.

図7にCPUモジュール10の内部構成を示す。図7において、30はCPU、31はメモリ、32はバスインターフェイス、15はCPUモジュール10とIOモジュール11〜14を接続しているバスである。CPU30はプログラムを実行してIOデータ更新処理を行う。また、メモリ31にはIOデータ更新テーブルとIOデータが格納されている。   FIG. 7 shows the internal configuration of the CPU module 10. In FIG. 7, 30 is a CPU, 31 is a memory, 32 is a bus interface, and 15 is a bus connecting the CPU module 10 and the IO modules 11 to 14. The CPU 30 executes the program to perform the IO data update process. The memory 31 stores an IO data update table and IO data.

プログラム実行処理のときは、CPU30はメモリ31からIOデータを読み込み、このIOデータに更新処理を施して再びメモリ31に書き込む。この更新処理では、CPUは必要なビットのみ更新するが、メモリの構成に合わせて8ビットや16ビットのデータを一括して取り扱う。IOデータ更新処理では、CPU30はバスインターフェイス32を介してIOモジュール11〜14からIOデータを読み込み、メモリ31に書き込む。また、メモリ31から更新されたIOデータを読み込み、このIOデータをIOモジュール11〜14に書き込む。   In the program execution process, the CPU 30 reads IO data from the memory 31, performs an update process on the IO data, and writes the IO data again in the memory 31. In this update process, the CPU updates only the necessary bits, but handles 8-bit or 16-bit data at once according to the memory configuration. In the IO data update process, the CPU 30 reads IO data from the IO modules 11 to 14 via the bus interface 32 and writes it to the memory 31. Also, the updated IO data is read from the memory 31, and this IO data is written to the IO modules 11-14.

特開2005−174042号公報JP 2005-174042 A

しかしながら、このようなプログラマブルコントローラには次のような課題があった。CPUモジュール10は、IOモジュール11〜14のデータが更新されているかどうかを事前に知ることができなかった。そのため、IOデータ更新処理において、CPUモジュール10は実際にデータが更新されているか否かに関わらず、全てのIOモジュールのIOデータについて読み込み処理を行っていた。   However, such a programmable controller has the following problems. The CPU module 10 could not know in advance whether the data of the IO modules 11 to 14 has been updated. Therefore, in the IO data update process, the CPU module 10 performs the read process on the IO data of all the IO modules regardless of whether or not the data is actually updated.

一般に、バス15を介した読み出し、書き込み処理は、CPUモジュール10内部のメモリ31に対する読み出し、書き込み処理よりもかなり遅い。そのため、バス15を介した転送処理が多くなるとIOデータ更新処理に時間がかかり、CPUの効率が低下してスキャン時間が長くなってしまうという課題があった。   In general, the reading and writing processes via the bus 15 are considerably slower than the reading and writing processes for the memory 31 in the CPU module 10. For this reason, if the number of transfer processes via the bus 15 increases, it takes time for the IO data update process, resulting in a problem that the efficiency of the CPU decreases and the scan time becomes long.

また、バス15に複数のCPUモジュールが接続されているマルチCPU構成のプログラマブルコントローラでは、複数のCPUがバス15をアクセスするためにバス15の使用率が高くなり、このバスを使用するための待ち時間が増加し、CPUの効率が更に低下し、スキャン時間が長くなってしまうという課題もあった。   Further, in a programmable controller having a multi-CPU configuration in which a plurality of CPU modules are connected to the bus 15, the usage rate of the bus 15 is high because a plurality of CPUs access the bus 15, and a wait for using this bus is required. There is also a problem that the time is increased, the efficiency of the CPU is further lowered, and the scanning time is lengthened.

従って本発明の目的は、更新されていないIOデータの読み込み処理を行わないようにすることにより、IOモジュールからの読み込み回数を少なくすると共に、IOモジュールが接続されているバスの使用率を下げ、スキャン時間を短くすることができるプログラマブルコントローラを提供することにある。   Therefore, an object of the present invention is to reduce the number of times of reading from the IO module by reducing the read processing of IO data that has not been updated, and to reduce the usage rate of the bus to which the IO module is connected, An object of the present invention is to provide a programmable controller that can shorten the scan time.

このような課題を解決するために、本発明のうち請求項1記載の発明は、
複数のモジュールがバスを介して接続され、プログラムの実行処理とそれに引き続くIOデータ更新処理からなるスキャンを繰り返し実行するプログラマブルコントローラにおいて、
外部からデータを収集すると共に、
1スキャンの間、前記収集したデータを保持するデータ保持部と、
このデータ保持部に保持されたデータと収集したデータが入力され、これらのデータを比較して、一致しているか否かを表す信号を出力する比較部と、
バスに接続された他の機器と通信を行うと共に、問い合わせがあったときに、前記比較部の出力に基づいて割り当てられたビットの状態を決定するバスインターフェイスと、
を具備したIOモジュールと、
前記プログラム実行処理とIOデータ更新処理を実行すると共に、接続されているIOモジュールに前記バスの異なったビットを割り当て、前記IOデータ更新処理を行う前に問い合わせを行い、この問い合わせで読み込んだデータに基づいて収集したデータが変更されているIOモジュールを特定して、この特定したIOモジュールのデータを読み込むCPUモジュールと、
を具備したものである。データが更新されていないIOモジュールのデータを読み込まないので、スキャン時間を短くすることができる。
In order to solve such a problem, the invention according to claim 1 of the present invention,
In a programmable controller in which a plurality of modules are connected via a bus and repeatedly execute a scan including a program execution process and a subsequent IO data update process.
While collecting data from outside,
A data holding unit for holding the collected data during one scan;
The data held in the data holding unit and the collected data are input, the data is compared, and a comparison unit that outputs a signal indicating whether or not they match,
A bus interface that communicates with other devices connected to the bus and determines the state of the assigned bit based on the output of the comparison unit when inquired;
An IO module comprising:
The program execution process and the IO data update process are executed, different bits of the bus are allocated to the connected IO modules, and an inquiry is made before the IO data update process is performed. A CPU module that identifies the IO module whose data collected based on it is changed, and reads the data of the identified IO module;
Is provided. Since the data of the IO module whose data has not been updated is not read, the scan time can be shortened.

請求項2記載の発明は、請求項1記載の発明において、
前記問い合わせでは、IOモジュールは応答を返さず、かつCPUモジュールは一定時間の後にこの問い合わせサイクルを終了するようにしたものである。アクセス時間を短くすることができる。
The invention according to claim 2 is the invention according to claim 1,
In the inquiry, the IO module does not return a response, and the CPU module ends the inquiry cycle after a predetermined time. The access time can be shortened.

請求項3記載の発明は、請求項1若しくは請求項2記載の発明において、
前記問い合わせサイクルは、前記バスの制御線および/またはアドレス線上の信号によって他のサイクルと区別するようにしたものである。簡単に他のサイクルと区別できる。
The invention according to claim 3 is the invention according to claim 1 or claim 2,
The inquiry cycle is distinguished from other cycles by signals on the control line and / or address line of the bus. It can be easily distinguished from other cycles.

請求項4記載の発明は、請求項1乃至請求項3いずれかに記載の発明において、
前記IOモジュールを複数のグループに分割し、これらのグループを区別するためにビットを割り付け、各グループ内でIOモジュールを区別するためにビットを割り付けて、IOモジュールは、グループの問い合わせのときはグループを区別するために割り付けられたビットを有効にし、自己が属するグループ内のIOモジュールの問い合わせのときは、グループ内でのIOモジュールを区別するために割り付けられたビットを有効にするようにしたものである。使用できるビット数よりも多いIOモジュールを扱うことができる。
The invention according to claim 4 is the invention according to any one of claims 1 to 3,
The IO module is divided into a plurality of groups, bits are assigned to distinguish these groups, and bits are assigned to distinguish IO modules within each group. The bit allocated to distinguish the IO module in the group to which the self belongs is enabled when the IO module in the group to which the self belongs is inquired. It is. More IO modules than the number of usable bits can be handled.

請求項5記載の発明は、請求項4記載の発明において、
前記グループを更にサブグループに分割するようにしたものである。扱えるIOモジュールの数を更に増やすことができる。
The invention according to claim 5 is the invention according to claim 4,
The group is further divided into subgroups. The number of IO modules that can be handled can be further increased.

請求項6記載の発明は、請求項4若しくは請求項5記載の発明において、
バスマスタになることができる複数のCPUモジュールを具備し、これらのCPUモジュールは自身に関係しているIOモジュールにのみ問い合わせを行うようにしたものである。問い合わせサイクルを少なくすることができる。
The invention according to claim 6 is the invention according to claim 4 or claim 5,
A plurality of CPU modules that can become bus masters are provided, and these CPU modules make inquiries only to IO modules related to themselves. The number of inquiry cycles can be reduced.

請求項7記載の発明は、
複数のモジュールがバスを介して接続され、プログラムの実行処理とそれに引き続くIOデータ更新処理からなるスキャンを繰り返し実行するプログラマブルコントローラにおいて、
外部からデータを収集すると共に、
1スキャンの間前記収集したデータを保持するデータ保持部と、
このデータ保持部に保持されたデータと収集したデータが入力され、これらのデータを比較して、一致しているか否かを表す信号を出力する比較部と、
バスに接続された他の機器と通信を行うと共に、バスが空いているときに、前記比較部の出力に基づいて割り当てられたビットの状態を決定するバスインターフェイスと、
を具備したIOモジュールと、
前記プログラム実行処理とIOデータ更新処理を実行すると共に、接続されているIOモジュールに前記バスの異なったビットを割り当て、バスが空いているときにIOモジュールが出力するビットで構成されたデータを読み込み、この読み込んだデータに基づいて収集したデータが変更されているIOモジュールを特定して、この特定したIOモジュールのデータを読み込むCPUモジュールと、
を具備したものである。スキャン時間を短くすることができ、かつ問い合わせサイクルをなくすることができる。
The invention described in claim 7
In a programmable controller in which a plurality of modules are connected via a bus and repeatedly execute a scan including a program execution process and a subsequent IO data update process.
While collecting data from outside,
A data holding unit for holding the collected data during one scan;
The data held in the data holding unit and the collected data are input, the data is compared, and a comparison unit that outputs a signal indicating whether or not they match,
A bus interface that communicates with other devices connected to the bus and determines the state of the assigned bit based on the output of the comparison unit when the bus is free;
An IO module comprising:
Executes the program execution process and IO data update process, assigns different bits of the bus to the connected IO modules, and reads data composed of bits output by the IO module when the bus is free A CPU module that identifies an IO module whose collected data has been changed based on the read data, and reads the data of the identified IO module;
Is provided. The scan time can be shortened and the inquiry cycle can be eliminated.

請求項8記載の発明は、請求項1乃至請求項7いずれかに記載の発明において、
前記割り付けるビットとして、データ線の他にアドレス線をも用いるようにしたものである。一度に扱えるIOモジュールの数を増やすことができる。
The invention according to claim 8 is the invention according to any one of claims 1 to 7,
In addition to data lines, address lines are also used as the allocated bits. The number of IO modules that can be handled at a time can be increased.

以上説明したことから明らかなように、本発明によれば次のような効果がある。
請求項1,2、3、4、5、6、7および8の発明によれば、IOモジュールにバスの異なったビットを割り当て、IOモジュールは1スキャンの間に外部から取り込むデータが更新されたときにこのビットを変化させて、CPUモジュールはIOデータ更新処理の前に問い合わせサイクルでこの割り当てたビットで構成される変更フラグデータを読み込んで、データが更新されているIOモジュールからのみデータを読み込むようにした。
As is apparent from the above description, the present invention has the following effects.
According to the first, second, third, fourth, fifth, sixth, seventh and eighth aspects of the invention, different bits of the bus are assigned to the IO module, and the IO module is updated with data fetched from outside during one scan. Sometimes this bit is changed, and the CPU module reads the change flag data composed of the assigned bit in the inquiry cycle before the IO data update process, and reads the data only from the IO module whose data has been updated. I did it.

データが更新されていないIOモジュールに対してはデータの読み込みを行わないので、IOモジュールからの読み込み回数を削減することができる。そのため、IOデータ更新処理の時間を短縮することができ、スキャン時間を短くすることができるという効果がある。また、IOモジュールからの読み込み作業が少なくなるとメモリのアクセス回数も減少するので、更にスキャン時間を短縮することができる。   Since data is not read from an IO module whose data has not been updated, the number of reads from the IO module can be reduced. For this reason, the IO data update processing time can be shortened, and the scan time can be shortened. Further, since the number of memory accesses is reduced when the reading operation from the IO module is reduced, the scanning time can be further reduced.

また、IOモジュールをグループ分けし、グループ毎にデータが更新されているかを表すビットを割り付けることにより、取り扱えるIOモジュールの数を増加させることができる。更に、データが更新されているかを表すビットを、バスが空いているときにCPUモジュールに送信するようにすると、問い合わせサイクルをなくすることができ、スキャン時間を更に削減することができるという効果もある。   In addition, the number of IO modules that can be handled can be increased by dividing the IO modules into groups and assigning bits indicating whether the data is updated for each group. Furthermore, if a bit indicating whether data is updated is transmitted to the CPU module when the bus is free, an inquiry cycle can be eliminated, and the scan time can be further reduced. is there.

以下本発明を、図面を用いて詳細に説明する。図1は本発明に係るプログラマブルコントローラに内蔵されているIOモジュールの構成図である。なお、発明に無関係な要素は、記載を省略している。図1において、40はフィールド側インターフェイスであり、フィールドバス(図示せず)を介してフィールド機器41a〜41nが接続されている。フィールド機器41a〜41nはフィールド側インターフェイス40を介してデータを交換する。42はデータ保持部であり、フィールド機器41a〜41nから取得したデータが一時的に保持される。このデータはスキャン毎に更新される。   Hereinafter, the present invention will be described in detail with reference to the drawings. FIG. 1 is a configuration diagram of an IO module built in a programmable controller according to the present invention. Note that elements not related to the invention are omitted. In FIG. 1, reference numeral 40 denotes a field-side interface, to which field devices 41a to 41n are connected via a field bus (not shown). The field devices 41 a to 41 n exchange data via the field side interface 40. A data holding unit 42 temporarily holds data acquired from the field devices 41a to 41n. This data is updated every scan.

43は比較部であり、データ保持部42に格納されたデータ、およびフィールド側インターフェイス40の出力データが入力される。比較部43はこれらのデータを比較して、その結果を出力する。データ保持部42には、前回CPUモジュールがデータを読み込んだ時点のデータが保存されている。従って、比較部43の出力は、前回CPUモジュールがデータを読み込んでから、フィールド側インターフェイス40を介して取得したデータが変更されたかどうかを表している。   Reference numeral 43 denotes a comparison unit to which data stored in the data holding unit 42 and output data of the field side interface 40 are input. The comparison unit 43 compares these data and outputs the result. The data holding unit 42 stores data at the time when the CPU module previously read data. Therefore, the output of the comparison unit 43 indicates whether or not the data acquired via the field-side interface 40 has been changed since the previous CPU module read the data.

44はバスインターフェイスであり、比較部43の出力が入力される。バスインターフェイス44は、図7のバスインターフェイス32と同様にバス15とのインターフェイスの機能を有するが、それ以外に比較部43の出力から変更フラグデータを作成する機能を有する。   Reference numeral 44 denotes a bus interface, to which the output of the comparison unit 43 is input. The bus interface 44 has a function of interfacing with the bus 15 similarly to the bus interface 32 of FIG. 7, but also has a function of creating change flag data from the output of the comparison unit 43.

変更フラグデータは、当該IOモジュールのデータが変更されたかどうかを表すデータであり、各IOモジュール毎にバス15のデータラインの異なったビットが割り当てられている。CPUモジュール10は、プログラマブルコントローラの動作開始時に、異なったビットを接続されているIOモジュールに割り当てる。バスインターフェイス44は、自身が属するIOモジュールに割り当てられているビットについて、比較部43の比較結果が“変更されている”ならそのビットを“0”にし、“変更されていない”なら“1”にする。割り当てられていないビットは全てハイインピーダンスにする。   The change flag data is data indicating whether or not the data of the IO module has been changed, and different bits of the data line of the bus 15 are assigned to each IO module. The CPU module 10 assigns different bits to the connected IO modules when the programmable controller starts operating. The bus interface 44 sets the bit assigned to the IO module to which the bus interface 44 belongs to “0” if the comparison result of the comparison unit 43 is “changed”, and “1” if the bit is not changed. To. All unassigned bits are set to high impedance.

バス15のデータラインを全て抵抗でプルアップしておくと、変更フラグデータは、データが変更されたIOモジュールに対応するビットのみ低レベルになり、対応するIOモジュールのデータが変更されていないビット、およびIOモジュールが割り当てられていないビットは高レベルになる。従って、この変更フラグデータを参照するだけで、CPUモジュールはどのIOモジュールのデータが変更されているかを知ることができる。   If all the data lines of the bus 15 are pulled up with resistors, the change flag data is a low level only for the bit corresponding to the IO module whose data has been changed, and the bit for which the data of the corresponding IO module has not been changed. , And a bit to which no IO module is assigned goes high. Therefore, only by referring to the change flag data, the CPU module can know which IO module data has been changed.

図2は、この実施例によるプログラマブルコントローラの動作を示すフローチャートである。なお、本発明に関係がない部分は、記載を省略している。図2において、工程(P2−1)でCPUモジュールは、接続されているIOモジュールに異なったビットを割り当てる。これによって、各IOモジュール内のバスインターフェイスは、割り当てられたビット以外のビットをハイインピーダンスにし、割り当てられたビットに比較部43の出力を反映させる。   FIG. 2 is a flowchart showing the operation of the programmable controller according to this embodiment. In addition, the description which is not related to the present invention is omitted. In FIG. 2, the CPU module assigns different bits to the connected IO module in step (P2-1). As a result, the bus interface in each IO module sets the bits other than the assigned bits to high impedance, and reflects the output of the comparison unit 43 in the assigned bits.

次に、工程(P2−2)でCPUモジュールは問い合わせサイクルを発行し、変更フラグデータを読み込む。そして、工程(P2−3)で読み込んだ変更フラグデータから、データが変更されているIOモジュールを特定し、工程(P2−4)で変更フラグデータをクリアする。すなわち、全ビットを“1”にする。   Next, in step (P2-2), the CPU module issues an inquiry cycle and reads the change flag data. Then, the IO module whose data has been changed is specified from the change flag data read in step (P2-3), and the change flag data is cleared in step (P2-4). That is, all bits are set to “1”.

そして、工程(P2−5)で、特定したIOモジュールに対して転送サイクルを発行し、データを読み込む。変更フラグデータで“1”となったビットに対応するIOモジュールのデータは読み込まない。そして、工程(P−6)で次のスキャンまで待機し、工程(P2−2)に戻る。   In step (P2-5), a transfer cycle is issued to the identified IO module, and data is read. Data of the IO module corresponding to the bit that is “1” in the change flag data is not read. In step (P-6), the process waits until the next scan and returns to step (P2-2).

この実施例では問い合わせサイクルが追加されるのでバスサイクルは増えるが、IOモジュールからの読み込み回数が減るので、結果としてバスのアクセス回数が減り、スキャン時間を減らすことができる。特に、使用するIOモジュールが多いときに、効果が大きくなる。   In this embodiment, since an inquiry cycle is added, the number of bus cycles increases, but the number of reads from the IO module decreases, resulting in a decrease in the number of bus accesses and a reduction in scan time. In particular, the effect is increased when there are many IO modules to be used.

CPUモジュールが変更フラグデータを読み込む“問い合わせサイクル”は特定のIOモジュールを対象にしたものではないので、“問い合わせサイクル”を受信したIOモジュールは応答信号を出力しない。CPUモジュールは応答信号を期待せず、一定時間後にこのサイクルを終了する。“問い合わせサイクル”であるかどうかは、バス15の制御線とアドレス線(どちらか一方でもよい)を使用して区別する。   Since the “inquiry cycle” in which the CPU module reads the change flag data is not intended for a specific IO module, the IO module that has received the “inquiry cycle” does not output a response signal. The CPU module does not expect a response signal and ends this cycle after a certain time. Whether or not it is an “inquiry cycle” is discriminated by using a control line and an address line (whichever is sufficient) of the bus 15.

接続されているIOモジュールの数が多く、バス15のデータラインのビットに1対1に対応できないときは、変更フラグデータを複数個用いる。この実施例を、図3を用いて説明する。この実施例では接続されているIOモジュールを12個(M1〜M12)とし、変更フラグデータのビット数が4であるとする。   When the number of connected IO modules is large and cannot correspond one-to-one to the bits of the data line of the bus 15, a plurality of change flag data are used. This embodiment will be described with reference to FIG. In this embodiment, it is assumed that the number of connected IO modules is 12 (M1 to M12) and the number of bits of the change flag data is 4.

この実施例では変更フラグデータを4つ用いる。IOモジュールM1〜M12を3つのグループ(M1〜M4、M5〜M8、M9〜M12)に分け、変更フラグデータの1つ(変更フラグデータ1)の各ビットをグループに割り当てる。すなわち、グループ1(M1〜M4)をビット0、グループ2(M5〜M8)をビット1、グループ3(M9〜M12)をビット2に割り当てる。   In this embodiment, four change flag data are used. The IO modules M1 to M12 are divided into three groups (M1 to M4, M5 to M8, and M9 to M12), and each bit of one of the change flag data (change flag data 1) is assigned to the group. That is, group 1 (M1 to M4) is assigned to bit 0, group 2 (M5 to M8) is assigned to bit 1, and group 3 (M9 to M12) is assigned to bit 2.

そして、各グループに異なる変更フラグデータを割り当て、各グループ内のIOモジュールに異なったビットを割り当てる。図3では、M1、M5、M9にビット0を、M2、M6、M10にビット1を、M3、M7、M11にビット2を、M4、M8、M12にビット3を割り当てる。   Then, different change flag data is assigned to each group, and different bits are assigned to the IO modules in each group. In FIG. 3, bit 0 is assigned to M1, M5, and M9, bit 1 is assigned to M2, M6, and M10, bit 2 is assigned to M3, M7, and M11, and bit 3 is assigned to M4, M8, and M12.

CPUモジュールは、最初に変更フラグデータ1を問い合わせる。このデータの全ビットが“1”であると全IOモジュールのデータが変更されてないので、読み込みを行わない。“0”であるビットがあると、そのビットに対応するグループの変更フラグデータを読み込み、データが変更されたIOモジュールを特定して、そのIOモジュールのデータのみ読み込む。このようにすると、全IOモジュールのデータが変更されていない場合は変更フラグデータ1のみ読み込めばよいので、問い合わせサイクルの回数を少なくすることができる。   The CPU module first queries the change flag data 1. If all the bits of this data are “1”, the data of all the IO modules are not changed, so that reading is not performed. If there is a bit that is “0”, the change flag data of the group corresponding to that bit is read, the IO module whose data has been changed is specified, and only the data of that IO module is read. In this way, when the data of all the IO modules has not been changed, only the change flag data 1 needs to be read, so that the number of inquiry cycles can be reduced.

変更フラグデータを3つ用い、M1〜M12のIOモジュールをこれらのデータのビットに順番に割り当てることも考えられるが、この場合は3つの変更フラグデータを全て読み込まないとデータが変更されているかわからないので、データが変更されるIOモジュールの数が少ない場合や特定のIOモジュールに集中する場合は、図3の割り当てにした方が、変更フラグデータの読み込み回数を少なくすることができる。   It is possible to use three change flag data and assign the IO modules of M1 to M12 to the bits of these data in order, but in this case, it is not known whether the data has been changed unless all three change flag data are read. Therefore, when the number of IO modules whose data is changed is small or when the data is concentrated on a specific IO module, the number of times of reading the change flag data can be reduced by the assignment shown in FIG.

なお、IOモジュールの数が多く、図3の割り当てでは収容できないときは、グループを更にサブグループに分け、このサブグループに変更フラグデータを割り当てればよい。また、複数の変更フラグデータを用いる場合、アドレス線でデータを区別するが、使用していないアドレス線があると、そのアドレス線にIOモジュールのビットを割り当てることもできる。このようにすると、一回の問い合わせで確認できるIOモジュールの数を増やすことができる。   If the number of IO modules is large and cannot be accommodated by the assignment shown in FIG. 3, the group may be further divided into subgroups, and change flag data may be assigned to the subgroups. When a plurality of change flag data is used, the data is distinguished by the address line. If there is an unused address line, the bit of the IO module can be assigned to the address line. In this way, the number of IO modules that can be confirmed by one inquiry can be increased.

また、バスマスタになるCPUモジュールを複数個用い、図3に示したようにIOモジュールをグループ分けする場合、各CPUモジュールは自身がアクセスするIOモジュールに関係する変更フラグデータに対してのみ問い合わせサイクルを発行するようにすると、問い合わせサイクルの数を減らすことができる。   In addition, when a plurality of CPU modules serving as bus masters are used and IO modules are grouped as shown in FIG. 3, each CPU module performs an inquiry cycle only for change flag data related to the IO modules that it accesses. If issued, the number of inquiry cycles can be reduced.

さらに、これらの実施例では問い合わせサイクルで変更されているIOモジュールを表す変更フラグデータを読み込むようにしたが、バス15が使用されていないときに、IOモジュールのデータが変更されているか否かのデータをCPUモジュールに送信するようにしてもよい。このようにすると、問い合わせサイクルをなくすることができるので、更に高速化が可能である。   Furthermore, in these embodiments, the change flag data indicating the IO module changed in the inquiry cycle is read, but whether or not the data of the IO module is changed when the bus 15 is not used. Data may be transmitted to the CPU module. In this way, the inquiry cycle can be eliminated, and the speed can be further increased.

本発明の一実施例を示す構成図である。It is a block diagram which shows one Example of this invention. 本発明の一実施例の動作を示すフローチャートである。It is a flowchart which shows operation | movement of one Example of this invention. 変更フラグデータのビット割りつけを示す図である。It is a figure which shows bit allocation of change flag data. プログラマブルコントローラの構成図である。It is a block diagram of a programmable controller. プログラマブルコントローラの動作を示す図である。It is a figure which shows operation | movement of a programmable controller. IOデータ更新テーブルの構成図である。It is a block diagram of IO data update table. CPUモジュールの構成図である。It is a block diagram of a CPU module.

符号の説明Explanation of symbols

10 CPUモジュール
11、12 IOモジュール
13、14 高機能IOモジュール
15 バス
20a〜20n IOモジュール番号
21a〜21n IOチャンネル番号
30 CPU
31 メモリ
32、44 バスインターフェイス
40 フィールド側インターフェイス
41a〜41n フィールド機器
42 データ保持部
43 比較部
10 CPU module 11, 12 IO module 13, 14 High function IO module 15 Bus 20a-20n IO module number 21a-21n IO channel number 30 CPU
31 Memory 32, 44 Bus interface 40 Field side interface 41a-41n Field device 42 Data holding part 43 Comparison part

Claims (8)

複数のモジュールがバスを介して接続され、プログラムの実行処理とそれに引き続くIOデータ更新処理からなるスキャンを繰り返し実行するプログラマブルコントローラにおいて、
外部からデータを収集すると共に、
1スキャンの間、前記収集したデータを保持するデータ保持部と、
このデータ保持部に保持されたデータと収集したデータが入力され、これらのデータを比較して、一致しているか否かを表す信号を出力する比較部と、
バスに接続された他の機器と通信を行うと共に、問い合わせがあったときに、前記比較部の出力に基づいて割り当てられたビットの状態を決定するバスインターフェイスと、
を具備したIOモジュールと、
前記プログラム実行処理とIOデータ更新処理を実行すると共に、接続されているIOモジュールに前記バスの異なったビットを割り当て、前記IOデータ更新処理を行う前に問い合わせを行い、この問い合わせで読み込んだデータに基づいて収集したデータが変更されているIOモジュールを特定して、この特定したIOモジュールのデータを読み込むCPUモジュールと、
を具備したことを特徴とするプログラマブルコントローラ。
In a programmable controller in which a plurality of modules are connected via a bus and repeatedly execute a scan including a program execution process and a subsequent IO data update process.
While collecting data from outside,
A data holding unit for holding the collected data during one scan;
The data held in the data holding unit and the collected data are input, the data is compared, and a comparison unit that outputs a signal indicating whether or not they match,
A bus interface that communicates with other devices connected to the bus and determines the state of the assigned bit based on the output of the comparison unit when inquired;
An IO module comprising:
The program execution process and the IO data update process are executed, different bits of the bus are allocated to the connected IO modules, and an inquiry is made before the IO data update process is performed. A CPU module that identifies the IO module whose data collected based on it is changed, and reads the data of the identified IO module;
A programmable controller comprising:
前記問い合わせでは、IOモジュールは応答を返さず、かつCPUモジュールは一定時間の後にこの問い合わせサイクルを終了するようにしたことを特徴とする請求項1記載のプログラマブルコントローラ。   2. The programmable controller according to claim 1, wherein the IO module does not return a response to the inquiry, and the CPU module ends the inquiry cycle after a predetermined time. 前記問い合わせサイクルは、前記バスの制御線および/またはアドレス線上の信号によって他のサイクルと区別するようにしたことを特徴とする請求項1若しくは請求項2記載のプログラマブルコントローラ。   3. The programmable controller according to claim 1, wherein the inquiry cycle is distinguished from other cycles by a signal on a control line and / or an address line of the bus. 前記IOモジュールを複数のグループに分割し、これらのグループを区別するためにビットを割り付け、各グループ内でIOモジュールを区別するためにビットを割り付けて、IOモジュールは、グループの問い合わせのときはグループを区別するために割り付けられたビットを有効にし、自己が属するグループ内のIOモジュールの問い合わせのときは、グループ内でのIOモジュールを区別するために割り付けられたビットを有効にするようにしたことを特徴とする請求項1乃至請求項3いずれかに記載のプログラマブルコントローラ。   The IO module is divided into a plurality of groups, bits are assigned to distinguish these groups, and bits are assigned to distinguish IO modules within each group. The allocated bit is enabled to distinguish the I / O module, and when querying the IO module in the group to which the self belongs, the allocated bit is enabled to distinguish the IO module in the group. The programmable controller according to any one of claims 1 to 3, wherein: 前記グループを更にサブグループに分割するようにしたことを特徴とする請求項4記載のプログラマブルコントローラ。   The programmable controller according to claim 4, wherein the group is further divided into subgroups. バスマスタになることができる複数のCPUモジュールを具備し、これらのCPUモジュールは自身に関係しているIOモジュールにのみ問い合わせを行うようにしたことを特徴とする請求項4若しくは請求項5記載のプログラマブルコントローラ。   6. The programmable according to claim 4, further comprising a plurality of CPU modules capable of becoming a bus master, wherein these CPU modules make an inquiry only to an IO module related to the CPU module. controller. 複数のモジュールがバスを介して接続され、プログラムの実行処理とそれに引き続くIOデータ更新処理からなるスキャンを繰り返し実行するプログラマブルコントローラにおいて、
外部からデータを収集すると共に、
1スキャンの間前記収集したデータを保持するデータ保持部と、
このデータ保持部に保持されたデータと収集したデータが入力され、これらのデータを比較して、一致しているか否かを表す信号を出力する比較部と、
バスに接続された他の機器と通信を行うと共に、バスが空いているときに、前記比較部の出力に基づいて割り当てられたビットの状態を決定するバスインターフェイスと、
を具備したIOモジュールと、
前記プログラム実行処理とIOデータ更新処理を実行すると共に、接続されているIOモジュールに前記バスの異なったビットを割り当て、バスが空いているときにIOモジュールが出力するビットで構成されたデータを読み込み、この読み込んだデータに基づいて収集したデータが変更されているIOモジュールを特定して、この特定したIOモジュールのデータを読み込むCPUモジュールと、
を具備したことを特徴とするプログラマブルコントローラ。
In a programmable controller in which a plurality of modules are connected via a bus and repeatedly execute a scan including a program execution process and a subsequent IO data update process.
While collecting data from outside,
A data holding unit for holding the collected data during one scan;
The data held in the data holding unit and the collected data are input, the data is compared, and a comparison unit that outputs a signal indicating whether or not they match,
A bus interface that communicates with other devices connected to the bus and determines the state of the assigned bit based on the output of the comparison unit when the bus is free;
An IO module comprising:
Executes the program execution process and IO data update process, assigns different bits of the bus to the connected IO modules, and reads data composed of bits output by the IO module when the bus is free A CPU module that identifies an IO module whose collected data has been changed based on the read data, and reads the data of the identified IO module;
A programmable controller comprising:
前記割り付けるビットとして、データ線の他にアドレス線をも用いるようにしたことを特徴とする請求項1乃至請求項7いずれかに記載のプログラマブルコントローラ。   8. The programmable controller according to claim 1, wherein an address line is also used in addition to a data line as the assigned bit.
JP2007035601A 2007-02-16 2007-02-16 Programmable controller Pending JP2008198148A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007035601A JP2008198148A (en) 2007-02-16 2007-02-16 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007035601A JP2008198148A (en) 2007-02-16 2007-02-16 Programmable controller

Publications (1)

Publication Number Publication Date
JP2008198148A true JP2008198148A (en) 2008-08-28

Family

ID=39756996

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007035601A Pending JP2008198148A (en) 2007-02-16 2007-02-16 Programmable controller

Country Status (1)

Country Link
JP (1) JP2008198148A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010061581A1 (en) * 2008-11-26 2010-06-03 横河電機株式会社 Sequence control device, module device, and connection device
US8839199B2 (en) 2010-01-20 2014-09-16 Mitsubishi Electric Corporation Programmable controller system and development system
JP2015103043A (en) * 2013-11-26 2015-06-04 横河電機株式会社 I/o module and process control system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010061581A1 (en) * 2008-11-26 2010-06-03 横河電機株式会社 Sequence control device, module device, and connection device
JP2010152872A (en) * 2008-11-26 2010-07-08 Yokogawa Electric Corp Sequence control device, and module device and connection device
US8839199B2 (en) 2010-01-20 2014-09-16 Mitsubishi Electric Corporation Programmable controller system and development system
JP2015103043A (en) * 2013-11-26 2015-06-04 横河電機株式会社 I/o module and process control system
US9645907B2 (en) 2013-11-26 2017-05-09 Yokogawa Electric Corporation I/O module and process control system

Similar Documents

Publication Publication Date Title
JP5040660B2 (en) Storage area allocation system and method, and control apparatus
EP3657337B1 (en) Method, apparatus, device and storage medium for accessing static random access memory
JP2004192622A (en) Method and data processing system for microprocessor communication in cluster based multiprocessor radio network
JP2001142842A (en) Dma handshake protocol
US20050223147A1 (en) Method and apparatus for allocating bus access rights in multimaster bus systems
CN1818856A (en) Digital signal system possessing accelerator and method of operation
EP3062232B1 (en) Method and device for automatically exchanging signals between embedded multi-cpu boards
CN114253884B (en) FPGA-based multi-master-to-multi-slave access arbitration method, system and storage medium
US8407424B2 (en) Data coherence method and apparatus for multi-node computer system
JP2845433B2 (en) Integrated circuit device
US20060212642A1 (en) Partition allocation method and computer system
US20080250194A1 (en) Two-dimensional writing data method for flash memory and corresponding storage device
JP2004192619A (en) Method, processing unit and data processing system for microprocessor communication in multiprocessor system
JP2008198148A (en) Programmable controller
CN103377135B (en) Addressing method, Apparatus and system
JP2008046771A (en) Direct memory access controller
CN109324899B (en) Addressing method and device based on PCIe (peripheral component interface express) pooled hardware resources and master control node
JP2004192621A (en) Method and data processing system for microprocessor communication in cluster based multiprocessor system
US7788466B2 (en) Integrated circuit with a plurality of communicating digital signal processors
TWI467385B (en) Mapping between two buses using serial addressing bits
WO2012127534A1 (en) Barrier synchronization method, barrier synchronization device and processing device
CN108038061B (en) Address allocation method and PLC system
US20030167386A1 (en) Control chip and method for accelerating memory access
US7000089B2 (en) Address assignment to transaction for serialization
CN111026688A (en) Three-dimensional DMA transmission method based on command linked list