JP6762546B1 - Serial communication method and serial communication system - Google Patents
Serial communication method and serial communication system Download PDFInfo
- Publication number
- JP6762546B1 JP6762546B1 JP2019129916A JP2019129916A JP6762546B1 JP 6762546 B1 JP6762546 B1 JP 6762546B1 JP 2019129916 A JP2019129916 A JP 2019129916A JP 2019129916 A JP2019129916 A JP 2019129916A JP 6762546 B1 JP6762546 B1 JP 6762546B1
- Authority
- JP
- Japan
- Prior art keywords
- serial communication
- controller
- communication
- devices
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 230000006854 communication Effects 0.000 title claims abstract description 239
- 238000004891 communication Methods 0.000 title claims abstract description 235
- 238000000034 method Methods 0.000 title claims description 59
- 238000010586 diagram Methods 0.000 abstract description 8
- 230000001360 synchronised effect Effects 0.000 description 17
- 238000012545 processing Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 7
- 238000012546 transfer Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000012790 confirmation Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 230000008054 signal transmission Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Systems (AREA)
- Small-Scale Networks (AREA)
- Communication Control (AREA)
Abstract
【課題】シングルマスタ/シングルスレーブ接続システムとシングルマスタ/マルチスレーブ接続システムで共通して通信可能とし、マルチスレーブ接続時に比べてシングルスレーブ接続時の通信データ長を削減する。【解決手段】シリアル通信機能を有するコントローラ(10)と、シリアル通信機能を有する1以上のデバイス(20)との間で通信フォーマットに従ってシリアル通信を行う際、コントローラは、デバイスが単一であるか複数であるかを示す情報を通信フォーマット中のコードに割り当て、デバイスが単一である場合、デバイスが単一であることを情報により示し、単一のデバイスとの間でシリアル通信を行い、デバイスが複数である場合、デバイスが複数であることを情報により示し、デバイスを識別するデバイスIDを通信フォーマット中に含め、デバイスIDにより特定されるデバイスとの間でシリアル通信を行う。【選択図】図1PROBLEM TO BE SOLVED: To enable communication in common between a single master / single slave connection system and a single master / multi-slave connection system, and reduce the communication data length at the time of single-slave connection as compared with the case of multi-slave connection. When serial communication is performed between a controller (10) having a serial communication function and one or more devices (20) having a serial communication function according to a communication format, is the controller a single device? Assign information indicating whether there are multiple devices to the code in the communication format, and when there is a single device, the information indicates that there is a single device, serial communication is performed with a single device, and the device When there are a plurality of devices, it is indicated by information that there are a plurality of devices, a device ID that identifies the device is included in the communication format, and serial communication is performed with the device specified by the device ID. [Selection diagram] Fig. 1
Description
この発明は、シリアル通信方法及びシリアル通信システムに関する。 The present invention relates to serial communication methods and serial communication systems.
各種デバイス間においてシリアル通信によりデータを授受することが一般的に行われている。このシリアル通信において、単一のコントローラに対して複数のデバイスが接続されたシングルマスタ/マルチスレーブ接続のシステムにおけるシングルマスタ/マルチスレーブ通信と、単一のコントローラに対して単一のデバイスが接続されたシングルマスタ/シングルスレーブ接続のシステムにおけるシングルマスタ/シングルスレーブ通信とが知られている。このような構成のシリアル通信システムは、特許文献1及び非特許文献1に記載されている。
It is common practice to exchange data between various devices by serial communication. In this serial communication, single master / multi-slave communication in a single master / multi-slave connection system in which multiple devices are connected to a single controller and a single device are connected to a single controller. Single master / single slave communication in a single master / single slave connection system is known. Serial communication systems having such a configuration are described in
以上の特許文献1には、単一のコントローラにバスを通じて複数のデバイスが接続されたシングルマスタ/マルチスレーブ接続システムにおける、シングルマスタ/マルチスレーブ通信の技術が開示されている。このシングルマスタ/マルチスレーブ通信では、複数のデバイスそれぞれを識別するためのデバイスID(identification)を定めておき、送受信するデータフレーム中にデバイスIDを含めるようにしている。
一方、以上の非特許文献1には、単一のコントローラにバスに単一のデバイスが接続されたシングルマスタ/シングルスレーブ接続システムにおける、シングルマスタ/シングルスレーブ通信の技術が開示されている。このシングルマスタ/シングルスレーブ通信では、コントローラに対して単一のデバイスが接続されているため、デバイスIDは不要である。従って、送受信するデータフレーム中にデバイスIDは含まれないため通信データ長が短くなり、簡潔な通信が可能になる。
On the other hand, Non-Patent
ところで、特許文献1に開示されたシングルマスタ/マルチスレーブ通信は、シングルマスタ/シングルスレーブ接続システムにも適用することが可能である。この場合、単一のデバイスに対してデバイスIDを定め、送受信するデータフレーム中にデバイスIDを含めるようにする。この結果、送受信するデータフレーム中にデバイスIDが含まれることにより通信データ長が増大し、非特許文献1に開示されたシングルマスタ/シングルスレーブ接続用の通信システムを使用する場合に比較して、通信周期が伸びることになる。ここで、通信周期が伸びることは、制御対象の制御周期が伸びることであり、高精度な制御が困難になることを意味する。
By the way, the single master / multi-slave communication disclosed in
一方、特許文献2に開示されたシングルマスタ/シングルスレーブ通信は、データフレーム中にデバイスIDを含まないため、通信データ長を短くすることができるものの、複数のデバイスを特定できないため、シングルマスタ/マルチスレーブ接続システムには適用することができない。
On the other hand, in the single master / single slave communication disclosed in
本発明は、シングルマスタ/シングルスレーブ接続システムとシングルマスタ/マルチスレーブ接続システムで共通して通信可能とし、マルチスレーブ接続時の通信データ長に比べてシングルスレーブ接続時の通信データ長を削減することが可能なシリアル通信方法及びシリアル通信システムを提供することを目的とする。 The present invention enables communication in common between a single master / single slave connection system and a single master / multi-slave connection system, and reduces the communication data length at the time of single-slave connection as compared with the communication data length at the time of multi-slave connection. It is an object of the present invention to provide a serial communication method and a serial communication system capable of the above.
この発明に係るシリアル通信方法は、シリアル通信機能を有するコントローラと、シリアル通信機能を有する1以上のデバイスとの間で、通信フォーマットに従ってシリアル通信を行うシリアル通信方法であって、コントローラは、デバイスが単一であるか複数であるかを示す情報を、通信フォーマット中に存在するコードに割り当て、デバイスが単一である場合、デバイスが単一であることを情報により示し、単一のデバイスとの間でシリアル通信を行い、デバイスが複数である場合、デバイスが複数であることを情報により示し、デバイスを識別するデバイスIDを通信フォーマット中に含め、複数のデバイスの中でデバイスIDにより特定されるデバイスとの間でシリアル通信を行う。 The serial communication method according to the present invention is a serial communication method in which a controller having a serial communication function and one or more devices having a serial communication function perform serial communication according to a communication format. Information indicating whether it is single or multiple is assigned to the code existing in the communication format, and when the device is single, the information indicates that the device is single, and the information indicates that the device is single. When serial communication is performed between the devices and there are multiple devices, the information indicates that there are multiple devices, and the device ID that identifies the device is included in the communication format and specified by the device ID among the multiple devices. Perform serial communication with the device.
この発明に係るシリアル通信方法によれば、シングルマスタ/シングルスレーブ接続システムとシングルマスタ/マルチスレーブ接続システムで共通して通信可能とし、マルチスレーブ接続時の通信データ長に比べてシングルスレーブ接続時の通信データ長を削減することが可能になる。 According to the serial communication method according to the present invention, the single master / single slave connection system and the single master / multi-slave connection system can communicate in common, and the communication data length at the time of single-slave connection is compared with that at the time of multi-slave connection. It is possible to reduce the communication data length.
以下、本発明のシリアル通信システムの実施の形態につき、図面を用いて説明する。なお、各図において、同一部分には同一符号を付している。 Hereinafter, embodiments of the serial communication system of the present invention will be described with reference to the drawings. In each figure, the same parts are designated by the same reference numerals.
実施の形態1.
はじめに、本発明の実施の形態1におけるシリアル通信システム1の基本的な構成について、図1と図2を参照して説明する。図1は、本発明の実施の形態1におけるシリアル通信システム1の第1構成例を示す構成図である。図2は、本発明の実施の形態1におけるシリアル通信システム1の第2構成例を示す構成図である。
First, the basic configuration of the
[シリアル通信システム1の構成]
図1において、シリアル通信方法を実行するシリアル通信システム1は、コントローラ10と、デバイス20と、バス通信ライン30とを有する。コントローラ10はマスタ、デバイス20はスレーブとして、バス通信ライン30を通して接続されている。
[Configuration of serial communication system 1]
In FIG. 1, the
ここで、単一のコントローラ10に対して、バス通信ライン30を通して単一のデバイス20が接続されており、シングルマスタ/シングルスレーブ接続のシリアル通信システム1を構成している。そして、シングルマスタ/シングルスレーブ接続のシリアル通信システム1において、シングルマスタ/シングルスレーブ通信が行われる。
Here, a
コントローラ10は、シリアル通信機能を備えており、シリアル通信によりデバイス20からデータを読み出す制御部である。デバイス20は、シリアル通信機能を備えたセンシングデバイスであり、例えば、制御対象から検出されたデータをシリアル通信により出力するエンコーダまたはセンサが該当する。バス通信ライン30は、電源Vccと、グランドGNDと、一対の差動伝送信号SD+/SD−とによって構成されている。
The
電源Vccは、コントローラ10からデバイス20に供給される。差動伝送信号SD+/SD−は、双方向に伝送されるものであり、コントローラ10からデバイス20に向けて送信される場合と、デバイス20からコントローラ10に向けて送信される場合とがある。
The power supply Vcc is supplied from the
図2において、シリアル通信システム1は、コントローラ10と、デバイス20と、バス通信ライン30とを有する。コントローラ10はマスタ、デバイス20はスレーブとして、バス通信ライン30を通して接続されている。スレーブとしてのデバイス20は、複数個のデバイス20_1、デバイス20_2、…、デバイス20_nを備えて構成される。
In FIG. 2, the
ここで、単一のコントローラ10に対して、バス通信ライン30を通して複数個のデバイス20、すなわち、デバイス20_1、デバイス20_2、…、デバイス20_nが、並列に接続されている。これにより、シングルマスタ/マルチスレーブ接続のシリアル通信システム1を構成している。そして、シングルマスタ/マルチスレーブ接続のシリアル通信システム1において、シングルマスタ/マルチスレーブ通信が行われる。
Here, a plurality of
複数個のデバイス20_1、デバイス20_2、…、デバイス20_nを識別するため、後述するデバイスIDが付与されている。このデバイスIDは、1,2,3,…といった順番に従った番号でもよいし、製品の製造番号の全部または一部であってもよい。 In order to identify a plurality of devices 20_1, devices 20_2, ..., And devices 20_n, device IDs described later are assigned. The device ID may be a number according to the order of 1, 2, 3, ..., Or may be all or a part of the serial number of the product.
コントローラ10は、このデバイスIDによって、複数個のデバイス20_1、デバイス20_2、…、デバイス20_nを識別し、特定することができる。複数個のデバイス20_1、デバイス20_2、…、デバイス20_n側も、このデバイスIDによって、コントローラ10からのリクエストが自分宛か否かを判別することができる。
The
[通信フォーマット中の各フィールドの説明]
次に、本発明の実施の形態1のシリアル通信システム1において実行されるシリアル通信方法で使用される通信フォーマットについて、図3と図4を参照して説明する。図3は、本発明の実施の形態1におけるシリアル通信システムのデータ転送時の通信フォーマットを示すタイミングチャートである。図4は、本発明の実施の形態1におけるシリアル通信システムで使用されるデータの通信フォーマットの内容の一例を示す説明図である。
[Description of each field in communication format]
Next, the communication format used in the serial communication method executed in the
まず、シングルマスタ/シングルスレーブ接続のシリアル通信システム1における通信の様子を説明する。図3の(a)は、シングルマスタ/シングルスレーブ接続のシリアル通信システム1における、コントローラ10からデバイス20に対するリクエストの送信を示している。
First, the state of communication in the
ここで、コントローラ10は、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が存在するか否かを監視しており、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFをリクエストとしてデバイスに対して送信する。なお、1データフレームとは、デバイス20からコントローラ10に向けて送信される一連のデータの単位である。
Here, the
デバイス20は、1データフレーム分以上のアイドル状態が継続した後に、リクエストとしてコントロールフィールドCFが送られてくることで、通信開始であると判断する。これにより、デバイス20は、他の通信に対して誤って通信開始と判断することを回避している。
The
デバイス20は、コントローラ10からコントロールフィールドCFがリクエストとして送られてくると、データを通信フォーマットに従ってコントローラ10に対してシリアル通信により送信する。デバイス20がエンコーダまたはセンサである場合、制御対象から検出されたデータをコントローラ10に対して送信する。
When the control field CF is sent as a request from the
図3の(b)は、シングルマスタ/シングルスレーブ接続のシリアル通信システム1における、デバイス20がコントローラ10に向けて送信するデータの通信フォーマットを示している。
FIG. 3B shows a communication format of data transmitted by the
デバイス20からコントローラ10へのデータは、図3の(b)に示されるように、通信フォーマットに従い、コントロールフィールドCF、ステータスフィールドSF、データフィールドDF0〜DFn、及び検査フィールドCRCが含まれている。
The data from the
図4の(a)は、図3の(a)及び(b)のタイミングチャートに示されるデータの各フィールドの内容を示している。コントロールフィールドCFは、コマンド情報である。ステータスフィールドSFは、デバイスの状態識別情報である。データフィールドDF0〜DFnは、データIDに割り振られた情報である。検査フィールドCRCは、CRCフィールド以外の全てのフィールドのスタートビットとデリミッタとを除く全てのビットに対するCRC(Cyclic Redundancy Check:巡回冗長検査)による誤り検査情報である。 FIG. 4A shows the contents of each field of data shown in the timing charts of FIGS. 3A and 3B. The control field CF is command information. The status field SF is device status identification information. The data fields DF0 to DFn are information assigned to the data ID. The check field CRC is error check information by CRC (Cyclic Redundancy Check) for all bits except the start bit and the delimiter of all fields other than the CRC field.
次に、シングルマスタ/マルチスレーブ接続のシリアル通信システム1における、通信の様子を説明する。図3の(c)は、シングルマスタ/マルチスレーブ接続のシリアル通信システム1における、コントローラ10からデバイス20に対するリクエストの送信を示している。
Next, the state of communication in the
コントローラ10は、上述した説明と同様に、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFとデバイスIDフィールドIDFを、複数個のデバイス20_1〜デバイス20_nのうちのいずれかのデバイス20_iへのリクエストとして送信する。
Similar to the above description, the
複数個のデバイス20_1〜デバイス20_nのうち、コントローラ10から呼び出されたデバイス20_iは、1データフレーム分以上のアイドル状態が継続した後に、リクエストとしてコントロールフィールドCFが送られてくることで、通信開始であると判断する。これにより、デバイス20_iは、自分以外の他のデバイス20_yへの通信に対して誤って通信開始と判断することを回避している。
Of the plurality of devices 20_1 to 20_n, the device 20_i called from the
デバイス20_iは、コントローラ10からコントロールフィールドCFがリクエストとして送られてくると、後述するようにコントロールフィールドCFの内容とデバイスIDフィールドIDFの内容とに応じて、自分宛のリクエストであるかを判別する。
When the control field CF is sent as a request from the
デバイス20_iは、コントローラ10からのリクエストが自分宛であると判別した場合、データを通信フォーマットに従ってコントローラ10に対してシリアル通信により送信する。デバイス20_iがエンコーダまたはセンサである場合、制御対象から検出されたデータをコントローラ10に対して送信する。
When the device 20_i determines that the request from the
図3の(d)は、シングルマスタ/マルチスレーブ接続のシリアル通信システム1における、デバイス20がコントローラ10に向けて送信するデータの通信フォーマットを示している。
FIG. 3D shows a communication format of data transmitted by the
デバイス20からコントローラ10へのデータは、図3の(d)に示されるように、通信フォーマットに従い、コントロールフィールドCF、デバイスIDフィールドIDF、ステータスフィールドSF、データフィールドDF0〜DFn、及び検査フィールドCRCが含まれている。
The data from the
図4の(b)は、図3の(c)及び(d)のタイミングチャートに示されるデータの各フィールドの内容を示している。コントロールフィールドCFは、コマンド情報である。デバイスIDフィールドIDFは、各デバイスを識別するデバイスID(identification)の情報である。ステータスフィールドSFは、デバイスの状態識別情報である。データフィールドDF0〜DFnは、データIDに割り振られた情報である。検査フィールドCRCは、CRCフィールド以外の全てのフィールドのスタートビットとデリミッタを除く全てのビットに対するCRC(Cyclic Redundancy Check:巡回冗長検査)による誤り検査情報である。 FIG. 4B shows the contents of each field of data shown in the timing charts of FIGS. 3C and 3D. The control field CF is command information. The device ID field IDF is information on a device ID (identification) that identifies each device. The status field SF is device status identification information. The data fields DF0 to DFn are information assigned to the data ID. The check field CRC is error check information by CRC (Cyclic Redundancy Check) for all bits except the start bit and the delimiter of all fields other than the CRC field.
[通信フォーマット中のコントロールフィールドの説明]
次に、本発明の実施の形態1のシリアル通信システム1において実行されるシリアル通信で使用される通信フォーマット中のコントロールフィールドCFについて、図5と図6を参照して説明する。
[Description of control field during communication format]
Next, the control field CF in the communication format used in the serial communication executed in the
図5は、本発明の実施の形態1におけるシリアル通信システムで使用されるデータの通信フォーマット中のコントロールフィールドのフォーマットを示す説明図である。コントローラ10とデバイス20との間で送受信されるコントロールフィールドCFは、スタートビット、SYNC(Synchronous)コード、データIDコード、データIDパリティ、及びデリミッタが含まれている。
FIG. 5 is an explanatory diagram showing a format of a control field in a data communication format used in the serial communication system according to the first embodiment of the present invention. The control field CF transmitted and received between the
図6は、本発明の実施の形態1におけるシリアル通信システムで使用されるデータの通信フォーマット中のコントロールフィールドCFの各ビットの内容を示す説明図である。 FIG. 6 is an explanatory diagram showing the contents of each bit of the control field CF in the data communication format used in the serial communication system according to the first embodiment of the present invention.
スタートビットは、開始位置を示すビットであり、例えば、“0”に固定されている。SYNCコードは、同期に用いられる予め定められたコードであり、“0”と“1”を所定回数繰り返す。この実施の形態1において、SYNCコードは、シングルマスタ/シングルスレーブ通信を行う場合は第1のSYNCコード“010”、シングルマスタ/マルチスレーブ通信を行う場合は第2のSYNCコード“101”が割り当てられる。データIDコードは、通信内容を選択するため、通信データや動作命令を割り当てられたコードである。データIDパリティは、データIDコードに対するパリティチェックのビットである。デリミッタは、終了位置を示すビットであり、例えば、“1”に固定されている。 The start bit is a bit indicating the start position, and is fixed to, for example, “0”. The SYNC code is a predetermined code used for synchronization, and repeats "0" and "1" a predetermined number of times. In the first embodiment, the SYNC code is assigned the first SYNC code "010" when performing single master / single slave communication, and the second SYNC code "101" when performing single master / multi-slave communication. Be done. The data ID code is a code to which communication data and operation commands are assigned in order to select the communication content. The data ID parity is a parity check bit for the data ID code. The delimiter is a bit indicating the end position, and is fixed to, for example, "1".
以上のコントロールフィールドCF中SYNCコードによって、シリアル通信システム1において、シングルマスタ/シングルスレーブ通信とシングルマスタ/マルチスレーブ通信のどちらを行うかが決定される。また、SYNCコードは、“010”と“101”のいずれであっても、本来の同期の用途にも使用される。
The SYNC code in the control field CF determines whether the
シングルマスタ/シングルスレーブ通信においては、デバイス20がコントロールフィールドCFを受信した後、デバイス20においてデータIDコードに応じたデータの返信や動作が実行される。
In the single master / single slave communication, after the
シングルマスタ/マルチスレーブ通信においては、コントロールフィールドCFに続いてデバイスIDフィールドIDFがコントローラ10から送信された後に、該当するデバイスIDを有するデバイス20_iにてデータIDコードに応じたデータの返信や動作が実行される。
In single master / multi-slave communication, after the device ID field IDF is transmitted from the
[シリアル通信システム1のコントローラ10側の処理手順]
次に、本発明の実施の形態1のシリアル通信システム1において実行されるシリアル通信方法のコントローラ10側の処理手順について、図7を参照しながら説明する。図7は、本発明の実施の形態1におけるシリアル通信システムのデータ転送時のコントローラ10側の処理手順を示すフローチャートである。
[Processing procedure on the
Next, the processing procedure on the
ステップS101において、シリアル通信システム1の電源がオンされると、コントローラ10はシリアル通信システム1内の各部を初期化する。その後、処理がステップS102へと進む。
In step S101, when the power of the
ステップS102において、コントローラ10は、バス通信ライン30に電源Vccを供給する。その後、処理がステップS103へと進む。
In step S102, the
ステップS103において、コントローラ10は、バス通信ライン30に接続されているデバイス20の設定を確認する。ここで、デバイス20の設定とは、バス通信ライン30に単一のデバイス20が接続されているか、または、バス通信ライン30に複数個のデバイス20_1〜デバイス20_nが接続されているか、を意味する。この設定は、ユーザによる操作部からの設定でもよいし、コントローラ10が自動的に取得した設定でもよい。
In step S103, the
ステップS103の設定確認に基づいて、ステップS104において、バス通信ライン30に単一のデバイス20が接続されていると判定されれば、処理がステップS105へと進む。
If it is determined in step S104 that a
ステップS105において、コントローラ10は、コントロールフィールドCF中のSYNCコードを、シングルマスタ/シングルスレーブ通信を行う場合の“010”に設定する。その後、処理がステップS106へと進む。
In step S105, the
ステップS106において、コントローラ10は、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFをリクエストとして、バス通信ライン30に送信する。これにより、コントローラ10は、単一のデバイス20との間でシングルマスタ/シングルスレーブ通信によりシリアル通信を行う。その後、処理がステップS107へと進む。
In step S106, the
ステップS107において、コントローラ10は、外部からのパワーオフの指示の有無を監視しており、外部からのパワーオフの指示が有るまで、ステップS106のシリアル通信の処理と、ステップS107の外部指示監視の処理とを繰り返している。
In step S107, the
ステップS107において、コントローラ10は、外部からのパワーオフの指示を検出すると、ステップS106のシリアル通信の処理を終了し、バス通信ライン30への電源Vcc供給を停止し、シリアル通信システム1としての処理を終了する。
When the
一方、ステップS103の設定確認に基づいて、ステップS104において、バス通信ライン30に複数個のデバイス20_1〜デバイス20_nが接続されていると判定されれば、処理がステップS108へと進む。 On the other hand, if it is determined in step S104 that a plurality of devices 20_1 to 20_n are connected to the bus communication line 30 based on the setting confirmation in step S103, the process proceeds to step S108.
ステップS108において、コントローラ10は、コントロールフィールドCF中のSYNCコードを、シングルマスタ/マルチスレーブ通信を行う場合の“101”に設定する。その後、処理がステップS109へと進む。
In step S108, the
ステップS109において、コントローラ10は、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFに続いて、デバイスIDフィールドIDFをリクエストとして、バス通信ライン30に送信する。デバイスIDフィールドIDFには、複数個のデバイス20_1〜デバイス20_nのうちの、通信相手となるいずれかのデバイス20_iのデバイスIDを含める。
In step S109, the
これにより、コントローラ10は、複数個のデバイス20_1〜デバイス20_n中のいずれかのデバイス20_iとの間で、シングルマスタ/マルチスレーブ通信によりシリアル通信を行う。その後、処理がステップS110へと進む。
As a result, the
ステップS110において、コントローラ10は、外部からのパワーオフの指示の有無を監視しており、外部からのパワーオフの指示が有るまで、ステップS109のシリアル通信の処理と、ステップS110の外部指示監視の処理とを繰り返している。
In step S110, the
ステップS110において、コントローラ10は、外部からのパワーオフの指示を検出すると、ステップS109のシリアル通信の処理を終了し、バス通信ライン30への電源Vcc供給を停止し、シリアル通信システム1としての処理を終了する。
When the
[シリアル通信システム1のデバイス20側の処理手順]
次に、本発明の実施の形態1のシリアル通信システム1において実行されるシリアル通信方法のデバイス20側の処理手順について、図8を参照しながら説明する。図8は、本発明の実施の形態1におけるシリアル通信システムのデータ転送時のデバイス20側の処理手順を示すフローチャートである。
[Processing procedure on the
Next, the processing procedure on the
ステップS201において、バス通信ライン30に接続された単一のデバイス20、またはバス通信ライン30に接続された複数個のデバイス20_1〜デバイス20_nは、バス通信ライン30に供給された電源Vccを受けて動作を開始する。その後、処理がステップS202へと進む。
In step S201, the
ステップS202において、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、自らを初期化する。その後、処理がステップS202へと進む。
In step S202, the
ステップS203において、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、コントローラ10からバス通信ライン30を通して送信されるコントロールフィールドCFの受信を待機している。
In step S203, the
ここで、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、1データフレーム分以上のアイドル状態が継続した後のコントロールフィールドCFを通信開始であると判断する。デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、コントロールフィールドCFを受信した後、処理がステップS204へと進む。
Here, each of the
ステップS204において、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、受信したコントロールフィールドCFに含まれるSYNCコードの内容を調べる。すなわち、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、SYNCコードが、シングルマスタ/シングルスレーブ通信用の“010”であるか、シングルマスタ/マルチスレーブ通信用の“101”であるかを識別する。
In step S204, the
ステップS204の識別に基づいて、SYNCコードが、シングルマスタ/シングルスレーブ通信用の“010”であると識別されれば、処理がステップS205へと進む。 If the SYNC code is identified as "010" for single master / single slave communication based on the identification in step S204, the process proceeds to step S205.
ステップS205において、デバイス20は、コントロールフィールドCFに含まれる動作命令に従い、図3の(b)のように通信フォーマットに従ったデータをシリアル通信によりコントローラ10に対して送信する。その後、処理がステップS209へと進む。
In step S205, the
ステップS209において、デバイス20は、バス通信ライン30における電源Vccの存在有無を監視しており、電源Vccが存在していればステップS203のコントロールフィールドCFの受信待機に戻り、電源Vccが存在しなくなればデバイス20の動作を終了する。
In step S209, the
ステップS204において、コントロールフィールドCFに含まれるSYNCコードの識別に基づいて、SYNCコードが、シングルマスタ/マルチスレーブ通信用の“101”であると識別されれば、処理がステップS206へと進む。 In step S204, if the SYNC code is identified as "101" for single master / multi-slave communication based on the identification of the SYNC code included in the control field CF, the process proceeds to step S206.
ステップS206において、複数個のデバイス20_1〜デバイス20_nそれぞれは、コントローラ10からコントロールフィールドCFに続いて送信されたデバイスIDフィールドIDFに含まれるデバイスIDが、自分のデバイスIDと一致するか比較する。その後、処理がステップS207へと進む。
In step S206, each of the plurality of devices 20_1 to 20_n compares whether the device ID included in the device ID field IDF transmitted from the
ステップS207において、複数個のデバイス20_1〜デバイス20_nそれぞれのうち、デバイスIDフィールドIDFに含まれるデバイスIDが、自分のデバイスIDと一致しないものは、コントロールフィールドCFに対する動作をせずに、ステップS209の電源Vcc存在判断に進む。 In step S207, among the plurality of devices 20_1 to 20_n, those whose device ID included in the device ID field IDF does not match their own device ID do not operate on the control field CF, and in step S209, Proceed to power supply Vcc existence judgment.
ステップS207において、複数個のデバイス20_1〜デバイス20_nそれぞれのうち、デバイスIDフィールドIDFに含まれるデバイスIDが、自分のデバイスIDと一致したデバイス20_iは、処理がステップS208へと進む。 In step S207, among the plurality of devices 20_1 to 20_n, the device 20_i whose device ID included in the device ID field IDF matches its own device ID proceeds to the process of step S208.
ステップS208において、デバイスIDフィールドIDFによりコントローラ10から呼び出されたデバイス20_iは、コントロールフィールドCFに含まれる動作命令に従い、図3の(d)のように通信フォーマットに従ったデータをシリアル通信によりコントローラ10に対して送信する。なお、デバイス20_iは、図3の(d)に示すように、コントロールフィールドCFとステータスフィールドSFとの間に、デバイスIDフィールドIDFに自らのデバイスIDを含めるようにする。その後、処理がステップS209へと進む。
In step S208, the device 20_i called from the
ステップS209において、複数個のデバイス20_1〜デバイス20_nそれぞれは、バス通信ライン30における電源Vccの存在有無を監視しており、電源Vccが存在していればステップS203のコントロールフィールドCFの受信待機に戻り、電源Vccが存在しなくなればデバイス20の動作を終了する。
In step S209, each of the plurality of devices 20_1 to 20_n monitors the presence or absence of the power supply Vcc on the bus communication line 30, and if the power supply Vcc exists, returns to the reception standby of the control field CF in step S203. When the power supply Vcc disappears, the operation of the
以上のように、実施の形態1のシリアル通信システム1において実行されるシリアル通信方法によれば、シングルマスタ/シングルスレーブ接続システムとシングルマスタ/マルチスレーブ接続システムで共通して通信可能とし、マルチスレーブ接続時の通信データ長に比べてシングルスレーブ接続時の通信データ長を削減することが可能になる。
As described above, according to the serial communication method executed in the
ここで、シングルスレーブ接続時は、マルチスレーブ接続時と比較して、図3の(c)及び(d)に示すように、デバイスIDフィールドIDF分の通信データ長を削減することが可能になる。従って、シングルマスタ/シングルスレーブ接続用の通信システムでは、制御対象の制御周期が伸びることを防止でき、高次元のモーションコントロールの実現に貢献でき、高精度な制御が可能になる。 Here, in the case of single-slave connection, as shown in FIGS. 3C and 3D, it is possible to reduce the communication data length for the device ID field IDF as compared with the case of multi-slave connection. .. Therefore, in the communication system for single master / single slave connection, it is possible to prevent the control cycle of the controlled object from being extended, contribute to the realization of high-dimensional motion control, and enable highly accurate control.
また、新たな信号やコードを付加せず、元々存在していたSYNCコードを参照するだけでよいため、シングルマスタ/シングルスレーブ接続、シングルマスタ/マルチスレーブ接続の切り替えが容易となり、システム更新時の変更点を最小限にすることができる。従って、デバイス20としてセンシングデバイスを使用した各種制御機器の拡張柔軟性を向上させることができる。
In addition, since it is only necessary to refer to the originally existing SYNC code without adding a new signal or code, it is easy to switch between single master / single slave connection and single master / multi-slave connection, and when updating the system. Changes can be minimized. Therefore, it is possible to improve the expansion flexibility of various control devices that use the sensing device as the
[その他の実施の形態]
本発明の実施の形態1におけるシリアル通信システム1の他の形態、シリアル通信システム1において実行されるシリアル通信方法の他の手順について、以下に説明する。
[Other embodiments]
Another embodiment of the
以上の実施の形態1の説明では、バス通信ライン30としてシリアル伝送のバス接続の具体例を示しているが、必ずしもこの内容に限定する必要はない。例えば、複数の信号線からなるパラレルラインのバスであっても、以上の実施の形態1のシリアル通信方法を適用することが可能である。 In the above description of the first embodiment, a specific example of a bus connection for serial transmission is shown as the bus communication line 30, but the content is not necessarily limited to this. For example, the serial communication method of the first embodiment can be applied even to a parallel line bus composed of a plurality of signal lines.
以上の実施の形態1のシリアル通信システム1の説明では、バス通信ライン30において、信号伝送するための2本の対等な信号線を用いたRS485規格の一対のSD+とSD−の差動伝送信号による通信を想定した例として示しているが、本発明はこの内容に限定されるものではない。例えば、本発明の実施の形態1のシリアル通信システム1をRS422規格やRS232規格による通信に適用してもよい。また、本発明の実施の形態1のシリアル通信システム1を差動伝送信号によらない通信に適用してもよい。
In the above description of the
以上の実施の形態1のシリアル通信方法の説明では、通信フォーマットおよび内部のフィールド構成、ビット構成などの具体例を説明したが、これらの内容に限定されるものではない。例えば、コントロールフィールドCF内のSYNCコードは、シングルマスタ/シングルスレーブとシングルマスタ/マルチスレーブが別の値であればよく、ビット長も3ビットに限らない。 In the description of the serial communication method of the first embodiment described above, specific examples such as a communication format, an internal field configuration, and a bit configuration have been described, but the description is not limited to these contents. For example, the SYNC code in the control field CF may have different values for the single master / single slave and the single master / multi-slave, and the bit length is not limited to 3 bits.
以上の実施の形態1のシリアル通信方法の説明におけるコントロールフィールドCF中のデータIDコードは、必要となる通信内容の選択肢の分だけ用意できればビット長は短くとも長くともよい。加えて、データIDパリティも検出度を上げるためにCRCに変更してもよい。 The data ID code in the control field CF in the description of the serial communication method of the first embodiment may have a short bit length or a long bit length as long as it can be prepared for the number of required communication content options. In addition, the data ID parity may also be changed to CRC to increase the detectability.
以上の実施の形態1のシリアル通信方法の説明において、デバイス20を構成するセンシングデバイスに特殊な動作命令を加える場合には、リクエスト情報として特殊コマンド用のフィールドを追加してもよい。例えば、センシングデバイスにメモリが搭載されており、そのメモリにアクセスして値を変更したい場合、リクエストにメモリアドレス用のフィールドと書込みデータ用のフィールドを追加すればよく、また、データの誤り検出もしたい場合にはCRCフィールドを追加すればよい。
In the above description of the serial communication method of the first embodiment, when a special operation command is added to the sensing device constituting the
以上の実施の形態1のシリアル通信方法の説明では、シリアル通信として調歩同期式の通信形態を想定した例を示しているが、この通信形態に限定されるものではない。 In the description of the serial communication method of the first embodiment described above, an example assuming a pace-synchronized communication mode as serial communication is shown, but the communication mode is not limited to this.
以上の実施の形態1のシリアル通信方法に関する図7のフローチャートを参照した説明において、ステップS101〜S104に記載された初期化、電源供給、及びデバイス設定確認、並びに、ステップS107とS110に記載された電源を監視しての動作は、必須の処理ではなく、いずれかの処理の省略または変更が可能である。 In the description with reference to the flowchart of FIG. 7 regarding the serial communication method of the first embodiment, the initialization, power supply, and device setting confirmation described in steps S101 to S104, and the steps S107 and S110 are described. The operation of monitoring the power supply is not an essential process, and any process can be omitted or changed.
1 シリアル通信システム、10 コントローラ、20 デバイス、20_1〜20_n 複数のデバイス、30 バス通信ライン。 1 serial communication system, 10 controllers, 20 devices, 20_1 to 20_n multiple devices, 30 bus communication lines.
Claims (6)
前記コントローラは、
前記デバイスが単一であるか複数であるかを示す情報を、前記通信フォーマット中に存在するコードに割り当て、
前記デバイスが単一である場合、前記デバイスが単一であることを前記情報により示し、単一の前記デバイスとの間で前記シリアル通信を行い、
前記デバイスが複数である場合、前記デバイスが複数であることを前記情報により示し、前記デバイスを識別するデバイスIDを前記通信フォーマット中に含め、複数の前記デバイスの中で前記デバイスIDにより特定される前記デバイスとの間で前記シリアル通信を行う
シリアル通信方法。 A serial communication method for performing serial communication between a controller having a serial communication function and one or more devices having a serial communication function according to a communication format.
The controller
Assigning information indicating whether the device is single or plural to the code existing in the communication format,
When the device is single, the information indicates that the device is single, and the serial communication is performed with the single device.
When there are a plurality of the devices, the information indicates that the number of the devices is a plurality, the device ID for identifying the device is included in the communication format, and the device ID is specified among the plurality of the devices. A serial communication method for performing the serial communication with the device.
前記コントローラと前記デバイスは、前記SYNCコードを参照し、前記コントローラと単一の前記デバイスとの間の前記シリアル通信、または前記コントローラと複数の前記デバイスとの間の前記シリアル通信のいずれかに切り替える
請求項1に記載のシリアル通信方法。 The information is assigned to the SYNC code in the control field.
The controller and the device refer to the SYNC code and switch to either the serial communication between the controller and the single device or the serial communication between the controller and the plurality of devices. The serial communication method according to claim 1.
前記マスタと前記スレーブの間で前記シリアル通信を行う
請求項1または請求項2のいずれか1項に記載のシリアル通信方法。 The controller is the master, the device is the slave,
The serial communication method according to any one of claims 1 and 2, wherein the serial communication is performed between the master and the slave.
前記センシングデバイスは、前記コントローラからのリクエストに応じ、データを前記コントローラに対して前記シリアル通信により送信する
請求項1から請求項3のいずれか1項に記載のシリアル通信方法。 The device is a sensing device.
The serial communication method according to any one of claims 1 to 3, wherein the sensing device transmits data to the controller by the serial communication in response to a request from the controller.
前記コントローラは、
前記バス通信ラインにおいて1データフレーム分以上のアイドル状態が存在するか否かを監視しており、
前記1データフレーム分以上の前記アイドル状態が存在した後に前記シリアル通信を開始する
請求項1から請求項4のいずれか1項に記載のシリアル通信方法。 The controller and the device are provided with a bus communication line for transmitting or receiving data according to a communication format.
The controller
It monitors whether or not there is an idle state for one data frame or more in the bus communication line.
The serial communication method according to any one of claims 1 to 4, wherein the serial communication is started after the idle state for one data frame or more exists.
請求項1から請求項5のいずれか1項に記載されたシリアル通信方法により、前記コントローラと1以上の前記デバイスとの間でシリアル通信を行う
シリアル通信システム。 A controller having a serial communication function and one or more devices having a serial communication function are provided.
A serial communication system that performs serial communication between the controller and one or more of the devices by the serial communication method according to any one of claims 1 to 5.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019129916A JP6762546B1 (en) | 2019-07-12 | 2019-07-12 | Serial communication method and serial communication system |
PCT/JP2020/025851 WO2021010166A1 (en) | 2019-07-12 | 2020-07-01 | Serial communication method and serial communication system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019129916A JP6762546B1 (en) | 2019-07-12 | 2019-07-12 | Serial communication method and serial communication system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP6762546B1 true JP6762546B1 (en) | 2020-09-30 |
JP2021016092A JP2021016092A (en) | 2021-02-12 |
Family
ID=72614663
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019129916A Expired - Fee Related JP6762546B1 (en) | 2019-07-12 | 2019-07-12 | Serial communication method and serial communication system |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP6762546B1 (en) |
WO (1) | WO2021010166A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114760219B (en) * | 2022-04-28 | 2023-04-14 | 深圳市晟瑞科技有限公司 | Multi-terminal communication method and device, electronic equipment and storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FI98027C (en) * | 1995-01-10 | 1997-03-25 | Nokia Telecommunications Oy | Packet radio system and terminal equipment for a packet radio system |
JP2009278603A (en) * | 2008-04-17 | 2009-11-26 | Hokuto Seigyo Kk | Serial communication apparatus |
-
2019
- 2019-07-12 JP JP2019129916A patent/JP6762546B1/en not_active Expired - Fee Related
-
2020
- 2020-07-01 WO PCT/JP2020/025851 patent/WO2021010166A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
JP2021016092A (en) | 2021-02-12 |
WO2021010166A1 (en) | 2021-01-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6680270B2 (en) | Motor control system and communication method of motor control system | |
JP3647955B2 (en) | Operation board, remote I / O communication control method | |
CN107205063A (en) | A kind of device conflict solution of Intelligent housing bus | |
JP2006244416A (en) | Electronic device system with master node and slave node | |
JP2008099482A (en) | Battery pack block, battery pack system, and address setting method for battery pack system | |
JP6762546B1 (en) | Serial communication method and serial communication system | |
US10678729B1 (en) | Interface conversion device of programmable logic controller (PLC) system and PLC system thereof | |
JP6894043B2 (en) | A method for operating a sensor device in an automated vehicle based on the DSI protocol | |
CN109154925A (en) | Communication equipment, communication means, program and communication system | |
JP6391373B2 (en) | Master / slave network device | |
JP4596448B2 (en) | Method, apparatus and bus system for causing program interruption in a subscriber of a bus system | |
JP2005277978A (en) | Method and device for automatically setting identification number | |
JP7324455B2 (en) | Serial communication method and serial communication system | |
JP5475479B2 (en) | Communications system | |
US20080126497A1 (en) | Controller Apparatus with Shared Expansion Connection and Method for the same | |
JP2005229322A (en) | Master slave synchronous communication system | |
JP2019176208A (en) | Communication system | |
JP2000227803A (en) | Method and system for controlling transmission in data link system of programmable controller | |
JP2004080132A (en) | Synchronization-detecting method for communication | |
JP2001282312A (en) | Display system for plc and data communication method between display and data | |
JP2008286461A (en) | Air conditioner | |
KR102091445B1 (en) | Data receiving apparatus and method thereof | |
JP3870890B2 (en) | Operation board, remote I / O communication control method | |
JP6888204B2 (en) | Temperature controller and communication converter | |
KR100295683B1 (en) | General call acknowledge apparatus and method for inter-integrated circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190712 |
|
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: 20200901 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200901 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6762546 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |