JP2014230097A - Master-slave system and node control method thereof - Google Patents

Master-slave system and node control method thereof Download PDF

Info

Publication number
JP2014230097A
JP2014230097A JP2013108351A JP2013108351A JP2014230097A JP 2014230097 A JP2014230097 A JP 2014230097A JP 2013108351 A JP2013108351 A JP 2013108351A JP 2013108351 A JP2013108351 A JP 2013108351A JP 2014230097 A JP2014230097 A JP 2014230097A
Authority
JP
Japan
Prior art keywords
slave
master
node
setting
slave device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013108351A
Other languages
Japanese (ja)
Inventor
素克 徳永
Motokatsu Tokunaga
素克 徳永
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.)
Hitachi Industry and Control Solutions Co Ltd
Original Assignee
Hitachi Industry and Control Solutions Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Industry and Control Solutions Co Ltd filed Critical Hitachi Industry and Control Solutions Co Ltd
Priority to JP2013108351A priority Critical patent/JP2014230097A/en
Publication of JP2014230097A publication Critical patent/JP2014230097A/en
Pending legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a master-slave system capable of easily setting a node ID of a slave device and easily performing addition or fault detection of the slave device.SOLUTION: The master-slave system including a master device 101 and a plurality of slave devices 106, 112 and 118 is connected by a serial signal line 105 connecting the master device and each of the slave devices via a shared bus and a signal line for dizzy connection of the master device and each of the slave devices with the master device as a terminal. A response telegraphic message of the slave device communicated via the serial signal line includes flag information indicating a state of an upper-stage device including a node ID setting state of another device reported by the signal line and a connection state of a lower-stage device.

Description

本発明は、複数の機器を接続して制御する組み込み用マスタスレーブシステムに係り、ノードID管理に好適な技術に関する。   The present invention relates to an embedded master-slave system that connects and controls a plurality of devices, and relates to a technique suitable for node ID management.

ビル設備・機器の管理や運用をおこなうビル管理システムでは、そのインテリジェント機能の実現のために、電力計や照度計等の計測センサが接続されたセンサモジュールが分散配置され、複数のセンサモジュールがコントローラに接続されてデータ収集している。コントローラはイーサネット(登録商標)等によりネットワーク接続されて制御されていることが多い。例えば、フロアー毎にコントローラが配置され、複数のコントローラがイーサネットを介して管理サーバに接続されて、計測センサで採取した測定データを基に、ビル全体の電力設備や照明設備が制御されている。   In a building management system that manages and operates building facilities and equipment, sensor modules connected to measurement sensors such as wattmeters and illuminance meters are distributed and multiple sensor modules are used as controllers to realize intelligent functions. Connected to and collecting data. The controller is often controlled by being connected to the network via Ethernet (registered trademark) or the like. For example, a controller is arranged for each floor, a plurality of controllers are connected to a management server via Ethernet, and power facilities and lighting facilities of the entire building are controlled based on measurement data collected by measurement sensors.

このコントローラは、複数のセンサモジュールを半二重方式の差動シリアル通信ライン等により共有バス接続し、計測センサから電力量や照度等の測定データを取得・処理し、管理サーバに通知している。このようなシステムは、各センサモジュールの識別のためのノードIDが必要となる。   This controller connects multiple sensor modules via a shared bus using a half-duplex differential serial communication line, etc., acquires and processes measurement data such as electric energy and illuminance from measurement sensors, and notifies the management server . Such a system requires a node ID for identifying each sensor module.

そして、半二重方式の差動シリアルインターフェースでは、主に2線の差動信号を送信/受信で共用しており、通信状況のモニタとプロトコル制御で送受信タイミングを制御して、データの送受信をおこなっている。このとき、コントローラがマスタ装置となり各センサモジュールがスレーブ装置となって、マスタ装置が、ポーリング方式で通信をおこなっている。   The half-duplex differential serial interface mainly uses two-wire differential signals for transmission / reception, and controls transmission / reception timing by monitoring the communication status and protocol control to transmit / receive data. I'm doing it. At this time, the controller serves as a master device and each sensor module serves as a slave device, and the master device communicates in a polling manner.

上記の差動シリアルインターフェースによるマスタスレーブシステムとそのノード識別子の設定に係る技術は、例えば、特許文献1に記載されている。詳しくは、特許文献1には、マスタノードと複数のスレーブノードとが通信バス接続されるとともに、マスタノードと複数のスレーブノードのそれぞれがノード識別子(ノードID)の設定開始を通知する通知線でリング状にデイジーチェーン接続されるネットワークが開示されている。そして、マスタノードがスレーブノードを所定のノード識別子に設定する要求メッセージを通信バスと介して順次送出し、デイジーチェーン接続された通知線から設定開始信号が入力されたスレーブノードが、通信バスから要求メッセージを取得して自ノードのノード識別子を設定し、マスタノードに応答するとともに、次ノードの通知線に設定開始信号を出力し、マスタノードは、リング接続された通知線から設定開始信号が入力されるとノード識別子の設定を終了することが記載されている。   A technique relating to the setting of the master-slave system using the differential serial interface and its node identifier is described in Patent Document 1, for example. Specifically, in Patent Document 1, a master node and a plurality of slave nodes are connected via a communication bus, and each of the master node and the plurality of slave nodes is a notification line for notifying the start of setting of a node identifier (node ID). A network daisy chained in a ring shape is disclosed. Then, the master node sequentially sends a request message for setting the slave node to a predetermined node identifier via the communication bus, and the slave node to which the setting start signal is input from the notification line connected in a daisy chain requests from the communication bus. Gets the message, sets the node identifier of its own node, responds to the master node, outputs the setting start signal to the notification line of the next node, and the master node receives the setting start signal from the ring-connected notification line It is described that the setting of the node identifier is completed when the operation is performed.

特開2009−239429号公報JP 2009-239429 A

上記の特許文献1に開示される技術によれば、スレーブノードはリング状にデイジーチェーン接続された通信線を介してノードIDの設定開始を通知されるので、各スレーブノードは順次、所定のノードIDに設定可能となる。また、マスタノードはリング状に接続された通信線によりノードIDの設定終了をモニタできるので、すべてのスレーブノードへノードIDの設定を容易におこなうことができるとともに、ノードIDの設定時間を短縮することができる。   According to the technique disclosed in Patent Document 1 above, slave nodes are notified of the start of node ID setting via a communication line connected in a daisy chain in a ring shape. ID can be set. In addition, since the master node can monitor the completion of node ID setting via a communication line connected in a ring shape, it is possible to easily set node IDs for all slave nodes and to shorten the node ID setting time. be able to.

しかし、スレーブ装置の途中追加が考慮されておらず、ビル管理システムに適用した場合にはセンサモジュールの配置変更や増設・削減が生じた際にすべてのセンサモジュールのノードIDの設定作業を再度おこなう必要があった。   However, the addition of slave devices is not taken into account, and when applied to a building management system, the node ID setting for all sensor modules is performed again when the sensor module is relocated, expanded, or reduced. There was a need.

また、マスタ装置がスレーブ装置の機器故障の検出を考慮しておらず、センサモジュールの故障検出に時間がかかる問題があった。   Further, the master device does not consider the detection of the device failure of the slave device, and there is a problem that it takes time to detect the failure of the sensor module.

本発明は、上記の問題を解決し、容易にスレーブ装置のノードIDの設定がおこなえるとともに、容易にスレーブ装置の追加や故障検出をおこなえるマスタスレーブシステムを提供することを目的とする。   An object of the present invention is to provide a master-slave system that solves the above-described problems and can easily set a node ID of a slave device and can easily add a slave device and detect a failure.

前記課題を解決するため、本発明のマスタ装置と複数のスレーブ装置を有するマスタスレーブシステムは、前記マスタ装置と前記スレーブ装置のそれぞれを共有バス接続するシリアル信号ラインと、前記マスタ装置と前記スレーブ装置のそれぞれが前記マスタ装置を端にしてデイジーチェーン接続される信号ラインにより接続され、前記シリアル信号ラインを介して通信される前記スレーブ装置の応答電文に、前記信号ラインにより通知する他の装置の状態を示すフラグ情報が含まれるようにした。   In order to solve the above problems, a master slave system having a master device and a plurality of slave devices according to the present invention includes a serial signal line for connecting the master device and the slave devices to a shared bus, the master device, and the slave devices. The state of the other device that is connected by the signal line that is daisy chain-connected with the master device as an end, and that is notified by the signal line to the response message of the slave device that is communicated via the serial signal line The flag information indicating is now included.

より詳しくは、前記マスタ装置を端にしてデイジーチェーン接続する信号ラインは、デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置側に接続された上段装置のノードID設定の完了状態を下段の装置に通知する上段装置状態信号のラインと、デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置と反対側に接続された下段スレーブ装置の有無を上段装置に通知する下段装置接続信号のラインと
から成るようにした。
More specifically, the signal line for daisy chain connection with the master device at the end indicates the completion state of the node ID setting of the upper device connected to the master device side of the master device connected to the daisy chain or the slave device. From the upper device status signal line to notify the upper device and the lower device connection signal line to notify the upper device of the presence or absence of the lower slave device connected to the opposite side of the master device connected to the daisy chain or the master device of the slave device. It was made to become.

そして、記スレーブ装置からマスタ装置への応答電文のフラグ情報には、当該スレーブ装置のノードID設定処理によるノードID設定完了フラグと、デイジーチェーン接続される信号ラインにより通知され、デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置と反対側に接続された下段スレーブ装置の接続有無を示す下段装置接続フラグと、デイジーチェーン接続される信号ラインにより通知され、デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置側に接続された上段装置のノードIDの設定状態を示す上段装置状態フラグを含むようにした。これにより、マスタ装置の故障検出やスレーブ装置の追加検知を容易にした。   And the flag information of the response message from the slave device to the master device is notified by the node ID setting completion flag by the node ID setting processing of the slave device and the signal line connected in the daisy chain, and is connected in the daisy chain. Master device or slave device connected to the lower device connected to the opposite side of the master device or the slave device of the master device or slave device, and a daisy chain connected master device or slave device notified by a signal line connected to the daisy chain The upper device status flag indicating the setting state of the node ID of the upper device connected to the master device side is included. This facilitates the detection of failure of the master device and the additional detection of slave devices.

上記の構成でスレーブ装置にノードIDを設定する場合には、スレーブ装置は、マスタ装置を端としてデイジーチェーン接続されたマスタ装置、あるいは、当該スレーブ装置のマスタ側に接続する上段のスレーブ装置からの通知により自己のノードIDの設定をおこなうことを認識し、共有バス接続された前記マスタ装置からノードID設定コマンドを受信し、前記ノードID設定コマンドに指定されたID値に自己のノードIDを設定し、デイジーチェーン接続された下段のスレーブ装置の有無を取得し、前記ノードID設定コマンドの応答電文の下段装置接続フラグに、前記下段のスレーブ装置の有無を反映し、前記マスタ装置に前記ノードID設定コマンドの応答として前記応答電文を通知するようにする。
前記ノードID設定コマンドを通知したマスタ装置は、前記スレーブ装置からの前記応答電文を受信し、前記応答電文の下段装置接続フラグが、下段装置接続有の場合には、前記ノードID設定コマンドのノードID値とは異なるノードID値を指定したノードID設定コマンドをスレーブ装置に通知し、下段装置接続無の場合には、スレーブ装置のノードIDの設定を終了するようにした。
When the node ID is set to the slave device with the above configuration, the slave device is connected from the master device daisy chained with the master device as an end, or from the upper slave device connected to the master side of the slave device. Recognizing that the node ID is set by notification, receiving the node ID setting command from the master device connected to the shared bus, and setting the node ID to the ID value specified in the node ID setting command The presence or absence of the lower slave device connected in a daisy chain is acquired, the presence or absence of the lower slave device is reflected in the lower device connection flag of the response message of the node ID setting command, and the node ID is added to the master device. The response message is notified as a response to the setting command.
The master device that has notified the node ID setting command receives the response message from the slave device, and if the lower device connection flag of the response message indicates that the lower device is connected, the node of the node ID setting command The node ID setting command specifying a node ID value different from the ID value is notified to the slave device, and when the lower device is not connected, the setting of the node ID of the slave device is terminated.

本発明によれば、容易にスレーブ装置のノードIDの設定がおこなえるとともに、スレーブ装置の追加時に短時間にノードID設定がおこなえ、容易にスレーブ装置の故障検出をおこなえるマスタスレーブシステムを提供することができる。   According to the present invention, it is possible to provide a master-slave system capable of easily setting a node ID of a slave device, setting a node ID in a short time when a slave device is added, and easily detecting a failure of the slave device. it can.

実施例1のマスタスレーブシステムの接続構成図である。1 is a connection configuration diagram of a master-slave system of Example 1. FIG. 実施例1のマスタ装置の電文フォーマットである。It is a message | telegram format of the master apparatus of Example 1. FIG. 実施例1のスレーブ装置の応答電文フォーマットである。It is a response message format of the slave device of the first embodiment. 実施例1のマスタ・スレーブ装置のイニシャル処理シーケンス図である。FIG. 3 is an initial process sequence diagram of the master / slave device according to the first embodiment. 実施例1のスレーブ装置の起動時イニシャル処理のフロー図である。FIG. 3 is a flowchart of initial processing at the time of activation of the slave device according to the first embodiment. 実施例1のマスタ装置の起動時イニシャル処理のフロー図である。It is a flowchart of the initial process at the time of starting of the master apparatus of Example 1. 実施例1のスレーブ装置増設時の処理フロー図である。FIG. 4 is a processing flowchart when adding slave devices according to the first embodiment. 実施例1の特定スレーブ装置に対するイニシャル処理のフロー図である。FIG. 3 is a flowchart of initial processing for a specific slave device according to the first embodiment. 実施例1のスレーブ装置異常時の検出処理フロー図である。FIG. 6 is a flowchart of detection processing when the slave device is abnormal in the first embodiment. 実施例1のスレーブ装置異常時の復帰処理内容を示す図である。It is a figure which shows the return processing content at the time of the slave apparatus abnormality of Example 1. FIG. 実施例1のスレーブ装置の他の機器構成を説明する図である。It is a figure explaining the other apparatus structure of the slave apparatus of Example 1. FIG. 実施例2のマスタスレーブシステムの接続構成図である。FIG. 6 is a connection configuration diagram of a master-slave system according to a second embodiment.

