JP2011216085A - Programmable controller - Google Patents
Programmable controller Download PDFInfo
- Publication number
- JP2011216085A JP2011216085A JP2011057306A JP2011057306A JP2011216085A JP 2011216085 A JP2011216085 A JP 2011216085A JP 2011057306 A JP2011057306 A JP 2011057306A JP 2011057306 A JP2011057306 A JP 2011057306A JP 2011216085 A JP2011216085 A JP 2011216085A
- Authority
- JP
- Japan
- Prior art keywords
- unit
- time
- master
- slave
- units
- 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.)
- Granted
Links
Images
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
本発明は、プログラマブルコントローラに関するもので、特に、同期制御等を行うために必要な各ユニット間で時刻を合わる技術に関する。 The present invention relates to a programmable controller, and more particularly, to a technique for setting the time between units necessary for performing synchronous control and the like.
FA(Factory Automation)におけるネットワークシステムは、生産工場内に配備された産業ロボットその他の生産設備の入力機器及び出力機器の制御を司る1または複数のPLC(Programmable Logic Controller)と、そのPLCにより動作が制御される機器とが、制御系のネットワークに接続される。制御系のネットワークに接続される複数の制御装置が同期制御を行う場合、それぞれの制御装置は、定期的に内部時計の時刻合わせを行う。つまり、マスタユニットとなる1台の制御装置が、自己の内部時計が示す時刻情報を他の制御装置に送り、他の制御装置は受け取った時刻情報に基づいて自己の内部時計を修正する。これにより、複数の制御装置の内部時計が示す時刻が一致し、その時刻に基づいて同期運転が行われる。この種の時刻合わせの技術は、例えば特許文献1に開示されている。従来の同期運転や時刻合わせは、もっぱらネットワークに接続される複数の制御装置間で行われている。 The network system in FA (Factory Automation) is operated by one or more PLCs (Programmable Logic Controllers) that control the input and output devices of industrial robots and other production equipment deployed in the production factory, and the PLCs. The device to be controlled is connected to a control system network. When a plurality of control devices connected to the control system network perform synchronous control, each control device periodically adjusts the time of the internal clock. That is, one control device serving as a master unit sends the time information indicated by its own internal clock to another control device, and the other control device corrects its own internal clock based on the received time information. As a result, the times indicated by the internal clocks of the plurality of control devices coincide with each other, and the synchronous operation is performed based on the times. This type of time adjustment technique is disclosed in Patent Document 1, for example. Conventional synchronous operation and time adjustment are performed exclusively between a plurality of control devices connected to the network.
一方、特許文献2に開示されるように、PLCを構成する複数のユニット間で、時刻合わせを行う技術も提案されている。すなわち、PLCは、複数のユニットを連結して構成される。各ユニットは、時計を内蔵し、その時計に合わせて指定された動作(制御値の出力,データの取得等)を行なう。各ユニットの内部時計の時刻を合わせは、基本的には、特許文献1と同様に、いずれか1つのユニット(マスタユニット)の内部時計の時刻情報を、他のユニット(スレーブユニット)に送り、スレーブユニットは、取得した時刻情報にあわせて自己の内部時計の時刻を修正する。特許文献2は、この修正の際に、内部時計の時刻をいきなり取得した時刻情報に上書きして更新するのではなく、時間の進み方を増減することで、マスタユニットの内部時計とのずれを徐々になくすように修正するものである。 On the other hand, as disclosed in Patent Document 2, a technique for performing time adjustment among a plurality of units constituting a PLC has also been proposed. That is, the PLC is configured by connecting a plurality of units. Each unit has a built-in clock and performs specified operations (control value output, data acquisition, etc.) according to the clock. To adjust the time of the internal clock of each unit, basically, as in Patent Document 1, the time information of the internal clock of any one unit (master unit) is sent to another unit (slave unit), The slave unit corrects the time of its own internal clock according to the acquired time information. Patent Document 2 does not update the time of the internal clock by overwriting the acquired time information at the time of this correction, but instead of updating the time advancement, the deviation from the internal clock of the master unit is corrected. The correction is made so that it is gradually lost.
マスタユニットから送信したフレームは、伝送路を伝わってスレーブユニットで受信されるので、受信した時点では、送信時から一定の遅れが生じている。そのため、時刻合わせのために現在時刻“T”を格納したフレームをマスタユニットが送信したとしても、各スレーブユニットがそのフレームを受信したときには、すでに時刻“T”から所定時間経過しているため、各スレーブユニットは、かかる遅れ時間も考慮して時刻合わせをする必要がある。そのため、初期処理として、マスタユニットとスレーブユニットとの間で実際にメッセージを送受して伝搬遅延時間T0を求め、各スレーブユニットは、その求めた伝搬遅延時間T0を記憶保持する。そして、運転中に適宜のタイミングでマスタユニットから送られてくる現在時刻Tを格納したフレームをスレーブユニットが受信すると、その受信した時刻は、時刻Tに伝搬遅延時間T0を加算した時刻となる。各スレーブユニットは、この伝搬遅延時間も考慮して、時刻合わせを行う。 Since the frame transmitted from the master unit is received by the slave unit through the transmission path, there is a certain delay from the time of transmission at the time of reception. Therefore, even if the master unit transmits a frame storing the current time “T” for time adjustment, when each slave unit receives the frame, a predetermined time has already passed since the time “T”. Each slave unit needs to set the time in consideration of the delay time. Therefore, as an initial process, a message is actually transmitted and received between the master unit and the slave unit to obtain the propagation delay time T0, and each slave unit stores and holds the obtained propagation delay time T0. When the slave unit receives a frame storing the current time T sent from the master unit at an appropriate timing during operation, the received time becomes a time obtained by adding the propagation delay time T0 to the time T. Each slave unit sets the time in consideration of this propagation delay time.
従来の時刻合わせは、実際にメーセージの送受を行い、通信に要した時間を計測することで伝搬遅延時間を求めているため、スレーブユニットの数が増加するほどその伝搬遅延時間を求める処理に時間がかかり煩雑となる。
また、通常のメッセージ送信を利用した通信ではネットワーク通信の混雑の程度により伝搬遅延時間も変動する。従って、初期設定により予め求めた伝搬遅延時間と、実際の動作中に時刻あわせのために時刻情報を格納したメッセージを送信した際に要する伝搬遅延時間がずれる可能性もある。特に、スレーブユニットの数が多くなると、各スレーブユニットの時刻合わせの精度が低下する。そこで、より高精度な時刻合わせの方式を開発したいという課題がある。
In conventional time adjustment, the actual transmission / reception of messages is performed and the propagation delay time is determined by measuring the time required for communication. Therefore, as the number of slave units increases, the time required for processing to determine the propagation delay time increases. And it becomes complicated.
In communication using normal message transmission, the propagation delay time also varies depending on the degree of congestion of network communication. Therefore, there is a possibility that the propagation delay time obtained in advance by the initial setting is different from the propagation delay time required when a message storing time information for time adjustment is transmitted during actual operation. In particular, as the number of slave units increases, the time adjustment accuracy of each slave unit decreases. Therefore, there is a problem that it is desired to develop a more accurate time adjustment method.
上記の課題を解決するために、本発明のプログラマブルコントローラは、(1)複数のユニットがシステムバスにデジチェーン接続されて構成されるプログラマブルコントローラであって、その複数のユニットのうちの少なくとも2つは、計時手段を備え、その計時手段を備えたユニットの1つはマスタとなり、他のユニットはスレーブとなる。マスタは、自己の計時手段の時刻情報を格納した時間同期フレームを送信する機能を備える。この時間同期フレームを受信したユニットは、新たなデータを追加することなく次のユニットに送信する。スレーブは、マスタから何番目に配置されたユニットであるかの接続位置に対応して決定される伝搬遅延時間を特定する補正値を記憶する記憶手段と、時間同期フレームを受信した場合には、その時間同期フレームに格納された時刻情報と前記補正値から現在の時刻情報を求め、自己の計時手段を補正する補正手段と、を備えるようにした。 In order to solve the above problems, a programmable controller of the present invention is (1) a programmable controller configured by a plurality of units being daisy chain connected to a system bus, and at least two of the plurality of units. Includes time measuring means, one of the units having the time measuring means becomes a master, and the other unit becomes a slave. The master has a function of transmitting a time synchronization frame that stores time information of its own time measuring means. The unit that has received this time synchronization frame transmits it to the next unit without adding new data. When the slave has received a time synchronization frame, storage means for storing a correction value for specifying a propagation delay time determined corresponding to the connection position of which unit is arranged from the master, Correction means for obtaining current time information from the time information stored in the time synchronization frame and the correction value and correcting its own clock means;
時間同期フレームは、実施形態の時間同期フレームに対応する。計時手段は、実施形態の内部時計26,32,42,62に対応する。記憶手段は、実施形態ではレジスタに対応する。計時手段の時刻情報は、具体的な日時情報のように絶対的なものでも良いし、電源ONからの経過時間のような相対的なものでもよい。相対的なものの場合、何時間・何分・何秒のように人間が容易に理解できるものでも良いし、定時でカウントアップするカウンタのカウンタ値などでもよい。時間同期フレームを受信した各ユニットは、内部でデータの追加等することなくそのまま次のユニットに向けて出力する。よって、その時間同期フレームが各ユニット内を伝搬する時間は、各ユニットでほぼ一定となるので、補正値も各ユニットの接続位置(マスタから何番目のユニット等)から簡単に求めることができる。また、実際の時刻合わせの補正の際も、マスタから送信された時間同期フレームが各スレーブで受信されるまでの伝搬遅延時間は、大きくぶれることもなく、補正値に従って高精度な時刻合わせを行うことができる。
The time synchronization frame corresponds to the time synchronization frame of the embodiment. The time measuring means corresponds to the
(2)補正値は、マスタが複数のユニットから取得した情報から求めたプログラマブルコントローラのユニット構成情報に基づき、設定対象のスレーブが何番目に配置しているかに基づいて算出し、マスタが、そのスレーブに設定するとよい。補正値は設定ツール装置などを用いて個々に設定しても良いが、マスタが設定することで間違いなく設定できる。このマスタにおける設定は、例えば、以下のようにする。マスタは、電源投入時に、プログラマブルコントローラを構成する各ユニットと通信を行い、各ユニットに設定された機種情報その他の属性情報を取得することで、デジチェーン接続されている各ユニットが、どの順番で配置されているかを検知する。各ユニットは、自己内での伝搬遅延(局遅延)時間を記憶保持しており、かかる伝搬遅延時間も併せてマスタに送る。マスタは、補正値の設定対象のスレーブまでの間に存在する各ユニットの伝搬遅延時間を取得しているため、補正値の設定対象となるスレーブまでに存在しているユニットでの伝搬遅延時間の総和を求め、求めた総和に基づいて補正値を算出する。マスタは、補正値の設定対象のスレーブが何番目に存在しているかを認識している。従って、各ユニットでの伝搬遅延時間が一定とし、係る1個あたりのユニット出かかる伝搬遅延時間(予め設定した固定値)に補正値の設定対象となるスレーブまでに存在しているユニットの数を乗算し、求めた値に基づいて補正値を算出するようにしてもよい。 (2) The correction value is calculated based on the unit configuration information of the programmable controller obtained from the information acquired by the master from a plurality of units, based on the order in which the slave to be set is arranged. Set to slave. The correction value may be set individually using a setting tool device or the like, but can be definitely set by the master. The setting in this master is as follows, for example. When power is turned on, the master communicates with each unit that makes up the programmable controller and acquires model information and other attribute information set for each unit, so that each unit connected in the digital chain is in any order. Detect if it is placed. Each unit stores and holds the propagation delay (station delay) time within itself, and also sends the propagation delay time to the master. Since the master acquires the propagation delay time of each unit existing up to the slave for which the correction value is set, the propagation delay time of the unit existing until the slave for which the correction value is set is set. A sum is obtained, and a correction value is calculated based on the obtained sum. The master recognizes the number of slaves for which correction values are set. Therefore, the propagation delay time in each unit is constant, and the number of units existing up to the slave whose correction value is to be set in the propagation delay time (a preset fixed value) per unit is determined. Multiplication may be performed to calculate a correction value based on the obtained value.
(3)補正値は、スレーブの時間同期フレームを伝搬するために要する伝搬遅延時間と、マスタで時間同期フレームを作成して送信するのに要する処理時間に基づき設定するとよい。このようにすると、より正確に補正値を求めることができる。 (3) The correction value may be set based on the propagation delay time required for propagating the slave time synchronization frame and the processing time required for creating and transmitting the time synchronization frame by the master. In this way, the correction value can be obtained more accurately.
(4)ユニットが時間同期フレームを伝搬するために要する伝搬遅延時間は、基準時間t0で一定とするとともに、マスタと一体に連結されるN番目のレーブに設定される補正値は、前記一定の時間×Nから求めることができる。このように、各ユニットの伝搬遅延時間を固定値にすることで、各補正値を簡単に求めることができる。 (4) The propagation delay time required for the unit to propagate the time-synchronized frame is constant at the reference time t0, and the correction value set for the Nth slave connected integrally with the master is the constant It can be obtained from time × N. Thus, each correction value can be easily obtained by setting the propagation delay time of each unit to a fixed value.
(5)システムバスにデジチェーン接続される複数のユニットからなるブロック体を複数備え、その複数のブロック体のうちの1つはCPUユニットを含み、複数のユニットの1つは、CPUユニットを含まないブロック体を構成する各ユニットとCPUユニットとを接続するための延長ユニットであり、それら延長ユニット同士が延長ケーブルで接続されることでプログラマブルコントローラが構成され、延長ユニット以外のユニットにおける時間同期フレームを伝搬するために要する伝搬遅延時間は、各ユニットで一定の時間とした。そして、マスタが実装されるブロックに存在するN番目の前記スレーブに設定される補正値は、前記一定の時間×Nとし、延長ケーブル以降のブロックに装着されたスレーブの記憶手段に格納される補正値は、延長ケーブルにおける伝搬遅延時間と、マスタとの間に存在する延長ユニットの伝搬遅延時間も加味して設定されるようにすると良い。この発明は、第2実施形態で実現される。 (5) A plurality of block bodies including a plurality of units connected to the system bus by a digital chain are provided, one of the plurality of block bodies including a CPU unit, and one of the plurality of units includes a CPU unit. This is an extension unit for connecting each unit that constitutes a block body and the CPU unit, and the extension unit is connected by an extension cable to form a programmable controller, and a time synchronization frame in units other than the extension unit The propagation delay time required for propagating the signal is constant for each unit. The correction value set for the Nth slave existing in the block where the master is mounted is the fixed time × N, and the correction value stored in the storage means of the slave attached to the block after the extension cable The value may be set in consideration of the propagation delay time in the extension cable and the propagation delay time of the extension unit existing between the master and the extension cable. The present invention is realized in the second embodiment.
(6)上記の(5)の発明を前提とし、延長ケーブルの長さを一定にすることで、その延長ケーブルでの伝搬遅延時間を固定値として補正値を設定するとよい。このようにすると、延長ケーブルでの伝搬遅延を実測することなく、精度良く求めることができるので、簡単な処理で適切な補正値を求めることができる。 (6) On the premise of the invention of (5) above, it is preferable to set the correction value with the propagation delay time in the extension cable as a fixed value by making the length of the extension cable constant. In this way, since it is possible to obtain with high accuracy without actually measuring the propagation delay in the extension cable, an appropriate correction value can be obtained with a simple process.
(7)マスタは、自己の計時手段から時刻情報をラッチして時間同期フレームを作成した場合、送信待ちの他の送信フレームの有無にかかわらず時間同期フレームを最優先で送信するようにするとよい。マスタからは、各種のフレームが作成され、適宜の順で送信されるので、仮に、マスタの計時手段から時刻情報をラッチし、時間同期フレームを作成した状態で当該時間同期フレームの送信がされずに待機状態が長く続くと、実際に送信されたときには時刻情報から大きく遅れた時刻となり、時刻合わせの精度が低下する。そこで、最優先にすることで、係る問題の発生を抑制する。 (7) When the master latches the time information from its own clocking means and creates a time synchronization frame, the master may transmit the time synchronization frame with the highest priority regardless of the presence or absence of other transmission frames waiting for transmission. . Since various frames are created and transmitted in an appropriate order from the master, the time synchronization frame is not transmitted in a state where the time information is latched from the master timing means and the time synchronization frame is created. If the standby state continues for a long time, when it is actually transmitted, it becomes a time greatly delayed from the time information, and the accuracy of time adjustment decreases. Therefore, by giving top priority, the occurrence of such a problem is suppressed.
(8)システムバスは、前記マスタから前記スレーブに向けて送信するフレームを伝送する下り系統と、前記スレーブから前記マスタに向けて送信するフレームを伝送する上り系統が別々に構成され、時間同期フレームは、下り系統のシステムバスを用いて伝送されるようにするとよい。このようにすると、時間同期フレームが、上りフレームと衝突して送信エラーとなることが無い。時間同期フレームは、マスタがスレーブに対して送信するため、その送信タイミングはマスタで管理できる。時間同期フレームを受信したスレーブ型のスレーブに転送する場合も下り系統を利用する。よって、下り系統を用いて時間同期フレームを送信することで、設定された補正値に対応した伝搬遅延時間で、より確実かつ早くに各スレーブに時間同期フレームを送信できる。 (8) In the system bus, a downlink system that transmits a frame transmitted from the master to the slave and an upstream system that transmits a frame transmitted from the slave to the master are configured separately, and a time synchronization frame May be transmitted using a downstream system bus. In this way, the time synchronization frame does not collide with the upstream frame and cause a transmission error. Since the master transmits the time synchronization frame to the slave, the transmission timing can be managed by the master. The downlink system is also used when transferring the time synchronization frame to the slave type slave that has received it. Therefore, by transmitting the time synchronization frame using the downlink system, the time synchronization frame can be transmitted to each slave more reliably and quickly with the propagation delay time corresponding to the set correction value.
本発明は、プログラマブルコントローラを構成するシステムバスで連結されたマスタとスレーブの時刻合わせを簡単かつ正確に行うことができる。 According to the present invention, it is possible to easily and accurately perform time adjustment of a master and a slave connected by a system bus constituting a programmable controller.
[第1実施形態]
図1は、本発明のプログラマブルコントローラ(以下、「PLC」)10の第1実施形態を示している。このPLC10は、各種の機能を実現するための複数のユニットを連結して構成される。この複数のユニットは、少なくとも1つのCPUユニット20を有する。更に、本実施形態のPLC10は、I/Oユニット30(入力ユニット、出力ユニット、入出力ユニットなど),高機能I/Oユニット40(高機能入力ユニット、高機能出力ユニット、高機能入出力ユニットなど),エンドユニット50を備えている。さらに、図示省略するが、PLC10を構成する各ユニットに対して電源供給を行うための電源ユニットも備えている。もちろん、PLC10を構成するユニットは、上記のものに限ることはなく、実行したい制御に応じて必要なものを適宜取捨選択して構成する。
[First Embodiment]
FIG. 1 shows a first embodiment of a programmable controller (hereinafter “PLC”) 10 of the present invention. The
これらの各ユニットは、ケースの側面にコネクタ15を備える。各ユニットは、コネクタ15同士を連結することで、電気的に接続される。すなわち、コネクタ15には、高速シリアル通信線の一端が接続され、高速シリアル通信線の他端は、ユニットの内部回路(本実施形態ではASIC)に接続される。また、電源線もコネクタ15に接続される。これにより、隣接するユニットのコネクタ15同士を連結することで、電源ユニットからのユニットへの電源供給が行えるとともに、ユニット間でデータ通信が行える。さらにPLC10のユニット間の通信は、ASICを用いて行い、高速化を図っている。
Each of these units includes a
本実施形態のプログラマブルコントローラを構成するシステムバスは、下り用システムバス11と上り用システムバス12の2系統で構成される。このように、各システムバス11,12を流れるフレームの方向を固定することで、通信時のフレームの衝突の発生確率を抑制し、より確実かつスムーズに伝送できるようにしている。なお、本発明では、システムバスとして、このように下り用と上り用の2つを設けることは、必須ではない。
The system bus constituting the programmable controller of the present embodiment is composed of two systems, a
CPUユニット20は、FAネットワークを構成する各機器の動作を制御するもので、「共通処理」,「INリフレッシュ」(マスタがスレーブのINデータを読み出す処理),「ユーザプログラムの演算実行」,「OUTリフレッシュ」(マスタからスレーブへ出力データを書き込む処理),「周辺サービス」をサイクリックに実行する。本発明との関係で言うと、CPUユニット20は、マスタユニットとなり、PLC10を構成する他のユニットとの間で時刻合わせを行う。
The
CPUユニット20は、MPU21と、EEPROM22と、RAM23と、ASIC24と、通信回路25と、内部時計26と、を備えている。EEPROM22は、CPUユニット用のシステムプログラムや、ユーザプログラムが格納される。MPU21は、CPUユニット用のマイクロプロセッサユニットであり、EEPROM22に格納されているシステムプログラムやユーザプログラムを実行することによってPLC全体を統括制御する。RAM23は、MPU21が動作する際にワークメモリとして使用されるメモリである。
The
AISC24は、ユーザプログラムの一部を実行する機能を有する。また、本発明との関係で言うと、ASIC24は、他のユニットとの間でマスタ−スレーブ通信を行う機能を有する。すなわち、ASIC24は、具体的な内部構造の図示は省略するが、MPU21と通信するためのMPUインタフェース部や、スレーブユニットとの間で送受するIOデータ等を格納する共有メモリ部や、スレーブユニットとの間でマスタ−スレーブ通信を管理する通信コントローラ部や、下り用システムバス11に接続され、実際にデータの送受を行う送信制御部24a並びに受信制御部24bを備えている。上述したように、システムバス11,12の伝送方向を一方向に固定したため、送信制御部24aは下り用システムバス11に接続し、受信制御部24bは上り用システムバス12に接続する。
The
ASIC24は、MPU21からの指示に従い、スレーブユニットに対して時刻合わせのための時間同期フレームを送信したり、PLCのユニット構成を調査するメッセージフレームを送信したりする。また、ASIC24は、そのメッセージフレームに対するレスポンスとして、各ユニットの構成情報を受信すると、受信した構成情報をMPU21に送る。時刻合わせのための具体的な機能は、後述する。
In accordance with an instruction from the
通信回路25は、フィールドネットワークに接続されたリモートI/O等の機器との間で通信する。内部時計26は、PLC10を構成する各ユニットの動作の基準となる時刻を示すもので、具体的な時刻を示すものでも良いし、電源投入からの経過時間(カウンタのカウンタ値)を示すものでも良い。この内部時計26は、水晶発振器に基づいて動作する。
The
I/Oユニット30や高機能I/Oユニット40は、センサやスイッチなどの入力機器を接続してそれらのオン・オフ信号を入力信号として取り込む入力ユニットやアクチュエータやリレーなどの出力機器を接続してそれらに対して出力信号を送り出す出力ユニット等である。それらのユニット30,40は、スレーブユニットとなる。
The I /
I/Oユニット30は、ASIC31、内部時計32並びに時刻情報補正用の補正時間を格納するレジスタ33を備える。レジスタ33はASIC31内部に組み込んでも良い。内部時計32は、内部時計26と同様に具体的な時刻を示すものでも良いし、電源投入からの経過時間(カウンタのカウンタ値)でも良い。I/Oユニット30のASIC31は、PLC10を構成する各ユニットが動作タイミングを合わせる同期運転をする場合、この内部時計32の時刻情報に基づいて動作する。ここで、動作タイミングを合わせるとは、例えば複数のI/Oユニットがともに出力ユニットとした場合に、その出力ユニットに接続された出力機器が同時に動作を開始したり、ある出力機器が動作開始後設定された時間経過後に別の出力機器が動作したりするものがある。
The I /
ASIC31は、具体的な内部構造の図示は省略するが、マスタ−スレーブ通信を管理する通信コントローラ部や、システムバス11,12に接続されて実際にデータの送受を行う送信制御部31a,31c並びに受信制御部31b,31dを備えている。そしてこのASIC31は、CPUユニット20との間でIOデータの送受を行い、接続された外部機器との間で図示省略のIO機器用インタフェースを介してIO信号の送受を行う。ASIC31は、システムバス11,12に対してデジチェーン接続されている。そして、ASIC31の通信コントローラ部は、下り用システムバス11を伝送されてくるフレームを受信制御部31bで受信すると、所定の処理を実行し、対となる送信制御部31aから下流側のスレーブユニットへ送信する。同様にASIC31の通信コントローラ部は、上り用システムバス12を伝送されてくるフレームを受信制御部31dで受信すると、所定の処理を実行し、対となる送信制御部31cから上流側の隣のユニットへ送信する。もちろん、下り用システムバス11で送られてきたフレームが自己宛のもので、その処理結果としてCPUユニット20にレスポンスを返す場合、係るレスポンスは、送信制御部31cから上り用システムバス12に送信する。
Although the
高機能I/Oユニット40は、上記のI/Oユニット30と同様にASIC41、内部時計42並びに時刻情報補正用の補正時間を格納するレジスタ43を備えるとともに、MPU44を備える。このMPU44が、より複雑な処理を実行する。そして高機能I/Oユニット40は、演算処理,IOリフレッシュ,共通処理,周辺サービス等の一連の処理をサイクリックに実行する。つまり、高機能I/Oユニット40は、自ら接続された出力機器の動作を制御するなどの機能を備え、特殊ユニットと称しても良い。演算処理は、予め設定されたプログラムを実行するものでも良いし、ユーザプログラムを実行するものでもよい。
The high-function I /
また、高機能I/Oユニット40のASIC41は、PLCを構成する各ユニットと同期運転する場合、この内部時計42の時刻情報に基づいて動作する。ASIC41は、システムバス11,12に対してデジチェーン接続されている。よって、ASIC41は、送信制御部41a,41cと受信制御部41b,41dを備え、送信制御部並びに受信制御部は、それぞれ対応する下り/上り用のシステムバス11,12に接続され、他のユニットと通信する。また、高機能I/Oユニット40はMPU44を備えることから、ASIC41にはMPUインタフェース部を備える。さらに、本実施形態では、この高機能I/Oユニット40がCPUユニット20から最も離れた最終のユニットであるため、その後にエンドユニット50が装着される。そして、高機能I/Oユニット40のASIC41の送信制御部41aは、エンドユニット50内の終端抵抗51に接続される。
Further, the
*時刻合わせ機能
各スレーブユニットのレジスタ33,43に格納される下り用システムバス11の伝搬遅延時間を考慮した補正時間は、以下のようになっている。この補正時間のレジスタ33,43への格納処理は、後述するように、設定ツール装置やユニットに設けた設定スイッチをユーザがマニュアル操作して個々に行ったり、マスタが自動的に行ったりする。
* Time adjustment function The correction time in consideration of the propagation delay time of the
CPUユニット20(ASIC21)から送信された時刻合わせのための時間同期フレームは、下り用システムバス11を用いて伝送される。各スレーブユニットは、この時間同期フレームを受信した場合、そのフレームにデータを追加したりすることなくそのまますぐに送信制御部にて次のユニットに向けて送信する。これにより、1つのユニットの受信制御部で時間同期フレームを受信してから送信制御部から送信されるまでに要する時間はほぼ一定となり、さらに、フレームがユニット内部の線路や、ユニット間のシステムバス11を移動する時間も、線路長から一意に規定され一定となる。よって、次のユニットにフレームを転送するための要する時間は、スレーブユニットであればほぼ等しいと言える。
The time synchronization frame for time adjustment transmitted from the CPU unit 20 (ASIC 21) is transmitted using the
従って、あるユニットの送信制御部からフレームが送信されたときから、そのフレームが次のユニットのASICで受信されるとともに当該次のユニットの送信制御部から出力されるまでに要する時間は、各ユニットとも等しく一定とみなせる。係る一定の時間を基準時間と称してt0とすると、図1に示す実施形態の場合、CPUユニット20の送信制御部24aから時間同期フレームが送信されたときから、その時間同期フレームがCPUユニット20に隣接する1番目のI/Oユニット30の送信制御部31aから出力されるまでに要する伝搬遅延時間は、t0となる。
Therefore, the time required from when a frame is transmitted from the transmission control unit of a unit to when the frame is received by the ASIC of the next unit and output from the transmission control unit of the next unit is Both can be considered equally constant. When such a fixed time is referred to as a reference time and is t0, in the embodiment shown in FIG. 1, the time synchronization frame is transmitted from the
同様に、その1番目のI/Oユニット30の送信制御部31aから時間同期フレームが送信されたときから、その時間同期フレームが隣接する2番目のI/Oユニット30のASIC31で受信され、送信制御部31aから出力されるまでに要する伝搬遅延時間は、t0となる。従って、CPUユニット20の送信制御部24aから時間同期フレームが送信されたときから、その時間同期フレームが2番目のI/Oユニット30の送信制御部31aから送信されるまでに要する伝搬遅延時間は、2×t0となる。同様に、CPUユニット20の送信制御部24aから時間同期フレームが送信されたときから、その時間同期フレームがN番目のスレーブユニットの送信制御部から送信されるまでに要する伝搬遅延時間は、N×t0となる。なお、各ユニットの内部処理、すなわち、受信制御部で受信してから送信制御部から出力するまでに要する時間に比べて、ユニット間のシステムバス11条を伝送する時間は非常に短く無視することもできる。よって、係るt0は、ユニットの内部処理に要する時間としてもよい。
Similarly, when the time synchronization frame is transmitted from the
このように、各スレーブの接続位置で、ほぼ固定的な伝搬遅延時間となるので、N番目のユニットのレジスタには、伝搬遅延時間に基づく補正時間として、“N×t0”を格納する。図1の例では、1番目のI/Oユニット30のレジスタ32には、“t0”が格納され、2番目のI/Oユニット30のレジスタ32には、“2×t0”が格納され、3番目のスレーブユニットとなる高機能I/Oユニット40のレジスタ42には、“3×t0”が格納される。
Thus, since the propagation delay time is almost fixed at the connection position of each slave, “N × t0” is stored in the register of the Nth unit as the correction time based on the propagation delay time. In the example of FIG. 1, “t0” is stored in the
このように、各ユニットのレジスタに格納する補正時間は、CPUユニット20に近いユニットから順にt0ずつ加算した時間(N番目のスレーブユニットは“N×t0”)となる。従って、ユーザがマニュアル操作で補正時間をレジスタに格納する場合、ユーザは設定対象のユニットがCPUユニットから何番目のユニットであるかを確認し、設定ツール装置を用いて対応する補正時間を個々に設定したり、各スレーブユニットに補正時間の設定用のスイッチなどを設け、ユーザがそのスイッチを操作してユニットごとに設定したりすることもできる。このスイッチは、例えばN番目であることを特定するスイッチとする。すると、各ユニットのASICは、予め記憶保持しておいた補正の基準時間t0とスイッチで特定されるNを乗算して補正時間を求めレジスタに格納する。 As described above, the correction time stored in the register of each unit is a time obtained by adding t0 in order from the unit close to the CPU unit 20 (the Nth slave unit is “N × t0”). Therefore, when the user manually stores the correction time in the register, the user confirms the order of the unit to be set from the CPU unit, and individually sets the corresponding correction time using the setting tool device. It is also possible to set a correction time for each slave unit or to set a correction time for each unit by a user operating the switch. This switch is, for example, a switch that identifies the Nth switch. Then, the ASIC of each unit obtains a correction time by multiplying the correction reference time t0 stored and held in advance by N specified by the switch, and stores it in the register.
また、マスタであるCPUユニット20が、各レジスタに対して補正時間を自動的に設定するようにしても良い。すなわち、電源投入時やシステム立ち上げ時の初期処理として、CPUユニット20が、PLCを構成する各ユニットの接続位置情報を取得し、補正時間の設定対象の各スレーブユニットの補正時間を算出すると共に、その算出した補正時間をそれぞれのスレーブユニットに通知する。そして、係る通知を受けたスレーブユニットは、送られてきた補正時間をレジスタに格納する。すなわち、CPUユニット20のASIC24は、通信に先立ち、下り用システムバス11を用いて、各スレーブユニットに対し、プロファイル要求メッセージを送信する。各スレーブユニットは、自己のプロファイル(機種情報等)を上り用システムバス12を用いて送る。これにより、CPUユニット20は、受信した各ノードを構成するユニットのプロファイル情報から各ノードに何のユニットがセットされているのかの構成情報を認識する。そこでCPUユニット20のMPU21は、その収集した構成情報に基づき、各スレーブユニットが何番目に接続されているのかを求めるとともに、基準時間t0を乗算して補正時間を求めることができる。
Further, the
次に、実際の制御実行時の時刻合わせについて説明する。CPUユニット20(マスタ)のASIC24は、自発的或いはMPU21からの指示に従い、内部時計26の時刻情報を時間同期フレームのデータ部に格納し、ブロードキャスト配信する。すなわち、図2〜図4に示すように、ASIC24内の送信コントローラ部24cは、時刻合わせの条件を満たすと、時間同期フレームのための送信データ(時刻情報)を送信制御部24aに与えるように制御し、時間同期フレーム送信要求フラグをONにする。なお、送信条件は、本実施形態では、送信タイマのタイムアップである。よって、時間同期フレームの送信処理は、送信タイマで設定される時間間隔で定時処理されることになる。この時間同期フレームは、最優先で送信される。
Next, time adjustment at the time of actual control execution will be described. The
送信制御部24aの符号化部は、その時間同期フレーム送信要求フラグの立ち上がりを検知し、マスタ時刻となる内部時計26の時刻情報をラッチする。そして符号化部は、ラッチした時刻情報を、時間同期フレームのデータ部内に格納する。このようにして生成された時間同期フレームは、送信部からSER部(SERializer)を経由して、パラレル−シリアル変換され、伝送路である下り用システムバス11に出力される。ASICは、時刻情報をラッチしたならば、時間同期フレームを最優先で遅滞なく送信される。つまり、ラッチした際に複数のフレームが送信待ちをしていた場合でも、ASICは、現在送信処理中のフレームの送信処理が完了後、次の送信タイミングで時間同期フレームを送信する。
The encoding unit of the
そして、下り用システムバス11を伝送されてきた時間同期フレーム(シリアル)は、1段目のスレーブユニット(ここでは、I/Oユニット30)のASIC31の受信制御部31bに受信される。受信制御部31bでは、DES部(DESerializer)にてシリアル−パラレル変換され、受信部を経由して復号部に渡され、復号化される。ASIC31は、時間同期フレームに格納されたマスタ時刻を取得できる。そして、復号部は、復号化された時間同期フレームのフレームチェックを行い、チェックが正常と判定されると復号化処理が正常完了したとして、受信完了フラグをONにする。なお、チェックが異常と判定された場合、ASIC31は受信したデータを破棄し、送信コントローラ31eはエラーレスポンスを作成する。そして、送信制御部31cは、その作成したエラーレスポンスを上り用システムバス12を用いてCPUユニット20に送る。なお、このようにエラーレスポンスを送らないようにしても良い。
The time synchronization frame (serial) transmitted through the
ASIC31は、この受信完了フラグがONになる立ち上がりで受信した時間同期フレームで送られてきたマスタ時刻をラッチし、当該マスタ時刻にレジスタ34に格納された補正時間を加算することで現在の時刻を求め、その求めた時刻に基づいて自己の内部時計32を補正する。
The
求めた現在時刻に基づく内部時計32の補正は、例えば、内部時計32の時刻を、上記の求めた現在の時刻によって上書きすることにより更新する処理を行うことで実現できる。また、このように上書きにより更新すると、補正前後で内部時計32の示す値が離散的に飛んでしまう。それを防ぐために、ASIC31は、特許文献2に開示された補正アルゴリズム等を用い内部時計32の時間の進む速度を速めたり遅らせたりすることで、時刻を連続的に徐々にマスタ時刻に合わせるように修正するようにしてもよい。
The correction of the
また、復号部で復号化された時間同期フレームは、送信コントローラ31eの制御により送信制御部31aに与えられ、最終的に、送信制御部24aのSER部(SERializer)にてパラレル−シリアル変換され、伝送路である下り用システムバス11に出力される。
Further, the time synchronization frame decoded by the decoding unit is given to the
このようにしてデジチェーン方式で送信された時間同期フレームは、次段に隣接するスレーブユニット(ここでは、2番目のI/Oユニット30)にて受信される。そして、上記と同様にフレームの受信チェックが正常の場合、ASIC31は、受信した時間同期フレームに格納されていたマスタ時刻を取得し、補正時間(2×t0)を加算した値を現在時刻となるように内部時計32を補正する。そして、送信コントローラは、受信した時間同期フレームを送信制御部24aを用いて下り用システムバス11に送信する。
The time synchronization frame transmitted in the digital chain manner in this way is received by the slave unit (here, the second I / O unit 30) adjacent to the next stage. If the frame reception check is normal as described above, the
このようにすることで、各スレーブユニットは、CPUユニット20から送られてきた時間同期フレームをデジチェーン方式で順次隣接するスレーブユニットに転送する。さらに、N番目のスレーブユニットの時刻は、マスタ時刻に対してCPUユニット20との間に存在するN−1個分のスレーブユニットの局遅延((N−1)×t0)だけ加算することで補正する(図4参照)。
In this way, each slave unit sequentially transfers the time synchronization frame sent from the
なお、スレーブユニットは、多くの場合その外形寸法形状は等しいため、隣接するユニット間をつなぐシステムバス11,12の長さや、ユニット内での配線の長さもほぼ等しく、フレームがその伝送経路を伝搬される時間も等しい。また、ユニットの種類によっては、幅寸法が倍になるなど、ユニット内の配線の長さが通常のものよりも長く、それに伴いそこを伝搬される時間が長くなるが、係る伝送路を伝搬される時間はASIC内での処理時間に比べて十分に短いので、上記のように、1つのユニットでの伝搬遅延時間は、一律に基準時間t0としても実用上問題がない。そして、そのように伝搬遅延時間を一律に設定することで、簡単に補正時間の設定が行える。もちろん、より正確にするためには、各ユニットにプロファイル情報としてそのユニットでの伝搬遅延時間を記憶保持しておき、CPUユニット20が構成情報を取得する際に、係る各ユニットの伝搬遅延時間も取得し、それに基づいてCPUユニット20のMPU21が、個々のノード(スレーブユニット)ごとにCPUユニット20からの伝搬遅延時間を求めるようにしても良い。
In many cases, the external dimensions of the slave units are the same. Therefore, the lengths of the
なお、1つのユニットを通過するのに必要とする時間を基準時間t0とした場合に、CPUユニット20の送信制御部24aから送信された時間同期フレームが、CPUユニット20に隣接する1番目のI/Oユニット30の送信制御部31aから送信されるまでに要する伝搬遅延時間は、t0となり、同様に、N−1番目のスレーブユニットの送信制御部から送信された時間同期フレームが、N番目のスレーブユニットのASICの送信制御部から出力されるまでに要する伝搬遅延時間は、t0となる。しかし、時間同期フレームに、送信制御部から送信された時刻を格納することはできない。そこで、マスタ時刻をラッチして時間同期フレームにマスタ時刻を格納し、実際に送信されるまでの処理が、CPUユニット20のASIC24の送信制御部24aで行われることから、係る送信制御部24aでの処理時間と、1番目のI/Oユニット30の送信制御部31aでの処理時間がほぼ等しいとみなせる。同様に、同一のユニットの受信制御部での処理時間と送信制御部での処理時間を合わせた当該ユニットの処理時間は、前段のユニットの送信制御部での処理時間と、自己の受信制御部での処理時間を合わせたものと等しいとみなせる。そこで、図3,図4に示すように、CPUユニット20のASIC24の送信制御部24aにてマスタ時刻データをラッチした時点を基準に、各レジスタに設定された補正時間を加算することで、その時点での各内部時計の時刻を合わせることができる。
When the time required to pass through one unit is the reference time t0, the time synchronization frame transmitted from the
マスタユニット20における送信制御部24aは、時間同期フレームのための時刻データを取得するとともに、ヘッダ部やエラーチェック用の訂正符号部などを付加して時間同期フレームを作成するとともに符号化するが、スレーブユニットにおける送信制御部31a,41aの符号化部では、対となる受信制御部31b,41bの復号化部で復号化したフレームを再度符号化する処理を行うことになり、マスタユニットにおける復号化部に比べるとその処理時間は短い。ただし、この処理時間の差は、各ユニットを伝搬する際の要する時間に比べると十分短いために、本実施形態のように、N番目のユニットの補正時間をN×t0で求めても問題はない。なお、高速化がさらに進むなど、その差が無視できなくなったり、より正確に求めたりするためには、マスタユニットの処理時間を考慮し、N番目のユニットの補正時間は、
N×t0+C
により求めるようにしても良い。ここで、Cは、マスタユニットの送信処理にかかる時間(マスタ時刻をラッチしてから出力されるまでの時間)と、スレーブユニットで送信処理にかかる時間の差である。
The
N × t0 + C
You may make it ask | require by. Here, C is the difference between the time required for the transmission process of the master unit (the time from when the master time is latched until it is output) and the time required for the transmission process in the slave unit.
CPUユニット20に直結された1番目のスレーブユニットに設定する補正時間(図3に示す1段目の補正時間)は上記のマスタとしての送信処理時間を考慮して決定する時間t0′とし、2番目以降のユニットに対する補正時間としては、
(N−1)×t0+t0′
としてもよい。
The correction time (first correction time shown in FIG. 3) set for the first slave unit directly connected to the
(N−1) × t0 + t0 ′
It is good.
[変形例]
デジチェーン接続された各スレーブユニットにおけるフレームの転送のための仕組みは、上述したものに限ることはなく、各種のもので実現できる。一例としては、例えば図5に示すようなものがある。すなわち、受信制御部31b(図では、I/Oユニット30の部分のみ示しているが、その後段に続く高機能I/Oユニット40でも同じ)で受信した時間同期フレームは、受信制御部31bのDES部aでシリアル−パラレル変換され、フォワード部bに転送される。フォワード部bは、符号のアライメント処理、つまり、時間同期フレームの先頭位置等を正確に認識し、復号化する。そして、フォワード部bは、復号化したフレームを受信部cに渡すとともに、バッファに格納する。そのバッファに格納されたフレームは、復号化処理された後、SED部dにてパラレル−シリアル変換され、次のユニットに向けて送信される。
[Modification]
The mechanism for frame transfer in each daisy chain connected slave unit is not limited to that described above, and can be realized by various types. An example is shown in FIG. That is, the time synchronization frame received by the
この例では、復号化したフレームを受信部に渡し、所定の受信処理を行うとともに、それと平行してSED部dに渡して次のユニットへの転送を行うようにしている。このとき、受信部cで正常受信したか否かの確認を待つことなく転送を行うことで、より高速に各スレーブユニットへの伝送が行える。 In this example, the decoded frame is delivered to the receiving unit, and predetermined reception processing is performed, and in parallel therewith, it is delivered to the SED unit d for transfer to the next unit. At this time, transmission to each slave unit can be performed at higher speed by performing transfer without waiting for confirmation of whether or not the reception unit c has normally received.
なお、受信部cで受信したフレームは、すでにフォワード部bにより復号化されているので、上述した実施形態のように受信部cによる受信処理の後で復号化する必要はなく、受信部で受信正常完了したタイミングで、上記の実施形態と同様の内部時計の補正処理をすることになる。 Note that since the frame received by the receiving unit c has already been decoded by the forward unit b, it is not necessary to decode after receiving processing by the receiving unit c as in the above-described embodiment. At the timing of normal completion, the same internal clock correction processing as in the above embodiment is performed.
この例と、上記の第1実施形態の対応関係を示すと、フォワード部bは、受信制御部31bの機能と送信制御部31aの機能を兼ねているといえる。そして、このように構成することで、各ユニットでの転送の速度が増し、高速通信が図れるが、それに伴い、マスタユニットにおける送信制御部24aでの処理時間と、各スレーブユニットにおける送信制御部31(フォワード部(バッファ格納・符号化)とSER部)での処理時間の差が、大きくなる。この場合でも、上述した第1の実施形態と同様に、N番目の補正時間をN×t0と行った概略の簡易な処理で求めることができる。そして、より正確な補正時間を設定する場合には、上述した変形例のようにマスタユニットでの処理時間を考慮して、各ユニットの補正時間を求めると良い。
When the correspondence relationship between this example and the first embodiment is shown, it can be said that the forward unit b has both the function of the
[変形例]
また、別の例としては、図6に示すようなものとすることもできる。この例では、さらに高速に転送することができる。すなわち、フォワード部b′では、符号のアライメント処理を行った後、復号化することなく受信部cに渡すとともにバッファに格納する処理を実行する。これにより、下流側のスレーブへの転送は、DES部aでシリアル−パラレル変換後、符号アライメント処理をして先頭位置を正確に特定後バッファに格納し、SER部dで出力されるので、図5に示す例よりもさらに高速に送信フレームを伝送できる。
[Modification]
Further, as another example, it may be as shown in FIG. In this example, transfer can be performed at higher speed. That is, in the forward part b ′, after the code alignment process is performed, a process of passing to the receiving part c without decoding and storing it in the buffer is executed. As a result, since the transfer to the slave on the downstream side is serial-parallel converted by the DES unit a, the code alignment process is performed, the head position is accurately specified and stored in the buffer, and is output by the SER unit d. The transmission frame can be transmitted at a higher speed than the example shown in FIG.
また、時刻合わせは、第1実施形態と同様に受信部で受信後、復号部eで復号化し、正常受信完了のタイミングで、取得したマスタ時刻と補正時間に基づき補正処理を行い、内部時計を修正する。 Similarly to the first embodiment, the time adjustment is received by the receiving unit, decoded by the decoding unit e, and corrected at the timing of normal reception based on the acquired master time and correction time, and the internal clock is set. Correct it.
この図6に示す例でも、簡易的な補正時間の設定は、N×t0で行うことができるが、マスタユニットにおける送信制御部の処理時間と、各スレーブユニットでの送信制御部での処理時間の差がさらに広がるため、より正確に補正時間を求めるためには、マスタユニットにおける送信制御部の処理時間を考慮した上記の各種の設定方法を採用すると良い。 In the example shown in FIG. 6 as well, simple correction time can be set at N × t0, but the processing time of the transmission control unit in the master unit and the processing time of the transmission control unit in each slave unit. In order to obtain the correction time more accurately, the above-described various setting methods in consideration of the processing time of the transmission control unit in the master unit may be employed.
[第2実施形態]
図7は、第2実施形態を示している。本実施形態のPLC10は、複数のユニットを連結して構成されるブロック体を複数用意し、それらを延長ケーブル14で連結して構成される。つまり、CPUユニット20と複数のユニットを連結して構成されるブロック体の最終段に延長ユニット60を取り付けるとともに、その延長ユニット60に延長ケーブル14の一方のコネクタを接続する。一方、複数のスレーブユニットを連結するともに少なくとも一方の端部に延長ユニット60′を連結して構成される延長ブロック体を用意し、その延長ユニット60′に上記の延長ケーブル14の他端を連結することで、2つのブロック体を連結する。延長ユニット60,60′は、CPUユニット20が含まれていないブロック体を構成する各ユニットと、CPUユニット20とをシステムバス11,12で接続するためのものである。特に、スレーブユニットをベースユニットに設けたスロットに装着するタイプでは、ベースユニットのスロット数以上のユニットを用いてPLCを構成しようとした場合、複数のベースユニットと延長ユニットを用いる。また、本実施形態のように、ユニットの側面同士を直接接続する場合でも、例えば、多数のユニットを連結する場合に、それら全てを連結すると1つのブロックが大きくなり過ぎることがあるため、本実施形態のように複数のブロックに分けるとともに、それら複数のブロック体を延長ユニット60,60′及び延長ケーブル14にて連結して構成する。延長ブロック体は、1または複数個用いることができ、最終段の延長ブロック体の端部にエンドユニット50を接続する。
[Second Embodiment]
FIG. 7 shows a second embodiment. The
延長ユニット60,60′は、ASIC61と、内部時計62と、補正時間を格納するレジスタ63と、を備えている。ASIC61は、上述したI/Oユニット30のASIC31や高機能I/Oユニット40のASIC41と同様に、下り用システムバス11に接続する送信制御部61a,受信制御部61bや、上り用システムバス12に接続する送信制御部61c,受信制御部61dを備えている。さらにASIC61は、受信したフレームに対し、波形整形処理を行う波形整形部も備えている。図示省略するが、この波形整形部は、例えば下流側に位置する受信制御部と送信制御部の間に組み込まれることになる。すなわち、下り用システムバス11に接続される延長ユニット60′の受信制御部61bと送信制御部61aの間と、上り用システムバス12に接続される延長ユニット60の受信制御部61dと送信制御部61cの間に配置される。上流側と下流側に配置しても良い。
The
そして、ASIC61は、他のスレーブユニットと同様に、CPUユニット(ASIC24)から送られてきた補正時間を受信すると、それをレジスタ62に格納し、時間同期フレームを正式受信すると、そこに格納されていたマスタ時刻を取得し、レジスタ62に格納されていた補正時間に基づき内部時計63の時刻を補正する。さらに、ASIC61は、下り用システムバス11の受信制御部61bで時間同期フレームを受信すると、データを追加することなく送信制御部61aからその時間同期フレームを送信するが、このとき、波形整形部にて波形整形処理などを行う。そのため、下り用システムバス11で隣接するスレーブユニットから送信された時間同期フレームが、延長ユニット60,60′の送信制御部61aから送信されるまでの伝搬遅延時間は、少なくとも係る波形整形処理等に要する時間だけ他の一般のスレーブユニットにおける伝搬遅延時間よりも長くなる。
Then, like the other slave units, the
なお、この波形整形処理は、時間同期フレームに限ることなく、全てのフレームに対して行う。また、上り用システムバス12に接続する受信制御部61dがフレームを受信すると、波形整形処理をした後、送信制御部61cから送信する。
This waveform shaping process is performed for all frames without being limited to time synchronization frames. Also, when the
また、時間同期フレームが延長ケーブル14を伝送される際にも、伝搬遅延時間が発生する。この伝搬遅延時間は、延長ケーブル14の長さに比例する。本実施形態では、各延長ユニット同士を接続するために使用する延長ケーブル14の長さを等しくし、延長ケーブル14で生じる伝搬遅延時間も固定値t2となるようにしている。
A propagation delay time also occurs when a time synchronization frame is transmitted through the
図1に示すように、PLCが延長ケーブルなど用いることなく単一のブロック体から構成されている場合、上述したように各スレーブユニットの補正時間は、単純にN番目のスレーブユニットがN×t0となる。これに対し、本実施形態のように、延長ケーブル14が介在されることで、延長ケーブル14以降のスレーブユニットの補正時間は、延長ケーブル14での伝搬遅延時間t2を考慮する必要がある。さらに、延長ユニット60,60′での伝搬遅延時間t1も一般のスレーブユニットで遅延する基準時間t0よりも長い。
As shown in FIG. 1, when the PLC is composed of a single block body without using an extension cable or the like, as described above, the correction time of each slave unit is simply N × t0. It becomes. On the other hand, as in the present embodiment, the
そこで、CPUユニット20のMPU21は、システム立ち上げ時に取得した構成情報から、延長ユニットの有無を判断し、延長ユニットがある場合には、対となる延長ユニットの間に延長ケーブル14が存在していると判断して各ユニットについての補正時間を求め、その求めた補正時間を各ユニットに通知する。
Therefore, the
具体的には、CPUユニット20を含むブロック体に連結されたスレーブユニットに対しては、上記の第1の実施形態と同様にN番目のスロットであれば、補正時間はN×t0となる。また、第1実施形態でも説明した通り、補正時間は、CPUユニット20のASIC24の送信制御部24aにてマスタ時刻データをラッチした時点を基準に、スレーブユニットの受信制御部で正常に受信されるまでの時間である。従って、延長ユニット60における波形整形処理が、受信制御部における正常受信された後で行われるとすると、当該延長ユニットで受信処理が完了するまでの伝搬遅延時間は、波形処理等の影響を受けないので、当該延長ユニット60の補正値は、補正時間はN×t0となる。
Specifically, for the slave units connected to the block body including the
この延長ユニット60と延長ケーブル14で接続された別の延長ブロック体を構成する延長ユニット60′についての補正時間は、延長ユニット60での伝搬遅延時t1と延長ケーブル14での伝搬遅延時間t2を考慮して求める。具体的には、当該延長ユニット60′がN番目であるとすると、
補正時間=(N−1)×t0+t1+t2
となる。さらに、この延長スロット60′の後段に続くスレーブユニットの補正時間は、係る延長スロット60′での伝搬遅延時間t1も考慮して求める。
The correction time for the extension unit 60 'constituting another extension block body connected to the
Correction time = (N−1) × t0 + t1 + t2
It becomes. Further, the correction time of the slave unit following the extension slot 60 'is determined in consideration of the propagation delay time t1 in the extension slot 60'.
なお、本実施形態では、延長ケーブル14の長さを固定にしたことで、延長ケーブル14での伝搬遅延時間t2も固定値となり、システム立ち上げ時に構成情報を取得することで、簡単な演算処理で各ユニットに対する補正時間を求め、設定することができるが、本発明は延長ケーブル14の長さを固定にしなくてももちろん良い。その場合には、特許文献2等に開示された伝搬時間の算出アルゴリズムを利用し、延長ケーブル14の両端に接続された延長ユニット60,60′のそれぞれに対する伝搬時間を求め、その差分から延長ケーブルでの遅延時間を算出することができる。また、ユーザは、使用する延長ケーブルの長さがわかっているので、設定ツール装置を用いて、使用する延長ケーブルの長さに対応する伝搬遅延時間をCPUユニットに設定しても良い。
In the present embodiment, since the length of the
[変形例]
上述した実施形態では、いずれも全てのユニットに内部時計を持たせ、時刻合わせを行うように説明したが、本発明は必ずしも全てのユニットと時刻合わせを行う必要はなく、同期運転等が必要な一部のユニットの内部時計をマスタの時刻に合わせるものでも良い。
[Modification]
In the above-described embodiments, it has been described that all units have an internal clock and time adjustment is performed. However, the present invention does not necessarily require time adjustment with all units, and requires synchronous operation or the like. The internal clock of some units may be set to the master time.
また、システムバスとして下り用システムバス11と上り用システムバス12の2系統に分けた構成を採ったが、上りと下りの伝送路を共通化した1系統のものでも良い。その場合でも、時間同期フレームを受信した場合には、自己でデータの追加等をすることなく転送することで、各ユニットでの伝搬時間を一定にすることができる。但し、上り信号のフレームと衝突する可能性があるため、本実施形態のように2系統或いはそれ以上に分け、少なくとも、時間同期フレームを送信しているときは、それが優先処理され衝突することなくデジチェーン接続された全てのスレーブユニットに伝達されるようにするのが好ましい。
In addition, although the system bus is divided into two systems, that is, the
さらにまた、上述した各実施形態では、ユニットの側面同士をコネクタで接続するタイプのものとしたが、本発明はこれに限ることはなく、例えば、各スレーブユニットをベースユニットに設けたスロットに装着するものでも良い。 Furthermore, in each of the embodiments described above, the side surfaces of the units are connected by connectors, but the present invention is not limited to this. For example, each slave unit is mounted in a slot provided in the base unit. You can do it.
10 PLC
11 下り用システムバス
12 上り用システムバス
14 延長ケーブル
20 CPUユニット
21 MPU
24 ASIC
26 内部時計
30 I/Oユニット
31 ASIC
32 内部時計
33 レジスタ
40 高機能I/Oユニット
41 ASIC
42 内部時計
43 レジスタ
44 MPU
50 エンドユニット
60 延長ユニット
10 PLC
11
24 ASIC
26 Internal clock 30 I /
32
42
50
Claims (8)
その複数のユニットのうちの少なくとも2つは計時手段を備え、その計時手段を備えたユニットの1つはマスタとなり、他のユニットはスレーブとなり、
前記マスタは、自己の計時手段の時刻情報を格納した時間同期フレームを送信する機能を備え、
前記時間同期フレームを受信した前記マスタ以外の前記複数のユニットは、新たなデータを追加することなく次のユニットに送信し、
前記スレーブは、前記マスタから何番目に配置されたユニットであるかの接続位置に対応して決定される伝搬遅延時間を特定する補正値を記憶する記憶手段と、前記時間同期フレームを受信した場合には、その時間同期フレームに格納された時刻情報と前記補正値から現在の時刻情報を求め、自己の計時手段を補正する補正手段と、
を備えることを特徴とするプログラマブルコントローラ。 A programmable controller comprising a plurality of units connected in a daisy chain to the system bus,
At least two of the plurality of units have time measuring means, one of the units having the time measuring means becomes a master, the other unit becomes a slave,
The master has a function of transmitting a time synchronization frame storing time information of its own time measuring means,
The plurality of units other than the master that have received the time synchronization frame transmit to the next unit without adding new data,
When the slave has received the time synchronization frame, storage means for storing a correction value for specifying a propagation delay time determined corresponding to the connection position of the unit arranged from the master, and the time synchronization frame Includes a correction means for obtaining current time information from the time information stored in the time synchronization frame and the correction value, and correcting its own clock means;
A programmable controller comprising:
前記マスタと一体に連結されるN番目の前記スレーブに設定される補正値は、前記一定の時間×Nで求めることを特徴とする請求項1または2に記載のプログラマブルコントローラ。 The propagation delay time required for the unit to propagate the time synchronization frame is a fixed time in each unit, and
3. The programmable controller according to claim 1, wherein a correction value set for the Nth slave connected integrally with the master is obtained by the predetermined time × N.
前記延長ユニット以外のユニットにおける前記時間同期フレームを伝搬するために要する伝搬遅延時間は、各ユニットで一定の時間とし、
前記マスタが実装されるブロックに存在するN番目の前記スレーブに設定される補正値は、前記一定の時間×Nとし、
前記延長ケーブル以降のブロックに装着されたスレーブの記憶手段に格納される補正値は、前記延長ケーブルにおける伝搬遅延時間と、マスタとの間に存在する延長ユニットでかかる伝搬遅延時間も加味して設定されることを特徴とする請求項1から3のいずれかに記載のプログラマブルコントローラ。 A plurality of block bodies including a plurality of units connected to the system bus by daisy chain are provided, one of the plurality of block bodies includes the CPU unit, and one of the plurality of units includes the CPU unit. It is an extension unit for connecting each unit that constitutes a non-block body and the CPU unit, and the programmable controller is configured by connecting these extension units with an extension cable,
Propagation delay time required to propagate the time synchronization frame in units other than the extension unit is a fixed time in each unit,
The correction value set in the Nth slave existing in the block where the master is mounted is the fixed time × N,
The correction value stored in the storage means of the slave attached to the block after the extension cable is set in consideration of the propagation delay time in the extension cable and the propagation delay time required in the extension unit existing between the master and the extension cable. The programmable controller according to any one of claims 1 to 3, wherein:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011057306A JP5794449B2 (en) | 2010-03-15 | 2011-03-15 | Programmable controller |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010058253 | 2010-03-15 | ||
JP2010058253 | 2010-03-15 | ||
JP2011057306A JP5794449B2 (en) | 2010-03-15 | 2011-03-15 | Programmable controller |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011216085A true JP2011216085A (en) | 2011-10-27 |
JP5794449B2 JP5794449B2 (en) | 2015-10-14 |
Family
ID=44945695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011057306A Active JP5794449B2 (en) | 2010-03-15 | 2011-03-15 | Programmable controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5794449B2 (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102419565A (en) * | 2011-12-02 | 2012-04-18 | 上海电器科学研究院 | PLC (Programmable Logic Controller) with synchronous pulse output function |
WO2013137023A1 (en) * | 2012-03-15 | 2013-09-19 | オムロン株式会社 | Control device, image processing device, control method, computer-readable recording medium, and program |
WO2013136913A1 (en) * | 2012-03-15 | 2013-09-19 | オムロン株式会社 | Control device, and control method |
JP2013196307A (en) * | 2012-03-19 | 2013-09-30 | Fanuc Ltd | Numerical control system for performing time measurement by io unit |
CN106020094A (en) * | 2015-03-31 | 2016-10-12 | 欧姆龙株式会社 | Information processing apparatus, information processing program, and information processing method |
JP2017079008A (en) * | 2015-10-21 | 2017-04-27 | 株式会社キーエンス | Programmable logic controller and control method |
JP2017079009A (en) * | 2015-10-21 | 2017-04-27 | 株式会社キーエンス | Monitor device of programmable logic controller |
EP3211497A1 (en) | 2016-02-26 | 2017-08-30 | Omron Corporation | Master device, slave device, information processing device, event log collecting system, control method of master device, control method of slave device and control program |
WO2018146909A1 (en) | 2017-02-07 | 2018-08-16 | オムロン株式会社 | Computation device, control device and control method |
JP2019020822A (en) * | 2017-07-12 | 2019-02-07 | 株式会社日立産機システム | Programmable controller |
CN109324535A (en) * | 2017-07-31 | 2019-02-12 | 松下神视株式会社 | Control unit, programmable controller |
JP6704548B1 (en) * | 2019-03-28 | 2020-06-03 | 三菱電機株式会社 | Communication system, communication device and program |
JP2022189586A (en) * | 2021-06-11 | 2022-12-22 | 矢崎総業株式会社 | Communication system, upper level control device and lower level control device |
WO2023096098A1 (en) * | 2021-11-29 | 2023-06-01 | 성창 주식회사 | System for time synchronization between server and iot device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1013394A (en) * | 1996-06-21 | 1998-01-16 | Fanuc Ltd | Synchronization method in communication |
JPH1049216A (en) * | 1996-08-06 | 1998-02-20 | Fanuc Ltd | Inter-device data communication method |
JP2001027904A (en) * | 1999-05-11 | 2001-01-30 | Fanuc Ltd | Numerical control system |
JP2001100813A (en) * | 1999-09-28 | 2001-04-13 | Mitsubishi Electric Corp | Programmable controller |
JP2005269879A (en) * | 2004-02-19 | 2005-09-29 | Toshiba Corp | Control system |
JP4029617B2 (en) * | 2000-05-22 | 2008-01-09 | 三菱電機株式会社 | Numerical control system and communication timing setting method in the numerical control system |
JP2008146149A (en) * | 2006-12-06 | 2008-06-26 | Yaskawa Electric Corp | Synchronous processing device and synchronous processing method of distributed system |
JP2009157913A (en) * | 2007-12-07 | 2009-07-16 | Omron Corp | Industrial controller |
JP2010003038A (en) * | 2008-06-19 | 2010-01-07 | Koyo Electronics Ind Co Ltd | Method of automatically assigning id to each unit in serial connection |
-
2011
- 2011-03-15 JP JP2011057306A patent/JP5794449B2/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1013394A (en) * | 1996-06-21 | 1998-01-16 | Fanuc Ltd | Synchronization method in communication |
JPH1049216A (en) * | 1996-08-06 | 1998-02-20 | Fanuc Ltd | Inter-device data communication method |
JP2001027904A (en) * | 1999-05-11 | 2001-01-30 | Fanuc Ltd | Numerical control system |
JP2001100813A (en) * | 1999-09-28 | 2001-04-13 | Mitsubishi Electric Corp | Programmable controller |
JP4029617B2 (en) * | 2000-05-22 | 2008-01-09 | 三菱電機株式会社 | Numerical control system and communication timing setting method in the numerical control system |
JP2005269879A (en) * | 2004-02-19 | 2005-09-29 | Toshiba Corp | Control system |
JP2008146149A (en) * | 2006-12-06 | 2008-06-26 | Yaskawa Electric Corp | Synchronous processing device and synchronous processing method of distributed system |
JP2009157913A (en) * | 2007-12-07 | 2009-07-16 | Omron Corp | Industrial controller |
JP2010003038A (en) * | 2008-06-19 | 2010-01-07 | Koyo Electronics Ind Co Ltd | Method of automatically assigning id to each unit in serial connection |
Cited By (30)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102419565A (en) * | 2011-12-02 | 2012-04-18 | 上海电器科学研究院 | PLC (Programmable Logic Controller) with synchronous pulse output function |
CN104126155B (en) * | 2012-03-15 | 2017-06-09 | 欧姆龙株式会社 | Control device, information processor, control method |
WO2013137023A1 (en) * | 2012-03-15 | 2013-09-19 | オムロン株式会社 | Control device, image processing device, control method, computer-readable recording medium, and program |
WO2013136913A1 (en) * | 2012-03-15 | 2013-09-19 | オムロン株式会社 | Control device, and control method |
JP2013191132A (en) * | 2012-03-15 | 2013-09-26 | Omron Corp | Control device |
CN104126155A (en) * | 2012-03-15 | 2014-10-29 | 欧姆龙株式会社 | Control device, image processing device, control method, computer-readable recording medium and program |
JPWO2013137023A1 (en) * | 2012-03-15 | 2015-08-03 | オムロン株式会社 | Control device, information processing device, control method, computer-readable recording medium, and program |
EP2816425A4 (en) * | 2012-03-15 | 2015-12-23 | Omron Tateisi Electronics Co | Control device, image processing device, control method, computer-readable recording medium, and program |
US9398080B2 (en) | 2012-03-15 | 2016-07-19 | Omron Corporation | Control device, image processing device, control method, computer-readable recording medium, and program |
JP2013196307A (en) * | 2012-03-19 | 2013-09-30 | Fanuc Ltd | Numerical control system for performing time measurement by io unit |
US9377770B2 (en) | 2012-03-19 | 2016-06-28 | Fanuc Corporation | Numerical control system using I/O unit for time measurement |
US10572420B2 (en) | 2015-03-31 | 2020-02-25 | Omron Corporation | Information processing apparatus, information processing program, and information processing method |
CN106020094B (en) * | 2015-03-31 | 2018-10-12 | 欧姆龙株式会社 | Information processing unit, computer readable storage medium and information processing method |
CN106020094A (en) * | 2015-03-31 | 2016-10-12 | 欧姆龙株式会社 | Information processing apparatus, information processing program, and information processing method |
JP2017079008A (en) * | 2015-10-21 | 2017-04-27 | 株式会社キーエンス | Programmable logic controller and control method |
JP2017079009A (en) * | 2015-10-21 | 2017-04-27 | 株式会社キーエンス | Monitor device of programmable logic controller |
US10523761B2 (en) | 2016-02-26 | 2019-12-31 | Omron Corporation | Master device, slave device, information processing device, event log collecting system, control method of master device, control method of slave device and control program |
EP3211497A1 (en) | 2016-02-26 | 2017-08-30 | Omron Corporation | Master device, slave device, information processing device, event log collecting system, control method of master device, control method of slave device and control program |
US20170251059A1 (en) | 2016-02-26 | 2017-08-31 | Omron Corporation | Master device, slave device, information processing device, event log collecting system, control method of master device, control method of slave device and control program |
WO2018146909A1 (en) | 2017-02-07 | 2018-08-16 | オムロン株式会社 | Computation device, control device and control method |
US10785014B2 (en) | 2017-02-07 | 2020-09-22 | Omron Corporation | Computation device, control device and control method |
JP2019020822A (en) * | 2017-07-12 | 2019-02-07 | 株式会社日立産機システム | Programmable controller |
CN109324535A (en) * | 2017-07-31 | 2019-02-12 | 松下神视株式会社 | Control unit, programmable controller |
JP6704548B1 (en) * | 2019-03-28 | 2020-06-03 | 三菱電機株式会社 | Communication system, communication device and program |
WO2020194714A1 (en) * | 2019-03-28 | 2020-10-01 | 三菱電機株式会社 | Communication system, communication device, and program |
US11310026B2 (en) | 2019-03-28 | 2022-04-19 | Mitsubishi Electric Corporation | Communication system, communication device, and program |
JP2022189586A (en) * | 2021-06-11 | 2022-12-22 | 矢崎総業株式会社 | Communication system, upper level control device and lower level control device |
US11809357B2 (en) | 2021-06-11 | 2023-11-07 | Yazaki Corporation | Communication system, superior control device and subordinate control device |
JP7410085B2 (en) | 2021-06-11 | 2024-01-09 | 矢崎総業株式会社 | Communication system and upper control device |
WO2023096098A1 (en) * | 2021-11-29 | 2023-06-01 | 성창 주식회사 | System for time synchronization between server and iot device |
Also Published As
Publication number | Publication date |
---|---|
JP5794449B2 (en) | 2015-10-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5794449B2 (en) | Programmable controller | |
JP6477161B2 (en) | INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING PROGRAM, AND INFORMATION PROCESSING METHOD | |
JP5408445B2 (en) | Programmable controller and master communication circuit | |
US9836038B2 (en) | Control device, and control method for link activating and deactivating | |
EP3309647B1 (en) | Control device and communication device | |
WO2015056695A1 (en) | Control device and control method | |
JP2007060400A (en) | Method and system for controlling communication timing | |
US20200007254A1 (en) | Networked motion control | |
KR20100080191A (en) | Apparatus and method for controlling synchronization between slave devices connected to network | |
TW200849925A (en) | Communication device, synchronized communication system, and synchronized communication method | |
CN107947888B (en) | A kind of task level synchronous method based on network communication | |
US20210063989A1 (en) | Control device and control method | |
US9081371B2 (en) | Method for synchronizing an operating clock with a time clock of an automation network | |
US20230161719A1 (en) | Processing of process data | |
WO2022168475A1 (en) | Control device | |
JP2018520396A (en) | Centralized network configuration for motion-related control systems | |
JP2007027889A (en) | Network configuration information teaching method in plc system | |
CN103973539A (en) | A method of operating an automation system | |
JP5487876B2 (en) | Communication device | |
EP3288198A1 (en) | System and method of clock synchronization in a computer network | |
JP3878312B2 (en) | Serial communication device | |
JP2012191361A (en) | Synchronous control system | |
JP6217478B2 (en) | Control system and control device | |
JP2014187442A (en) | Synchronous controller | |
JPS62162159A (en) | Control method for masterless serial bus occupation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140314 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150114 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150129 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150330 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20150716 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150729 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5794449 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |