Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6865600B2 - Communication relay device - Google Patents
[go: Go Back, main page]

JP6865600B2 - Communication relay device - Google Patents

Communication relay device Download PDF

Info

Publication number
JP6865600B2
JP6865600B2 JP2017030011A JP2017030011A JP6865600B2 JP 6865600 B2 JP6865600 B2 JP 6865600B2 JP 2017030011 A JP2017030011 A JP 2017030011A JP 2017030011 A JP2017030011 A JP 2017030011A JP 6865600 B2 JP6865600 B2 JP 6865600B2
Authority
JP
Japan
Prior art keywords
relay
communication
control device
data
unit
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.)
Active
Application number
JP2017030011A
Other languages
Japanese (ja)
Other versions
JP2018137573A (en
Inventor
斉藤 昌夫
昌夫 斉藤
規仁 石田
規仁 石田
晴彦 植木
晴彦 植木
正典 中村
正典 中村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Schneider Electric Japan Holdings Ltd
Original Assignee
Schneider Electric Japan Holdings 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 Schneider Electric Japan Holdings Ltd filed Critical Schneider Electric Japan Holdings Ltd
Priority to JP2017030011A priority Critical patent/JP6865600B2/en
Publication of JP2018137573A publication Critical patent/JP2018137573A/en
Application granted granted Critical
Publication of JP6865600B2 publication Critical patent/JP6865600B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Description

本発明は、データの授受を行う2つの機器の間に介在して、さらに他の機器からのデータの授受を中継する通信中継装置に関する。 The present invention relates to a communication relay device that intervenes between two devices that transfer data and relays data transfer from another device.

プログラマブル表示器のようなHMI(Human Machine Interface)機器は、PLC(Programmable Logic Controller)などの制御機器と接続され、データの授受のために制御機器と相互に通信を行う。例えば、特許文献1には、PLCとの間でシリアル通信を行うプログラマブル表示器が開示されている。 An HMI (Human Machine Interface) device such as a programmable display is connected to a control device such as a PLC (Programmable Logic Controller) and communicates with the control device for data transfer. For example, Patent Document 1 discloses a programmable display that performs serial communication with a PLC.

特開2016−126487号公報(2016年7月11日公開)Japanese Unexamined Patent Publication No. 2016-126487 (published on July 11, 2016)

上述のようなシステムにおいて、データ収集、データ解析などの目的で、PLCからデータを取得したい場合、例えば、PLCの予備の通信ポートにデータロガーのような機器を接続し、データロガーによってデータを取得することが考えられる。しかしながら、PLCが予備の通信ポートを備えていなければ、データロガーによってデータを取得することができない。 In the above system, when you want to acquire data from PLC for the purpose of data collection, data analysis, etc., for example, connect a device such as a data logger to the spare communication port of PLC and acquire the data by the data logger. It is conceivable to do. However, if the PLC does not have a spare communication port, the data cannot be acquired by the data logger.

本発明の一態様は、予備の通信ポートを有していない制御機器からデータを取得することを目的とする。 One aspect of the present invention is to obtain data from a control device that does not have a spare communication port.

上記の課題を解決するために、本発明の一態様に係る通信中継装置は、ホスト機器と、当該ホスト機器からの要求に応じてデータの読み出しおよび書き込みをする制御機器との間でシリアル通信を行うとともに、データを管理するデータ管理機器からの要求を前記制御機器に送信する通信中継装置であって、データを伝送するデータ伝送路と、前記データ伝送路を介した第1通信経路を通じて前記ホスト機器と前記制御機器との間の通信を中継するとともに、前記データ伝送路を介した第2通信経路を通じて前記データ管理機器と前記制御機器との通信を中継する中継処理部と、前記中継処理部が動作しているときに、前記ホスト機器および前記制御機器を前記第1通信経路に接続する一方、前記中継処理部が動作していないときに、前記ホスト機器と前記制御機器とを相互に接続する通信経路切替部とを備えている。 In order to solve the above problems, the communication relay device according to one aspect of the present invention performs serial communication between a host device and a control device that reads and writes data in response to a request from the host device. A communication relay device that transmits a request from a data management device that manages data to the control device, and the host through a data transmission path for transmitting data and a first communication path via the data transmission path. A relay processing unit that relays communication between the device and the control device and relays communication between the data management device and the control device through a second communication path via the data transmission line, and the relay processing unit. Is operating, the host device and the control device are connected to the first communication path, while the relay processing unit is not operating, the host device and the control device are connected to each other. It is equipped with a communication path switching unit.

上記の構成によれば、中継処理部が動作している状態では、ホスト機器および制御機器が、第1通信経路を介して通信するとともに、データ管理機器および制御機器が、第2通信経路を介して通信する。それゆえ、ホスト機器と制御機器との通信を行いながら、その合間にホスト機器とデータ管理機器との通信を行うことができる。したがって、制御機器が予備の通信ポートを有していなくても、データ管理機器との通信を行うことができる。 According to the above configuration, in the state where the relay processing unit is operating, the host device and the control device communicate via the first communication path, and the data management device and the control device communicate via the second communication path. To communicate. Therefore, it is possible to communicate between the host device and the data management device while communicating between the host device and the control device. Therefore, even if the control device does not have a spare communication port, it is possible to communicate with the data management device.

また、中継制御部が動作していない状態では、ホスト機器および制御機器の間の通信が、ホスト機器と制御機器とが相互に接続されることによって維持される。したがって、中継制御部の動作が動作していないときに、ホスト機器および制御機器の間の通信が行なわれないという不都合を回避することができる。 Further, when the relay control unit is not operating, communication between the host device and the control device is maintained by connecting the host device and the control device to each other. Therefore, it is possible to avoid the inconvenience that communication between the host device and the control device is not performed when the operation of the relay control unit is not operating.

前記通信中継装置は、前記ホスト機器と制御機器との間で通信の有無を監視する通信監視部と、前記通信監視部によって通信が無いと判定されたときに、前記第1通信経路への前記ホスト機器および前記制御機器の接続と、ホスト機器および前記制御機器の相互接続とを切り替える動作を行うように前記通信経路切替部を制御する切替制御部とをさらに備えている。 The communication relay device includes a communication monitoring unit that monitors the presence or absence of communication between the host device and the control device, and when the communication monitoring unit determines that there is no communication, the communication relay device connects to the first communication path. It further includes a switching control unit that controls the communication path switching unit so as to perform an operation of switching between the connection of the host device and the control device and the interconnection of the host device and the control device.

上記の構成によれば、ホスト機器および制御機器の間で通信が行なわれていない状態で信号経路切替部による切り替え動作が行われる。これにより、通信途中のデータが当該切り替え動作によって喪失されることを回避できる。 According to the above configuration, the switching operation by the signal path switching unit is performed in a state where communication is not performed between the host device and the control device. As a result, it is possible to prevent data during communication from being lost due to the switching operation.

前記通信中継装置は、前記データ管理機器からの前記制御機器への要求に、前記ホスト機器からの前記制御機器への要求に対する優先度を設定する優先度設定部をさらに備え、前記中継処理部は、設定された前記優先度にしたがって、前記データ管理機器からの要求を前記制御機器に送信する。 The communication relay device further includes a priority setting unit that sets a priority for a request from the data management device to the control device and a request from the host device to the control device, and the relay processing unit includes a priority setting unit. , The request from the data management device is transmitted to the control device according to the set priority.

上記の構成によれば、ホスト機器と制御機器との間の通信量に応じて優先度を設定することにより、効率的にデータ管理機器からの要求を前記制御機器に送信することができる。 According to the above configuration, the request from the data management device can be efficiently transmitted to the control device by setting the priority according to the amount of communication between the host device and the control device.

前記通信中継装置は、前記制御機器との間の通信のボーレートを標準ボーレートよりも高速の高速ボーレートに設定するボーレート設定部をさらに備え、前記中継処理部は、前記制御機器との間の通信を設定された前記高速ボーレートで行う。 The communication relay device further includes a baud rate setting unit that sets the baud rate of communication with the control device to a high-speed baud rate higher than the standard baud rate, and the relay processing unit performs communication with the control device. This is performed at the set high-speed baud rate.

上記の構成によれば、通信中継装置と高速ボーレートに対応した制御機器との間で、高速ボーレートで通信をすることができる。これにより、通信中継装置と制御機器との通信時間を短縮することができる。 According to the above configuration, communication can be performed at a high speed baud rate between the communication relay device and the control device corresponding to the high speed baud rate. As a result, the communication time between the communication relay device and the control device can be shortened.

前記通信中継装置において、前記中継処理部は、前記ホスト機器に対する通信処理と、前記制御機器に対する通信処理とを個別に行う。 In the communication relay device, the relay processing unit individually performs communication processing for the host device and communication processing for the control device.

上記の構成によれば、中継処理部は、ホスト機器と通信している間に、制御機器に別の要求を送信することができる。このように、2つの通信を同時に行なうことで通信時間を短縮することができる。したがって、通信中継装置の処理能力を向上させることができる。 According to the above configuration, the relay processing unit can send another request to the control device while communicating with the host device. In this way, the communication time can be shortened by performing the two communications at the same time. Therefore, the processing capacity of the communication relay device can be improved.

前記通信中継装置は、前記データ管理機器からの前記制御機器への要求のサイズが所定値を超えるときに、当該要求を所定のサイズに分割する要求分割部をさらに備え、前記中継処理部は、前記ホスト機器からの要求と、当該要求に対する前記制御機器の前記ホスト機器への応答との一連の処理が行われていない期間に、分割された前記データ管理機器からの要求を前記制御機器に送信する。 The communication relay device further includes a request dividing unit that divides the request into a predetermined size when the size of the request from the data management device to the control device exceeds a predetermined value, and the relay processing unit includes a request dividing unit. A divided request from the data management device is transmitted to the control device during a period in which a series of processes of the request from the host device and the response of the control device to the host device in response to the request are not performed. To do.

上記の構成によれば、分割された要求の個々のサイズが小さくなるので、データ管理機器からの要求を処理するために、ホスト機器から制御機器への要求の送信が待たされることを抑制できる。これにより、ホスト機器と制御機器との間の通信の効率が低下することを抑制することができる。 According to the above configuration, since the individual size of the divided request is reduced, it is possible to suppress waiting for the transmission of the request from the host device to the control device in order to process the request from the data management device. As a result, it is possible to suppress a decrease in communication efficiency between the host device and the control device.

前記通信中継装置において、前記中継処理部は、前記ホスト機器から前記制御機器への書き込みの要求を、前記優先度に関わらず、前記データ管理機器からの前記制御機器への要求よりも優先して、前記制御機器に送信する。 In the communication relay device, the relay processing unit gives priority to a request for writing from the host device to the control device over a request from the data management device to the control device regardless of the priority. , Transmit to the control device.

ホスト機器から制御機器へのデータの書き込みは、制御機器への指示などの重要な要求であることが多い。したがって、上記の構成によれば、ホスト機器から制御機器への書き込みの要求を最優先して実行することができる。 Writing data from the host device to the control device is often an important request such as an instruction to the control device. Therefore, according to the above configuration, the request for writing from the host device to the control device can be executed with the highest priority.

前記通信中継装置は、前記中継処理部の動作にエラーが生じたことを検知するエラー検知部をさらに備え、前記通信経路切替部は、前記エラー検知部によってエラーが検知されたときに、前記ホスト機器と前記制御機器とを相互に接続する。 The communication relay device further includes an error detection unit that detects that an error has occurred in the operation of the relay processing unit, and the communication path switching unit is the host when an error is detected by the error detection unit. The device and the control device are interconnected.

上記の構成によれば、中継処理部の動作にエラーが生じたときに、ホスト機器と制御機器との間の通信が、ホスト機器および制御機器の相互接続によって維持される。これにより、中継処理部の動作にエラーが生じたために、ホスト機器と制御機器との間の通信が不能になるという不都合を回避することができる。 According to the above configuration, when an error occurs in the operation of the relay processing unit, the communication between the host device and the control device is maintained by the interconnection of the host device and the control device. As a result, it is possible to avoid the inconvenience that communication between the host device and the control device becomes impossible due to an error in the operation of the relay processing unit.

本発明の一態様によれば、予備の通信ポートを有していない制御機器から容易にデータを取得することができるという効果を奏する。 According to one aspect of the present invention, there is an effect that data can be easily acquired from a control device that does not have a spare communication port.

本発明の各実施形態に係る制御システムの構成を示すブロック図である。It is a block diagram which shows the structure of the control system which concerns on each embodiment of this invention. 本発明の実施形態1に係る上記制御システムにおける通信中継装置の要部の構成を示すブロック図である。It is a block diagram which shows the structure of the main part of the communication relay device in the said control system which concerns on Embodiment 1 of this invention. (a)は上記通信中継装置の中継制御部が動作していない状態を示す図であり、(b)は上記通信中継装置の中継制御部が動作している状態を示す図である。(A) is a diagram showing a state in which the relay control unit of the communication relay device is not operating, and (b) is a diagram showing a state in which the relay control unit of the communication relay device is operating. 上記通信中継装置の起動時の処理手順を示すフローチャートである。It is a flowchart which shows the processing procedure at the time of starting the said communication relay device. 上記通信中継装置がオフライン状態に移行したときの上記中継制御部による処理手順を示すフローチャートである。It is a flowchart which shows the processing procedure by the relay control unit when the communication relay device goes into an offline state. 例外エラー発生時の上記中継制御部による処理手順を示すフローチャートである。It is a flowchart which shows the processing procedure by the said relay control part when an exception error occurs. (a)は上記通信中継装置の通常動作時における上記中継制御部による処理手順を示すフローチャートであり、(b)は上記通信中継装置の異常動作時における上記中継制御部による処理手順を示すフローチャートである。(A) is a flowchart showing a processing procedure by the relay control unit during normal operation of the communication relay device, and (b) is a flowchart showing a processing procedure by the relay control unit during abnormal operation of the communication relay device. is there. 本発明の実施形態2に係る上記制御システムにおける通信中継装置の要部の構成を示すブロック図である。It is a block diagram which shows the structure of the main part of the communication relay device in the said control system which concerns on Embodiment 2 of this invention. 図8に示す通信中継装置を介した上記制御システムにおけるホスト機器および制御機器の間の通信の状態を示す図である。FIG. 5 is a diagram showing a state of communication between a host device and a control device in the control system via the communication relay device shown in FIG. 本発明の実施形態3に係る上記制御システムにおける通信中継装置の要部の構成を示すブロック図である。It is a block diagram which shows the structure of the main part of the communication relay device in the said control system which concerns on Embodiment 3 of this invention. 図10に示す通信中継装置における共通メモリを介した通信の概念を示す図である。It is a figure which shows the concept of communication through a common memory in the communication relay device shown in FIG. (a)は図10に示す通信中継装置を介した上記ホスト機器および上記制御機器の間の通信の状態を示す図であり、(b)は図10に示す通信中継装置を介した上記ホスト機器および上記制御機器の間の通信の他の状態を示す図である。(A) is a diagram showing a state of communication between the host device and the control device via the communication relay device shown in FIG. 10, and (b) is a diagram showing the state of communication between the host device and the control device via the communication relay device shown in FIG. And other states of communication between the control devices. 図10に示す通信中継装置を介した上記ホスト機器および上記制御機器の間の通信のさらに他の状態を示す図である。It is a figure which shows the other state of the communication between the said host device and the said control device through the communication relay device shown in FIG.

〔実施形態1〕
本発明の実施形態1について図1〜図7に基づいて説明すると、以下の通りである。
[Embodiment 1]
The first embodiment of the present invention will be described below with reference to FIGS. 1 to 7.

図1は、本実施形態を含む各実施形態に係る制御システム100の構成を示すブロック図である。図2は、実施形態1に係る制御システム100における通信中継装置20の要部の構成を示すブロック図である。 FIG. 1 is a block diagram showing a configuration of a control system 100 according to each embodiment including the present embodiment. FIG. 2 is a block diagram showing a configuration of a main part of the communication relay device 20 in the control system 100 according to the first embodiment.

まず、制御システム100の概要について説明する。 First, the outline of the control system 100 will be described.

図1に示すように、制御システム100は、通信中継装置20と、ホスト機器30と、制御機器40と、デバイス50と、LAN(Local Area Network)60と、データ管理機器70とを備えている。 As shown in FIG. 1, the control system 100 includes a communication relay device 20, a host device 30, a control device 40, a device 50, a LAN (Local Area Network) 60, and a data management device 70. ..

通信中継装置20は、ホスト機器30と制御機器40とをハードウェアで接続するハードウェア通信経路と、ホスト機器30と制御機器40とをソフトウェアで接続するソフトウェア通信経路とを有している。また、通信中継装置20は、ソフトウェア通信経路を介して、データ管理機器70からの要求に応じて、データ管理機器70と制御機器40との間の通信を中継する。 The communication relay device 20 has a hardware communication path for connecting the host device 30 and the control device 40 by hardware, and a software communication path for connecting the host device 30 and the control device 40 with software. Further, the communication relay device 20 relays the communication between the data management device 70 and the control device 40 in response to a request from the data management device 70 via the software communication path.

通信中継装置20およびホスト機器30は、シリアル通信を行うことができるように、シリアル通信ケーブルを介して相互に接続されている。同じく、通信中継装置20および制御機器40は、シリアル通信を行うことができるように、シリアル通信ケーブルを介して相互に接続されている。通信中継装置20は、制御機器40との通信のための通信ポートとしてシリアルポートCOM1を備えている。また、通信中継装置20は、ホスト機器30との通信のための通信ポートとしてシリアルポートCOM2を備えている。 The communication relay device 20 and the host device 30 are connected to each other via a serial communication cable so that serial communication can be performed. Similarly, the communication relay device 20 and the control device 40 are connected to each other via a serial communication cable so that serial communication can be performed. The communication relay device 20 includes a serial port COM1 as a communication port for communication with the control device 40. Further, the communication relay device 20 includes a serial port COM2 as a communication port for communication with the host device 30.

通信中継装置20およびデータ管理機器70は、LAN(Local Area Network)60を介した通信を行うことができるように、LANケーブル、ルータなどを介して相互に接続されている。 The communication relay device 20 and the data management device 70 are connected to each other via a LAN cable, a router, or the like so that communication can be performed via a LAN (Local Area Network) 60.

制御機器40は、制御機能を有する機器であり、例えば、PLC(Programmable Logic Controller)で構成される。制御機器40は、デバイス50との間でデータの授受を行う。デバイス50としては、センサ、スイッチのような入力機器や、アクチュエータ、リレー、電磁弁、表示器のような出力機器が用いられる。また、制御機器40は、温度調節計、インバータ等の機器で構成されてもよい。 The control device 40 is a device having a control function, and is composed of, for example, a PLC (Programmable Logic Controller). The control device 40 exchanges data with and from the device 50. As the device 50, input devices such as sensors and switches, and output devices such as actuators, relays, solenoid valves, and indicators are used. Further, the control device 40 may be composed of devices such as a temperature controller and an inverter.

ホスト機器30は、プログラマブル表示器などのHMI機器であり、表示装置およびタッチパネルを有している。ホスト機器30は、表示装置に表示された画面上でのタッチパネルによる入力操作によって制御機器40に制御指示などのデータを送信したり、制御機器40のデバイス50に関するデータなどのデータを受信したりする。ホスト機器30は、このようなデータの送受信を行うために、制御機器40に対してデータの読み出しを要求したり、データの書き込みを要求したりする。 The host device 30 is an HMI device such as a programmable display, and has a display device and a touch panel. The host device 30 transmits data such as a control instruction to the control device 40 by an input operation using the touch panel on the screen displayed on the display device, and receives data such as data related to the device 50 of the control device 40. .. The host device 30 requests the control device 40 to read the data or write the data in order to send and receive such data.

データ管理機器70は、データ収集、データ解析、データ書き込みなどの各種のデータを管理する処理を行う機器である。データ管理機器70は、パーソナルコンピュータ、専用の装置などで構成されている。 The data management device 70 is a device that performs processing for managing various types of data such as data collection, data analysis, and data writing. The data management device 70 is composed of a personal computer, a dedicated device, and the like.

次に、通信中継装置20のハードウェア構成について説明する。 Next, the hardware configuration of the communication relay device 20 will be described.

図1に示すように、通信中継装置20は、CPU(Central Processing Unit)1と、メインメモリ2と、ROM(Read Only Memory)3と、第1ドライバ/レシーバ4と、第2ドライバ/レシーバ5と、第1UART(Universal Asynchronous Receiver Transmitter)6と、第2UART7と、第1リレー8(通信経路切替部)と、第2リレー9(通信経路切替部)と、LANインターフェース部10と、電源回路11と、データバス12(データ伝送路)とを備えている。 As shown in FIG. 1, the communication relay device 20 includes a CPU (Central Processing Unit) 1, a main memory 2, a ROM (Read Only Memory) 3, a first driver / receiver 4, and a second driver / receiver 5. The first UART (Universal Asynchronous Receiver Transmitter) 6, the second UART 7, the first relay 8 (communication path switching unit), the second relay 9 (communication path switching unit), the LAN interface unit 10, and the power supply circuit 11. And a data bus 12 (data transmission line).

CPU1は、通信中継装置20を動作させるためのシステムプログラムを実行する処理装置である。具体的には、CPU1は、システムプログラムの実行に際して、メインメモリ2、第1ドライバ/レシーバ4と、第2ドライバ/レシーバ5、LANインターフェース部10などからデータを受け取り、当該データに対して演算または加工を施した上で、メインメモリ2、第1ドライバ/レシーバ4と、第2ドライバ/レシーバ5、LANインターフェース部10などに出力する。 The CPU 1 is a processing device that executes a system program for operating the communication relay device 20. Specifically, when executing the system program, the CPU 1 receives data from the main memory 2, the first driver / receiver 4, the second driver / receiver 5, the LAN interface unit 10, and the like, and calculates or calculates the data. After processing, the data is output to the main memory 2, the first driver / receiver 4, the second driver / receiver 5, the LAN interface unit 10, and the like.

また、CPU1は、ウォッチドッグタイマ1aを内蔵している。ウォッチドッグタイマ1aは、後述する中継制御部13からの反応の時間間隔を計測し、その計測値が規定時間を超えるか否かを判定することにより、中継制御部13の動作を監視する。ウォッチドッグタイマ1aは、中継制御部13からの反応が規定時間の間に取得できたときにはタイマを更新し、中継制御部13からの反応が規定時間の間に取得できないときにタイムアウトのエラー処理としてシステムをリセットする。なお、ウォッチドッグタイマ1aは、CPU1の外部に設けられていてもよい。 Further, the CPU 1 has a built-in watchdog timer 1a. The watchdog timer 1a monitors the operation of the relay control unit 13 by measuring the time interval of the reaction from the relay control unit 13 described later and determining whether or not the measured value exceeds the specified time. The watchdog timer 1a updates the timer when the response from the relay control unit 13 can be acquired within the specified time, and as a timeout error process when the response from the relay control unit 13 cannot be acquired within the specified time. Reset the system. The watchdog timer 1a may be provided outside the CPU 1.

メインメモリ2は、通信中継装置20における主記憶装置を構成するメモリであり、DRAM(Dynamic Random Access Memory)によって構成される。 The main memory 2 is a memory constituting the main storage device in the communication relay device 20, and is composed of a DRAM (Dynamic Random Access Memory).

ROM3は、通信中継装置20の起動時やリセット時に実行されるBIOS(Basic Input Output System)などの、通信中継装置20の動作に不可欠なプログラム(上述のシステムプログラムを含む)を記憶している。 The ROM 3 stores programs (including the above-mentioned system programs) that are indispensable for the operation of the communication relay device 20, such as a BIOS (Basic Input Output System) that is executed when the communication relay device 20 is started up or reset.

第1ドライバ/レシーバ4は、ホスト機器30から受信データRxDを受信する受信回路であり、かつホスト機器30へ送信データTxDを送信する送信回路である。 The first driver / receiver 4 is a receiving circuit that receives received data RxD from the host device 30, and is a transmitting circuit that transmits transmission data TxD to the host device 30.

第2ドライバ/レシーバ5は、制御機器40から受信データRxDを受信する受信回路であり、かつ制御機器40へ送信データTxDを送信する送信回路である。 The second driver / receiver 5 is a receiving circuit that receives received data RxD from the control device 40, and is a transmitting circuit that transmits transmission data TxD to the control device 40.

第1ドライバ/レシーバ4および第2ドライバ/レシーバ5は、一般のシリアル通信の規格(RS−232C、RS−422、RS−485など)に対応している。 The first driver / receiver 4 and the second driver / receiver 5 correspond to general serial communication standards (RS-232C, RS-422, RS-485, etc.).

第1UART6は、第1ドライバ/レシーバ4から出力される調歩同期方式のシリアル信号をパラレル信号に変換してデータバス12に出力する回路である。また、第1UART6は、データバス12から第1ドライバ/レシーバ4に入力されるパラレル信号を調歩同期方式のシリアル信号に変換する回路である。また、第1UART6は、送信用のバッファと受信用のバッファとを内蔵している。 The first UART 6 is a circuit that converts a pacing-synchronized serial signal output from the first driver / receiver 4 into a parallel signal and outputs the serial signal to the data bus 12. Further, the first UART 6 is a circuit that converts a parallel signal input from the data bus 12 to the first driver / receiver 4 into a serial signal of the pace synchronization method. Further, the first UART 6 has a built-in buffer for transmission and a buffer for reception.

第2UART7は、第2ドライバ/レシーバ5から出力される調歩同期方式のシリアル信号をパラレル信号に変換してデータバス12に出力する回路である。また、第2UART7は、データバス12から第2ドライバ/レシーバ5に入力されるパラレル信号を調歩同期方式のシリアル信号に変換する回路である。また、第2UART7は、送信用のバッファと受信用のバッファとを内蔵している。 The second UART 7 is a circuit that converts a pacing-synchronized serial signal output from the second driver / receiver 5 into a parallel signal and outputs the serial signal to the data bus 12. Further, the second UART 7 is a circuit that converts a parallel signal input from the data bus 12 to the second driver / receiver 5 into a serial signal of the pace synchronization method. Further, the second UART 7 has a built-in buffer for transmission and a buffer for reception.

第1リレー8は、シリアルポートCOM2と第1ドライバ/レシーバ4との間に介在している。第1リレー8は、ホスト機器30と制御機器40とを相互に接続して制御機器40からホスト機器30へ通信データを伝送する通信経路と、ホスト機器30と第1ドライバ/レシーバ4との間の通信経路とを切り替える回路である。このため、第1リレー8は、出力端子8aと、第1入力接点8bと、第2入力接点8cとを有している。出力端子8aは、シリアルポートCOM2と接続されている。第1入力接点8bは、第1ドライバ/レシーバ4の出力端子と接続されている。第2入力接点8cは、シリアルポートCOM1と第2ドライバ/レシーバ5の入力端子との間の、制御機器40からの通信データが伝送される通信経路と接続されている。 The first relay 8 is interposed between the serial port COM2 and the first driver / receiver 4. The first relay 8 connects the host device 30 and the control device 40 to each other and transmits communication data from the control device 40 to the host device 30 between the host device 30 and the first driver / receiver 4. It is a circuit that switches between the communication path and the communication path of. Therefore, the first relay 8 has an output terminal 8a, a first input contact 8b, and a second input contact 8c. The output terminal 8a is connected to the serial port COM2. The first input contact 8b is connected to the output terminal of the first driver / receiver 4. The second input contact 8c is connected to a communication path between the serial port COM1 and the input terminal of the second driver / receiver 5 to which communication data from the control device 40 is transmitted.

第2リレー9は、シリアルポートCOM1と第2ドライバ/レシーバ5との間に介在している。第2リレー9は、ホスト機器30と制御機器40とを相互に接続してホスト機器30から制御機器40へ通信データを伝送する通信経路と、制御機器40と第2ドライバ/レシーバ5との間の通信経路とを切り替える回路である。このため、第2リレー9は、出力端子9aと、第1入力接点9bと、第2入力接点9cとを有している。出力端子9aは、シリアルポートCOM1と接続されている。第1入力接点9bは、第2ドライバ/レシーバ5の出力端子と接続されている。第2入力接点9cは、シリアルポートCOM2と第1ドライバ/レシーバ4の入力端子との間の、ホスト機器30からの通信データが伝送される通信経路と接続されている。 The second relay 9 is interposed between the serial port COM1 and the second driver / receiver 5. The second relay 9 connects the host device 30 and the control device 40 to each other and transmits communication data from the host device 30 to the control device 40, and between the control device 40 and the second driver / receiver 5. It is a circuit that switches between the communication path and the communication path of. Therefore, the second relay 9 has an output terminal 9a, a first input contact 9b, and a second input contact 9c. The output terminal 9a is connected to the serial port COM1. The first input contact 9b is connected to the output terminal of the second driver / receiver 5. The second input contact 9c is connected to a communication path between the serial port COM2 and the input terminal of the first driver / receiver 4 to which communication data from the host device 30 is transmitted.

第1リレー8および第2リレー9の切り替えは、CPU1(後述の切替制御部18)によって制御される。 Switching between the first relay 8 and the second relay 9 is controlled by the CPU 1 (switching control unit 18 described later).

なお、本実施形態では、ホスト機器30に対する第1ドライバ/レシーバ4と制御機器40との接続の切り替えに第1リレー8を用い、制御機器40に対する第2ドライバ/レシーバ5とホスト機器30との接続の切り替えに第2リレー9を用いている。このような接続の切り替えには、第1リレー8および第2リレー9に限らず、切替制御部18による切替制御が可能な電子制御式の半導体スイッチなどを用いることができる。 In this embodiment, the first relay 8 is used to switch the connection between the first driver / receiver 4 to the host device 30 and the control device 40, and the second driver / receiver 5 to the control device 40 and the host device 30 are connected to each other. The second relay 9 is used for switching the connection. For such connection switching, not only the first relay 8 and the second relay 9 but also an electronically controlled semiconductor switch or the like capable of switching control by the switching control unit 18 can be used.

以降の説明において、第1リレー8が出力端子8aと第2入力接点8cとを接続する状態、および第2リレー9が出力端子9aと第2入力接点9cとを接続する状態をバイパス接続状態と称する。また、第1リレー8が出力端子8aと第1入力接点8bとを接続する状態、および第2リレー9が出力端子9aと第1入力接点9bとを接続する状態を中継接続状態と称する。 In the following description, the state in which the first relay 8 connects the output terminal 8a and the second input contact 8c and the state in which the second relay 9 connects the output terminal 9a and the second input contact 9c are referred to as a bypass connection state. Refer to. Further, a state in which the first relay 8 connects the output terminal 8a and the first input contact 8b and a state in which the second relay 9 connects the output terminal 9a and the first input contact 9b are referred to as a relay connection state.

LANインターフェース部10は、データ管理機器70などの外部機器を通信中継装置20とLAN通信が可能となるように接続するためのインターフェースである。LANインターフェース部10は、LAN60と接続されている。 The LAN interface unit 10 is an interface for connecting an external device such as the data management device 70 to the communication relay device 20 so as to enable LAN communication. The LAN interface unit 10 is connected to the LAN 60.

電源回路11は、通信中継装置20の各部(メインメモリ2、ROM3、第1ドライバ/レシーバ4、第2ドライバ/レシーバ5、第1UART6、第2UART7、LANインターフェース部10など)に電力を供給する回路である。通信中継装置20の起動時には電源回路11がオンされ、通信中継装置20の停止時には電源回路11がオフされる。 The power supply circuit 11 is a circuit that supplies electric power to each part (main memory 2, ROM3, first driver / receiver 4, second driver / receiver 5, first UART6, second UART7, LAN interface part 10, etc.) of the communication relay device 20. Is. The power supply circuit 11 is turned on when the communication relay device 20 is started, and the power supply circuit 11 is turned off when the communication relay device 20 is stopped.

続いて、通信中継装置20のシステム構成について、図2を参照して説明する。なお、図2においては、便宜上、第1ドライバ/レシーバ4、第2ドライバ/レシーバ5、第1UART6および第2UART7を省略している。 Subsequently, the system configuration of the communication relay device 20 will be described with reference to FIG. In FIG. 2, for convenience, the first driver / receiver 4, the second driver / receiver 5, the first UART6, and the second UART7 are omitted.

図2に示すように、通信中継装置20は、通信中継機能を実現するために中継制御部13を含んでいる。中継制御部13は、通信中継プログラムがCPU1によって実行されることで実現される、通信中継機能を有する部分である。通信中継機能は、上述のハードウェア通信経路とソフトウェア通信経路とを切り替える機能と、ソフトウェア通信経路を介してデータ管理機器70と制御機器40との間の通信を中継する機能とを含んでいる。 As shown in FIG. 2, the communication relay device 20 includes a relay control unit 13 in order to realize the communication relay function. The relay control unit 13 is a part having a communication relay function realized by executing the communication relay program by the CPU 1. The communication relay function includes a function of switching between the hardware communication path and the software communication path described above, and a function of relaying communication between the data management device 70 and the control device 40 via the software communication path.

中継制御部13は、起動・停止制御部14と、受信データ監視部15(通信監視部)と、オフライン設定部16と、エラー処理部17(エラー検知部)と、切替制御部18と、中継処理部19とを有している。 The relay control unit 13 relays the start / stop control unit 14, the reception data monitoring unit 15 (communication monitoring unit), the offline setting unit 16, the error processing unit 17 (error detection unit), the switching control unit 18, and the relay. It has a processing unit 19.

起動・停止制御部14は、電源回路11がオンされてから中継制御部13が動作可能になるまでの各部の初期化(例えば通信ドライバの初期化)などを行う。また、起動・停止制御部14は、電源回路11がオフされてから中継制御部13が動作を停止するまでの各部の終了処理などを行う。また、起動・停止制御部14は、電源回路11がオンされてから中継制御部13が動作可能になるまでの起動前の期間に起動前通知を後述する切替制御部18に与える。また、起動・停止制御部14は、電源回路11がオンされた後に中継制御部13が動作可能になったという動作可能通知を後述する切替制御部18に与える。また、起動・停止制御部14は、電源回路11がオフされたときに中継制御部13が動作を停止するという動作停止通知を切替制御部18に与える。 The start / stop control unit 14 initializes each unit (for example, initialization of the communication driver) from the time when the power supply circuit 11 is turned on until the relay control unit 13 becomes operable. Further, the start / stop control unit 14 performs termination processing of each unit from when the power supply circuit 11 is turned off until the relay control unit 13 stops operating. Further, the start / stop control unit 14 gives a pre-start notification to the switching control unit 18, which will be described later, during the period before the start from when the power supply circuit 11 is turned on until the relay control unit 13 becomes operable. Further, the start / stop control unit 14 gives an operable notification to the switching control unit 18, which will be described later, that the relay control unit 13 has become operable after the power supply circuit 11 is turned on. Further, the start / stop control unit 14 gives an operation stop notification to the switching control unit 18 that the relay control unit 13 stops the operation when the power supply circuit 11 is turned off.

受信データ監視部15は、ホスト機器30および制御機器40から受信された受信データRxDを監視することにより、ホスト機器30および制御機器40の通信の有無を監視する。受信データ監視部15は、具体的には、受信データRxDに含まれるパケットの状態を監視しており、送信されるパケットの間隔が、所定の間隔以上であるときに、切替可能通知を切替制御部18に与える。上記の所定の間隔とは、パケット通信が行われていないと判定できる最短の時間のことである。 The reception data monitoring unit 15 monitors the presence / absence of communication between the host device 30 and the control device 40 by monitoring the received data RxD received from the host device 30 and the control device 40. Specifically, the reception data monitoring unit 15 monitors the state of the packets included in the reception data RxD, and when the interval between the transmitted packets is equal to or greater than a predetermined interval, the switchable notification is switched and controlled. Give to part 18. The above-mentioned predetermined interval is the shortest time during which it can be determined that packet communication is not being performed.

オフライン設定部16は、後述する中継処理部19が中継処理を行なわない期間(オフライン期間)に各種の設定(オフライン設定)を行うために設けられている。オフライン設定部16が行う設定としては、例えば、ボーレートなどの通信設定、IPアドレスの設定などが挙げられる。オフライン設定部16に対する設定は、LAN60に接続された図示しない設定装置80(パーソナルコンピュータなど)から行なわれるが、設定画面を表示する表示部と、設定入力を行う入力部とを備えた通信中継装置20によって行われてもよい。また、オフライン設定部16は、オフライン設定を開始すること、およびオフライン設定を終了することを切替制御部18に通知する。 The offline setting unit 16 is provided to make various settings (offline setting) during a period (offline period) in which the relay processing unit 19 described later does not perform relay processing. Examples of the settings performed by the offline setting unit 16 include communication settings such as baud rate and IP address settings. The setting for the offline setting unit 16 is performed from a setting device 80 (personal computer or the like) (not shown) connected to the LAN 60, but a communication relay device including a display unit for displaying the setting screen and an input unit for inputting the setting. It may be done by 20. Further, the offline setting unit 16 notifies the switching control unit 18 that the offline setting is started and the offline setting is finished.

エラー処理部17は、中継制御部13の起動時または動作時に例外エラーが発生したことを検知すると、切替制御部18に例外エラーの発生を通知する。また、エラー処理部17は、ウォッチドッグタイマ1aのタイムアウトを検知したときに、切替制御部18にタイムアウトエラーの発生を通知する。 When the error processing unit 17 detects that an exception error has occurred at the time of starting or operating the relay control unit 13, the error processing unit 17 notifies the switching control unit 18 of the occurrence of the exception error. Further, when the error processing unit 17 detects the time-out of the watchdog timer 1a, the error processing unit 17 notifies the switching control unit 18 of the occurrence of a time-out error.

切替制御部18は、第1リレー8および第2リレー9の接続状態をバイパス接続状態と中継接続状態との間で切り替える制御を行う。具体的には、切替制御部18は、次のように、各状態で第1リレー8および第2リレー9の切り替えを制御する切替制御信号を第1リレー8および第2リレー9に出力する。 The switching control unit 18 controls to switch the connection state of the first relay 8 and the second relay 9 between the bypass connection state and the relay connection state. Specifically, the switching control unit 18 outputs a switching control signal for controlling switching between the first relay 8 and the second relay 9 to the first relay 8 and the second relay 9 as follows.

切替制御部18は、起動・停止制御部14から起動前通知および動作停止通知を受けたときに、第1リレー8の出力端子8aと第2入力接点8cとを接続するとともに、第2リレー9の出力端子9aと第2入力接点9cとを接続する切替制御信号を出力する。また、切替制御部18は、起動・停止制御部14から動作可能通知を受けたときに、第1リレー8の出力端子8aと第1入力接点8bとを接続するとともに、第2リレー9の出力端子9aと第1入力接点9bとを接続する切替制御信号を出力する。 When the switching control unit 18 receives the pre-start notification and the operation stop notification from the start / stop control unit 14, the switching control unit 18 connects the output terminal 8a of the first relay 8 and the second input contact 8c, and the second relay 9 Outputs a switching control signal that connects the output terminal 9a of the above and the second input contact 9c. Further, when the switching control unit 18 receives the operation enablement notification from the start / stop control unit 14, the switching control unit 18 connects the output terminal 8a of the first relay 8 and the first input contact 8b, and outputs the second relay 9. A switching control signal for connecting the terminal 9a and the first input contact 9b is output.

切替制御部18は、受信データ監視部15からの切替可能通知を受けたときに、第1リレー8および第2リレー9の現状の接続状態をバイパス接続状態と中継接続状態との間で切り替えるように切替制御信号を出力する。 When the switching control unit 18 receives the switchable notification from the received data monitoring unit 15, the switching control unit 18 switches the current connection state of the first relay 8 and the second relay 9 between the bypass connection state and the relay connection state. Outputs a switching control signal to.

切替制御部18は、オフライン設定部16からオフライン設定を開始する通知を受けた状態で、受信データ監視部15からの切替可能通知をさらに受けたときに、中継接続状態からバイパス接続状態に切り替える切替制御信号を出力する。また、切替制御部18は、オフライン設定部16からオフライン設定を終了する通知を受けた状態で、受信データ監視部15からの切替可能通知をさらに受けたときに、バイパス接続状態から中継接続状態に切り替える切替制御信号を出力する。 The switching control unit 18 switches from the relay connection state to the bypass connection state when the switching control unit 18 further receives the switchable notification from the reception data monitoring unit 15 in the state of receiving the notification from the offline setting unit 16 to start the offline setting. Output the control signal. Further, when the switching control unit 18 receives a notification from the offline setting unit 16 to end the offline setting and further receives a switchable notification from the received data monitoring unit 15, the switching control unit 18 changes from the bypass connection state to the relay connection state. Outputs a switching control signal for switching.

切替制御部18は、エラー処理部17から例外エラー発生の通知またはウォッチドッグタイムアウトエラー発生の通知を受けたときに、中継接続状態からバイパス接続状態に切り替える切替制御信号を出力する。 When the switching control unit 18 receives a notification of the occurrence of an exception error or a notification of the occurrence of a watchdog timeout error from the error processing unit 17, it outputs a switching control signal for switching from the relay connection state to the bypass connection state.

中継処理部19は、第1リレー8および第2リレー9が中継接続状態に切り替えられている期間に、シリアルポートCOM2から入力されたホスト機器30からの受信データRxDを、データバス12を介して第2リレー9の第1入力接点9bに出力する。また、中継処理部19は、第1リレー8および第2リレー9が中継接続状態に切り替えられている期間に、シリアルポートCOM1から入力された制御機器40からの受信データRxDを、データバス12を介して第1リレー8の第1入力接点8bに出力する。 The relay processing unit 19 transmits the received data RxD from the host device 30 input from the serial port COM2 via the data bus 12 during the period when the first relay 8 and the second relay 9 are switched to the relay connection state. Output to the first input contact 9b of the second relay 9. Further, the relay processing unit 19 transfers the received data RxD from the control device 40 input from the serial port COM1 to the data bus 12 during the period when the first relay 8 and the second relay 9 are switched to the relay connection state. The data is output to the first input contact 8b of the first relay 8 via the above.

また、中継処理部19は、優先度変更部191(優先度設定部)を有している。優先度変更部191は、データ管理機器70からのデータ読み出しまたはデータ書き込みの要求に対する優先度を変更する。優先度のレベルとしては、低レベル、中レベル、高レベルの3つのレベルがある。 Further, the relay processing unit 19 has a priority changing unit 191 (priority setting unit). The priority change unit 191 changes the priority for a request for reading or writing data from the data management device 70. There are three priority levels: low level, medium level, and high level.

低レベル(デフォルト)は、ホスト機器30と制御機器40との間の主通信を最優先するレベルである。低レベルでは、ホスト機器30からの要求コマンドが送信されていない状況以外では、データ管理機器70からの割り込み要求に対する割込通信が実施されない。 The low level (default) is a level that gives the highest priority to the main communication between the host device 30 and the control device 40. At a low level, interrupt communication for an interrupt request from the data management device 70 is not performed except in a situation where the request command from the host device 30 is not transmitted.

中レベルは、ホスト機器30と制御機器40との間の主通信(2回)と、割り込み要求に対する割込通信とを交互に行うレベルである。中レベルでは、具体的には、ホスト機器30からの2回の要求コマンドの送信に対して、1回の割込通信を行う。 The medium level is a level at which main communication (twice) between the host device 30 and the control device 40 and interrupt communication for an interrupt request are alternately performed. At the medium level, specifically, one interrupt communication is performed for two transmissions of the request command from the host device 30.

高レベルは、主通信に支障を来さない程度(タイムアウトが発生しない程度)で割込通信を優先させるレベルである。 The high level is a level that gives priority to interrupt communication to the extent that it does not interfere with the main communication (to the extent that a timeout does not occur).

なお、中レベルおよび高レベルにおける、1回の主通信に対する割込通信の回数は適宜設定できる。また、優先度のレベルは、ユーザによって変更することが可能である。 The number of interrupt communications for one main communication at the medium level and the high level can be set as appropriate. In addition, the priority level can be changed by the user.

上記のように構成される通信中継装置20による通信中継の処理について説明する。図3の(a)は、中継制御部13が動作していない状態を示す図であり、図3の(b)は、中継制御部13が動作している状態を示す図である。図4は、通信中継装置20の起動時の処理手順を示すフローチャートである。図5は、通信中継装置20がオフライン状態に移行したときの中継制御部13による処理手順を示すフローチャートである。図6は、例外エラー発生時の中継制御部13による処理手順を示すフローチャートである。図7の(a)は、通信中継装置20の通常動作時における中継制御部13による処理手順を示すフローチャートである。図7の(b)は、通信中継装置20の異常動作時における中継制御部13による処理手順を示すフローチャートである。 The process of communication relay by the communication relay device 20 configured as described above will be described. FIG. 3A is a diagram showing a state in which the relay control unit 13 is not operating, and FIG. 3B is a diagram showing a state in which the relay control unit 13 is operating. FIG. 4 is a flowchart showing a processing procedure at the time of starting the communication relay device 20. FIG. 5 is a flowchart showing a processing procedure by the relay control unit 13 when the communication relay device 20 goes into the offline state. FIG. 6 is a flowchart showing a processing procedure by the relay control unit 13 when an exception error occurs. FIG. 7A is a flowchart showing a processing procedure by the relay control unit 13 during normal operation of the communication relay device 20. FIG. 7B is a flowchart showing a processing procedure by the relay control unit 13 at the time of abnormal operation of the communication relay device 20.

まず、中継制御部13の起動時における通信中継の処理について説明する。 First, a communication relay process at the time of starting the relay control unit 13 will be described.

通信中継装置20の電源がオフされている状態では、第1リレー8および第2リレー9がバイパス接続状態にある。したがって、図3の(a)に示すように、ホスト機器30および制御機器40は、中継制御部13を介さずに、第1リレー8および第2リレー9によるバイパス通信経路25(前述のハードウェア通信経路)を介して相互に接続された状態で通信している。この状態では、図2に示すように、第1リレー8において、出力端子8aが第2入力接点8cに接続され、第2リレー9において、出力端子9aが第2入力接点9cに接続されている。 When the power of the communication relay device 20 is turned off, the first relay 8 and the second relay 9 are in the bypass connection state. Therefore, as shown in FIG. 3A, the host device 30 and the control device 40 do not go through the relay control unit 13, but the bypass communication path 25 by the first relay 8 and the second relay 9 (the hardware described above). Communication is in a state of being connected to each other via a communication path). In this state, as shown in FIG. 2, in the first relay 8, the output terminal 8a is connected to the second input contact 8c, and in the second relay 9, the output terminal 9a is connected to the second input contact 9c. ..

具体的には、次のようにデータの送受信が行なわれる。図1に示すように、ホスト機器30から送信されたデータは、シリアルポートCOM2を通じて第2リレー9の第2入力接点9cおよび出力端子9aを介して送信データTxDとしてシリアルポートCOM1から出力されて、制御機器40に受信される。また、制御機器40から送信されたデータは、シリアルポートCOM1を通じて第1リレー8の第2入力接点8cおよび出力端子8aを介して送信データTxDとしてシリアルポートCOM2から出力されて、ホスト機器30に受信される。 Specifically, data is transmitted and received as follows. As shown in FIG. 1, the data transmitted from the host device 30 is output from the serial port COM1 as transmission data TxD via the second input contact 9c and the output terminal 9a of the second relay 9 through the serial port COM2. Received by the control device 40. Further, the data transmitted from the control device 40 is output from the serial port COM2 as transmission data TxD via the second input contact 8c and the output terminal 8a of the first relay 8 through the serial port COM1 and received by the host device 30. Will be done.

図4に示すように、通信中継装置20の電源がオンされることで、電源回路11から通信中継装置20の各部に電力が供給されると、起動・停止制御部14は、起動時の処理を開始する(ステップS1)。 As shown in FIG. 4, when the power of the communication relay device 20 is turned on and power is supplied from the power supply circuit 11 to each part of the communication relay device 20, the start / stop control unit 14 processes at the time of startup. Is started (step S1).