本発明の実施例を、図面を参照しながら説明する。尚、各図および各実施例において、同一又は類似の構成要素には同じ符号を付し、説明を省略する。   Embodiments of the present invention will be described with reference to the drawings. In each drawing and each embodiment, the same or similar components are denoted by the same reference numerals, and description thereof is omitted.

(実施例1)
図1は、実施例1のマスタスレーブシステムの接続構成図である。システムは、ポーリング方式で通信をおこなうひとつのマスタ装置101と、複数のスレーブ装置106、112、118から成り、差動シリアルライン105で接続されている。マスタ装置とスレーブ装置は、半2重方式で通信をおこなっている。そして、差動シリアルライン105とは別に、マスタ装置101とスレーブ装置106、112、118とは、詳細を後述する信号によりデイジーチェーン接続されている。
本実施例では、図1に示すように、マスタ装置101はデイジーチェーン接続の端に設置され、スレーブ装置106、112、118が順次接続されている。以下の説明では、デイジーチェーン接続のマスタ装置側を上段と呼び、マスタ装置と反対側を下段と呼ぶこととする。
Example 1
FIG. 1 is a connection configuration diagram of the master-slave system according to the first embodiment. The system is composed of one master device 101 that communicates in a polling manner and a plurality of slave devices 106, 112, and 118, and they are connected by a differential serial line 105. The master device and the slave device communicate with each other by a half duplex method. In addition to the differential serial line 105, the master device 101 and the slave devices 106, 112, and 118 are daisy chain connected by signals that will be described in detail later.
In this embodiment, as shown in FIG. 1, the master device 101 is installed at the end of the daisy chain connection, and the slave devices 106, 112, and 118 are sequentially connected. In the following description, the master device side of the daisy chain connection is referred to as the upper stage, and the side opposite to the master device is referred to as the lower stage.

マスタ装置101は、通信用のシリアルポート102とノードID設定完了フラグを示すデジタル出力端子(A)103と、下段のスレーブ装置の接続を確認するためのデジタル入力端子(B)104を有している。   The master device 101 has a serial port 102 for communication, a digital output terminal (A) 103 indicating a node ID setting completion flag, and a digital input terminal (B) 104 for confirming the connection of the lower slave device. Yes.

スレーブ装置A106は、差動シリアルライン105にバス接続する通信用のシリアルポート109と、上段のマスタ装置101のノードID設定完了フラグをモニタするためのデジタル入力端子(A)107と、上段のマスタ装置101に自機の接続を示す接続指示出力端子108と、自機のノードID設定完了フラグを示すデジタル出力端子(A)110と、下段のスレーブ装置の接続を確認するためのデジタル入力端子(B)111を備えている。   The slave device A106 includes a communication serial port 109 connected to the differential serial line 105, a digital input terminal (A) 107 for monitoring a node ID setting completion flag of the upper master device 101, and an upper master. A connection instruction output terminal 108 indicating the connection of the own device to the device 101, a digital output terminal (A) 110 indicating the node ID setting completion flag of the own device, and a digital input terminal (for confirming the connection of the lower slave device) B) 111 is provided.

また、スレーブ装置B112、スレーブ装置C118も、スレーブ装置A106と同様のインターフェースを備えている。通信用のシリアルポート115、121は、差動シリアルライン105にバス接続し、デジタル入力端子(A)(A)113、119は、上段のスレーブ装置のデジタル出力端子(A)110、116に接続し、接続指示出力端子114、120が、上段のスレーブ装置のデジタル入力端子(B)111、117に接続している。   The slave device B112 and the slave device C118 also have the same interface as the slave device A106. Serial ports 115 and 121 for communication are bus-connected to differential serial line 105, and digital input terminals (A) (A) 113 and 119 are connected to digital output terminals (A) 110 and 116 of the upper slave device. The connection instruction output terminals 114 and 120 are connected to the digital input terminals (B) 111 and 117 of the upper slave device.

本実施例では、マスタ装置とスレーブ装置およびスレーブ装置間のデジタル出力端子(A)とデジタル入力端子(A)(A)を接続する信号を“上段装置状態信号”と称し、接続指示出力端子とデジタル入力端子(B)を接続する信号を“下段接続信号”と称することとする。   In this embodiment, a signal for connecting the digital output terminal (A) and the digital input terminals (A) (A) between the master device, the slave device, and the slave device is referred to as an “upper device status signal”, and the connection instruction output terminal A signal for connecting the digital input terminal (B) is referred to as a “lower connection signal”.

デイジーチェーン接続した最下段のスレーブ装置C118のデジタル出力端子(A)122とデジタル入力端子(B)123は、下段にスレーブ装置が接続されていないため、開放端となっている。   The digital output terminal (A) 122 and the digital input terminal (B) 123 of the lowermost slave device C118 connected in a daisy chain are open because no slave device is connected to the lower stage.

ここで、デジタル入力端子(B)104、111、117をプルアップ入力端子とし、接続指示出力端子108、114、120をオープンコレクタ(またはオープンドレイン)の制御出力あるいは、GNDレベルの固定出力端子とする。これによれば、スレーブ装置は、デジタル入力端子(B)がLOWレベルのときに下段にスレーブ装置が接続され、HIGHレベルのときには下段にスレーブ装置が接続されていないと判別できる。   Here, the digital input terminals (B) 104, 111, 117 are pull-up input terminals, and the connection instruction output terminals 108, 114, 120 are open collector (or open drain) control outputs or GND level fixed output terminals. To do. According to this, the slave device can be determined that the slave device is connected to the lower stage when the digital input terminal (B) is at the LOW level, and that the slave device is not connected to the lower stage when the digital input terminal (B) is at the HIGH level.

上述で、マスタ装置101と複数のスレーブ装置106、112、118とは、差動シリアルライン105で接続するとしたが、差動シリアルに限定されるものでないことは言うまでもない。また、マスタ装置101と複数のスレーブ装置106、112、118とをデイジーチェーン接続する信号はシングルエンドの信号としたが、差動信号としてもよい。この場合には、耐ノイズ性が増し信頼性の向上が期待できる。   In the above description, the master device 101 and the plurality of slave devices 106, 112, and 118 are connected by the differential serial line 105, but it is needless to say that the master device 101 is not limited to the differential serial. Further, the signal for daisy chain connecting the master device 101 and the plurality of slave devices 106, 112, and 118 is a single-ended signal, but may be a differential signal. In this case, noise resistance can be increased and reliability can be expected.

次に、ポーリング方式でアクセスをおこなうひとつのマスタ装置101と、複数のスレーブ装置106、112、118との間の電文フォーマットを図2aと図2bにより説明する。図2aはマスタ装置が出力する電文フォーマットを示し、図2bは、スレーブ装置が出力する応答電文フォーマットを示している。実施例のマスタスレーブシステムは、半2重のポーリング方式の通信をおこなうため、図2aと図2bのフォーマットの電文が交互に差動シリアルライン105に出力される。   Next, a message format between one master device 101 that accesses by the polling method and a plurality of slave devices 106, 112, and 118 will be described with reference to FIGS. 2a and 2b. FIG. 2A shows a message format output by the master device, and FIG. 2B shows a response message format output by the slave device. Since the master-slave system of the embodiment performs half-duplex polling communication, messages in the formats of FIGS. 2 a and 2 b are alternately output to the differential serial line 105.

マスタ装置が出力する電文は、図2aに示すように、宛先のノードIDと自機のノードIDのフィールドを含む定型部と、スレーブ装置に通知するコマンドあるいはデータのフィールドを含むデータ部から構成される。宛先のノードIDには、コマンドやデータを通知するスレーブ装置のノードIDが設定される。自機のノードIDには、マスタ装置のノードIDである固定値“0”が設定される。   As shown in FIG. 2a, the message output by the master device is composed of a fixed portion including fields of the destination node ID and the node ID of the own device, and a data portion including a command or data field notified to the slave device. The In the destination node ID, the node ID of the slave device that notifies the command or data is set. A fixed value “0” that is the node ID of the master device is set in the node ID of the own device.

上記のマスタ装置の電文のコマンドあるいはデータのフィールドには、詳細を後述する、“スレーブ装置のノードIDクリア要求”や“スレーブ装置のイニシャル要求”や“ノードID設定”等のコマンドと、“ノードIDの設定値”等のデータが設定される。   In the command or data field of the above master device message, details such as “slave device node ID clear request”, “slave device initial request”, “node ID setting” command, and “node” Data such as “set value of ID” is set.

スレーブ装置が出力する電文は、図2bに示すように、宛先のノードIDと自機のノードIDのフィールドと詳細を後述するフラグ・フィールドを含む定型部と、マスタ装置に応答するデータやステータスを示すフィールドを含むデータ部から構成される。宛先のノードIDにはマスタ装置のノードIDである固定値“0”が設定され、自機のノードIDには応答するスレーブ装置のノードIDが設定される。   As shown in FIG. 2b, the message output by the slave device includes a destination node ID, a node ID field of the own device, a fixed part including a flag field to be described in detail, and data and status in response to the master device. It consists of a data part containing the field shown. A fixed value “0”, which is the node ID of the master device, is set as the destination node ID, and the node ID of the slave device that responds is set as the node ID of the own device.

つぎに、上述のフラグ・フィールドについて詳細に説明する。図2bに示すように、フラグ・フィールドは、“ノードID設定完了フラグ”と“下段装置接続フラグ”と“上段装置状態フラグ”を含んでいる。
このうち、“ノードID設定完了フラグ”は、詳細を後述する“ノードID設定”のコマンドに対する処理結果が設定される(設定完:1、設定未完:0)。前述のとおり、このフラグ内容は、デジタル出力端子(A)にも反映されている。また、“下段装置接続フラグ”には、当該スレーブ装置のデジタル入力端子(B)の状態が反映され、“上段装置状態フラグ”には、当該スレーブ装置のデジタル入力端子(A)の状態が反映されている。
Next, the flag field will be described in detail. As shown in FIG. 2b, the flag field includes a “node ID setting completion flag”, a “lower apparatus connection flag”, and an “upper apparatus state flag”.
Among these, the “node ID setting completion flag” is set with a processing result for a “node ID setting” command whose details will be described later (setting completed: 1, setting not completed: 0). As described above, the contents of this flag are also reflected in the digital output terminal (A). In addition, the state of the digital input terminal (B) of the slave device is reflected in the “lower device connection flag”, and the state of the digital input terminal (A) of the slave device is reflected in the “upper device state flag”. Has been.

より具体的には、スレーブB112の応答電文の“ノードID設定完了フラグ”と“下段装置接続フラグ”と“上段装置状態フラグ”には、それぞれ、デジタル出力端子(A)116の状態(デジタル入力端子(A)119の入力値)、デジタル入力端子(B)117の状態(接続指示出力端子120の出力値)、デジタル入力端子(A)113の状態(デジタル出力端子(A)110の状態)が反映されている。スレーブA106の応答電文とスレーブC118の応答電文も同様である。   More specifically, the “node ID setting completion flag”, “lower device connection flag”, and “upper device status flag” of the response message of the slave B112 are respectively set to the status of the digital output terminal (A) 116 (digital input). Terminal (A) 119 input value), digital input terminal (B) 117 state (connection instruction output terminal 120 output value), digital input terminal (A) 113 state (digital output terminal (A) 110 state) Is reflected. The same applies to the response message of slave A106 and the response message of slave C118.

これにより、マスタ装置は、スレーブB112の応答電文から、スレーブA106のノードIDの設定状態と、スレーブC118のスレーブ装置接続有無とノードIDの設定完了通知とを検知することができる。つまり、マスタ装置は、特定スレーブの応答電文から、応答した特定スレーブの上段と下段のスレーブ装置の状態も同時に把握することができる。   As a result, the master device can detect the node ID setting state of the slave A 106, the presence / absence of the slave device connection of the slave C 118, and the node ID setting completion notification from the response message of the slave B 112. That is, the master device can simultaneously grasp the states of the upper and lower slave devices that have responded from the response message of the specific slave.

つぎに、上記フラグ・フィールドを参照したスレーブ装置のノードIDの設定・追加・異常検出の実施内容を図3〜10により、詳細に説明する。   Next, the contents of setting / addition / abnormality detection of the node ID of the slave device referring to the flag field will be described in detail with reference to FIGS.

まず、ノードIDの前提となる規約について、説明する。
ノードIDは、スレーブ装置のそれぞれでユニークな値が割り当てられる。本実施例のネットワークシステムはシングルマスタ方式の通信をおこなっており、マスタ装置のノードIDには、固定値“0”が割り当てられている。そして、すべてのノードを対象とすることを意味するブロードキャストID“255”を用意している。さらに、詳細は後述するが、スレーブ装置は、マスタ装置からノードIDが割り当てられるまでは、ノードID“254”が設定されているものとする。上記を前提に、図3により、ノードIDの設定シーケンスを説明する。
First, the rules that are the premise of the node ID will be described.
The node ID is assigned a unique value for each slave device. The network system of the present embodiment performs single master communication, and a fixed value “0” is assigned to the node ID of the master device. A broadcast ID “255”, which means that all nodes are targeted, is prepared. Further, although details will be described later, it is assumed that the node ID “254” is set in the slave device until the node ID is assigned from the master device. Based on the above, the node ID setting sequence will be described with reference to FIG.

