JP2005191910A - Communication method - Google Patents

Communication method Download PDF

Info

Publication number
JP2005191910A
JP2005191910A JP2003430542A JP2003430542A JP2005191910A JP 2005191910 A JP2005191910 A JP 2005191910A JP 2003430542 A JP2003430542 A JP 2003430542A JP 2003430542 A JP2003430542 A JP 2003430542A JP 2005191910 A JP2005191910 A JP 2005191910A
Authority
JP
Japan
Prior art keywords
data
communication
transmission
communication unit
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2003430542A
Other languages
Japanese (ja)
Inventor
Hideaki Onda
秀明 恩田
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.)
Marelli Corp
Original Assignee
Calsonic Kansei Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Calsonic Kansei Corp filed Critical Calsonic Kansei Corp
Priority to JP2003430542A priority Critical patent/JP2005191910A/en
Publication of JP2005191910A publication Critical patent/JP2005191910A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a communication method equalizing the communication loads of CPUs of respective units and efficiently performing communication. <P>SOLUTION: The communication unit of a transmission origin provides a first/end flag F/E_F indicating the start and end of data transmission and S_ID indicating the ID data of the transmission origin in a communication frame 61 and transmits it to the communication unit of a transmission destination. At the time of receiving the first/end flag F/E_F indicating the start and end of the data transmission, the communication unit of the transmission destination transmits response frames 62 and 63 indicating reception establishment corresponding to flag data and including T_ID indicating the ID data of the transmission origin to the communication unit of the transmission origin. The communication unit next in the order of the ID data detects that the response frames 62 and 63 corresponding to the first/end flag F/E_F indicating the end of the data transmission are transmitted from the communication unit of the transmission destination, and transmission and reception are successively performed. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、複数の通信ユニット間でシリアル通信線を用いて行う通信方法の技術分野に属する。   The present invention belongs to the technical field of a communication method performed using a serial communication line between a plurality of communication units.

従来において、シリアル通信線を用いた半2重通信では、マスターとなるユニットとスレーブとなるユニットで構成されることになり、マスターユニットがスレーブを指定してデータを送信し、スレーブユニットはマスターから自分が指定されるとデータを送信する。スレーブユニットが自発的にデータを送ることはなく、マスターから指定されてはじめてデータを送信する(例えば、特許文献1参照。)。
特開2001−251319号公報(第2−5頁、全図)
Conventionally, half-duplex communication using a serial communication line consists of a master unit and a slave unit. The master unit designates the slave and transmits data. Send data when you are specified. The slave unit does not voluntarily send data, but sends data only when designated by the master (see, for example, Patent Document 1).
JP 2001-251319 A (page 2-5, full view)

しかしながら、従来の通信方法にあっては、マスターが必ずスレーブに呼びかけるため、マスターユニットのCPUの負荷が高くなる。
また、一旦マスターを経由してスレーブに伝達しなければならないため、スレーブ同士の通信ができず、マスター経由により応答性が悪かった。
However, in the conventional communication method, since the master always calls the slave, the load on the CPU of the master unit increases.
In addition, since the data must be transmitted once to the slave via the master, the slaves cannot communicate with each other, and the responsiveness is poor via the master.

本発明は、上記問題点に着目してなされたもので、その目的とするところは、
各ユニットのCPUの通信負荷を均等にでき、通信を効率よく行うことができる通信方法を提供することにある。
The present invention was made paying attention to the above-mentioned problems, and the object is as follows.
It is an object of the present invention to provide a communication method capable of equalizing the communication load of the CPU of each unit and performing communication efficiently.

上記目的を達成するため、本発明では、複数の通信ユニットをシリアル通信線によりバス型に接続して構成したネットワークにおける通信方法において、各通信ユニットには重複しないIDを割り当て、送信元の通信ユニットは、データに送信の開始と終了を示すフラグを設け、送信先の通信ユニットは、データの終了を示すフラグを含むデータを受け取ると、送信元の通信ユニットに自ユニットのIDを含み、データを受け取ったことを示す応答データを送信する、ことを特徴とする。   In order to achieve the above object, according to the present invention, in a communication method in a network configured by connecting a plurality of communication units in a bus form with serial communication lines, a non-overlapping ID is assigned to each communication unit, and the communication unit of the transmission source Provides a flag indicating the start and end of transmission in the data, and when the destination communication unit receives the data including the flag indicating the end of data, the communication unit of the transmission source includes the ID of its own unit, Response data indicating that it has been received is transmitted.

よって、本発明にあっては、各通信ユニットのCPUの通信負荷を均等にでき、各通信ユニットの通信を効率よく行うことができる。   Therefore, in the present invention, the communication load of the CPU of each communication unit can be equalized, and communication of each communication unit can be performed efficiently.

以下、本発明の通信方法を実現する実施の形態を、請求項1,2,3に基づいて説明する。   Hereinafter, embodiments for realizing the communication method of the present invention will be described based on claims 1, 2, and 3.

まず、構成を説明する。
図1は実施例1の通信方法を用いた通信システムの構成を示す図である。図2は実施例1の通信方法で用いる通信データのフォーマットを示す説明図である。図3は実施例1の通信方法を用いた通信システムの通信ユニットで実行される送信処理の流れを示すフローチャートである。図4は実施例1の通信方法を用いた通信システムの通信ユニットで実行される受信処理の流れを示すフローチャートである。図5は実施例1の通信方法の通信手順を示す説明図である。図6は実施例1の通信方法の通信タイミングを示すタイミングチャートである。図7は実施例1の通信方法の通信状態を示す説明図である。
First, the configuration will be described.
FIG. 1 is a diagram illustrating a configuration of a communication system using the communication method according to the first embodiment. FIG. 2 is an explanatory diagram illustrating a format of communication data used in the communication method according to the first embodiment. FIG. 3 is a flowchart showing a flow of transmission processing executed in the communication unit of the communication system using the communication method of the first embodiment. FIG. 4 is a flowchart illustrating a flow of reception processing executed by the communication unit of the communication system using the communication method according to the first embodiment. FIG. 5 is an explanatory diagram illustrating a communication procedure of the communication method according to the first embodiment. FIG. 6 is a timing chart illustrating the communication timing of the communication method according to the first embodiment. FIG. 7 is an explanatory diagram illustrating a communication state of the communication method according to the first embodiment.