起動・停止制御部14は、起動時の処理として、第1ドライバ/レシーバ4および第2ドライバ/レシーバ5を介した通信を制御する通信ドライバを初期化する(ステップS2)。起動・停止制御部14は、所定の初期化処理が完了したか否かを判定し(ステップS3)、完了していないときは(NO)、初期化処理を継続する。起動・停止制御部14による所定の初期化処理が完了すると(ステップS3のYES)、受信データ監視部15は、ホスト機器30および制御機器40からの受信データRxDを監視する(ステップS4)。 The start / stop control unit 14 initializes a communication driver that controls communication via the first driver / receiver 4 and the second driver / receiver 5 as a process at the time of startup (step S2). The start / stop control unit 14 determines whether or not the predetermined initialization process has been completed (step S3), and if not (NO), continues the initialization process. When the predetermined initialization process by the start / stop control unit 14 is completed (YES in step S3), the reception data monitoring unit 15 monitors the reception data RxD from the host device 30 and the control device 40 (step S4).

受信データ監視部15は、受信データRxDの監視の結果、ホスト機器30と制御機器40との間のパケット送信が完了したか否かを判定する(ステップS5)。受信データ監視部15は、パケット送信が完了していないと判定すると(ステップS5のNO)、引き続いてパケット送信が完了したか否かを判定する。また、受信データ監視部15は、パケット送信が完了したと判定すると(ステップS5のYES)、ホスト機器30または制御機器40からの何らかのデータがあるか否かを判定する(ステップS6)。受信データ監視部15は、ステップS6において何らかのデータがあると判定すると(YES)、ステップS5の処理を行う。 The reception data monitoring unit 15 determines whether or not the packet transmission between the host device 30 and the control device 40 is completed as a result of monitoring the received data RxD (step S5). When the reception data monitoring unit 15 determines that the packet transmission is not completed (NO in step S5), it subsequently determines whether or not the packet transmission is completed. Further, when the reception data monitoring unit 15 determines that the packet transmission is completed (YES in step S5), the reception data monitoring unit 15 determines whether or not there is any data from the host device 30 or the control device 40 (step S6). When the reception data monitoring unit 15 determines in step S6 that there is some data (YES), the reception data monitoring unit 15 performs the process of step S5.

受信データ監視部15は、ステップS6において何らかのデータがないと判定すると(NO)、データがない状態を確認してから10msが経過したか否かを判定する(ステップS7)。受信データ監視部15は、ステップS7においてデータがない状態を確認してから10msが経過していないと判定すると(NO)、ステップS5の処理を行う。 When the reception data monitoring unit 15 determines in step S6 that there is no data (NO), it determines whether or not 10 ms has elapsed after confirming that there is no data (step S7). If it is determined in step S7 that 10 ms has not elapsed since the reception data monitoring unit 15 confirmed that there is no data (NO), the received data monitoring unit 15 performs the process of step S5.

受信データ監視部15がステップS7においてデータがない状態を確認してから10msが経過していると判定すると(YES)、第1リレー8および第2リレー9は、切替制御部18からの切替制御信号によって、中継接続状態に切り替える(ステップS8)。この状態では、バイパス接続が切断されている。 When it is determined (YES) that 10 ms has elapsed since the received data monitoring unit 15 confirmed that there is no data in step S7, the first relay 8 and the second relay 9 are switched and controlled by the switching control unit 18. The relay connection state is switched by the signal (step S8). In this state, the bypass connection is broken.

ホスト機器30と制御機器40との間でやり取りされるパケットの間隔は10msである。このため、受信データ監視部15は、パケットが確認できない期間が10msを超えると、パケットの通信が無いものと判断することができる。なお、上記のパケットの間隔は、10msに限らず、任意に設定することができる。 The interval between packets exchanged between the host device 30 and the control device 40 is 10 ms. Therefore, the received data monitoring unit 15 can determine that there is no packet communication when the period during which the packet cannot be confirmed exceeds 10 ms. The packet interval is not limited to 10 ms and can be set arbitrarily.

中継処理部19は、この状態で、ホスト機器30および制御機器40の間と、データ管理機器70および制御機器40との間で、それぞれの通信を中継する処理を行う(ステップS9)。中継処理部19は、データ管理機器70からのデータ送信要求(割り込み要求)を受けたか否かを判定する(ステップS10)。中継処理部19は、ステップS10においてデータ送信要求を受けていないと判定すると(NO)、ステップS9の処理を継続して行う。また、中継処理部19は、ステップS10においてデータ送信要求を受けたと判定すると(YES)、データ送信要求を基にパケットを生成して、シリアルポートCOM1に送出する(ステップS11)。 In this state, the relay processing unit 19 performs a process of relaying each communication between the host device 30 and the control device 40 and between the data management device 70 and the control device 40 (step S9). The relay processing unit 19 determines whether or not a data transmission request (interrupt request) from the data management device 70 has been received (step S10). If the relay processing unit 19 determines in step S10 that the data transmission request has not been received (NO), the relay processing unit 19 continues the processing of step S9. Further, when the relay processing unit 19 determines that the data transmission request has been received in step S10 (YES), the relay processing unit 19 generates a packet based on the data transmission request and sends the packet to the serial port COM1 (step S11).

