JP2004274395A - Duplicate address detecting method, slave and master in field bus system, and field bus - Google Patents

Duplicate address detecting method, slave and master in field bus system, and field bus Download PDF

Info

Publication number
JP2004274395A
JP2004274395A JP2003062345A JP2003062345A JP2004274395A JP 2004274395 A JP2004274395 A JP 2004274395A JP 2003062345 A JP2003062345 A JP 2003062345A JP 2003062345 A JP2003062345 A JP 2003062345A JP 2004274395 A JP2004274395 A JP 2004274395A
Authority
JP
Japan
Prior art keywords
slave
address
master
random number
status
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
Application number
JP2003062345A
Other languages
Japanese (ja)
Other versions
JP4023342B2 (en
Inventor
Seiji Mizutani
征爾 水谷
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2003062345A priority Critical patent/JP4023342B2/en
Publication of JP2004274395A publication Critical patent/JP2004274395A/en
Application granted granted Critical
Publication of JP4023342B2 publication Critical patent/JP4023342B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a duplicate address detecting method by which a slave or master can recognize the occurrence of duplicate address of a node, even in a field bus system employing a multi-drop wiring configuration. <P>SOLUTION: Each slave 20 is allowed to have random numbers, and the slave 20 returns a response with the random numbers in response to a status reading request ((1)) from a master unit 12 ((2)). Upon receiving the response, the master issues a status writing request added with the received random numbers ((3)). The slave compares the random numbers added to the status writing request with its own random numbers, and if the random numbers match with each other, the slave becomes a subscriber slave, and if the random numbers do not match, the slave recognizes that a duplicate address occurs and is brought into a standby state. The master recognizes the occurrence of a duplicate address by detecting a node in a standby state. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
この発明は、フィールドバスシステムにおける二重アドレス検知方法及びスレーブ並びにマスタ及びフィールドバスに関するもので、フィールドバスシステムで、マルチドロップの配線形態におけるノードの二重アドレス検知を行うものに関する。
【0002】
【従来の技術】
FA(ファクトリーオートメーション)で用いられるPLC(プログラマブルコントローラ)は、スイッチやセンサなどの入力機器のON/OFF情報を入力し、ラダー言語などで書かれたシーケンスプログラム(ユーザプログラム)に沿って論理演算を実行する。そして、PLCは、得られた演算結果にしたがって、リレー,バルブ,アクチュエータなどの出力機器に対し、ON/OFF情報の信号を出力することで制御が実行される。
【0003】
係るPLCの一形態として、各機能ごとに生成されたユニットを複数用意し、電気,機械的に連結して構成するものがある。係るタイプを構成するためのユニットとしては、電源ユニット,CPUユニット,I/Oユニット,マスタユニット等各種のものがある。PLCを構成するI/Oユニットが有する接続端子には、PLCの近くの場所に存在する入力機器や出力機器の接続線をつなぐ。
【0004】
そして、上記したマスタユニットのほうは、フィールドバス等の制御系ネットワークに接続され、その制御系ネットワークに接続された各種のスレーブと制御系ネットワークを介して通信可能となっている。このフィールドバスにおける配線は、マルチドロップ配線になっていて、ひとつのフィールドバスにマスタユニットと複数のスレーブとが接続できるようになっている。各スレーブは接続端子を有していて、その接続端子には、PLCから比較的に遠い場所に存在する入力機器や出力機器がつながれる。そしてマスタユニットは、各スレーブとの間でフィールドバス通信をしてフレームを送受信することにより、各スレーブにつながれている入力機器の入力信号(INデータ)を受け取るとともに、出力信号(OUTデータ)を各スレーブに対して送信する。通信の詳細を説明すると、マスタユニットから出力された送信フレームは、フィールドバスに接続された全てのスレーブ(ノード)に対して一度に到達する。そして、各スレーブには個々にノードアドレスが設定されており、送信フレームには宛先のノードアドレスを含む宛先データを付加しておく。これにより、各スレーブは、受信した送信フレームの宛先データを抽出し、自己宛の送信フレームか否かを判断し自己宛の場合にはその送信フレームを取り込み、自己宛でない場合には破棄するようになる。
【0005】
なお、スレーブからマスタユニットへ向けて出力されるフレームも、同様に送信アドレスにマスタユニットのノードアドレスが付加されることにより、宛先のマスタユニットのみが受信することができる。そして、係るスレーブからマスタユニットに向けて出力されるフレームの送信タイミングであるが、各スレーブが一斉に送信すると、フィールドバス上で衝突が生じて通信不能となるので、予め指定された送信タイミングで、各スレーブが順次フレームを送信するような通信プロトコルをとっている。
【0006】
そして、この種の通信プロトコルにおけるマスタとスレーブのデータの送受は、マスタユニットから一括送受信方式によりOUTフレームを送信する。このOUTフレーム中にはOUTデータが含まれていて、所定のOUTスレーブに受信される。なお、1つのOUTフレーム中のOUTデータ領域には、複数のOUTスレーブ用のOUTデータが格納されており、各OUTフレームは、OUTデータ領域中の自己用のOUTデータの格納位置が予めわかっているため、当該格納位置のOUTデータを取得する。
【0007】
一方、各INスレーブは、マスタユニットからOUTフレームを正常に受信すると、その受信完了をきっかけにして時間管理を始める。そして各INスレーブが出力するフレーム同士が重ならないような基本アイドルタイム毎に、各INスレーブは各々決められたタイミングで、INフレームIF0〜IF2をマスタユニットに送信する。
【0008】
マスタユニットでは、基本アイドルタイムに基づく各スレーブ毎のタイムスロット内でINフレームIF0〜IF2を受信し、各INフレームIF0〜IF2のヘッダであるスタートビットに基づいてINフレーム中のINデータIN0〜IN2を取込む。基本アイドルタイムを適切に設定することにより、各INスレーブからのINフレームの重なりを防止して、確実にINデータを送受することができる。
【0009】
このマルチドロップ方式では、マスタユニットが出力する送信フレームの宛先データを全てのスレーブとすれば、一度に全てのスレーブに送信フレームを送ることができるメリットがある。この種のシステムは、例えば特許文献1などに開示されている。
【0010】
また、各スレーブのノードアドレスの設定は、例えば、スレーブに設けられたディップスイッチ等のメカ的な設定スイッチをユーザが操作してアドレスを割り付ける。
【0011】
【特許文献1】
特開平09−128019
【0012】
【発明が解決しようとする課題】
しかしながら、上記した従来のマルチドロップ方式のネットワークの場合、以下に示す問題がある。すなわち、ノードアドレスの設定が個々のスレーブに対してユーザがマニュアル操作で設定するため、誤って異なるスレーブに同一のノードアドレスを設定してしまうおそれがある。そして、そのように二重アドレスを設定してしまうと、マスタユニットからの送信フレームが一度に全ノードに到達するため、その二重アドレスに対して送信フレームを送ると、二重アドレスが割り付けられた複数のスレーブ(ノード)が同時に送信フレームを受信し、それぞれがレスポンスを返信する。すると、フィールドバス上では伝送フレームの衝突が発生し、不安定な通信回線となる。
【0013】
さらに、上記したように、二重アドレスが発生している場合に、複数のスレーブからの送信フレームが衝突してマスタ側に到達しない場合には、そのノードアドレスのスレーブがフィールドバス上に存在していないと認識し、一方のスレーブからの送信フレームを受信した場合には、受信できたスレーブは存在していることが認識できるものの、ネットワークに加入できないスレーブの存在は認識することができない。従って、マスタユニット側では、二重アドレス状態が発生していることを認識することができなかった。
【0014】
しかも、一方のスレーブからのレスポンスを正常に受信すると、マスタユニットはそのノードアドレスのスレーブが存在していると認識し、その後、レスポンスを正常に受信したスレーブと通信すべくマスタユニットがその二重アドレスが発生しているノードアドレスに向けて送信フレームを送った場合、前回のレスポンスが受信されなかったスレーブがその送信フレームを受信しレスポンスを返すおそれもある。
【0015】
この発明は、マルチドロップの配線形態をとっているフィールドバスシステムであっても、ノードの二重アドレスが発生していることをスレーブやマスタ側で認識することができるフィールドバスシステムにおける二重アドレス検知方法及びスレーブ並びにマスタ及びフィールドバスを提供することを目的とする。
【0016】
【課題を解決するための手段】
この発明によるフィールドバスシステムにおける二重アドレス検知方法は、マスタと、スレーブが、フィールドバスに接続されて構成されるフィールドバスシステムにおける二重アドレス検知方法である。そして、まず前記スレーブは、設定された乱数を記憶保持する。そして、前記マスタは、前記フィールドバスに接続されたスレーブに対し、ノードアドレスを指定してステータスリード要求を発行する。また、前記指定されたノードアドレスを持つスレーブは、前記ステータスリード要求を受信すると、自己のノードアドレスとともに前記乱数を前記ステータスリード要求に対するレスポンスとして返送する。前記マスタは、前記レスポンスを受信すると、受信したノードアドレスのスレーブに対し、前記乱数を含むステータスライトを発行する。そして、前記ステータスライトの送信アドレスを持つスレーブは、受信した前記ステータスライトとともに送られてきた乱数と、自己が記憶保持する乱数を比較し、一致しない場合には、同一のノードアドレスを持つ他のスレーブが存在する二重アドレス状態であることを検知し、自己は待機状態になるようにした。
【0017】
ここで、乱数の設定は、実施の形態では、乱数設定手段を設け、スレーブ側にて所定のタイミングで乱数を設定するようにしたが、本発明はこれに限ることはなく、例えばツールその他の外部から乱数を与え、それを記憶保持するようにしてもよい。
【0018】
また、上記した検知方法の発明を実施するために適した本発明に係るスレーブは、フィールドバスに接続可能なスレーブであって、前記フィールドバスを介してマスタと通信する通信手段と、設定された乱数を記憶する乱数記憶手段と、前記マスタから送られてきた自己のノードアドレス宛のステータスリード要求を受信した際に、自己のノードアドレスとともに前記乱数記憶手段に記憶された乱数を前記ステータスリード要求に対するレスポンスとして返送する機能と、前記マスタから送られてきた自己のノードアドレス宛の乱数を含むステータスライトを受信した際に、そのステータスライトとともに送られてきた乱数と、自己が記憶保持する乱数を比較し、一致しない場合には、同一のノードアドレスを持つ他のスレーブが存在する二重アドレス状態であることを検知し、自己のステータスを待機状態にする機能を備えるようにした。
【0019】
また、上記した検知方法の発明を実施するために適した本発明に係るマスタは、フィールドバスに接続可能なマスタであって、前記フィールドバスを介してスレーブと通信する通信手段と、前記フィールドバスに接続されたスレーブに対し、ノードアドレスを指定してステータスリード要求を発行する機能と、そのステータスリード要求に対するスレーブからの乱数付きのレスポンスを受信した際に、その受信したノードアドレスのスレーブに対し、受信した乱数を含むステータスライトを発行する機能を備えるようにした。
【0020】
さらに、上記した検知方法の発明を実施するために適した本発明に係るフィールドバスシステムとしては、上記した構成のマスタと、スレーブが、フィールドバスに接続されて構成される。そして、前記マスタは、前記フィールドバスに接続されたスレーブに対し、ノードアドレスを指定してステータスリード要求を発行し、前記指定されたノードアドレスを持つスレーブは、前記ステータスリード要求を受信すると、自己のノードアドレスとともに前記乱数を前記ステータスリード要求に対するレスポンスとして返送し、前記マスタは、前記レスポンスを受信すると、受信したノードアドレスのスレーブに対し、前記乱数を含むステータスライトを発行し、前記ステータスライトの送信アドレスを持つスレーブは、受信した前記ステータスライトとともに送られてきた乱数と、自己が記憶保持する乱数を比較し、一致しない場合には、同一のノードアドレスを持つ他のスレーブが存在する二重アドレス状態であることを検知し、自己は待機状態に設定されるようにした。
【0021】
本発明が適用されるフィールドバスシステムは、例えばマルチドロップの配線形態と称されるもので、通常状態では、マスタからはOUTデータを一括してスレーブへ転送し、スレーブ側では自局の決められた時間帯にINデータを返送する通信プロトコルをとる。このシステムでは、各スレーブに設定されるノードアドレスは、そのフィールドバスシステムにおいてユニークである必要があるが、誤って同一のノードアドレスを複数のスレーブに設定し、二重アドレスを生じてしまうことがある。本発明は、係る二重アドレスが発生していることを検知するものである。
【0022】
すなわち、本発明では、スレーブに乱数を持たせ、マスタからのステータスリード要求に対してその乱数付きのレスポンスを返送し、そのレスポンスを受信したマスタは、受信した乱数を付加したステータスライト要求を発行する。従って、スレーブは、自己のノードアドレス宛のステータスライト要求に付加された乱数と自己の乱数を比較することにより、二重アドレスが発生しているか否かを判断できる。つまり、自己のノードアドレス宛のステータスライト要求に付加された乱数と自己の乱数が一致した場合には、その前に返送したステータスリード要求に対する乱数付きレスポンスがマスタに受信されたとみなせるので、そのまま加入する。一方、一致しなかった場合には、同一のノードアドレスを持つ他のスレーブからのレスポンスがマスタに受信され自己が発したレスポンスは受信されなかったといえる。従って、同一のノードアドレスを持つスレーブが少なくともほかに1つ存在し、二重アドレスが発生していることを認識できる。さらに、自己はマスタに認識されなかったので、待機状態になる。これにより、二重アドレスとなった複数のスレーブが同時にフレームを送信することがなくなり、通信の安定化が図れる。
【0023】
また、本発明に係る二重アドレス検知方法では、上記した発明を前提とし、前記マスタは、前記待機状態になっているスレーブのノードアドレスを取得することにより、二重アドレスが発生していることを認識するようにした。そして、この方法を実施するのに適した本発明にかかるマスタとしては、前記ステータスライトに基づいて待機状態に設定されたスレーブのノードアドレスを取得することにより、二重アドレスが発生しているスレーブを認識する機能を備えることである。これにより、本発明では、二重アドレスが発生していることをマスタも認識できる。
【0024】
さらにまた本発明に係る二重アドレス検知方法では、前記スレーブが前記マスタに返すレスポンスの送信に確率を設定し、送信タイミングに来ても所定の割合で前記レスポンスを送信しないように制御するようにすることができる。そして、かかる方法を実施するのに適した本発明に係るスレーブでは、マスタに返すレスポンスの送信に確率を設定し、送信タイミングに来ても所定の割合で前記レスポンスを送信しないように制御する機能を備えることである。
【0025】
すなわち、二重アドレスが発生している場合に、タイミングよくいずれか1つのスレーブから発せられたステータスリードに対するレスポンスがマスタに受信されると、上記したように二重アドレスを検知することができる。しかし、複数のレスポンスが衝突していずれもマスタに受信されないおそれもある。これに対し、本発明では、所定の割合でレスポンスが送信されないので、そのとき他のスレーブからレスポンスが送信されると、衝突することなくマスタユニットに到達する(二重アドレスを発生したスレーブが2つの場合)。また、3つ以上のスレーブが二重アドレスとなっていても、確実に衝突が回避されるとはいえないが、レスポンスを送信するスレーブの数が少ないほど、マスタに到達する可能性が高くなる。これにより、確率付きで複数回レスポンスを送信することにより、いずれかのスレーブからのレスポンスをマスタが認識し、認識されなかった他のスレーブは二重アドレスによる待機状態になる。
【0026】
【発明の実施の形態】
図1は、本発明の好適な一実施の形態を実現するシステム全体を示している。図1に示すように、PLC10と各種のスレーブ20が、フィールドバス30を介して接続されネットワークシステムを構築している。ノードとなるスレーブ20としては、リモートIOその他の機器がある。
【0027】
PLC10は、CPUユニット11やマスタユニット12などの各機能ごとに生成されたユニットを連結することにより構成されている。その各ユニットはPLCバス(内部バスとも言う。図示せず)につながれていて、PLCの各ユニット間でバス通信をしてデータ通信ができるようになっている。そして、このマスタユニット12にはフィールドバス30がに接続され、そのフィールドバス30に複数台の各スレーブ20がマルチドロップ接続によってつながれていて、マスタユニットと各スレーブとの間で通信が行われるようになっている。さらに、マスタユニット12は、PLC10の内部バスを介してCPUユニット11内のIOメモリにアクセスし、IOデータ等の読み書きを行うようになっている。もう少し説明すると、マスタユニット12がスレーブ20の接続端子につながれた入力機器からの入力信号(オン/オフ状態)をフィールドバス通信によって取り込んで、マスタユニット12が取り込んだ入力信号(入力データ)を内部バス通信によってCPUユニット11に送信し、CPUユニット11が入力信号を受け取る。CPUユニット11は、その入力信号に基づいてユーザプログラムによって予め定められた論理演算をし、その演算結果を含んだ出力信号(出力データ)を内部バスを介してマスタユニット12に送信する。マスタユニットはその出力信号をフィールドバス通信によってスレーブに送信する。各ユニットでは受信した出力信号を接続端子に接続された出力機器に対して出力する。なお、入力信号と出力信号をあわせてI/Oデータと呼ぶことがある。つまり、INデータは入力機器からスレーブへ、スレーブからマスタユニットへ、マスタユニットからCPUユニットへと伝わる。また、OUTデータはCPUユニットからマスタユニットへ、マスタユニットからスレーブへ、スレーブから出力機器へと伝わる。
【0028】
マスタユニット12は、図2に示すように、フィールドバスに接続され、実際にデータの送受を行う通信インタフェース12aと、その通信インタフェース12aを介してマスタ−スレーブ間通信をし、スレーブ20との間でI/Oデータの送受を行ったり、所定のコマンドの送信並びにそれに基づくレスポンスの受信を行うマスタ用ASIC12bと、各種の制御を行うMPU12dと、各種の制御実行時にワークエリア等として使用されるRAM12cと、上記制御を行うプログラムや、各種の設定データ等が格納されたEEPROM12eと、CPUユニットなどと内部バス通信を行うためのインタフェース12hと、動作状態(通信状態)や異常/正常などを示すLED表示部12f並びにアドレスの設定などを行うための設定スイッチ12gを備えている。
【0029】
MPU12dが行う制御としては、CPUユニット11その他のユニット等と通信したり、マスタ用ASIC12bを動作させたりするようになっている。特に本発明との関係でいうと、フィールドバス30に接続されたスレーブ20と通信をし、二重アドレスが発生していないかをチェックするようになっている。具体的な処理機能は後述する。
【0030】
スレーブ20は、図3に示すように、フィールドバスに接続され、実際にマスタユニット12との間でI/Oデータや各種メッセージ等の送受を行う通信インタフェース20aと、その通信インタフェース20aを介して取得したマスタ−スレーブ間通信をし、I/Oデータの送受を行ったり、マスタユニット12からの所定のコマンドの受信並びにそれに基づくレスポンスの送信を行うスレーブ用ASIC20bと、各種の制御を行うMPU20dと、上記制御を行うプログラムや、各種の設定データ,IOデータ等が格納されたEEPROM20eと、端子台の構造となっていて入力機器または出力機器の配線を接続してI/Oデータの送受を行うI/O部20jと、動作状態(通信状態)や異常/正常などを示すLED表示部20f並びにノードアドレスの設定などを行うための設定スイッチ20gを備えている。さらに、入力電圧(24V)を5Vに降圧し、スレーブ20内の各素子に電源供給する電源部20iを備えている。なお、スレーブには3種類あって、それぞれ入力スレーブ、出力スレーブ、入出力スレーブがある。例えば入力スレーブは、入力機器を接続するのみであり、INデータを格納しINデータを送信する構成となっている。
【0031】
このスレーブ20は、本発明との関係でいうと、MPU20d内に乱数生成手段を備え、この乱数生成手段は、最初のフィールドバス上のキャリア検知のタイミングで値(乱数)を決定し、決定した乱数は、リセットされるまでその値をホールドする。この乱数の値をホールドするのは、ソフトウエア上のバッファに保持しても良いし、EEPROM20eに格納するようにしても良い。したがって、仮に異なるスレーブ20に同一のノードアドレスを設定する二重アドレス状態が発生しても、その二重アドレスとなった複数のスレーブの乱数の値が一致する可能性はきわめて低くなる。
【0032】
さらに、マスタユニット12から送られてくる自己宛てのステータスリードを受け取ると、自己のノードアドレスとともに上記ホールドしている乱数を含むステータスリードレスポンスを発行し、マスタユニット12に返送する機能を有する。
【0033】
さらにまた、ステータスリードレスポンスを受信したマスタユニット12は、後述するように、取得したステータスリードレスポンスに書き込まれた乱数を含むステータスライトを、ステータスリードレスポンスを発行したスレーブのノードアドレスに向けて出力するので、そのレスポンスの送信先ノードアドレスを持つスレーブは、係るステータスライトを受信し、それに含まれている乱数と自己が保有している乱数をチェックする。
【0034】
そして、スレーブ20は、受信した送信フレームの内容からフィールドバスに対する加入状態(加入ステータス)を判断し、その判断した加入ステータスを記憶保持する機能を有する。すなわち、ステータスリードレスポンスを送信にもかかわらず、自己宛のノードアドレスのステータスライトが受信できなかった場合には、マスタユニット12がそのノードアドレスのスレーブを認識していないと判断できるので、加入ステータスは「未加入ノード」となる。なお、この加入ステータスの初期値は、「未加入ノード」である。
【0035】
このように「未加入ノード」となった場合、単に通信エラーによりマスタユニット12がスレーブを認識できない可能性もあるが、複数回ステータスリードレスポンスを発行しても「未加入ノード」の状態のままであると、複数のスレーブが同時にステータスリードレスポンスを発行したことによりマスタユニット12がステータリードレスポンスを認識できない、つまり、二重アドレスが発生している可能性があるといえる。
【0036】
また、自己宛のノードアドレスのステータスライトを受信し、それに含まれている乱数が自己が保有するものと一致する場合には、マスタユニット12が自己を認識したと判断できるので、加入ステータスは「加入済みノード」となる。これにより、このスレーブは、フィールドバスに正式に加入でき、以降マスタユニット12とI/Oデータの送受が可能となる。
【0037】
そして、自己宛のノードアドレスのステータスライトを受信し、それに含まれている乱数が自己が保有するものと一致しなかった場合には、二重アドレスを生じているとともにマスタユニット12が同一のノードアドレスを持つ他のスレーブを認識し、自己を認識しなかったと判断できるので、加入ステータスは「二重アドレスで待機中」となる。
【0038】
このように、各スレーブ20は、自己の加入ステータスを保持しているので、マスタユニット12は、各スレーブ20が持つ加入ステータスを認識することにより、二重アドレスの発生の有無並びにどのノードアドレスが二重アドレスを発生しているかを検出することができる。
【0039】
次に、上記した処理を実行するためのマスタユニット12並びにスレーブ20の具体的な処理機能を説明する。まず、マスタユニット12並びにスレーブ20が発行するコマンドは、以下のようになっている。
【0040】
図4に示すように、本プロトコルの通信サイクルの開始タイミングはマスタ局であるマスタユニット12が管理する。そして、通信サイクルはOUT_frameから始まり,複数のCN_frame,EVE_frame,IN_frameとつづく。マスタユニットと各スレーブとの間の通信サイクルの開始タイミングは、OUT_frameの正常受信完了をもって合わせられる。つまり通信同期のタイミングをOUT_frameの正常受信完了タイミングとしているわけである。そして、それにつづくCN_frame,EVE_frame,IN_frameのそれぞれのフレーム内容(通信データサイズ、通信タイミング、通信サイクルなど)は常に固定になっているので、各フレームの送信タイミングは、OUT_frameの正常受信完了を開始タイミングとして予め定められた時間監視により行う。
【0041】
ここで、OUT_frameは、マスタユニット12からスレーブ20へのOUTデータ転送用フレームであって、このOUT_frameに各スレーブに対して送信するOUTデータが含まれている。また受信する側の各スレーブ20にとっては、このOUT_frameが通信サイクルの開始を表すフレームとなる。つまり、各スレーブ20はこのOUT_frameの受信完了時点から計時を開始すべく内部カウンタを起動(タイマ起動)し、予め設定したそれぞれの送信タイミングで所定のフレームをマスタユニット12に対して送信する。
【0042】
そして、OUT_frameのデータ構造は、図5に示すようになっている。すなわち、OUT_frameは、「フレームヘッダ」と、マスタユニット12から所定のスレーブ(OUTスレーブ)20へ送る出力データである「OUTデータ」と、フレームチェックシーケンスである「CRC」からなる。さらに、フレームヘッダは、フレームの開始を示す「スタート」と、フレームの識別コード(プロトコル制御コード)を示す「コマンド」と、接続確認したいスレーブのノードアドレス(CN_frameの要求)を登録する「CN_frame送信要求アドレス」と、イベントフレームを送信許可するノードアドレスを登録する「EVENT送信許可アドレス」と、各スレーブでのOUTデータ位置とINフレーム送出位置の登録バージョンを登録する「ドメインバージョン」と、OUTデータのデータ長を登録する「レングス」とを備えている。
【0043】
さらに、「コマンド」には、本発明との関係で言うと、OUTデータのリフレッシュの許可/禁止を指示するコマンドがある。また、接続確認フレーム送信要求モードと、ステータスリード強制要求モードと、接続確認フレームの送信確率(スレーブ側レスポンスが75%)と、ステータスリード強制要求のレスポンス送信確率(スレーブ側レスポンスが75%)設定有効フラグがある。
【0044】
接続確認フレーム送信要求モードは、加入ステータスに対応して「加入済みスレーブへの要求」,「未加入スレーブへの要求」,「二重アドレス検知スレーブへの要求」の3種類を識別するコードである。また、ステータス強制要求モードは、スレーブに対してEVE_flameの発行を要求するもので、「加入済みスレーブへの要求」,「二重アドレス検知スレーブへの要求」の2種類を識別するコードである。さらに、接続確認フレームの送信確率(スレーブ側レスポンスが75%)設定有効フラグ(1/0)と、ステータスリード強制要求のレスポンス送信確率(スレーブ側レスポンスが75%)設定有効フラグ(1/0)がある。なお、この各送信確率の設定有効フラグは、スレーブがレスポンスを送信する確率を設定するもので、有効フラグが1の時は、75%の確率でレスポンスを返し、有効フラグが0の時は、100%の確率でレスポンスを返すようになる。
【0045】
CN_frameは、ネットワークに接続されているかどうかを確認するための接続確認用フレームである。すなわち、OUT_frame中のCN_frame送信要求アドレスで指定されたスレーブが、レスポンスして返送するフレームであり、図6に示すようなデータ構造をとっている。ここで、「スタート」はフレームの開始を示すもので、「コマンド」はフレーム識別コード,プロトコル制御コードであり、「送信元アドレス」はこのCN_frameを送信したスレーブに設定された送信元アドレスであり、「CRC」はフレームチェックシーケンスである。そして、「コマンド」には、加入ステータスの3つの状態のどれかを特定する2ビットのコードが格納される。
【0046】
EVE_frameは、通信サイクル中のメッセージデータ転送フレームである。いつどのノードが転送するかはマスタが決定し、OUT_frame中のEVENT送信許可アドレスに格納するノードアドレスで通知する。このフレームのデータ構造は、図7に示すようになっている。ここで、「スタート」はフレームの開始を示すもので、「コマンド」はフレーム識別コード,プロトコル制御コードであり、「宛先アドレス」はこのイベントデータを送信する宛先アドレスであり、「送信元アドレス」はこのイベントデータを送信したノードに設定された送信元アドレスであり、「レングス」は送信するイベントデータのデータ長であり、「イベントデータ」は送信する内容であるイベントデータであり、「CRC」はフレームチェックシーケンスである。
【0047】
さらに、「コマンド」には、本発明との関係で言うと、マスタユニットが使用する「ステータスライト要求」と、そのステータスライト要求に対する「ACKレスポンス」や「BUSY」(スレーブのみ使用)がある。また、「加入済スレーブへのステータスリード要求」と、「未加入スレーブへのステータスリード要求」と、「二重アドレス検知スレーブへのステータスリード要求」がある。これらのステータスリード要求は、いずれもマスタユニットのみが使用する。
【0048】
さらに、「レスポンス確率設定有効での未加入スレーブへのステータスリード要求」と、「レスポンス確率設定有効での二重アドレス検知スレーブへのステータス情報読出し要求」がある。これらの読み出し要求は、いずれもマスタユニットのみが使用する。
【0049】
さらにまた、上記以外のコマンドとして、スレーブのみが使用するものとしては、上記した各ステータスリードに対する「ACKレスポンス」な「BUSYレスポンス」がある。
【0050】
IN_frameは、スレーブからマスタへのINデータ転送用フレームである。どのスレーブがいつIN_frameを転送するかは、バスイニシャライズ時にマスタが設定する。なお、このIN_frameは、実際のIOデータの送受の際に利用するもので、従来と同様であるので、詳細な説明を省略する。
【0051】
そして、本実施の形態では、マスタユニット12とスレーブ20の間で上記した各種のフレームを送受することにより、二重アドレス発生を検知する。すなわち、図8に示すように、マスタユニット12は、EVE_frameにより、アドレスを順次変えながらステータスリード要求をする(▲1▼)。このとき、全ての加入ステータスに対して逐次ステータスリード要求を発行するようにしても良いし、未加入スレーブに対してのみステータスリード要求をするようにしても良い。
【0052】
このステータスリード要求を受けた該当するノードアドレス(例えば#0)のスレーブは、ステータスリードに対するレスポンスを返すが、このとき、自己のアドレスとともにスレーブ20が持つ乱数を付加する(▲2▼)。すると、二重アドレスを生じている場合には、複数のレスポンスがネットワーク(フィールドバス)上を伝送されるため衝突を生じる。そのため、いずれか1つのレスポンスのみがマスタユニット12に受信されるか、或いは全てのレスポンスが受信されない。
【0053】
マスタユニット12がレスポンスを受信すると、マスタユニット12は、EVE_frameにより、受信したアドレスを送信先アドレスとし、ステータスライトのコマンドを発行する(▲3▼)。このとき、受信した乱数も付加する。このステータスライトは、送信先アドレスと一致するノードアドレスのスレーブ20が受信する。図示の場合にはノードアドレス#0を持つ2つのスレーブ20がそれぞれ受信する。
【0054】
そして、乱数が一致するスレーブ20は、EVE_frameを用いてマスタユニット12に対してステータスライトに対するレスポンスを返す(▲4▼)。このレスポンスも乱数付きである。そして、このレスポンスをマスタユニットが受信することにより、ノードアドレス#0が存在し、ネットワークに加入していることが確認できる。また、スレーブ20は、上記したレスポンスを返すとともに、ステータスライト要求に伴い初期値が未加入スレーブの加入ステータスを加入済みスレーブに変更する。
【0055】
また、乱数が一致しないスレーブ20は、二重アドレスが発生しているとともに、他のスレーブがマスタユニット12に認識されたことが理解できる。よって、内部初期化をするとともに二重アドレス異常状態になる。つまり、初期値が未加入スレーブの加入ステータスを二重アドレスで待機中に変更する。また、ネットワークへは加入できず、ステータスライトレスポンスも返さない。また、異常状態であるので、LED表示部20Fを点灯させ、二重アドレスにより待機中であることを周囲に知らせるようにする。
【0056】
なお、加入ステータスが加入状態となったスレーブ20は、実際には、そのスレーブ20のステータス情報/INデータリフレッシュ許可をイネーブルにすることでINリフレッシュが開始され、OUT_frameのコマンドによってOUTデータのリフレッシュが開始される。これにより、通常のI/Oデータの送受が行われる。
【0057】
一方、マスタユニット12がステータスリードに対してレスポンスがない場合、そのステータスリードを発したノードアドレスのスレーブが存在していない場合と、二重アドレスが発生しており、しかも、複数のスレーブから発せられるレスポンスが衝突し、いずれのレスポンスもマスタユニット12に受信できなかった場合の両方がある。二重アドレスが発生している場合には、以下に示す処理を行うことにより、未加入のスレーブからのレスポンスを受信することが可能となる。
【0058】
すなわち、OUT_frameを使ったCN_frame送信確率付きの接続確認要求を行うか、EVE_frameを使ったステータスリードでレスポンス確率付きとすることで、未加入のスレーブからのレスポンスが受信できる可能性がある。つまり、スレーブ側でのCN_frame送信確率とEVE_frameを使ったステータスリード要求でのスレーブ側でのレスポンス送信確率を75%とすることができる。そこで、75%の確率付きとすることで、25%の確率でスレーブはフレームを送信しないので、数回のステータスリード要求再送を行うなかで1つのノードだけがレスポンスを返す確率が高くなり、検出確率を向上させることができる。
【0059】
そして、二重アドレスを発生している複数のスレーブの中の1つのみがフレームを送信する状態が発生した場合には、確実にその送信したフレームがマスタユニット12に受信される。すると、上記した図8中(b)に示すように、受信されなかった他のスレーブ20は、二重アドレスによる待機状態となる。
【0060】
次に、マスタ側での二重アドレス異常検知スレーブの認識手順について説明する。図9に示すように、まず、マスタユニット12は、OUT_frameの接続確認フレーム送信要求モード(二重アドレス検知スレーブに対する要求)を発行する(▲1▼)。すると、該当スレーブ、つまり加入ステータスが二重アドレスで待機中のスレーブがCN_frameにより応答を返す。このCN_frameを受信することにより、マスタユニット12は、該当アドレスで二重アドレスが発生していることを認識できる。
【0061】
また、別の認識手順としては、図10に示すように、マスタユニット12は、OUT_frameの二重アドレス検知スレーブに対するステータスリード強制要求有りコマンドを発行する(▲1▼)。これにより、該当スレーブのステータス情報を得ることもできる(▲2▼)。
【0062】
上記した二重アドレスの検知処理は、例えば図11に示すフローチャートを実行することにより実施される。まず、ネットワーク初期化処理開始に伴い、ネットワークに存在しうる全てのスレーブに対し、確率付き接続確認フレーム送信要求をかける(ST1)。このとき、コマンドオプションとして「未加入ノードアドレスのみ応答」を付加することもできる。
【0063】
この確率付き接続確認フレーム送信要求に対して応答のなかったスレーブは、(1)確率付きのシーケンスで応答となったが、他にも同じアドレスのスレーブからの応答があったため、フレームが衝突しフレームエラー;
(2)確率付きのシーケンスで無応答となった;
(3)ネットワークに存在しない;
(4)ノイズでフレームエラー:
(5)確率付きのシーケンスで無応答となった;
の可能性がある。
【0064】
そこで、リカバリ手順として、応答のなかったノード全てに確率付き接続確認フレーム送信要求をかける(ST2)。このとき、「コマンドオプションとして未加入ノードアドレスのみ応答」を付加するとよい。確率付きにすることにより、マスタユニット12がレスポンスを受信する可能性が高くなる。そして、応答のなかったノードの全てが応答するまで、このステップ2を繰り返し実行する。
【0065】
全てが応答したならば、応答のあったスレーブに確率付きステータス読み出しコマンドを発行する(ST3)。「コマンドオプションとして未加入ノードアドレスのみ応答」を付加するとよい。
【0066】
このステップ3の処理で応答のなかったスレーブは、
(1)確率付きのシーケンスで応答となったが、他にも同じアドレスのスレーブからの応答があったため、フレームが衝突しフレームエラー;
(2)ノイズでフレームエラー;
の可能性がある。
【0067】
そこで、リカバリ手順として、このステップ3で応答のなかったノード全てに確率付きステータス読み出しコマンドを発行する(ST4)。このとき「コマンドオプションとして未加入ノードアドレスのみ応答」を付加するとよい。そして、応答のなかったノードの全てが応答するまで、このステップ4を繰り返し実行する。
【0068】
全てが応答したならば、ST3で応答のあったスレーブの属性(in,out,点数,スレーブ固有の乱数を記録)を記録する(ST5)。次いで、ステップ3で応答のあったノード全てにステータス書き込みコマンドを乱数付きで発行する(ST6)。
【0069】
そして、ステップ3で応答のあったノード全てに確率付きステータス読み出しコマンドを発行する(ST7)。このとき、「コマンドオプションとして二重アドレス検知スレーブのみ」とする。
【0070】
このステップ7で応答のなかったスレーブは、
(1)ノイズでフレームエラー;
(2)二重アドレスノードが2つ以上存在する;
(3)確率付きのシーケンスで無応答となった;
の可能性がある。
【0071】
そこで、ステップ7で応答のなかったノード全てに確率付きステータス読み出しコマンドを発行する(ST8)。このとき、「コマンドオプションとして二重アドレス検知スレーブのみ」とする。そして、応答のなかったノードの全てが応答するまで、このステップ7を繰り返し実行する。
【0072】
全てが応答したならば、ステップ3で応答のあったノード全てにステータス読み出しコマンド発行(「コマンドオプションとして二重アドレス検知スレーブのみ応答」を付加)する(ST9)。そして、このステップ8で応答のあったノードを二重アドレス異常のノードとして記録する(ST10)。
【0073】
このようにして、乱数折り返しを使ったステータスリード→ステータスライトを行うことで、スレーブ側での二重アドレス検知が可能である。二重アドレス異常状態に遷移したスレーブは、二重アドレス異常検知スレーブ向けのステータスリードとCN_frameのみにレスポンスを返すだけで、IOリフレッシュや他のイベント通信等は一切行わない。これにより、二重アドレスが設定された複数のスレーブの1つのみが正規に加入するため、安定した通信が行える。
【0074】
また、スレーブは、マスタユニット12からのステータス情報の読み出し、書き込みが終了するまでIOリフレッシュを実行しない。具体的には、INデータについては、スレーブ20のステータス情報/INデータリフレッシュ許可がアサートされた時点でリフレッシュを開始し、IN_frameを送出することが出来るようになる。また、OUTデータについては、OUT_frame中のOUTデータのリフレッシュ許可フラグによって、スレーブでのOUTデータのリフレッシュ開始が許可される。
【0075】
また、このようにしてマスタユニット12は、二重アドレスの有無を含めたネットワーク構成を認識することができる。そして、以後通常のIO情報の送受等を行うが、適宜のタイミングで、ネットワークの状態(加入ステータスの変更の有無等)を監視することができる。すなわち、マスタユニット12は、▲1▼加入済みのスレーブが接続し続けているか,▲2▼新たなスレーブが接続されていないか等を監視する。
【0076】
▲1▼加入済みのノードが接続し続けているか
マスタユニット12から加入済みスレーブに対してだけに、加入済みスレーブに対する要求モードによる定期的なポーリング(OUT_frameにて)をかける。ポーリングを受けた加入済みのスレーブはCN_frame(加入済みステータスを付加)をマスタに向け返送する。これにより、加入済みのノードが接続し続けているかを判定する。
【0077】
▲2▼新たなノードが接続されていないか
電源立ち後れなどで諸記事にネットワークに加入できなかったスレーブが後から加入することがある。従って、マスタユニット12から全スレーブに向け、未加入スレーブに対する要求モードによる定期的なポーリング(OUT_frameにて)をかける。ポーリングを受けたスレーブ(加入ステータスが「未加入スレーブ」)は、CN_frame(未加入ステータスを付加)をマスタに向けて返送する。
【0078】
新たなスレーブの接続を検知したマスタは、そのスレーブに対してEVE_frameによる加入勧誘を行い、電源投入時の初期処理と同様に、スレーブとの間で所定のフレームの送受を行う。そして、新たなスレーブは、加入ステータスが加入済みとなり、マスタユニット側ではメモリ割付けを行い、以後、通常のIO情報の送受等が行われる。
【0079】
【発明の効果】
以上のように、この発明では、スレーブに乱数を持たせ、マスタからのステータスリード要求に対してその乱数付きのレスポンスを返送し、そのレスポンスを受信したマスタは、受信した乱数を付加したステータスライト要求を発行するようにしたため、スレーブは、ステータスライト要求に付加された乱数と自己の乱数を比較することにより、二重アドレスが発生しているか否かを判断できる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態を示す図である。
【図2】マスタユニットの内部構造を示すブロック図である。
【図3】スレーブの内部構造を示すブロック図である。
【図4】通信サイクルにおいて送受されるフレームを示すフレームを示す図である。
【図5】OUT_frameのデータ構造を示す図である。
【図6】CN_frameのデータ構造を示す図である。
【図7】EVE_frameのデータ構造を示す図である。
【図8】二重アドレス検知方法の一例を説明する図である。
【図9】二重アドレス検知方法の一例を説明する図である。
【図10】二重アドレス検知方法の一例を説明する図である。
【図11】二重アドレス検知方法の一例を示すフローチャートである。
【符号の説明】
10 PLC
11 CPUユニット
12 マスタユニット
12a 通信インタフェース
12b マスタ用ASIC
12c RAM
12d MPU
12e EEPROM
12f LED表示部
12g 設定スイッチ
12h インタフェース
20 スレーブ
20a 通信インタフェース
20b スレーブ用ASIC
20d MPU
20e EEPROM
20f LED表示部
20g 設定スイッチ
20i 電源部
20j I/O部
30 フィールドバス
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a dual address detection method and a slave, a master and a field bus in a field bus system, and more particularly to a field bus system for performing double address detection of a node in a multi-drop wiring configuration.
[0002]
[Prior art]
PLC (programmable controller) used in factory automation (FA) inputs ON / OFF information of input devices such as switches and sensors, and performs logical operations according to a sequence program (user program) written in a ladder language or the like. Execute. The PLC is controlled by outputting ON / OFF information signals to output devices such as relays, valves and actuators in accordance with the obtained calculation results.
[0003]
As one form of such a PLC, there is a type in which a plurality of units generated for each function are prepared and electrically and mechanically connected. There are various units such as a power supply unit, a CPU unit, an I / O unit, and a master unit as units for configuring such a type. A connection line of an input device or an output device existing near the PLC is connected to a connection terminal of the I / O unit constituting the PLC.
[0004]
The master unit is connected to a control system network such as a field bus, and can communicate with various slaves connected to the control system network via the control system network. The wiring in the field bus is a multi-drop wiring, and a master unit and a plurality of slaves can be connected to one field bus. Each slave has a connection terminal, and an input device or an output device existing at a location relatively far from the PLC is connected to the connection terminal. The master unit receives the input signal (IN data) of the input device connected to each slave and transmits and receives the output signal (OUT data) by transmitting and receiving frames via fieldbus communication with each slave. Send to each slave. Explaining the details of communication, a transmission frame output from the master unit reaches all the slaves (nodes) connected to the field bus at one time. A node address is individually set for each slave, and destination data including the destination node address is added to the transmission frame. Thereby, each slave extracts the destination data of the received transmission frame, determines whether or not the transmission frame is addressed to itself, takes in the transmission frame if addressed to itself, and discards the transmission frame if not addressed to itself. become.
[0005]
A frame output from the slave to the master unit can be received only by the destination master unit by similarly adding the node address of the master unit to the transmission address. Then, the transmission timing of the frame output from the slave to the master unit is transmitted. If all the slaves transmit at the same time, a collision occurs on the field bus and communication becomes impossible, so that the transmission timing specified in advance is used. The communication protocol is such that each slave sequentially transmits frames.
[0006]
For transmitting and receiving data between the master and the slave in this type of communication protocol, an OUT frame is transmitted from the master unit in a batch transmission / reception method. This OUT frame contains OUT data and is received by a predetermined OUT slave. Note that the OUT data area in one OUT frame stores OUT data for a plurality of OUT slaves, and each OUT frame knows in advance the storage position of its own OUT data in the OUT data area. Therefore, the OUT data at the storage location is obtained.
[0007]
On the other hand, when each IN slave normally receives the OUT frame from the master unit, the completion of the reception triggers time management. Each IN slave transmits IN frames IF0 to IF2 to the master unit at a predetermined timing for each basic idle time in which frames output by each IN slave do not overlap each other.
[0008]
The master unit receives the IN frames IF0 to IF2 in the time slot of each slave based on the basic idle time, and receives the IN data IN0 to IN2 in the IN frame based on the start bit which is the header of each of the IN frames IF0 to IF2. Take in. By appropriately setting the basic idle time, overlapping of IN frames from each IN slave can be prevented, and IN data can be transmitted and received reliably.
[0009]
This multi-drop method has an advantage that the transmission frame can be sent to all the slaves at once if the destination data of the transmission frame output by the master unit is all the slaves. This type of system is disclosed, for example, in Patent Document 1.
[0010]
For setting the node address of each slave, for example, a user operates a mechanical setting switch such as a dip switch provided in the slave to assign an address.
[0011]
[Patent Document 1]
JP-A-09-128019
[0012]
[Problems to be solved by the invention]
However, the above-described conventional multi-drop type network has the following problems. That is, since the user sets the node address by manual operation for each slave, there is a possibility that the same node address is erroneously set to a different slave. If a duplicate address is set as described above, a transmission frame from the master unit reaches all nodes at once, and when a transmission frame is sent to the duplicate address, the duplicate address is assigned. The plurality of slaves (nodes) receive the transmission frame at the same time, and each of them returns a response. Then, a collision of transmission frames occurs on the field bus, resulting in an unstable communication line.
[0013]
Further, as described above, when a duplicate address occurs and transmission frames from a plurality of slaves do not arrive at the master side, the slave having the node address exists on the field bus. When it is recognized that there is no slave and a transmission frame from one of the slaves is received, it is possible to recognize that there is a slave that can be received, but it is not possible to recognize the presence of a slave that cannot join the network. Therefore, the master unit could not recognize that the double address state occurred.
[0014]
Moreover, when a response from one of the slaves is normally received, the master unit recognizes that a slave having the node address exists, and then, in order to communicate with the slave that has normally received the response, the master unit executes the duplex operation. When a transmission frame is sent to a node address where an address has been generated, there is a possibility that a slave whose previous response was not received may receive the transmission frame and return a response.
[0015]
The present invention is directed to a double address in a field bus system in which a slave or a master can recognize that a double address of a node is generated even in a field bus system having a multi-drop wiring configuration. It is an object to provide a detection method and a slave, as well as a master and a fieldbus.
[0016]
[Means for Solving the Problems]
A double address detection method in a field bus system according to the present invention is a double address detection method in a field bus system in which a master and a slave are connected to a field bus. Then, the slave first stores and holds the set random number. Then, the master issues a status read request to a slave connected to the field bus by designating a node address. Further, upon receiving the status read request, the slave having the specified node address returns the random number together with its own node address as a response to the status read request. Upon receiving the response, the master issues a status write including the random number to the slave at the received node address. Then, the slave having the transmission address of the status light compares the random number transmitted with the received status light with the random number stored and held by itself, and if they do not match, another slave having the same node address. Detects that the slave is in the dual address state, and sets itself to the standby state.
[0017]
Here, the random number is set in the embodiment by providing a random number setting means and setting the random number at a predetermined timing on the slave side. However, the present invention is not limited to this. A random number may be given from the outside and stored and held.
[0018]
Further, a slave according to the present invention suitable for carrying out the invention of the above-described detection method is a slave connectable to a field bus, and a communication unit configured to communicate with a master via the field bus, and Random number storage means for storing a random number, and upon receiving a status read request addressed to its own node address sent from the master, the random number stored in the random number storage means together with its own node address in the status read request. When a status light including a random number addressed to its own node address sent from the master is received, a random number sent together with the status light and a random number stored and held by itself are returned. Compare and if they do not match, there is another slave with the same node address. Detects that the address state, and as a function of its own status to the standby state.
[0019]
Further, a master according to the present invention suitable for carrying out the invention of the above-described detection method is a master connectable to a field bus, and a communication means for communicating with a slave via the field bus; A function that issues a status read request by specifying a node address to the slave connected to the slave, and when a response with a random number from the slave to the status read request is received, the slave with the received node address is And a function of issuing a status light including the received random number.
[0020]
Further, as a field bus system according to the present invention suitable for carrying out the invention of the above-described detection method, the master and the slave having the above-described configuration are connected to a field bus. Then, the master issues a status read request to a slave connected to the field bus by designating a node address. When the slave having the designated node address receives the status read request, it issues a status read request. The master returns the random number together with the node address as a response to the status read request, and upon receiving the response, the master issues a status write including the random number to the slave at the received node address, and The slave having the transmission address compares the received random number sent with the status light with the random number stored and held by itself, and if they do not match, the slave having another slave having the same node address exists. Detects the address status, Himself was to be set in a standby state.
[0021]
The fieldbus system to which the present invention is applied is, for example, a so-called multi-drop wiring mode. In a normal state, the master transfers the OUT data collectively to the slave, and the slave determines its own station. A communication protocol for returning the IN data during the set time period is adopted. In this system, the node address set for each slave must be unique in the fieldbus system, but the same node address may be set to multiple slaves by mistake, resulting in a duplicate address. is there. The present invention detects the occurrence of such a double address.
[0022]
That is, in the present invention, the slave has a random number, returns a response with the random number in response to the status read request from the master, and the master receiving the response issues a status write request to which the received random number is added. I do. Therefore, the slave can determine whether or not a double address has occurred by comparing the random number added to the status write request addressed to its own node address with its own random number. In other words, if the random number added to the status write request addressed to its own node address matches its own random number, the response with the random number to the previously returned status read request can be regarded as received by the master. I do. On the other hand, if they do not match, it can be said that the response from the other slave having the same node address is received by the master and the response issued by itself is not received. Therefore, it can be recognized that there is at least one other slave having the same node address and a duplicate address has occurred. Further, since the master is not recognized by the master, the master enters a standby state. As a result, a plurality of slaves having dual addresses do not transmit frames at the same time, and communication can be stabilized.
[0023]
Further, in the dual address detection method according to the present invention, based on the above-described invention, the master may obtain the node address of the slave in the standby state, so that the double address is generated. Was recognized. As a master according to the present invention suitable for carrying out this method, a slave address in which a double address is generated is obtained by acquiring a node address of a slave set in a standby state based on the status light. Is to have a function to recognize the Thus, according to the present invention, the master can also recognize that a double address has occurred.
[0024]
Furthermore, in the dual address detection method according to the present invention, a probability is set for transmission of a response that the slave returns to the master, and control is performed such that the response is not transmitted at a predetermined rate even at the transmission timing. can do. In the slave according to the present invention suitable for carrying out such a method, a function of setting a probability for transmission of a response to be returned to the master and controlling not to transmit the response at a predetermined rate even at the transmission timing. It is to have.
[0025]
That is, if a response to a status read issued from any one of the slaves is received by the master in a timely manner when a duplicate address is generated, the duplicate address can be detected as described above. However, there is a possibility that a plurality of responses collide and none of them are received by the master. On the other hand, in the present invention, since the response is not transmitted at a predetermined ratio, if a response is transmitted from another slave at that time, the response arrives at the master unit without collision (the number of slaves that have generated a duplicate address is 2). Case). Even if three or more slaves have dual addresses, it cannot be said that a collision is reliably avoided, but the smaller the number of slaves transmitting a response, the higher the possibility of reaching the master. . As a result, by transmitting the response a plurality of times with a probability, the master recognizes the response from any one of the slaves, and the other slaves that are not recognized enter a standby state by the dual address.
[0026]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 shows an entire system for realizing a preferred embodiment of the present invention. As shown in FIG. 1, a PLC 10 and various slaves 20 are connected via a field bus 30 to form a network system. The slave 20 serving as a node includes a remote IO and other devices.
[0027]
The PLC 10 is configured by connecting units generated for each function, such as the CPU unit 11 and the master unit 12. Each unit is connected to a PLC bus (also referred to as an internal bus; not shown) so that data communication can be performed by bus communication between the units of the PLC. A field bus 30 is connected to the master unit 12, and a plurality of slaves 20 are connected to the field bus 30 by multi-drop connection so that communication between the master unit and each slave is performed. It has become. Further, the master unit 12 accesses the IO memory in the CPU unit 11 via the internal bus of the PLC 10 and reads and writes IO data and the like. More specifically, the master unit 12 captures an input signal (on / off state) from an input device connected to the connection terminal of the slave 20 by fieldbus communication, and receives the input signal (input data) captured by the master unit 12 internally. The signal is transmitted to the CPU unit 11 by bus communication, and the CPU unit 11 receives the input signal. The CPU unit 11 performs a logical operation predetermined by a user program based on the input signal, and transmits an output signal (output data) including the operation result to the master unit 12 via an internal bus. The master unit transmits its output signal to the slave by fieldbus communication. Each unit outputs the received output signal to an output device connected to the connection terminal. Note that the input signal and the output signal may be collectively referred to as I / O data. That is, the IN data is transmitted from the input device to the slave, from the slave to the master unit, and from the master unit to the CPU unit. The OUT data is transmitted from the CPU unit to the master unit, from the master unit to the slave, and from the slave to the output device.
[0028]
As shown in FIG. 2, the master unit 12 is connected to a field bus and communicates with the slave 20 via a communication interface 12a for actually transmitting and receiving data and a master-slave communication via the communication interface 12a. ASIC 12b for transmitting / receiving I / O data, transmitting a predetermined command and receiving a response based on the command, MPU 12d for performing various controls, and RAM 12c used as a work area when performing various controls. An EEPROM 12e in which a program for performing the above-described control and various setting data are stored; an interface 12h for performing internal bus communication with a CPU unit and the like; and an LED indicating an operation state (communication state) and abnormality / normality. A setting switch for setting the display section 12f and the address, etc. It is equipped with a switch 12g.
[0029]
As control performed by the MPU 12d, the MPU 12d communicates with the CPU unit 11 and other units, and operates the master ASIC 12b. In particular, in the context of the present invention, it communicates with the slave 20 connected to the field bus 30 and checks whether a double address has occurred. Specific processing functions will be described later.
[0030]
As shown in FIG. 3, the slave 20 is connected to a field bus and communicates I / O data and various messages with the master unit 12 via the communication interface 20a. An ASIC 20b for a slave that performs the acquired master-slave communication, transmits and receives I / O data, receives a predetermined command from the master unit 12, and transmits a response based on the command, and an MPU 20d that performs various controls. An EEPROM 20e in which a program for performing the above-described control, various setting data, IO data, and the like are stored, and a terminal block structure for connecting input / output device wiring to transmit / receive I / O data. An I / O unit 20j and an LED display unit 20f indicating an operation state (communication state), abnormal / normal, etc. And a setting switch 20g for performing such setting of the node address. Further, a power supply unit 20i that reduces the input voltage (24V) to 5V and supplies power to each element in the slave 20 is provided. There are three types of slaves, input slaves, output slaves, and input / output slaves. For example, the input slave only connects the input device, and stores the IN data and transmits the IN data.
[0031]
In the context of the present invention, the slave 20 includes a random number generation unit in the MPU 20d, and the random number generation unit determines and determines a value (random number) at the first carrier detection timing on the field bus. The random number holds its value until reset. The value of the random number may be held in a buffer on software or stored in the EEPROM 20e. Therefore, even if a double address state occurs in which the same node address is set to different slaves 20, the possibility that the values of the random numbers of a plurality of slaves having the double address match will be extremely low.
[0032]
Further, when receiving a status read addressed to itself from the master unit 12, it has a function of issuing a status read response including the held random number together with its own node address and returning the status read response to the master unit 12.
[0033]
Furthermore, the master unit 12 that has received the status read response outputs a status write including the random number written in the obtained status read response to the node address of the slave that issued the status read response, as described later. Therefore, the slave having the destination node address of the response receives the status light and checks the random number included in the status light and the random number held by itself.
[0034]
The slave 20 has a function of judging a subscription state (subscription status) to the field bus from the content of the received transmission frame, and storing and holding the determined subscription status. That is, if the status write of the node address addressed to itself is not received despite the transmission of the status read response, it can be determined that the master unit 12 does not recognize the slave of the node address. Becomes an “unjoined node”. Note that the initial value of the subscription status is “unsubscribed node”.
[0035]
When the status becomes “unsubscribed node”, the master unit 12 may not be able to recognize the slave simply due to a communication error. However, even if the status read response is issued a plurality of times, the status remains as “unsubscribed node”. In this case, it can be said that the master unit 12 cannot recognize the status read response because a plurality of slaves have simultaneously issued the status read response, that is, there is a possibility that a duplicate address has occurred.
[0036]
When the status light of the node address addressed to itself is received and the random number included in the status light matches the one held by itself, it can be determined that the master unit 12 has recognized itself. "Subscribed node". As a result, the slave can formally join the field bus, and can transmit and receive I / O data with the master unit 12 thereafter.
[0037]
Then, when the status light of the node address addressed to itself is received, and the random number included therein does not match the one held by itself, a double address is generated and the master unit 12 Since the other slave having the address can be recognized and it can be determined that it has not recognized itself, the joining status becomes "waiting at the dual address".
[0038]
As described above, since each slave 20 holds its own subscription status, the master unit 12 recognizes the subscription status of each slave 20 to determine whether a double address has occurred and which node address has It is possible to detect whether a duplicate address is generated.
[0039]
Next, specific processing functions of the master unit 12 and the slave 20 for executing the above-described processing will be described. First, the commands issued by the master unit 12 and the slave 20 are as follows.
[0040]
As shown in FIG. 4, the start timing of the communication cycle of this protocol is managed by the master unit 12, which is the master station. Then, the communication cycle starts with OUT_frame and continues with a plurality of CN_frame, EVE_frame, and IN_frame. The start timing of the communication cycle between the master unit and each slave is adjusted when the normal reception of OUT_frame is completed. That is, the timing of communication synchronization is set to the timing of completion of normal reception of OUT_frame. Since the frame contents (communication data size, communication timing, communication cycle, etc.) of CN_frame, EVE_frame, and IN_frame that follow are always fixed, the transmission timing of each frame is the timing of starting the completion of normal reception of OUT_frame. This is performed by monitoring a predetermined time.
[0041]
Here, OUT_frame is an OUT data transfer frame from the master unit 12 to the slave 20, and the OUT_frame contains OUT data to be transmitted to each slave. For each slave 20 on the receiving side, OUT_frame is a frame indicating the start of a communication cycle. In other words, each slave 20 starts an internal counter (starts a timer) to start counting from the time when the reception of OUT_frame is completed, and transmits a predetermined frame to the master unit 12 at each preset transmission timing.
[0042]
The data structure of OUT_frame is as shown in FIG. That is, OUT_frame includes a “frame header”, “OUT data” as output data sent from the master unit 12 to a predetermined slave (OUT slave) 20, and “CRC” as a frame check sequence. Further, the frame header includes “start” indicating the start of the frame, “command” indicating the identification code (protocol control code) of the frame, and “CN_frame transmission” for registering the node address (CN_frame request) of the slave whose connection is to be confirmed. A "request address", an "EVENT transmission permission address" for registering a node address at which an event frame is permitted to be transmitted, a "domain version" for registering a registered version of an OUT data position and an IN frame transmission position at each slave, and an OUT data And a “length” for registering the data length.
[0043]
Further, the “command” includes a command instructing permission / inhibition of refresh of OUT data in relation to the present invention. The connection confirmation frame transmission request mode, the status read compulsory request mode, the connection confirmation frame transmission probability (slave side response is 75%), and the status read compulsory request response transmission probability (slave side response is 75%) are set. There is a valid flag.
[0044]
The connection confirmation frame transmission request mode is a code for identifying three types of “request to a subscribed slave”, “request to an unsubscribed slave”, and “request to a double address detection slave” according to the subscription status. is there. The status forced request mode is for requesting the slave to issue an EVE_frame, and is a code for identifying two types of "request to the subscribed slave" and "request to the double address detection slave". Further, a connection confirmation frame transmission probability (slave side response is 75%) setting valid flag (1/0) and a status transmission compulsory request response transmission probability (slave side response 75%) setting valid flag (1/0) There is. The setting valid flag of each transmission probability sets a probability that the slave transmits a response. When the valid flag is 1, a response is returned at a probability of 75%. When the valid flag is 0, a response is returned. Returns a response with a 100% probability.
[0045]
CN_frame is a connection confirmation frame for confirming whether or not the terminal is connected to the network. That is, the frame specified by the CN_frame transmission request address in the OUT_frame is a frame returned as a response and has a data structure as shown in FIG. Here, “start” indicates the start of a frame, “command” is a frame identification code and a protocol control code, and “source address” is a source address set to the slave that transmitted this CN_frame. , “CRC” are frame check sequences. The “command” stores a 2-bit code that specifies any one of the three states of the subscription status.
[0046]
EVE_frame is a message data transfer frame during a communication cycle. When and which node transfers data is determined by the master, and is notified by the node address stored in the EVENT transmission permission address in OUT_frame. The data structure of this frame is as shown in FIG. Here, “start” indicates the start of a frame, “command” is a frame identification code and a protocol control code, “destination address” is a destination address for transmitting this event data, and “transmission source address”. Is the source address set in the node that transmitted this event data, "length" is the data length of the event data to be transmitted, "event data" is the event data to be transmitted, and "CRC" Is a frame check sequence.
[0047]
Further, the “command” includes, in relation to the present invention, a “status write request” used by the master unit, and an “ACK response” or “BUSY” (only a slave is used) for the status write request. Further, there are a "status read request to a subscribed slave", a "status read request to an unsubscribed slave", and a "status read request to a dual address detection slave". These status read requests are used only by the master unit.
[0048]
Further, there are a "status read request to an unsubscribed slave when the response probability setting is valid" and a "status information read request to a dual address detection slave when the response probability setting is valid". These read requests are used only by the master unit.
[0049]
Further, as commands other than the above, commands used only by the slave include "BUSY response" such as "ACK response" to each status read described above.
[0050]
IN_frame is an IN data transfer frame from the slave to the master. Which slave transfers IN_frame and when is set by the master at the time of bus initialization. Note that this IN_frame is used when actual IO data is transmitted and received, and is the same as the conventional one, so that detailed description is omitted.
[0051]
In the present embodiment, the occurrence of a double address is detected by transmitting and receiving the various frames described above between the master unit 12 and the slave 20. That is, as shown in FIG. 8, the master unit 12 issues a status read request while sequentially changing the address using EVE_frame ((1)). At this time, a status read request may be issued sequentially for all the subscription statuses, or a status read request may be issued only to the unsubscribed slaves.
[0052]
The slave of the corresponding node address (for example, # 0) receiving the status read request returns a response to the status read. At this time, the slave 20 adds a random number of the slave 20 together with its own address ((2)). Then, when a duplicate address is generated, a collision occurs because a plurality of responses are transmitted on a network (field bus). Therefore, only one of the responses is received by the master unit 12, or all the responses are not received.
[0053]
When the master unit 12 receives the response, the master unit 12 issues a status write command using the received address as a destination address by using EVE_frame ([3]). At this time, the received random number is also added. This status light is received by the slave 20 having the node address matching the transmission destination address. In the case shown in the figure, the two slaves 20 having the node address # 0 respectively receive.
[0054]
Then, the slave 20 having the same random number returns a response to the status write to the master unit 12 using the EVE_frame ([4]). This response also has a random number. When the master unit receives this response, it can be confirmed that the node address # 0 exists and has joined the network. Further, the slave 20 returns the above-described response, and changes the subscription status of the slave whose initial value has not been added to the subscribed slave in accordance with the status write request.
[0055]
In addition, it can be understood that the slaves 20 whose random numbers do not match have a double address generated, and that the master unit 12 has recognized another slave. Therefore, the internal address is initialized and the double address becomes abnormal. That is, the initial value changes the joining status of the slave that has not joined yet to standby at the dual address. Also, it cannot join the network and does not return a status write response. In addition, since it is in an abnormal state, the LED display unit 20F is turned on to notify the surroundings of the standby state by the double address.
[0056]
Note that the slave 20 whose subscription status is in the subscription state actually starts the IN refresh by enabling the status information / IN data refresh permission of the slave 20, and the OUT data is refreshed by the OUT_frame command. Be started. Thus, normal I / O data transmission / reception is performed.
[0057]
On the other hand, when the master unit 12 does not respond to the status read, when there is no slave having the node address that issued the status read, when the master unit 12 has a duplicate address, and when a plurality of slaves There are both cases where the received responses collide and neither response could be received by the master unit 12. When a duplicate address is generated, it is possible to receive a response from an unsubscribed slave by performing the following processing.
[0058]
That is, there is a possibility that a response from an unsubscribed slave can be received by making a connection confirmation request with a CN_frame transmission probability using OUT_frame or by adding a response probability with a status read using EVE_frame. In other words, the CN_frame transmission probability on the slave side and the response transmission probability on the slave side in response to a status read request using EVE_frame can be 75%. Therefore, with the probability of 75%, since the slave does not transmit the frame with a probability of 25%, the probability that only one node returns a response becomes high during retransmission of the status read request several times. Probability can be improved.
[0059]
Then, when a state occurs in which only one of the plurality of slaves generating a duplicate address transmits a frame, the transmitted frame is reliably received by the master unit 12. Then, as shown in (b) of FIG. 8 described above, the other slaves 20 that have not been received are placed in a standby state by the dual address.
[0060]
Next, a procedure for recognizing a double address abnormality detection slave on the master side will be described. As shown in FIG. 9, first, the master unit 12 issues an OUT_frame connection confirmation frame transmission request mode (a request to the dual address detection slave) ((1)). Then, the corresponding slave, that is, the slave whose subscription status is waiting at the dual address returns a response by CN_frame. By receiving the CN_frame, the master unit 12 can recognize that a duplicate address has occurred at the corresponding address.
[0061]
As another recognition procedure, as shown in FIG. 10, the master unit 12 issues a status read compulsory request presence command to the double address detection slave of OUT_frame ((1)). Thus, the status information of the slave can be obtained ((2)).
[0062]
The above-described double address detection processing is performed by executing, for example, a flowchart shown in FIG. First, with the start of the network initialization processing, a request for transmission of a connection confirmation frame with probability is made to all slaves that may exist in the network (ST1). At this time, “Respond only to unsubscribed node address” can be added as a command option.
[0063]
The slave that has not responded to the transmission request of the connection confirmation frame with probability responds in the sequence with the probability (1), but the frame collision occurs because there is another response from the slave having the same address. Frame error;
(2) no response in the sequence with probability;
(3) not present in the network;
(4) Frame error due to noise:
(5) no response in the sequence with probability;
There is a possibility.
[0064]
Therefore, as a recovery procedure, a connection confirmation frame transmission request with probability is sent to all nodes that have not responded (ST2). At this time, it is preferable to add “response only to the non-subscribed node address as a command option”. Providing a probability increases the possibility that the master unit 12 receives a response. Then, this step 2 is repeatedly executed until all the nodes that have not responded respond.
[0065]
If all respond, a status read command with probability is issued to the responding slave (ST3). "Respond only to non-subscribed node addresses as command options" may be added.
[0066]
The slave that has not responded in the process of step 3 is
(1) A response was sent in a sequence with a probability, but since there was a response from a slave having the same address, a frame collision occurred and a frame error occurred;
(2) Frame error due to noise;
There is a possibility.
[0067]
Then, as a recovery procedure, a status read command with probability is issued to all nodes that have not responded in step 3 (ST4). At this time, "response only to the non-subscribed node address as a command option" may be added. Then, this step 4 is repeatedly executed until all nodes that have not responded respond.
[0068]
If all responses have been received, the attributes (in, out, score, and random number unique to the slave) of the slave that responded in ST3 are recorded (ST5). Next, a status write command is issued with a random number to all nodes responding in step 3 (ST6).
[0069]
Then, a status read command with probability is issued to all nodes that responded in step 3 (ST7). At this time, “only the dual address detection slave as a command option” is set.
[0070]
The slaves that did not respond in step 7
(1) Frame error due to noise;
(2) there are two or more duplicate address nodes;
(3) no response in the sequence with probability;
There is a possibility.
[0071]
Therefore, a status read command with probability is issued to all nodes that have not responded in step 7 (ST8). At this time, “only the dual address detection slave as a command option” is set. This step 7 is repeatedly executed until all of the nodes that have not responded respond.
[0072]
If all have responded, a status read command is issued to all the nodes that responded in step 3 ("Response only to the dual address detection slave as a command option" is added) (ST9). Then, the node responding in step 8 is recorded as a node having a double address abnormality (ST10).
[0073]
In this way, by performing status read → status write using random number loopback, double address detection on the slave side is possible. The slave that has transitioned to the double address abnormality state only returns a response to the status read and CN_frame for the double address abnormality detection slave, but does not perform any IO refresh or any other event communication. As a result, only one of the plurality of slaves to which the duplicate address is set is properly joined, and stable communication can be performed.
[0074]
The slave does not execute the IO refresh until the reading and writing of the status information from the master unit 12 are completed. Specifically, the IN data is refreshed when the status information / IN data refresh permission of the slave 20 is asserted, and IN_frame can be transmitted. For the OUT data, the start of the refresh of the OUT data in the slave is permitted by the refresh permission flag of the OUT data in the OUT_frame.
[0075]
Further, in this way, the master unit 12 can recognize the network configuration including the presence / absence of a duplicate address. Thereafter, normal transmission / reception of IO information and the like are performed. At an appropriate timing, the state of the network (whether or not the subscription status has been changed) can be monitored. That is, the master unit 12 monitors (1) whether or not a subscribed slave continues to be connected, and (2) whether or not a new slave is connected.
[0076]
(1) Whether the subscribed node keeps connecting
Periodic polling (in OUT_frame) in the request mode for the subscribed slaves is performed only from the master unit 12 to the subscribed slaves. The subscribed slave that has been polled returns CN_frame (added subscribed status) to the master. Thereby, it is determined whether the subscribed node continues to be connected.
[0077]
(2) Is a new node connected?
Slave that could not join the network for various articles due to power failure etc. may join later. Therefore, the master unit 12 periodically polls all slaves (in OUT_frame) in the request mode for the unjoined slaves. The slave that has received the polling (the subscription status is “unsubscribed slave”) returns CN_frame (with the unsubscribed status added) to the master.
[0078]
The master that has detected the connection of the new slave performs an invitation solicitation for the slave by using the EVE_frame, and transmits and receives a predetermined frame to and from the slave in the same manner as the initial processing at the time of power-on. Then, the subscription status of the new slave is "subscribed", the memory allocation is performed on the master unit side, and then the normal transmission / reception of IO information is performed.
[0079]
【The invention's effect】
As described above, according to the present invention, a random number is given to a slave, a response with the random number is returned in response to a status read request from the master, and the master receiving the response sends a status write to which the received random number is added. Since the request is issued, the slave can determine whether or not a double address has occurred by comparing the random number added to the status write request with its own random number.
[Brief description of the drawings]
FIG. 1 is a diagram showing a first embodiment of the present invention.
FIG. 2 is a block diagram showing an internal structure of a master unit.
FIG. 3 is a block diagram showing an internal structure of a slave.
FIG. 4 is a diagram showing a frame indicating a frame transmitted and received in a communication cycle.
FIG. 5 is a diagram showing a data structure of OUT_frame.
FIG. 6 is a diagram showing a data structure of CN_frame.
FIG. 7 is a diagram showing a data structure of EVE_frame.
FIG. 8 is a diagram illustrating an example of a dual address detection method.
FIG. 9 is a diagram illustrating an example of a dual address detection method.
FIG. 10 is a diagram illustrating an example of a dual address detection method.
FIG. 11 is a flowchart illustrating an example of a dual address detection method.
[Explanation of symbols]
10 PLC
11 CPU unit
12 Master unit
12a Communication interface
12b Master ASIC
12c RAM
12d MPU
12e EEPROM
12f LED display
12g setting switch
12h interface
20 slaves
20a Communication interface
ASIC for 20b slave
20d MPU
20e EEPROM
20f LED display
20g setting switch
20i power supply
20j I / O section
30 Fieldbus

Claims (9)

マスタと、スレーブが、フィールドバスに接続されて構成されるフィールドバスシステムにおける二重アドレス検知方法であって、
前記スレーブは、設定された乱数を記憶保持し、
前記マスタは、前記フィールドバスに接続されたスレーブに対し、ノードアドレスを指定してステータスリード要求を発行し、
前記指定されたノードアドレスを持つスレーブは、前記ステータスリード要求を受信すると、自己のノードアドレスとともに前記乱数を前記ステータスリード要求に対するレスポンスとして返送し、
前記マスタは、前記レスポンスを受信すると、受信したノードアドレスのスレーブに対し、前記乱数を含むステータスライトを発行し、
前記ステータスライトの送信アドレスを持つスレーブは、受信した前記ステータスライトとともに送られてきた乱数と、自己が記憶保持する乱数を比較し、一致しない場合には、同一のノードアドレスを持つ他のスレーブが存在する二重アドレス状態であることを検知し、自己は待機状態になることを特徴とするフィールドバスシステムにおける二重アドレス検知方法。
A double address detection method in a fieldbus system in which a master and a slave are connected to a fieldbus,
The slave stores and holds the set random number,
The master issues a status read request to a slave connected to the field bus by designating a node address,
Upon receiving the status read request, the slave having the specified node address returns the random number together with its own node address as a response to the status read request,
Upon receiving the response, the master issues a status light including the random number to a slave at the received node address,
The slave having the transmission address of the status light compares the received random number sent with the status light with the random number stored and held by itself, and if they do not match, another slave having the same node address is used. A double address detecting method in a field bus system, wherein the method detects an existing double address state and enters a standby state.
前記マスタは、前記待機状態になっているスレーブのノードアドレスを取得することにより、二重アドレスが発生していることを認識することを特徴とする請求項1に記載のフィールドバスシステムにおける二重アドレス検知方法。2. The field bus system according to claim 1, wherein the master recognizes that a duplicate address has occurred by acquiring a node address of the slave in the standby state. 3. Address detection method. 前記スレーブが前記マスタに返すレスポンスの送信に確率を設定し、送信タイミングにきても所定の割合で前記レスポンスを送信しないように制御することを特徴とする請求項1または2に記載のフィールドバスシステムにおける二重アドレス検知方法。The fieldbus according to claim 1 or 2, wherein a probability is set for transmission of a response returned by the slave to the master, and control is performed such that the response is not transmitted at a predetermined rate even at a transmission timing. How to detect double addresses in the system. フィールドバスに接続可能なスレーブであって、
前記フィールドバスを介してマスタと通信する通信手段と、
設定された乱数を記憶する乱数記憶手段と、
前記マスタから送られてきた自己のノードアドレス宛のステータスリード要求を受信した際に、自己のノードアドレスとともに前記乱数記憶手段に記憶された乱数を前記ステータスリード要求に対するレスポンスとして返送する機能と、
前記マスタから送られてきた自己のノードアドレス宛の乱数を含むステータスライトを受信した際に、そのステータスライトとともに送られてきた乱数と、自己が記憶保持する乱数を比較し、一致しない場合には、同一のノードアドレスを持つ他のスレーブが存在する二重アドレス状態であることを検知し、自己のステータスを待機状態にする機能を備えたことを特徴とするスレーブ。
A slave that can be connected to the fieldbus,
Communication means for communicating with the master via the field bus;
Random number storage means for storing the set random number;
Upon receiving a status read request addressed to its own node address sent from the master, a function of returning a random number stored in the random number storage unit together with its own node address as a response to the status read request,
When receiving a status light including a random number addressed to its own node address sent from the master, the random number sent together with the status light is compared with the random number stored and held by itself. A slave which has a function of detecting a double address state in which another slave having the same node address exists and setting its own status to a standby state.
前記マスタに返すレスポンスの送信に確率を設定し、送信タイミングにきても所定の割合で前記レスポンスを送信しないように制御する機能を備えたことを特徴とする請求項4に記載のスレーブ。5. The slave according to claim 4, further comprising a function of setting a probability for transmitting a response to be returned to the master, and controlling not to transmit the response at a predetermined rate even at a transmission timing. フィールドバスに接続可能なマスタであって、
前記フィールドバスを介してスレーブと通信する通信手段と、
前記フィールドバスに接続されたスレーブに対し、ノードアドレスを指定してステータスリード要求を発行する機能と、
そのステータスリード要求に対するスレーブからの乱数付きのレスポンスを受信した際に、その受信したノードアドレスのスレーブに対し、受信した乱数を含むステータスライトを発行する機能を備えたことを特徴とするマスタ。
A master connectable to the fieldbus,
Communication means for communicating with the slave via the field bus;
A function of issuing a status read request to a slave connected to the field bus by designating a node address;
When receiving a response with a random number from a slave to the status read request, the master has a function of issuing a status write including the received random number to the slave at the received node address.
前記ステータスライトに基づいて待機状態に設定されたスレーブのノードアドレスを取得することにより、二重アドレスが発生しているスレーブを認識する機能を備えたことを特徴とする請求項6に記載のマスタ。7. The master according to claim 6, further comprising a function of recognizing a slave having a duplicate address by acquiring a node address of the slave set in a standby state based on the status light. . 請求項6に記載のマスタと、請求項4に記載のスレーブが、フィールドバスに接続されて構成されるフィールドバスシステムであって、
前記マスタは、前記フィールドバスに接続されたスレーブに対し、ノードアドレスを指定してステータスリード要求を発行し、
前記指定されたノードアドレスを持つスレーブは、前記ステータスリード要求を受信すると、自己のノードアドレスとともに前記乱数を前記ステータスリード要求に対するレスポンスとして返送し、
前記マスタは、前記レスポンスを受信すると、受信したノードアドレスのスレーブに対し、前記乱数を含むステータスライトを発行し、
前記ステータスライトの送信アドレスを持つスレーブは、受信した前記ステータスライトとともに送られてきた乱数と、自己が記憶保持する乱数を比較し、一致しない場合には、同一のノードアドレスを持つ他のスレーブが存在する二重アドレス状態であることを検知し、自己は待機状態に設定されるようにしたことを特徴とするフィールドバスシステム。
A fieldbus system comprising a master according to claim 6 and a slave according to claim 4 connected to a fieldbus,
The master issues a status read request to a slave connected to the field bus by designating a node address,
Upon receiving the status read request, the slave having the specified node address returns the random number together with its own node address as a response to the status read request,
Upon receiving the response, the master issues a status light including the random number to a slave at the received node address,
The slave having the transmission address of the status light compares the received random number sent with the status light with the random number stored and held by itself, and if they do not match, another slave having the same node address is used. A field bus system wherein an existing double address state is detected, and the self is set to a standby state.
前記マスタが、前記待機状態に設定されたスレーブのノードアドレスを取得することにより、二重アドレスが発生しているスレーブを認識することができる請求項8に記載のフィールドバスシステム。9. The fieldbus system according to claim 8, wherein the master can recognize a slave having a duplicate address by acquiring a node address of the slave set in the standby state.
JP2003062345A 2003-03-07 2003-03-07 Dual address detection method, slave, master and field bus in field bus system Expired - Fee Related JP4023342B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003062345A JP4023342B2 (en) 2003-03-07 2003-03-07 Dual address detection method, slave, master and field bus in field bus system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003062345A JP4023342B2 (en) 2003-03-07 2003-03-07 Dual address detection method, slave, master and field bus in field bus system

Publications (2)

Publication Number Publication Date
JP2004274395A true JP2004274395A (en) 2004-09-30
JP4023342B2 JP4023342B2 (en) 2007-12-19

Family

ID=33124291

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003062345A Expired - Fee Related JP4023342B2 (en) 2003-03-07 2003-03-07 Dual address detection method, slave, master and field bus in field bus system

Country Status (1)

Country Link
JP (1) JP4023342B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009164786A (en) * 2007-12-28 2009-07-23 Nec Electronics Corp Data transfer system and data transfer method
JP2012099997A (en) * 2010-11-01 2012-05-24 Kawamura Electric Inc Communication system
JP2019159653A (en) * 2018-03-12 2019-09-19 オムロン株式会社 Control system, control method and control program
CN113347283A (en) * 2021-06-03 2021-09-03 上海钧嵌传感技术有限公司 Method and system for distributing node addresses
CN114338530A (en) * 2021-12-21 2022-04-12 浙江华锐捷技术有限公司 Method and device for adjusting equipment state, storage medium and electronic device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716420A (en) * 2014-01-03 2014-04-09 西南大学 Automatic station address obtaining method of Modbus ASCII slave station and slave station

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009164786A (en) * 2007-12-28 2009-07-23 Nec Electronics Corp Data transfer system and data transfer method
JP2012099997A (en) * 2010-11-01 2012-05-24 Kawamura Electric Inc Communication system
JP2019159653A (en) * 2018-03-12 2019-09-19 オムロン株式会社 Control system, control method and control program
JP7268287B2 (en) 2018-03-12 2023-05-08 オムロン株式会社 Control system, control method and control program
CN113347283A (en) * 2021-06-03 2021-09-03 上海钧嵌传感技术有限公司 Method and system for distributing node addresses
CN113347283B (en) * 2021-06-03 2022-05-24 上海钧嵌传感技术有限公司 Method and system for distributing node addresses
CN114338530A (en) * 2021-12-21 2022-04-12 浙江华锐捷技术有限公司 Method and device for adjusting equipment state, storage medium and electronic device
CN114338530B (en) * 2021-12-21 2023-09-29 浙江华锐捷技术有限公司 Method and device for adjusting equipment state, storage medium and electronic device

Also Published As

Publication number Publication date
JP4023342B2 (en) 2007-12-19

Similar Documents

Publication Publication Date Title
JP5717240B2 (en) Communication system and communication apparatus
US9100397B2 (en) BACnet MS/TP automatic MAC addressing
US8842747B2 (en) Method for digital communication between a plurality of nodes connected by a serial field bus and corresponding system, in particular a field control system or field surveyance system
JP5814474B2 (en) Method for driving a communication system
US10229078B2 (en) Multi-master bus
CN104253880A (en) Address assignment for safe users of a field bus
JPH09181737A (en) Communication method for small scale network
JP3359094B2 (en) Communication system, method in which parent node recognizes states of multiple child nodes, and method of recognizing new terminal in communication system having multiple terminals
JP4023342B2 (en) Dual address detection method, slave, master and field bus in field bus system
US20140297913A1 (en) Slave control device and method for programming a slave control device
JP2004280304A (en) Field bus system, communication method and master/ slave
JP4458279B2 (en) Programmable controller system communication method
JP2011035834A (en) Communication system, communication apparatus and communication method
US10243887B2 (en) Switch unit, ethernet network, and method for activating components in an ethernet network
JP4107110B2 (en) Fieldbus system, connection confirmation method, and master
US10524219B2 (en) Communication apparatus, communication system and communication method
JP4635616B2 (en) Network communication method between computers
JP2008211536A (en) Remote io transmission system
JP2007066103A (en) Method for controlling event processing time
JPH10232704A (en) Duplex programmable controller
TWI470441B (en) Method and system of intelligent address allocation based on tandem bus
CN101645195B (en) Recognizing telegram boundaries
WO2006030697A1 (en) Communication device, communication control method, communication control program, and computer-readable recording medium containing the communication control program
US9971715B2 (en) Communication device and link establishment method
JPH1117713A (en) Multicast communication processing system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050920

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070907

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: 20070911

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070924

R150 Certificate of patent or registration of utility model

Ref document number: 4023342

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101012

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101012

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111012

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111012

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121012

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121012

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131012

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees