JP2019022106A - Communication system - Google Patents

Communication system Download PDF

Info

Publication number
JP2019022106A
JP2019022106A JP2017139678A JP2017139678A JP2019022106A JP 2019022106 A JP2019022106 A JP 2019022106A JP 2017139678 A JP2017139678 A JP 2017139678A JP 2017139678 A JP2017139678 A JP 2017139678A JP 2019022106 A JP2019022106 A JP 2019022106A
Authority
JP
Japan
Prior art keywords
time
timeout time
communication
master device
timeout
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
JP2017139678A
Other languages
Japanese (ja)
Inventor
田中 良則
Yoshinori Tanaka
良則 田中
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.)
Azbil Corp
Original Assignee
Azbil Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Azbil Corp filed Critical Azbil Corp
Priority to JP2017139678A priority Critical patent/JP2019022106A/en
Publication of JP2019022106A publication Critical patent/JP2019022106A/en
Pending legal-status Critical Current

Links

Images

Abstract

To make it easy to appropriately set an initial value of a time-out time for a master apparatus.SOLUTION: A master apparatus comprises: a communication control unit 22 that performs retransmission processing on a request command when no response messages have not been received within a time-out time after transmission of the request command to a slave apparatus; a communication parameter database 260 that stores a communication history of data requests; an information acquisition unit 27 that when no initial value for the time-out time is set at the time of start-up of the master apparatus, acquires, from another master apparatus whose time-out time has already set, information on the time-out time; a time-out time calculation unit 28 that, on the basis of the acquired time-out time and the number of other master apparatuses, calculates an initial value for the time-out time; and a time-out time setting unit 29 that sets the initial value for the time-out time to the communication parameter database 260.SELECTED DRAWING: Figure 2

Description

本発明は、マスタ機器とスレーブ機器との間で通信を行うマスタ・スレーブ方式の通信システムに関するものである。   The present invention relates to a master-slave communication system that performs communication between a master device and a slave device.

通信ゲートウェイが行う制御ネットワーク通信は、マスタ機器(通信ゲートウェイ)が要求を送信し、スレーブ機器(PLC(Programmable Logic Controller)など)が応答を返すという、コマンド−レスポンス方式である。この通信では、マスタ機器側に要求送信後の応答受信タイムアウト時間を設定してタイムアウト監視を行う。マスタ機器は、タイムアウト時間内に応答が受信できなかった場合、要求再送を行い、一定回数の要求再送を行った後でもスレーブ機器からの応答が無い場合に通信異常とする。   The control network communication performed by the communication gateway is a command-response system in which a master device (communication gateway) transmits a request and a slave device (PLC (Programmable Logic Controller) or the like) returns a response. In this communication, a response reception timeout time after request transmission is set on the master device side to perform timeout monitoring. If the master device fails to receive a response within the time-out period, it performs request retransmission, and if there is no response from the slave device even after performing a predetermined number of request retransmissions, it determines a communication error.

マスタ機器に最適なタイムアウト時間を設定するためには、実際にスレーブ機器と通信しながらの調整が必要である。しかしながら、プロセス制御システムのようにネットワーク上に複数台のマスタ機器とスレーブ機器とが存在する場合には、スレーブ機器と通信を行うマスタ機器の台数によってスレーブ機器の応答時間が変動するため、適切なタイムアウト時間を設定することが難しく、タイムアウト時間が感覚的・経験的に決定されることが多々あった。   In order to set the optimum timeout time for the master device, adjustment is required while actually communicating with the slave device. However, when there are multiple master devices and slave devices on the network as in a process control system, the response time of the slave devices varies depending on the number of master devices communicating with the slave devices. It was difficult to set the timeout time, and the timeout time was often determined sensuously and empirically.

マスタ機器が1台の場合にタイムアウト時間を設定する公知の技術として、特許文献1、特許文献2に開示された技術がある。特許文献1、特許文献2に開示された技術は、実際にスレーブ機器と通信を行い、要求を送信してから要求に対する応答を受信するまでの応答時間に基づいてタイムアウト時間を決めるものである。このように、特許文献1、特許文献2に開示された技術では、実際にスレーブ機器と通信を行いながらタイムアウト時間を決めるため、制御ネットワークへのマスタ機器の追加と同時に、このマスタ機器に、既設のマスタ機器の台数を考慮した適切なタイムアウト時間を設定することが難しいという問題点があった。   As a known technique for setting the timeout time when there is one master device, there are techniques disclosed in Patent Document 1 and Patent Document 2. The techniques disclosed in Patent Document 1 and Patent Document 2 actually communicate with a slave device and determine a timeout time based on a response time from when a request is transmitted until a response to the request is received. As described above, in the techniques disclosed in Patent Document 1 and Patent Document 2, in order to determine the timeout time while actually communicating with the slave device, at the same time as adding the master device to the control network, There is a problem that it is difficult to set an appropriate timeout time considering the number of master devices.

特開平9−18545号公報Japanese Patent Laid-Open No. 9-18545 特開平6−121002号公報JP-A-6-121002

本発明は、上記課題を解決するためになされたもので、スレーブ機器と通信を行うことなく、マスタ機器のタイムアウト時間の適切な初期値を容易に設定可能な通信システムを提供することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a communication system that can easily set an appropriate initial value of the timeout time of a master device without communicating with a slave device. To do.