実施例1の通信方法を用いた通信システムは、車両に搭載される車載機器でシリアル通信を構成したものであり、図1に示すように、通信線5に対して通信ユニット1,2,3をバス型に接続して構成する。なお、実施例1では、説明上、通信ユニットが3台(一部4台)の場合を用いて説明する。
各通信ユニット1,2,3は、データ処理、通信制御を行うCPU11,21,31、各CPUn1から出力されるデータを変換して通信線5に出力する送信回路12,22,32、通信線5からの信号を変換して各CPUn1に出力する受信回路13,23,33により構成している。
The communication system using the communication method of the first embodiment is configured by serial communication with an in-vehicle device mounted on a vehicle. As shown in FIG. Are connected in a bus form. In the first embodiment, for the sake of explanation, a case where there are three communication units (partially four) will be described.
Each communication unit 1, 2, 3 includes CPUs 11, 21, 31 that perform data processing and communication control, transmission circuits 12, 22, 32 that convert data output from each CPU n1 and output the data to the communication line 5, and communication lines 5 is constituted by receiving circuits 13, 23, and 33 that convert the signal from 5 and output it to each CPU n1.

次に図2を参照して、実施例1の通信方法で用いる通信フォーマット6について説明する。
フレーム形式で表現するデータである通信フレーム61は、データ長を示すLENGTH、自局のIDナンバーを示すS_ID、相手局のIDナンバーを示すT_ID、データ送信の開始と終了を示すファースト/エンドフラグF/E_F、データDATAn(DATA1〜DATAn)、送信データと受信データの整合性を検証するためのチェックサムSUMで構成される。
Next, the communication format 6 used in the communication method of the first embodiment will be described with reference to FIG.
The communication frame 61, which is data expressed in a frame format, is a LENGTH indicating the data length, an S_ID indicating the ID number of the own station, a T_ID indicating the ID number of the partner station, and a first / end flag F indicating the start and end of data transmission. / E_F, data DATAn (DATA1 to DATAn), and a checksum SUM for verifying consistency between transmission data and reception data.

正常なデータ送信の完了を示すために送信される応答フレーム62は、正常なデータ送信の完了を示すACKと、相手局のIDナンバーを示すT_ID又は送信データの終了を示すエンドフラグE_Fで構成される。
また、データ送信の不完了を示すために送信される応答フレーム63は、データ送信の不完了を示すNACKと、相手局のIDナンバーを示すT_ID又は送信データの終了を示すエンドフラグE_Fで構成される。
The response frame 62 transmitted to indicate the completion of normal data transmission is composed of an ACK indicating the completion of normal data transmission and a T_ID indicating the ID number of the partner station or an end flag E_F indicating the end of transmission data. The
The response frame 63 transmitted to indicate incomplete data transmission is composed of a NACK indicating incomplete data transmission and a T_ID indicating the ID number of the partner station or an end flag E_F indicating the end of transmission data. The

次に、作用を説明する。   Next, the operation will be described.

[マスター/スレーブ通信方式について]
マスター/スレーブ通信方式について、図8〜図14に、その構成、通信データのフォーマット、送信処理及び受信処理の流れ、通信手順、タイムチャートを示す。
まず図10に示すフローチャートを用いてマスター/スレーブ通信方式のマスター側の通信処理の流れについて説明する。
[About master / slave communication method]
Regarding the master / slave communication method, FIGS. 8 to 14 show the configuration, the format of communication data, the flow of transmission processing and reception processing, the communication procedure, and the time chart.
First, the flow of communication processing on the master side in the master / slave communication method will be described using the flowchart shown in FIG.

ステップS101では、スレーブユニットのIDナンバーを1とする処理を行う。   In step S101, a process for setting the ID number of the slave unit to 1 is performed.

ステップS102では、スレーブIDナンバーにセットされているスレーブユニットにデータを要求するデータ送信を行う。   In step S102, data transmission for requesting data is performed to the slave unit set in the slave ID number.

ステップS103では、タイマT3のタイマカウントを開始する。   In step S103, the timer count of timer T3 is started.

ステップS104では、スレーブIDナンバーにセットされているスレーブユニットのデータを受信したかどうかを判断し、受信したならばステップS105に移行し、受信していないならばステップS107に移行する。   In step S104, it is determined whether or not the data of the slave unit set in the slave ID number has been received. If received, the process proceeds to step S105. If not received, the process proceeds to step S107.

ステップS105では、スレーブIDナンバーをインクリメント(+1)する。   In step S105, the slave ID number is incremented (+1).

ステップS106では、スレーブIDナンバーが、最大値であるかどうかを判断し、最大値であるならばステップS101に移行し、最大値でないならばステップS102に移行する。   In step S106, it is determined whether or not the slave ID number is the maximum value. If it is the maximum value, the process proceeds to step S101, and if it is not the maximum value, the process proceeds to step S102.

ステップS107では、カウントしたタイマが時間T3を経過したかどうかを判断し、T3が経過したならばステップS108に移行し、T3が経過しなければステップS104に移行する。   In step S107, it is determined whether the counted timer has elapsed time T3. If T3 has elapsed, the process proceeds to step S108, and if T3 has not elapsed, the process proceeds to step S104.