(動作シーケンス)
図3は、マスタ装置とスレーブ装置間のノードIDの設定シーケンスを示した図で、マスタ装置とスレーブ装置A・B・Cとの間の通信ラインと下段装置接続信号と上段装置状態信号の動作シーケンスを、時間変化を紙面の下方向に表わしたシーケンス図である。
マスタ装置の詳細な動作フローとスレーブ装置の詳細な動作フローは後述する。
(Operation sequence)
FIG. 3 is a diagram showing a node ID setting sequence between the master device and the slave device, and the operation of the communication line, the lower device connection signal, and the upper device state signal between the master device and the slave devices A, B, and C. FIG. 4 is a sequence diagram showing a time change in a downward direction on the paper.
A detailed operation flow of the master device and a detailed operation flow of the slave device will be described later.

本実施例では、マスタ装置のノードIDを固定値“0”としているので、常にノードID設定完了とみなすことができ、デジタル出力端子(A)103に上段装置ID設定完を出力する。マスタ装置のデジタル出力端子(A)103は、上段装置状態信号としてスレーブ装置Aにデイジーチェーン接続され、上段装置ID設定完を通知する(S300)。
つぎに、マスタ装置は、デジタル入力端子(B)をモニタして、下段装置が接続されているか否かの判定をおこなう(S301)。デジタル入力端子(B)には下段装置接続信号でスレーブ装置A106がデイジーチェーン接続しており、下段装置接続状態と判定される。
In this embodiment, since the node ID of the master device is a fixed value “0”, it can always be considered that the node ID setting is completed, and the upper device ID setting completion is output to the digital output terminal (A) 103. The digital output terminal (A) 103 of the master device is daisy chain connected to the slave device A as an upper device status signal and notifies the completion of the upper device ID setting (S300).
Next, the master device monitors the digital input terminal (B) and determines whether or not the lower device is connected (S301). The slave device A106 is daisy chain connected to the digital input terminal (B) by the lower device connection signal, and it is determined that the lower device is connected.

図示していないが、この時点で、マスタ装置が接続するスレーブ装置に設定されているノードIDのクリアを要求する“ノードIDクリア要求コマンド”を通知するようにしてもよい。特に、ネットワークシステムの稼働中にノードIDの再割当をおこなう際に必要となる。この場合には、宛先のノードIDをブロードキャストID“255”として、“ノードIDクリア要求コマンド”を通知する。   Although not shown, at this time, a “node ID clear request command” for requesting clear of the node ID set in the slave device to which the master device is connected may be notified. This is especially necessary when reassigning node IDs during network system operation. In this case, the node ID of the destination is set to the broadcast ID “255”, and a “node ID clear request command” is notified.

マスタ装置は、上記の下段装置接続状態の判定(S301)の後に、宛先ノードIDを“254”とした“イニシャル要求コマンド”を出力する(S302)。このコマンドは、共有バス接続するスレーブ装置A・B・Cに差動シリアルライン105を介して通知される。
“イニシャル要求コマンド”を受けたスレーブ装置A・B・Cのそれぞれは、デジタル入力端子(A)をモニタし、デイジーチェーン接続した上段装置がノードIDの設定を完了しているか否かを判定する(S303)。
After the determination of the lower device connection state (S301), the master device outputs an “initial request command” with the destination node ID set to “254” (S302). This command is notified via the differential serial line 105 to the slave devices A, B, and C connected to the shared bus.
Each of the slave devices A, B, and C that has received the “initial request command” monitors the digital input terminal (A) and determines whether or not the upper device connected in the daisy chain has completed the setting of the node ID. (S303).

この時点では、スレーブ装置A・B・CはノードIDの設定がおこなわれていない。マスタ装置に上段装置状態信号が接続しているスレーブ装置Aのみが“上段装置のノードID設定完”を検知し、スレーブ装置B・Cは“上段装置のノードID設定未完“を検知する。これにより、スレーブ装置Aのみが、自己がノードID設定等のイニシャル処理の対象と判断し、“イニシャル要求コマンド”のコマンド応答の電文を出力する(S304)。   At this time, the slave devices A, B, and C have not been set with node IDs. Only the slave device A, to which the upper device status signal is connected to the master device, detects “the node ID setting of the upper device is complete”, and the slave devices B and C detect “the node ID setting of the upper device is incomplete”. As a result, only the slave device A determines that it is the target of the initial process such as node ID setting, and outputs a command response message of the “initial request command” (S304).

コマンド応答を受信したマスタ装置は、この応答により、ノードIDが未設定のスレーブ装置が存在することを確認できる。つぎに、マスタ装置は、宛先ノードIDを“254”とした“ノードID設定コマンド”を出力する(S305)。このとき、電文のデータ部に、設定するノードID値(ID=1)を指定する。
この“ノードID設定コマンド”はスレーブ装置A・B・Cに通知されるが、先に、自己がノードID設定等のイニシャル処理の対象と判断したスレーブ装置Aのみが、ノードIDをID=1とするノードID設定をおこなう(S306)。
The master device that has received the command response can confirm from this response that there is a slave device with no node ID set. Next, the master device outputs a “node ID setting command” with the destination node ID set to “254” (S305). At this time, the node ID value to be set (ID = 1) is specified in the data portion of the message.
This “node ID setting command” is notified to the slave devices A, B, and C, but only the slave device A that has been determined to be the target of initial processing such as node ID setting first sets the node ID to ID = 1. Node ID setting is performed (S306).

スレーブ装置Aは、自己のノードID設定の後に、デジタル出力端子(A)に“上段装置ID設定完“を出力し、上段装置状態信号でデイジーチェーン接続されたスレーブ装置Bに、スレーブ装置AのノードID設定が完了したことを通知する(S307)。
そして、スレーブ装置Aは、“ノードID設定コマンド”のコマンド応答の電文を出力する(S308)。このとき、図2bに示される応答電文の定型部のフラグ・フィールドはつぎのように設定される。
After setting the node ID of the slave device A, the slave device A outputs “upper device ID setting complete” to the digital output terminal (A), and the slave device B of the slave device A connected to the slave device B daisy chained by the upper device state signal. Notify that the node ID setting has been completed (S307).
Then, the slave device A outputs a command response message of “node ID setting command” (S308). At this time, the flag field of the fixed part of the response message shown in FIG. 2b is set as follows.

“ノードID設定完了フラグ”には、設定完を表わす“1”が格納され、“上段装置状態フラグ”にも、正常を表わす“1”が格納される。スレーブ装置Aのデジタル入力端子(B)には、下段装置接続信号によりスレーブ装置Bの接続指示出力端子がデイジーチェーン接続されており、デジタル入力端子(B)をモニタすることで、“下段装置接続フラグ”には下段装置有を表わす“1”が格納される。   “Node ID setting completion flag” stores “1” indicating completion of setting, and “Upper stage device state flag” also stores “1” indicating normality. The connection instruction output terminal of the slave device B is daisy chained to the digital input terminal (B) of the slave device A by the lower device connection signal. By monitoring the digital input terminal (B), the “lower device connection” In the “flag”, “1” indicating that the lower device is present is stored.

“ノードID設定コマンド”のコマンド応答を受けたマスタ装置は、応答電文の“下段装置接続フラグ”を参照して、下段にスレーブ装置が接続されているか否かの判定をおこなう(S309)。応答電文の“下段装置接続フラグ”が“1”の場合には、再び、宛先ノードIDを“254”とした“イニシャル要求コマンド”を出力する(S310)。
このコマンドは、共有バス接続するスレーブ装置A・B・Cに通知されるが、スレーブ装置Aは、既に、ノードID(ID=1)が設定されているので、この“イニシャル要求コマンド”の電文を受信することはない。
The master device that has received the command response of the “node ID setting command” refers to the “lower device connection flag” in the response message and determines whether or not the slave device is connected to the lower device (S309). If the “lower device connection flag” in the response message is “1”, an “initial request command” with the destination node ID “254” is output again (S310).
This command is notified to the slave devices A, B, and C connected to the shared bus, but since the node ID (ID = 1) has already been set in the slave device A, the message of this “initial request command” Never receive.

“イニシャル要求コマンド”を受信したスレーブ装置B・Cのそれぞれは、デジタル入力端子(A)をモニタし、デイジーチェーン接続した上段装置がノードIDの設定を完了しているか否かを判定する(S311)。
この時点で、スレーブ装置AがノードID設定を完了し、“上段装置ID設定完”を上段装置状態信号に出力している(S307)ので、スレーブ装置Bは上段装置のノードID設定完”を検知する。スレーブ装置Cは“上段装置のノードID設定未完“を検知する。これにより、スレーブ装置Bは、自己がノードID設定等のイニシャル処理の対象と判断し、“イニシャル要求コマンド”のコマンド応答の電文を出力する(S312)。
Receiving the “initial request command”, each of the slave devices B and C monitors the digital input terminal (A) and determines whether the upper device connected in the daisy chain has completed the node ID setting (S311). ).
At this time, the slave device A completes the node ID setting and outputs “upper device ID setting complete” to the upper device status signal (S307), so that the slave device B sets the node ID of the upper device complete. The slave device C detects “the node ID setting of the upper device is incomplete”, whereby the slave device B determines that it is the target of the initial process such as node ID setting, and the “initial request command” command A response message is output (S312).

コマンド応答を受信したマスタ装置は、宛先ノードIDを“254”とした“ノードID設定コマンド”を出力する(S313)。このとき、電文のデータ部に、設定するノードID値(ID=2)を指定する。本実施例では、マスタ装置は、ID=1から順に大きくなるノードID値を割り当てるが、これに限られるものではなく、設定するスレーブ装置の間でユニークな値であればよい。   The master device that has received the command response outputs a “node ID setting command” with the destination node ID set to “254” (S313). At this time, the node ID value (ID = 2) to be set is specified in the data portion of the message. In this embodiment, the master device assigns node ID values that increase in order from ID = 1, but is not limited to this, and any value that is unique among the slave devices to be set may be used.

この“ノードID設定コマンド”はスレーブ装置A・B・Cに通知される。しかし、スレーブ装置Aは、既に、ノードID(ID=1)が設定されているため、前記“ノードID設定コマンド”を受信しない。したがって、先に、自己がノードID設定等のイニシャル処理の対象と判断したスレーブ装置Bのみが、ノードIDをID=2とするノードID設定をおこなう(S314)。   This “node ID setting command” is notified to the slave devices A, B, and C. However, since the node ID (ID = 1) has already been set, the slave device A does not receive the “node ID setting command”. Therefore, only the slave device B that is determined to be the target of the initial process such as node ID setting first performs node ID setting with the node ID set to ID = 2 (S314).

スレーブ装置Bは、自己のノードID設定の後に、デジタル出力端子(A)に“上段装置ID設定完“を出力し、上段装置状態信号でデイジーチェーン接続されたスレーブ装置Cに、スレーブ装置BのノードID設定が完了したことを通知する(S315)。
そして、スレーブ装置Bは、“ノードID設定コマンド”のコマンド応答の電文を出力する(S316)。このとき、図2bに示される応答電文の定型部のフラグ・フィールドはつぎのように設定される。
After setting the node ID of the slave device B, the slave device B outputs “upper device ID setting complete” to the digital output terminal (A), and the slave device B of the slave device B is connected to the slave device C daisy chained by the upper device state signal. Notify that the node ID setting has been completed (S315).
Then, the slave device B outputs a command response message of “node ID setting command” (S316). At this time, the flag field of the fixed part of the response message shown in FIG. 2b is set as follows.

“ノードID設定完了フラグ”には、設定完を表わす“1”が格納され、“上段装置状態フラグ”にも、正常を表わす“1”が格納される。スレーブ装置Bのデジタル入力端子(B)には、下段装置接続信号によりスレーブ装置Cの接続指示出力端子がデイジーチェーン接続されており、デジタル入力端子(B)をモニタすることで、“下段装置接続フラグ”には下段装置有を表わす“1”が格納される。   “Node ID setting completion flag” stores “1” indicating completion of setting, and “Upper stage device state flag” also stores “1” indicating normality. The connection instruction output terminal of the slave device C is daisy chained to the digital input terminal (B) of the slave device B by the lower device connection signal. By monitoring the digital input terminal (B), the “lower device connection” In the “flag”, “1” indicating that the lower device is present is stored.

“ノードID設定コマンド”のコマンド応答を受けたマスタ装置は、応答電文の“下段装置接続フラグ”を参照して、下段にスレーブ装置が接続されているか否かの判定をおこなう(S317)。応答電文の“下段装置接続フラグ”が“1”の場合には、再び、宛先ノードIDを“254”とした“イニシャル要求コマンド”を出力する(S318)。
このコマンドは、共有バス接続するスレーブ装置A・B・Cに通知されるが、既に、スレーブ装置AにはノードID(ID=1)が設定され、スレーブ装置BにはノードID(ID=2)が設定されているので、この“イニシャル要求コマンド”の電文を受信することはない。
The master device that has received the command response of the “node ID setting command” refers to the “lower device connection flag” in the response message and determines whether or not the slave device is connected to the lower device (S317). If the “lower device connection flag” of the response message is “1”, an “initial request command” with the destination node ID “254” is output again (S318).
This command is notified to the slave devices A, B, and C connected to the shared bus, but the node ID (ID = 1) is already set in the slave device A, and the node ID (ID = 2) is set in the slave device B. ) Is set, the message of this “initial request command” is never received.