本発明の通信システムは、要求コマンドを送信するように構成された複数のマスタ機器と、このマスタ機器とネットワークを介して接続され、前記要求コマンドで要求されたデータを含む応答メッセージを要求元のマスタ機器に返送するように構成された少なくとも1つのスレーブ機器とを備え、前記マスタ機器は、前記要求コマンドを要求先の前記スレーブ機器に送信し、前記要求コマンドを送信してからタイムアウト時間以内に前記応答メッセージを受信できなかった場合に前記要求コマンドの再送処理を行うように構成された通信制御部と、データ要求の通信履歴を記憶するように構成された通信パラメータデータベースと、マスタ機器の起動時に前記タイムアウト時間の初期値が設定されていない場合に、前記タイムアウト時間が既に設定されている他のマスタ機器からタイムアウト時間の情報を取得するように構成された情報取得部と、この情報取得部によって取得されたタイムアウト時間と前記他のマスタ機器の台数とに基づいて、前記タイムアウト時間の初期値を算出するように構成された第1のタイムアウト時間算出部と、前記タイムアウト時間の初期値を前記通信パラメータデータベースに設定するように構成されたタイムアウト時間設定部とを備えることを特徴とするものである。   The communication system of the present invention includes a plurality of master devices configured to transmit a request command, and a response message connected to the master device via a network and including data requested by the request command. At least one slave device configured to return to the master device, wherein the master device transmits the request command to the requested slave device, and within a timeout period after transmitting the request command A communication control unit configured to perform retransmission processing of the request command when the response message cannot be received, a communication parameter database configured to store a communication history of a data request, and activation of a master device If the initial value of the timeout period is not set at Based on the information acquisition unit configured to acquire the timeout time information from other set master devices, the timeout time acquired by the information acquisition unit and the number of the other master devices, A first time-out time calculating unit configured to calculate an initial value of the time-out time; and a time-out time setting unit configured to set the initial value of the time-out time in the communication parameter database. It is a feature.

また、本発明の通信システムの1構成例において、前記マスタ機器は、前記要求コマンドを送信してから前記応答メッセージを受信するまでの応答時間に基づいて新たなタイムアウト時間を算出するように構成された第2のタイムアウト時間算出部と、この第2のタイムアウト時間算出部によって算出されたタイムアウト時間を含む通信履歴を前記通信パラメータデータベースに記録することにより、前記タイムアウト時間の最新の値を設定するように構成された通信履歴記録部とをさらに備え、前記情報取得部は、前記他のマスタ機器の通信パラメータデータベースに記録された通信履歴を取得することにより、前記タイムアウト時間の情報を取得することを特徴とするものである。
また、本発明の通信システムの1構成例において、前記通信履歴記録部は、前記要求コマンドで要求したデータの数と前記第2のタイムアウト時間算出部によって算出されたタイムアウト時間と要求先のスレーブ機器の情報とを少なくとも含む前記通信履歴を、前記通信パラメータデータベースに記録し、前記第1のタイムアウト時間算出部は、前記情報取得部によって取得された通信履歴に含まれる前記タイムアウト時間の最大値および最小値と、この通信履歴に含まれる前記データの数の最大値および最小値と、前記他のマスタ機器の台数と、発行予定の要求コマンドで要求するデータの数とに基づいて、この要求コマンドに対応する前記タイムアウト時間の初期値を算出することを特徴とするものである。
また、本発明の通信システムの1構成例において、前記第1のタイムアウト時間算出部は、前記情報取得部によって取得された通信履歴のうち前記他のマスタ機器の動作継続時間が最も長い動作期間のときに記録された通信履歴を前記タイムアウト時間の初期値の算出に用いることを特徴とするものである。
Further, in one configuration example of the communication system of the present invention, the master device is configured to calculate a new timeout time based on a response time from when the request command is transmitted until the response message is received. The latest time-out value is set by recording the second time-out time calculating unit and the communication history including the time-out time calculated by the second time-out time calculating unit in the communication parameter database. A communication history recording unit configured as described above, wherein the information acquisition unit acquires the time-out time information by acquiring a communication history recorded in a communication parameter database of the other master device. It is a feature.
In the configuration example of the communication system of the present invention, the communication history recording unit includes the number of data requested by the request command, the timeout time calculated by the second timeout time calculation unit, and the requested slave device. The communication history including at least the information of the communication history is recorded in the communication parameter database, and the first timeout time calculation unit includes a maximum value and a minimum of the timeout time included in the communication history acquired by the information acquisition unit. Based on the value, the maximum and minimum values of the number of data included in the communication history, the number of the other master devices, and the number of data requested by the request command to be issued. The initial value of the corresponding timeout time is calculated.
Further, in one configuration example of the communication system of the present invention, the first timeout time calculation unit has an operation period of the longest operation duration of the other master device among the communication histories acquired by the information acquisition unit. The communication history recorded sometimes is used for calculating the initial value of the timeout time.

本発明によれば、タイムアウト時間の初期値が設定されていない新設のマスタ機器が、タイムアウト時間が既に設定されている既設のマスタ機器からタイムアウト時間の情報を取得して、取得した情報と既設のマスタ機器の台数とに基づいて、タイムアウト時間の初期値を算出するようにしたので、スレーブ機器と通信を行うことなく、既設のマスタ機器の台数を考慮した、新設のマスタ機器のタイムアウト時間の適切な初期値を容易に設定することができる。   According to the present invention, a new master device in which an initial value of the timeout time is not set acquires time-out time information from an existing master device in which the timeout time is already set, and the acquired information and the existing Since the initial value of the timeout time is calculated based on the number of master devices, the timeout time of the new master device is considered appropriate considering the number of existing master devices without communicating with the slave devices. A simple initial value can be set easily.

図1は、本発明の実施例に係る通信システムの構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a communication system according to an embodiment of the present invention. 図2は、本発明の実施例に係る通信システムのマスタ機器の構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of the master device of the communication system according to the embodiment of the present invention. 図3は、本発明の実施例に係る通信システムの既設のマスタ機器の動作を説明するフローチャートである。FIG. 3 is a flowchart for explaining the operation of the existing master device of the communication system according to the embodiment of the present invention. 図4は、通信パラメータデータベースに記録される通信履歴の1例を示す図である。FIG. 4 is a diagram illustrating an example of a communication history recorded in the communication parameter database. 図5は、本発明の実施例においてネットワークに新たに追加されたマスタ機器の動作を説明するフローチャートである。FIG. 5 is a flowchart for explaining the operation of the master device newly added to the network in the embodiment of the present invention. 図6は、タイムアウト時間の初期値が設定されたときのマスタ機器の通信パラメータデータベースの内容の1例を示す図である。FIG. 6 is a diagram illustrating an example of the contents of the communication parameter database of the master device when the initial value of the timeout time is set.

以下、本発明の実施例について図面を参照して説明する。図1は本発明の実施例に係る通信システムの構成を示すブロック図である。本実施例の通信システムは、例えばPLCなどからなる少なくとも1つのスレーブ機器1−1,1−2と、例えば通信ゲートウェイなどからなる複数のマスタ機器2−1,2−2,2−3と、スレーブ機器1−1,1−2とマスタ機器2−1〜2−3とを相互に接続するネットワーク3とから構成される。   Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a communication system according to an embodiment of the present invention. The communication system according to the present embodiment includes at least one slave device 1-1 and 1-2 including, for example, a PLC, and a plurality of master devices 2-1, 2-2, 2-3 including, for example, a communication gateway. The network includes a slave device 1-1 and 1-2 and a network 3 that connects the master devices 2-1 to 2-3 with each other.

図2はマスタ機器2−1の構成を示すブロック図である。マスタ機器2−1は、スレーブ機器1−1,1−2に要求コマンドを送信する送信部20と、要求コマンドに対するスレーブ機器1−1,1−2からの応答メッセージを受信する受信部21と、送信部20を介して要求コマンドを要求先のスレーブ機器1−1,1−2に送信し、要求コマンドを送信してからタイムアウト時間以内に応答メッセージを受信できなかった場合に要求コマンドの再送処理を行う通信制御部22と、要求コマンドを送信したときからの経過時間を計測する経過時間計測部23と、要求コマンドを送信してから応答メッセージを受信するまでの応答時間に基づいて新たなタイムアウト時間を算出するタイムアウト時間算出部24と、タイムアウト時間算出部24によって算出されたタイムアウト時間を含む通信履歴を通信パラメータデータベース(以下、通信パラメータDB)260に記録することにより、タイムアウト時間の最新の値を設定する通信履歴記録部25と、発行予定の要求コマンドの情報と通信パラメータDB260とを記憶する記憶部26と、マスタ機器2−1の起動時にタイムアウト時間の初期値が設定されていない場合に、タイムアウト時間が既に設定されている他のマスタ機器から通信履歴を取得する情報取得部27と、情報取得部27によって取得されたタイムアウト時間と他のマスタ機器の台数とに基づいて、タイムアウト時間の初期値を算出するタイムアウト時間算出部28と、タイムアウト時間の初期値を通信パラメータDB260に設定するタイムアウト時間設定部29と、マスタ機器2−1が起動してからの動作継続時間を計測する動作継続時間計測部30とを備えている。マスタ機器2−2,2−3の構成も、マスタ機器2−1と同様である。   FIG. 2 is a block diagram showing the configuration of the master device 2-1. The master device 2-1 includes a transmission unit 20 that transmits a request command to the slave devices 1-1 and 1-2, and a reception unit 21 that receives a response message from the slave devices 1-1 and 1-2 with respect to the request command. The request command is transmitted to the requesting slave devices 1-1 and 1-2 via the transmission unit 20, and the request command is retransmitted when the response message is not received within the timeout period after the request command is transmitted. A communication control unit 22 that performs processing, an elapsed time measurement unit 23 that measures an elapsed time from when the request command is transmitted, and a new response time based on the response time from when the request command is transmitted until the response message is received. A timeout time calculation unit 24 for calculating a timeout time, and a communication history including the timeout time calculated by the timeout time calculation unit 24 A communication history recording unit 25 that sets the latest value of the timeout time by recording in the communication parameter database (hereinafter referred to as communication parameter DB) 260, and a storage unit that stores information on the request command to be issued and the communication parameter DB 260 26, an information acquisition unit 27 for acquiring a communication history from another master device for which a timeout time has already been set when an initial value of the timeout time is not set when the master device 2-1 is started, and information acquisition Based on the timeout time acquired by the unit 27 and the number of other master devices, a timeout time calculation unit 28 that calculates an initial value of the timeout time, and a timeout time setting that sets the initial value of the timeout time in the communication parameter DB 260 When the operation is continued after the unit 29 and the master device 2-1 are activated And a continuous operation time measurement unit 30 for measuring the. The configuration of the master devices 2-2 and 2-3 is the same as that of the master device 2-1.

以下、本実施例の通信システムの動作について説明する。本実施例では、マスタ機器2−1,2−2が、タイムアウト時間が既に設定されている既設の機器で、マスタ機器2−3がネットワーク3に新たに追加される機器の場合について説明する。   Hereinafter, the operation of the communication system of the present embodiment will be described. In the present embodiment, a case will be described in which the master devices 2-1 and 2-2 are existing devices for which a timeout time has already been set, and the master device 2-3 is a device newly added to the network 3.

図3はマスタ機器2−1の動作を説明するフローチャートである。マスタ機器2−1の記憶部26には、発行すべきデータ要求の情報(要求するデータの種類、データの数、要求先のスレーブ機器の情報)が予め登録されている。マスタ機器2−1の通信制御部22は、この発行すべきデータ要求の情報に従って、スレーブ機器1−1または1−2に対してデータを要求する要求コマンドを生成し、この要求コマンドを送信部20を介して要求先のスレーブ機器1−1または1−2に送信する(図3ステップS100)。   FIG. 3 is a flowchart for explaining the operation of the master device 2-1. In the storage unit 26 of the master device 2-1, data request information to be issued (requested data type, number of data, request destination slave device information) is registered in advance. The communication control unit 22 of the master device 2-1 generates a request command for requesting data from the slave device 1-1 or 1-2 according to the information of the data request to be issued, and sends the request command to the transmission unit. 20 to the requested slave device 1-1 or 1-2 (step S100 in FIG. 3).

通信制御部22は、要求コマンドの送信後、要求先のスレーブ機器1−1または1−2からの応答を待つ。マスタ機器2−1の経過時間計測部23は、要求コマンドを送信したときからの経過時間を計測する(図3ステップS101)。
要求コマンドを受信したスレーブ機器1−1または1−2は、この要求コマンドで要求されたデータを含む応答メッセージを要求元のマスタ機器2−1に返送する。
After transmitting the request command, the communication control unit 22 waits for a response from the requested slave device 1-1 or 1-2. The elapsed time measuring unit 23 of the master device 2-1 measures the elapsed time from when the request command is transmitted (step S101 in FIG. 3).
The slave device 1-1 or 1-2 that has received the request command returns a response message including data requested by the request command to the requesting master device 2-1.