ステップS108では、同じスレーブIDナンバーでタイムアウトが1回目かどうかを判断し、1回目であるならばステップS102に移行し、1回目でない(複数回)であるならばステップS105に移行する。   In step S108, it is determined whether the timeout is the first time with the same slave ID number. If it is the first time, the process proceeds to step S102, and if it is not the first time (multiple times), the process proceeds to step S105.

次に、図11に示すフローチャートを用いてマスター/スレーブ通信方式のスレーブ側の通信方式の流れについて説明する。   Next, the flow of the communication method on the slave side of the master / slave communication method will be described using the flowchart shown in FIG.

ステップS111では、データを受信したかどうかを判断し、受信したならばステップS112に移行し、受信していないならばステップS111に移行して待つようにする。   In step S111, it is determined whether data has been received. If received, the process proceeds to step S112, and if not received, the process proceeds to step S111 to wait.

ステップS112では、受信したデータが自ユニットに向けたものかどうかを判断し、自ユニットに向けたものであればステップS113に移行し、自ユニットに向けたものでないならばステップS111に移行する。   In step S112, it is determined whether the received data is directed to the own unit. If the received data is directed to the own unit, the process proceeds to step S113. If not, the process proceeds to step S111.

ステップS113では、マスターユニットに自ユニットのデータを送信する。   In step S113, the data of the own unit is transmitted to the master unit.

以下の説明上、スレーブユニットは4台とする。
マスター/スレーブ通信方式では、図12に示すように、全ての通信が、マスターユニットMに対するスレーブユニットS1〜S4の通信により行われることになる。そのため、図9に示すようにマスターユニットMで使用する通信フレームFmは、T_IDで相手先つまりスレーブユニットのみを有し、スレーブユニットS1〜S4で使用する通信フレームFsは、S_IDで自ユニットつまりスレーブユニットのみを有することになる。
In the following explanation, it is assumed that there are four slave units.
In the master / slave communication method, as shown in FIG. 12, all communication is performed by communication of the slave units S1 to S4 with respect to the master unit M. Therefore, as shown in FIG. 9, the communication frame Fm used in the master unit M has only the other party, that is, the slave unit with T_ID, and the communication frame Fs used in the slave units S1 to S4 has the own unit, that is, the slave with S_ID. You will only have units.

このマスター/スレーブ通信方式では、正常通信処理(図13(a)参照、図10のステップS101〜S106、図11のS111〜S113)、再送処理(図13(b)参照)においても、マスターユニットとスレーブユニット間の通信となる。
このように、マスター/スレーブ通信方式では、全ての通信がマスターユニットとスレーブユニット間で行われるため、スレーブユニットが多いほど、マスターユニットの負荷は大きなものとなる。また、全ての通信を、マスターユニットを介して行うため効率がよくない。
特に、車載機器では、インテリジェント化による各車載機器のCPUの高性能化が進んでおり、スレーブユニットにすると、各機器の持つCPUの性能が生かしきれなくなる。そのことと関係なく、この通信方式では、マスターユニットの負荷が大きくなるのである。
この点、実施例1では、均等な負荷となる。
In this master / slave communication system, the master unit is also used in normal communication processing (see FIG. 13A, steps S101 to S106 in FIG. 10, S111 to S113 in FIG. 11), and retransmission processing (see FIG. 13B). And communication between slave units.
As described above, in the master / slave communication method, all communication is performed between the master unit and the slave unit. Therefore, the greater the number of slave units, the greater the load on the master unit. Further, since all communication is performed via the master unit, the efficiency is not good.
In particular, in-vehicle devices have advanced CPU performance of each in-vehicle device due to intelligentization. If a slave unit is used, the CPU performance of each device cannot be fully utilized. Regardless of this, in this communication method, the load on the master unit increases.
In this regard, in the first embodiment, the load is equal.

[送信処理]
図3は実施例1の通信方法により、各通信ユニット1,2,3,4のCPUn1で実行される送信処理の流れを示すフローチャートで、以下、各ステップについて説明する。
[Transmission process]
FIG. 3 is a flowchart showing a flow of transmission processing executed by the CPU n1 of each of the communication units 1, 2, 3, 4 by the communication method of the first embodiment. Each step will be described below.

ステップS11では、送信処理を開始する。   In step S11, transmission processing is started.

ステップS12では、その通信ユニットの必要性に応じて、送信相手を設定する。   In step S12, a transmission partner is set according to the necessity of the communication unit.

ステップS13では、設定した送信相手に対する送信データをセットする。   In step S13, transmission data for the set transmission partner is set.

ステップS14では、送信タイマのカウントを開始する。   In step S14, the transmission timer starts counting.

ステップS15では、送信タイマのカウント時間がT1に達したかどうかを判断し、T1に達したならばステップS18に移行し、T1に達しないならばステップS16に移行する。   In step S15, it is determined whether the count time of the transmission timer has reached T1, and if T1 is reached, the process proceeds to step S18, and if not, the process proceeds to step S16.

ステップS16では、正常なデータ受信が行われたことを示すACKデータを受信したかどうかを判断し、受信したならばステップS17に移行し、受信しないならばステップS21に移行する。   In step S16, it is determined whether or not ACK data indicating that normal data reception was performed. If received, the process proceeds to step S17. If not received, the process proceeds to step S21.

ステップS17では、処理を終了する。   In step S17, the process ends.

ステップS18では、前回の送信が再送信であるかどうかを判断し、再送信であるならばステップS19に移行し、再送信でないならばステップS23に移行する。   In step S18, it is determined whether or not the previous transmission is retransmission. If it is retransmission, the process proceeds to step S19. If not, the process proceeds to step S23.

ステップS19では、送信失敗であるとして、ダミーACKデータを含む応答フレーム62を送信する。   In step S19, it is determined that the transmission has failed, and a response frame 62 including dummy ACK data is transmitted.

ステップS20では、処理を終了する。   In step S20, the process ends.

ステップS21では、データ送信の不完了を示すNACKを受信したかどうかを判断し、受信したならばステップS22に移行し、受信しないならばステップS15に移行する。   In step S21, it is determined whether or not a NACK indicating incomplete data transmission has been received. If received, the process proceeds to step S22, and if not received, the process proceeds to step S15.

ステップS22では、NACKデータの受信が2回目であるかどうかを判断し、2回目であるならばステップS24に移行し、2回目でないならばステップS23に移行する。   In step S22, it is determined whether or not NACK data is received for the second time. If it is the second time, the process proceeds to step S24. If not, the process proceeds to step S23.

ステップS23では、送信データを再セットする。   In step S23, the transmission data is reset.

ステップS24では、送信失敗であるとして、ダミーACKデータを含む応答フレーム62を送信する。   In step S24, it is determined that the transmission has failed, and a response frame 62 including dummy ACK data is transmitted.

ステップS25では、処理を終了する。   In step S25, the process ends.

[受信処理]
図4は実施例1の通信方法により、各通信ユニット1,2,3のCPUn1で実行される受信処理の流れを示すフローチャートで、以下、各ステップについて説明する。
[Receive processing]
FIG. 4 is a flowchart showing the flow of reception processing executed by the CPU n1 of each of the communication units 1, 2 and 3 according to the communication method of the first embodiment. Each step will be described below.

ステップS31では、受信処理を開始する。   In step S31, reception processing is started.

ステップS32では、他の通信ユニットから送信されるACKデータを受信したかどうかを判断し、受信したならばステップS33に移行し、受信しないならばステップS36に移行する。   In step S32, it is determined whether or not ACK data transmitted from another communication unit has been received. If received, the process proceeds to step S33, and if not received, the process proceeds to step S36.

ステップS33では、受信したACKデータを含む応答フレーム62の送信元のIDナンバーS_IDが、自ユニットのIDナンバーより1つ前(自分のID-1)であるかどうかを判断し、1つ前であるならばステップS34に移行し、1つ前でないならばステップS41に移行する。   In step S33, it is determined whether or not the transmission source ID number S_ID of the response frame 62 including the received ACK data is one before the own unit ID number (own ID-1). If there is, the process proceeds to step S34, and if not, the process proceeds to step S41.

ステップS34では、通信線のアイドリング時間のタイマカウントを起動させる。   In step S34, the timer count of the idling time of the communication line is activated.

ステップS35では、カウント時間がT2(50ms)に達したかどうかを判断し、T2に達したならば、図3のステップS12に移行して送信処理へ移行し、T2に達しないならばステップS35に移行して待つようにする。   In step S35, it is determined whether or not the count time has reached T2 (50 ms). If T2 is reached, the process proceeds to step S12 in FIG. 3 and the transmission process is performed. If T2 is not reached, step S35 is performed. And wait for it.

ステップS36では、データを受信したかどうかを判断し、データを受信したならばステップS37に移行し、データを受信していないならばステップS40に移行する。   In step S36, it is determined whether or not data has been received. If data has been received, the process proceeds to step S37. If no data has been received, the process proceeds to step S40.

ステップS37では、受信したデータの相手局を示すT_IDが自分の通信ユニットのIDと同じかどうか、つまり自分の通信ユニット向けのデータかどうかを判断し、自分の通信ユニット向けの場合にはステップS38に移行し、自分の通信ユニット向けでない場合にはステップS40に移行する。   In step S37, it is determined whether T_ID indicating the partner station of the received data is the same as the ID of the own communication unit, that is, whether the data is for the own communication unit. If the communication unit is not for the communication unit, the process proceeds to step S40.

ステップS38では、正常なデータ受信が行われたことを示すACKデータを含む応答フレーム62を送信する。   In step S38, a response frame 62 including ACK data indicating that normal data reception has been performed is transmitted.

ステップS39では、処理を終了する。   In step S39, the process ends.

ステップS40では、ユニット故障検知のためにカウントした時間がT4に達したかどうかを判断し、T4に達したならば図3のステップS12に移行して送信処理を行うようにし、T4に達しないならばステップS32に移行する。   In step S40, it is determined whether the time counted for unit failure detection has reached T4. If T4 is reached, the process proceeds to step S12 in FIG. If so, the process proceeds to step S32.

ステップS41では、受信したACKデータを含む応答フレーム62の送信元のIDナンバーS_IDが、自ユニットのIDナンバーより2つ前(自分のID-2)であるかどうかを判断し、2つ前であるならばステップS42に移行し、2つ前でないならばステップS32に移行する。   In step S41, it is determined whether or not the transmission source ID number S_ID of the response frame 62 including the received ACK data is two before the own unit ID number (own ID-2). If there is, the process proceeds to step S42, and if not, the process proceeds to step S32.

ステップS42では、故障検知のためのタイマのカウントを開始する。   In step S42, timer counting for failure detection is started.

[通信制御処理]
実施例1の通信方法による通信処理について説明する。
説明上、通信ユニット1,2,3によりシリアル通信が構成されているものとする。
なお、図7の通信フレームのデータは16進で表現され、ファーストフラグを示すデータをAAH、エンドフラグを示すデータをFFH、ACKを示すデータを10H、
NACKを示すデータを5AHとする。
[Communication control processing]
Communication processing according to the communication method of the first embodiment will be described.
For the sake of explanation, it is assumed that serial communication is constituted by the communication units 1, 2, and 3.
The communication frame data in FIG. 7 is expressed in hexadecimal, the data indicating the first flag is AAH, the data indicating the end flag is FFH, the data indicating ACK is 10H,
Data indicating NACK is set to 5AH.

