JP2005191910A - Communication method - Google Patents
Communication method Download PDFInfo
- 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
Links
Images
Landscapes
- Small-Scale Networks (AREA)
Abstract
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参照。)。
しかしながら、従来の通信方法にあっては、マスターが必ずスレーブに呼びかけるため、マスターユニットの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
まず、構成を説明する。
図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
次に図2を参照して、実施例1の通信方法で用いる通信フォーマット6について説明する。
フレーム形式で表現するデータである通信フレーム61は、データ長を示すLENGTH、自局のIDナンバーを示すS_ID、相手局のIDナンバーを示すT_ID、データ送信の開始と終了を示すファースト/エンドフラグF/E_F、データDATAn(DATA1〜DATAn)、送信データと受信データの整合性を検証するためのチェックサムSUMで構成される。
Next, the
The
正常なデータ送信の完了を示すために送信される応答フレーム62は、正常なデータ送信の完了を示すACKと、相手局のIDナンバーを示すT_ID又は送信データの終了を示すエンドフラグE_Fで構成される。
また、データ送信の不完了を示すために送信される応答フレーム63は、データ送信の不完了を示すNACKと、相手局のIDナンバーを示すT_ID又は送信データの終了を示すエンドフラグE_Fで構成される。
The
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
ステップ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
ステップ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
ステップ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
ステップ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
ステップ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
ステップ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
ステップ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
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
つまり、通信線5へ送出された送信データは全てのユニットで受信し、該当するユニットのみがそのデータを採用すると共に、応答を返す(図7(a)参照)。
That is, the transmission data sent to the
通信ユニット3が送出したACKデータを含む応答フレーム62を通信ユニット2が受信すると、応答フレーム62に含まれるT_IDはID=1を示すため、自ユニットのID-1となり、このことをステップS33の処理で検知し、ステップS34の処理でタイマを始動させる。
T2=50msが経過したならば、ID=1の通信ユニット1の送信は完了したものとして、通信ユニット2が例えば通信ユニット1へ送信を行う。
When the
If T2 = 50 ms elapses, the
通信ユニット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
In this way, each communication unit performs transmission / reception in the order of ID while receiving a
When the communication between the
よって、エンドフラグにより通信の終了を確認した通信ユニット1は、図7(d)に示すように次の通信を行う。
例えば、通信ユニット2から通信ユニット3へのデータ送信において、受信側、この場合の通信ユニット3が受信した通信フレーム61のデータより演算で求めた所定の値が、受信した通信フレーム61のチェックサムと整合せず、正常なデータを受信できていないと判断する場合には、通信ユニット3から通信ユニット2へNACKデータを含む応答フレーム63を送信する(図7(e)参照)。
Therefore, the
For example, in data transmission from the
NACKデータを送信元である通信ユニット2が受信すると、通信ユニット2は、図7(f)に示すように同じ送信データを、ステップS23の処理により再送信する。
再送信が成立すると、通信ユニット3から通信ユニット2へACKデータを含む応答フレーム62が送信される(図7(f)参照)。
When the
When the retransmission is established, the
さらに、データ送信の再送時における処理について、図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
When normal communication is performed, transmission of the
〈1〉ACKデータが応答されない場合
通信ユニット1から他の通信ユニットへデータが送信され、その通信ユニットから応答フレームが送信されない場合、通信ユニット1は送信時にステップS15の処理によりタイマをカウントしているので、時間T1の経過により、データ通信が成立しなかったものと判断して、ステップS23の処理により再送信を行う(図6(b)参照)。
<1> When ACK data is not responded When data is transmitted from the
〈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
〈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
The communication unit of the next ID that has received the
〈4〉通信ユニット3が故障した場合
通信ユニット3が故障している場合には、通信ユニット2の通信が終了した後に、通信ユニット3からのACKデータを含む応答フレーム62が他のユニットで受信されない。この状態で時間T4が経過した際には、ステップS40の処理により、通信ユニット3の故障を検出したものとして通信権を通信ユニット4に渡す。
<4> When
次に、効果を説明する。
第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
(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 通信ユニット
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
21 CPU
31 CPU
DESCRIPTION OF
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.
送信元の通信ユニットが、
送信後の所定時間内に、送信先の通信ユニットからの前記応答データを受信しない場合に、送信エラーと判断し、
他の通信ユニットによる通信を開始させるため、送信元の通信ユニットがデータ送信の終了を示すフラグデータに対応する仮の応答データを送信する、
ことを特徴とする通信方法。 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.
送信先の通信ユニットが、
データが不完全な受信となった場合に、送信元からのデータ送信の終了を示すフラグデータに対応し、且つ受信の不完了を示す応答データを送信し、
送信先の通信ユニットが、
送信先からの受信の不完了を示す応答データを受信すると、再送信を行う、
ことを特徴とする通信方法。 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.
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10541830B2 (en) | 2017-11-27 | 2020-01-21 | Mitsubishi Electric Corporation | Serial communication system |
-
2003
- 2003-12-25 JP JP2003430542A patent/JP2005191910A/en not_active Withdrawn
Cited By (1)
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 |