マスタ機器2−1の通信制御部22は、経過時間計測部23によって計測された経過時間がタイムアウト時間T以内のときに、受信部21が要求先のスレーブ機器1−1または1−2から応答メッセージを受信した場合(図3ステップS102,S103においてYES)、今回のデータ要求が終了したと判断する。なお、タイムアウト時間Tは、要求先のスレーブ機器毎およびデータ要求の種類毎に設定される。したがって、通信制御部22は、後述する記憶部26の通信パラメータDB260を参照し、今回の要求先のスレーブ機器と今回のデータ要求の種類とに対応するタイムアウト時間Tの値を取得して、ステップS102,S103の判定を行うことになる。   When the elapsed time measured by the elapsed time measuring unit 23 is within the timeout time T, the communication control unit 22 of the master device 2-1 receives a response from the requesting slave device 1-1 or 1-2. If a message is received (YES in steps S102 and S103 in FIG. 3), it is determined that the current data request has been completed. Note that the timeout time T is set for each requesting slave device and each type of data request. Therefore, the communication control unit 22 refers to a communication parameter DB 260 of the storage unit 26 to be described later, acquires a value of the timeout time T corresponding to the slave device of the current request destination and the type of data request of the current time, The determinations in S102 and S103 are made.

データ要求の終了後、マスタ機器2−1のタイムアウト時間算出部24は、要求コマンドを送信してから応答メッセージを受信するまでの応答時間Tr(応答メッセージを受信するまで経過時間計測部23によって計測された経過時間)に基づいて新たなタイムアウト時間Tを算出する(図3ステップS104)。タイムアウト時間算出部24は、特許文献1に開示されているように、過去の複数回のデータ要求の応答時間Trと今回のデータ要求の応答時間Trとから応答時間Trの平均値および分散値を求め、平均値に分散値の所定倍の値を加えたものを新たなタイムアウト時間Tとすればよい。   After the data request is completed, the timeout time calculation unit 24 of the master device 2-1 transmits the request command and receives the response message Tr (measured by the elapsed time measurement unit 23 until the response message is received). The new timeout time T is calculated based on the elapsed time) (step S104 in FIG. 3). As disclosed in Patent Document 1, the timeout time calculation unit 24 calculates an average value and a variance value of the response time Tr from the response time Tr of a plurality of past data requests and the response time Tr of the current data request. The new timeout time T may be obtained by adding the value obtained by multiplying the average value by a predetermined multiple of the variance value.

また、タイムアウト時間算出部24は、特許文献2に開示されているように、今回のデータ要求の応答時間Trに所定のマージンを加算した値を新たなタイムアウト時間Tとしてもよいし、過去の複数回のデータ要求の応答時間Trと今回のデータ要求の応答時間Trとから応答時間Trの平均値を求め、この平均値に所定のマージンを加算した値を新たなタイムアウト時間Tとしてもよい。タイムアウト時間Tの算出方法は以上の方法に限るものではないことは言うまでもない。   Further, as disclosed in Patent Document 2, the timeout time calculation unit 24 may use a value obtained by adding a predetermined margin to the response time Tr of the current data request as a new timeout time T, or a plurality of past multiple times. The average value of the response time Tr may be obtained from the response time Tr of the data request for the first time and the response time Tr of the current data request, and a value obtained by adding a predetermined margin to the average value may be used as the new timeout time T. Needless to say, the calculation method of the timeout time T is not limited to the above method.

上記のとおり、タイムアウト時間Tは、要求先のスレーブ機器毎およびデータ要求の種類毎に設定される。したがって、上記のように今回のデータ要求の応答時間Trと共に、過去の複数回のデータ要求の応答時間Trをタイムアウト時間Tの算出に用いる場合には、今回のデータ要求と要求先のスレーブ機器が同一で、且つ要求するデータの種類(データの数)が同一のデータ要求の応答時間Trを用いることになる。   As described above, the timeout time T is set for each requesting slave device and each type of data request. Therefore, as described above, when the response time Tr of a plurality of past data requests is used for calculating the timeout time T together with the response time Tr of the current data request, the slave device of the current data request and the request destination The response times Tr of data requests that are the same and request the same type of data (number of data) are used.

マスタ機器2−1の通信履歴記録部25は、今回のデータ要求の通信履歴をマスタ機器2−1の記憶部26に記憶されている通信パラメータDB260に記録する(図3ステップS105)。通信履歴には、データ要求で要求したデータの数と、経過時間計測部23によって計測された応答時間Trと、タイムアウト時間算出部24によって算出されたタイムアウト時間Tと、要求先のスレーブ機器を識別する情報とが含まれる。   The communication history recording unit 25 of the master device 2-1 records the communication history of the current data request in the communication parameter DB 260 stored in the storage unit 26 of the master device 2-1 (step S105 in FIG. 3). The communication history identifies the number of data requested in the data request, the response time Tr measured by the elapsed time measurement unit 23, the timeout time T calculated by the timeout time calculation unit 24, and the requested slave device. Information to be included.

図4は通信パラメータDB260に記録される通信履歴の1例を示す図である。通信履歴は、要求先のスレーブ機器毎およびデータ要求の種類毎に記録される。図4の例では、1種類のデータ要求について1回分の通信履歴のみを記載しているが、複数回のデータ要求の応答時間Trをタイムアウト時間Tの算出に用いる場合には、毎回のデータ要求の通信履歴を通信パラメータDB260に記録すればよい。ただし、通信制御部22がステップS102,S103の判定で用いるタイムアウト時間Tは、今回の要求先のスレーブ機器と今回のデータ要求の種類とに対応するタイムアウト時間Tのうち最新の値である。   FIG. 4 is a diagram illustrating an example of a communication history recorded in the communication parameter DB 260. The communication history is recorded for each requested slave device and each type of data request. In the example of FIG. 4, only one communication history is described for one type of data request. However, when the response time Tr of a plurality of data requests is used for calculating the timeout time T, the data request for each time is described. May be recorded in the communication parameter DB 260. However, the timeout time T used by the communication control unit 22 in the determinations in steps S102 and S103 is the latest value of the timeout times T corresponding to the current slave device and the type of data request.