中継処理部19は、上記のようにしてパケットを優先度に応じて制御機器40に送信する。制御システム100の使用状況によっては、ホスト機器30がほとんど操作されずにモニタとして使用されることがある。このような状況においては、ホスト機器30と制御機器40との間の主通信にはあまりリアルタイム性が要求されない。このような場合は、優先度変更部191がユーザの指示に応じて割込通信の優先度を高レベルに変更して、割込通信を頻繁に行うことができる。また、ある特定の時間帯では割込通信を控えることが望ましい場合がある。このような場合は、優先度変更部191がユーザの指示に応じて割込通信の優先度を低レベルに変更しておく。これにより、通信中継装置20は、割込通信の頻度を下げて、主通信を優先させることができる。 The relay processing unit 19 transmits the packet to the control device 40 according to the priority as described above. Depending on the usage status of the control system 100, the host device 30 may be used as a monitor with almost no operation. In such a situation, real-time performance is not required so much for the main communication between the host device 30 and the control device 40. In such a case, the priority changing unit 191 can change the priority of the interrupt communication to a high level according to the instruction of the user, and the interrupt communication can be performed frequently. In addition, it may be desirable to refrain from interrupt communication in a specific time zone. In such a case, the priority changing unit 191 changes the priority of the interrupt communication to a low level according to the instruction of the user. As a result, the communication relay device 20 can reduce the frequency of interrupt communication and give priority to main communication.

このように、優先度変更部191は、制御システム100の事情に応じて優先度を変更可能に設定する。ただし、ホスト機器30から制御機器40へのデータの書き込みは、最優先されることが望ましい。このため、データ管理機器70からの読み出しの要求とホスト機器30からの書き込みのコマンドとが競合する場合、書き込みのコマンドが優先される。例えば、製造ラインにおいて、製造品の品種が変更されるときには、レシピデータがホスト機器30から制御機器40に昼休みなどの時間を利用して一斉に送信されることがある。このような場合、割り込みの優先度が設定されていても、ホスト機器30からの書き込み処理が優先される。 In this way, the priority changing unit 191 sets the priority so that the priority can be changed according to the circumstances of the control system 100. However, it is desirable that the writing of data from the host device 30 to the control device 40 has the highest priority. Therefore, when the read request from the data management device 70 and the write command from the host device 30 conflict with each other, the write command has priority. For example, in the production line, when the product type of the manufactured product is changed, the recipe data may be simultaneously transmitted from the host device 30 to the control device 40 during a lunch break or the like. In such a case, even if the interrupt priority is set, the write process from the host device 30 is prioritized.

制御機器40は、通信中継装置20から送信されたパケットを受信すると、データ管理機器70からのデータ送信要求に応じたデータを読み出して送信する。 When the control device 40 receives the packet transmitted from the communication relay device 20, the control device 40 reads and transmits the data in response to the data transmission request from the data management device 70.

中継処理部19は、制御機器40からのデータを受信すると、パケットを応答データに変換して、LANインターフェース部10を介してデータ管理機器70に返信する(ステップS12)。 When the relay processing unit 19 receives the data from the control device 40, it converts the packet into response data and returns it to the data management device 70 via the LAN interface unit 10 (step S12).

上記のように、中継処理部19が動作している状態では、図3の(b)に示すように、ホスト機器30および制御機器40は、第1リレー8および第2リレー9を含んで中継処理部19によってデータバス12を介して形成される第1中継通信経路26(前述のソフトウェア通信経路,第1通信経路)を通じて通信する。また、データ管理機器70および制御機器40は、中継処理部19によってデータバス12を介して形成される第2中継通信経路27(第2通信経路)を通じて通信する。それゆえ、ホスト機器30と制御機器40との通信を行いながら、その合間にホスト機器30とデータ管理機器70との通信を行うことができる。したがって、制御機器40が予備の通信ポートを有していなくても、データ管理機器70との通信を行うことができる。 As described above, in the state where the relay processing unit 19 is operating, as shown in FIG. 3B, the host device 30 and the control device 40 relay including the first relay 8 and the second relay 9. Communication is performed through the first relay communication path 26 (the software communication path described above, the first communication path) formed by the processing unit 19 via the data bus 12. Further, the data management device 70 and the control device 40 communicate with each other through the second relay communication path 27 (second communication path) formed by the relay processing unit 19 via the data bus 12. Therefore, while communicating between the host device 30 and the control device 40, it is possible to communicate between the host device 30 and the data management device 70 in the meantime. Therefore, even if the control device 40 does not have a spare communication port, it is possible to communicate with the data management device 70.

また、中継制御部13の起動前には、バイパス接続状態が確保され、中継制御部13の起動時には、バイパス接続状態から中継接続状態に切り替えられる。これにより、図3の(a)に示すように、中継制御部13の動作が停止していても、ホスト機器30および制御機器40の間の通信が第1リレー8および第2リレー9を介したバイパス通信経路25を介して維持される。したがって、中継制御部13の動作が停止しているときに、ホスト機器30および制御機器40の間の通信が行なわれないという不都合は生じない。 Further, the bypass connection state is secured before the relay control unit 13 is activated, and when the relay control unit 13 is activated, the bypass connection state is switched to the relay connection state. As a result, as shown in FIG. 3A, communication between the host device 30 and the control device 40 is performed via the first relay 8 and the second relay 9 even if the operation of the relay control unit 13 is stopped. It is maintained via the bypass communication path 25. Therefore, there is no inconvenience that communication between the host device 30 and the control device 40 is not performed when the operation of the relay control unit 13 is stopped.

また、バイパス接続状態から中継接続状態に切り替えられるときには、ホスト機器30および制御機器40の間で通信が行なわれていない状態で第1リレー8および第2リレー9の切り替え動作が行なわれる。中継接続状態からバイパス接続状態に切り替えられるときにも、ホスト機器30および制御機器40の間で通信が行なわれていない状態で第1リレー8および第2リレー9の切り替え動作が行なわれる。これにより、通信途中のデータが第1リレー8および第2リレー9の切り替え動作によって喪失されることを回避できる。 Further, when the bypass connection state is switched to the relay connection state, the switching operation of the first relay 8 and the second relay 9 is performed in a state where communication is not performed between the host device 30 and the control device 40. Even when the relay connection state is switched to the bypass connection state, the switching operation of the first relay 8 and the second relay 9 is performed in a state where communication is not performed between the host device 30 and the control device 40. As a result, it is possible to prevent data during communication from being lost due to the switching operation of the first relay 8 and the second relay 9.

なお、電断時には、通信中継装置20の電源が強制的にオフ状態となるので、切替制御部18による第1リレー8および第2リレー9の切替制御が不能になる。このような不都合に対しては、第1リレー8における出力端子8aと第2入力接点8cとの間、および第2リレー9における出力端子9aと第2入力接点9cとの間の接点形式をb接点(ノーマリクローズ)としておく。これにより、電断時に切替制御部18からの切替制御信号が無信号(ローレベル)になると、第1リレー8および第2リレー9がバイパス接続状態に強制的に切り替わる。あるいは、通信中継装置20は、電源回路11がオフすると第1リレー8および第2リレー9を強制的にバイパス接続状態に切り替える回路を別途備えていてもよい。これにより、電断時には、切替制御部18が機能しなくなっても、上記の回路によって第1リレー8および第2リレー9がバイパス接続状態に切り替わる。 When the power is cut off, the power supply of the communication relay device 20 is forcibly turned off, so that the switching control unit 18 cannot control the switching of the first relay 8 and the second relay 9. For such inconvenience, the contact type between the output terminal 8a and the second input contact 8c in the first relay 8 and between the output terminal 9a and the second input contact 9c in the second relay 9 is changed to b. Set as a contact (normally closed). As a result, when the switching control signal from the switching control unit 18 becomes no signal (low level) at the time of power interruption, the first relay 8 and the second relay 9 are forcibly switched to the bypass connection state. Alternatively, the communication relay device 20 may separately include a circuit for forcibly switching the first relay 8 and the second relay 9 to the bypass connection state when the power supply circuit 11 is turned off. As a result, even if the switching control unit 18 does not function at the time of power failure, the first relay 8 and the second relay 9 are switched to the bypass connection state by the above circuit.

また、電断時にバイパス接続状態に切り替え可能な、第1リレー8に置き替わる半導体スイッチとしては、出力端子8aと第1入力接点8bとの間にノーマリオフ型の第1トランジスタを配置し、出力端子8aと第2入力接点8cとの間にノーマリオン型の第2トランジスタを配置するようなスイッチが考えられる。同様に、第2リレー9に置き替わる半導体スイッチとしては、出力端子9aと第1入力接点9bとの間にノーマリオフ型の第1トランジスタを配置し、出力端子9aと第2入力接点9cとの間にノーマリオン型の第2トランジスタを配置するようなスイッチが考えられる。このようなスイッチは、ゲート電圧が印加されないとき、第1トランジスタがオフする一方、第2トランジスタがオンし、ゲート電圧が印加されるとき、第1トランジスタがオンする一方、第2トランジスタがオフする。これにより、通信中継装置20の電源回路11が電断時にオフしているときには、スイッチにゲート電圧が印加されないので、第1トランジスタがオフする一方、第2トランジスタがオンすることでバイパス接続状態が得られる。 Further, as a semiconductor switch that can be switched to the bypass connection state at the time of power failure and replaces the first relay 8, a normally-off type first transistor is arranged between the output terminal 8a and the first input contact 8b, and the output terminal. A switch in which a normalion type second transistor is arranged between the 8a and the second input contact 8c can be considered. Similarly, as a semiconductor switch that replaces the second relay 9, a normally-off type first transistor is arranged between the output terminal 9a and the first input contact 9b, and between the output terminal 9a and the second input contact 9c. A switch in which a normalion type second transistor is arranged is conceivable. In such a switch, when the gate voltage is not applied, the first transistor is turned off while the second transistor is turned on, and when the gate voltage is applied, the first transistor is turned on while the second transistor is turned off. .. As a result, when the power supply circuit 11 of the communication relay device 20 is turned off at the time of power failure, the gate voltage is not applied to the switch, so that the first transistor is turned off, while the second transistor is turned on, so that the bypass connection state is set. can get.

続いて、オフライン設定部16によるオフライン設定時における通信中継の処理について説明する。 Subsequently, the processing of communication relay at the time of offline setting by the offline setting unit 16 will be described.

まず、オフライン設定部16が、LAN60に接続された設定装置80からのオフライン設定の指示を受けると、中継処理部19はオフライン状態に移行する。オフライン状態に移行すると、中継処理部19は、ホスト機器30および制御機器40の間の送受信処理を完了させる(ステップS21)。受信データ監視部15は、上記の送受信処理が完了すると、ホスト機器30または制御機器40からの何らかのデータがあるか否かを判定する(ステップS22)。受信データ監視部15は、ステップS22において何らかのデータがあると判定すると(YES)、処理をステップS21に戻す。 First, when the offline setting unit 16 receives an instruction for offline setting from the setting device 80 connected to the LAN 60, the relay processing unit 19 shifts to the offline state. When the offline state is entered, the relay processing unit 19 completes the transmission / reception processing between the host device 30 and the control device 40 (step S21). When the transmission / reception process is completed, the reception data monitoring unit 15 determines whether or not there is any data from the host device 30 or the control device 40 (step S22). When the reception data monitoring unit 15 determines in step S22 that there is some data (YES), the process returns to step S21.

受信データ監視部15は、ステップS22において何らかのデータがないと判定すると(NO)、データがない状態を確認してから10msが経過したか否かを判定する(ステップS23)。受信データ監視部15は、ステップS23においてデータがない状態を確認してから10msが経過していないと判定すると(NO)、処理をステップS21に戻す。 When the reception data monitoring unit 15 determines in step S22 that there is no data (NO), it determines whether or not 10 ms has elapsed after confirming that there is no data (step S23). When the reception data monitoring unit 15 determines in step S23 that 10 ms has not elapsed since confirming that there is no data (NO), the process returns to step S21.

受信データ監視部15がステップS23においてデータがない状態を確認してから10msが経過していると判定すると(YES)、第1リレー8および第2リレー9は、切替制御部18からの切替制御信号によって、バイパス接続状態に切り替える(ステップS24)。 When it is determined (YES) that 10 ms has elapsed since the received data monitoring unit 15 confirmed that there is no data in step S23, the first relay 8 and the second relay 9 are switched and controlled by the switching control unit 18. It switches to the bypass connection state by the signal (step S24).

バイパス接続状態に移行すると、オフライン設定部16は、設定装置80からの操作に応じてオフライン設定の処理を実行する(ステップS25)。 When the state shifts to the bypass connection state, the offline setting unit 16 executes the offline setting process in response to the operation from the setting device 80 (step S25).

オフライン設定部16は、Webサーバのような機能を有しており、オフライン設定のための画面をHTML(Hyper Text Markup Language)形式などで設定装置80に提供する。当該画面には、ボーレートなどの通信設定、LAN60に対するIPアドレスの設定などを行う項目が設けられている。これにより、設定装置80は、LAN60を介して通信中継装置20にアクセスすると、Webブラウザで設定することができる。 The offline setting unit 16 has a function like a Web server, and provides a screen for offline setting to the setting device 80 in HTML (Hyper Text Markup Language) format or the like. The screen is provided with items for setting communication settings such as baud rate and setting an IP address for LAN60. As a result, the setting device 80 can be set by the Web browser when the communication relay device 20 is accessed via the LAN 60.

オフライン設定部16がオフライン設定を終了すると(ステップS26)、受信データ監視部15は、ホスト機器30および制御機器40からの受信データRxDを監視する(ステップS27)。 When the offline setting unit 16 finishes the offline setting (step S26), the received data monitoring unit 15 monitors the received data RxD from the host device 30 and the control device 40 (step S27).

