JP2020198514A - Communication device, baud rate automatic setting method and communication system - Google Patents

Communication device, baud rate automatic setting method and communication system Download PDF

Info

Publication number
JP2020198514A
JP2020198514A JP2019103068A JP2019103068A JP2020198514A JP 2020198514 A JP2020198514 A JP 2020198514A JP 2019103068 A JP2019103068 A JP 2019103068A JP 2019103068 A JP2019103068 A JP 2019103068A JP 2020198514 A JP2020198514 A JP 2020198514A
Authority
JP
Japan
Prior art keywords
baud rate
communication device
baud
unit
opposite side
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019103068A
Other languages
Japanese (ja)
Other versions
JP7251324B2 (en
Inventor
圭太郎 中川原
Keitaro Nakagawara
圭太郎 中川原
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.)
Fujitsu General Ltd
Original Assignee
Fujitsu General 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 Fujitsu General Ltd filed Critical Fujitsu General Ltd
Priority to JP2019103068A priority Critical patent/JP7251324B2/en
Publication of JP2020198514A publication Critical patent/JP2020198514A/en
Application granted granted Critical
Publication of JP7251324B2 publication Critical patent/JP7251324B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

To provide a communication device or the like capable of setting a baud rate easily and automatically.SOLUTION: A communication device communicating data with an opposite side communication device has: a setting section for setting an arbitrary baud rate from multiple baud rates that can be set; and a transmission section for transmitting a prescribed signal to the opposite side communication device at a first baud rate thus set. The communication device has: a receiving section for receiving a signal from the opposite side communication device; a measurement section for measuring a communication time per bit from a received prescribed signal, when the baud rate of the opposite side communication device does not match, and specifying the baud rate of the opposite side communication device on the basis of the communication time per bit thus measured; and a second determination unit for determining whether or not the specified baud rate is the first baud rate or less. The communication device has a control section for controlling the setting section so as to set a baud rate, of the specified baud rate or less, as the first baud rate among multiple baud rates that can be set, when the specified baud rate is the first baud rate or less.SELECTED DRAWING: Figure 2

Description

本発明は、通信装置、ボーレート自動設定方法及び通信システムに関する。 The present invention relates to a communication device, an automatic baud rate setting method, and a communication system.

2台の通信装置の間を通信ケーブルで通信接続するためにUART(Universal Asynchronous Receiver Transmitter)インタフェースを用いた通信装置がある。UARTインタフェースは、通信装置毎に複数のボーレート(通信速度)が準備されている。通常、このボーレートの設定は手動で行われているが、中には自動で設定されるものもある。 There is a communication device using a UART (Universal Asynchronous Receiver Transmitter) interface for communicating and connecting two communication devices with a communication cable. For the UART interface, a plurality of baud rates (communication speeds) are prepared for each communication device. Normally, this baud rate is set manually, but some are set automatically.

この自動設定の方法は、2台の通信装置の内、事前に何れか一方の通信装置を送信側の通信装置、他方の通信装置を受信側の通信装置に設定する。送信側の通信装置は、設定可能な複数のボーレート(4800bps、9600bps、19200bps、38400bps等)の中から任意のボーレートを設定して固定信号を受信側の通信装置に送信する。受信側の通信装置は、受信した固定信号から固定信号の周期を測定し、測定した固定信号の周期からボーレートを特定する。更に、受信側の通信装置は、特定されたボーレートを備えている場合、当該ボーレートを設定して送信側の通信装置に返信して自動設定が完了する。受信側の通信装置からの返信がない場合、送信側の通信装置は、現在設定中のボーレートを別のボーレートに変更して受信側の通信装置に再送信し、送信側の通信装置は、受信側の通信装置からの返信を受信するまでボーレートを変更して固定信号の送信を繰り返し実行する。 In this automatic setting method, one of the two communication devices is set in advance as the transmission side communication device and the other communication device as the reception side communication device. The communication device on the transmitting side sets an arbitrary baud rate from a plurality of settable baud rates (4800bps, 9600bps, 19200bps, 38400bps, etc.) and transmits a fixed signal to the communication device on the receiving side. The communication device on the receiving side measures the period of the fixed signal from the received fixed signal, and specifies the baud rate from the measured period of the fixed signal. Further, when the receiving side communication device has the specified baud rate, the baud rate is set and returned to the transmitting side communication device to complete the automatic setting. If there is no reply from the receiving side communication device, the transmitting side communication device changes the currently set baud rate to another baud rate and retransmits it to the receiving side communication device, and the transmitting side communication device receives. The baud rate is changed and the fixed signal is repeatedly transmitted until a reply from the communication device on the side is received.

特開2017−34448号公報JP-A-2017-34448

従来例の自動設定方法は、接続される通信装置が決まっているために、送信側の通信装置(親に相当)と受信側の通信装置(子に相当)との親子関係が事前に設定できるので、送信側の通信装置と受信側の通信装置との間のボーレートの自動設定も容易である。 In the automatic setting method of the conventional example, since the communication device to be connected is determined, the parent-child relationship between the communication device on the transmitting side (corresponding to the parent) and the communication device on the receiving side (corresponding to the child) can be set in advance. Therefore, it is easy to automatically set the baud rate between the communication device on the transmitting side and the communication device on the receiving side.

しかしながら、接続される通信装置が決まっておらず、事前に親子関係が設定できない場合は、上記の方法によるボーレートの自動設定が困難であった。また、従来例は、自動設定が完了するまで、送信側(親側)でボーレートの設定を順次変えていくため、自動設定が完了するまでの時間を要する場合もある。 However, when the communication device to be connected is not determined and the parent-child relationship cannot be set in advance, it is difficult to automatically set the baud rate by the above method. Further, in the conventional example, since the baud rate setting is sequentially changed on the transmitting side (parent side) until the automatic setting is completed, it may take time to complete the automatic setting.

本発明ではこのような問題に鑑み、ボーレートを容易に自動設定できる通信装置を提供することを目的とする。 In view of such a problem, an object of the present invention is to provide a communication device capable of easily and automatically setting a baud rate.

一つの態様の通信装置は、対向側の通信装置との間でデータを通信する通信装置である。通信装置は、設定部と、送信部と、受信部と、第1の判定部と、計測部と、第2の判定部と、制御部とを有する。設定部は、設定可能な複数のボーレートの中から任意のボーレートを設定する。送信部は、設定された第1のボーレートで第1の信号を対向側の通信装置に送信する。受信部は、対向側の通信装置にて設定された第2のボーレートで送信された第2の信号を対向側の通信装置から受信する。第1の判定部は、第1のボーレートと第2のボーレートとが一致したか否かを判定する。計測部は、第1のボーレートと第2のボーレートとが一致していない場合に、第2の信号の1ビットあたりの通信時間(以下、1ビット長という)を計測し、計測した1ビット長から第2のボーレートを特定する。第2の判定部は、特定された第2のボーレートが第1のボーレート以下であるか否かを判定する。制御部は、第2のボーレートが第1のボーレート以下の場合に、設定可能な複数のボーレートの中から、第2のボーレート以下で最も大きいボーレートを第1の信号に設定するように設定部を制御する。 A communication device of one aspect is a communication device that communicates data with a communication device on the opposite side. The communication device includes a setting unit, a transmission unit, a reception unit, a first determination unit, a measurement unit, a second determination unit, and a control unit. The setting unit sets an arbitrary baud rate from a plurality of baud rates that can be set. The transmission unit transmits the first signal to the communication device on the opposite side at the set first baud rate. The receiving unit receives the second signal transmitted at the second baud rate set by the communication device on the opposite side from the communication device on the opposite side. The first determination unit determines whether or not the first baud rate and the second baud rate match. When the first baud rate and the second baud rate do not match, the measuring unit measures the communication time per bit of the second signal (hereinafter referred to as 1 bit length), and the measured 1 bit length is measured. Identify the second baud rate from. The second determination unit determines whether or not the specified second baud rate is equal to or less than the first baud rate. When the second baud rate is equal to or lower than the first baud rate, the control unit sets the setting unit so that the largest baud rate below the second baud rate is set as the first signal from among the plurality of baud rates that can be set. Control.

本発明は、通信装置間のボーレートを容易に自動設定できることを目的とする。 An object of the present invention is that the baud rate between communication devices can be easily and automatically set.

図1は、本実施例の防災無線システムの一例を示す説明図である。FIG. 1 is an explanatory diagram showing an example of the disaster prevention radio system of this embodiment. 図2は、第1の通信装置の構成の一例を示すブロック図である。FIG. 2 is a block diagram showing an example of the configuration of the first communication device. 図3は、UART通信に使用する信号の通信フォーマットの一例を示す説明図である。FIG. 3 is an explanatory diagram showing an example of a communication format of a signal used for UART communication. 図4は、計測部の受信したデータの計測方法の一例を示す説明図である。FIG. 4 is an explanatory diagram showing an example of a method of measuring the data received by the measuring unit. 図5は、自動設定処理に関わる第1の通信装置の処理動作の一例を示すフローチャートである。FIG. 5 is a flowchart showing an example of the processing operation of the first communication device involved in the automatic setting processing. 図6は、外部機器と防災操作卓との間のボーレート自動設定の動作の一例を示す説明図である。FIG. 6 is an explanatory diagram showing an example of the operation of automatic baud rate setting between the external device and the disaster prevention operation console. 図7は、外部機器と防災操作卓との間のボーレート自動設定の動作の一例を示す説明図である。FIG. 7 is an explanatory diagram showing an example of the operation of automatic baud rate setting between the external device and the disaster prevention operation console.

以下、図面に基づいて、本願の開示する通信装置等の実施例を詳細に説明する。尚、本実施例により、開示技術が限定されるものではない。また、以下に示す各実施例は、矛盾を起こさない範囲で適宜変形しても良い。 Hereinafter, examples of the communication device and the like disclosed in the present application will be described in detail with reference to the drawings. The disclosed technology is not limited by the present embodiment. In addition, each of the examples shown below may be appropriately modified as long as it does not cause a contradiction.

図1は、本実施例の防災無線システム1の一例を示す説明図である。図1に示す防災無線システム1は、防災操作卓2と、無線親局3と、無線子局4とを有する。無線親局3は、無線子局4との間を無線通信で接続する。防災操作卓2は、例えば、各地の防災情報を集中管理する管理者の操作卓である。防災操作卓2と無線親局3のそれぞれが通信装置40を備え、防災操作卓2と無線親局3との間をそれぞれの通信装置40によって通信接続する。また、防災操作卓2、無線子局4と外部機器5はそれぞれが通信装置10を備え、防災操作卓2と外部機器5との間をそれぞれの通信装置10によって通信接続し、無線子局4と外部機器5との間をそれぞれの通信装置10によって通信接続する。 FIG. 1 is an explanatory diagram showing an example of the disaster prevention radio system 1 of this embodiment. The disaster prevention wireless system 1 shown in FIG. 1 has a disaster prevention operation console 2, a wireless master station 3, and a wireless slave station 4. The wireless master station 3 connects with the wireless slave station 4 by wireless communication. The disaster prevention operation table 2 is, for example, an operation table of an administrator who centrally manages disaster prevention information in each area. Each of the disaster prevention operation console 2 and the wireless master station 3 is provided with a communication device 40, and the disaster prevention operation console 2 and the wireless master station 3 are communicated and connected by the respective communication devices 40. Further, the disaster prevention operation console 2, the wireless slave station 4 and the external device 5 are each provided with a communication device 10, and the disaster prevention operation console 2 and the external device 5 are communicated and connected by the respective communication devices 10, and the wireless slave station 4 is connected. And the external device 5 are communicated and connected by each communication device 10.

例えば、無線子局4に接続する外部機器5(5B)はカメラ等の監視装置、防災操作卓2に接続する外部機器5(5A)はモニタ装置とする。無線子局4は、例えば、河川に配置したカメラ(外部機器5B)からの映像信号を受信し、受信した映像信号を無線親局3に送信する。更に、無線親局3は、無線子局4からの映像信号を防災操作卓2に送信する。更に、防災操作卓2は、無線親局3から受信した映像信号をモニタ装置(外部機器5A)に送信する。そして、モニタ装置(外部機器5A)は、防災操作卓2から受信した映像信号をモニタ画面に映し出す。その結果、防災操作卓2の利用者は、モニタ装置(外部機器5A)に映し出された映像から河川の水位などの状況を認識できる。 For example, the external device 5 (5B) connected to the wireless slave station 4 is a monitoring device such as a camera, and the external device 5 (5A) connected to the disaster prevention operation console 2 is a monitoring device. The wireless slave station 4 receives, for example, a video signal from a camera (external device 5B) arranged in a river, and transmits the received video signal to the wireless master station 3. Further, the wireless master station 3 transmits the video signal from the wireless slave station 4 to the disaster prevention operation console 2. Further, the disaster prevention operation console 2 transmits the video signal received from the wireless master station 3 to the monitoring device (external device 5A). Then, the monitor device (external device 5A) displays the video signal received from the disaster prevention operation console 2 on the monitor screen. As a result, the user of the disaster prevention operation console 2 can recognize the situation such as the water level of the river from the image projected on the monitor device (external device 5A).

外部機器5Aは、第1の通信装置10(10A)を有する。第1の通信装置10は、UARTの通信を行う、例えば、UART通信装置である。また、防災操作卓2は、第1の通信装置10(10B)と、第2の通信装置40とを有する。第2の通信装置40は、UARTの通信を行う、例えば、UART通信装置である。また、無線親局3は、第2の通信装置40を有する。更に、無線子局4は、第1の通信装置10(10B)を有する。更に、外部機器5Bは、第1の通信装置10(10A)を有する。 The external device 5A has a first communication device 10 (10A). The first communication device 10 is, for example, a UART communication device that performs UART communication. Further, the disaster prevention operation console 2 has a first communication device 10 (10B) and a second communication device 40. The second communication device 40 is, for example, a UART communication device that performs UART communication. Further, the wireless master station 3 has a second communication device 40. Further, the radio slave station 4 has a first communication device 10 (10B). Further, the external device 5B has a first communication device 10 (10A).

図2は、第1の通信装置10の構成の一例を示すブロック図である。図2に示す第1の通信装置10は、P/S(Parallel/Serial)変換部11と、設定部12と、送信部13と、受信部14と、S/P(Serial/Parallel)変換部15と、受信判定部16と、制御部17とを有する。なお、第2の通信装置40も上記と同じ構成である。 FIG. 2 is a block diagram showing an example of the configuration of the first communication device 10. The first communication device 10 shown in FIG. 2 includes a P / S (Parallel / Serial) conversion unit 11, a setting unit 12, a transmission unit 13, a reception unit 14, and an S / P (Serial / Parallel) conversion unit. It has 15, a reception determination unit 16, and a control unit 17. The second communication device 40 also has the same configuration as described above.

P/S変換部11は、制御部17から入力される送信データであるパラレルデータをシリアルデータに変換し、変換後のシリアルデータを送信部13に出力する。 The P / S conversion unit 11 converts parallel data, which is transmission data input from the control unit 17, into serial data, and outputs the converted serial data to the transmission unit 13.

設定部12は、制御部17からのボーレートを設定する指示を検出するとP/S変換部11及びS/P変換部15に対してボーレートを設定する。また、制御部17からのボーレートの自動設定の指示を検出した場合、ボーレートの自動設定を開始する。設定部12は、複数の設定可能なボーレートを備え、複数のボーレートの中から接続される通信装置との通信可能なボーレートを設定する。なお、設定可能なボーレートは通信装置によって異なる場合があり、その設定方法については後述する。 When the setting unit 12 detects an instruction for setting the baud rate from the control unit 17, the setting unit 12 sets the baud rate for the P / S conversion unit 11 and the S / P conversion unit 15. Further, when the instruction for automatic setting of the baud rate is detected from the control unit 17, the automatic setting of the baud rate is started. The setting unit 12 has a plurality of settable baud rates, and sets a baud rate capable of communicating with a communication device connected from the plurality of baud rates. The baud rate that can be set may differ depending on the communication device, and the setting method will be described later.

送信部13は、設定部12にて設定されたボーレートでP/S変換部11で変換されたシリアルデータ信号を対向側の通信装置に送信する。尚、対向側の通信装置は、自装置がUARTを用いて通信を行う先の通信装置である。例えば、自装置が図1に示す外部機器5Aの通信装置10Aの場合、対向側の通信装置は防災操作卓2の通信装置10Bである。 The transmission unit 13 transmits the serial data signal converted by the P / S conversion unit 11 at the baud rate set by the setting unit 12 to the communication device on the opposite side. The communication device on the opposite side is a communication device to which the own device communicates using the UART. For example, when the own device is the communication device 10A of the external device 5A shown in FIG. 1, the communication device on the opposite side is the communication device 10B of the disaster prevention operation console 2.

受信部14は、対向側の通信装置10Bから送信されたデータ信号を受信し、受信したデータ信号をS/P変換部15と受信判定部16に出力する。 The receiving unit 14 receives the data signal transmitted from the communication device 10B on the opposite side, and outputs the received data signal to the S / P conversion unit 15 and the reception determination unit 16.

S/P変換部15は、受信部14から入力される受信データであるシリアルデータをパラレルデータに変換し、パラレル変換後のパラレルデータを制御部17に出力する。 The S / P conversion unit 15 converts the serial data, which is the reception data input from the reception unit 14, into parallel data, and outputs the parallel data after the parallel conversion to the control unit 17.

制御部17は、各部の制御および送信データの作成および受信データ処理を行うとともに、第1の判定部18を有する。また、ボーレートの自動設定モードに入るには、手動の他に、通信装置間で通信ケーブルが接続されたと検知すると、設定部12と受信判定部16にボーレートの自動設定モードの開始を通知する。 The control unit 17 controls each unit, creates transmission data, processes received data, and has a first determination unit 18. Further, in order to enter the automatic baud rate setting mode, in addition to manual operation, when it is detected that a communication cable is connected between communication devices, the setting unit 12 and the reception determination unit 16 are notified of the start of the automatic baud rate setting mode.