また、図4の例では、通信パラメータDB260に、マスタ機器2−1が起動してからの経過時間である動作継続時間が記録されている。動作継続時間計測部30は、マスタ機器2−1が起動してからの動作継続時間を計測している。通信履歴記録部25は、動作継続時間計測部30の計測結果に応じて、通信パラメータDB260に記録される動作継続時間の値を適宜更新すればよい。   In the example of FIG. 4, the operation continuation time, which is the elapsed time since the master device 2-1 is activated, is recorded in the communication parameter DB 260. The operation duration measuring unit 30 measures the operation duration after the master device 2-1 is activated. The communication history recording unit 25 may appropriately update the value of the operation duration recorded in the communication parameter DB 260 according to the measurement result of the operation duration measurement unit 30.

記憶部26は、マスタ機器2−1の電源が切断されても情報を保持できる不揮発性のメモリである。このため、作成された通信パラメータDB260の内容が消えることはなく、マスタ機器2−1が起動する度に通信パラメータDB260に新たな通信履歴が追加されることになる。   The storage unit 26 is a non-volatile memory that can retain information even when the power of the master device 2-1 is turned off. For this reason, the content of the created communication parameter DB 260 does not disappear, and a new communication history is added to the communication parameter DB 260 every time the master device 2-1 is activated.

次に、マスタ機器2−1のタイムアウト時間算出部24は、経過時間計測部23によって計測された経過時間がタイムアウト時間T以内のときに、受信部21が要求先のスレーブ機器1−1または1−2から応答メッセージを受信できず(図3ステップS102においてNO)、且つ要求コマンドの再送回数が所定回数未満の場合(図3ステップS106においてYES)、現在のタイムアウト時間Tに所定の係数α(α>1)を乗算した値を新たなタイムアウト時間Tとして更新する(図3ステップS107)。このように、タイムアウト時間T内に応答メッセージを受信できなかった場合には、タイムアウト時間Tが長くなるように更新する。   Next, when the elapsed time measured by the elapsed time measuring unit 23 is within the timeout time T, the timeout time calculating unit 24 of the master device 2-1 receives the request from the slave device 1-1 or 1. -2 cannot be received (NO in step S102 in FIG. 3), and the number of retransmissions of the request command is less than the predetermined number (YES in step S106 in FIG. 3), a predetermined coefficient α ( The value multiplied by α> 1) is updated as a new timeout time T (step S107 in FIG. 3). As described above, when the response message cannot be received within the timeout time T, the update is performed so that the timeout time T becomes longer.

そして、マスタ機器2−1の通信制御部22は、ステップS100と同じ要求コマンドを要求先のスレーブ機器1−1または1−2に再送する(図3ステップS108)。
マスタ機器2−1の経過時間計測部23は、要求コマンドを送信したときからの経過時間を0にリセットして、経過時間の計測を再び開始する(ステップS101)。
Then, the communication control unit 22 of the master device 2-1 retransmits the same request command as that in step S100 to the request-destination slave device 1-1 or 1-2 (step S108 in FIG. 3).
The elapsed time measuring unit 23 of the master device 2-1 resets the elapsed time from when the request command is transmitted to 0, and starts measuring the elapsed time again (step S101).

ステップS102,S103の通信制御部22の動作は上記と同様である。ただし、このとき通信制御部22が判定に用いるタイムアウト時間Tは、ステップS107で更新された値である。こうして、タイムアウト時間T内に応答メッセージを受信できるまで、タイムアウト時間Tを延長しつつ要求コマンドの再送を行い、タイムアウト時間T内に応答メッセージを受信できた時点で、そのときの応答時間Trを基にタイムアウト時間Tを再計算して(ステップS104)、通信履歴を通信パラメータDB260に記録する(ステップS105)。   The operation of the communication control unit 22 in steps S102 and S103 is the same as described above. However, the timeout time T used for determination by the communication control unit 22 at this time is the value updated in step S107. Thus, until the response message can be received within the timeout time T, the request command is retransmitted while extending the timeout time T. When the response message is received within the timeout time T, the response time Tr at that time is used as a reference. The timeout time T is recalculated (step S104), and the communication history is recorded in the communication parameter DB 260 (step S105).

また、通信制御部22は、要求コマンドの再送回数が所定回数に達した場合(ステップS106においてNO)、通信異常と判断して(図3ステップS109)、データ要求処理を終了する。
マスタ機器2−1は、以上のようなデータ要求処理を発行すべきデータ要求毎に行う。ここでの説明では、マスタ機器2−1の動作について説明しているが、マスタ機器2−2の動作もマスタ機器2−1と同様である。
If the number of retransmissions of the request command reaches a predetermined number (NO in step S106), communication control unit 22 determines that the communication is abnormal (step S109 in FIG. 3), and ends the data request process.
The master device 2-1 performs the data request processing as described above for each data request to be issued. In the description here, the operation of the master device 2-1 is described, but the operation of the master device 2-2 is the same as that of the master device 2-1.

なお、他のマスタ機器が存在しない状態でマスタ機器2−1,2−2をネットワーク3に接続した場合、後述のように他のマスタ機器の情報を利用してタイムアウト時間Tの初期値設定を行うことはできない。そこで、このような場合には、比較的大きな値をタイムアウト時間Tの初期値として手動設定するか、あるいはタイムアウト時間算出部24の機能を利用してタイムアウト時間Tの初期値を設定すればよい。タイムアウト時間算出部24の機能を利用してタイムアウト時間Tの初期値を設定する場合には、図3で説明した処理において、ステップS102の判定をスキップして応答メッセージの受信を待ち、応答時間Trに基づいてタイムアウト時間Tの初期値を算出すればよい。   In addition, when the master devices 2-1 and 2-2 are connected to the network 3 in a state where no other master device exists, the initial value of the timeout time T is set using the information of the other master devices as described later. Can't do it. Therefore, in such a case, a relatively large value may be manually set as the initial value of the timeout time T, or the initial value of the timeout time T may be set using the function of the timeout time calculation unit 24. When the initial value of the timeout time T is set using the function of the timeout time calculation unit 24, the determination in step S102 is skipped in the process described with reference to FIG. The initial value of the timeout time T may be calculated based on the above.