その後、受信データ監視部15は、上述のステップS5〜S7と同じ処理を行う(ステップS28〜S30)。また、第1リレー8および第2リレー9は、ステップS30の後、上述のステップS8と同じ処理を行う(ステップS31)。これにより、中継処理部19はオンライン状態に移行する(ステップS32)。中継処理部19は、この状態で、ホスト機器30および制御機器40の間と、データ管理機器70および制御機器40との間で、それぞれの通信を中継する処理を行う(ステップS33)
このように、オフライン設定を行うときには、中継接続状態からバイパス接続状態に切り替えられる。これにより、中継処理部19による中継動作が停止していても、ホスト機器30および制御機器40の間の通信が第1リレー8および第2リレー9を介したバイパス接続状態によって維持される。また、オンライン状態からオフライン状態へ移行するとき、およびオフライン状態からオンライン状態へ移行するときには、ホスト機器30および制御機器40の間で通信が行なわれていない状態で第1リレー8および第2リレー9の切り替え動作が行なわれる。これにより、通信途中のデータが第1リレー8および第2リレー9の切り替え動作によって喪失されることを回避できる。
After that, the received data monitoring unit 15 performs the same processing as in steps S5 to S7 described above (steps S28 to S30). Further, the first relay 8 and the second relay 9 perform the same processing as in step S8 described above after step S30 (step S31). As a result, the relay processing unit 19 shifts to the online state (step S32). In this state, the relay processing unit 19 performs a process of relaying each communication between the host device 30 and the control device 40 and between the data management device 70 and the control device 40 (step S33).
In this way, when the offline setting is performed, the relay connection state can be switched to the bypass connection state. As a result, even if the relay operation by the relay processing unit 19 is stopped, the communication between the host device 30 and the control device 40 is maintained by the bypass connection state via the first relay 8 and the second relay 9. Further, when shifting from the online state to the offline state, and when shifting from the offline state to the online state, the first relay 8 and the second relay 9 are in a state where communication is not performed between the host device 30 and the control device 40. Switching operation is performed. As a result, it is possible to prevent data during communication from being lost due to the switching operation of the first relay 8 and the second relay 9.

引き続いて、例外エラー発生時およびウォッチドッグタイムアウトエラー発生時における通信中継の処理について説明する。 Subsequently, the processing of communication relay when an exception error occurs and a watchdog timeout error occurs will be described.

例外エラーが発生した場合、図6に示すように、まず、中継処理部19は、ホスト機器30および制御機器40の間と、データ管理機器70および制御機器40の間とで、それぞれの通信を中継する処理を行う(ステップS41)。エラー処理部17は、例外エラーが発生したことを検知すると、例外エラーによる割り込み処理が必要となったことを切替制御部18に通知する(ステップS42)。第1リレー8および第2リレー9は、切替制御部18からの切替制御信号によって、バイパス接続状態に切り替える(ステップS43)。バイパス接続状態に切り替えられると、中継処理部19による中継処理は終了する(ステップS44)。 When an exception error occurs, as shown in FIG. 6, first, the relay processing unit 19 communicates between the host device 30 and the control device 40 and between the data management device 70 and the control device 40, respectively. The relay process is performed (step S41). When the error processing unit 17 detects that an exception error has occurred, it notifies the switching control unit 18 that interrupt processing due to the exception error is required (step S42). The first relay 8 and the second relay 9 are switched to the bypass connection state by the switching control signal from the switching control unit 18 (step S43). When the bypass connection state is switched, the relay processing by the relay processing unit 19 ends (step S44).

中継制御部13が通常に動作している場合、図7の(a)に示すように、中継処理部19は、ホスト機器30および制御機器40の間と、データ管理機器70および制御機器40との間で、それぞれの通信を中継する処理を行う(ステップS51)。ウォッチドッグタイマ1aは、通信中継装置20のシステム、すなわち中継制御部13の全体の動作を監視するので、中継制御部13によるデータ管理機器70およびホスト機器30と制御機器40との通信が正常に行われていれば、タイマを更新する(ステップS52)。 When the relay control unit 13 is operating normally, as shown in FIG. 7A, the relay processing unit 19 is between the host device 30 and the control device 40, and between the data management device 70 and the control device 40. A process of relaying each communication is performed between the two (step S51). Since the watchdog timer 1a monitors the entire operation of the system of the communication relay device 20, that is, the relay control unit 13, communication between the data management device 70 and the host device 30 and the control device 40 by the relay control unit 13 is normal. If so, the timer is updated (step S52).

中継処理部19は、データ管理機器70からのデータ送信要求を受けたか否かを判定する(ステップS53)。中継処理部19は、ステップS53においてデータ送信要求を受けたと判定すると(YES)、前述のステップS11,S12の処理を行うことにより、制御機器40から要求されたデータを取得してデータ管理機器70に送信する処理を行う(ステップS54)。 The relay processing unit 19 determines whether or not a data transmission request from the data management device 70 has been received (step S53). When the relay processing unit 19 determines that the data transmission request has been received in step S53 (YES), the relay processing unit 19 acquires the data requested from the control device 40 by performing the processes of steps S11 and S12 described above, and the data management device 70. The process of transmitting to is performed (step S54).

次いで、ウォッチドッグタイマ1aは、ステップS52と同じく、通信正常時にタイマを更新する(ステップS55)。また、中継処理部19が、ステップS53においてデータ送信要求を受けていないと判定すると(NO)、ウォッチドッグタイマ1aによるステップS55の処理が行われる。その後は、処理がステップS51に戻る。 Next, the watchdog timer 1a updates the timer when communication is normal (step S55), as in step S52. If the relay processing unit 19 determines in step S53 that the data transmission request has not been received (NO), the watchdog timer 1a processes step S55. After that, the process returns to step S51.

中継制御部13の動作に異常が生じた場合、図7の(b)に示すように、通信経路の切り替えが行なわれる。まず、中継処理部19は、ホスト機器30および制御機器40の間と、データ管理機器70および制御機器40の間とで、それぞれの通信を中継する処理を行う(ステップS61)。 When an abnormality occurs in the operation of the relay control unit 13, the communication path is switched as shown in FIG. 7B. First, the relay processing unit 19 performs a process of relaying each communication between the host device 30 and the control device 40 and between the data management device 70 and the control device 40 (step S61).

ウォッチドッグタイマ1aは、中継制御部13の動作を監視しており、中継制御部13からの反応が前回のタイマ更新からの規定時間の間に取得できなかったことでタイムアウトする。エラー処理部17は、ウォッチドッグタイマ1aのタイムアウトを検知すると、タイムアウトエラーによる割り込み処理が必要となったことを切替制御部18に通知する(ステップS62)。 The watchdog timer 1a monitors the operation of the relay control unit 13, and times out because the response from the relay control unit 13 could not be acquired within the specified time from the previous timer update. When the error processing unit 17 detects the timeout of the watchdog timer 1a, it notifies the switching control unit 18 that interrupt processing due to the timeout error is required (step S62).

第1リレー8および第2リレー9は、切替制御部18からの切替制御信号によって、バイパス接続状態に切り替える(ステップS63)。バイパス接続状態に切り替えられると、中継処理部19による中継処理は終了する(ステップS64)。 The first relay 8 and the second relay 9 are switched to the bypass connection state by the switching control signal from the switching control unit 18 (step S63). When the bypass connection state is switched, the relay processing by the relay processing unit 19 ends (step S64).

このように、中継制御部13において例外エラーおよびウォッチドッグタイムアウトエラーが発生したときには、ホスト機器30と制御機器40との接続状態がバイパス接続状態に切り替えられる。これにより、中継制御部13において何らかの問題が生じて中継処理部19の動作が異常な状態に陥った場合に、ホスト機器30と制御機器との間の通信が不能になるという不都合を回避することができる。 In this way, when an exception error and a watchdog timeout error occur in the relay control unit 13, the connection state between the host device 30 and the control device 40 is switched to the bypass connection state. This avoids the inconvenience that communication between the host device 30 and the control device becomes impossible when some problem occurs in the relay control unit 13 and the operation of the relay processing unit 19 falls into an abnormal state. Can be done.

なお、ウォッチドッグタイムアウトエラーが発生した場合、エラー処理部17からの直接の制御によって、第1リレー8および第2リレー9がバイパス接続状態に切り替えられることもある。 When a watchdog timeout error occurs, the first relay 8 and the second relay 9 may be switched to the bypass connection state by direct control from the error processing unit 17.

上記のようなバイパス接続状態へ切り替える機能が無い場合、通信中継装置20の電源をオンしている状態で中継制御部13に異常が生じれば、中継処理部19による中継接続状態が維持できないので、通信に支障を来してしまう。 If there is no function to switch to the bypass connection state as described above, and if an abnormality occurs in the relay control unit 13 while the power of the communication relay device 20 is on, the relay connection state by the relay processing unit 19 cannot be maintained. , It interferes with communication.

〔実施形態2〕
本発明の実施形態2について図1、図8および図9に基づいて説明すると、以下の通りである。なお、本実施形態において、実施形態1における構成要素と同一の機能を有する構成要素については、同一の符号を付記して、その説明を省略する。
[Embodiment 2]
The second embodiment of the present invention will be described below with reference to FIGS. 1, 8 and 9. In the present embodiment, the same reference numerals will be added to the components having the same functions as the components in the first embodiment, and the description thereof will be omitted.

図8は、実施形態2に係る制御システム100における通信中継装置21の要部の構成を示すブロック図である。図9は、通信中継装置21を介した制御システム100におけるホスト機器30および制御機器40の間の通信の状態を示す図である。図9においては、縦軸が時間を表している。 FIG. 8 is a block diagram showing a configuration of a main part of the communication relay device 21 in the control system 100 according to the second embodiment. FIG. 9 is a diagram showing a state of communication between the host device 30 and the control device 40 in the control system 100 via the communication relay device 21. In FIG. 9, the vertical axis represents time.

図1に示すように、制御システム100は、通信中継装置21と、ホスト機器30と、制御機器40と、デバイス50と、LAN60と、データ管理機器70とを備えている。 As shown in FIG. 1, the control system 100 includes a communication relay device 21, a host device 30, a control device 40, a device 50, a LAN 60, and a data management device 70.

図8に示すように、通信中継装置21は、通信中継機能を実現するために中継制御部13Aを含んでいる。中継制御部13Aは、通信中継プログラムがCPU1によって実行されることで実現される、前述の通信中継機能を有する部分である。 As shown in FIG. 8, the communication relay device 21 includes a relay control unit 13A in order to realize the communication relay function. The relay control unit 13A is a part having the above-mentioned communication relay function, which is realized by executing the communication relay program by the CPU 1.

中継制御部13Aは、実施形態1の通信中継装置20における中継制御部13と同じく、起動・停止制御部14と、受信データ監視部15と、オフライン設定部16と、エラー処理部17と、切替制御部18とを有している。また、中継制御部13Aは、中継処理部19Aを有している。中継処理部19Aは、中継制御部13が有する中継処理部19と同じく、優先度変更部191を有しているが、さらにボーレート変更部192(ボーレート設定部)を有している。 Like the relay control unit 13 in the communication relay device 20 of the first embodiment, the relay control unit 13A switches between the start / stop control unit 14, the reception data monitoring unit 15, the offline setting unit 16, and the error processing unit 17. It has a control unit 18. Further, the relay control unit 13A has a relay processing unit 19A. The relay processing unit 19A has a priority changing unit 191 like the relay processing unit 19 of the relay control unit 13, but also has a baud rate changing unit 192 (baud rate setting unit).

ボーレート変更部192は、制御機器40との通信のボーレートを、標準のボーレート(標準ボーレート)と、標準ボーレートよりも高速の高速ボーレートとの間で変更する。 The baud rate changing unit 192 changes the baud rate of communication with the control device 40 between a standard baud rate (standard baud rate) and a high-speed baud rate faster than the standard baud rate.

制御機器40を構成するPLCには、コマンドによって高速ボーレートに変更できる機種がある。そこで、ボーレート変更部192は、このようなPLCとの通信速度を高めるために、上記コマンドをPLCへ送り、標準ボーレートから高速ボーレートに変更する。 Some PLCs constituting the control device 40 can be changed to a high-speed baud rate by a command. Therefore, the baud rate changing unit 192 sends the above command to the PLC in order to increase the communication speed with such a PLC, and changes the baud rate from the standard baud rate to the high speed baud rate.

これにより、図9に示すように、通信中継装置21は、ボーレートを変更できないホスト機器30と高速ボーレートに変更された制御機器40との通信の中継において、ホスト機器30とは標準ボーレートで通信し、制御機器40とは高速ボーレートで通信する。したがって、トータルの通信時間を短くすることができる。 As a result, as shown in FIG. 9, the communication relay device 21 communicates with the host device 30 at the standard baud rate in relaying the communication between the host device 30 whose baud rate cannot be changed and the control device 40 whose baud rate has been changed to the high speed baud rate. , Communicate with the control device 40 at a high speed baud rate. Therefore, the total communication time can be shortened.

例えば、実施形態1の通信中継装置20では、ホスト機器30との通信に10msを要し、制御機器40との通信に10ms要しているとする。これに対し、制御機器40のボーレートを5倍に高速化できる場合、通信中継装置21は、制御機器40との通信を2msで行うことにより、トータルの通信時間を通信中継装置20に比べて8ms短縮することができる。これにより、通信中継装置21の処理能力を向上させることができる。また、この短縮できた時間を、例えばデータ管理機器70の通信に利用することで、ホスト機器30および制御機器40の間の通信を遅延させることなく、データ管理機器70による割込通信を処理することができる。 For example, in the communication relay device 20 of the first embodiment, it is assumed that communication with the host device 30 takes 10 ms and communication with the control device 40 takes 10 ms. On the other hand, when the baud rate of the control device 40 can be increased five times, the communication relay device 21 communicates with the control device 40 in 2 ms, so that the total communication time is 8 ms as compared with the communication relay device 20. Can be shortened. As a result, the processing capacity of the communication relay device 21 can be improved. Further, by using this shortened time for communication of the data management device 70, for example, the interrupt communication by the data management device 70 is processed without delaying the communication between the host device 30 and the control device 40. be able to.