“イニシャル要求コマンド”を受信したスレーブ装置Cは、デジタル入力端子(A)をモニタし、デイジーチェーン接続した上段装置がノードIDの設定を完了しているか否かを判定する(S319)。
この時点で、スレーブ装置BがノードID設定を完了し、“上段装置ID設定完”を上段装置状態信号に出力している(S315)ので、スレーブ装置Cは、上段装置のノードID設定完”を検知する。これにより、スレーブ装置Cは、自己がノードID設定等のイニシャル処理の対象と判断し、“イニシャル要求コマンド”のコマンド応答の電文を出力する(S320)。
The slave device C that has received the “initial request command” monitors the digital input terminal (A) and determines whether or not the upper device connected in the daisy chain has completed the setting of the node ID (S319).
At this time, the slave device B completes the node ID setting and outputs “upper device ID setting complete” to the upper device status signal (S315), so that the slave device C completes the node ID setting of the upper device. As a result, the slave device C determines that it is the target of initial processing such as node ID setting and outputs a command response message of the “initial request command” (S320).

コマンド応答を受信したマスタ装置は、宛先ノードIDを“254”とした“ノードID設定コマンド”を出力する(S321)。このとき、電文のデータ部に、設定するノードID値(ID=3)を指定する。   The master device that has received the command response outputs a “node ID setting command” with the destination node ID set to “254” (S321). At this time, the node ID value (ID = 3) to be set is specified in the data portion of the message.

この“ノードID設定コマンド”はスレーブ装置A・B・Cに通知される。しかし、既に、スレーブ装置AはノードIDがID=1に設定され、スレーブ装置BはノードIDがID=2に設定されているため、この“ノードID設定コマンド”を受信しない。したがって、先に、自己がノードID設定等のイニシャル処理の対象と判断したスレーブ装置Cのみが、ノードIDをID=3とするノードID設定をおこなう(S322)。   This “node ID setting command” is notified to the slave devices A, B, and C. However, since the node ID of the slave device A is already set to ID = 1 and the node ID of the slave device B is already set to ID = 2, this “node ID setting command” is not received. Therefore, only the slave device C that has been determined to be the target of initial processing such as node ID setting first performs node ID setting with the node ID set to ID = 3 (S322).

スレーブ装置Cは、自己のノードID設定の後に、デジタル出力端子(A)に“上段装置ID設定完“を出力する(図示せず)。スレーブ装置Cは、最下段のスレーブ装置となっているため、上位状態信号が接続されていない。
そして、スレーブ装置Cは、“ノードID設定コマンド”のコマンド応答の電文を出力する(S323)。このとき、図2bに示される応答電文の定型部のフラグ・フィールドはつぎのように設定される。
After setting the node ID of the slave device C, the slave device C outputs “upper device ID setting complete” to the digital output terminal (A) (not shown). Since the slave device C is the lowest-level slave device, the upper level signal is not connected.
Then, the slave device C outputs a command response message of “node ID setting command” (S323). At this time, the flag field of the fixed part of the response message shown in FIG. 2b is set as follows.

“ノードID設定完了フラグ”には、設定完を表わす“1”が格納され、“上段装置状態フラグ”にも、正常を表わす“1”が格納される。スレーブ装置Cは最下段のスレーブ装置のため、スレーブ装置Cのデジタル入力端子(B)には下段装置接続信号が接続されていない。このため、スレーブ装置Cのデジタル入力端子(B)は、下段装置が未接続の状態となっている。スレーブ装置Cは、デジタル入力端子(B)をモニタして、“下段装置接続フラグ”に下段装置無を表わす“0”を格納する。   “Node ID setting completion flag” stores “1” indicating completion of setting, and “Upper stage device state flag” also stores “1” indicating normality. Since the slave device C is the lowermost slave device, the lower device connection signal is not connected to the digital input terminal (B) of the slave device C. For this reason, the digital input terminal (B) of the slave device C is not connected to the lower device. The slave device C monitors the digital input terminal (B) and stores “0” representing the absence of the lower device in the “lower device connection flag”.

“ノードID設定コマンド”のコマンド応答を受けたマスタ装置は、応答電文の“下段装置接続フラグ”を参照して、下段にスレーブ装置が接続されているか否かの判定をおこなう(S324)。この時には、応答電文の“下段装置接続フラグ”が“0”となっているため、下段にはスレーブ装置が接続されていないと判断し、マスタ装置は、ノードIDの設定処理を終了する。   The master device that has received the command response of the “node ID setting command” refers to the “lower device connection flag” in the response message and determines whether or not the slave device is connected to the lower device (S324). At this time, since the “lower device connection flag” of the response message is “0”, it is determined that no slave device is connected to the lower device, and the master device ends the node ID setting process.

上記のとおり、本実施例のマスタスレーブシステムは、マスタ装置とスレーブ装置との間を、上段装置状態信号と下位装置接続信号でデイジーチェーン接続した。そして、上段装置状態信号をモニタして、上段装置がノードID設定完しているスレーブ装置のうちの最下段のスレーブ装置に接続するスレーブ装置が、つぎに、自己がノードID設定するスレーブ装置であると認識し、マスタ装置が出力する“ノードID設定コマンド”に基づいてノードID設定をおこなうようにした。さらに、スレーブ装置は、応答コマンドにより、下段装置の接続状態をマスタ装置に通知し、マスタ装置は、前記下段装置の接続状態を参照してスレーブ装置の有無を判断し、下段に接続するスレーブ装置がなくなるまで、スレーブ装置ごとに順にノードIDの設定をおこなうようにした。これにより、もれなくスレーブ装置にユニークなノードIDの設定をおこなうようにしたものである。   As described above, in the master-slave system of this embodiment, the master device and the slave device are daisy chain-connected using the upper device status signal and the lower device connection signal. Then, the slave device that monitors the upper device status signal and connects to the lowest slave device among the slave devices for which the upper device has completed the node ID setting is the slave device that itself sets the node ID. Recognized that there is a node ID is set based on the “node ID setting command” output by the master device. Further, the slave device notifies the master device of the connection status of the lower device by a response command, the master device refers to the connection status of the lower device, determines the presence or absence of the slave device, and connects to the lower device. The node ID is set for each slave device in order until there is no more. As a result, a unique node ID is set for the slave device.

図3のシーケンス図の説明では、イニシャル要求コマンドのコマンド応答(S304、S312、S320)について特に言及しながったが、イニシャル処理の結果を応答するようにしてもよい。例えば、エラー情報等の情報を応答電文に含ませることにより、マスタ装置でリトライ処理を指示することや、当該スレーブ装置を無効にして、ノードIDの割当処理を続ける等の処理をおこなうことができる。   In the description of the sequence diagram of FIG. 3, the command response (S304, S312, S320) of the initial request command is not particularly mentioned, but the result of the initial process may be returned. For example, by including information such as error information in the response message, it is possible to instruct retry processing on the master device, or to invalidate the slave device and continue the node ID assignment processing. .

また、図3に示したシーケンスでは、“イニシャル要求コマンド”とそのコマンド応答は、必須の処理ではない。スレーブ装置は、上段装置状態によって自己がつぎにノードID設定するスレーブ装置であることを認識するので、マスタ装置が出力する“ノードID設定コマンド”によるノードID設定が可能となっている。   In the sequence shown in FIG. 3, the “initial request command” and its command response are not essential processes. Since the slave device recognizes that it is the slave device that will next set the node ID depending on the state of the upper device, the node ID can be set by the “node ID setting command” output from the master device.

(スレーブ装置の処理フロー)
つぎに、図3のノードIDの設定シーケンスに対応するスレーブ装置の処理フローを図4により説明する。
(Slave device processing flow)
Next, the processing flow of the slave device corresponding to the node ID setting sequence of FIG. 3 will be described with reference to FIG.

自機のリセット処理あるいはマスタ装置からの“ノードIDクリア要求コマンド”により、スレーブ装置は、自機のノードIDを“254”に設定する(S401)。以降、宛先ノードIDが“254”の電文を受信する。前述のとおり、ノードID“254”はスレーブ装置のデフォルトのノードIDであり、マスタ装置からノードIDが割り当てられるまでは、ノードID“254”が設定されている。   The slave device sets the node ID of the own device to “254” by the reset processing of the own device or the “node ID clear request command” from the master device (S401). Thereafter, a message with the destination node ID “254” is received. As described above, the node ID “254” is the default node ID of the slave device, and the node ID “254” is set until the node ID is assigned from the master device.

つぎに、マスタ装置からの宛先ID=254の“イニシャル要求コマンド”の受信を待つ(S402)。
“イニシャル要求コマンド”を受信すると、自機のノードIDの設定状態とデジタル入力端子(A)をモニタして上段装置の状態を検出する(S403)。
Next, it waits for reception of an “initial request command” with destination ID = 254 from the master device (S402).
When the “initial request command” is received, the node ID setting state of the own device and the digital input terminal (A) are monitored to detect the state of the upper device (S403).

自機のノードIDの設定状態と上段装置の状態を判定し(S404)、自機のノードIDの設定が未完(X=0)、かつ、上段装置のID設定状態が設定未完(Y=0)の場合には、上段装置のノードID設定はまた完了していない判断し(S405)、マスタ装置からの“イニシャル要求コマンド”には応答しない(S406)。そして、一定時間の経過待ち後に(S407)、“イニシャル要求コマンド”の受信待ち(S402)に戻る。   Determines the node ID setting status and the upper device status of the own device (S404), the node ID setting of the own device is incomplete (X = 0), and the ID setting status of the upper device is incomplete (Y = 0) ), It is determined that the node ID setting of the upper device has not been completed (S405), and no response is made to the “initial request command” from the master device (S406). Then, after waiting for the elapse of a certain time (S407), the process returns to waiting for reception of the “initial request command” (S402).

(S404)で、自機のノードIDの設定が未完(X=0)、かつ、上段装置のID設定状態が設定完(Y=1)の場合には、上段装置のノードID設定が完了していると判断し(S408)、マスタ装置の“イニシャル要求コマンド”に対するコマンド応答をおこなう(S409)。この後、マスタ装置からの“ノードID設定コマンド”の受信を待つ(S410)。   In (S404), if the node ID setting of the own device is incomplete (X = 0) and the ID setting state of the upper device is complete (Y = 1), the node ID setting of the upper device is completed. (S408), a command response to the “initial request command” of the master device is made (S409). Thereafter, it waits for reception of a “node ID setting command” from the master device (S410).

マスタ装置からの“ノードID設定コマンド”を受信すると、電文に指定されたノードID値に自己のノードIDを変更する(S411)。この後、デジタル出力端子(A)に“上段装置ID設定完”を出力し、上段装置状態信号で接続された下段スレーブ装置に状態変化を通知する(S412)。つぎに、デジタル入力端子(B)をモニタし、下段装置の接続状態を検出して、コマンド応答電文のフラグ・フィールドの“下段装置接続フラグ”に格納する値を求める。下段にスレーブ装置が接続されていれば、下段装置接続フラグ”には下段装置有を表わす“1”が格納される(S413)。   When the “node ID setting command” is received from the master device, its own node ID is changed to the node ID value specified in the message (S411). Thereafter, “upper device ID setting complete” is output to the digital output terminal (A), and the lower slave device connected by the upper device state signal is notified of the state change (S412). Next, the digital input terminal (B) is monitored, the connection state of the lower device is detected, and the value stored in the “lower device connection flag” in the flag field of the command response message is obtained. If the slave device is connected to the lower row, “1” indicating that the lower device is present is stored in the lower device connection flag ”(S413).

フラグ・フィールドの“ノードID設定完了フラグ”と“上段装置状態フラグ”も所定の値が格納されて、コマンド応答電文が作成され、マスタ装置に出力される(S414)。上記の処理によりスレーブ装置のノードIDの設定をおこなう。   Predetermined values are also stored in the “node ID setting completion flag” and “upper apparatus status flag” in the flag field, and a command response message is created and output to the master apparatus (S414). The slave device node ID is set by the above processing.

図4のフロー図では、“イニシャル要求コマンド”の受信により上段装置のノードIDの設定状態を判定しているが、“ノードID設定コマンド”の受信により、上段装置のノードIDの設定状態を判定し、設定完であれば、自機のノードIDの設定をおこなうようにしてもよい。   In the flowchart of FIG. 4, the node ID setting state of the upper device is determined by receiving the “initial request command”, but the node ID setting state of the upper device is determined by receiving the “node ID setting command”. However, if the setting is complete, the node ID of the own device may be set.

(マスタ装置の処理フロー)
つぎに、図3のノードIDの設定シーケンスに対応するマスタ装置の処理フローを図5により説明する。この処理は、実施例のマスタスレーブシステムが初期起動するときや、システム起動後に、マスタ装置が再起動する際に実行される。マスタ装置が再起動する場合には、図5のフロー図を実行する前に、全スレーブ装置に全スレーブ機器に対し、現在設定されているノードIDとROM上に格納されているノードIDを全てクリアする“ノードIDクリア要求コマンド”を発行する。
(Processing flow of master device)
Next, a processing flow of the master apparatus corresponding to the node ID setting sequence of FIG. 3 will be described with reference to FIG. This process is executed when the master / slave system of the embodiment is initially started or when the master device is restarted after the system is started. When the master device restarts, before executing the flow chart of FIG. 5, all the node IDs currently stored in the slave devices and all the node IDs stored in the ROM are stored in all the slave devices. Issue a “node ID clear request command” to clear.