次に、ネットワーク3に新たに追加されたマスタ機器2−3の動作を、図5を参照して説明する。新たに追加されたマスタ機器2−3には、タイムアウト時間Tが設定されていない。そこで、本実施例では、マスタ機器2−3が、既設のマスタ機器2−1,2−2と連携して、最適なタイムアウト時間Tの初期値を自動的に設定する。   Next, the operation of the master device 2-3 newly added to the network 3 will be described with reference to FIG. A timeout time T is not set for the newly added master device 2-3. Therefore, in this embodiment, the master device 2-3 automatically sets an optimal initial value of the timeout time T in cooperation with the existing master devices 2-1 and 2-2.

マスタ機器2−3の情報取得部27は、マスタ機器2−3が起動したときに、タイムアウト時間Tの初期値がマスタ機器2−3の通信パラメータDB260に設定されていない場合、他のマスタ機器2−1,2−2の通信パラメータDB260の内容を取得する(図5ステップS200)。上記のとおりマスタ機器2−1,2−2が起動する度に通信パラメータDB260に新たな通信履歴が追加されるので、マスタ機器2−1,2−2の通信パラメータDB260には、動作期間の異なる通信履歴が記録されている。   When the master device 2-3 is activated, the information acquisition unit 27 of the master device 2-3 determines that the initial value of the timeout time T is not set in the communication parameter DB 260 of the master device 2-3. The contents of the communication parameters DB 2-1 and 2-2 are acquired (step S200 in FIG. 5). As described above, a new communication history is added to the communication parameter DB 260 every time the master devices 2-1 and 2-2 are activated, so the communication parameters DB 260 of the master devices 2-1 and 2-2 Different communication histories are recorded.

マスタ機器2−3のタイムアウト時間算出部28は、情報取得部27によって取得された通信パラメータDB260の内容のうち、動作継続時間が最も長い通信履歴を抽出する。そして、タイムアウト時間算出部28は、抽出した通信履歴に含まれるタイムアウト時間Tの最大値Tmaxとタイムアウト時間Tの最小値Tminとデータ数の最大値Dmaxとデータ数の最小値Dminと、既設のマスタ機器2−1,2−2の台数Cと、発行予定のデータ要求でスレーブ機器1−1,1−2に要求するデータの数Dとに基づいて、当該データ要求に対応するタイムアウト時間Tの初期値を、要求先のスレーブ機器毎に算出する(図5ステップS201)。
T={(Tmax−Tmin)/(Dmax−Dmin)×(D−Dmin)
×(C+1)/C}+Tmin ・・・(1)
The timeout time calculation unit 28 of the master device 2-3 extracts the communication history having the longest operation continuation time from the contents of the communication parameter DB 260 acquired by the information acquisition unit 27. The timeout time calculation unit 28 then includes the maximum value Tmax of the timeout time T, the minimum value Tmin of the timeout time T, the maximum value Dmax of the number of data, the minimum value Dmin of the number of data, and the existing master included in the extracted communication history. Based on the number C of the devices 2-1 and 2-2 and the number D of data requested to the slave devices 1-1 and 1-2 in the data request to be issued, the timeout time T corresponding to the data request is determined. An initial value is calculated for each requested slave device (step S201 in FIG. 5).
T = {(Tmax−Tmin) / (Dmax−Dmin) × (D−Dmin)
× (C + 1) / C} + Tmin (1)

台数Cは、マスタ機器2−3の情報取得部27が通信を行ったマスタ機器2−1,2−2の台数である。
図4の例では、スレーブ機器1−1に関して、Tmax=240ms、Tmin=200ms、Dmax=56個、Dmin=45個、既設のマスタ機器2−1,2−2の台数C=2台となる。したがって、発行予定のデータ要求でスレーブ機器1−1に要求するデータの数Dが例えば50個とすれば、このデータ要求のタイムアウト時間Tは式(1)より227msとなる。発行予定のデータ要求の情報は、予め記憶部26に登録されている。したがって、タイムアウト時間算出部28は、発行予定のデータ要求の種類毎および要求先のスレーブ機器毎にタイムアウト時間Tの初期値を算出することが可能である。
The number C is the number of master devices 2-1 and 2-2 with which the information acquisition unit 27 of the master device 2-3 communicates.
In the example of FIG. 4, regarding the slave device 1-1, Tmax = 240 ms, Tmin = 200 ms, Dmax = 56, Dmin = 45, and the number of existing master devices 2-1 and 2-2 is C = 2. . Therefore, if the number of data D requested to the slave device 1-1 in the data request to be issued is 50, for example, the time-out time T for this data request is 227 ms from the equation (1). Information on the data request to be issued is registered in the storage unit 26 in advance. Accordingly, the timeout time calculation unit 28 can calculate the initial value of the timeout time T for each type of data request scheduled to be issued and for each slave device requested.

情報取得部27によって取得された通信パラメータDB260の内容のうち、動作継続時間が最も長い通信履歴を採用する理由は、タイムアウト時間Tの初期値を適切な値にするためである。同一のスレーブ機器について動作継続時間が同一の通信履歴が複数存在する場合には、これら複数の通信履歴のうちいずれかを使用すればよい。   The reason for adopting the communication history with the longest operation duration among the contents of the communication parameter DB 260 acquired by the information acquisition unit 27 is to set the initial value of the timeout time T to an appropriate value. When there are a plurality of communication histories having the same operation duration time for the same slave device, any one of the plurality of communication histories may be used.

マスタ機器2−3のタイムアウト時間設定部29は、発行予定のデータ要求の情報(データ要求で要求するデータの数、要求先のスレーブ機器)とこのデータ要求のタイムアウト時間Tの初期値とをマスタ機器2−3の記憶部26の通信パラメータDB260に記録する。こうして、タイムアウト時間Tの初期値が発行予定のデータ要求の種類毎および要求先のスレーブ機器毎に設定される(図5ステップS202)。図6はタイムアウト時間Tの初期値が設定されたときのマスタ機器2−3の通信パラメータDB260の内容の1例を示す図である。
以上で、ネットワーク3に新たに追加されたマスタ機器2−3が最初に起動したときのタイムアウト時間設定動作が終了し、以降は図3で説明した処理が実施される。
The timeout time setting unit 29 of the master device 2-3 masters the data request information (the number of data requested by the data request, the requested slave device) and the initial value of the timeout time T of the data request. It records in communication parameter DB260 of the memory | storage part 26 of the apparatus 2-3. In this way, the initial value of the timeout time T is set for each type of data request scheduled to be issued and for each requested slave device (step S202 in FIG. 5). FIG. 6 is a diagram showing an example of the contents of the communication parameter DB 260 of the master device 2-3 when the initial value of the timeout time T is set.
This completes the timeout time setting operation when the master device 2-3 newly added to the network 3 is first activated, and thereafter, the processing described with reference to FIG. 3 is performed.

以上のように、本実施例では、タイムアウト時間Tが既に設定されている既設のマスタ機器2−1,2−2からタイムアウト時間Tの情報を取得して、取得した情報と既設のマスタ機器2−1,2−2の台数とに基づいて、マスタ機器2−3に設定するタイムアウト時間Tの初期値を算出するようにしたので、スレーブ機器1−1,1−2と通信を行うことなく、既設のマスタ機器2−1,2−2の台数を考慮したマスタ機器2−3のタイムアウト時間Tの適切な初期値を容易に設定することができる。   As described above, in this embodiment, the information on the timeout time T is acquired from the existing master devices 2-1 and 2-2 in which the timeout time T is already set, and the acquired information and the existing master device 2 are acquired. Since the initial value of the timeout time T set in the master device 2-3 is calculated based on the numbers of -1 and 2-2, communication with the slave devices 1-1 and 1-2 is not performed. Therefore, it is possible to easily set an appropriate initial value of the timeout time T of the master device 2-3 in consideration of the number of existing master devices 2-1, 2-2.

なお、本実施例では、PLC(スレーブ機器1−1,1−2)、通信ゲートウェイ(マスタ機器2−1〜2−3)などのプロセス機器が接続された制御ネットワークに本発明を適用した例で説明しているが、本発明は他のネットワーク通信でも適用可能である。   In this embodiment, the present invention is applied to a control network to which process devices such as PLCs (slave devices 1-1 and 1-2) and communication gateways (master devices 2-1 to 2-3) are connected. However, the present invention is also applicable to other network communications.

本実施例のスレーブ機器1−1,1−2およびマスタ機器2−1〜2−3の各々は、CPU(Central Processing Unit)、記憶装置および外部とのインタフェースを備えたコンピュータと、これらのハードウェア資源を制御するプログラムによって実現することができる。各装置のCPUは、記憶装置に格納されたプログラムに従って本実施例で説明した処理を実行する。   Each of the slave devices 1-1 and 1-2 and the master devices 2-1 to 2-3 of the present embodiment includes a CPU (Central Processing Unit), a storage device, a computer having an interface with the outside, and hardware of these devices. It can be realized by a program that controls hardware resources. The CPU of each device executes the processing described in the present embodiment in accordance with a program stored in the storage device.

本発明は、マスタ・スレーブ方式の通信システムに適用することができる。   The present invention can be applied to a master-slave communication system.

1−1,1−2…スレーブ機器、2−1〜2−3…マスタ機器、3…ネットワーク、20…送信部、21…受信部、22…通信制御部、23…経過時間計測部、24,28…タイムアウト時間算出部、25…通信履歴記録部、26…記憶部、27…情報取得部、29…タイムアウト時間設定部、30…動作継続時間計測部、260…通信パラメータデータベース。   1-1, 1-2 ... slave device, 2-1 to 2-3 ... master device, 3 ... network, 20 ... transmission unit, 21 ... reception unit, 22 ... communication control unit, 23 ... elapsed time measurement unit, 24 , 28 ... timeout time calculation unit, 25 ... communication history recording unit, 26 ... storage unit, 27 ... information acquisition unit, 29 ... timeout time setting unit, 30 ... operation duration measurement unit, 260 ... communication parameter database.

Claims (4)

