JP4023342B2 - Dual address detection method, slave, master and field bus in field bus system - Google Patents

Dual address detection method, slave, master and field bus in field bus system Download PDF

Info

Publication number
JP4023342B2
JP4023342B2 JP2003062345A JP2003062345A JP4023342B2 JP 4023342 B2 JP4023342 B2 JP 4023342B2 JP 2003062345 A JP2003062345 A JP 2003062345A JP 2003062345 A JP2003062345 A JP 2003062345A JP 4023342 B2 JP4023342 B2 JP 4023342B2
Authority
JP
Japan
Prior art keywords
slave
master
address
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.)
Expired - Fee Related
Application number
JP2003062345A
Other languages
Japanese (ja)
Other versions
JP2004274395A (en
Inventor
征爾 水谷
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
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 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

Landscapes

  • Programmable Controllers (AREA)
  • Small-Scale Networks (AREA)

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]
BACKGROUND OF THE INVENTION
The present invention relates to a dual address detection method, slave, master, and field bus in a field bus system, and relates to a field bus system that performs double address detection of a node in a multi-drop wiring form.
[0002]
[Prior art]
PLC (programmable controller) used in FA (factory automation) 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. Execute. Then, the PLC performs control by outputting a signal of ON / OFF information to an output device such as a relay, a valve, or an actuator according to the obtained calculation result.
[0003]
As one form of such a PLC, there is one in which a plurality of units generated for each function are prepared and electrically and mechanically connected. As a unit for constituting such a type, there are various types such as a power supply unit, a CPU unit, an I / O unit, and a master unit. A connection terminal of an I / O unit constituting the PLC is connected to a connection line of an input device or an output device existing near the PLC.
[0004]
The master unit described above 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 this 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 and an output device existing at a location relatively far from the PLC are connected to the connection terminal. And the master unit receives the input signal (IN data) of the input device connected to each slave by performing fieldbus communication with each slave and transmits / receives the frame, and also outputs the output signal (OUT data). Send to each slave. Explaining the details of communication, the transmission frame output from the master unit reaches all the slaves (nodes) connected to the fieldbus at once. A node address is individually set for each slave, and destination data including a destination node address is added to the transmission frame. As a result, each slave extracts the destination data of the received transmission frame, determines whether it is a transmission frame addressed to itself, captures the transmission frame if it is addressed to itself, and discards it if it is not addressed to itself. become.
[0005]
Similarly, a frame output from the slave to the master unit can be received only by the destination master unit by adding the node address of the master unit to the transmission address. This is the transmission timing of the frame output from the slave to the master unit. When all the slaves transmit at the same time, a collision occurs on the fieldbus and communication becomes impossible. The communication protocol is such that each slave sequentially transmits frames.
[0006]
In this type of communication protocol, master and slave data are transmitted and received by the master unit using the batch transmission / reception method. This OUT frame contains OUT data and is received by a predetermined OUT slave. Note that OUT data for a plurality of OUT slaves is stored in the OUT data area in one OUT frame, and each OUT frame knows in advance the storage location of its own OUT data in the OUT data area. Therefore, OUT data at the storage position is acquired.
[0007]
On the other hand, when each IN slave normally receives an OUT frame from the master unit, it starts time management triggered by the completion of the reception. Each IN slave transmits the IN frames IF0 to IF2 to the master unit at a determined timing for each basic idle time such that the 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 for each slave based on the basic idle time, and the IN data IN0 to IN2 in the IN frame based on the start bit that is the header of each IN frame IF0 to IF2. Take in. By appropriately setting the basic idle time, it is possible to prevent the IN frames from being overlapped from each IN slave and reliably transmit and receive IN data.
[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 from the master unit is all the slaves. This type of system is disclosed in Patent Document 1, for example.
[0010]
For setting the node address of each slave, for example, the user assigns an address by operating a mechanical setting switch such as a dip switch provided in the slave.
[0011]
[Patent Document 1]
JP 09-128019 A
[0012]
[Problems to be solved by the invention]
However, the above-described conventional multidrop network has the following problems. In other words, since the node address is set manually for each slave by the user, there is a possibility that the same node address is set for different slaves by mistake. If a double address is set in this way, the transmission frame from the master unit reaches all the nodes at once, so if a transmission frame is sent to that double address, the double address is assigned. A plurality of slaves (nodes) simultaneously receive a transmission frame, and each returns a response. Then, transmission frame collision occurs on the fieldbus, resulting in an unstable communication line.
[0013]
Furthermore, as described above, when a double address occurs, if the transmission frames from multiple slaves collide and do not reach the master side, the slave of that node address exists on the fieldbus. When the transmission frame from one of the slaves is received, it can be recognized that there is a slave that can be received, but the presence of a slave that cannot join the network cannot be recognized. Therefore, the master unit cannot recognize that a double address state has occurred.
[0014]
In addition, when the response from one slave is normally received, the master unit recognizes that there is a slave with the node address, and then the master unit doubles to communicate with the slave that has received the response normally. When a transmission frame is sent to a node address where an address is generated, there is a possibility that a slave whose previous response has not been received receives the transmission frame and returns a response.
[0015]
The present invention relates to a dual address in a field bus system in which a slave or master side can recognize that a double address of a node is generated even in a field bus system which takes 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]
The dual address detection method in the fieldbus system according to the present invention is a dual address detection method in a fieldbus system in which a master and a slave are connected to a fieldbus. First, the slave stores and holds the set random number. Then, the master designates a node address and issues a status read request to the slave connected to the field bus. Further, when the slave having the designated node address receives the status read request, it returns the random number together with its own node address as a response to the status read request. When the master receives the response, the master issues a status write including the random number to the slave of the received node address. Then, the slave having the transmission address of the status write compares the random number sent together with the received status write with the random number stored and held by itself, and if they do not match, another slave having the same node address It was detected that the slave was in a double address state, and it was in a standby state.
[0017]
Here, in the embodiment, the random number is set by providing a random number setting unit 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.
[0018]
The slave according to the present invention suitable for carrying out the invention of the detection method described above is a slave that can be connected to a field bus, and is set with a communication means that communicates with the master via the field bus. Random number storage means for storing a random number, and when 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 is sent to the status read request When receiving a status write containing a random number addressed to its own node address sent from the master and a random number sent with the status write and a random number stored and held by itself If they do not match, there is another slave that has the same node address. Detects that the address state, and as a function of its own status to the standby state.
[0019]
A master according to the present invention suitable for carrying out the invention of the detection method described above is a master connectable to a field bus, and communication means for communicating with a slave via the field bus, and the field bus A function that issues a status read request by designating a node address to the slave connected to, and when a response with a random number is received from the slave in response to the status read request, the slave of the received node address The function to issue a status light including the received random number was added.
[0020]
Furthermore, the fieldbus system according to the present invention suitable for carrying out the invention of the detection method described above is configured by connecting the master and slave having the above-described configuration to the fieldbus. Then, the master issues a status read request by designating a node address to the slave connected to the field bus. When the slave having the designated node address receives the status read request, When the response is received, the master issues a status write including the random number to the slave of the received node address, and returns the status write of the status write. The slave having the transmission address compares the received random number with the status light and the random number stored and held by itself, and if they do not match, the slave having the same node address exists. Detect that the address is Himself was to be set in a standby state.
[0021]
The fieldbus system to which the present invention is applied is called, for example, a multi-drop wiring form. In a normal state, OUT data is transferred from the master to the slave in a normal state, and the slave side determines the own station. A communication protocol for returning IN data during a specified time period is used. In this system, the node address set for each slave needs to be unique in the fieldbus system, but the same node address may be set to multiple slaves by mistake, resulting in a double address. is there. The present invention detects the occurrence of such a double address.
[0022]
That is, in the present invention, a random number is given to the slave, a response with the random number is returned to the status read request from the master, and the master that has received the response issues a status write request with the received random number added To 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, it can be assumed that the master has received a response with a random number for the status read request that was returned before that, so join as is. To do. On the other hand, if they do not match, it can be said that a response from another slave having the same node address is received by the master and a response issued by itself is not received. Therefore, it can be recognized that at least one other slave having the same node address exists and a double address is generated. Furthermore, since the self was not recognized by the master, it enters a standby state. As a result, a plurality of slaves having double addresses do not transmit frames simultaneously, and communication can be stabilized.
[0023]
Further, in the double address detection method according to the present invention, on the premise of the above-described invention, the master generates a double address by acquiring the node address of the slave in the standby state. To recognize. Then, as a master according to the present invention suitable for carrying out this method, a slave 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 write. It is to have a function to recognize. Thereby, in this invention, the master can also recognize that the double address has generate | occur | produced.
[0024]
Furthermore, in the double 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 so that the response is not transmitted at a predetermined rate even when the transmission timing comes. can do. And in the slave according to the present invention suitable for carrying out such a method, a function is set so that a probability is set for transmission of a response to be returned to the master, and the response is not transmitted at a predetermined rate even when the transmission timing comes. It is to provide.
[0025]
That is, when a double address has occurred and a response to a status read issued from any one of the slaves is received in a timely manner, the double address can be detected as described above. However, a plurality of responses may collide and none of them may be received by the master. On the other hand, in the present invention, since responses are not transmitted at a predetermined rate, if a response is transmitted from another slave at that time, the master unit is reached without collision (the slaves that have generated the double address have 2 One). Also, even if three or more slaves have double addresses, collisions cannot be reliably avoided, but the smaller the number of slaves that send responses, the more likely they are to reach the master. . As a result, by transmitting a response multiple times with a probability, the master recognizes a response from one of the slaves, and the other slaves that have not been recognized enter a standby state with a double address.
[0026]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows the 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 construct 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), and data communication can be performed by performing bus communication between the PLC units. 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 a multi-drop connection, so that communication is performed between the master unit and each slave. 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 / writes IO data and the like. More specifically, the master unit 12 takes in an input signal (on / off state) from an input device connected to the connection terminal of the slave 20 by fieldbus communication, and the input signal (input data) taken in by the master unit 12 is internal. The data is transmitted to the CPU unit 11 by bus communication, and the CPU unit 11 receives an input signal. The CPU unit 11 performs a logical operation predetermined by the user program based on the input signal, and transmits an output signal (output data) including the operation result to the master unit 12 via the internal bus. The master unit transmits the output signal to the slave by fieldbus communication. Each unit outputs the received output signal to the output device connected to the connection terminal. The input signal and the output signal may be collectively referred to as I / O data. That is, 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 the field bus, and performs communication between the master and the slave via the communication interface 12 a that actually transmits and receives data, and the slave 20. The master ASIC 12b that transmits / receives I / O data, transmits a predetermined command and receives a response based thereon, the MPU 12d that performs various controls, and the RAM 12c that is used as a work area when performing various controls An EEPROM 12e storing a program for performing the above control and various setting data, an interface 12h for performing internal bus communication with the CPU unit, etc., and an LED indicating an operating state (communication state), abnormality / normality, etc. A setting switch for setting the display unit 12f and address. It is equipped with a switch 12g.
[0029]
As the control performed by the MPU 12d, the CPU unit 11 communicates with other units and operates the master ASIC 12b. In particular, in connection with the present invention, communication is performed with the slave 20 connected to the field bus 30 to check 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 the field bus, and actually transmits / receives I / O data and various messages to / from the master unit 12 via the communication interface 20a. The slave ASIC 20b that performs the acquired master-slave communication, transmits / receives I / O data, receives a predetermined command from the master unit 12, and transmits a response based on the command, and the MPU 20d that performs various controls The EEPROM 20e storing the program for performing the above control, various setting data, IO data, and the like, and the terminal block structure are connected to the wiring of the input device or output device to transmit / receive I / O data. Same as the I / O unit 20j and the LED display unit 20f indicating the operating state (communication state), abnormal / normal And a setting switch 20g for performing such setting of the node address. Furthermore, a power supply unit 20 i that steps down the input voltage (24 V) to 5 V 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 an input device, and is configured to store IN data and transmit IN data.
[0031]
In relation to the present invention, the slave 20 is provided with random number generation means in the MPU 20d, and this random number generation means determines and determines a value (random number) at the timing of carrier detection on the first fieldbus. The random number holds its value until it is reset. The random number value may be held in a software buffer or stored in the EEPROM 20e. Therefore, even if a double address state in which the same node address is set in different slaves 20 is generated, the possibility that the random number values of a plurality of slaves that have become the double address match is extremely low.
[0032]
Further, when a status read addressed to itself sent from the master unit 12 is received, a status read response including the held random number together with its own node address is issued and returned to the master unit 12.
[0033]
Furthermore, as will be described later, the master unit 12 that has received the status read response outputs a status write including the random number written in the acquired status read response toward the node address of the slave that issued the status read response. Therefore, the slave having the destination node address of the response receives the status write and checks the random number included in the slave and the random number held by itself.
[0034]
Then, the slave 20 has a function of determining the 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, even if the status read response is transmitted, if the status write of the node address addressed to itself cannot be received, it can be determined that the master unit 12 does not recognize the slave of the node address. Becomes an “unsubscribed node”. Note that the initial value of the subscription status is “unsubscribed node”.
[0035]
In this way, if the node becomes an “unjoined node”, there is a possibility that the master unit 12 cannot recognize the slave simply due to a communication error. However, even if a status read response is issued multiple times, it remains in the “unjoined node” state. Then, it can be said that there is a possibility that the master unit 12 cannot recognize the stator read response because a plurality of slaves simultaneously issued the status read response, that is, a double address has occurred.
[0036]
Further, when the status light of the node address addressed to itself is received and the random number included in the status write matches that held by itself, it can be determined that the master unit 12 has recognized itself, so the subscription status is “ It becomes a “subscribed node”. As a result, this slave can formally join the field bus, and thereafter can send and receive I / O data to and from the master unit 12.
[0037]
When the status write of the node address addressed to itself is received and the random number contained therein does not match that held by itself, a double address is generated and the master unit 12 is the same node. Since it can be determined that another slave having an address has been recognized and that it has not recognized itself, the subscription status is “waiting at a double address”.
[0038]
Thus, since each slave 20 holds its own subscription status, the master unit 12 recognizes the subscription status possessed by each slave 20 to determine whether a double address has occurred and which node address. It is possible to detect whether a double 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, 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 a master station. The communication cycle starts from OUT_frame and continues with a plurality of CN_frames, EVE_frames, and IN_frames. The start timing of the communication cycle between the master unit and each slave is adjusted upon completion of normal reception of OUT_frame. That is, the communication synchronization timing is set as the normal reception completion timing of OUT_frame. Since the subsequent frame contents (communication data size, communication timing, communication cycle, etc.) of CN_frame, EVE_frame, and IN_frame are always fixed, the transmission timing of each frame is the timing for starting the normal reception completion of OUT_frame. As follows.
[0041]
Here, OUT_frame is a frame for OUT data transfer from the master unit 12 to the slave 20, and OUT data to be transmitted to each slave is included in this OUT_frame. For each slave 20 on the receiving side, this OUT_frame is a frame indicating the start of the communication cycle. That is, each slave 20 activates an internal counter (timer activation) to start timing from the time when reception of this 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” that is output data sent from the master unit 12 to a predetermined slave (OUT slave) 20, and “CRC” that is a frame check sequence. Further, the frame header registers “start” indicating the start of the frame, “command” indicating the frame identification code (protocol control code), and “CN_frame transmission” for registering the node address (CN_frame request) of the slave whose connection is to be confirmed. "Request address", "EVENT transmission permission address" for registering a node address that permits transmission of event frames, "Domain version" for registering the registered version of the OUT data position and IN frame transmission position in each slave, and OUT data "Length" for registering the data length of
[0043]
Further, the “command” includes a command for instructing permission / prohibition of refresh of OUT data in relation to the present invention. Also, connection confirmation frame transmission request mode, status read forced request mode, connection confirmation frame transmission probability (slave side response is 75%), and status read forced request response transmission probability (slave side response is 75%) There is a valid flag.
[0044]
The connection confirmation frame transmission request mode is a code that identifies three types of "request to subscribed slave", "request to unsubscribed slave", and "request to dual address detection slave" corresponding to the subscription status. is there. Further, the status forced request mode is a code for requesting the slave to issue EVE_frame, and is a code for identifying two types of “request to subscribed slave” and “request to double address detection slave”. Furthermore, a connection confirmation frame transmission probability (slave-side response is 75%) setting valid flag (1/0) and a status read forced request response transmission probability (slave-side response is 75%) setting valid flag (1/0) There is. The setting valid flag for each transmission probability sets the probability that the slave will send a response. When the valid flag is 1, the response is returned with a probability of 75%, and when the valid flag is 0, A response is returned with a probability of 100%.
[0045]
CN_frame is a connection confirmation frame for confirming whether or not the network is connected. That is, the slave specified by the CN_frame transmission request address in OUT_frame is a frame returned in 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 protocol control code, and “source address” is a source address set to the slave that transmitted this CN_frame. , “CRC” is a frame check sequence. In the “command”, a 2-bit code that specifies one of the three states of the subscription status is stored.
[0046]
EVE_frame is a message data transfer frame in the communication cycle. The master determines when and which node to transfer, and notifies it with 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 protocol control code, “destination address” is a destination address for transmitting this event data, and “source address” Is a source address set to the node that transmitted the event data, “Length” is the data length of the event data to be transmitted, “Event data” is the event data that is the content to be transmitted, and “CRC” Is a frame check sequence.
[0047]
Further, in relation to the present invention, “command” includes “status write request” used by the master unit and “ACK response” and “BUSY” (only the slave is used) for the status write request. In addition, there are “status read request to subscribed slave”, “status read request to unsubscribed slave”, and “status read request to dual address detection slave”. These status read requests are used only by the master unit.
[0048]
Furthermore, there are “status read request to unsubscribed slave with response probability setting valid” and “status information read request to dual address detection slave with response probability setting valid”. These read requests are used only by the master unit.
[0049]
Furthermore, as commands other than those described 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. The master sets which slave transfers IN_frame at the time of bus initialization. Note that this IN_frame is used for actual transmission / reception of IO data, and is the same as the conventional one, and thus detailed description thereof 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 makes a status read request while sequentially changing addresses according to EVE_frame ((1)). At this time, status read requests may be issued sequentially for all subscription statuses, or status read requests may be issued only to unsubscribed slaves.
[0052]
The slave of the corresponding node address (for example, # 0) that has received this status read request returns a response to the status read. At this time, the random number of the slave 20 is added together with its own address ((2)). Then, when a double address is generated, a collision occurs because a plurality of responses are transmitted over the network (field bus). Therefore, only one response is received by the master unit 12, or not all responses are received.
[0053]
When the master unit 12 receives the response, the master unit 12 issues a status write command using the received address as the transmission destination address by EVE_frame ((3)). At this time, the received random number is also added. This status write is received by the slave 20 of the node address that matches the destination address. In the illustrated case, the two slaves 20 having the node address # 0 each receive.
[0054]
Then, the slave 20 having the same random number returns a response to the status write to the master unit 12 using EVE_frame ((4)). This response is also accompanied by a random number. When the master unit receives this response, it can be confirmed that the node address # 0 exists and is joined to the network. Further, the slave 20 returns the above-mentioned response, and changes the subscription status of the slave whose initial value is not yet subscribed to the subscribed slave in response to the status write request.
[0055]
In addition, the slave 20 whose random numbers do not match can be understood that a double address is generated and that another slave is recognized by the master unit 12. Therefore, the internal initialization is performed and a double address abnormal state occurs. That is, the initial value of the unsubscribed slave is changed to a standby status with a double address. Also, it cannot join the network and does not return a status write response. Further, since it is in an abnormal state, the LED display unit 20F is turned on to inform the surroundings that it is waiting by a 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. Thereby, transmission / reception of normal I / O data is performed.
[0057]
On the other hand, when the master unit 12 does not respond to the status read, there is no slave at the node address that issued the status read, a double address has occurred, and the master unit 12 can issue from a plurality of slaves. There are both cases where the responses to be received collide and neither response has been received by the master unit 12. When a double address has occurred, 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 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 with respect to the status read request using EVE_frame can be set to 75%. Therefore, with a probability of 75%, the slave does not transmit a frame with a probability of 25%. Therefore, the probability that only one node will return a response is increased during several status read request retransmissions. Probability can be improved.
[0059]
When a state occurs in which only one of the plurality of slaves generating a double 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 enter a standby state based on the double address.
[0060]
Next, the recognition procedure of the 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 (request for a double address detection slave) ((1)). Then, the corresponding slave, that is, a slave that has a subscription status of dual address and is waiting returns a response with CN_frame. By receiving this CN_frame, the master unit 12 can recognize that a double 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 forced request presence command to the OUT_frame dual address detection slave ((1)). Thereby, the status information of the slave can be obtained ((2)).
[0062]
The double address detection process described above is performed by executing, for example, the flowchart shown in FIG. First, with the start of the network initialization process, a connection confirmation frame transmission request with probability is sent to all slaves that may exist in the network (ST1). At this time, “response only to unjoined node address” can be added as a command option.
[0063]
The slave that did not respond to the connection confirmation frame transmission request with probability (1) responded with a sequence with probability, but there was another response from the slave with the same address, so the frame collided. Frame error;
(2) No response in sequence with probability;
(3) does not exist in the network;
(4) Frame error due to noise:
(5) No response in sequence with probability;
There is a possibility.
[0064]
Therefore, as a recovery procedure, a connection confirmation frame transmission request with probability is made to all nodes that have not responded (ST2). At this time, it is preferable to add “response to only unjoined node address as a command option”. With the probability, the possibility that the master unit 12 receives a response is increased. Then, Step 2 is repeatedly executed until all the nodes that have not responded respond.
[0065]
If all respond, issue a status read command with probability to the responding slave (ST3). It is preferable to add “response to only unjoined node address as a command option”.
[0066]
Slaves that did not respond in the process of step 3
(1) The response is a sequence with probability, but there was another response from the slave with the same address, so the frame collided and frame error;
(2) Frame error due to noise;
There is a possibility.
[0067]
Therefore, as a recovery procedure, a status read command with probability is issued to all the nodes that did not respond in step 3 (ST4). At this time, it is preferable to add “response to only unjoined node address as a command option”. Then, step 4 is repeatedly executed until all the nodes that have not responded respond.
[0068]
If all respond, record the attributes of the slave that responded in ST3 (record in, out, points, slave-specific random number) (ST5). Next, a status write command is issued with random numbers to all the nodes that responded in step 3 (ST6).
[0069]
Then, a status read command with probability is issued to all the nodes that responded in step 3 (ST7). At this time, “only a double address detection slave as a command option” is set.
[0070]
Slaves that did not respond in step 7
(1) Frame error due to noise;
(2) There are two or more dual address nodes;
(3) No response in sequence with probability;
There is a possibility.
[0071]
Therefore, a status read command with probability is issued to all the nodes that did not respond in step 7 (ST8). At this time, “only a double address detection slave as a command option” is set. Then, this step 7 is repeatedly executed until all 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 ("Only a double address detection slave responds as a command option") (ST9). Then, the node that has responded in step 8 is recorded as a node with a double address error (ST10).
[0073]
In this way, double address detection on the slave side is possible by performing status read → status write using random number wrapping. The slave that has transitioned to the double address abnormal state only returns a response to the status read and CN_frame for the double address abnormal detection slave, and does not perform IO refresh or other event communication at all. As a result, only one of the plurality of slaves set with the double address is properly joined, so that stable communication can be performed.
[0074]
Further, the slave does not perform the IO refresh until the reading and writing of the status information from the master unit 12 are completed. Specifically, for IN data, refreshing can be started and IN_frame can be sent when status information / IN data refresh permission of the slave 20 is asserted. For OUT data, the refresh start flag of OUT data in OUT_frame allows the start of refresh of OUT data in the slave.
[0075]
In this way, the master unit 12 can recognize the network configuration including the presence / absence of a double address. Thereafter, normal transmission / reception of IO information and the like are performed, but the network state (presence / absence of change in subscription status, etc.) can be monitored at an appropriate timing. That is, the master unit 12 monitors whether (1) a slave that has already been joined continues to be connected, or (2) whether a new slave is not connected.
[0076]
(1) Whether the subscribed node is still connected
Periodic polling (in OUT_frame) in the request mode for the joined slave is applied only to the joined slave from the master unit 12. The subscribed slave that has received the poll returns CN_frame (added subscription status) to the master. As a result, it is determined whether or not the joined node continues to be connected.
[0077]
(2) Is a new node connected?
Slaves who have not been able to join the network due to a power failure may join later. Therefore, periodic polling (in OUT_frame) in the request mode for unsubscribed slaves is applied from the master unit 12 to all slaves. The slave that has received the poll (the subscription status is “unsubscribed slave”) returns CN_frame (with the non-subscription status added) to the master.
[0078]
The master that has detected the connection of a new slave makes a solicitation to join the slave by using EVE_frame, and transmits and receives a predetermined frame to and from the slave in the same manner as in the initial process when the power is turned on. Then, the new slave has a subscription status, and the master unit performs memory allocation. Thereafter, normal IO information is transmitted and received.
[0079]
【The invention's effect】
As described above, in the present invention, a random number is given to the slave, a response with the random number is returned in response to the status read request from the master, and the master receiving the response receives the status write with the received random number added. Since the request is issued, the slave can determine whether or not a double address is generated 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 the master unit.
FIG. 3 is a block diagram showing an internal structure of a slave.
FIG. 4 is a diagram illustrating a frame indicating a frame transmitted / received in a communication cycle.
FIG. 5 is a diagram illustrating a data structure of OUT_frame.
FIG. 6 is a diagram illustrating a data structure of CN_frame.
FIG. 7 is a diagram illustrating a data structure of EVE_frame.
FIG. 8 is a diagram illustrating an example of a double address detection method.
FIG. 9 is a diagram illustrating an example of a double address detection method.
FIG. 10 is a diagram illustrating an example of a double address detection method.
FIG. 11 is a flowchart illustrating an example of a double 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
20b Slave ASIC
20d MPU
20e EEPROM
20f LED display
20g setting switch
20i power supply
20j I / O part
30 Fieldbus

Claims (9)

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

Families Citing this family (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
JP7268287B2 (en) * 2018-03-12 2023-05-08 オムロン株式会社 Control system, control method and control program
CN113347283B (en) * 2021-06-03 2022-05-24 上海钧嵌传感技术有限公司 Method and system for distributing node addresses
CN114338530B (en) * 2021-12-21 2023-09-29 浙江华锐捷技术有限公司 Method and device for adjusting equipment state, storage medium and electronic device

Cited By (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

Also Published As

Publication number Publication date
JP2004274395A (en) 2004-09-30

Similar Documents

Publication Publication Date Title
KR102338503B1 (en) Method for transmitting and receiving wake-up signal in vehicle network
EP1022878B1 (en) Data transmission system
JP5717240B2 (en) Communication system and communication apparatus
US9100397B2 (en) BACnet MS/TP automatic MAC addressing
US9519283B2 (en) Method and apparatus for transmitting data in an automated control system
WO2010009584A1 (en) Method and system for smart address assignment based on serial bus
CN112075063B (en) Gateway for data communication in a vehicle
JP2014531844A (en) Method for driving a communication system
JP4023342B2 (en) Dual address detection method, slave, master and field bus in field bus system
US7474625B2 (en) Time-triggered communication system and method for the synchronized start of a dual-channel network
JP2013530595A (en) Method for transitioning the drive state of at least one device
JP6410914B1 (en) Serial communication system
CN113542265B (en) Local network security management, device, computer equipment and storage medium
US9501440B2 (en) Slave control device and method for programming a slave control device
JP2770282B2 (en) Vehicle data transmission system
JP2004280304A (en) Field bus system, communication method and master/ slave
US10524219B2 (en) Communication apparatus, communication system and communication method
JP4013592B2 (en) Vehicle communication system
JP4107110B2 (en) Fieldbus system, connection confirmation method, and master
US10243887B2 (en) Switch unit, ethernet network, and method for activating components in an ethernet network
JP2012169800A (en) Communication system
JP2022538080A (en) A method of interacting with a computer on a vehicle's on-board bus
KR20220021446A (en) Distributed communication system and method of controlling the same system
JPH10232704A (en) Duplex programmable controller
WO2006030697A1 (en) Communication device, communication control method, communication control program, and computer-readable recording medium containing the communication control program

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