マスタ装置はノードID設定のための処理の初めに、スレーブ装置台数の管理数を0に初期設定する。そして、マスタ装置のデジタル出力端子(A)に上段装置ID設定完を出力し、デイジーチェーン接続するスレーブ装置に上段装置接続状態を通知する(S501)。
つぎに、マスタ装置は、デジタル入力端子(B)をモニタして、下段装置が接続されているかの判定をおこなう(S502)。マスタ装置のデジタル入力端子(B)に下段装置接続信号を介してスレーブ装置Aがデイジーチェーン接続されていれば下段装置接続状態と判定され、S504に進む。
At the beginning of the process for setting the node ID, the master device initializes the number of managed slave devices to zero. Then, the upper apparatus ID setting completion is output to the digital output terminal (A) of the master apparatus, and the upper apparatus connection state is notified to the slave apparatus connected in the daisy chain (S501).
Next, the master device monitors the digital input terminal (B) and determines whether the lower device is connected (S502). If the slave device A is daisy chain connected to the digital input terminal (B) of the master device via the lower device connection signal, it is determined that the lower device is connected, and the process proceeds to S504.

下段装置の接続がなければ一定時間経過後(S503)、再度、デジタル入力端子(B)をモニタして、下段装置が接続されているかの判定をおこなう(S502)。図示していないが、所定回数接続確認をおこなっても、下段装置の接続が確認できなければ、マスタ装置はスレーブ装置が未接続として処理を終了する。   If the lower apparatus is not connected, after a predetermined time has elapsed (S503), the digital input terminal (B) is monitored again to determine whether the lower apparatus is connected (S502). Although not shown, if the connection of the lower device cannot be confirmed even if the connection confirmation is performed a predetermined number of times, the master device terminates the process because the slave device is not connected.

S504で、マスタ装置は、接続するスレーブ装置に、宛先ノードIDを“254”とした“イニシャル要求コマンド”を出力する。前述のとおりこのコマンドは、接続するすべてのスレーブ装置に通知されるが、デイジーチェーン接続した上段装置がノードIDの設定を完了しているスレーブ装置のみが、“イニシャル要求コマンド”の応答をおこなう。   In S504, the master device outputs an “initial request command” with the destination node ID “254” to the slave device to be connected. As described above, this command is notified to all the slave devices to be connected, but only the slave device whose node ID has been set by the upper device connected in the daisy chain responds with an “initial request command”.

マスタ装置は、スレーブ装置からの応答を確認し(S505)、応答があった場合には、S506に進む。応答がなかった場合には、“イニシャル要求コマンド”の通知リトライ処理を2回まで実施する(S507)(S508)。
S508で、2回リトライしても応答がなかった場合には、ノードID設定の異常としてログ出力をおこない(S513)、システム稼働不可として終了する(S514)。
The master device confirms the response from the slave device (S505). If there is a response, the master device proceeds to S506. When there is no response, notification retry processing of “initial request command” is executed up to two times (S507) (S508).
In S508, if there is no response even after two retries, a log output is performed as an abnormal node ID setting (S513), and the system operation is terminated (S514).

S506で、マスタ装置は、宛先ノードIDを“254”とした“ノードID設定コマンド”を出力する。このとき、電文のデータ部に、設定するノードID値を指定する。指定するID値は、マスタ装置が、スレーブ装置ごとにユニークなID値となるように割り振る。例えば、ID=1から順に増加する整数値を割り振る。前述のとおりこのコマンドは、接続するすべてのスレーブ装置に通知されるが、自己がノードID設定等のイニシャル処理の対象と判断したスレーブ装置(デイジーチェーン接続した上段装置がノードIDの設定を完了しているスレーブ装置)のみが、指定されたノードIDの設定をおこない、“ノードID設定コマンド”のコマンド応答をおこなう。   In S506, the master device outputs a “node ID setting command” with the destination node ID set to “254”. At this time, the node ID value to be set is specified in the data portion of the message. The ID value to be specified is allocated so that the master device has a unique ID value for each slave device. For example, an integer value that sequentially increases from ID = 1 is allocated. As mentioned above, this command is sent to all connected slave devices, but the slave device that it has determined to be the target of initial processing such as node ID setting (the upper device connected in a daisy chain completes the node ID setting). Only the slave device) sets the specified node ID and sends a command response of the “node ID setting command”.

マスタ装置は、スレーブ装置からのコマンド応答を確認し、応答電文のフラグ・フィールドのうち、“ノードID設定完了フラグ”が設定完を表わす“1”が格納されているか否かを確認する(S509)。ノードID設定完了フラグ”に設定完を表わす“1”が格納されていれば、S510に進む。また、コマンド応答がなかった場合や、“ノードID設定完了フラグ”に設定未完を表わす“0”が格納されていた場合には、“ノードID設定コマンド”の通知リトライ処理を2回まで実施する(S511)(S512)。   The master device confirms the command response from the slave device, and confirms whether or not “1” indicating that the “node ID setting completion flag” indicates the setting completion is stored in the flag field of the response message (S509). ). If “1” indicating completion of setting is stored in the “node ID setting completion flag”, the process proceeds to S510, and if there is no command response, “0” indicating incomplete setting in the “node ID setting completion flag”. Is stored, the notification retry processing of the “node ID setting command” is executed up to twice (S511) (S512).

S512で、2回リトライしても応答がなかった場合には、ノードID設定の異常としてログ出力をおこない(S513)、システム稼働不可として終了する(S514)。   If there is no response after two retries in S512, a log output is made as an abnormal node ID setting (S513), and the system operation is terminated (S514).

S510で、マスタ装置は、接続するひとつのスレーブ装置のノードID設定が完了したものとして、スレーブ装置台数の管理数を1インクリメントする。
つぎに、先に受信した“ノードID設定コマンド”のコマンド応答の応答電文のフラグ・フィールドの“下段装置接続フラグ”に下段装置有を表わす“1”が格納されているか否かを判定する(S515)。“下段装置接続フラグ”に下段装置無を表わす“0”が格納されていれば、すべてのスレーブ装置のノードID設定が完了したので、マスタ装置のイニシャル処理フローを終了する。
In S510, the master device assumes that the node ID setting of one slave device to be connected is completed, and increments the management number of the number of slave devices by one.
Next, it is determined whether or not “1” indicating the presence of the lower device is stored in the “lower device connection flag” in the flag field of the response message of the command response of the “node ID setting command” received earlier ( S515). If “0” representing the absence of the lower device is stored in the “lower device connection flag”, the node ID setting of all the slave devices has been completed, and the initial process flow of the master device is terminated.

S515で、“下段装置接続フラグ”に下段装置有を表わす“1”が格納されていれば、ノードIDが未設定のスレーブ装置が接続されているものと判断し、上記のS504からS510の処理フロー(図5の破線で囲まれた矩形領域の処理)をおこない、スレーブ装置にノードIDの設定をおこなう。
そして、S515で、応答電文のフラグ・フィールドの“下段装置接続フラグ”の判定をおこなう。
In S515, if “1” indicating that the lower device is present is stored in the “lower device connection flag”, it is determined that the slave device whose node ID is not set is connected, and the above processing from S504 to S510 is performed. A flow (processing of a rectangular area surrounded by a broken line in FIG. 5) is performed, and a node ID is set in the slave device.
In S515, the “lower device connection flag” in the flag field of the response message is determined.

S515で、最下段のスレーブ装置からの応答電文の“下段装置接続フラグ”には、下段装置無を表わす“0”が格納されているので、マスタ装置は、すべてのスレーブ装置のノードID設定をおこなうことができる。   In S515, the “lower device connection flag” in the response message from the lowermost slave device stores “0” indicating the absence of the lower device, so the master device sets the node IDs of all slave devices. Can be done.

このように、本実施例では、“上段装置のノードID設定完”を通知する上段装置状態信号と下段装置の有無を通知する下段装置接続信号とにより、マスタ装置と複数のスレーブ装置がデイジーチェーン接続されているので、マスタ装置に近いスレーブ装置から順にスレーブ装置台数分のノードIDの設定が行われる。   As described above, in the present embodiment, the master device and the plurality of slave devices are daisy chained by the upper device status signal for notifying the completion of the node ID setting of the upper device and the lower device connection signal for notifying the presence or absence of the lower device. Since they are connected, node IDs for the number of slave devices are set in order from the slave device closest to the master device.

(スレーブ装置の増設処理)
つぎに、本実施例のシステムが稼働中にスレーブ機器を増設した際のノードIDの割当処理を図6により説明する。
(Slave device expansion processing)
Next, a node ID assignment process when adding slave devices while the system of this embodiment is operating will be described with reference to FIG.

本実施例のスレーブ装置は、図1に示されるように、上段装置状態信号と下段装置接続信号とによりデイジーチェーン接続されている。このため、スレーブ装置の増設は、最下段のスレーブ装置に、新たなスレーブ装置を上段装置状態信号と下段装置接続信号により接続することによりおこなわれる。   As shown in FIG. 1, the slave devices of this embodiment are daisy chain-connected by an upper device status signal and a lower device connection signal. For this reason, the expansion of the slave device is performed by connecting a new slave device to the lowermost slave device by the upper device status signal and the lower device connection signal.

本実施例のマスタスレーブシステムは、ポーリング方式により通信をおこなっており、スレーブ装置の応答電文のフラグ・フィールドの“下段装置接続フラグ”により、下段装置の接続判定をおこなえることは上述のとおりである。したがって、P台のスレーブ装置が接続されている状態で、スレーブ装置が追加された場合には、最下段のスレーブ装置(ID=P)からの応答電文により、P+1台目のスレーブ装置の接続有無を判定できる。
詳しくは、マスタ装置は、図6に示す最下段のスレーブ装置(ID=P)への通信により、追加されたP+1台目のスレーブ装置のノードIDの設定処理をおこなう。
The master-slave system of this embodiment communicates by the polling method, and as described above, it is possible to determine the connection of the lower device by the “lower device connection flag” in the flag field of the response message of the slave device. . Therefore, when a slave device is added while P slave devices are connected, the response message from the lowest slave device (ID = P) indicates that the P + 1 slave device Can determine whether a connection is present.
Specifically, the master device performs a node ID setting process for the added P + 1 slave device by communication with the lowest slave device (ID = P) shown in FIG.

マスタ装置は、まず、宛先ID=P(最下段のスレーブ装置)へコマンド・データ電文を送信する(S601)。つぎに、スレーブ装置(ID=P)からのコマンド応答を待ち、応答電文のフラグ・フィールドの“下段装置接続フラグ”に、下段装置有を表わす“1”が格納されているか否かを判定する(S602)。“下段装置接続フラグ”に下段装置無を表わす“0”が格納されていれば、“スレーブ装置の増設無”と判断し(S604)、最下段のスレーブ装置への通信を終了する。   First, the master device transmits a command / data message to destination ID = P (the lowest slave device) (S601). Next, it waits for a command response from the slave device (ID = P), and determines whether or not “1” indicating that the lower device is present is stored in the “lower device connection flag” in the flag field of the response message. (S602). If “0” indicating that there is no lower device is stored in the “lower device connection flag”, it is determined that “there is no additional slave device” (S604), and the communication to the lowest slave device is terminated.

S602で、“下段装置接続フラグ”に下段装置有を表わす“1”が格納されていれば、ノードIDが未設定のスレーブ装置が接続されているものと判断し、増設されたスレーブ装置のイニシャル処理とノードIDの割当処理をおこない、マスタ装置のスレーブ装置接続管理台数を更新する(S603)。具体的には、スレーブ装置の台数がPのときに1台のスレーブ装置が増設されると、図6の処理フローにより、追加されたスレーブ装置のノードID値がID=P+1に設定され、マスタ装置のスレーブ装置管理台数はP+1台に更新される。   In S602, if “1” indicating that the lower device is present is stored in the “lower device connection flag”, it is determined that the slave device whose node ID is not set is connected, and the added slave device is initialized. Processing and node ID assignment processing are performed to update the number of slave device connection management units of the master device (S603). Specifically, when one slave device is added when the number of slave devices is P, the node ID value of the added slave device is set to ID = P + 1 by the processing flow of FIG. The slave device management number of the master device is updated to P + 1.

つぎに、図6のS603の増設スレーブ装置のイニシャル処理の詳細を図7により説明する。
図7は、マスタ装置が増設スレーブ装置のイニシャル処理・ノードID設定処理をおこなうフロー図を示したものである。
Next, details of the initial processing of the additional slave device in S603 of FIG. 6 will be described with reference to FIG.
FIG. 7 shows a flowchart in which the master device performs the initial processing and node ID setting processing of the additional slave device.

増設スレーブ装置は、新たにシステムに追加されるものであり、自機のノードIDは“254”になっている。さらに、上段装置状態信号と下段装置接続信号によりデイジーチェーン接続する上段スレーブ装置は、既に、ノードID設定が完了しているので、上段装置状態信号から、上段装置のID設定状態が設定完であることが通知される。したがって、マスタ装置から宛先IDが“254”の“イニシャル要求コマンド”を受信すると、自機がノードID設定の対象であることが認識される。このとき、他のスレーブ装置は、既に、ノードIDが設定されているため、“イニシャル要求コマンド”を受信することはない。   The additional slave device is newly added to the system, and its own node ID is “254”. Furthermore, since the node ID setting has already been completed for the upper slave device connected in a daisy chain by the upper device status signal and the lower device connection signal, the ID setting status of the upper device is completely set from the upper device status signal. Be notified. Accordingly, when receiving an “initial request command” having a destination ID “254” from the master device, it is recognized that the own device is a node ID setting target. At this time, the other slave devices do not receive the “initial request command” because the node ID is already set.