実施例1の通信方法を用いた通信システムでは、図5に示すようにマスター・スレーブの関係なしに通信を行う。
まず、通信ユニット1から通信ユニット3へデータ送信を行う場合、通信ユニット1のCPU11が、自ユニットを示すS_IDをID=1(01H)をセット、相手を示すT_IDをID=3(03H)セット、ファーストフラグをセット(AAH)して通信フレーム61を送信回路12へ出力する。送信回路はCPU11からのデータを変換して通信線5へ送出する(ステップS12→S13)。相手局となる通信ユニット3は、データを受信し、送信先が自ユニットであれば、ACKデータ(10H)を含む応答フレーム62を通信線5へ送出する(ステップS36→S37→S38)。
In the communication system using the communication method of the first embodiment, communication is performed without a master / slave relationship as shown in FIG.
First, when data is transmitted from the communication unit 1 to the communication unit 3, the CPU 11 of the communication unit 1 sets the S_ID indicating its own unit to ID = 1 (01H) and sets the T_ID indicating the other party to ID = 3 (03H). The first flag is set (AAH), and the communication frame 61 is output to the transmission circuit 12. The transmission circuit converts the data from the CPU 11 and sends it to the communication line 5 (steps S12 → S13). The communication unit 3 as a partner station receives the data, and if the transmission destination is its own unit, sends a response frame 62 including ACK data (10H) to the communication line 5 (steps S36 → S37 → S38).

つまり、通信線5へ送出された送信データは全てのユニットで受信し、該当するユニットのみがそのデータを採用すると共に、応答を返す(図7(a)参照)。   That is, the transmission data sent to the communication line 5 is received by all units, and only the corresponding unit adopts the data and returns a response (see FIG. 7A).

通信ユニット3が送出したACKデータを含む応答フレーム62を通信ユニット2が受信すると、応答フレーム62に含まれるT_IDはID=1を示すため、自ユニットのID-1となり、このことをステップS33の処理で検知し、ステップS34の処理でタイマを始動させる。
T2=50msが経過したならば、ID=1の通信ユニット1の送信は完了したものとして、通信ユニット2が例えば通信ユニット1へ送信を行う。
When the communication unit 2 receives the response frame 62 including the ACK data transmitted by the communication unit 3, the T_ID included in the response frame 62 indicates ID = 1, and thus becomes the ID-1 of its own unit. This is detected in the process, and a timer is started in the process of step S34.
If T2 = 50 ms elapses, the communication unit 2 transmits to the communication unit 1, for example, assuming that the transmission of the communication unit 1 with ID = 1 is completed.

通信ユニット1は、データを受信すると、ACKを含む応答フレーム62を通信ユニット2へ送信し、ACKデータが通信ユニット2で受信されると、送信が完了する(図7(b)参照)。
このように、各通信ユニットは、図6(a)に示すように、ACKデータを含む応答フレーム62を受け取りながら、ID順に送受信を行う。
上記の通信ユニット1と通信ユニット3との通信が、その内容から通信ユニット3から通信ユニット1への送信により完了する場合、通信ユニット3は、図7(c)に示すエンドフラグ(FFH)を含む通信フレーム61を通信ユニット1へ送信し、通信ユニット1が通信ユニット3へエンドフラグ(FFH)を含む応答フレーム62を送信することで、内容的にも1つの通信が終了する。
When receiving the data, the communication unit 1 transmits a response frame 62 including ACK to the communication unit 2, and when the ACK data is received by the communication unit 2, the transmission is completed (see FIG. 7B).
In this way, each communication unit performs transmission / reception in the order of ID while receiving a response frame 62 including ACK data, as shown in FIG.
When the communication between the communication unit 1 and the communication unit 3 is completed by transmission from the communication unit 3 to the communication unit 1 based on the content, the communication unit 3 displays the end flag (FFH) shown in FIG. The included communication frame 61 is transmitted to the communication unit 1, and the communication unit 1 transmits a response frame 62 including an end flag (FFH) to the communication unit 3, thereby completing one communication.

よって、エンドフラグにより通信の終了を確認した通信ユニット1は、図7(d)に示すように次の通信を行う。
例えば、通信ユニット2から通信ユニット3へのデータ送信において、受信側、この場合の通信ユニット3が受信した通信フレーム61のデータより演算で求めた所定の値が、受信した通信フレーム61のチェックサムと整合せず、正常なデータを受信できていないと判断する場合には、通信ユニット3から通信ユニット2へNACKデータを含む応答フレーム63を送信する(図7(e)参照)。
Therefore, the communication unit 1 confirming the end of communication by the end flag performs the next communication as shown in FIG.
For example, in data transmission from the communication unit 2 to the communication unit 3, a predetermined value obtained by calculation from the data of the communication frame 61 received by the communication unit 3 in this case is the checksum of the received communication frame 61. If it is determined that normal data cannot be received, a response frame 63 including NACK data is transmitted from the communication unit 3 to the communication unit 2 (see FIG. 7E).

NACKデータを送信元である通信ユニット2が受信すると、通信ユニット2は、図7(f)に示すように同じ送信データを、ステップS23の処理により再送信する。
再送信が成立すると、通信ユニット3から通信ユニット2へACKデータを含む応答フレーム62が送信される(図7(f)参照)。
When the communication unit 2 that is the transmission source receives the NACK data, the communication unit 2 retransmits the same transmission data by the process of step S23 as shown in FIG.
When the retransmission is established, the response frame 62 including the ACK data is transmitted from the communication unit 3 to the communication unit 2 (see FIG. 7F).

さらに、データ送信の再送時における処理について、図6のタイムチャートを参照して説明する。
説明上、図6では、通信ユニット1,2,3,4により通信ネットワークが構成されているものとする。
正常な通信が行われている場合、通信ユニット1からの通信フレーム61の送信→通信ユニット1への応答フレーム62の送信→通信ユニット2からの通信フレーム61の送信→通信ユニット2への応答フレーム62の送信と通信が続いていくことになる(図6(a)参照)。
Furthermore, processing at the time of retransmission of data transmission will be described with reference to the time chart of FIG.
For the sake of explanation, it is assumed in FIG. 6 that a communication network is configured by the communication units 1, 2, 3, and 4.
When normal communication is performed, transmission of the communication frame 61 from the communication unit 1 → transmission of the response frame 62 to the communication unit 1 → transmission of the communication frame 61 from the communication unit 2 → response frame to the communication unit 2 Transmission and communication of 62 continue (see FIG. 6A).