〔実施形態3〕
本発明の実施形態3について図1、図10〜図13に基づいて説明すると、以下の通りである。なお、本実施形態において、実施形態1における構成要素と同一の機能を有する構成要素については、同一の符号を付記して、その説明を省略する。
[Embodiment 3]
The third embodiment of the present invention will be described below with reference to FIGS. 1, 10 to 13. In the present embodiment, the same reference numerals will be added to the components having the same functions as the components in the first embodiment, and the description thereof will be omitted.

図10は、実施形態3に係る制御システム100における通信中継装置22の要部の構成を示すブロック図である。図11は、通信中継装置22における第1共通メモリ28および第2共通メモリ29を介した通信の概念を示す図である。図12の(a)は、通信中継装置22を介したホスト機器30および制御機器40の間の通信の状態を示す図である。図12の(b)は、通信中継装置22を介したホスト機器30および制御機器40の間の通信の他の状態を示す図である。図13は、通信中継装置22を介したホスト機器30および制御機器40の間の通信のさらに他の状態を示す図である。 FIG. 10 is a block diagram showing a configuration of a main part of the communication relay device 22 in the control system 100 according to the third embodiment. FIG. 11 is a diagram showing the concept of communication via the first common memory 28 and the second common memory 29 in the communication relay device 22. FIG. 12A is a diagram showing a state of communication between the host device 30 and the control device 40 via the communication relay device 22. FIG. 12B is a diagram showing another state of communication between the host device 30 and the control device 40 via the communication relay device 22. FIG. 13 is a diagram showing still another state of communication between the host device 30 and the control device 40 via the communication relay device 22.

図1に示すように、制御システム100は、通信中継装置22と、ホスト機器30と、制御機器40と、デバイス50と、LAN60と、データ管理機器70とを備えている。ただし、通信中継装置22は、図1に示されている第1ドライバ/レシーバ4および第2ドライバ/レシーバ5に加えて、図11に示す第1共通メモリ28と、第2共通メモリ29とを備えている。 As shown in FIG. 1, the control system 100 includes a communication relay device 22, a host device 30, a control device 40, a device 50, a LAN 60, and a data management device 70. However, in addition to the first driver / receiver 4 and the second driver / receiver 5 shown in FIG. 1, the communication relay device 22 includes the first common memory 28 and the second common memory 29 shown in FIG. I have.

第1共通メモリ28は、ホスト機器30および制御機器40の通信に共通に用いられるメモリである。第1共通メモリ28は、受信データRxDを伝送する受信メモリ28aと、送信データTxDを伝送する送信メモリ28bとを有している。 The first common memory 28 is a memory commonly used for communication between the host device 30 and the control device 40. The first common memory 28 has a reception memory 28a for transmitting the reception data RxD and a transmission memory 28b for transmitting the transmission data TxD.

第2共通メモリ29は、制御機器40およびLAN60の通信に共通に用いられるメモリである。第2共通メモリ29は、受信データRxDを伝送する受信メモリ29aと、送信データTxDを伝送する送信メモリ29bとを有している。 The second common memory 29 is a memory commonly used for communication between the control device 40 and the LAN 60. The second common memory 29 has a reception memory 29a for transmitting the reception data RxD and a transmission memory 29b for transmitting the transmission data TxD.

図10に示すように、通信中継装置22は、通信中継機能を実現するために中継制御部13Bを含んでいる。中継制御部13Bは、通信中継プログラムがCPU1によって実行されることで実現される、前述の通信中継機能を有する部分である。 As shown in FIG. 10, the communication relay device 22 includes a relay control unit 13B in order to realize the communication relay function. The relay control unit 13B is a part having the above-mentioned communication relay function, which is realized by executing the communication relay program by the CPU 1.

中継制御部13Bは、実施形態1の通信中継装置20における中継制御部13と同じく、起動・停止制御部14と、受信データ監視部15と、オフライン設定部16と、エラー処理部17と、切替制御部18とを有している。また、中継制御部13Bは、中継処理部19Bを有している。中継処理部19Bは、中継制御部13が有する中継処理部19と同じく、優先度変更部191を有しているが、さらに中継調整部193(要求分割部)を有している。 Like the relay control unit 13 in the communication relay device 20 of the first embodiment, the relay control unit 13B switches between the start / stop control unit 14, the reception data monitoring unit 15, the offline setting unit 16, and the error processing unit 17. It has a control unit 18. Further, the relay control unit 13B has a relay processing unit 19B. The relay processing unit 19B has a priority changing unit 191 like the relay processing unit 19 of the relay control unit 13, but further has a relay adjusting unit 193 (request dividing unit).

また、中継処理部19は、図11に示すように、シリアルポートCOM1側のCOM1スレッドで、シリアルポートCOM1に対する制御機器40との通信の処理を行う。また、中継処理部19は、シリアルポートCOM2側のCOM2スレッドで、シリアルポートCOM2に対するホスト機器30との通信の処理を行う。また、中継処理部19は、LANスレッドで、LAN60に対するデータ管理機器70との通信の処理を行う。 Further, as shown in FIG. 11, the relay processing unit 19 processes the communication of the serial port COM1 with the control device 40 by the COM1 thread on the serial port COM1 side. Further, the relay processing unit 19 processes the communication of the serial port COM2 with the host device 30 by the COM2 thread on the serial port COM2 side. Further, the relay processing unit 19 processes the communication with the data management device 70 for the LAN 60 by the LAN thread.

中継調整部193は、データ管理機器70からの割込要求のサイズが所定値を超えるときに、割込要求を分割する。割込要求を分割するサイズは、予め設定されているが、ユーザによって設定できるようにしてもよい。中継処理部19は、通信中継装置22と制御機器40との間で、ホスト機器30の要求と、当該要求に対する制御機器40の応答とが行われていない期間に、分割されたデータ送信要求を制御機器40に送信する。ただし、上記の要求および応答は、一連の処理として行われる。 The relay adjustment unit 193 divides the interrupt request when the size of the interrupt request from the data management device 70 exceeds a predetermined value. The size for dividing the interrupt request is set in advance, but it may be set by the user. The relay processing unit 19 issues a divided data transmission request between the communication relay device 22 and the control device 40 during a period in which the request of the host device 30 and the response of the control device 40 to the request are not made. It is transmitted to the control device 40. However, the above request and response are performed as a series of processes.

上記のように構成される制御システム100において、図11に示すように、ホスト機器30からの要求は、シリアルポートCOM2を介して受信された後、COM2スレッドで処理されて受信メモリ28aを介してCOM1スレッドに送出される。その要求は、COM1スレッドで処理された後、シリアルポートCOM1を介して制御機器40に送信される。 In the control system 100 configured as described above, as shown in FIG. 11, the request from the host device 30 is received via the serial port COM2, then processed by the COM2 thread and processed via the reception memory 28a. It is sent to the COM1 thread. The request is processed by the COM1 thread and then transmitted to the control device 40 via the serial port COM1.

一方、制御機器40からの応答は、シリアルポートCOM1を介して受信された後、COM1スレッドで処理されて送信メモリ28bを介してCOM2スレッドに送出される。その応答は、COM2スレッドで処理された後、シリアルポートCOM2を介してホスト機器30に送信される。 On the other hand, the response from the control device 40 is received via the serial port COM1, processed by the COM1 thread, and sent to the COM2 thread via the transmission memory 28b. The response is processed by the COM2 thread and then transmitted to the host device 30 via the serial port COM2.

また、データ管理機器70からの要求は、LAN60を介して受信された後、LANスレッドで処理されて受信メモリ29aを介してCOM1スレッドに送出される。その要求は、COM1スレッドで処理された後、シリアルポートCOM1を介して制御機器40に送信される。 Further, the request from the data management device 70 is received via the LAN 60, then processed by the LAN thread and sent to the COM1 thread via the reception memory 29a. The request is processed by the COM1 thread and then transmitted to the control device 40 via the serial port COM1.

一方、制御機器40からの応答は、シリアルポートCOM1を介して受信された後、COM1スレッドで処理されて送信メモリ29bを介してLANスレッドに送出される。その応答は、LANスレッドで処理された後、LAN60を介してデータ管理機器70に送信される。 On the other hand, the response from the control device 40 is received via the serial port COM1, processed by the COM1 thread, and sent to the LAN thread via the transmission memory 29b. The response is processed by the LAN thread and then transmitted to the data management device 70 via the LAN 60.

このように、中継処理部19は、COM1スレッドおよびCOM2スレッドで、それぞれ制御機器40側の通信処理とホスト機器30側の通信処理とをマルチタスクで個別に行う。また、データ管理機器70からの割り込み要求が発生したときに、中継処理部19は、図11において破線に示すように、COM1スレッドおよびLANスレッドで、それぞれ制御機器40側の通信処理とデータ管理機器70側の通信処理とをマルチタスクで個別に行う。しかも、COM1スレッドは、ホスト機器30の要求とデータ管理機器70からの割り込みの要求とを処理するが、 一方の要求を処理している間に他方の要求を処理しない(排他処理)。 In this way, the relay processing unit 19 individually multitasks the communication processing on the control device 40 side and the communication processing on the host device 30 side in the COM1 thread and the COM2 thread, respectively. Further, when an interrupt request is generated from the data management device 70, the relay processing unit 19 uses the COM1 thread and the LAN thread as the COM1 thread and the LAN thread, respectively, for communication processing and the data management device on the control device 40 side, as shown by the broken line in FIG. Communication processing on the 70 side is performed individually by multitasking. Moreover, the COM1 thread processes the request of the host device 30 and the request of the interrupt from the data management device 70, but does not process the other request while processing one request (exclusive processing).

これにより、通信中継装置22は、ホスト機器30と通信している間に、制御機器40に別の要求を送信することができる。この処理をシリアルに実行すると、一方の通信を行なってから他方の通信を行なうので、他方の通信が待たされる。これに対し、2つの通信を同時に行なうことで通信時間を短縮することができる。したがって、ホスト機器30側と制御機器40側とで処理を分離することにより、通信中継装置22の処理能力を向上させることができる。 As a result, the communication relay device 22 can transmit another request to the control device 40 while communicating with the host device 30. When this process is executed serially, one communication is performed and then the other communication is performed, so that the other communication is awaited. On the other hand, the communication time can be shortened by performing the two communications at the same time. Therefore, the processing capacity of the communication relay device 22 can be improved by separating the processing between the host device 30 side and the control device 40 side.

また、通信中継装置22を介してホスト機器30および制御機器40の間での通常の通信は、図12の(a)に示すようにして行われる。通信中継装置22(中継処理部19B)は、ホスト機器30からの要求を制御機器40に転送し、その要求に対する制御機器40からの応答をホスト機器30に転送する。この結果、通信時間T1がタイムアウト時間以内に収まるので、タイムアウトは生じない。 Further, normal communication between the host device 30 and the control device 40 via the communication relay device 22 is performed as shown in FIG. 12 (a). The communication relay device 22 (relay processing unit 19B) transfers the request from the host device 30 to the control device 40, and transfers the response from the control device 40 to the request to the host device 30. As a result, the communication time T1 is settled within the timeout time, so that no timeout occurs.

また、制御システム100において、通信中継装置22を介したホスト機器30および制御機器40の間での通信中にデータ管理機器70からデータ送信要求が送信されたときの通信は、図12の(b)に示すようにして行われる。通信中継装置22(中継処理部19B)は、ホスト機器30および制御機器40の間で通信が行われているときに、データ管理機器70からの割込要求REQ(太い一点鎖線にて示す)を受ける。すると、通信中継装置22は、制御機器40との間で、ホスト機器30の要求に対する制御機器40の応答が行われていない期間に、細い一点鎖線で示すように、データ管理機器70からのデータ送信要求に応じた割込通信を行う。そして、通信中継装置22は、データ管理機器70へ割込応答RES(太い一点鎖線にて示す)を返送する。 Further, in the control system 100, the communication when the data transmission request is transmitted from the data management device 70 during the communication between the host device 30 and the control device 40 via the communication relay device 22 is shown in FIG. 12 (b). ) Is performed. The communication relay device 22 (relay processing unit 19B) sends an interrupt request EQU (indicated by a thick alternate long and short dash line) from the data management device 70 when communication is being performed between the host device 30 and the control device 40. receive. Then, the communication relay device 22 receives data from the data management device 70 as shown by a thin alternate long and short dash line during the period when the control device 40 does not respond to the request of the host device 30 with the control device 40. Performs interrupt communication according to the transmission request. Then, the communication relay device 22 returns the interrupt response RES (indicated by a thick alternate long and short dash line) to the data management device 70.

割込通信が行われている間に、ホスト機器30から次の要求が送信されると、当該要求が発されるタイミングによっては、通信中継装置22から制御機器40への、ホスト機器30の要求の転送が、割込通信の終了まで待たされることがある。このような場合でも、通信時間T2がタイムアウト時間以内に収まっていれば、タイムアウトは生じない。 If the next request is transmitted from the host device 30 while the interrupt communication is being performed, the request of the host device 30 from the communication relay device 22 to the control device 40 depends on the timing at which the request is issued. Transfer may be waited until the end of interrupt communication. Even in such a case, if the communication time T2 is within the timeout time, no timeout occurs.