図7の処理フロー図において、マスタ装置は、接続するスレーブ装置に、宛先ノードIDを“254”とした“イニシャル要求コマンド”を出力する(S504)。前述のとおり、このコマンドを受信した増設スレーブ装置がイニシャル処理とノードID設定処理を開始し、フローにしたがって処理される。処理内容は、図5に示したフローの点線で囲まれた部分と同じになるため、ここでは説明を省略する。   In the process flow diagram of FIG. 7, the master device outputs an “initial request command” with the destination node ID “254” to the slave device to be connected (S504). As described above, the additional slave device that has received this command starts the initial process and the node ID setting process, and is processed according to the flow. Since the processing content is the same as the portion surrounded by the dotted line in the flow shown in FIG. 5, the description is omitted here.

上記のとおり、スレーブ装置が増設されるときには、増設スレーブ装置のみにイニシャル処理・ノードID設定処理をおこなうことができる。このため、全スレーブ装置のノードIDの設定処理をおこなう必要がないため、システム処理を中断する必要がなく、短時間にスレーブ装置の追加処理をおこなうことができる。   As described above, when slave devices are added, initial processing and node ID setting processing can be performed only on the added slave devices. For this reason, since it is not necessary to perform the node ID setting process for all slave devices, it is not necessary to interrupt the system processing, and the slave device can be added in a short time.

(スレーブ装置の異常検知)
つぎに、システム稼働中にスレーブ機器の異常検知方法の処理を図8、9により説明する。
本実施例では、上述したノードID設定の実施例での上段装置状態信号の意味に加えて、“上段装置のノードID設定完”を通知する上段装置状態信号を、装置の状態を示す信号として使用し、信号の状態を応答電文の上段装置状態フラグに反映するようにする。本実施例は、スレーブ装置のノードIDが設定完了して上段装置状態信号に設定完を表わす“1”が出力された後に、当該スレーブ装置で異常処理状態が生じると、上段装置状態信号が設定未完を表わす“0”にリセットするものである。また、当該スレーブ装置が内部異常によりリブート処理によっても、設定未完を表わす“0”にリセットするものである。応答電文の上段装置状態フラグも同様に変化する。
別の言い方をすれば、“上段装置のノードID設定完“とスレーブ装置の異常処理状態を重畳して上段装置状態信号に出力するものである。
なお、上述のとおり、上段装置状態信号は下段のスレーブ装置がノードIDを設定する際に参照される。したがって、ノードIDの設定後に変化しても、下段のスレーブ装置のノードIDの設定には影響しない。
(Slave device error detection)
Next, processing of the slave device abnormality detection method during system operation will be described with reference to FIGS.
In this embodiment, in addition to the meaning of the upper device status signal in the node ID setting embodiment described above, the upper device status signal for notifying the “upper device node ID setting” is used as a signal indicating the device status. Used to reflect the signal status in the upper device status flag of the response message. In this embodiment, after the node ID of the slave device is set and “1” indicating the setting completion is output to the upper device status signal, when an abnormal processing state occurs in the slave device, the upper device status signal is set. It is reset to “0” indicating incomplete. Also, the slave device is reset to “0” indicating incomplete setting even by reboot processing due to an internal abnormality. The upper device status flag of the response message changes similarly.
In other words, the node ID setting completion of the upper device and the abnormal processing state of the slave device are superimposed and output to the upper device state signal.
As described above, the upper device status signal is referred to when the lower slave device sets the node ID. Therefore, even if it changes after the node ID is set, it does not affect the node ID setting of the slave device in the lower stage.

スレーブ装置の異常状態の検出には、当該スレーブ装置からのポーリング応答が規定回数以上ない場合と、当該スレーブ装置の下段スレーブ装置のポーリング応答の電文の“上段装置状態フラグ”が異常状態を示す場合の2つがある。ID=nのスレーブ装置の前者をリトライ超過フラグROV(n)とし、後者を上段装置状態フラグ(n)flagとする。   To detect an abnormal state of a slave device, when the polling response from the slave device does not exceed the specified number of times, and when the “upper device status flag” in the polling response message of the lower slave device of the slave device indicates an abnormal state There are two. The former of the slave device with ID = n is the retry excess flag ROV (n), and the latter is the upper device state flag (n) flag.

図8は、ID=nのスレーブ装置のリトライ超過フラグROV(n)と上段装置状態フラグ(n)flagの取得方法を説明するためのフロー図である。
マスタ装置は、ID=nのスレーブ装置にコマンド/データ電文を送信し(S801)、スレーブ装置からの応答を待つ(S802)。応答がない場合には、S801のコマンド/データ電文の送信のリトライ処理をおこなう(S804、S805)。
FIG. 8 is a flowchart for explaining a method of acquiring the retry excess flag ROV (n) and the upper device status flag (n) flag of the slave device with ID = n.
The master device transmits a command / data message to the slave device with ID = n (S801), and waits for a response from the slave device (S802). If there is no response, retry processing of transmission of the command / data message in S801 is performed (S804, S805).

リトライ処理をおこなってもスレーブ装置からの応答がない場合には、リトライ超過フラグROV(n)に、リトライエラーを示す“1“をセットする。このとき、スレーブ装置から応答電文がないので“上段装置状態フラグ“の検出ができない。したがって、上段装置状態フラグ(n-1)flagは不定となる(S806)。   If there is no response from the slave device even after retry processing, “1” indicating a retry error is set in the retry excess flag ROV (n). At this time, since there is no response message from the slave device, the “upper device status flag” cannot be detected. Therefore, the upper apparatus state flag (n-1) flag is indefinite (S806).

S802で、スレーブ装置から応答があった場合には、応答電文のフラグ・フィールドを参照して“上段装置状態フラグ”を検出し、上段装置状態フラグ(n-1)flagを取得する(S803)。つぎに、取得した上段装置状態フラグ(n-1)flagが、正常状態(ID設定完)を表わす“1”であるか否かを判定する(S807)。
正常状態である場合には、上段装置状態フラグ(n-1)flagに“1”を設定する。この場合には、スレーブ装置から応答があったので、リトライ超過フラグROV(n)は“0”に設定する(S808)。
S807で、異常状態である場合には、上段装置状態フラグ(n-1)flagに“0”を設定し、リトライ超過フラグROV(n)も“0”に設定する(S809)。
If there is a response from the slave device in S802, the “upper device status flag” is detected by referring to the flag field of the response message, and the upper device status flag (n−1) flag is acquired (S803) . Next, it is determined whether or not the acquired upper apparatus state flag (n−1) flag is “1” indicating a normal state (ID setting complete) (S807).
In the normal state, “1” is set to the upper apparatus state flag (n−1) flag. In this case, since there is a response from the slave device, the retry excess flag ROV (n) is set to “0” (S808).
In S807, if it is an abnormal state, “0” is set to the upper apparatus state flag (n−1) flag, and the retry excess flag ROV (n) is also set to “0” (S809).

上述した図8のフローにより、上段装置状態フラグ(n-1)flagとリトライ超過フラグROV(n)を取得できる。上段装置状態フラグ(n)flagは、異常検知をおこなうスレーブ装置の下段のスレーブ装置に対して同様の処理をおこなうことにより取得できる。
つまり、当該スレーブ装置と隣接するスレーブ装置の応答から、上段装置状態フラグ(n-1)flag、(n)flag、とリトライ超過フラグROV(n)、ROV(n+1)を取得し、このうち、上段装置状態フラグ(n)flagとリトライ超過フラグROV(n)からID=nのスレーブ装置の異常状態を判定し、スレーブ装置の復帰処理をおこなう。
The upper apparatus state flag (n−1) flag and the retry excess flag ROV (n) can be acquired by the flow of FIG. 8 described above. The upper device status flag (n) flag can be obtained by performing the same process on the slave device at the lower level of the slave device that performs abnormality detection.
That is, from the response of the slave device adjacent to the slave device, the upper device status flag (n-1) flag, (n) flag, and retry excess flags ROV (n), ROV (n + 1) are obtained, Among them, the abnormal state of the slave device with ID = n is determined from the upper device state flag (n) flag and the retry excess flag ROV (n), and the recovery processing of the slave device is performed.

図9により、取得した上段装置状態フラグ(n)flagとリトライ超過フラグROV(n)の組み合わせによる復帰処理を説明する。
この組み合わせのうち、上段装置状態フラグ(n)flagが“1”で、かつ、リトライ超過フラグROV(n)が“0”の場合は、正常状態であり、復帰処理はおこなわない。
With reference to FIG. 9, the return process by the combination of the acquired upper apparatus state flag (n) flag and the retry excess flag ROV (n) will be described.
In this combination, when the upper apparatus state flag (n) flag is “1” and the retry excess flag ROV (n) is “0”, the state is normal and the return process is not performed.

リトライ超過フラグROV(n)が“0”、かつ、上段装置状態フラグ(n)flagが“0”の場合、ID=nのスレーブ装置は初期状態に戻っている可能性があるため、イニシャル処理を実施する。リトライ超過フラグROV(n)が“1”、かつ、上段装置状態フラグ(n)flagが“0”の場合も同様に、イニシャル処理を実施する。これは、スレーブ装置自身のエラーリカバリ機能によりリセット処理がおこなわれたことを想定している。   If the retry excess flag ROV (n) is “0” and the upper device status flag (n) flag is “0”, the slave device with ID = n may have returned to the initial state, so initial processing To implement. Similarly, the initial process is performed when the retry excess flag ROV (n) is “1” and the upper apparatus state flag (n) flag is “0”. This assumes that the reset processing has been performed by the error recovery function of the slave device itself.

リトライ超過フラグROV(n)が“1”、かつ、上段装置状態フラグ(n)flagが“1”の場合、スレーブ装置がフリーズ状態にある可能性があるため、スレーブ装置をリセットし、その後、イニシャル処理をおこなうようにする。ここで、スレーブ装置のリセットとは、装置の動作状態を電源投入時等の初期状態に戻すこと意味し、イニシャル処理はスレーブ装置の初期設定処理を意味する。
上記のように、下段のスレーブ装置の応答電文に下段スレーブ装置が接続する上段スレーブ装置の装置状態を示す“上段装置状態フラグ“を設けることにより、スレーブ装置の異常状態からの復帰を適切におこなえるため、マスタスレーブシステムの信頼性が向上する。
If the retry excess flag ROV (n) is “1” and the upper device state flag (n) flag is “1”, the slave device may be in a frozen state. Perform initial processing. Here, resetting the slave device means returning the operation state of the device to an initial state such as when the power is turned on, and initial processing means initial setting processing of the slave device.
As described above, by providing the “upper device status flag” indicating the device status of the upper slave device connected to the lower slave device in the response message of the lower slave device, it is possible to appropriately recover from the abnormal status of the slave device. Therefore, the reliability of the master / slave system is improved.

上記の実施例では、デイジーチェーン接続された直上の上段スレーブ装置の装置状態を応答電文の“上段装置状態フラグ”に反映する例を説明したが、デイジーチェーン接続された複数の上段スレーブ装置の装置状態を応答電文の“上段装置状態フラグ”に反映するようにしてもよい。この場合には、いずれかの上段スレーブ装置で異常が発生したかを調べる処理が必要となるが、ネットワークシステムとしての異常検知が早くなる効果がある。多くのスレーブ装置がデイジーチェーン接続されてポーリング方式により通信する場合には、その効果が顕著となる。以下に、その実施内容を詳細に説明する。   In the above embodiment, the example has been described in which the device status of the upper slave device immediately above connected in a daisy chain is reflected in the “upper device status flag” of the response message, but the devices of a plurality of upper slave devices connected in a daisy chain are described. The state may be reflected in the “upper apparatus state flag” of the response message. In this case, it is necessary to perform processing to check which abnormality has occurred in any of the upper slave devices, but there is an effect that the abnormality detection as a network system is accelerated. When many slave devices are connected in a daisy chain and communicate by the polling method, the effect becomes remarkable. Below, the implementation content is demonstrated in detail.

図10は、上段装置状態信号の出力回路構成の概要を説明する図である。図1のシステム構成に対応して、スレーブBとスレーブCの内部構成を示しているが、スレーブAも同様の構成をもつ。ここでは、スレーブBの内部構成を説明するが、スレーブA、Cも同様の構成・機能をもつ。   FIG. 10 is a diagram for explaining the outline of the output circuit configuration of the upper device status signal. Corresponding to the system configuration of FIG. 1, the internal configurations of slave B and slave C are shown, but slave A also has the same configuration. Here, the internal configuration of the slave B will be described, but the slaves A and C also have the same configuration and function.

上述のとおり、スレーブ(B)112のデジタル入力端子(A)113には、デイジーチェーン接続するスレーブAの上段装置状態信号が接続され、スレーブAの状態(ノードID設定の完了状態)が通知されている。スレーブ(B)のノードIDの設定処理時にノードID設定部は、この信号と、デジタル入力端子(B)117から入力される下段装置接続信号により通知される下段装置の接続指示により、自機のノードID設定をおこない、デジタル出力端子(A)116にノードIDの設定完を出力している。   As described above, the digital input terminal (A) 113 of the slave (B) 112 is connected to the upper device status signal of the slave A connected in a daisy chain, and the status of the slave A (node ID setting completion status) is notified. ing. During the node (ID) setting process of the slave (B), the node ID setting unit uses the lower device connection instruction notified by this signal and the lower device connection signal input from the digital input terminal (B) 117 to Node ID setting is performed, and node ID setting completion is output to the digital output terminal (A) 116.