〈1〉ACKデータが応答されない場合
通信ユニット1から他の通信ユニットへデータが送信され、その通信ユニットから応答フレームが送信されない場合、通信ユニット1は送信時にステップS15の処理によりタイマをカウントしているので、時間T1の経過により、データ通信が成立しなかったものと判断して、ステップS23の処理により再送信を行う(図6(b)参照)。
<1> When ACK data is not responded When data is transmitted from the communication unit 1 to another communication unit and no response frame is transmitted from the communication unit, the communication unit 1 counts a timer by the process of step S15 at the time of transmission. Therefore, it is determined that data communication has not been established due to the elapse of time T1, and retransmission is performed by the process of step S23 (see FIG. 6B).

〈2〉NACKデータが応答された場合
通信ユニット1からの送信先である通信ユニットでは、受信した通信フレームのデータの演算結果とチェックサムSUMの整合性について照合を行う。この照合が一致しない場合には、データが正しく受信できていないことになるため、送信先の通信ユニットから通信ユニット1へNACKデータを含む応答フレーム63が送信され、再送信が行われる(図6(c)参照)。
<2> When NACK Data is Responded The communication unit that is the transmission destination from the communication unit 1 collates the calculation result of the received communication frame data with the checksum SUM. If the collation does not match, the data has not been received correctly, and therefore a response frame 63 including NACK data is transmitted from the communication unit at the transmission destination to the communication unit 1, and retransmission is performed (FIG. 6). (See (c)).

〈3〉再送信を2回行ってもACKデータの応答がない場合
送信先よりACKデータの応答がない場合には、時間T1の経過により再送信が行われるが、2回目の送信に対しても時間内にACKデータが応答されない場合、また、2回目の送信に対してNACKデータが応答された場合には、ステップS19又はステップS24の処理により、他の通信ユニットへ通信権を渡すためにダミーACKデータを含む応答フレーム62を送出する(図6(d)参照)。
ダミーACKデータを含む応答フレーム62を受信した次のIDの通信ユニットは、前のIDの通信ユニットの通信が終了したと判断して次の通信を行う。
<3> If there is no ACK data response even if the retransmission is performed twice. If there is no ACK data response from the destination, the retransmission is performed after the time T1. If the ACK data is not responded in time, or if the NACK data is responded to the second transmission, in order to pass the communication right to another communication unit by the process of step S19 or step S24. A response frame 62 including dummy ACK data is transmitted (see FIG. 6D).
The communication unit of the next ID that has received the response frame 62 including the dummy ACK data determines that the communication of the communication unit of the previous ID has been completed and performs the next communication.

〈4〉通信ユニット3が故障した場合
通信ユニット3が故障している場合には、通信ユニット2の通信が終了した後に、通信ユニット3からのACKデータを含む応答フレーム62が他のユニットで受信されない。この状態で時間T4が経過した際には、ステップS40の処理により、通信ユニット3の故障を検出したものとして通信権を通信ユニット4に渡す。
<4> When communication unit 3 has failed If communication unit 3 has failed, response frame 62 including ACK data from communication unit 3 is received by another unit after communication of communication unit 2 is completed. Not. When the time T4 elapses in this state, the communication right is transferred to the communication unit 4 as a result of detecting the failure of the communication unit 3 by the process of step S40.

次に、効果を説明する。
第1実施例の通信方法にあっては、下記に列挙する効果を得ることができる。
(1)複数の車載された通信ユニットをシリアル通信線によりバス型に接続して構成した車内ネットワークにおける通信方法において、各通信ユニットに重複しないIDデータを割り当て、各通信ユニットはIDデータ順にデータ送信の機会を得るようにし、送信元の通信ユニットは、データ送信の開始と終了を示すファースト/エンドフラグF/E_Fと、送信元のIDデータを示すS_IDとを通信フレーム61に設けて送信先の通信ユニットへ送信し、送信先の通信ユニットは、データ送信の開始と終了を示すファースト/エンドフラグF/E_Fを受け取ると、フラグデータに対応する受け取り成立を示し、送信元のIDデータを示すT_IDを含む応答フレーム62,63を送信元の通信ユニットへ送信し、送信先の通信ユニットからデータ送信の終了を示すファースト/エンドフラグF/E_Fに対応する応答フレーム62,63が送信されたことをIDデータ順の次の通信ユニットが検知して、次々に送受信を行うため、各通信ユニットのCPUの通信負荷を均等にでき、各通信ユニットの通信を効率よく行うことができる。
Next, the effect will be described.
In the communication method of the first embodiment, the effects listed below can be obtained.
(1) In a communication method in an in-vehicle network configured by connecting a plurality of in-vehicle communication units in a bus type with serial communication lines, non-overlapping ID data is assigned to each communication unit, and each communication unit transmits data in the order of ID data. The transmission source communication unit provides the communication frame 61 with a first / end flag F / E_F indicating the start and end of data transmission and S_ID indicating the transmission source ID data. When the first / end flag F / E_F indicating the start and end of data transmission is received, the transmission destination communication unit indicates that the reception corresponding to the flag data is established, and T_ID indicating the source ID data The response frames 62 and 63 including the first and second data are transmitted to the transmission source communication unit, and the first / Since the next communication unit in the order of ID data detects that the response frames 62 and 63 corresponding to the received flag F / E_F have been transmitted and performs transmission / reception one after another, the communication load of the CPU of each communication unit can be equalized. The communication of each communication unit can be performed efficiently.

