JP6762546B1 - Serial communication method and serial communication system - Google Patents

Serial communication method and serial communication system Download PDF

Info

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
Application number
JP2019129916A
Other languages
Japanese (ja)
Other versions
JP2021016092A (en
Inventor
裕史 丸山
裕史 丸山
勝紀 下平
勝紀 下平
宗明 久保田
宗明 久保田
田中 俊行
俊行 田中
真一 新井
真一 新井
侑宏 星野
侑宏 星野
遼平 牛草
遼平 牛草
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tamagawa Seiki Co Ltd
Original Assignee
Tamagawa Seiki Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tamagawa Seiki Co Ltd filed Critical Tamagawa Seiki Co Ltd
Priority to JP2019129916A priority Critical patent/JP6762546B1/en
Priority to PCT/JP2020/025851 priority patent/WO2021010166A1/en
Application granted granted Critical
Publication of JP6762546B1 publication Critical patent/JP6762546B1/en
Publication of JP2021016092A publication Critical patent/JP2021016092A/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus 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 Patent Document 1 and Non-Patent Document 1.

特開2004−317261号公報Japanese Unexamined Patent Publication No. 2004-317261

「ロータリーエンコーダ FA-CORDER(R)」(カタログ番号:T12-1228N58)、多摩川精機株式会社、2018年9月発行"Rotary encoder FA-CORDER (R)" (catalog number: T12-1228N58), Tamagawa Seiki Co., Ltd., published in September 2018

以上の特許文献1には、単一のコントローラにバスを通じて複数のデバイスが接続されたシングルマスタ/マルチスレーブ接続システムにおける、シングルマスタ/マルチスレーブ通信の技術が開示されている。このシングルマスタ/マルチスレーブ通信では、複数のデバイスそれぞれを識別するためのデバイスID(identification)を定めておき、送受信するデータフレーム中にデバイスIDを含めるようにしている。 Patent Document 1 described above discloses a technique for single master / multi-slave communication in a single master / multi-slave connection system in which a plurality of devices are connected to a single controller via a bus. In this single master / multi-slave communication, a device ID (identification) for identifying each of a plurality of devices is defined, and the device ID is included in the data frame to be transmitted / received.

一方、以上の非特許文献1には、単一のコントローラにバスに単一のデバイスが接続されたシングルマスタ/シングルスレーブ接続システムにおける、シングルマスタ/シングルスレーブ通信の技術が開示されている。このシングルマスタ/シングルスレーブ通信では、コントローラに対して単一のデバイスが接続されているため、デバイスIDは不要である。従って、送受信するデータフレーム中にデバイスIDは含まれないため通信データ長が短くなり、簡潔な通信が可能になる。 On the other hand, Non-Patent Document 1 described above discloses a technique for single master / single slave communication in a single master / single slave connection system in which a single device is connected to a bus on a single controller. In this single master / single slave communication, since a single device is connected to the controller, no device ID is required. Therefore, since the device ID is not included in the data frame to be transmitted / received, the communication data length is shortened, and simple communication becomes possible.

ところで、特許文献1に開示されたシングルマスタ/マルチスレーブ通信は、シングルマスタ/シングルスレーブ接続システムにも適用することが可能である。この場合、単一のデバイスに対してデバイスIDを定め、送受信するデータフレーム中にデバイスIDを含めるようにする。この結果、送受信するデータフレーム中にデバイスIDが含まれることにより通信データ長が増大し、非特許文献1に開示されたシングルマスタ/シングルスレーブ接続用の通信システムを使用する場合に比較して、通信周期が伸びることになる。ここで、通信周期が伸びることは、制御対象の制御周期が伸びることであり、高精度な制御が困難になることを意味する。 By the way, the single master / multi-slave communication disclosed in Patent Document 1 can also be applied to a single master / single slave connection system. In this case, the device ID is defined for a single device, and the device ID is included in the data frame to be transmitted / received. As a result, the communication data length is increased by including the device ID in the data frame to be transmitted and received, and compared with the case of using the communication system for single master / single slave connection disclosed in Non-Patent Document 1, The communication cycle will be extended. Here, the extension of the communication cycle means that the control cycle of the controlled object is extended, which means that highly accurate control becomes difficult.

一方、特許文献2に開示されたシングルマスタ/シングルスレーブ通信は、データフレーム中にデバイスIDを含まないため、通信データ長を短くすることができるものの、複数のデバイスを特定できないため、シングルマスタ/マルチスレーブ接続システムには適用することができない。 On the other hand, in the single master / single slave communication disclosed in Patent Document 2, since the device ID is not included in the data frame, the communication data length can be shortened, but since a plurality of devices cannot be specified, the single master / single master / It cannot be applied to multi-slave connection systems.

本発明は、シングルマスタ/シングルスレーブ接続システムとシングルマスタ/マルチスレーブ接続システムで共通して通信可能とし、マルチスレーブ接続時の通信データ長に比べてシングルスレーブ接続時の通信データ長を削減することが可能なシリアル通信方法及びシリアル通信システムを提供することを目的とする。 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.

本発明の実施の形態1におけるシリアル通信システムの第1構成例を示す構成図である。It is a block diagram which shows the 1st structural example of the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムの第2構成例を示す構成図である。It is a block diagram which shows the 2nd structural example of the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムのデータ転送時の通信フォーマットを示すタイミングチャートである。It is a timing chart which shows the communication format at the time of data transfer of the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムで使用されるデータの通信フォーマットの内容の一例を示す説明図である。It is explanatory drawing which shows an example of the content of the communication format of the data used in the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムで使用されるデータの通信フォーマット中のコントロールフィールドのフォーマットを示す説明図である。It is explanatory drawing which shows the format of the control field in the communication format of the data used in the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムで使用されるデータの通信フォーマット中のコントロールフィールドの内容を示す説明図である。It is explanatory drawing which shows the content of the control field in the communication format of the data used in the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムのデータ転送時のコントローラ側の処理手順を示すフローチャートである。It is a flowchart which shows the processing procedure on the controller side at the time of data transfer of the serial communication system in Embodiment 1 of this invention. 本発明の実施の形態1におけるシリアル通信システムのデータ転送時のデバイス側の処理手順を示すフローチャートである。It is a flowchart which shows the processing procedure on the device side at the time of data transfer of the serial communication system in Embodiment 1 of this invention.

以下、本発明のシリアル通信システムの実施の形態につき、図面を用いて説明する。なお、各図において、同一部分には同一符号を付している。 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構成例を示す構成図である。
Embodiment 1.
First, the basic configuration of the serial communication system 1 according to the first embodiment of the present invention will be described with reference to FIGS. 1 and 2. FIG. 1 is a configuration diagram showing a first configuration example of the serial communication system 1 according to the first embodiment of the present invention. FIG. 2 is a configuration diagram showing a second configuration example of the serial communication system 1 according to the first embodiment of the present invention.

[シリアル通信システム1の構成]
図1において、シリアル通信方法を実行するシリアル通信システム1は、コントローラ10と、デバイス20と、バス通信ライン30とを有する。コントローラ10はマスタ、デバイス20はスレーブとして、バス通信ライン30を通して接続されている。
[Configuration of serial communication system 1]
In FIG. 1, the serial communication system 1 that executes the serial communication method has a controller 10, a device 20, and a bus communication line 30. The controller 10 is a master and the device 20 is a slave, which are connected through the bus communication line 30.

ここで、単一のコントローラ10に対して、バス通信ライン30を通して単一のデバイス20が接続されており、シングルマスタ/シングルスレーブ接続のシリアル通信システム1を構成している。そして、シングルマスタ/シングルスレーブ接続のシリアル通信システム1において、シングルマスタ/シングルスレーブ通信が行われる。 Here, a single device 20 is connected to the single controller 10 through the bus communication line 30, and constitutes a serial communication system 1 with a single master / single slave connection. Then, in the serial communication system 1 of the single master / single slave connection, the single master / single slave communication is performed.

コントローラ10は、シリアル通信機能を備えており、シリアル通信によりデバイス20からデータを読み出す制御部である。デバイス20は、シリアル通信機能を備えたセンシングデバイスであり、例えば、制御対象から検出されたデータをシリアル通信により出力するエンコーダまたはセンサが該当する。バス通信ライン30は、電源Vccと、グランドGNDと、一対の差動伝送信号SD+/SD−とによって構成されている。 The controller 10 has a serial communication function, and is a control unit that reads data from the device 20 by serial communication. The device 20 is a sensing device having a serial communication function, and corresponds to, for example, an encoder or a sensor that outputs data detected from a controlled object by serial communication. The bus communication line 30 is composed of a power supply Vcc, a ground GND, and a pair of differential transmission signals SD + / SD−.

電源Vccは、コントローラ10からデバイス20に供給される。差動伝送信号SD+/SD−は、双方向に伝送されるものであり、コントローラ10からデバイス20に向けて送信される場合と、デバイス20からコントローラ10に向けて送信される場合とがある。 The power supply Vcc is supplied from the controller 10 to the device 20. The differential transmission signal SD + / SD− is transmitted in both directions, and may be transmitted from the controller 10 to the device 20 or may be transmitted from the device 20 to the controller 10.

図2において、シリアル通信システム1は、コントローラ10と、デバイス20と、バス通信ライン30とを有する。コントローラ10はマスタ、デバイス20はスレーブとして、バス通信ライン30を通して接続されている。スレーブとしてのデバイス20は、複数個のデバイス20_1、デバイス20_2、…、デバイス20_nを備えて構成される。 In FIG. 2, the serial communication system 1 has a controller 10, a device 20, and a bus communication line 30. The controller 10 is a master and the device 20 is a slave, which are connected through the bus communication line 30. The device 20 as a slave includes a plurality of devices 20_1, devices 20_2, ..., And devices 20_n.

ここで、単一のコントローラ10に対して、バス通信ライン30を通して複数個のデバイス20、すなわち、デバイス20_1、デバイス20_2、…、デバイス20_nが、並列に接続されている。これにより、シングルマスタ/マルチスレーブ接続のシリアル通信システム1を構成している。そして、シングルマスタ/マルチスレーブ接続のシリアル通信システム1において、シングルマスタ/マルチスレーブ通信が行われる。 Here, a plurality of devices 20, that is, devices 20_1, devices 20_2, ..., And devices 20_n are connected in parallel to a single controller 10 through a bus communication line 30. As a result, the serial communication system 1 having a single master / multi-slave connection is configured. Then, in the serial communication system 1 of the single master / multi-slave connection, the single master / multi-slave communication is performed.

複数個のデバイス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 controller 10 can identify and identify a plurality of devices 20_1, devices 20_2, ..., Devices 20_n by the device ID. The plurality of devices 20_1, devices 20_2, ..., The device 20_n side can also determine whether or not the request from the controller 10 is addressed to itself by the device ID.

[通信フォーマット中の各フィールドの説明]
次に、本発明の実施の形態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 serial communication system 1 of the first embodiment of the present invention will be described with reference to FIGS. 3 and 4. FIG. 3 is a timing chart showing a communication format at the time of data transfer of the serial communication system according to the first embodiment of the present invention. FIG. 4 is an explanatory diagram showing an example of the contents of a data communication format used in the serial communication system according to the first embodiment of the present invention.

まず、シングルマスタ/シングルスレーブ接続のシリアル通信システム1における通信の様子を説明する。図3の(a)は、シングルマスタ/シングルスレーブ接続のシリアル通信システム1における、コントローラ10からデバイス20に対するリクエストの送信を示している。 First, the state of communication in the serial communication system 1 of the single master / single slave connection will be described. FIG. 3A shows the transmission of a request from the controller 10 to the device 20 in the serial communication system 1 of the single master / single slave connection.

ここで、コントローラ10は、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が存在するか否かを監視しており、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFをリクエストとしてデバイスに対して送信する。なお、1データフレームとは、デバイス20からコントローラ10に向けて送信される一連のデータの単位である。 Here, the controller 10 monitors whether or not there is an idle state of one data frame or more from the last part of the preceding data frame, and idles one data frame or more from the last part of the preceding data frame. After the state continues, the control field CF is sent to the device as a request. A data frame is a unit of a series of data transmitted from the device 20 to the controller 10.

デバイス20は、1データフレーム分以上のアイドル状態が継続した後に、リクエストとしてコントロールフィールドCFが送られてくることで、通信開始であると判断する。これにより、デバイス20は、他の通信に対して誤って通信開始と判断することを回避している。 The device 20 determines that communication has started when the control field CF is sent as a request after the idle state for one data frame or more continues. As a result, the device 20 avoids erroneously determining that communication has started for other communications.

デバイス20は、コントローラ10からコントロールフィールドCFがリクエストとして送られてくると、データを通信フォーマットに従ってコントローラ10に対してシリアル通信により送信する。デバイス20がエンコーダまたはセンサである場合、制御対象から検出されたデータをコントローラ10に対して送信する。 When the control field CF is sent as a request from the controller 10, the device 20 transmits data to the controller 10 by serial communication according to the communication format. When the device 20 is an encoder or a sensor, the data detected from the controlled object is transmitted to the controller 10.

図3の(b)は、シングルマスタ/シングルスレーブ接続のシリアル通信システム1における、デバイス20がコントローラ10に向けて送信するデータの通信フォーマットを示している。 FIG. 3B shows a communication format of data transmitted by the device 20 toward the controller 10 in the serial communication system 1 of the single master / single slave connection.

デバイス20からコントローラ10へのデータは、図3の(b)に示されるように、通信フォーマットに従い、コントロールフィールドCF、ステータスフィールドSF、データフィールドDF0〜DFn、及び検査フィールドCRCが含まれている。 The data from the device 20 to the controller 10 includes the control field CF, the status field SF, the data fields DF0 to DFn, and the inspection field CRC according to the communication format, as shown in FIG. 3B.

図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 serial communication system 1 of the single master / multi-slave connection will be described. FIG. 3C shows the transmission of a request from the controller 10 to the device 20 in the serial communication system 1 of the single master / multi-slave connection.

コントローラ10は、上述した説明と同様に、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFとデバイスIDフィールドIDFを、複数個のデバイス20_1〜デバイス20_nのうちのいずれかのデバイス20_iへのリクエストとして送信する。 Similar to the above description, the controller 10 sets the control field CF and the device ID field IDF to the plurality of devices 20_1 to 20_n after the idle state for one data frame or more continues from the final part of the preceding data frame. It is sent as a request to one of the devices 20_i.

複数個のデバイス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 controller 10 starts communication by sending a control field CF as a request after the idle state for one data frame or more continues. Judge that there is. As a result, the device 20_i avoids erroneously determining that the communication has started for the communication to the device 20_y other than itself.

デバイス20_iは、コントローラ10からコントロールフィールドCFがリクエストとして送られてくると、後述するようにコントロールフィールドCFの内容とデバイスIDフィールドIDFの内容とに応じて、自分宛のリクエストであるかを判別する。 When the control field CF is sent as a request from the controller 10, the device 20_i determines whether the request is addressed to itself according to the contents of the control field CF and the contents of the device ID field IDF, as will be described later. ..

デバイス20_iは、コントローラ10からのリクエストが自分宛であると判別した場合、データを通信フォーマットに従ってコントローラ10に対してシリアル通信により送信する。デバイス20_iがエンコーダまたはセンサである場合、制御対象から検出されたデータをコントローラ10に対して送信する。 When the device 20_i determines that the request from the controller 10 is addressed to itself, the device 20_i transmits data to the controller 10 by serial communication according to the communication format. When the device 20_i is an encoder or a sensor, the data detected from the controlled object is transmitted to the controller 10.

図3の(d)は、シングルマスタ/マルチスレーブ接続のシリアル通信システム1における、デバイス20がコントローラ10に向けて送信するデータの通信フォーマットを示している。 FIG. 3D shows a communication format of data transmitted by the device 20 toward the controller 10 in the serial communication system 1 of the single master / multi-slave connection.

デバイス20からコントローラ10へのデータは、図3の(d)に示されるように、通信フォーマットに従い、コントロールフィールドCF、デバイスIDフィールドIDF、ステータスフィールドSF、データフィールドDF0〜DFn、及び検査フィールドCRCが含まれている。 The data from the device 20 to the controller 10 has the control field CF, the device ID field IDF, the status field SF, the data fields DF0 to DFn, and the inspection field CRC according to the communication format, as shown in FIG. 3D. include.

図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 serial communication system 1 of the first embodiment of the present invention will be described with reference to FIGS. 5 and 6.

図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 controller 10 and the device 20 includes a start bit, a SYNC (Synchronous) code, a data ID code, a data ID parity, and a delimiter.

図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 serial communication system 1 performs single master / single slave communication or single master / multi-slave communication. Further, the SYNC code, whichever is "010" or "101", is also used for the original synchronization purpose.

シングルマスタ/シングルスレーブ通信においては、デバイス20がコントロールフィールドCFを受信した後、デバイス20においてデータIDコードに応じたデータの返信や動作が実行される。 In the single master / single slave communication, after the device 20 receives the control field CF, the device 20 executes a data return or operation according to the data ID code.

シングルマスタ/マルチスレーブ通信においては、コントロールフィールドCFに続いてデバイスIDフィールドIDFがコントローラ10から送信された後に、該当するデバイスIDを有するデバイス20_iにてデータIDコードに応じたデータの返信や動作が実行される。 In single master / multi-slave communication, after the device ID field IDF is transmitted from the controller 10 following the control field CF, the device 20_i having the corresponding device ID returns or operates data according to the data ID code. Will be executed.

[シリアル通信システム1のコントローラ10側の処理手順]
次に、本発明の実施の形態1のシリアル通信システム1において実行されるシリアル通信方法のコントローラ10側の処理手順について、図7を参照しながら説明する。図7は、本発明の実施の形態1におけるシリアル通信システムのデータ転送時のコントローラ10側の処理手順を示すフローチャートである。
[Processing procedure on the controller 10 side of the serial communication system 1]
Next, the processing procedure on the controller 10 side of the serial communication method executed in the serial communication system 1 of the first embodiment of the present invention will be described with reference to FIG. 7. FIG. 7 is a flowchart showing a processing procedure on the controller 10 side at the time of data transfer of the serial communication system according to the first embodiment of the present invention.

ステップS101において、シリアル通信システム1の電源がオンされると、コントローラ10はシリアル通信システム1内の各部を初期化する。その後、処理がステップS102へと進む。 In step S101, when the power of the serial communication system 1 is turned on, the controller 10 initializes each part in the serial communication system 1. After that, the process proceeds to step S102.

ステップS102において、コントローラ10は、バス通信ライン30に電源Vccを供給する。その後、処理がステップS103へと進む。 In step S102, the controller 10 supplies the power supply Vcc to the bus communication line 30. After that, the process proceeds to step S103.

ステップS103において、コントローラ10は、バス通信ライン30に接続されているデバイス20の設定を確認する。ここで、デバイス20の設定とは、バス通信ライン30に単一のデバイス20が接続されているか、または、バス通信ライン30に複数個のデバイス20_1〜デバイス20_nが接続されているか、を意味する。この設定は、ユーザによる操作部からの設定でもよいし、コントローラ10が自動的に取得した設定でもよい。 In step S103, the controller 10 confirms the settings of the device 20 connected to the bus communication line 30. Here, the setting of the device 20 means whether a single device 20 is connected to the bus communication line 30, or whether a plurality of devices 20_1 to 20_n are connected to the bus communication line 30. .. This setting may be a setting from the operation unit by the user, or may be a setting automatically acquired by the controller 10.

ステップS103の設定確認に基づいて、ステップS104において、バス通信ライン30に単一のデバイス20が接続されていると判定されれば、処理がステップS105へと進む。 If it is determined in step S104 that a single device 20 is connected to the bus communication line 30 based on the setting confirmation in step S103, the process proceeds to step S105.

ステップS105において、コントローラ10は、コントロールフィールドCF中のSYNCコードを、シングルマスタ/シングルスレーブ通信を行う場合の“010”に設定する。その後、処理がステップS106へと進む。 In step S105, the controller 10 sets the SYNC code in the control field CF to "010" when performing single master / single slave communication. After that, the process proceeds to step S106.

ステップS106において、コントローラ10は、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFをリクエストとして、バス通信ライン30に送信する。これにより、コントローラ10は、単一のデバイス20との間でシングルマスタ/シングルスレーブ通信によりシリアル通信を行う。その後、処理がステップS107へと進む。 In step S106, the controller 10 transmits the control field CF as a request to the bus communication line 30 after the idle state for one data frame or more continues from the final portion of the preceding data frame. As a result, the controller 10 performs serial communication with the single device 20 by single master / single slave communication. After that, the process proceeds to step S107.

ステップS107において、コントローラ10は、外部からのパワーオフの指示の有無を監視しており、外部からのパワーオフの指示が有るまで、ステップS106のシリアル通信の処理と、ステップS107の外部指示監視の処理とを繰り返している。 In step S107, the controller 10 monitors the presence or absence of an external power-off instruction, and until the external power-off instruction is given, the serial communication process in step S106 and the external instruction monitoring in step S107 are performed. The process is repeated.

ステップS107において、コントローラ10は、外部からのパワーオフの指示を検出すると、ステップS106のシリアル通信の処理を終了し、バス通信ライン30への電源Vcc供給を停止し、シリアル通信システム1としての処理を終了する。 When the controller 10 detects the power-off instruction from the outside in step S107, the controller 10 ends the serial communication process in step S106, stops the power supply Vcc supply to the bus communication line 30, and processes the serial communication system 1 as one. To finish.

一方、ステップ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 controller 10 sets the SYNC code in the control field CF to "101" when performing single master / multi-slave communication. After that, the process proceeds to step S109.

ステップS109において、コントローラ10は、先行するデータフレームの最終部分から1データフレーム分以上のアイドル状態が継続した後に、コントロールフィールドCFに続いて、デバイスIDフィールドIDFをリクエストとして、バス通信ライン30に送信する。デバイスIDフィールドIDFには、複数個のデバイス20_1〜デバイス20_nのうちの、通信相手となるいずれかのデバイス20_iのデバイスIDを含める。 In step S109, the controller 10 transmits the device ID field IDF as a request to the bus communication line 30 following the control field CF after the idle state for one data frame or more continues from the final portion of the preceding data frame. To do. The device ID field IDF includes the device ID of any device 20_i as a communication partner among the plurality of devices 20_1 to 20_n.

これにより、コントローラ10は、複数個のデバイス20_1〜デバイス20_n中のいずれかのデバイス20_iとの間で、シングルマスタ/マルチスレーブ通信によりシリアル通信を行う。その後、処理がステップS110へと進む。 As a result, the controller 10 performs serial communication between the plurality of devices 20_1 and any of the devices 20_n among the devices 20_n by single master / multi-slave communication. After that, the process proceeds to step S110.

ステップS110において、コントローラ10は、外部からのパワーオフの指示の有無を監視しており、外部からのパワーオフの指示が有るまで、ステップS109のシリアル通信の処理と、ステップS110の外部指示監視の処理とを繰り返している。 In step S110, the controller 10 monitors the presence or absence of an external power-off instruction, and until there is an external power-off instruction, the serial communication process in step S109 and the external instruction monitoring in step S110 are performed. The process is repeated.

ステップS110において、コントローラ10は、外部からのパワーオフの指示を検出すると、ステップS109のシリアル通信の処理を終了し、バス通信ライン30への電源Vcc供給を停止し、シリアル通信システム1としての処理を終了する。 When the controller 10 detects the power-off instruction from the outside in step S110, the controller 10 ends the serial communication process in step S109, stops the power supply Vcc supply to the bus communication line 30, and processes the serial communication system 1. To finish.

[シリアル通信システム1のデバイス20側の処理手順]
次に、本発明の実施の形態1のシリアル通信システム1において実行されるシリアル通信方法のデバイス20側の処理手順について、図8を参照しながら説明する。図8は、本発明の実施の形態1におけるシリアル通信システムのデータ転送時のデバイス20側の処理手順を示すフローチャートである。
[Processing procedure on the device 20 side of the serial communication system 1]
Next, the processing procedure on the device 20 side of the serial communication method executed in the serial communication system 1 of the first embodiment of the present invention will be described with reference to FIG. FIG. 8 is a flowchart showing a processing procedure on the device 20 side at the time of data transfer of the serial communication system according to the first embodiment of the present invention.

ステップS201において、バス通信ライン30に接続された単一のデバイス20、またはバス通信ライン30に接続された複数個のデバイス20_1〜デバイス20_nは、バス通信ライン30に供給された電源Vccを受けて動作を開始する。その後、処理がステップS202へと進む。 In step S201, the single device 20 connected to the bus communication line 30, or the plurality of devices 20_1 to 20_n connected to the bus communication line 30 receive the power supply Vcc supplied to the bus communication line 30. Start operation. After that, the process proceeds to step S202.

ステップS202において、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、自らを初期化する。その後、処理がステップS202へと進む。 In step S202, the device 20 or the plurality of devices 20_1 to 20_n each initialize themselves. After that, the process proceeds to step S202.

ステップS203において、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、コントローラ10からバス通信ライン30を通して送信されるコントロールフィールドCFの受信を待機している。 In step S203, the device 20 or the plurality of devices 20_1 to 20_n are each waiting for the reception of the control field CF transmitted from the controller 10 through the bus communication line 30.

ここで、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、1データフレーム分以上のアイドル状態が継続した後のコントロールフィールドCFを通信開始であると判断する。デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、コントロールフィールドCFを受信した後、処理がステップS204へと進む。 Here, each of the device 20 or the plurality of devices 20_1 to 20_n determines that the control field CF after the idle state for one data frame or more continues is the communication start. After receiving the control field CF for each of the device 20 or the plurality of devices 20_1 to 20_n, the process proceeds to step S204.

ステップS204において、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、受信したコントロールフィールドCFに含まれるSYNCコードの内容を調べる。すなわち、デバイス20、または複数個のデバイス20_1〜デバイス20_nそれぞれは、SYNCコードが、シングルマスタ/シングルスレーブ通信用の“010”であるか、シングルマスタ/マルチスレーブ通信用の“101”であるかを識別する。 In step S204, the device 20 or the plurality of devices 20_1 to 20_n each check the contents of the SYNC code included in the received control field CF. That is, for each of the device 20 or the plurality of devices 20_1 to 20_n, whether the SYNC code is "010" for single master / single slave communication or "101" for single master / multi-slave communication. To identify.

ステップ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 device 20 transmits data according to the communication format to the controller 10 by serial communication according to the operation command included in the control field CF, as shown in FIG. 3B. After that, the process proceeds to step S209.

ステップS209において、デバイス20は、バス通信ライン30における電源Vccの存在有無を監視しており、電源Vccが存在していればステップS203のコントロールフィールドCFの受信待機に戻り、電源Vccが存在しなくなればデバイス20の動作を終了する。 In step S209, the device 20 monitors the presence / absence of the power supply Vcc in the bus communication line 30, and if the power supply Vcc exists, it returns to the reception standby of the control field CF in step S203, and the power supply Vcc must not exist. If so, the operation of the device 20 is terminated.

ステップ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 controller 10 following the control field CF matches its own device ID. After that, the process proceeds to step S207.

ステップ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 controller 10 by the device ID field IDF follows the operation command included in the control field CF, and the data according to the communication format as shown in FIG. 3D is transmitted to the controller 10 by serial communication. Send to. As shown in FIG. 3D, the device 20_i includes its own device ID in the device ID field IDF between the control field CF and the status field SF. After that, the process proceeds to step S209.

ステップ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 device 20 is terminated.

以上のように、実施の形態1のシリアル通信システム1において実行されるシリアル通信方法によれば、シングルマスタ/シングルスレーブ接続システムとシングルマスタ/マルチスレーブ接続システムで共通して通信可能とし、マルチスレーブ接続時の通信データ長に比べてシングルスレーブ接続時の通信データ長を削減することが可能になる。 As described above, according to the serial communication method executed in the serial communication system 1 of the first embodiment, the single master / single slave connection system and the single master / multi-slave connection system can communicate in common, and the multi-slave can be communicated in common. It is possible to reduce the communication data length at the time of single-slave connection as compared with the communication data length at the time of connection.

ここで、シングルスレーブ接続時は、マルチスレーブ接続時と比較して、図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 device 20.

[その他の実施の形態]
本発明の実施の形態1におけるシリアル通信システム1の他の形態、シリアル通信システム1において実行されるシリアル通信方法の他の手順について、以下に説明する。
[Other embodiments]
Another embodiment of the serial communication system 1 in the first embodiment of the present invention, another procedure of the serial communication method executed in the serial communication system 1, will be described below.

以上の実施の形態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 serial communication system 1 of the first embodiment, a pair of SD + and SD- differential transmission signals of RS485 standard using two equal signal lines for signal transmission in the bus communication line 30. Although it is shown as an example assuming communication by, the present invention is not limited to this content. For example, the serial communication system 1 of the first embodiment of the present invention may be applied to communication according to the RS422 standard or the RS232 standard. Further, the serial communication system 1 of the first embodiment of the present invention may be applied to communication not based on a differential transmission signal.

以上の実施の形態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 device 20, a field for the special command may be added as request information. For example, if the sensing device has a memory and you want to access the memory and change the value, you can add a field for the memory address and a field for the write data to the request, and also detect data errors. If you want to, you can add a CRC field.

以上の実施の形態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)

シリアル通信機能を有するコントローラと、シリアル通信機能を有する1以上のデバイスとの間で、通信フォーマットに従ってシリアル通信を行うシリアル通信方法であって、
前記コントローラは、
前記デバイスが単一であるか複数であるかを示す情報を、前記通信フォーマット中に存在するコードに割り当て、
前記デバイスが単一である場合、前記デバイスが単一であることを前記情報により示し、単一の前記デバイスとの間で前記シリアル通信を行い、
前記デバイスが複数である場合、前記デバイスが複数であることを前記情報により示し、前記デバイスを識別するデバイス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コードに割り当てられており、
前記コントローラと前記デバイスは、前記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以上のデバイスとを備え、
請求項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.
JP2019129916A 2019-07-12 2019-07-12 Serial communication method and serial communication system Expired - Fee Related JP6762546B1 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

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