ところが、割込要求REQのサイズが大きすぎて、割込通信に長時間を要すると、ホスト機器30の要求が通信中継装置22から制御機器40へ転送されるのに待たされる待機時間が長引く。この結果、上記の通信時間T2がタイムアウト時間を超えると、タイムアウトが生じてしまう。 However, if the size of the interrupt request EQU is too large and the interrupt communication takes a long time, the waiting time waited for the request of the host device 30 to be transferred from the communication relay device 22 to the control device 40 becomes long. As a result, when the communication time T2 exceeds the timeout time, a timeout occurs.

そこで、割込要求REQのサイズが所定値を超えるときには、中継調整部193が、割込要求REQを所定の分割サイズに分割する。これにより、分割された割込要求REQの個々のサイズが小さくなるので、図13に細い一点鎖線にて示すように割込通信が行われても、上記の待機時間を抑制できるか、あるいは無くすことができる。これにより、通信時間T3がタイムアウト時間以内に収まるので、タイムアウトは生じない。 Therefore, when the size of the interrupt request EQU exceeds a predetermined value, the relay adjustment unit 193 divides the interrupt request EQU into a predetermined division size. As a result, the individual sizes of the divided interrupt request EQUs are reduced, so that even if interrupt communication is performed as shown by a thin alternate long and short dash line in FIG. 13, the above-mentioned standby time can be suppressed or eliminated. be able to. As a result, the communication time T3 is settled within the timeout time, so that no timeout occurs.

また、ホスト機器30と制御機器40との間の通信が頻繁に行なわれない場合、大きなサイズのデータの読み書きを要求しても、ホスト機器30と制御機器40との間の通信に及ぶ影響は小さい。そこで、このような場合は、その要求を分割せずにそのまま制御機器40に送信する。これにより、割込通信に要する時間を短時間で行うことができる。したがって、データ管理機器70の処理効率を向上させることができる。 Further, when the communication between the host device 30 and the control device 40 is not frequently performed, even if a large size data is requested to be read / written, the influence on the communication between the host device 30 and the control device 40 is not affected. small. Therefore, in such a case, the request is transmitted to the control device 40 as it is without being divided. As a result, the time required for interrupt communication can be shortened. Therefore, the processing efficiency of the data management device 70 can be improved.

〔ソフトウェアによる実現例〕
通信中継装置20〜21の制御ブロック(特に中継制御部13)は、上述のように、CPU1を用いてソフトウェアによって実現される。
[Example of realization by software]
The control blocks (particularly the relay control unit 13) of the communication relay devices 20 to 21 are realized by software using the CPU 1 as described above.

通信中継装置20〜21は、CPU1が通信中継プログラムをROM3から読み取って実行することにより、本発明の目的が達成される。上記記録媒体としては、ROM3以外にも、「一時的でない有形の媒体」、例えば、テープ、ディスク、カード、半導体メモリ、プログラマブルな論理回路などを用いることができる。また、通信中継プログラムは、該通信中継プログラムを伝送可能な任意の伝送媒体(通信ネットワークや放送波等)を介して上記コンピュータに供給されてもよい。なお、本発明の一態様は、上記プログラムが電子的な伝送によって具現化された、搬送波に埋め込まれたデータ信号の形態でも実現され得る。 The object of the present invention is achieved by the CPU 1 reading the communication relay program from the ROM 3 and executing the communication relay devices 20 to 21. As the recording medium, in addition to the ROM 3, a “non-temporary tangible medium” such as a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, or the like can be used. Further, the communication relay program may be supplied to the computer via an arbitrary transmission medium (communication network, broadcast wave, etc.) capable of transmitting the communication relay program. It should be noted that one aspect of the present invention can also be realized in the form of a data signal embedded in a carrier wave, in which the above program is embodied by electronic transmission.

本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope of the claims, and the embodiments obtained by appropriately combining the technical means disclosed in the different embodiments. Is also included in the technical scope of the present invention.

8 第1リレー(通信経路切替部)
9 第2リレー(通信経路切替部)
12 データバス(データ伝送路)
15 受信データ監視部(通信監視部)
16 オフライン設定部
17 エラー処理部(エラー検知部)
18 切替制御部
19,19A,19B 中継処理部
20〜21 通信中継装置
25 バイパス通信経路
26 第1中継通信経路(第1通信経路)
27 第2中継通信経路(第2通信経路)
30 ホスト機器
40 制御機器
70 データ管理機器
191 優先度変更部(優先度設定部)
192 ボーレート変更部(ボーレート設定部)
193 中継調整部(要求分割部)
8 1st relay (communication path switching unit)
9 Second relay (communication path switching unit)
12 Data bus (data transmission line)
15 Received data monitoring unit (communication monitoring unit)
16 Offline setting unit 17 Error processing unit (Error detection unit)
18 Switching control unit 19, 19A, 19B Relay processing unit 20-21 Communication relay device 25 Bypass communication path 26 1st relay communication path (1st communication path)
27 Second relay communication path (second communication path)
30 Host equipment 40 Control equipment 70 Data management equipment 191 Priority change unit (Priority setting unit)
192 Baud rate change section (Baud rate setting section)
193 Relay adjustment section (request division section)

Claims (6)

ホスト機器と、当該ホスト機器からの要求に応じてデータの読み出しおよび書き込みをする制御機器との間でシリアル通信を行うとともに、データを管理するデータ管理機器からの要求を前記制御機器に送信する通信中継装置であって、
データを伝送するデータ伝送路と、
前記データ伝送路を介した第1通信経路を通じて前記ホスト機器と前記制御機器との間の通信を中継するとともに、前記データ伝送路を介した第2通信経路を通じて前記データ管理機器と前記制御機器との通信を中継する中継処理部と、
前記中継処理部が動作しているときに、前記ホスト機器および前記制御機器を前記第1通信経路に接続する一方、前記中継処理部が動作していないときに、前記ホスト機器と前記制御機器とを相互に接続する通信経路切替部と
前記ホスト機器との間でデータの送受信を行う第1送受信回路と、
前記制御機器との間でデータの送受信を行う第2送受信回路と、を備え、
前記通信経路切替部は、前記ホスト機器と前記第1送受信回路との間に設けられた第1リレー、および前記制御機器と前記第2送受信回路との間に設けられた第2リレーを含み、
前記第1リレーは、前記ホスト機器に接続される出力端子と、前記第1送受信回路に接続される第1入力接点と、前記第2送受信回路に接続されて前記制御機器からのデータが入力される第2入力接点とを有し、
前記第2リレーは、前記制御機器に接続される出力端子と、前記第2送受信回路に接続される第1入力接点と、前記第1送受信回路に接続されて前記ホスト機器からのデータが入力される第2入力接点とを有し、
前記中継処理部が動作しているときに、前記第1リレーおよび前記第2リレーでは、各々その出力端子とその第1入力接点とが接続され、
前記中継処理部が動作していないときに、前記第1リレーおよび前記第2リレーでは、各々その出力端子とその第2入力接点とが接続される、ことを特徴とする通信中継装置。
Communication between the host device and the control device that reads and writes data in response to the request from the host device, and also transmits the request from the data management device that manages the data to the control device. It ’s a relay device,
A data transmission line that transmits data and
The communication between the host device and the control device is relayed through the first communication path via the data transmission path, and the data management device and the control device are connected through the second communication path via the data transmission path. And the relay processing unit that relays the communication of
When the relay processing unit is operating, the host device and the control device are connected to the first communication path, while when the relay processing unit is not operating, the host device and the control device are connected. Communication path switching unit that connects to each other ,
A first transmission / reception circuit that transmits / receives data to / from the host device,
A second transmission / reception circuit for transmitting / receiving data to / from the control device is provided.
The communication path switching unit includes a first relay provided between the host device and the first transmission / reception circuit, and a second relay provided between the control device and the second transmission / reception circuit.
The first relay is connected to an output terminal connected to the host device, a first input contact connected to the first transmission / reception circuit, and a second transmission / reception circuit to input data from the control device. Has a second input contact
The second relay is connected to the output terminal connected to the control device, the first input contact connected to the second transmission / reception circuit, and the first transmission / reception circuit to input data from the host device. Has a second input contact
When the relay processing unit is operating, the output terminal and the first input contact of the first relay and the second relay are connected to each other.
A communication relay device characterized in that, when the relay processing unit is not operating, the output terminal and the second input contact of the first relay and the second relay are connected to each other.
前記ホスト機器と制御機器との間で通信の有無を監視する通信監視部と、
前記通信監視部によって通信が無いと判定されたときに、前記第1通信経路への前記ホスト機器および前記制御機器の接続と、前記ホスト機器および前記制御機器の相互接続とを切り替える動作を行うように前記通信経路切替部を制御する切替制御部とをさらに備えていることを特徴とする請求項1に記載の通信中継装置。
A communication monitoring unit that monitors the presence or absence of communication between the host device and the control device,
When the communication monitoring unit determines that there is no communication, the operation of switching between the connection of the host device and the control device to the first communication path and the interconnection of the host device and the control device is performed. The communication relay device according to claim 1, further comprising a switching control unit that controls the communication path switching unit.
前記データ管理機器からの前記制御機器への要求に、前記ホスト機器からの前記制御機器への要求に対する優先度を設定する優先度設定部をさらに備え、
前記中継処理部は、設定された前記優先度にしたがって、前記データ管理機器からの要求を前記制御機器に送信することを特徴とする請求項1または2に記載の通信中継装置。
A priority setting unit for setting a priority for a request from the data management device to the control device and a request from the host device to the control device is further provided.
The communication relay device according to claim 1 or 2, wherein the relay processing unit transmits a request from the data management device to the control device according to the set priority.
前記制御機器との間の通信のボーレートを標準ボーレートよりも高速の高速ボーレートに設定するボーレート設定部をさらに備え、
前記中継処理部は、前記制御機器との間の通信を設定された前記高速ボーレートで行うことを特徴とする請求項1から3のいずれか1項に記載の通信中継装置。
Further provided with a baud rate setting unit for setting the baud rate of communication with the control device to a high-speed baud rate higher than the standard baud rate.
The communication relay device according to any one of claims 1 to 3, wherein the relay processing unit performs communication with the control device at the set high-speed baud rate.
前記中継処理部は、前記ホスト機器に対する通信処理と、前記制御機器に対する通信処理とを個別に行うことを特徴とする請求項1から4のいずれか1項に記載の通信中継装置。 The communication relay device according to any one of claims 1 to 4, wherein the relay processing unit individually performs communication processing for the host device and communication processing for the control device. 前記データ管理機器からの前記制御機器への要求のサイズが所定値を超えるときに、当該要求を所定のサイズに分割する要求分割部をさらに備え、
前記中継処理部は、前記ホスト機器からの要求と、当該要求に対する前記制御機器の前記ホスト機器への応答との一連の処理が行われていない期間に、分割された前記データ管理機器からの要求を前記制御機器に送信することを特徴とする請求項5に記載の通信中継装置。
When the size of the request from the data management device to the control device exceeds a predetermined value, a request dividing unit for dividing the request into a predetermined size is further provided.
The relay processing unit is divided into requests from the data management device during a period in which a series of processes of the request from the host device and the response of the control device to the host device in response to the request are not performed. The communication relay device according to claim 5, wherein the data is transmitted to the control device.
JP2017030011A 2017-02-21 2017-02-21 Communication relay device Active JP6865600B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017030011A JP6865600B2 (en) 2017-02-21 2017-02-21 Communication relay device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017030011A JP6865600B2 (en) 2017-02-21 2017-02-21 Communication relay device

Publications (2)

Publication Number Publication Date
JP2018137573A JP2018137573A (en) 2018-08-30
JP6865600B2 true JP6865600B2 (en) 2021-04-28

Family

ID=63367150

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017030011A Active JP6865600B2 (en) 2017-02-21 2017-02-21 Communication relay device

Country Status (1)

Country Link
JP (1) JP6865600B2 (en)

Also Published As

Publication number Publication date
JP2018137573A (en) 2018-08-30

Similar Documents

Publication Publication Date Title
CN101770215B (en) Programmable controller
RU2637060C2 (en) Technological process control system, peripheral device for use in it (versions) and method of actions planning
CN102843238B (en) Energy-conservation in the network node of automated network
JP2001306350A (en) Field device control system and computer readable storage medium
JP2004054907A (en) Programmable controller, CPU unit, communication unit, and method of controlling communication unit
JP7078889B2 (en) Controls, control methods, and control programs
US10346332B2 (en) Slave device
KR100689323B1 (en) Fieldbus Network Multiplexing System
JP6865600B2 (en) Communication relay device
US20040128033A1 (en) Embedded internet integrated chip controlled valve actuator
JP2010134752A (en) Field device
US20130145025A1 (en) Programmable controller
JP5852267B2 (en) Relay interface module for distributed control systems
JP6350154B2 (en) Control system
JP2021064855A (en) Electronic control device
KR101344393B1 (en) Field bus network system of ring structure
JPWO2020089964A1 (en) Communication systems, communication devices, and programs
JP3791001B2 (en) Operation monitoring system
JP2000132210A (en) Control device and cooperative control method
JP5433219B2 (en) Cluster system
JP7593153B2 (en) Network Systems
JP6330448B2 (en) Control system, control device, and relay device
TWI908234B (en) Scada system
JP2009093423A (en) Programmable logic control device with queue function and its method
JP7028124B2 (en) CPU unit, CPU unit control method, information processing program, and recording medium

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20170922

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200203

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20201116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210106

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210217

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210330

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210406

R150 Certificate of patent or registration of utility model

Ref document number: 6865600

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250