(2)送信元の通信ユニットが、送信後の時間T1内に、送信先の通信ユニットからの応答フレーム62,63を受信しない場合に、送信エラーと判断し、他の通信ユニットによる通信を開始させるため、送信元の通信ユニットがデータ送信の終了を示すファースト/エンドフラグF/E_Fに対応するダミー応答データを送信するため、故障や通信線への非接続となった通信ユニットの通信権を速やかに次の通信ユニットへ渡して、効率的な通信が維持できる。   (2) If the transmission source communication unit does not receive the response frames 62 and 63 from the transmission destination communication unit within the time T1 after transmission, it is determined as a transmission error and communication by another communication unit is started. Therefore, since the source communication unit transmits dummy response data corresponding to the first / end flag F / E_F indicating the end of data transmission, the communication right of the communication unit that has failed or disconnected from the communication line is It can be quickly passed to the next communication unit to maintain efficient communication.

(3)送信先の通信ユニットが、データが不完全な受信となった場合に、送信元からのデータ送信の終了を示すファースト/エンドフラグF/E_Fに対応し、且つ受信の不完了を示す応答データを送信し、送信先の通信ユニットが、送信先からの受信の不完了を示す応答データを受信すると、再送信を行うため、データ通信の確実性を向上させることができる。   (3) The destination communication unit corresponds to the first / end flag F / E_F indicating the end of data transmission from the transmission source when data is incompletely received, and indicates incomplete reception When the response data is transmitted and the communication unit of the transmission destination receives the response data indicating incompletion of reception from the transmission destination, retransmission is performed, and thus the reliability of data communication can be improved.

以上、本発明の通信方法を実施例1に基づき説明してきたが、具体的な構成については、これらの実施例に限られるものではなく、特許請求の範囲の各請求項に係る発明の要旨を逸脱しない限り、設計の変更や追加等は許容される。   As described above, the communication method of the present invention has been described based on the first embodiment. However, the specific configuration is not limited to these embodiments, and the gist of the invention according to each claim of the claims is described. Unless it deviates, design changes and additions are allowed.

実施例で示す通信ユニットは、車載機器の場合、各機器の一部の構成となる。
IDナンバーは、機器の優先順位で割り振るようにするのが、望ましい。
In the case of an in-vehicle device, the communication unit shown in the embodiment has a partial configuration of each device.
It is desirable to assign ID numbers in the priority order of devices.

実施例1の通信方法を用いた通信システムの構成を示す図である。It is a figure which shows the structure of the communication system using the communication method of Example 1. FIG. 実施例1の通信方法で用いる通信データのフォーマットを示す説明図である。It is explanatory drawing which shows the format of the communication data used with the communication method of Example 1. FIG. 実施例1の通信方法を用いた通信システムの通信ユニットで実行される送信処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the transmission process performed with the communication unit of the communication system using the communication method of Example 1. FIG. 実施例1の通信方法を用いた通信システムの通信ユニットで実行される受信処理の流れを示すフローチャートである。3 is a flowchart illustrating a flow of reception processing executed by a communication unit of a communication system using the communication method of Embodiment 1. 実施例1の通信方法の通信手順を示す説明図である。6 is an explanatory diagram illustrating a communication procedure of a communication method according to the first embodiment. 実施例1の通信方法の通信タイミングを示すタイミングチャートである。3 is a timing chart illustrating communication timings of the communication method according to the first exemplary embodiment. 実施例1の通信方法の通信状態を示す説明図である。It is explanatory drawing which shows the communication state of the communication method of Example 1. FIG. マスター/スレーブ方式を用いた通信システムの構成を示す図である。It is a figure which shows the structure of the communication system using a master / slave system. マスター/スレーブ方式で用いる通信データのフォーマットを示す説明図である。It is explanatory drawing which shows the format of the communication data used with a master / slave system. マスター/スレーブ方式を用いた通信システムの通信ユニットで実行される送信処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the transmission process performed with the communication unit of the communication system using a master / slave system. マスター/スレーブ方式を用いた通信システムの通信ユニットで実行される受信処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the reception process performed with the communication unit of the communication system using a master / slave system. マスター/スレーブ方式の通信手順を示す説明図である。It is explanatory drawing which shows the communication procedure of a master / slave system. マスター/スレーブ方式の通信タイミングを示すタイミングチャートである。It is a timing chart which shows the communication timing of a master / slave system. マスター/スレーブ方式の通信状態を示す説明図である。It is explanatory drawing which shows the communication state of a master / slave system.

符号の説明Explanation of symbols

1 通信ユニット
2 通信ユニット
3 通信ユニット
11 CPU
21 CPU
31 CPU
12 送信回路
22 送信回路
32 送信回路
13 受信回路
23 受信回路
33 受信回路
5 通信線
6 通信フォーマット
61 通信フレーム
62 応答フレーム(ACK)
63 応答フレーム(NACK)
LENGTH データ長
S_ID 自局のIDナンバー
T_ID 相手局のIDナンバー
F/E_F ファースト/エンドフラグ
DATAn データ
SUM チェックサム
ACK 正常なデータ送信の完了を示すデータ
NACK データ送信の不完了を示すデータ
M マスターユニット
S1〜S4 スレーブユニット
Fm (マスターユニットの)通信フレーム
Fs (スレーブユニットの)通信フレーム
1 Communication unit 2 Communication unit 3 Communication unit 11 CPU
21 CPU
31 CPU
DESCRIPTION OF SYMBOLS 12 Transmission circuit 22 Transmission circuit 32 Transmission circuit 13 Reception circuit 23 Reception circuit 33 Reception circuit 5 Communication line 6 Communication format 61 Communication frame 62 Response frame (ACK)
63 Response frame (NACK)
LENGTH data length
S_ID ID number of your station
T_ID ID number of the partner station
F / E_F First / End flag
DATAn data
SUM Checksum
ACK Data indicating the completion of normal data transmission
NACK Data indicating incomplete data transmission M Master unit S1 to S4 Slave unit Fm (Master unit) communication frame Fs (Slave unit) communication frame