第1の判定部18は、設定部17で設定された自装置10Aのボーレート(以下第1のボーレート)と対向側の通信装置10Bで設定されたボーレート(以下第2のボーレート)とが一致したか否かを判定する。判定方法は、制御部17が受信信号をS/P変換部15から出力された受信データを後述する自動設定用のデータであると判別できたとき、ボーレートが一致していると判定する。 In the first determination unit 18, the baud rate of the own device 10A (hereinafter referred to as the first baud rate) set by the setting unit 17 and the baud rate set by the communication device 10B on the opposite side (hereinafter referred to as the second baud rate) match. Judge whether or not. The determination method determines that the baud rates match when the control unit 17 can determine that the received signal is the data for automatic setting described later from the received data output from the S / P conversion unit 15.

受信判定部16は、ボーレートの自動設定モード時、対向側の通信装置と通信可能なボーレートを特定する。受信判定部16は、第2の判定部21と、計測部22と、チェック受信部23とを有する。 The reception determination unit 16 identifies the baud rate capable of communicating with the communication device on the opposite side in the automatic baud rate setting mode. The reception determination unit 16 includes a second determination unit 21, a measurement unit 22, and a check reception unit 23.

計測部22は、第1の判定部18によって第1のボーレートと第2のボーレートとが一致していないと判定された場合に、対向側の通信装置から送信された後述する自動設定用
の信号から1ビット長(1ビットあたりの通信時間)を計測し、計測した1ビット長から第2のボーレートと特定する。これは、1ビット長の逆数がボーレートとなるため、1ビット長でボーレートが特定できるからである。
When the first determination unit 18 determines that the first baud rate and the second baud rate do not match, the measurement unit 22 transmits a signal for automatic setting, which will be described later, transmitted from the communication device on the opposite side. 1 bit length (communication time per bit) is measured from, and the measured 1 bit length is specified as the second baud rate. This is because the reciprocal of the 1-bit length is the baud rate, so the baud rate can be specified by the 1-bit length.

第2の判定部21は、計測部22によって特定された第2のボーレートが第1のボーレートと比較して第1のボーレート以下であるか否かを判定し、判定結果を制御部17に出力する。 The second determination unit 21 determines whether or not the second baud rate specified by the measurement unit 22 is equal to or less than the first baud rate as compared with the first baud rate, and outputs the determination result to the control unit 17. To do.

チェック受信部23は、対向側の通信装置10Bから所定時間(例えば、3秒)内にボーレートが一致したことを示す一致信号を受信したか否かを判定し、判定結果を制御部17に出力する。 The check receiving unit 23 determines whether or not a matching signal indicating that the baud rates have matched has been received from the communication device 10B on the opposite side within a predetermined time (for example, 3 seconds), and outputs the determination result to the control unit 17. To do.

尚、説明の便宜上、図2に示す第1の通信装置10は、通信装置である外部機器5A内の第1の通信装置10Aを例示して説明したが、対向側の通信装置である防災操作卓2内の第1の通信装置10Bも同一の構成である。従って、第1の通信装置10Bについては、第1の通信装置10Aと同一の構成には同一符号を付すことで、その重複する構成及び動作の説明については省略する。第1の通信装置10Aは、第1の信号及び第1の一致信号を第1の通信装置10Bに送信すると共に、第1の通信装置10Bからの第2の信号及び第2の一致信号を受信する。これに対して、第1の通信装置10Bは、第2の信号及び第2の一致信号を第1の通信装置10Aに送信すると共に、第1の通信装置10Aからの第1の信号及び第1の一致信号を受信する。また、図2は、第1の通信装置10Aとの第1の通信装置10Bは、同一の構成のため同一名称としているが、第1の通信装置10Aと第1の通信装置10Bとの区別するために便宜上、次の名称とする。第1の通信装置10Aの構成の名称に「第1の」を付し、第1の通信装置10Bの構成の名称に「第2の」を付す。ただし、第1の通信装置10Aの第1の判定部、第2の判定部に相当する通信装置10Bは、第3の判定部、第4の判定部とする。 For convenience of explanation, the first communication device 10 shown in FIG. 2 has been described by exemplifying the first communication device 10A in the external device 5A which is a communication device, but the disaster prevention operation which is the communication device on the opposite side. The first communication device 10B in the table 2 has the same configuration. Therefore, with respect to the first communication device 10B, the same components as those of the first communication device 10A are designated by the same reference numerals, and the description of the overlapping configurations and operations will be omitted. The first communication device 10A transmits the first signal and the first matching signal to the first communication device 10B, and receives the second signal and the second matching signal from the first communication device 10B. To do. On the other hand, the first communication device 10B transmits the second signal and the second matching signal to the first communication device 10A, and the first signal and the first signal from the first communication device 10A. Receives a match signal. Further, in FIG. 2, the first communication device 10A and the first communication device 10B have the same name because they have the same configuration, but the first communication device 10A and the first communication device 10B are distinguished from each other. Therefore, for convenience, the names are as follows. "First" is added to the name of the configuration of the first communication device 10A, and "second" is added to the name of the configuration of the first communication device 10B. However, the communication device 10B corresponding to the first determination unit and the second determination unit of the first communication device 10A is a third determination unit and a fourth determination unit.

図3は、UART通信に使用する信号の通信フォーマットの一例を示す説明図である。図3に示すUART通信に使用する信号の通信フォーマットは、1バイト(8ビット)の構成であって、データ開始を示す1ビットのスタートビットと、MSB〜LSBまでの8ビットのデータビットと、データ終了を示す1ビットのストップビットとを有する。本実施例でボーレートの自動設定時には、「5516」を送信データとした図3に示す通信フォーマットの送信信号が使用する。送信データを「5516」とした場合、1ビット毎に1(High)、0(Low)を4回繰り返すため、計測部22において1ビットあたりの通信時間の計測が連続して可能となる。送信データは、「5516」以外に1ビット毎に1(High)、0(Low)を繰り返すデータとして「AA16」にしてもよい。ボーレートの自動設定時、通信装置はこの送信データを連続して送信することで、送信先の通信装置が確実に受信できるようにしている。 FIG. 3 is an explanatory diagram showing an example of a communication format of a signal used for UART communication. The communication format of the signal used for UART communication shown in FIG. 3 has a 1-byte (8-bit) configuration, and includes a 1-bit start bit indicating a data start, an 8-bit data bit from MSB to LSB, and It has a 1-bit stop bit indicating the end of data. At the time of automatic setting of the baud rate in this embodiment, the transmission signal of the communication format shown in FIG. 3 with "55 16 " as the transmission data is used. When the transmission data is set to "55 16 ", 1 (High) and 0 (Low) are repeated 4 times for each bit, so that the measurement unit 22 can continuously measure the communication time per bit. The transmission data may be "AA 16 " as data that repeats 1 (High) and 0 (Low) for each bit in addition to "55 16 ". When the baud rate is automatically set, the communication device continuously transmits this transmission data so that the communication device at the transmission destination can reliably receive the data.

図4は、第2の信号であるデータ信号から計測部22が1ビット長を計測する計測方法の一例を示す説明図である。この1ビット長の逆数がボーレートとなる。計測部22は、対向側の通信装置から受信部14で受信したデータ信号から1ビット毎の1(High)の信号の立上りエッジから次の立下りエッジまでの時間をカウントして1ビット長を計測する。計測結果が、ボーレート毎に定められた1ビット長の時間の範囲内のいずれかにあるかでボーレートを特定する。例えば、計測結果が99〜109マイクロ秒の間にあるときはボーレートが9600bpsと特定し、47〜57マイクロ秒の間にあるときはボーレートが19200bpsと特定する。1ビット長の時間に範囲を設けているのは測定誤差を考慮しているためである。実際の計測では、3回連続で1ビット長を計測し、3回の計測結果のすべてが同じボーレートを特定する1ビット長の範囲内にあればボーレ−トを特定する。上記は、1(High)の信号で1ビット長を計測したが、0(Low)の信号を用いて立下りエッジから次の立上りエッジまでの時間を計測してもよい。 FIG. 4 is an explanatory diagram showing an example of a measurement method in which the measurement unit 22 measures a bit length from a data signal which is a second signal. The reciprocal of this 1-bit length is the baud rate. The measuring unit 22 counts the time from the rising edge to the next falling edge of a 1 (High) signal for each bit from the data signal received by the receiving unit 14 from the communication device on the opposite side to obtain a 1-bit length. measure. The baud rate is specified depending on whether the measurement result is within the time range of 1 bit length determined for each baud rate. For example, when the measurement result is between 99 and 109 microseconds, the baud rate is specified as 9600 bps, and when the measurement result is between 47 and 57 microseconds, the baud rate is specified as 19200 bps. The reason why the time range of 1 bit length is provided is that the measurement error is taken into consideration. In the actual measurement, the 1-bit length is measured three times in a row, and if all the measurement results of the three times are within the range of the 1-bit length that specifies the same baud rate, the baud rate is specified. In the above, the 1-bit length is measured with a 1 (High) signal, but the time from the falling edge to the next rising edge may be measured using the 0 (Low) signal.