要求コマンドを送信するように構成された複数のマスタ機器と、
このマスタ機器とネットワークを介して接続され、前記要求コマンドで要求されたデータを含む応答メッセージを要求元のマスタ機器に返送するように構成された少なくとも1つのスレーブ機器とを備え、
前記マスタ機器は、
前記要求コマンドを要求先の前記スレーブ機器に送信し、前記要求コマンドを送信してからタイムアウト時間以内に前記応答メッセージを受信できなかった場合に前記要求コマンドの再送処理を行うように構成された通信制御部と、
データ要求の通信履歴を記憶するように構成された通信パラメータデータベースと、
マスタ機器の起動時に前記タイムアウト時間の初期値が設定されていない場合に、前記タイムアウト時間が既に設定されている他のマスタ機器からタイムアウト時間の情報を取得するように構成された情報取得部と、
この情報取得部によって取得されたタイムアウト時間と前記他のマスタ機器の台数とに基づいて、前記タイムアウト時間の初期値を算出するように構成された第1のタイムアウト時間算出部と、
前記タイムアウト時間の初期値を前記通信パラメータデータベースに設定するように構成されたタイムアウト時間設定部とを備えることを特徴とする通信システム。
A plurality of master devices configured to send request commands;
At least one slave device connected to the master device via a network and configured to return a response message including data requested by the request command to the requesting master device;
The master device is
A communication configured to transmit the request command to the slave device that is the request destination, and to perform retransmission processing of the request command when the response message is not received within a timeout period after the request command is transmitted A control unit;
A communication parameter database configured to store a communication history of data requests;
An information acquisition unit configured to acquire information on timeout time from another master device in which the timeout time is already set when the initial value of the timeout time is not set when the master device is started;
A first timeout time calculating unit configured to calculate an initial value of the timeout time based on the timeout time acquired by the information acquisition unit and the number of the other master devices;
A communication system, comprising: a timeout time setting unit configured to set an initial value of the timeout time in the communication parameter database.
請求項1記載の通信システムにおいて、
前記マスタ機器は、
前記要求コマンドを送信してから前記応答メッセージを受信するまでの応答時間に基づいて新たなタイムアウト時間を算出するように構成された第2のタイムアウト時間算出部と、
この第2のタイムアウト時間算出部によって算出されたタイムアウト時間を含む通信履歴を前記通信パラメータデータベースに記録することにより、前記タイムアウト時間の最新の値を設定するように構成された通信履歴記録部とをさらに備え、
前記情報取得部は、前記他のマスタ機器の通信パラメータデータベースに記録された通信履歴を取得することにより、前記タイムアウト時間の情報を取得することを特徴とする通信システム。
The communication system according to claim 1, wherein
The master device is
A second timeout time calculating unit configured to calculate a new timeout time based on a response time from when the request command is transmitted until the response message is received;
A communication history recording unit configured to set the latest value of the timeout time by recording a communication history including the timeout time calculated by the second timeout time calculating unit in the communication parameter database; In addition,
The information acquisition unit acquires the time-out time information by acquiring a communication history recorded in a communication parameter database of the other master device.
請求項2記載の通信システムにおいて、
前記通信履歴記録部は、前記要求コマンドで要求したデータの数と前記第2のタイムアウト時間算出部によって算出されたタイムアウト時間と要求先のスレーブ機器の情報とを少なくとも含む前記通信履歴を、前記通信パラメータデータベースに記録し、
前記第1のタイムアウト時間算出部は、前記情報取得部によって取得された通信履歴に含まれる前記タイムアウト時間の最大値および最小値と、この通信履歴に含まれる前記データの数の最大値および最小値と、前記他のマスタ機器の台数と、発行予定の要求コマンドで要求するデータの数とに基づいて、この要求コマンドに対応する前記タイムアウト時間の初期値を算出することを特徴とする通信システム。
The communication system according to claim 2, wherein
The communication history recording unit includes the communication history including at least the number of data requested by the request command, the time-out time calculated by the second time-out time calculating unit, and information of a requested slave device. Recorded in the parameter database,
The first timeout time calculation unit includes a maximum value and a minimum value of the timeout time included in the communication history acquired by the information acquisition unit, and a maximum value and a minimum value of the number of data included in the communication history. And an initial value of the timeout time corresponding to the request command based on the number of the other master devices and the number of data requested by the request command to be issued.
請求項2または3記載の通信システムにおいて、
前記第1のタイムアウト時間算出部は、前記情報取得部によって取得された通信履歴のうち前記他のマスタ機器の動作継続時間が最も長い動作期間のときに記録された通信履歴を前記タイムアウト時間の初期値の算出に用いることを特徴とする通信システム。
The communication system according to claim 2 or 3,
The first timeout time calculation unit is configured to display a communication history recorded during an operation period of the longest operation duration of the other master device among the communication histories acquired by the information acquisition unit as an initial value of the timeout time. A communication system characterized by being used for calculation of a value.
JP2017139678A 2017-07-19 2017-07-19 Communication system Pending JP2019022106A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017139678A JP2019022106A (en) 2017-07-19 2017-07-19 Communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017139678A JP2019022106A (en) 2017-07-19 2017-07-19 Communication system

Publications (1)

Publication Number Publication Date
JP2019022106A true JP2019022106A (en) 2019-02-07

Family

ID=65353128

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017139678A Pending JP2019022106A (en) 2017-07-19 2017-07-19 Communication system

Country Status (1)

Country Link
JP (1) JP2019022106A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023095851A1 (en) * 2021-11-26 2023-06-01 エドワーズ株式会社 Vacuum pump and control device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023095851A1 (en) * 2021-11-26 2023-06-01 エドワーズ株式会社 Vacuum pump and control device

Similar Documents

Publication Publication Date Title
JP2013123998A (en) Communication control device for vehicle
JP7115465B2 (en) DELAY PREDICTION DEVICE, DELAY PREDICTION SYSTEM, DELAY PREDICTION METHOD AND DELAY PREDICTION PROGRAM
CN107547619B (en) Timer parameter negotiation method and device
CN106465049A (en) Periodic management stabilization for Internet Of Things
JP2019022106A (en) Communication system
TWI599206B (en) Wireless communication quality information processing apparatus and communication system
CN116095111A (en) Configuration method and device of data acquisition equipment and platform server of Internet of things
JP5714067B2 (en) COMMUNICATION SYSTEM, SERVER DEVICE, CONTROL METHOD, AND PROGRAM
JP4192627B2 (en) Packet transmission / reception method and apparatus
KR101899967B1 (en) Method for monitoring device of network on vehicle
KR20220053386A (en) Data communication method and apparatus for efficient file transmission
JP7453061B2 (en) Communication control system and communication control method
WO2021149640A1 (en) Control device for industrial machine
US10263795B2 (en) System and method for reducing the energy consumption of an interconnection device
JP2005184551A (en) Communication apparatus, communication control method and communication control program
CN115208794B (en) Timer adjustment method, device, equipment and medium of Profibus-DP protocol
JP6838022B2 (en) Manufacturing equipment control and monitoring system
JP2809263B2 (en) Automatic message transmission device
WO2017154066A1 (en) Elevator control device
CN117336304A (en) Data retransmission method, device, electronic equipment and storage medium
JP6878705B1 (en) Communication devices, communication systems, communication methods, and programs
JP6415261B2 (en) Network device, control method, and program
KR101869536B1 (en) Apparatus for monitoring device of network on vehicle
US20180083740A1 (en) Communication apparatus and communication method
JPWO2023053158A5 (en)