Claims (3)

複数の車載された通信ユニットをシリアル通信線によりバス型に接続して構成した車内ネットワークにおける通信方法において、
各通信ユニットに重複しないIDデータを割り当て、
前記各通信ユニットは前記IDデータ順にデータ送信の機会を得るようにし、
送信元の通信ユニットは、データ送信の開始と終了を示すフラグデータと、送信元のIDデータとを送信データに設けて送信先の通信ユニットへ送信し、
送信先の通信ユニットは、データ送信の開始と終了を示すフラグデータを受け取ると、フラグデータに対応する受け取り成立を示し、送信元のIDデータを含む応答データを送信元の通信ユニットへ送信し、
送信先の通信ユニットからデータ送信の終了を示すフラグデータに対応する応答データが送信されたことをIDデータ順の次の通信ユニットが検知して、次々に送受信を行う、
ことを特徴とする通信方法。
In a communication method in an in-vehicle network configured by connecting a plurality of vehicle-mounted communication units in a bus shape with a serial communication line,
Assign unique ID data to each communication unit,
Each communication unit gets an opportunity of data transmission in the order of the ID data,
The transmission source communication unit provides flag data indicating the start and end of data transmission and the transmission source ID data in the transmission data and transmits it to the transmission destination communication unit.
When receiving the flag data indicating the start and end of data transmission, the transmission destination communication unit indicates that the reception corresponding to the flag data is established, and transmits response data including the transmission source ID data to the transmission source communication unit.
The next communication unit in the ID data order detects that the response data corresponding to the flag data indicating the end of data transmission is transmitted from the destination communication unit, and performs transmission and reception one after another.
A communication method characterized by the above.
請求項1に記載された通信方法において、
送信元の通信ユニットが、
送信後の所定時間内に、送信先の通信ユニットからの前記応答データを受信しない場合に、送信エラーと判断し、
他の通信ユニットによる通信を開始させるため、送信元の通信ユニットがデータ送信の終了を示すフラグデータに対応する仮の応答データを送信する、
ことを特徴とする通信方法。
The communication method according to claim 1,
The source communication unit is
If the response data from the destination communication unit is not received within a predetermined time after transmission, it is determined as a transmission error,
In order to start communication by another communication unit, the transmission source communication unit transmits temporary response data corresponding to flag data indicating the end of data transmission.
A communication method characterized by the above.
請求項2に記載された通信方法において、
送信先の通信ユニットが、
データが不完全な受信となった場合に、送信元からのデータ送信の終了を示すフラグデータに対応し、且つ受信の不完了を示す応答データを送信し、
送信先の通信ユニットが、
送信先からの受信の不完了を示す応答データを受信すると、再送信を行う、
ことを特徴とする通信方法。
The communication method according to claim 2,
The destination communication unit is
When the data is incompletely received, it responds to flag data indicating the end of data transmission from the transmission source, and transmits response data indicating incomplete reception,
The destination communication unit is
When response data indicating incomplete reception from the destination is received, retransmission is performed.
A communication method characterized by the above.
JP2003430542A 2003-12-25 2003-12-25 Communication method Withdrawn JP2005191910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003430542A JP2005191910A (en) 2003-12-25 2003-12-25 Communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003430542A JP2005191910A (en) 2003-12-25 2003-12-25 Communication method

Publications (1)

Publication Number Publication Date
JP2005191910A true JP2005191910A (en) 2005-07-14

Family

ID=34788885

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003430542A Withdrawn JP2005191910A (en) 2003-12-25 2003-12-25 Communication method

Country Status (1)

Country Link
JP (1) JP2005191910A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10541830B2 (en) 2017-11-27 2020-01-21 Mitsubishi Electric Corporation Serial communication system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10541830B2 (en) 2017-11-27 2020-01-21 Mitsubishi Electric Corporation Serial communication system

Similar Documents

Publication Publication Date Title
WO2012020761A1 (en) Communication system and communication apparatus
US20060277339A1 (en) Communication apparatus, switching method, and switching program
US8780772B2 (en) Communication protocol for wireless enhanced controller area networks
WO2022017102A1 (en) Arbitration line-based full-duplex spi communication method
US7117283B2 (en) Multi-master extended I2C protocol
JP2009253382A (en) Terminal station, method, program, and system thereof
JP2009244991A (en) Data communication method, data communication system, electronic control unit, and circuit board
CN103650401A (en) Internal communication method for mobile terminal
CN1988537A (en) Data transmission protocol
JP4210993B2 (en) USB hub device, USB peripheral device and data transmission / reception method
JP2005191910A (en) Communication method
JP2003256033A (en) Vehicular communication system
JP2010141819A (en) Communication device, communication method, and communication program
JP4977943B2 (en) Communications system
JP2015149541A (en) communication system
JP2005346175A (en) Apparatus and method for command communication
JP7039959B2 (en) Communication systems, relay devices, and nodes
JP5338120B2 (en) Hub device and program
JP4069125B2 (en) Transmission method, transmission apparatus, and transmission / reception system
JP4087070B2 (en) Broadcast / ACK transmission method
JP4315096B2 (en) Network system
JP4257995B2 (en) Half-duplex communication control method
JP2007324943A (en) Retransmission system at communication trouble
JP3454264B2 (en) Wireless communication system and wireless communication method
KR100567033B1 (en) Method for operating synchronous serial communication in which master and slave are fixed

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20051115

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060324

A761 Written withdrawal of application

Effective date: 20070802

Free format text: JAPANESE INTERMEDIATE CODE: A761