本実施例は、デジタル出力端子(A)116に、ノードID設定部の設定状態とスレーブ装置の内部異常検出部の検出状態とデジタル入力端子(A)113の状態の論理積(AND)を出力するようにする。これにより、デジタル出力端子(A)116に、スレーブ(B)のノードIDの設定完の状態と内部異常検出状態を出力するとともに、デジタル入力端子(A)の状態をデジタル出力端子(A)に出力する。つまり、スレーブ(A)106もスレーブ(B)112と同様の構成としているので、スレーブ(A)の内部異常検出状態が、スレーブ(B)112のデジタル出力端子(A)116に出力されることになる。   In this embodiment, the logical product (AND) of the setting state of the node ID setting unit, the detection state of the internal abnormality detection unit of the slave device, and the state of the digital input terminal (A) 113 is output to the digital output terminal (A) 116. To do. As a result, a node ID setting completion state and an internal abnormality detection state of the slave (B) are output to the digital output terminal (A) 116, and the state of the digital input terminal (A) is output to the digital output terminal (A). Output. That is, since the slave (A) 106 has the same configuration as the slave (B) 112, the internal abnormality detection state of the slave (A) is output to the digital output terminal (A) 116 of the slave (B) 112. become.

そして、スレーブ(B)112のデジタル出力端子(A)116は、スレーブ(C)118のデジタル入力端子(A)119に上段装置状態信号を介してデイジーチェーン接続され、スレーブ(C)118の応答電文の“上段装置状態フラグ”に反映される。
これにより、スレーブ(C)118の応答電文の“上段装置状態フラグ”は、スレーブ(A)106の内部異常検出状態、または、スレーブ(B)112の内部異常検出状態を示すことができる。以上により、直上のスレーブ装置の異常状態だけでなく、上段にデイジーチェーン接続された複数のスレーブ装置の異常状態を下段のスレーブ装置の応答から検知することができる。
The digital output terminal (A) 116 of the slave (B) 112 is daisy chained to the digital input terminal (A) 119 of the slave (C) 118 via the upper device status signal, and the response of the slave (C) 118 It is reflected in the “upper device status flag” in the message.
Thereby, the “upper apparatus state flag” in the response message of the slave (C) 118 can indicate the internal abnormality detection state of the slave (A) 106 or the internal abnormality detection state of the slave (B) 112. As described above, it is possible to detect not only the abnormal state of the slave device directly above but also the abnormal states of a plurality of slave devices connected in the daisy chain in the upper stage from the responses of the slave devices in the lower stage.

(実施例2)
つぎに、本発明をビル管理システムに適用した実施例を説明する。
図11は、ビル管理システムのシステム構成を示す図である。
接点モジュール25a〜27a、25b〜27bは、電力計や照度計等の計測センサが内蔵あるいは接続されたセンサモジュールで、計測データを例えば、フロアー毎に設けたホストコントローラ24a、24bに、差動シリアルネットワークa、bを介して、送信している。そして、接点モジュール25a〜27a、25b〜27bは、上段装置状態と下段装置状態を示す信号により、デイジーチェーン接続されている。図1のマスタ装置101がホストコントローラ24a、24bに対応し、スレーブ (A)106、スレーブ(B)112、スレーブ(C)118が、接点モジュール25a〜27a、25b〜27bに対応している。
(Example 2)
Next, an embodiment in which the present invention is applied to a building management system will be described.
FIG. 11 is a diagram illustrating a system configuration of a building management system.
The contact modules 25a to 27a and 25b to 27b are sensor modules with built-in or connected measurement sensors such as wattmeters and illuminance meters. The measurement data is differentially serialized to the host controllers 24a and 24b provided for each floor, for example. It is transmitted via networks a and b. The contact modules 25a to 27a and 25b to 27b are daisy chain connected by signals indicating the upper device state and the lower device state. 1 corresponds to the host controllers 24a and 24b, and the slave (A) 106, the slave (B) 112, and the slave (C) 118 correspond to the contact modules 25a to 27a and 25b to 27b.

ホストコントローラ24a、24bは、差動シリアルネットワークa、bに共有バス接続する接点モジュール25a〜27a、25b〜27bをポーリング方式のプロトコルでデータの送受信を行う。そして、ホストコントローラ24a、24bは、HUB23を介して、システム全体を統括し情報収集機能をもつサーバ22とユーザマンマシンとなるクライアントPC(21)に接続している。
ホストコントローラ24a、24bは、接点モジュール25a〜27a、25b〜27bに対して、上記の実施例で説明したノードID設定処理と増設処理、異常状態の検知とリカバリ処理をおこなう。
The host controllers 24a and 24b send and receive data to and from the contact modules 25a to 27a and 25b to 27b connected to the differential serial networks a and b by a shared bus using a polling protocol. The host controllers 24a and 24b are connected via a HUB 23 to a server 22 that controls the entire system and has an information collection function, and a client PC (21) that is a user machine.
The host controllers 24a, 24b perform the node ID setting process, the extension process, the abnormal state detection, and the recovery process described in the above embodiment for the contact modules 25a-27a, 25b-27b.

101 マスタ装置
102、109、115、121 シリアルポート
103、110、116、122 デジタル出力端子(A)
104、111、117、123 デジタル入力端子(B)
105 差動シリアルライン
106、112、118 スレーブ装置
107、113、119 デジタル入力端子A
108、114、120 接続指示出力端子
101 Master device 102, 109, 115, 121 Serial port 103, 110, 116, 122 Digital output terminal (A)
104, 111, 117, 123 Digital input terminal (B)
105 Differential serial line 106, 112, 118 Slave device 107, 113, 119 Digital input terminal A
108, 114, 120 Connection instruction output terminal

Claims (14)

マスタ装置と複数のスレーブ装置を有するマスタスレーブシステムは、
前記マスタ装置と前記スレーブ装置のそれぞれを共有バス接続するシリアル信号ラインと、
前記マスタ装置と前記スレーブ装置のそれぞれが前記マスタ装置を端にしてデイジーチェーン接続する信号ラインにより接続され、
前記シリアル信号ラインを介して通信される前記スレーブ装置の応答電文に、
前記信号ラインにより通知される他の装置の状態を示すフラグ情報が含まれる
ことを特徴とするマスタスレーブシステム。
A master-slave system having a master device and a plurality of slave devices,
A serial signal line for connecting each of the master device and the slave device via a shared bus;
Each of the master device and the slave device is connected by a signal line daisy chained with the master device as an end,
In the response message of the slave device communicated via the serial signal line,
A master-slave system comprising flag information indicating a state of another device notified by the signal line.
請求項1に記載のマスタスレーブシステムにおいて、
前記マスタ装置を端にしてデイジーチェーン接続する信号ラインは、
デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置側に接続された上段装置のノードID設定の完了状態を下段の装置に通知する上段装置状態信号のラインと、
デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置と反対側に接続された下段スレーブ装置の有無を上段装置に通知する下段装置接続信号のラインと
から成ることを特徴とするマスタスレーブシステム。
In the master-slave system according to claim 1,
The signal line daisy chained with the master device at the end is
The upper device status signal line for notifying the lower device of the completion status of the node ID setting of the upper device connected to the master device side of the master device or slave device connected in a daisy chain;
A master / slave system comprising: a master device connected in a daisy chain or a lower device connection signal line for notifying the upper device of the presence or absence of a lower slave device connected to the opposite side of the master device of the slave device.
請求項2に記載のマスタスレーブシステムにおいて、
前記スレーブ装置は、
共有バス接続するシリアル信号ラインにコマンドあるいはデータを送受する前記シリアルポートと、
前記上段装置状態信号に当該スレーブ装置のノードIDの設定完了状態を出力するデジタル出力端子(A)と、
前記上段装置状態信号により上段スレーブ装置のノードIDの設定完了状態をモニタするデジタル入力端子(A)と、
前記下段装置接続信号に当該スレーブ装置が接続されていることを指示する接続指示出力端子と、
前記下段装置接続信号により下段スレーブ装置の接続有無を確認するデジタル入力端子(B)と、を有し、
前記マスタ装置は、
共有バス接続するシリアル信号ラインとコマンドあるいはデータを送受する前記シリアルポートと、
前記上段装置状態信号に当該マスタ装置のノードIDの設定完了状態を出力するデジタル出力端子と、
前記下段装置接続信号に接続して下段のスレーブ装置の接続有無を確認するデジタル入力端子と、を備える
ことを特徴とするマスタスレーブシステム。
In the master slave system according to claim 2,
The slave device is
The serial port for sending and receiving commands or data to a serial signal line connected to a shared bus;
A digital output terminal (A) for outputting a node ID setting completion status of the slave device to the upper device status signal;
A digital input terminal (A) for monitoring the completion status of the node ID setting of the upper slave device by the upper device status signal;
A connection instruction output terminal for instructing that the slave apparatus is connected to the lower apparatus connection signal;
A digital input terminal (B) for confirming whether or not the lower slave device is connected by the lower device connection signal;
The master device is
A serial signal line for connecting to a shared bus and the serial port for sending and receiving commands or data;
A digital output terminal that outputs a setting completion state of the node ID of the master device to the upper device status signal;
A master-slave system comprising: a digital input terminal that is connected to the lower-stage device connection signal and confirms whether or not a lower-level slave device is connected.
請求項2あるいは3に記載のマスタスレーブシステムにおいて、
前記上段装置状態信号端子には、上段側から順に、ノードIDの設定完了状態が出力される
ことを特徴とするマスタスレーブシステム。
In the master-slave system according to claim 2 or 3,
A master-slave system characterized in that a node ID setting completion status is output to the upper device status signal terminal in order from the upper device side.
請求項1に記載のマスタスレーブシステムにおいて、
前記スレーブ装置からマスタ装置への応答電文のフラグ情報には、
当該スレーブ装置のノードID設定処理によるノードID設定完了フラグと、
デイジーチェーン接続される信号ラインにより通知され、デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置と反対側に接続された下段スレーブ装置の接続有無を示す下段装置接続フラグと、
デイジーチェーン接続される信号ラインにより通知され、デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置側に接続された上段装置のノードIDの設定状態を示す上段装置状態フラグを含む
ことを特徴とするマスタスレーブシステム。
In the master-slave system according to claim 1,
In the flag information of the response message from the slave device to the master device,
Node ID setting completion flag by the node ID setting processing of the slave device,
A lower apparatus connection flag that indicates whether or not a lower slave apparatus connected to the opposite side of the master apparatus connected to the daisy chain or the master apparatus of the slave apparatus is notified by a daisy chain connected signal line;
It is notified by a signal line connected in a daisy chain and includes an upper device status flag indicating a setting state of a node ID of an upper device connected to the master device side of a master device or a slave device connected in a daisy chain. Master-slave system.
請求項1に記載のマスタスレーブシステムにおいて、
前記マスタ装置を端にしてデイジーチェーン接続する信号ラインは、
デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置側に接続された上段装置のノードID設定の完了状態および異常検知状態を下段の装置に通知する上段装置状態信号のラインと、
デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置と反対側に接続された下段スレーブ装置の有無を上段装置に通知する下段装置接続信号のラインから成る
ことを特徴とするマスタスレーブシステム。
In the master-slave system according to claim 1,
The signal line daisy chained with the master device at the end is
The upper device status signal line for notifying the lower device of the completion status and abnormality detection status of the node ID setting of the upper device connected to the master device side of the master device or slave device connected in the daisy chain;
A master-slave system comprising a lower device connection signal line for notifying the upper device of the presence or absence of a master device connected in a daisy chain or a lower slave device connected to the opposite side of the master device of a slave device.
請求項6に記載のマスタスレーブシステムにおいて、
前記スレーブ装置は、上段のスレーブ装置に接続する上段装置状態信号のラインにより通知される上段装置状態とノードID設定の完了状態と当該スレーブ装置の異常検知状態の論理積を上段装置状態として下段のスレーブ装置に出力するデジタル出力端子(A)を備える
ことを特徴とするマスタスレーブシステム。
In the master-slave system according to claim 6,
The slave device uses the logical product of the upper device state notified by the upper device state signal line connected to the upper slave device, the node ID setting completion state, and the abnormality detection state of the slave device as the upper device state. A master-slave system comprising a digital output terminal (A) for output to a slave device.
マスタ装置と複数のスレーブ装置が接続されたマスタスレーブシステムのノード制御方法であって、
スレーブ装置からマスタ装置への応答電文には応答電文に上段装置状態フラグと下段装置接続フラグが含まれ、
スレーブ装置は、マスタ装置を端としてデイジーチェーン接続され当該スレーブ装置のマスタ側に接続する上段のスレーブ装置のノードIDの設定状況あるいは異常検知状況を示す上段装置状態フラグと、マスタ装置を端としてデイジーチェーン接続され当該スレーブ装置のマスタ装置と反対側に接続された下段のスレーブ装置の下段スレーブ装置の接続有無を示す下段装置接続フラグとを更新して、マスタ装置に応答電文を通知し、
前記スレーブ装置から前記応答電文を受信したマスタ装置は、前記上段装置状態フラグあるいは前記下段装置接続フラグにより、ノードIDの設定処理あるいはノードIDの追加処理あるいはスレーブ装置の復帰処理をおこなう
ことを特徴とするマスタスレーブシステムのノード制御方法。
A master slave system node control method in which a master device and a plurality of slave devices are connected,
The response message from the slave device to the master device includes the upper device status flag and the lower device connection flag in the response message,
The slave device is daisy chained with the master device at the end, the upper device status flag indicating the node ID setting status or abnormality detection status of the upper slave device connected to the master side of the slave device, and the master device with the daisy chain as the end. Update the lower device connection flag indicating the presence or absence of connection of the lower slave device of the lower slave device connected to the opposite side of the master device of the slave device, and notify the master device of the response message,
The master device that has received the response message from the slave device performs a node ID setting process, a node ID addition process, or a slave apparatus return process according to the upper device status flag or the lower device connection flag. Node control method for master / slave system.
請求項8に記載のマスタスレーブシステムのノード制御方法において、
設定したノードIDを有するスレーブ装置のうち、マスタ装置を端としてデイジーチェーン接続され、マスタ装置から最も離れた最下段のスレーブ装置からの応答電文の前記下段装置接続フラグが、下段装置の接続有を示す場合に、
マスタ装置は、前記所定のノードIDを宛先としてイニシャル要求コマンドと新たなノードID値を指定したノードID設定コマンドをスレーブ装置に通知して、ノードIDの追加設定処理をおこなう
ことを特徴とするマスタスレーブシステムのノード制御方法。
The node control method for a master-slave system according to claim 8,
Of the slave devices having the set node ID, the lower device connection flag of the response message from the slave device at the lowest stage farthest from the master device is connected in a daisy chain with the master device as an end, indicating that the lower device is connected. When showing
The master device notifies the slave device of an initial request command and a node ID setting command designating a new node ID value with the predetermined node ID as a destination, and performs a node ID additional setting process. Node control method for slave system.
請求項8に記載のマスタスレーブシステムのノード制御方法において、
前記スレーブ装置から前記応答電文を受信したマスタ装置は、
前記応答電文を通知したスレーブ装置の直上のスレーブ装置の応答の有無を検出し、
前記応答の有無と前記上段装置状態フラグを判定し、
前記上段装置状態フラグが異常状態を示す場合には、前記応答電文を通知したスレーブ装置の直上のスレーブ装置のイニシャル処理をおこない、
前記上段装置状態フラグが正常状態を示し、かつ、前記応答が無い場合には、前記応答電文を通知したスレーブ装置の直上のスレーブ装置のリセット処理をおこなった後にイニシャル処理をおこなう
ことを特徴とするマスタスレーブシステムのノード制御方法。
The node control method for a master-slave system according to claim 8,
The master device that has received the response message from the slave device,
Detect the presence or absence of a response of the slave device immediately above the slave device that notified the response message,
Determining the presence of the response and the upper device status flag;
When the upper device status flag indicates an abnormal state, the initial processing of the slave device immediately above the slave device that notified the response message is performed,
When the upper device status flag indicates a normal state and there is no response, initial processing is performed after reset processing of the slave device immediately above the slave device that has notified the response message. Node control method for master / slave system.
請求項8に記載のマスタスレーブシステムのノード制御方法において、
前記スレーブ装置の応答電文の上段装置状態フラグは、マスタ装置を端としてデイジーチェーン接続され当該スレーブ装置のマスタ側に接続するすべての上段スレーブ装置のノードIDの設定状況あるいは異常検知状況の論理積を示しており、
前記応答電文を受信したマスタ装置は、前記上段装置状態フラグが異常状態を示している場合に、応答電文を通知したスレーブ装置より上段のいずれかのスレーブ装置での異常状態を検出し、
応答電文を通知したスレーブ装置より上段のスレーブ装置の応答有無を順に判定して異常状態のスレーブ装置を特定する
ことを特徴とするマスタスレーブシステムのノード制御方法。
The node control method for a master-slave system according to claim 8,
The upper device status flag of the response message of the slave device is a logical product of the node ID setting status or abnormality detection status of all upper slave devices connected to the master side of the slave device that is daisy chained with the master device as an end. Shows,
The master device that has received the response message detects an abnormal state in any one of the slave devices above the slave device that has notified the response message when the upper device state flag indicates an abnormal state,
A node control method for a master-slave system, wherein a slave device in an abnormal state is identified by sequentially determining whether there is a response from a slave device above the slave device that has notified the response message.
マスタ装置と複数のスレーブ装置が接続されたマスタスレーブシステムのノード制御方法であって、
マスタ装置を端としてデイジーチェーン接続されたマスタ装置、あるいは、当該スレーブ装置のマスタ側に接続する上段のスレーブ装置からの通知により自己のノードIDの設定をおこなうスレーブ装置は、
共有バス接続された前記マスタ装置からノードID設定コマンドを受信し、
前記ノードID設定コマンドに指定されたID値に自己のノードIDを設定し、
デイジーチェーン接続された下段のスレーブ装置の有無を取得し、
前記ノードID設定コマンドの応答電文の下段装置接続フラグに、前記下段のスレーブ装置の有無を反映し、
前記マスタ装置に前記ノードID設定コマンドの応答電文を通知し、
前記ノードID設定コマンドを通知したマスタ装置は、
前記スレーブ装置からの前記応答電文を受信し、
前記応答電文の下段装置接続フラグが、下段装置接続有の場合には、前記ノードID設定コマンドのノードID値とは異なるノードID値を指定したノードID設定コマンドをスレーブ装置に通知し、下段装置接続無の場合には、スレーブ装置のノードIDの設定を終了する
をことを特徴とするマスタスレーブシステムのノード制御方法。
A master slave system node control method in which a master device and a plurality of slave devices are connected,
A master device that is daisy chained with the master device as the end, or a slave device that sets its own node ID by notification from the upper slave device connected to the master side of the slave device,
A node ID setting command is received from the master device connected to the shared bus,
Set its own node ID to the ID value specified in the node ID setting command,
Acquires the presence or absence of the lower slave device connected in a daisy chain.
Reflect the presence or absence of the slave device in the lower row in the lower device connection flag of the response message of the node ID setting command,
Notifying the master device of a response message of the node ID setting command,
The master device that has notified the node ID setting command,
Receiving the response message from the slave device;
If the lower device connection flag of the response message indicates that the lower device is connected, the slave device is notified of a node ID setting command specifying a node ID value different from the node ID value of the node ID setting command, and the lower device A node control method for a master-slave system, characterized in that, when there is no connection, the setting of the node ID of the slave device is terminated.
請求項12に記載のマスタスレーブシステムのノード制御方法において、
前記スレーブ装置は、
デイジーチェーン接続されたマスタ装置あるいはスレーブ装置のマスタ装置側に接続された上段装置のノードID設定の完了状態を下段の装置に通知する上段装置状態信号をモニタし、
モニタした上段装置状態信号がノードID設定の完了状態を示すときに、自己がノードID設定の対象であることを認識し、
マスタ装置からのイニシャル要求コマンドあるいはノードID設定コマンドに応答する
ことを特徴とするマスタスレーブシステムのノード制御方法。
In the node control method of the master slave system according to claim 12,
The slave device is
Monitor the upper device status signal to notify the lower device of the node ID setting completion status of the upper device connected to the master device side of the master device or slave device connected in daisy chain,
When the monitored upper device status signal indicates the completion status of node ID setting, it recognizes that it is the node ID setting target,
A node control method for a master / slave system characterized by responding to an initial request command or a node ID setting command from a master device.
請求項12あるいは13に記載のマスタスレーブシステムのノード制御方法において、
マスタ装置からノードID設定コマンドを受信する以前のスレーブ装置は、複数のスレーブ装置で共通の所定のノードIDをもち、
マスタ装置は、前記所定のノードIDを宛先としてイニシャル要求コマンドあるいはノードID設定コマンドをスレーブ装置に通知する
ことを特徴とするマスタスレーブシステムのノード制御方法。
In the node control method of the master slave system according to claim 12 or 13,
The slave device before receiving the node ID setting command from the master device has a predetermined node ID common to a plurality of slave devices,
A master device notifies a slave device of an initial request command or a node ID setting command with the predetermined node ID as a destination, a node control method of a master-slave system.
JP2013108351A 2013-05-22 2013-05-22 Master-slave system and node control method thereof Pending JP2014230097A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013108351A JP2014230097A (en) 2013-05-22 2013-05-22 Master-slave system and node control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013108351A JP2014230097A (en) 2013-05-22 2013-05-22 Master-slave system and node control method thereof