次に実施例の防災無線システム1の動作について説明する。図5は、ボーレートの自動設定処理に関わる第1の通信装置10の処理動作の一例を示すフローチャートである。尚、説明の便宜上、自装置10A(外部機器5Aの第1の通信装置10A)が図5に示す処理動作を実行する場合を説明するが、自装置10Aと接続される対向側の通信装置10B(防災操作卓2の第1の通信装置10B)も、同様に、図5に示す処理動作を実行する。 Next, the operation of the disaster prevention wireless system 1 of the embodiment will be described. FIG. 5 is a flowchart showing an example of the processing operation of the first communication device 10 related to the automatic setting process of the baud rate. For convenience of explanation, a case where the own device 10A (the first communication device 10A of the external device 5A) executes the processing operation shown in FIG. 5 will be described, but the communication device 10B on the opposite side connected to the own device 10A will be described. (The first communication device 10B of the disaster prevention operation console 2) also executes the processing operation shown in FIG. 5 in the same manner.

図2に示す自装置10A内の設定部12は、制御部17からの自動設定の開始指示を受けると自動設定モードを開始する(ステップS11)。自装置10A内の設定部12は、P/S変換部11及びS/P変換部15に対して設定可能なボーレートの中から最も通信速度の速いボーレートを設定する(以下、自装置10Aで設定されたボーレートを第1のボーレートという)(ステップS12)。制御部17は、自動設定のデータである「5516」をP/S変換部11で変換したシリアルデータ信号を送信部13から対向側の通信装置10Bに送信する(ステップS13)。なお、対向側の通信装置10Bも同様に、設定可能なボーレートの中から最も通信速度の速いボーレートを設定して、自動設定のデータである「5516」を自装置10Aに送信する。 The setting unit 12 in the own device 10A shown in FIG. 2 starts the automatic setting mode when receiving an instruction to start the automatic setting from the control unit 17 (step S11). The setting unit 12 in the own device 10A sets the baud rate having the fastest communication speed among the baud rates that can be set for the P / S conversion unit 11 and the S / P conversion unit 15 (hereinafter, set by the own device 10A). The baud rate is referred to as the first baud rate) (step S12). The control unit 17 transmits the serial data signal obtained by converting the automatically set data “55 16 ” by the P / S conversion unit 11 from the transmission unit 13 to the communication device 10B on the opposite side (step S13). Similarly, the communication device 10B on the opposite side also sets the baud rate having the fastest communication speed from the baud rates that can be set, and transmits the automatically set data "55 16 " to the own device 10A.

自装置10A内の受信部14は、対向側の通信装置10Bからの送信された信号の受信を開始する(ステップS14)。 The receiving unit 14 in the own device 10A starts receiving the signal transmitted from the communication device 10B on the opposite side (step S14).

制御部17は、第1のボーレートと第2のボーレートが一致していると、受信部14で受信した信号をS/P変換部15でパラレルデータに変換したデータが自動設定用のデータである「5516」と判別できるので、制御部17内の第1の判定部18は、制御部17が自動設定用のデータである「5516」と判別できたか否か判定する(ステップS15)。 When the first baud rate and the second baud rate match, the control unit 17 converts the signal received by the receiving unit 14 into parallel data by the S / P conversion unit 15, and the data is the data for automatic setting. Since it can be determined as "55 16 ", the first determination unit 18 in the control unit 17 determines whether or not the control unit 17 can determine whether it can be determined as "55 16 " which is the data for automatic setting (step S15).

制御部17内の第1の判定部18は、自動設定用のデータである「5516」が判別できた場合(ステップS15:Yes)、第1のボーレートと第2のボーレートが一致していると判定し、制御部17は自動設定用のデータの送信を停止させる(ステップS16)。制御部17は、自動設定用のデータの送信を停止させた後、対向側の通信装置10Bに対してボーレートが一致したことを対向側の通信装置10Bに報知するための信号である一致信号を送信部13から送信させる(ステップS17)。なお、対向側の通信装置10Bも同様に、自動設定用のデータである「5516」が判別できた場合、自動設定用のデータの送信を停止して、ボーレートが一致したことを報知する一致信号を自装置10Aに送信する。 When the first determination unit 18 in the control unit 17 can determine "55 16 " which is the data for automatic setting (step S15: Yes), the first baud rate and the second baud rate match. The control unit 17 stops the transmission of the data for automatic setting (step S16). After stopping the transmission of the data for automatic setting, the control unit 17 transmits a matching signal, which is a signal for notifying the communication device 10B on the opposite side that the baud rate has matched with the communication device 10B on the opposite side. It is transmitted from the transmission unit 13 (step S17). Similarly, when the communication device 10B on the opposite side can determine the data for automatic setting "55 16 ", the transmission of the data for automatic setting is stopped to notify that the baud rates have been matched. The signal is transmitted to the own device 10A.

受信判定部16内のチェック受信部23は、対向側の通信装置10Bから一致信号を受信したか否かを判定する(ステップS18)。 The check reception unit 23 in the reception determination unit 16 determines whether or not a match signal has been received from the communication device 10B on the opposite side (step S18).

制御部17は、一致信号を受信しなかった場合(ステップS18:No)、自装置10Aが一致信号の送信を開始してから所定時間が経過したか否かを判定する(ステップS21)。この所定時間は、対向側の通信装置10Bからの一致信号を受信する待ち時間で、例えば、その時間は一致信号を送信する際のボーレートにおいて1データ分(10クロック)の時間とする。制御部17は、一致信号の送信開始から所定時間が経過した場合(ステップS21:Yes)、対向側の通信装置10Bが、自装置10Aからの自動設定用のデータである「5516」を判別できていないとして、対向側の通信装置10Bに対して現在設定中のボーレートで自動設定用のデータの送信を再開するように送信部13を制御する(ステップS22)。そして、制御部17は、自動設定用のデータの送信を再開した後、対向側の通信装置10Bからの送信信号を受信したデータが自動設定用のデータであると判別できたか否かを判定するようにステップS15に移行する。 When the control unit 17 does not receive the match signal (step S18: No), the control unit 17 determines whether or not a predetermined time has elapsed since the own device 10A started transmitting the match signal (step S21). This predetermined time is the waiting time for receiving the match signal from the communication device 10B on the opposite side. For example, the time is set to one data (10 clocks) at the baud rate when transmitting the match signal. When a predetermined time has elapsed from the start of transmission of the match signal (step S21: Yes), the control unit 17 determines that the communication device 10B on the opposite side determines "55 16 " which is the data for automatic setting from the own device 10A. Assuming that it has not been completed, the transmission unit 13 is controlled so as to restart the transmission of the data for automatic setting to the communication device 10B on the opposite side at the currently set baud rate (step S22). Then, after resuming the transmission of the data for automatic setting, the control unit 17 determines whether or not the data received from the communication device 10B on the opposite side can be determined to be the data for automatic setting. The process proceeds to step S15.

制御部17は、一致信号の送信開始から所定時間を経過していない場合(ステップS21:No)、一致信号を受信したか否かを判定するようにステップS18に移行する。 When the predetermined time has not elapsed from the start of transmission of the match signal (step S21: No), the control unit 17 proceeds to step S18 so as to determine whether or not the match signal has been received.

制御部17は、一致信号を受信した場合(ステップS18:Yes)、自動設定モードを終了し(ステップS19)、設定中のボーレートで通常のデータ通信を開始し(ステップS20)、図5に示す処理動作を終了する。 When the control unit 17 receives the match signal (step S18: Yes), the control unit 17 ends the automatic setting mode (step S19), starts normal data communication at the set baud rate (step S20), and is shown in FIG. End the processing operation.

制御部17内の第1の判定部18は、自動設定用のデータの「5516」が判別できなかった場合(ステップS15:No)、第1のボーレートと第2のボーレートが一致していないと判定し、受信判定部16内の計測部22で、受信部14からのシリアルデータから1ビット長(1ビットあたりの通信時間)を測定し、測定した1ビット長から対向側の通信装置10Bの設定された第2のボーレートを特定する(ステップS25)。 When the first determination unit 18 in the control unit 17 cannot determine "55 16 " of the data for automatic setting (step S15: No), the first baud rate and the second baud rate do not match. The measurement unit 22 in the reception determination unit 16 measures the 1-bit length (communication time per bit) from the serial data from the reception unit 14, and the communication device 10B on the opposite side from the measured 1-bit length. The set second baud rate of is specified (step S25).

受信判定部16内の第2の判定部21は、特定された第2のボーレートが第1のボーレート以下であるか否かを判定する(ステップS26)。第2の判定部21は、特定された第2の信号のボーレートが第1のボーレート以下の場合(ステップS26:Yes)、自装置10Aが設定可能な複数のボーレートの中から第2のボーレートに一致するボーレートがあるか否かを判定する(ステップS27)。 The second determination unit 21 in the reception determination unit 16 determines whether or not the specified second baud rate is equal to or less than the first baud rate (step S26). When the baud rate of the specified second signal is equal to or lower than the first baud rate (step S26: Yes), the second determination unit 21 selects the second baud rate from the plurality of baud rates that can be set by the own device 10A. It is determined whether or not there is a matching baud rate (step S27).

受信判定部16内の第2の判定部21で特定された第2のボーレートが第1のボーレート以下でない場合(ステップS26:No)、再度、受信信号で自動設定用のデータを判別できたか否かを判定するようにステップS15に移行して、自装置10Aのボーレートはそのままで、再度、対向側の通信装置Bからの信号を受信する。これは、対向側の通信装置10Bが自装置10Aの後述するステップ30と同じようにボーレートを下げて自動設定用のデータを送信するためである。 When the second baud rate specified by the second determination unit 21 in the reception determination unit 16 is not equal to or lower than the first baud rate (step S26: No), whether or not the data for automatic setting can be determined again by the received signal. The process proceeds to step S15 so as to determine whether or not, and the signal from the communication device B on the opposite side is received again while maintaining the baud rate of the own device 10A. This is because the communication device 10B on the opposite side lowers the baud rate and transmits the data for automatic setting in the same manner as in step 30 described later of the own device 10A.

第2の判定部21は、自装置10Aの設定可能な複数のボーレートの中に特定した第2のボーレートがある場合(ステップS27:Yes)、特定した第2のボーレートと同じボーレートを第1のボーレートとして設定し、自動設定用のデータを送信し(ステップS28)、再度、受信信号で自動設定用のデータを判別できたか否かを判定するようにステップS15に移行する。 When the specified second baud rate is among the plurality of settable baud rates of the own device 10A (step S27: Yes), the second determination unit 21 uses the same baud rate as the specified second baud rate as the first baud rate. It is set as a baud rate, the data for automatic setting is transmitted (step S28), and the process proceeds to step S15 so as to determine whether or not the data for automatic setting can be determined again from the received signal.

第2の判定部21は、自装置10Aの設定可能な複数のボーレートの中に特定した第2のボーレートがない場合(ステップS27:No)、自装置10Aの設定可能な複数のボーレートの中から特定した第2のボーレート未満のボーレートがあるか否かを判定する(ステップS29)。 When the specified second baud rate is not among the plurality of settable baud rates of the own device 10A (step S27: No), the second determination unit 21 is selected from the plurality of settable baud rates of the own device 10A. It is determined whether or not there is a baud rate lower than the specified second baud rate (step S29).

制御部17は、特定した第2のボーレート未満のボーレートがある場合(ステップS29:Yes)、設定可能なボーレートの中から、特定した第2のボーレート未満、かつ最大のボーレートを第1のボーレートとして設定し、自動設定用のデータを送信し(ステップS30)、再度、受信信号で自動設定用のデータを判別できたか否かを判定するようにステップS15に移行する。 When the control unit 17 has a baud rate lower than the specified second baud rate (step S29: Yes), the control unit 17 sets the baud rate lower than the specified second baud rate and the maximum baud rate as the first baud rate among the settable baud rates. The setting is performed, the data for automatic setting is transmitted (step S30), and the process proceeds to step S15 so as to determine whether or not the data for automatic setting can be determined from the received signal again.

制御部17は、特定した第2のボーレート未満のボーレートがない場合(ステップS29:No)、設定可能なボーレート内に自動設定できるボーレートがないものと判断し、自動設定の失敗を表すエラー信号を出力し(ステップS31)、図5に示す処理動作を終了する。 If there is no baud rate lower than the specified second baud rate (step S29: No), the control unit 17 determines that there is no baud rate that can be automatically set within the settable baud rate, and outputs an error signal indicating a failure of the automatic setting. Output (step S31), and the processing operation shown in FIG. 5 is terminated.

尚、通信装置は、ステップS13の自動設定用のデータの送信開始から、ステップS16の送信停止、ステップS28又はステップS30のボーレート変更まで継続して自動設定用のデータを送信する。 The communication device continuously transmits the data for automatic setting from the start of transmission of the data for automatic setting in step S13 to the stop of transmission in step S16 and the change of the baud rate in step S28 or step S30.

外部機器5A側の第1の通信装置10Aは、図5に示す自動設定処理を実行すると共に、対向側の通信装置である防災操作卓2A側の第1の通信装置10Bも、図5に示す自動設定処理を実行する。その結果、通信装置10A及び通信装置10Bは、親子関係を事前に設定しなくても、UART通信に使用するボーレートを自動設定できる。 The first communication device 10A on the external device 5A side executes the automatic setting process shown in FIG. 5, and the first communication device 10B on the disaster prevention operation console 2A side, which is the communication device on the opposite side, is also shown in FIG. Execute automatic setting process. As a result, the communication device 10A and the communication device 10B can automatically set the baud rate used for the UART communication without setting the parent-child relationship in advance.

図6は、通信装置10A及び通信装置10Bとの間のボーレート自動設定の動作の一例を示す説明図である。尚、説明の便宜上、通信装置10Aは、38400bps及び19200bpsのボーレートを設定可能にし、通信装置10Bは、19200bps及び9600bpsのボーレートを設定可能にしている。また、通信装置10Aで設定されたボーレートを第1のボーレートとし、通信装置10Bで設定されたボーレートを第2のボーレートとする。 FIG. 6 is an explanatory diagram showing an example of the operation of automatic baud rate setting between the communication device 10A and the communication device 10B. For convenience of explanation, the communication device 10A makes it possible to set the baud rates of 38400 bps and 19200 bps, and the communication device 10B makes it possible to set the baud rates of 19200 bps and 9600 bps. Further, the baud rate set by the communication device 10A is set as the first baud rate, and the baud rate set by the communication device 10B is set as the second baud rate.

状態A1の通信装置10Aは、通信装置10Bとの間でUARTのボーレートを自動設定する場合、複数の設定可能なボーレートの中から最大のボーレート、すなわち38400bpsのボーレートを設定する。通信装置10Aは、38400bpsのボーレートで自動設定用のデータを通信装置10Bに送信する。 When the communication device 10A in the state A1 automatically sets the UART baud rate with the communication device 10B, the communication device 10A sets the maximum baud rate from a plurality of configurable baud rates, that is, a baud rate of 38400 bps. The communication device 10A transmits data for automatic setting to the communication device 10B at a baud rate of 38400 bps.

これに対して、状態A1の通信装置10Bは、通信装置10Aとの間でUARTのボーレートを自動設定する場合、複数の設定可能なボーレートの中から最大のボーレート、すなわち19200bpsのボーレートを設定する。通信装置10Bは、19200bpsのボーレートで自動設定用のデータを通信装置10Aに送信する。 On the other hand, when the communication device 10B in the state A1 automatically sets the UART baud rate with the communication device 10A, the communication device 10B sets the maximum baud rate, that is, the baud rate of 19200 bps from a plurality of configurable baud rates. The communication device 10B transmits data for automatic setting to the communication device 10A at a baud rate of 19,200 bps.

状態A1の通信装置10Aは、通信装置10Bからの送信信号を受信した受信信号が自動設定用のデータであると判別できないため、第1のボーレートと第2のボーレートが一致していないと判断し、受信信号から1ビット長を計測して、計測したデータ長を基に第2のボーレートを特定する。通信装置10Aは、第1のボーレートが特定した第2のボーレート以下と判断し、設定可能なボーレートの中から特定した第2のボーレートである19200bpsがある場合、第1のボーレートを19200bpsに設定し、自動設定用のデータを通信装置10Bに送信する(状態A2)。 Since the communication device 10A in the state A1 cannot determine that the received signal received from the communication device 10B is the data for automatic setting, it determines that the first baud rate and the second baud rate do not match. , The 1-bit length is measured from the received signal, and the second baud rate is specified based on the measured data length. The communication device 10A determines that the first baud rate is equal to or lower than the specified second baud rate, and if there is a second baud rate of 19200 bps specified from the configurable baud rates, the communication device 10A sets the first baud rate to 19200 bps. , Data for automatic setting is transmitted to the communication device 10B (state A2).

これに対して、状態A1の通信装置10Bは、通信装置10Aと同様に第1のボーレートと第2のボーレートが一致していないと判断し、受信信号からデータ長(1ビット長)を計測して、計測したデータ長を基に第1のボーレートを19200bpsと特定する。通信装置10Bは、特定した第1のボーレートが第2のボーレート以下でないと判断し、第2のボーレートは19200bpsのまま自動設定用のデータを通信装置10Aに送信する(状態A2)。 On the other hand, the communication device 10B in the state A1 determines that the first baud rate and the second baud rate do not match as in the communication device 10A, and measures the data length (1 bit length) from the received signal. Therefore, the first baud rate is specified as 19200 bps based on the measured data length. The communication device 10B determines that the specified first baud rate is not equal to or lower than the second baud rate, and transmits data for automatic setting to the communication device 10A while keeping the second baud rate at 19200 bps (state A2).

状態A2の通信装置10Aは、第1のボーレートと第2のボーレートとがともに19200bpsと一致したと判断し、一致信号を通信装置10Bに送信する。また、通信装置10Bは、同じく第1のボーレートと第2のボーレートとがともに19200bpsと一致したと判断し、一致信号を通信装置10Aに送信する。 The communication device 10A in the state A2 determines that both the first baud rate and the second baud rate match 19200 bps, and transmits a matching signal to the communication device 10B. Further, the communication device 10B also determines that both the first baud rate and the second baud rate match 19200 bps, and transmits a matching signal to the communication device 10A.