Publications (1)

Publication Number Publication Date
JP2014230097A true JP2014230097A (en) 2014-12-08

Family

ID=52129571

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013108351A Pending JP2014230097A (en) 2013-05-22 2013-05-22 Master-slave system and node control method thereof

Country Status (1)

Country Link
JP (1) JP2014230097A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016134879A (en) * 2015-01-22 2016-07-25 富士機械製造株式会社 Apparatus id assignment system
JPWO2015136660A1 (en) * 2014-03-13 2017-04-06 Necディスプレイソリューションズ株式会社 Display device, multi-display system, and display device ID determination method
JP2018129564A (en) * 2017-02-06 2018-08-16 株式会社リコー Ground shorting portion detecting device, ground shorting portion detecting method, and ground shorting portion detecting program
DE102018207957A1 (en) 2017-05-22 2018-11-22 Yazaki Corporation CONTROL DEVICE AND CONTROL SYSTEM
WO2020184062A1 (en) * 2019-03-14 2020-09-17 オムロン株式会社 Control system and control device
WO2020184063A1 (en) * 2019-03-14 2020-09-17 オムロン株式会社 Control system and control device
TWI725786B (en) * 2020-03-20 2021-04-21 新唐科技股份有限公司 Slave device, master device and data transfer method
US11084435B2 (en) 2015-12-22 2021-08-10 Yazaki Corporation Control device and control system
WO2022013967A1 (en) * 2020-07-15 2022-01-20 富士通株式会社 Communication control device, communication system, and communication control method
US11688887B2 (en) 2019-02-11 2023-06-27 Lg Energy Solution, Ltd. Slave BMS inspection system and method

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2015136660A1 (en) * 2014-03-13 2017-04-06 Necディスプレイソリューションズ株式会社 Display device, multi-display system, and display device ID determination method
US10055188B2 (en) 2014-03-13 2018-08-21 Nec Display Solutions, Ltd. Display device, multi-display system, and ID determination method for display device
US10268435B2 (en) 2014-03-13 2019-04-23 Nec Display Solutions, Ltd. Display device, multi-display system, and ID determination method for display device
JP2016134879A (en) * 2015-01-22 2016-07-25 富士機械製造株式会社 Apparatus id assignment system
US11084435B2 (en) 2015-12-22 2021-08-10 Yazaki Corporation Control device and control system
JP2018129564A (en) * 2017-02-06 2018-08-16 株式会社リコー Ground shorting portion detecting device, ground shorting portion detecting method, and ground shorting portion detecting program
DE102018207957A1 (en) 2017-05-22 2018-11-22 Yazaki Corporation CONTROL DEVICE AND CONTROL SYSTEM
US10773661B2 (en) 2017-05-22 2020-09-15 Yazaki Corporation Control device and control system
DE102018207957B4 (en) 2017-05-22 2022-07-14 Yazaki Corporation CONTROL EQUIPMENT AND CONTROL SYSTEM
US11688887B2 (en) 2019-02-11 2023-06-27 Lg Energy Solution, Ltd. Slave BMS inspection system and method
JP2020150452A (en) * 2019-03-14 2020-09-17 オムロン株式会社 Control system and control unit
JP2020150453A (en) * 2019-03-14 2020-09-17 オムロン株式会社 Control system and control unit
JP7010257B2 (en) 2019-03-14 2022-01-26 オムロン株式会社 Control system and control unit
WO2020184063A1 (en) * 2019-03-14 2020-09-17 オムロン株式会社 Control system and control device
JP7107262B2 (en) 2019-03-14 2022-07-27 オムロン株式会社 Control system and controller
WO2020184062A1 (en) * 2019-03-14 2020-09-17 オムロン株式会社 Control system and control device
US12019419B2 (en) 2019-03-14 2024-06-25 Omron Corporation Control system and control apparatus
TWI725786B (en) * 2020-03-20 2021-04-21 新唐科技股份有限公司 Slave device, master device and data transfer method
US11537547B2 (en) 2020-03-20 2022-12-27 Nuvoton Technology Corporation Slave device, master device, and data transmission method
WO2022013967A1 (en) * 2020-07-15 2022-01-20 富士通株式会社 Communication control device, communication system, and communication control method
JPWO2022013967A1 (en) * 2020-07-15 2022-01-20
JP7338794B2 (en) 2020-07-15 2023-09-05 富士通株式会社 Communication control device, communication system and communication control method

Similar Documents

Publication Publication Date Title
JP2014230097A (en) Master-slave system and node control method thereof
CN106453383B (en) UART-based master-slave multi-machine communication system and method
US3845472A (en) Data communication system employing a series loop
JP2007020150A (en) Communication master station startup period control method
CN105871672A (en) One-host multi-slave communication system and data transmission method thereof
US20110197000A1 (en) Master-slave device communication circuit and id address setting method thereof
JP6629361B2 (en) Programmable logic controller
EP2958276A1 (en) System and method for interconnecting discrete segments of a security system using a network
KR20170122483A (en) System for detecting communication network
CN110995889A (en) Address allocation system and method
US20090240859A1 (en) Automatic address setting system
JP2005277978A (en) Method and device for automatically setting identification number
JP3206006U (en) Multipoint traffic signal control system
EP2903324B1 (en) Wireless network adapter and self-configuration method of same
JP5475479B2 (en) Communications system
CN210518417U (en) Address allocation system
KR101294308B1 (en) Facilities control system and operating method of the system
JP2009005566A (en) Power line communication system in power distribution board
JP6470056B2 (en) Wireless disaster prevention system and repeater node
JP2019028953A (en) Relay device, receiver, disaster prevention system and program
JPH08242303A (en) Method for detecting drop/disconnection of adaptor for slave equipment in nurse calling equipment
JPS61295738A (en) Transmission controller
KR101917616B1 (en) Iot system using lora network
JP2012169800A (en) Communication system
JP4407838B2 (en) Communication master station startup control method