その結果、状態A3の通信装置10Aは第2の一致信号を受信、状態A3の通信装置10Bは第1の一致信号を受信することで、通信装置10Aと通信装置10Bとの間で19200bpsのボーレートでのデータ通信を開始する。 As a result, the communication device 10A in the state A3 receives the second match signal, and the communication device 10B in the state A3 receives the first match signal, so that the baud rate of 19200 bps between the communication device 10A and the communication device 10B. Start data communication with.

図7は、通信装置10Aと通信装置10Bとの間のボーレート自動設定の動作の一例を示す説明図である。尚、説明の便宜上、通信装置10Aは、38400bps、19200bps及び4800bpsのボーレートを設定可能にし、通信装置10Bは、9600bps及び4800bpsのボーレートを設定可能にしている。また、通信装置10Aで設定されたボーレートを第1のボーレートとし、通信装置10Bで設定されたボーレートを第2のボーレートとする。 FIG. 7 is an explanatory diagram showing an example of the operation of automatic baud rate setting between the communication device 10A and the communication device 10B. For convenience of explanation, the communication device 10A makes it possible to set baud rates of 38400 bps, 19200 bps, and 4800 bps, and the communication device 10B makes it possible to set baud rates of 9600 bps and 4800 bps. Further, the baud rate set by the communication device 10A is set as the first baud rate, and the baud rate set by the communication device 10B is set as the second baud rate.

状態B1の通信装置10Aは、通信装置10Bとの間でUARTのボーレートを自動設定する場合、複数のボーレートの中から最大のボーレート、すなわち38400bpsのボーレートを設定する。通信装置10Aは、38400bpsのボーレートで自動設定用のデータを通信装置10Bに送信する。 When the communication device 10A in the state B1 automatically sets the UART baud rate with the communication device 10B, the communication device 10A sets the maximum baud rate from a plurality of baud rates, that is, a baud rate of 38400 bps. The communication device 10A transmits data for automatic setting to the communication device 10B at a baud rate of 38400 bps.

これに対して、状態B1の通信装置10Bは、通信装置10Aとの間でUARTのボーレートを自動設定する場合、複数の設定可能なボーレートの中から最大のボーレート、すなわち9600bpsのボーレートを設定する。通信装置10Bは、9600bpsのボーレートで自動設定用のデータを通信装置10Aに送信する。 On the other hand, when the communication device 10B in the state B1 automatically sets the UART baud rate with the communication device 10A, the communication device 10B sets the maximum baud rate from a plurality of configurable baud rates, that is, a baud rate of 9600 bps. The communication device 10B transmits data for automatic setting to the communication device 10A at a baud rate of 9600 bps.

状態B1の通信装置10Aは、通信装置10Bからの送信信号を受信した受信信号が自動設定用のデータであると判別できないため、第1のボーレートと第2のボーレートが一致していないと判断し、受信信号からデータ長(1ビット長)を計測して、計測したデータ長を基に第2のボーレートを9600bpsと特定する。通信装置10Aは、特定した第2のボーレートは、第1のボーレート以下と判断し、設定可能なボーレートの中から4800bpsを第1のボーレートに設定する。通信装置10Aは、4800bpsのボーレートで自動設定用のデータを通信装置10Bに送信する(状態B2)。 Since the communication device 10A in the state B1 cannot determine that the received signal received from the communication device 10B is the data for automatic setting, it determines that the first baud rate and the second baud rate do not match. , The data length (1 bit length) is measured from the received signal, and the second baud rate is specified as 9600 bps based on the measured data length. The communication device 10A determines that the specified second baud rate is equal to or lower than the first baud rate, and sets 4800 bps as the first baud rate from the settable baud rates. The communication device 10A transmits data for automatic setting to the communication device 10B at a baud rate of 4800 bps (state B2).

状態B1の通信装置10Bは、通信装置10Aと同様に第1のボーレートと第2のボーレートが一致していないと判断し、受信信号からデータ長(1ビット長)を計測して、計測したデータ長を基に第1のボーレートを38400bpsと特定する。通信装置10Bは、特定した第1のボーレートが第2のボーレート以下でないと判断し、第2のボーレートは9600bpsのまま自動設定用のデータを通信装置10Aに送信する(状態B2)。 Similar to the communication device 10A, the communication device 10B in the state B1 determines that the first baud rate and the second baud rate do not match, measures the data length (1 bit length) from the received signal, and measures the data. The first baud rate is specified as 38400 bps based on the length. The communication device 10B determines that the specified first baud rate is not equal to or lower than the second baud rate, and transmits data for automatic setting to the communication device 10A while keeping the second baud rate at 9600 bps (state B2).

状態B2の通信装置10Aは、4800bpsの第1のボーレートと9600bpsの第2のボーレートが一致してなく、かつ、特定した第2のボーレートが第1のボーレート以下でないと判断し、第1のボーレートは4800bpsのまま自動設定用のデータを通信装置10Bに送信する(状態B3)。 The communication device 10A in the state B2 determines that the first baud rate of 4800 bps and the second baud rate of 9600 bps do not match, and the specified second baud rate is not equal to or less than the first baud rate, and determines that the first baud rate is not equal to or lower than the first baud rate. Transmits data for automatic setting to the communication device 10B at 4800 bps (state B3).

これに対して、状態B2の通信装置10Bは、4800bpsの第1のボーレートと9600bpsの第2のボーレートとを比較し、第1のボーレートと第2のボーレートが一致していないと判断し、受信信号からデータ長(1ビット長)を計測して、計測したデータ長を基に第1のボーレートを4800bpsと特定する。通信装置10Bは、特定した第1のボーレートが第2のボーレート以下と判断し、設定可能なボーレートの中から4800bpsを第2のボーレートに設定する。通信装置10Bは、4800bpsの第2のボーレートで自動設定用のデータを通信装置10Aに送信する(状態B3)。 On the other hand, the communication device 10B in the state B2 compares the first baud rate of 4800 bps and the second baud rate of 9600 bps, determines that the first baud rate and the second baud rate do not match, and receives the data. The data length (1 bit length) is measured from the signal, and the first baud rate is specified as 4800 bps based on the measured data length. The communication device 10B determines that the specified first baud rate is equal to or lower than the second baud rate, and sets 4800 bps as the second baud rate from the settable baud rates. The communication device 10B transmits data for automatic setting to the communication device 10A at a second baud rate of 4800 bps (state B3).

状態B3の通信装置10Aは、第1のボーレートと第2のボーレートとがともに4800bpsと一致したと判断し、一致信号を通信装置10Bに送信する。また、通信装置10Bは、同じく第1のボーレートと第2のボーレートとがともに4800bpsと一致したと判断し、一致信号を通信装置10Aに送信する。 The communication device 10A in the state B3 determines that both the first baud rate and the second baud rate match 4800 bps, and transmits a matching signal to the communication device 10B. Further, the communication device 10B also determines that both the first baud rate and the second baud rate match 4800 bps, and transmits a matching signal to the communication device 10A.

その結果、状態B4の通信装置10Aは第2の一致信号を受信、状態A3の通信装置10Bは第1の一致信号を受信することで、通信装置10Aと通信装置10Bとの間で4800bpsのボーレートでのデータ通信を開始する。 As a result, the communication device 10A in the state B4 receives the second match signal, and the communication device 10B in the state A3 receives the first match signal, so that the baud rate of 4800 bps between the communication device 10A and the communication device 10B. Start data communication with.

外部機器5Aの通信装置10A及び対向側(防災操作卓2)の通信装置10Bは自動設定するための自動設定用のデータを相互に送信することで、事前に親子関係を設定することなく、自動設定開始のボーレート初期値が不一致の場合でも、最短時間でボーレートを一致させることができる。 The communication device 10A of the external device 5A and the communication device 10B on the opposite side (disaster prevention operation console 2) automatically transmit data for automatic setting for automatic setting without setting a parent-child relationship in advance. Even if the initial baud rate at the start of setting does not match, the baud rate can be matched in the shortest time.

本実施例では、説明の便宜上、外部機器5Aと防災操作卓2との間のUARTのボーレートを自動設定する場合について例示したが、外部機器5Bと無線子局4との間のUARTのボーレートを自動設定する場合にも適用可能である。 In this embodiment, for convenience of explanation, the case where the UART baud rate between the external device 5A and the disaster prevention operation console 2 is automatically set has been illustrated, but the UART baud rate between the external device 5B and the wireless slave station 4 has been illustrated. It can also be applied when setting automatically.

また、本実施例では、防災無線システム1を例示して説明したが、通信装置と対向側の通信装置との間をUARTで通信接続するシステムであれば良く、UARTで通信接続する通信装置に適用可能である。 Further, in the present embodiment, the disaster prevention wireless system 1 has been described as an example, but any system may be used as long as it is a system for communicating and connecting between the communication device and the communication device on the opposite side by UART, and the communication device for communication connection by UART Applicable.

本実施例では、自動設定を開始する際に設定可能な複数のボーレートの中から大きい順にボーレートを順次設定し、通信装置間で順次実行する場合を例示した。しかしながら、設定可能なボーレートの中から、例えば、小さい順にボーレートを順次設定し、通信装置間で順次実行しても良く、適宜変更可能である。 In this embodiment, a case is illustrated in which the baud rates are sequentially set in descending order from a plurality of baud rates that can be set when the automatic setting is started, and the baud rates are sequentially executed between the communication devices. However, among the baud rates that can be set, for example, the baud rates may be set sequentially in ascending order and executed sequentially between the communication devices, and can be changed as appropriate.

本実施例では、1ビット長(1ビットあたりの通信時間)を計測する場合、自動設定用の送信データ「5516」または「AA16」を用いた計測を例示した。しかしながら、送信データを「3316」または「BB16」として2ビットの時間を計測して1ビット長を求めたり、送信データを「7716」または「EE16」として3ビットの時間を計測して1ビット長を求めても良く、適宜変更可能である。 In this embodiment, when measuring the 1-bit length (communication time per bit), the measurement using the transmission data "55 16 " or "AA 16 " for automatic setting is illustrated. However, the transmission data is set to "33 16 " or "BB 16 " and the time of 2 bits is measured to obtain the 1-bit length, or the transmission data is set to "77 16 " or "EE 16 " and the time of 3 bits is measured. The 1-bit length may be obtained and can be changed as appropriate.

また、図示した各部の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各部の分散・統合の具体的形態は図示のものに限られず、その全部又は一部を、各種の負荷や使用状況等に応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。 Further, each component of each of the illustrated parts does not necessarily have to be physically configured as shown in the figure. That is, the specific form of distribution / integration of each part is not limited to the one shown in the figure, and all or part of them are functionally or physically distributed / integrated in arbitrary units according to various loads and usage conditions. Can be configured.

2 防災操作卓
5(5A、5B) 外部機器
10(10A,10B) 第1の通信装置
12 設定部
13 送信部
14 受信部
16 受信判定部
17 制御部
18 第1の判定部
21 第2の判定部
22 計測部
23 チェック受信部
2 Disaster prevention operation console 5 (5A, 5B) External device 10 (10A, 10B) First communication device 12 Setting unit 13 Transmission unit 14 Reception unit 16 Reception judgment unit 17 Control unit 18 First judgment unit 21 Second judgment Unit 22 Measuring unit 23 Check receiving unit

Claims (8)

対向側の通信装置との間でデータを通信する通信装置であって、
設定可能な複数のボーレートの中から任意のボーレートを設定する設定部と、
設定されたボーレートである第1のボーレートで予め定めた自動設定用のデータを前記対向側の通信装置に送信する送信部と、
前記第1のボーレートで前記対向側の通信装置から送信された信号を受信する受信部と、
前記第1のボーレートと前記対向側の通信装置から送信された信号のボーレートである第2のボーレートとが一致したか否か判定する第1の判定部と、
前記第1の判定部にて前記第1のボーレートと前記第2のボーレートとが一致していない場合に、前記受信部で受信した受信信号の1ビット長を計測し、計測された前記1ビット長から前記第2のボーレートを特定する計測部と、
特定された前記第2のボーレートが前記第1のボーレート以下であるか否かを判定する第2の判定部と、
前記第2の判定部で前記第2のボーレートが前記第1のボーレート以下である場合に、前記設定可能な複数のボーレートの中から、前記第2のボーレート以下のボーレートを前記第1のボーレートに設定するように前記設定部を制御する制御部と
を有することを特徴とする通信装置。
A communication device that communicates data with a communication device on the opposite side.
A setting unit that sets an arbitrary baud rate from multiple baud rates that can be set,
A transmitter that transmits data for automatic setting predetermined at a first baud rate, which is a set baud rate, to the communication device on the opposite side, and a transmission unit.
A receiving unit that receives a signal transmitted from the communication device on the opposite side at the first baud rate, and a receiving unit.
A first determination unit for determining whether or not the first baud rate and the second baud rate, which is the baud rate of the signal transmitted from the communication device on the opposite side, match.
When the first baud rate and the second baud rate do not match in the first determination unit, the 1-bit length of the received signal received by the receiving unit is measured, and the measured 1 bit is measured. A measuring unit that identifies the second baud rate from the length,
A second determination unit for determining whether or not the specified second baud rate is equal to or lower than the first baud rate.
When the second baud rate is equal to or lower than the first baud rate in the second determination unit, the baud rate equal to or lower than the second baud rate is set as the first baud rate from the plurality of configurable baud rates. A communication device including a control unit that controls the setting unit so as to be set.
前記制御部は、
前記第2の判定部にて前記第2のボーレートが前記第1のボーレート以下である場合に、前記設定可能な複数のボーレートの中から、前記第2のボーレートに一致するボーレートがあるか否かを判定し、一致するボーレートがある場合に、当該一致するボーレートを前記第1のボーレートに設定するように前記設定部を制御することを特徴とする請求項1に記載の通信装置。
The control unit
When the second baud rate is equal to or lower than the first baud rate in the second determination unit, whether or not there is a baud rate that matches the second baud rate from among the plurality of configurable baud rates. The communication device according to claim 1, wherein when there is a matching baud rate, the setting unit is controlled so as to set the matching baud rate to the first baud rate.
前記制御部は、
前記第2の判定部にて前記第2のボーレートが前記第1のボーレート以下である場合に、前記設定可能な複数のボーレートの中から前記第2のボーレートに一致するボーレートがあるか否かを判定し、一致するボーレートがない場合に、前記設定可能な複数のボーレートの中から、前記第2のボーレート未満、かつ、最大のボーレートを前記第1のボーレートに設定するように前記設定部を制御することを特徴とする請求項1または2に記載の通信装置。
The control unit
When the second baud rate is equal to or lower than the first baud rate in the second determination unit, whether or not there is a baud rate that matches the second baud rate from among the plurality of configurable baud rates. When it is determined and there is no matching baud rate, the setting unit is controlled so as to set the baud rate less than the second baud rate and the maximum baud rate to the first baud rate from the plurality of settable baud rates. The communication device according to claim 1 or 2, wherein the communication device.
前記制御部は、
前記第1の判定部にて前記第1のボーレートと前記第2のボーレートとが一致している場合に、前記所定の信号の送信を停止し、ボーレートが一致したことを示す一致信号を前記対向側の通信装置に送信するように前記送信部を制御することを特徴とする請求項1〜3のいずれか1つに記載の通信装置。
The control unit
When the first baud rate and the second baud rate match in the first determination unit, the transmission of the predetermined signal is stopped, and a matching signal indicating that the baud rates match is transmitted to the opposite side. The communication device according to any one of claims 1 to 3, wherein the transmission unit is controlled so as to transmit to the communication device on the side.
前記制御部は、
前記一致信号を前記対向側の通信装置に送信した後、前記対向側の通信装置からの一致信号を受信した場合に、設定中のボーレートで前記対向側の通信装置との間のデータ通信を開始するように前記送信部及び前記受信部を制御することを特徴とする請求項4に記載の通信装置。
The control unit
After transmitting the matching signal to the opposite side communication device, when the matching signal from the opposite side communication device is received, data communication with the opposite side communication device is started at the set baud rate. The communication device according to claim 4, wherein the transmitting unit and the receiving unit are controlled so as to perform the same.
前記制御部は、
前記一致信号の前記対向側の通信装置への送信開始から所定時間を経過した場合に、現在設定中のボーレートで送信を再開するように前記送信部を制御することを特徴とする請求項4または5に記載の通信装置。
The control unit
4. The transmission unit is controlled so as to restart the transmission at the currently set baud rate when a predetermined time has elapsed from the start of transmission of the matching signal to the communication device on the opposite side. The communication device according to 5.
対向側の通信装置との間でデータを通信する通信装置が、
設定可能な複数のボーレートの中から任意のボーレートを設定し、
設定されたボーレートである第1のボーレートで予め定めた自動設定用のデータを前記対向側の通信装置に送信し、
前記対向側の通信装置にて設定されたボーレートである第2のボーレートで前記対向側の通信装置から送信される信号を受信し、
前記第1のボーレートと前記第2のボーレートとが一致するか否かを判定し、
前記第1のボーレートと前記第2のボーレートとが一致していない場合に、前記対向側の通信装置から受信した受信信号の1ビット長を計測し、
計測された前記1ビット長から前記第2のボーレートを特定し、第2のボーレートが前記第1のボーレート以下であるか否かを判定し、
特定された前記第2のボーレートが前記第1のボーレート以下の場合に、前記設定可能な複数のボーレートの中から、特定された前記第2のボーレート以下のボーレートを前記第1のボーレートに設定する
処理を実行することを特徴とするボーレート自動設定方法。
The communication device that communicates data with the communication device on the opposite side
Set any baud rate from multiple baud rates that can be set,
Data for automatic setting predetermined at the first baud rate, which is the set baud rate, is transmitted to the communication device on the opposite side.
The signal transmitted from the communication device on the opposite side is received at the second baud rate, which is the baud rate set by the communication device on the opposite side.
It is determined whether or not the first baud rate and the second baud rate match, and
When the first baud rate and the second baud rate do not match, the 1-bit length of the received signal received from the communication device on the opposite side is measured.
The second baud rate is specified from the measured 1-bit length, and it is determined whether or not the second baud rate is equal to or less than the first baud rate.
When the specified second baud rate is equal to or lower than the first baud rate, the baud rate equal to or lower than the specified second baud rate is set as the first baud rate from the plurality of configurable baud rates. A baud rate automatic setting method characterized by executing processing.
通信装置と、対向側の通信装置とを有し、通信装置と対向側の通信装置との間でデータを通信する通信システムであって、
前記通信装置は、
設定可能な複数のボーレートの中から任意のボーレートを設定する第1の設定部と、
設定されたボーレートである第1のボーレートで予め定めた自動設定用のデータを前記対向側の通信装置に送信する第1の送信部と、
前記対向側の通信装置にて設定されたボーレートである第2のボーレートで前記対向側の通信装置から送信される信号を受信する第1の受信部と、
前記第1のボーレートと前記第2のボーレートとが一致するか否かを判定する第1の判定部と、
前記第1のボーレートと前記第2のボーレートとが一致していない場合に、前記対向側の通信装置から受信した受信信号の1ビット長を計測し、計測された前記1ビット長から前記第2のボーレートを特定する第1の計測部と、
計測部で特定された第2のボーレートが前記第1のボーレート以下であるか否かを判定する第2の判定部と、
前記第2の判定部にて前記第2のボーレートが前記第1のボーレート以下である場合に、前記設定可能な複数のボーレートの中から、前記第2のボーレート以下のボーレートを前記第1のボーレートに設定するように前記第1の設定部を制御する第1の制御部と
を有し、
前記対向側の通信装置は、
設定可能な複数のボーレートの内、任意のボーレートを設定する第2の設定部と、
設定されたボーレートである第2のボーレートで予め定めた自動設定用のデータ前記通信装置に送信する第2の送信部と、
前記通信装置から前記第1のボーレートで送信される信号を受信する第2の受信部と、
前記第2のボーレートと前記第1のボーレートとが一致するか否かを判定する第3の判定部と、
前記第3の判定部にて前記第2のボーレートと前記第1のボーレートとが一致していない場合に、前記通信装置から受信した受信信号の1ビット長を計測し、計測された前記1ビット長から前記第1のボーレートを特定する第2の計測部と、
前記第1のボーレートが前記第2のボーレート以下であるか否かを判定する第4の判定部と、
前記第4の判定部にて前記第1のボーレートが前記第2のボーレート以下である場合に、前記設定可能な複数のボーレートの中から、記第2のボーレート以下のボーレートを前記第2の信号に設定するように前記第2の設定部を制御する第2の制御部と
を有することを特徴とする通信システム。
A communication system having a communication device and a communication device on the opposite side, and communicating data between the communication device and the communication device on the opposite side.
The communication device is
A first setting unit that sets an arbitrary baud rate from a plurality of settable baud rates,
A first transmission unit that transmits data for automatic setting predetermined at a first baud rate, which is a set baud rate, to the communication device on the opposite side, and
A first receiving unit that receives a signal transmitted from the opposite side communication device at a second baud rate that is a baud rate set by the opposite side communication device.
A first determination unit for determining whether or not the first baud rate and the second baud rate match, and
When the first baud rate and the second baud rate do not match, the 1-bit length of the received signal received from the communication device on the opposite side is measured, and the measured 1-bit length is used as the second bit length. The first measuring unit that identifies the baud rate of
A second determination unit that determines whether or not the second baud rate specified by the measurement unit is equal to or lower than the first baud rate.
When the second baud rate is equal to or lower than the first baud rate in the second determination unit, the baud rate equal to or lower than the second baud rate is selected from the plurality of configurable baud rates as the first baud rate. It has a first control unit that controls the first setting unit so as to be set to.
The communication device on the opposite side is
A second setting unit for setting an arbitrary baud rate among a plurality of settable baud rates,
Data for automatic setting predetermined at a second baud rate, which is a set baud rate, and a second transmission unit that transmits data to the communication device.
A second receiving unit that receives a signal transmitted from the communication device at the first baud rate, and
A third determination unit that determines whether or not the second baud rate and the first baud rate match.
When the second baud rate and the first baud rate do not match in the third determination unit, the 1-bit length of the received signal received from the communication device is measured, and the measured 1 bit is measured. A second measuring unit that identifies the first baud rate from the length, and
A fourth determination unit that determines whether or not the first baud rate is equal to or lower than the second baud rate.
When the first baud rate is equal to or lower than the second baud rate in the fourth determination unit, the baud rate equal to or lower than the second baud rate is selected from the plurality of configurable baud rates as the second signal. A communication system including a second control unit that controls the second setting unit so as to be set to.
JP2019103068A 2019-05-31 2019-05-31 Communication device, automatic baud rate setting method, and communication system Active JP7251324B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019103068A JP7251324B2 (en) 2019-05-31 2019-05-31 Communication device, automatic baud rate setting method, and communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019103068A JP7251324B2 (en) 2019-05-31 2019-05-31 Communication device, automatic baud rate setting method, and communication system

Publications (2)

Publication Number Publication Date
JP2020198514A true JP2020198514A (en) 2020-12-10
JP7251324B2 JP7251324B2 (en) 2023-04-04

Family

ID=73648462

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019103068A Active JP7251324B2 (en) 2019-05-31 2019-05-31 Communication device, automatic baud rate setting method, and communication system

Country Status (1)

Country Link
JP (1) JP7251324B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112968752A (en) * 2021-01-28 2021-06-15 歌尔科技有限公司 Baud rate switching method and device for UART communication and initiator terminal
CN113556210A (en) * 2021-07-16 2021-10-26 青岛信芯微电子科技股份有限公司 Upper computer and method for establishing communication connection
CN114584276A (en) * 2022-05-05 2022-06-03 合肥芯荣微电子有限公司 UART baud rate self-adaption method and system and SoC chip

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0345052A (en) * 1989-07-13 1991-02-26 Tokyo Electric Co Ltd Communication terminal equipment
JPH05236048A (en) * 1992-01-08 1993-09-10 Nec Corp Start-stop system data transmitter-receiver
JPH08125712A (en) * 1994-10-20 1996-05-17 Casio Comput Co Ltd Discrimination method and discrimination device for communication parameter
JP2004166032A (en) * 2002-11-14 2004-06-10 Matsushita Electric Ind Co Ltd Data communication terminal
JP2009100291A (en) * 2007-10-17 2009-05-07 Kyocera Mita Corp Facsimile equipment
JP2011091742A (en) * 2009-10-26 2011-05-06 Kyocera Corp Communication device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0345052A (en) * 1989-07-13 1991-02-26 Tokyo Electric Co Ltd Communication terminal equipment
JPH05236048A (en) * 1992-01-08 1993-09-10 Nec Corp Start-stop system data transmitter-receiver
JPH08125712A (en) * 1994-10-20 1996-05-17 Casio Comput Co Ltd Discrimination method and discrimination device for communication parameter
JP2004166032A (en) * 2002-11-14 2004-06-10 Matsushita Electric Ind Co Ltd Data communication terminal
JP2009100291A (en) * 2007-10-17 2009-05-07 Kyocera Mita Corp Facsimile equipment
JP2011091742A (en) * 2009-10-26 2011-05-06 Kyocera Corp Communication device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112968752A (en) * 2021-01-28 2021-06-15 歌尔科技有限公司 Baud rate switching method and device for UART communication and initiator terminal
CN113556210A (en) * 2021-07-16 2021-10-26 青岛信芯微电子科技股份有限公司 Upper computer and method for establishing communication connection
CN113556210B (en) * 2021-07-16 2024-02-27 青岛信芯微电子科技股份有限公司 Upper computer and method for establishing communication connection
CN114584276A (en) * 2022-05-05 2022-06-03 合肥芯荣微电子有限公司 UART baud rate self-adaption method and system and SoC chip

Also Published As

Publication number Publication date
JP7251324B2 (en) 2023-04-04

Similar Documents

Publication Publication Date Title
JP7251324B2 (en) Communication device, automatic baud rate setting method, and communication system
JP2015528271A5 (en)
US7836199B2 (en) System and method for multilane link rate negotiation
CN105830472A (en) Radio communications
KR20050076924A (en) I2c cummunication system capable of reciprocal communication and method thereof
JP2013030932A (en) Communication system and sub-master node used for the communication system
JP6422332B2 (en) Electronic device, accessory device, control method thereof, and control program
US6922790B2 (en) Three wire communication protocol
US9935731B2 (en) Communication apparatus, lens apparatus and image pickup apparatus including the same
JP2017063309A5 (en)
JP7140719B2 (en) Measuring device and measuring method
US20060098722A1 (en) Repeating installation, communication speed adjusting method, program, and recording medium
JP2011091742A (en) Communication device
CN101483645B (en) Communications device, communications method, and storage medium
JP2019193077A (en) Radio communication device and control method thereof
JP3857687B2 (en) Device communication speed detection method
JP6183281B2 (en) Communication system and electronic control device
JP6354348B2 (en) Wireless communication apparatus, wireless communication apparatus connection method, and program
JPH0690269A (en) Data transmission method
US8422062B2 (en) Apparatus and method for facsimile transmission configuration
TW202246972A (en) Rs-485 circuit and communication system
JPH04205106A (en) Programmable controller
JP2021129238A (en) Communication device and communication program
JPS62117440A (en) Communication controlling system
JPS5957542A (en) Terminal device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220228

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221213

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230213

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230306

R151 Written notification of patent or utility model registration

Ref document number: 7251324

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151