JP5605338B2 - Communication device - Google Patents
Communication device Download PDFInfo
- Publication number
- JP5605338B2 JP5605338B2 JP2011193905A JP2011193905A JP5605338B2 JP 5605338 B2 JP5605338 B2 JP 5605338B2 JP 2011193905 A JP2011193905 A JP 2011193905A JP 2011193905 A JP2011193905 A JP 2011193905A JP 5605338 B2 JP5605338 B2 JP 5605338B2
- Authority
- JP
- Japan
- Prior art keywords
- mailbox
- message
- identification code
- transmission
- reception
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Small-Scale Networks (AREA)
Description
本発明は、メールボックスを用いて通信を行う通信装置に関する。 The present invention relates to a communication apparatus that performs communication using a mailbox.
車両においては、制御の高度化またはサービスの充実を図るために、電子制御装置(ECU)等の車載機器同士を通信バスで相互に接続してローカルエリアネットワーク(いわゆる車内LAN)を構成し、車載機器間で情報を共有することが行われている。 In vehicles, in order to enhance control or enhance services, in-vehicle devices such as electronic control units (ECUs) are connected to each other via a communication bus to form a local area network (so-called in-vehicle LAN). Information is shared between devices.
なお、車内LANの通信プロトコルとして、コントローラエリアネットワーク(CAN;Controller Area Network)が多く利用されている。
このCANプロトコルでは、送信メッセージをフレーム化して通信バスへ送信する前には、送信メッセージの種類を表す識別IDコード(以下、CANIDという)が設定された送信用メールボックスに送信メッセージを格納するとともに、通信バスを介してフレームを受信した場合には、フレームから抽出した受信メッセージを、この受信メッセージに付与されているCANIDと同一のCANIDが予め設定された受信用メールボックスに格納するように規定されている。
Note that a controller area network (CAN) is often used as a communication protocol for in-vehicle LAN.
In this CAN protocol, before a transmission message is framed and transmitted to a communication bus, the transmission message is stored in a transmission mailbox in which an identification ID code (hereinafter referred to as CANID) representing the type of the transmission message is set. Stipulates that when a frame is received via the communication bus, the received message extracted from the frame is stored in a receiving mailbox in which the same CANID as the CANID assigned to the received message is set in advance. Has been.
電子制御装置には、所定数(例えば32個)のメールボックスが予め設けられており、各メールボックスには、メールボックスを識別するためのボックス番号(例えば0〜31の整数値)が付与されている。そして、各メールボックスの設定は、電子制御装置が起動してCAN通信が開始される前のCAN初期化処理で行われる。 The electronic control device is provided with a predetermined number (for example, 32) of mailboxes in advance, and each mailbox is given a box number (for example, an integer value of 0 to 31) for identifying the mailbox. ing. Each mailbox is set in a CAN initialization process before the electronic control device is activated and CAN communication is started.
具体的には、まず、図10に示すように、CANID毎に、メールボックスの使用方法(送信用[Tx]/受信用[Rx])を示す送受信設定、およびメッセージのデータ長を示すDLC(Data Length Code)が記述されたメッセージ仕様MSに基づいて、設計者が、各メールボックスのボックス番号に対応するCANIDと送受信設定とDLCを設定し、メールボックス設定仕様MBSを作成している。このメールボックス設定仕様MBSは電子制御装置内に記憶されており、電子制御装置の起動毎に、メールボックス設定仕様MBSが読み出され、メールボックス設定仕様MBSの設定に従って、メールボックス毎にCANIDと送受信設定とDLCが設定される。したがって、電子制御装置の起動時にメールボックス設定が行われると、その後、メールボックス設定が変更されることはない。 Specifically, as shown in FIG. 10, first, for each CANID, a transmission / reception setting indicating a method of using a mailbox (transmission [Tx] / reception [Rx]), and a DLC ( Based on the message specification MS in which (Data Length Code) is described, the designer sets the CANID, transmission / reception setting, and DLC corresponding to the box number of each mailbox, and creates the mailbox setting specification MBS. This mailbox setting specification MBS is stored in the electronic control device, and the mailbox setting specification MBS is read every time the electronic control device is activated, and according to the setting of the mailbox setting specification MBS, CANID and Transmission / reception settings and DLC are set. Therefore, if the mailbox setting is performed when the electronic control device is activated, the mailbox setting is not changed thereafter.
ところで、メールボックスは、一般的にRAMで構成されており、ビット値を書き換えることができない異常であるビット固着が発生する可能性がある。
そして従来、メールボックスに所定のパターンを書き込んだ後に、書き込んだパターンを読み出し、書き込みパターンと読み出しパターンとが不一致である場合に、ビット固着が発生している旨を通知する技術が知られている(例えば、特許文献1を参照)。これにより、メールボックスの異常状態を検知することができるため、この異常状態に対応した制御(例えば、フェイルセーフ制御、あるいはメールボックスに格納されるメッセージに関連した制御の停止)を行うことが可能となり、メールボックスの異常による車両制御への影響を最低限に抑えることができる。
By the way, the mailbox is generally composed of a RAM, and there is a possibility that bit sticking, which is an abnormality in which the bit value cannot be rewritten, may occur.
Conventionally, a technique is known in which after a predetermined pattern is written in a mailbox, the written pattern is read, and when the write pattern does not match the read pattern, a notification that bit sticking has occurred is known. (For example, see Patent Document 1). As a result, the abnormal state of the mailbox can be detected, so that it is possible to perform control corresponding to the abnormal state (for example, fail-safe control or stop of control related to the message stored in the mailbox). Thus, the influence on the vehicle control due to the abnormality of the mailbox can be minimized.
しかしながら、上述のように、電子制御装置の起動時にメールボックス設定が行われた後ではメールボックス設定が変更されないために、特許文献1に記載のようにメールボックスの異常状態を検知することができても、異常なメールボックスに関連した制御の制限が継続してしまうという問題があった。 However, as described above, since the mailbox setting is not changed after the mailbox setting is performed at the time of starting the electronic control device, an abnormal state of the mailbox can be detected as described in Patent Document 1. However, there was a problem that the control restriction related to the abnormal mailbox continued.
本発明は、こうした問題に鑑みてなされたものであり、異常なメールボックスがメッセージ格納用に割り当てられるのを抑制する技術を提供することを目的とする。 The present invention has been made in view of these problems, and an object of the present invention is to provide a technique for suppressing an abnormal mailbox from being assigned for storing messages.
上記目的を達成するためになされた請求項1〜5に記載の発明は、メッセージと、メッセージの種別を示す識別コードとが少なくとも格納される複数の第1メールボックスと、第1メールボックスからメッセージと識別コードを抽出し、第1メールボックスから抽出したメッセージに、第1メールボックスから抽出した識別コードを付与したフレームを構成して通信バス上に送信するとともに、通信バスを介してフレームを受信した場合には、受信したフレームからメッセージと識別コードを抽出し、抽出した識別コードと一致する識別コードが格納されている第1メールボックスに、フレームから抽出したメッセージを格納する第1送受信手段とを備えた通信装置であって、異常判断手段が、複数の第1メールボックスのそれぞれについて異常が発生しているか否かを判断する。そして第1割当手段が、複数の第1メールボックスのうち、異常が発生していないと異常判断手段により判断された第1メールボックスについては、第1メールボックスに識別コードを格納することにより、第1メールボックスを、識別コードに対応するメッセージの格納用に割り当てるとともに、割当禁止手段が、複数の第1メールボックスのうち、異常が発生していると異常判断手段により判断された第1メールボックスについては、第1メールボックスへの識別コードの格納を禁止することにより、メッセージの格納用に割り当てることを禁止する。 In order to achieve the above object, the inventions according to claims 1 to 5 include a plurality of first mailboxes storing at least a message and an identification code indicating a message type, and messages from the first mailbox. And an identification code is extracted, and a frame with the identification code extracted from the first mailbox added to the message extracted from the first mailbox is transmitted to the communication bus and the frame is received via the communication bus. A first transmission / reception means for extracting the message and the identification code from the received frame, and storing the message extracted from the frame in the first mailbox storing the identification code that matches the extracted identification code; The abnormality determination means is configured for each of the plurality of first mailboxes. Normally it is determined whether or not occurring. The first assigning means stores an identification code in the first mailbox for the first mailbox determined by the abnormality determining means that no abnormality has occurred among the plurality of first mailboxes, The first mail is assigned for storing the message corresponding to the identification code, and the assignment prohibiting means determines that the abnormality determining means determines that an abnormality has occurred among the plurality of first mailboxes. The box is prohibited from being assigned for storing messages by prohibiting the storage of the identification code in the first mailbox.
このように構成された通信装置では、正常なメールボックスはメッセージの格納用に割り当てられる一方、異常なメールボックスはメッセージの格納用に割り当てられない。これにより、メールボックスの異常のために、この異常なメールボックスを割り当てられているメッセージの通信ができなくなるという状況の発生を抑制し、通信の信頼性を向上させることができる。 In the communication apparatus configured as described above, a normal mailbox is allocated for storing messages, while an abnormal mailbox is not allocated for storing messages. As a result, it is possible to suppress the occurrence of a situation in which communication of a message to which this abnormal mailbox is assigned cannot be performed due to an abnormality in the mailbox, thereby improving communication reliability.
また、請求項1,3に記載の通信装置では、複数のメッセージにはそれぞれ、優先度が予め設定されており、第1割当手段は、複数のメッセージのうち、優先度が高いメッセージから順に第1メールボックスを割り当てる。 Further, in the communication apparatus according to claim 1 and 3 are set respectively, the priority in advance for a plurality of messages, the first allocation unit, among the plurality of messages, the the high priority message in order assign a mailbox.
これにより、正常なメールボックスの数が複数のメッセージの数より少ない場合であっても、正常なメールボックスを、優先度が高いメッセージに優先的に割り当てることができる。このため、重要なメッセージの通信がメールボックスの異常のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 Thereby, even when the number of normal mailboxes is smaller than the number of the plurality of messages, the normal mailboxes can be preferentially assigned to messages having high priority. For this reason, it is possible to suppress the occurrence of a situation in which an important message cannot be communicated due to an abnormality in the mailbox, and the communication reliability can be further improved.
なお優先度は、メッセージのシステムへの影響度およびメッセージの通信周期等に基づいて決定するとよい。具体的には、請求項2に記載の通信装置が他の通信装置と通信バスを介してデータ通信可能に接続されることによりシステムを形成している場合において、メッセージの通信ができない場合におけるシステムに及ぼす影響が大きいほどそのメッセージの優先度を高くしたり、メッセージの通信周期が短いほどそのメッセージが重要であるという判断基準に基づいてメッセージの通信周期が短いほどそのメッセージの優先度を高くしたりする。
The priority may be determined based on the degree of influence of the message on the system, the communication cycle of the message, and the like. Specifically, when the communication apparatus according to
ところで、CAN(Controller Area Network)プロトコルでは、上述の識別コードを用いて、どのフレームを優先的に処理するかを決定する調停制御を、ビット単位非破壊アービトレーションと呼ばれる手法により実行するようにされている。 By the way, in the CAN (Controller Area Network) protocol, arbitration control for determining which frame is preferentially processed using the above-described identification code is executed by a technique called bit-unit non-destructive arbitration. Yes.
すなわち、通信バス上の信号レベルには、ドミナント(優性)とリセッシブ(劣性)とがあり、複数の通信装置から、ドミナントとリセッシブとが同時に送信された場合に、バスの信号レベルはドミナントとなる。一般的に、ドミナントの理論値を0、リセッシブの論理値を1として考える。 That is, there are dominant (dominant) and recessive (inferior) signal levels on the communication bus. When a dominant and recessive signal is transmitted simultaneously from a plurality of communication devices, the bus signal level becomes dominant. . In general, it is assumed that the theoretical value of dominant is 0 and the logical value of recessive is 1.
つまり、CANプロトコルを用いた通信システムでは、同時に複数のフレームが通信バス上に送信された場合、識別コードの論理値が最も小さいフレームを送信した通信装置が送信権を得る。そして、通常、優先度が高いフレームほど、他のフレームとの衝突が生じても優先して伝送されるように、論理値が小さい識別コードが割り当てられている。 That is, in a communication system using the CAN protocol, when a plurality of frames are transmitted simultaneously on the communication bus, the communication apparatus that has transmitted the frame having the smallest identification code logical value obtains the transmission right. In general, an identification code having a smaller logical value is assigned so that a higher priority frame is transmitted with higher priority even if a collision with another frame occurs.
そこで、請求項2,4に記載の通信装置において、第1送受信手段がCAN(Controller Area Network)プロトコルに従って送受信を行う場合には、第1割当手段は、複数の識別コードのうち、識別コードの値が小さい順に第1メールボックスに格納することにより、第1メールボックスを割り当てる。
Therefore, in the communication device according to
これにより、正常なメールボックスの数が複数のメッセージの数より少ない場合であっても、正常なメールボックスを、識別コードの値が小さい識別コードに対応したメッセージに優先的に割り当てることができる。これにより、重要なメッセージの通信がメールボックスの異常のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 Thereby, even when the number of normal mailboxes is smaller than the number of a plurality of messages, normal mailboxes can be preferentially assigned to messages corresponding to identification codes having a small identification code value. As a result, it is possible to suppress the occurrence of a situation in which an important message cannot be communicated due to an abnormality in the mailbox, and to further improve the reliability of communication.
また、請求項1または請求項2に記載の通信装置において、第1メールボックスは、第1割当手段によって、第1送受信手段が送信するメッセージである送信用メッセージを格納する送信用第1メールボックス、および、第1送受信手段が受信するメッセージである受信用メッセージを格納する受信用第1メールボックスの何れかに割り当てられ、送信共有設定手段が、第1割当手段による第1メールボックスの割り当てが行われた結果、第1メールボックスに割り当てられなかった送信用メッセージである未割当送信用メッセージが存在する場合には、第1割当手段によって送信用第1メールボックスとして割り当てられた第1メールボックスの中から、予め設定された送信ボックス選択条件を満たす第1メールボックスを選択し、選択された送信用第1メールボックスについて、既に割り当てられている送信用メッセージの他に未割当送信用メッセージを格納できるように設定する。
Moreover, Te communication device smell of claim 1 or
これにより、1つのメールボックスを複数のメッセージの格納用として共有することができる。このため、正常なメールボックスの数が複数のメッセージの数より少ない場合であっても、メッセージの通信がメールボックス不足のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 Thus, one mailbox can be shared for storing a plurality of messages. For this reason, even when the number of normal mailboxes is less than the number of multiple messages, the occurrence of a situation in which message communication cannot be performed due to insufficient mailboxes is suppressed, and communication reliability is further improved. Can be made.
また、請求項1,2に記載の通信装置において、請求項6に記載のように、送信ボックス選択条件は、第1割当手段により割り当てられた第1メールボックスのうち、第1割当手段により最も遅く割り当てられた送信用第1メールボックスであることであるようにするとよい。
Further, in the communication device according to any one of
これにより、識別コードが格納されているメールボックスの中で最も優先度が低い識別コードが格納されているメールボックスを、未割当送信用メッセージと共有してメッセージを格納するためのメールボックスとすることができる。すなわち、優先度が高いメッセージを格納するためのメールボックスが、未割当送信用メッセージと共有してメッセージを格納するためのメールボックスとして設定されるという状況の発生を抑制することができる。このため、メールボックスの共有設定に起因した異常により重要なメッセージの通信ができなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 As a result, the mailbox storing the identification code with the lowest priority among the mailboxes storing the identification code is used as a mailbox for storing the message by sharing it with the unallocated transmission message. be able to. That is, it is possible to suppress the occurrence of a situation in which a mailbox for storing a message having a high priority is set as a mailbox for storing a message in common with an unassigned transmission message. For this reason, it is possible to suppress the occurrence of a situation in which an important message cannot be communicated due to an abnormality caused by the mailbox sharing setting, and to further improve the reliability of communication.
また、請求項3,4に記載の通信装置では、第1メールボックスは、第1割当手段によって、第1送受信手段が送信するメッセージである送信用メッセージを格納する送信用第1メールボックス、および、第1送受信手段が受信するメッセージである受信用メッセージを格納する受信用第1メールボックスの何れかに割り当てられ、受信共有設定手段が、第1割当手段による第1メールボックスの割り当てが行われた結果、第1メールボックスに割り当てられなかった受信用メッセージである未割当受信用メッセージが存在する場合には、第1割当手段によって受信用第1メールボックスとして割り当てられた第1メールボックスの中から、予め設定された受信ボックス選択条件を満たす第1メールボックスを選択し、選択された受信用第1メールボックスについて、既に割り当てられている受信用メッセージの他に未割当受信用メッセージを格納できるように設定する。
Further, in the communication apparatus according to
これにより、1つのメールボックスを複数のメッセージの格納用として共有することができる。このため、正常なメールボックスの数が複数のメッセージの数より少ない場合であっても、メッセージの通信がメールボックス不足のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 Thus, one mailbox can be shared for storing a plurality of messages. For this reason, even when the number of normal mailboxes is less than the number of multiple messages, the occurrence of a situation in which message communication cannot be performed due to insufficient mailboxes is suppressed, and communication reliability is further improved. Can be made.
また、請求項3,4に記載の通信装置において、請求項7に記載のように、受信ボックス選択条件は、第1割当手段により割り当てられた第1メールボックスのうち、第1割当手段により最も遅く割り当てられた受信用第1メールボックスであることであるようにするとよい。
Further, in the communication device according to
これにより、識別コードが格納されているメールボックスの中で最も優先度が低い識別コードが格納されているメールボックスを、未割当受信用メッセージと共有してメッセージを格納するためのメールボックスとすることができる。すなわち、優先度が高いメッセージを格納するためのメールボックスが、未割当受信用メッセージと共有してメッセージを格納するためのメールボックスとして設定されるという状況の発生を抑制することができる。このため、メールボックスの共有設定に起因した異常により重要なメッセージの通信ができなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 As a result, the mailbox storing the identification code with the lowest priority among the mailboxes storing the identification code is used as a mailbox for storing the message by sharing it with the unallocated reception message. be able to. That is, it is possible to suppress the occurrence of a situation in which a mailbox for storing a message having a high priority is set as a mailbox for storing a message in common with an unallocated reception message. For this reason, it is possible to suppress the occurrence of a situation in which an important message cannot be communicated due to an abnormality caused by the mailbox sharing setting, and to further improve the reliability of communication.
また、請求項5に記載の通信装置では、メッセージと、メッセージの種別を示す識別コードとが少なくとも格納される複数の第2メールボックスと、第2メールボックスからメッセージと識別コードを抽出し、メールボックスから抽出したメッセージに、第2メールボックスから抽出した識別コードを付与したフレームを構成して通信バス上に送信するとともに、通信バスを介してフレームを受信した場合には、受信したフレームからメッセージと識別コードを抽出し、抽出した識別コードと一致する識別コードが格納されている第2メールボックスに、フレームから抽出したメッセージを格納する第2送受信手段とを備えている場合には、請求項8に記載のように、第2送受信使用判断手段が、第1割当手段によるメールボックスの割り当てが行われた結果、メールボックスに割り当てられなかったメッセージである未割当メッセージが存在する場合に、第2送受信手段が使用中であるか否かを判断し、第2割当手段が、第2送受信手段が使用中でないと第2送受信使用判断手段により判断された場合に、第2メールボックスについて、第2メールボックスに未割当メッセージの識別コードを格納することにより、識別コードが格納された第2メールボックスを未割当メッセージの格納用に割り当てる。 Further, in the communication apparatus according to claim 5, extracted and the message, and a plurality of second mailbox identification code indicating the type of message is at least stored, the message identification code from the second mailbox, e-mail When the message extracted from the box is added with the identification code extracted from the second mailbox and transmitted to the communication bus, and the frame is received via the communication bus, the message is received from the received frame. And a second transmission / reception means for storing the message extracted from the frame in the second mailbox storing the identification code that matches the extracted identification code. As described in FIG. 8, the second transmission / reception usage determining means assigns the mailbox by the first assigning means. As a result, when there is an unassigned message that is a message that has not been assigned to the mailbox, it is determined whether or not the second sending / receiving means is in use, and the second assigning means When it is determined by the second transmission / reception use determining means that the means is not in use, the identification code of the unallocated message is stored in the second mailbox with respect to the second mailbox. assign a mail box for storage of unallocated message.
これにより、第1送受信手段が送受信するメッセージを格納するために第2メールボックスを用いることができる。このため、正常な第1メールボックスの数が複数のメッセージの数より少ない場合であっても、メッセージの通信がメールボックス不足のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 Thereby, the second mailbox can be used to store messages transmitted and received by the first transmitting / receiving means. For this reason, even when the number of normal first mailboxes is smaller than the number of multiple messages, the occurrence of a situation where message communication becomes impossible due to a shortage of mailboxes is suppressed, and communication reliability is improved. Further improvement can be achieved.
(第1実施形態)
以下に本発明の第1実施形態を図面とともに説明する。
図1は、本発明が適用された電子制御装置1の構成を示すブロック図である。
(First embodiment)
A first embodiment of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of an electronic control device 1 to which the present invention is applied.
電子制御装置(以下、ECUという)1は、CAN(Controller Area Network)プロトコルを用いた車内LANに接続され、車両に搭載された他のECUとの間でデータ通信可能に構成されている。 An electronic control unit (hereinafter referred to as ECU) 1 is connected to an in-vehicle LAN using a CAN (Controller Area Network) protocol, and is configured to be capable of data communication with other ECUs mounted on the vehicle.
そしてECU1は、図1に示すように、CANプロトコルに従って他のECUとの通信を制御するCANコントローラ2と、CANコントローラ2とCANバスBS1との間でデータを送受信するためのCANトランシーバ3と、CANコントローラ2を介して他のECUとの間でメッセージを交換することにより、他のECUと連携して各種処理を実行する制御部4とを備えている。
As shown in FIG. 1, the ECU 1 includes a
CANトランシーバ3は、予め規定されたCANバスの電気的条件を満たす信号を確実に送受信するように構成されている。
CANコントローラ2は、ECU間で送受信されるメッセージ等を格納するためのメールボックスMBを複数(本実施形態で32個)備えたデータ格納部21と、メールボックスMBの格納値に基づいてメッセージをフレーム化し、CANトランシーバ3を介してCANバスBS1に送信する送信制御、CANトランシーバ3を介してフレームを受信してメッセージの抽出等を行う受信制御、バス上でフレームが衝突した際のバス権の調停制御等、CANプロトコルに従った通信制御を実行するプロトコルコア部22と、プロトコルコア部22の送信制御および受信制御時に、データ格納部21へのアクセスを制御するアクセス制御部23とを備えている。
The CAN transceiver 3 is configured to reliably transmit and receive signals that satisfy the electrical condition of the CAN bus defined in advance.
The
なお、データ格納部21に設けられたメールボックスMBのそれぞれには、メールボックスを識別するためのボックス番号(本実施形態では0〜31の整数値)が付与されている。
Each mailbox MB provided in the
また各メールボックスMBには、メッセージの種類および優先度を表す識別コード(以下、CANIDという)を格納するためのCANIDレジスタR1、フレームに載せて送信するメッセージまたは受信フレームから抽出したメッセージを格納するためのメッセージレジスタR2、メールボックスの使用方法(送信用/受信用)を示す送受信設定情報を格納するための送受信設定レジスタR3、メッセージのデータ長を示すDLC(Data Length Code)を格納するためのDLCレジスタR4が設けられている。 Each mailbox MB stores a CANID register R1 for storing an identification code (hereinafter referred to as CANID) indicating a message type and priority, a message transmitted on a frame, or a message extracted from a received frame. Message register R2 for storing, transmission / reception setting register R3 for storing transmission / reception setting information indicating how to use the mailbox (for transmission / reception), and DLC (Data Length Code) indicating the data length of the message A DLC register R4 is provided.
また制御部4は、CPU41、ROM42、およびRAM43を備え、ROM42が記憶するプログラムに基づく処理をCPU41が実行することにより、各種処理を実行する。例えば、他のECUに対して送信すべきメッセージがある場合、メッセージの内容からそのメッセージに対応するCANIDを特定し、特定したCANIDが設定されているメールボックスMBのメッセージレジスタR2にメッセージを格納する。
The
また制御部4は、CANコントローラ2からフレームを受信した旨の通知を受けた場合に、送受信設定レジスタR3が受信用に設定されているメールボックスMBのメッセージレジスタR2の内容を読み出すことにより、他のECUからのメッセージを受信する。
When the
さらに、制御部4のROM42には、各メールボックスMBのボックス番号に対応するCANIDと送受信設定情報とDLCが設定されたメールボックス設定仕様MBS(図10を参照)が記憶されている。
Further, the
まず、制御部4が実行するCAN初期化処理の手順を図2を用いて説明する。図2はCAN初期化処理を示すフローチャートである。このCAN初期化処理は、ECU1が起動した直後に1回のみ実行される処理である。
First, the procedure of the CAN initialization process executed by the
このCAN初期化処理が実行されると、制御部4のCPU41は、まずS10にて、メールボックスMBのビット固着を検査するビット固着検査処理(詳細は後述)を実行する。その後S20にて、CANコントローラ2の各種設定を行うためのコントロールレジスタ設定を実行する。
When this CAN initialization process is executed, the
次にS30にて、メールボックスMBのレジスタ設定を行うメールボックス設定処理(詳細は後述)を実行し、さらにS40にて、CANコントローラ2の通信速度の設定を行い、CAN初期化処理を終了する。そして、このCAN初期化処理の終了後にCAN通信が開始される。
Next, in S30, a mailbox setting process (details will be described later) for register setting of the mailbox MB is executed, and in S40, the communication speed of the
次に、S10で実行されるビット固着検査処理の手順を図3を用いて説明する。図3はビット固着検査処理を示すフローチャートである。
ビット固着検査処理が実行されると、制御部4のCPU41は、まずS110にて、ビット固着検査が行われていないメールボックスMB(以下、未検査メールボックスMBともいう)が存在するか否かを判断する。ここで、未検査メールボックスMBが存在する場合には(S110:YES)、S120にて、未検査メールボックスMBの中から1つのメールボックスMBを選択する。
Next, the procedure of the bit sticking inspection process executed in S10 will be described with reference to FIG. FIG. 3 is a flowchart showing the bit sticking inspection process.
When the bit sticking inspection process is executed, the
そしてS130にて、S120で選択したメールボックスMBについて、そのメッセージレジスタR2に検査用データを書き込み、さらにS140にて、検査用データを書き込んだメールボックスMBのメッセージレジスタR2からデータを読み出し、読み出したデータと検査用データと照合する。 In S130, for the mailbox MB selected in S120, the test data is written in the message register R2, and in S140, the data is read out and read from the message register R2 of the mailbox MB in which the test data is written. Check data against test data.
その後S150にて、S120で選択したメールボックスMBについて、そのCANIDレジスタR1に検査用データを書き込み、さらにS160にて、検査用データを書き込んだメールボックスMBのCANIDレジスタR1からデータを読み出し、読み出したデータと検査用データと照合する。 Thereafter, in S150, for the mailbox MB selected in S120, the inspection data is written into the CANID register R1, and in S160, the data is read out and read from the CANID register R1 of the mailbox MB in which the inspection data is written. Check data against test data.
さらにS170にて、S120で選択したメールボックスMBについて、そのDLCレジスタR4に検査用データを書き込み、さらにS180にて、検査用データを書き込んだメールボックスMBのDLCレジスタR4からデータを読み出し、読み出したデータと検査用データと照合する。 Further, in S170, for the mailbox MB selected in S120, the inspection data is written in the DLC register R4, and in S180, the data is read out from the DLC register R4 of the mailbox MB in which the inspection data is written. Check data against test data.
そしてS190にて、S140,S160,S180での照合結果(以下、ビット固着検査照合結果という)をRAM43に記憶した後にS110に移行する。一方、S110にて、未検査メールボックスMBが存在しない場合、すなわち全てのメールボックスMBで固着検査が行われた場合には(S110:NO)、ビット固着検査処理を終了する。
In S190, the collation results in S140, S160, and S180 (hereinafter referred to as bit sticking inspection collation results) are stored in the
次に、S30で実行されるメールボックス設定処理の手順を図4を用いて説明する。図4はメールボックス設定処理を示すフローチャートである。
メールボックス設定処理が実行されると、制御部4のCPU41は、まずS210にて、メールボックスMBのボックス番号を指示するボックス番号カウンタC1の値を0にセットする。次にS220にて、ROM42に記憶されているメールボックス設定仕様MBSの中でメールボックスの設定が行われていないメッセージ(以下、未設定メッセージという)が存在するか否かを判断する。ここで、未設定メッセージが存在しない場合(S220:NO)、すなわち、メールボックス設定仕様MBSに記載されている全てのメッセージについてメールボックスMBの設定が実施された場合には、メールボックス設定処理を終了する。一方、未設定メッセージが存在する場合には(S220:YES)、S230にて、メールボックス設定仕様MBSに記載されている未設定メッセージの中で、メールボックスMBのボックス番号が最も小さい未設定メッセージを選択する。
Next, the procedure of the mailbox setting process executed in S30 will be described with reference to FIG. FIG. 4 is a flowchart showing the mailbox setting process.
When the mailbox setting process is executed, the
そしてS240にて、ボックス番号カウンタC1が指示するボックス番号を有するメールボックスMB(以下、カウンタ指示メールボックスMBという)が正常であるか否かを、RAM43に記憶されたビット固着検査照合結果に基づいて判断する。ここで、カウンタ指示メールボックスMBが正常である場合には(S240:YES)、S250にて、メールボックス設定仕様MBSに基づいて、カウンタ指示メールボックスMBの送受信設定レジスタR3に「送信用」または「受信用」を設定する。
Then, in S240, whether or not the mailbox MB having the box number indicated by the box number counter C1 (hereinafter referred to as counter-indicating mailbox MB) is normal is determined based on the bit sticking inspection collation result stored in the
その後S260にて、カウンタ指示メールボックスMBの送受信設定レジスタR3が「受信用」に設定されているか否かを判断する。ここで、「受信用」に設定されている場合には(S260:YES)、S270にて、メールボックス設定仕様MBSに基づいて、カウンタ指示メールボックスMBのCANIDレジスタR1にCANIDを設定し、さらにS280にて、CANIDレジスタR1に設定されているCANIDを有するメッセージのみを格納可能となるようにIDフィルタ設定を実施する。そしてS290にて、ボックス番号カウンタC1をインクリメント(1加算)して、S220に移行して、上述の処理を繰り返す。 Thereafter, in S260, it is determined whether or not the transmission / reception setting register R3 of the counter instruction mailbox MB is set to “for reception”. If “for receiving” is set (S260: YES), CANID is set in CANID register R1 of counter instruction mailbox MB based on mailbox setting specification MBS in S270. In S280, ID filter setting is performed so that only messages having the CANID set in the CANID register R1 can be stored. In step S290, the box number counter C1 is incremented (added by 1), the process proceeds to step S220, and the above-described processing is repeated.
一方、「受信用」に設定されていない場合には(S260:NO)、「送信用」に設定されていると判断して、S300にて、メールボックス設定仕様MBSに基づいて、カウンタ指示メールボックスMBのCANIDレジスタR1にCANIDを設定する。そしてS290にて、ボックス番号カウンタC1をインクリメント(1加算)して、S220に移行して、上述の処理を繰り返す。 On the other hand, if it is not set to “for receiving” (S260: NO), it is determined that it is set to “for sending”, and the counter instruction mail is determined based on the mailbox setting specification MBS at S300. CANID is set in the CANID register R1 of the box MB. In step S290, the box number counter C1 is incremented (added by 1), the process proceeds to step S220, and the above-described processing is repeated.
また、S240にて、選択されたメールボックスMBがビット固着による異常である場合には(S240:NO)、S310にて、レジスタ設定が行われていないメールボックスMB(以下、未設定メールボックスMBともいう)が存在するか否かを判断する。具体的には、ボックス番号カウンタC1の値が31未満である場合に、未設定メールボックスMBが存在すると判断する。 In S240, if the selected mailbox MB is abnormal due to bit sticking (S240: NO), in S310, the mailbox MB for which no register setting has been performed (hereinafter, unset mailbox MB). It is also determined whether or not there exists. Specifically, when the value of the box number counter C1 is less than 31, it is determined that an unset mailbox MB exists.
ここで、未設定メールボックスMBが存在しない場合には(S310:NO)、メールボックス設定処理を終了する。一方、未設定メールボックスMBが存在する場合には(S310:YES)、S320にて、ボックス番号カウンタC1をインクリメント(1加算)して、S240に移行して、上述の処理を繰り返す。 If no unset mailbox MB exists (S310: NO), the mailbox setting process is terminated. On the other hand, when there is an unset mailbox MB (S310: YES), the box number counter C1 is incremented (added by 1) in S320, the process proceeds to S240, and the above processing is repeated.
このように構成された電子制御装置1では、メッセージと、メッセージの種別を示すCANIDとが少なくとも格納される複数のメールボックスMBと、メールボックスMBからメッセージとCANIDを抽出し、メールボックスMBから抽出したメッセージに、メールボックスMBから抽出したCANIDを付与したフレームを構成してCANバスBS1上に送信するとともに、CANバスBS1を介してフレームを受信した場合には、受信したフレームからメッセージとCANIDを抽出し、抽出したCANIDと一致するCANIDが格納されているメールボックスMBに、フレームから抽出したメッセージを格納するCANコントローラ2とを備え、複数のメールボックスMBのそれぞれについてビット固着が発生しているか否かを判断する(S10)。そして、複数のメールボックスMBのうち、ビット固着が発生していないと判断されたメールボックスMBについては(S240:YES)、メールボックスMBにCANIDを格納することにより、このメールボックスMBを、CANIDに対応するメッセージの格納用に割り当てるとともに(S250〜S300)、ビット固着が発生していると判断されたメールボックスMBについては(S240:NO)、メールボックスMBへのCANIDの格納を禁止することにより、メッセージの格納用に割り当てることを禁止する。
In the electronic control device 1 configured as described above, a plurality of mailboxes MB storing at least a message and a CANID indicating the type of message, a message and a CANID are extracted from the mailbox MB, and extracted from the mailbox MB. When a frame with a CANID extracted from the mailbox MB is added to the received message and transmitted to the CAN bus BS1, and the frame is received via the CAN bus BS1, the message and the CANID are received from the received frame. Whether the mailbox MB storing the CANID that is extracted and storing the CANID that matches the extracted CANID is provided with the
したがって、正常なメールボックスMBはメッセージの格納用に割り当てられる一方、異常なメールボックスMBはメッセージの格納用に割り当てられない。これにより、メールボックスMBの異常のために、この異常なメールボックスMBを割り当てられているメッセージの通信ができなくなるという状況の発生を抑制し、通信の信頼性を向上させることができる。 Thus, a normal mailbox MB is allocated for message storage, while an abnormal mailbox MB is not allocated for message storage. Accordingly, it is possible to suppress the occurrence of a situation in which communication of a message to which the abnormal mailbox MB is assigned cannot be performed due to an abnormality in the mailbox MB, and it is possible to improve communication reliability.
なお従来は、図5に示すように、メールボックス設定処理を実行していた。図5は、従来のメールボックス設定処理を示すフローチャートである。
従来のメールボックス設定処理が実行されると、図5に示すように、まずS1010にて、ボックス番号カウンタC1の値を0にセットする。次にS1020にて、未設定メッセージが存在するか否かを判断する。ここで、未設定メッセージが存在しない場合には(S1020:NO)、メールボックス設定処理を終了する。一方、未設定メッセージが存在する場合には(S1020:YES)、S1030にて、メールボックス設定仕様MBSに記載されている未設定メッセージの中で、メールボックスMBのボックス番号が最も小さい未設定メッセージを選択する。
Conventionally, as shown in FIG. 5, a mailbox setting process has been executed. FIG. 5 is a flowchart showing a conventional mailbox setting process.
When the conventional mailbox setting process is executed, the value of the box number counter C1 is first set to 0 in S1010 as shown in FIG. In step S1020, it is determined whether there is an unset message. If no unset message exists (S1020: NO), the mailbox setting process is terminated. On the other hand, if there is an unset message (S1020: YES), in S1030, the unset message with the smallest box number of the mailbox MB among the unset messages described in the mailbox setting specification MBS. Select.
そしてS1040にて、メールボックス設定仕様MBSに基づいて、ボックス番号カウンタC1が指示するボックス番号を有するメールボックスMB(カウンタ指示メールボックスMB)の送受信設定レジスタR3に「送信用」または「受信用」を設定する。 In S1040, based on the mailbox setting specification MBS, the transmission / reception setting register R3 of the mailbox MB (counter instruction mailbox MB) having the box number indicated by the box number counter C1 is set to “for transmission” or “for reception”. Set.
その後S1050にて、カウンタ指示メールボックスMBの送受信設定レジスタR3が「受信用」に設定されているか否かを判断する。ここで、「受信用」に設定されている場合には(S1050:YES)、S1060にて、メールボックス設定仕様MBSに基づいて、カウンタ指示メールボックスMBのCANIDレジスタR1にCANIDを設定し、さらにS1070にて、CANIDレジスタR1に設定されているCANIDを有するメッセージのみを格納可能となるようにIDフィルタ設定を実施する。そしてS1080にて、ボックス番号カウンタC1をインクリメント(1加算)して、S1020に移行して、上述の処理を繰り返す。 Thereafter, in S1050, it is determined whether or not the transmission / reception setting register R3 of the counter instruction mailbox MB is set to “for reception”. If “for receiving” is set (S1050: YES), CANID is set in CANID register R1 of counter instruction mailbox MB based on mailbox setting specification MBS in S1060. In S1070, ID filter setting is performed so that only messages having CANID set in CANID register R1 can be stored. In S1080, the box number counter C1 is incremented (added by 1), and the process proceeds to S1020 to repeat the above processing.
一方、「受信用」に設定されていない場合には(S1050:NO)、S1090にて、メールボックス設定仕様MBSに基づいて、カウンタ指示メールボックスMBのCANIDレジスタR1にCANIDを設定する。そしてS1080にて、ボックス番号カウンタC1をインクリメント(1加算)して、S1020に移行して、上述の処理を繰り返す。 On the other hand, if “for receiving” is not set (S1050: NO), CANID is set in CANID register R1 of counter instruction mailbox MB based on mailbox setting specification MBS in S1090. In S1080, the box number counter C1 is incremented (added by 1), and the process proceeds to S1020 to repeat the above processing.
すなわち、従来のメールボックス設定処理では、メールボックスMBにビット固着が発生しているか否かに関わらず、メールボックス設定仕様MBSの設定に従って、メールボックス毎に設定を行う。例えば、ボックス番号が5であるメールボックス(以下、メールボックスMB05という)に関するCANIDと送受信設定情報とDLCがメールボックス設定仕様MBSに記載されていた場合には、メールボックスMB05にビット固着が発生していたとしても、メールボックス設定仕様MBSの記載に基づいて、メールボックスMB05に関するCANIDと送受信設定情報とDLCがメールボックスMB05に設定される。 That is, in the conventional mailbox setting process, the setting is performed for each mailbox according to the setting of the mailbox setting specification MBS regardless of whether or not the bit lock has occurred in the mailbox MB. For example, when CANID, transmission / reception setting information, and DLC related to a mailbox with a box number 5 (hereinafter referred to as mailbox MB05) are described in the mailbox setting specification MBS, bit sticking occurs in the mailbox MB05. Even so, based on the description of the mailbox setting specification MBS, the CANID, transmission / reception setting information, and DLC regarding the mailbox MB05 are set in the mailbox MB05.
以上説明した実施形態において、電子制御装置1は本発明における通信装置、CANコントローラ2のメールボックスMBは本発明における第1メールボックス、CANIDは本発明における識別コード、CANコントローラ2は本発明における第1送受信手段、S10の処理は本発明における異常判断手段、S250〜S300の処理は本発明における第1割当手段、S240における判断がNOである場合の分岐は本発明における割当禁止手段である。
In the embodiment described above, the electronic control device 1 is the communication device in the present invention, the mailbox MB of the
(第2実施形態)
以下に本発明の第2実施形態を図面とともに説明する。なお、第2実施形態では、第1実施形態と異なる部分のみを説明する。
(Second Embodiment)
A second embodiment of the present invention will be described below with reference to the drawings. In the second embodiment, only parts different from the first embodiment will be described.
第2実施形態における電子制御装置(ECU)1は、メールボックス設定処理が変更された点以外は第1実施形態と同じである。
第2実施形態のメールボックス設定処理は、S230の処理が変更された点以外は第1実施形態と同じである。
The electronic control unit (ECU) 1 in the second embodiment is the same as that in the first embodiment except that the mailbox setting process is changed.
The mailbox setting process of the second embodiment is the same as that of the first embodiment except that the process of S230 is changed.
すなわち、メールボックス設定仕様MBSに記載されている未設定メッセージの中で、CANIDが最も小さい未設定メッセージを選択する。
なお、CAN(Controller Area Network)プロトコルでは、CANIDを用いて、どのフレームを優先的に処理するかを決定する調停制御を、ビット単位非破壊アービトレーションと呼ばれる手法により実行するようにされている。
That is, the unset message with the smallest CANID is selected from the unset messages described in the mailbox setting specification MBS.
In the CAN (Controller Area Network) protocol, arbitration control for determining which frame is preferentially processed using CANID is performed by a technique called bit-unit non-destructive arbitration.
すなわち、通信バス上の信号レベルには、ドミナント(優性)とリセッシブ(劣性)とがあり、複数のECUから、ドミナントとリセッシブとが同時に送信された場合に、バスの信号レベルはドミナントとなる。一般的に、ドミナントの理論値を0、リセッシブの論理値を1として考える。 That is, the signal level on the communication bus includes a dominant (dominant) and a recessive (inferior), and when a dominant and a recessive are simultaneously transmitted from a plurality of ECUs, the signal level on the bus becomes a dominant. In general, it is assumed that the theoretical value of dominant is 0 and the logical value of recessive is 1.
つまり、CANプロトコルを用いた通信システムでは、同時に複数のフレームが通信バス上に送信された場合、識別コードの論理値が最も小さいフレームを送信したECUが送信権を得る。そして、通常、優先度が高いフレームほど、他のフレームとの衝突が生じても優先して伝送されるように、論理値が小さいCANIDが割り当てられている。 That is, in a communication system using the CAN protocol, when a plurality of frames are transmitted simultaneously on the communication bus, the ECU that has transmitted the frame with the smallest logical value of the identification code obtains the transmission right. In general, a CANID having a smaller logical value is assigned so that a higher priority frame is preferentially transmitted even if a collision with another frame occurs.
つまり、第2実施形態の電子制御装置(ECU)1では、優先度が高いCANIDに対応するメッセージから順にメールボックスMBが割り当てられる。これにより、正常なメールボックスMBの数が、メールボックス設定仕様MBSで設定されているメッセージの数より少ない場合であっても、重要なメッセージの通信がメールボックスMBの異常のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 That is, in the electronic control unit (ECU) 1 of the second embodiment, the mailboxes MB are assigned in order from the message corresponding to the CANID having the higher priority. As a result, even if the number of normal mailboxes MB is smaller than the number of messages set in the mailbox setting specification MBS, communication of important messages cannot be performed due to an abnormality in the mailbox MB. It is possible to suppress the occurrence of the situation and further improve the reliability of communication.
(第3実施形態)
以下に本発明の第3実施形態を図面とともに説明する。なお、第3実施形態では、第2実施形態と異なる部分のみを説明する。
(Third embodiment)
A third embodiment of the present invention will be described below with reference to the drawings. In the third embodiment, only parts different from the second embodiment will be described.
第3実施形態における電子制御装置1は、メールボックス設定処理が変更された点以外は第2実施形態と同じである。図6は、第3実施形態のメールボックス設定処理を示すフローチャートである。 The electronic control device 1 according to the third embodiment is the same as the second embodiment except that the mailbox setting process is changed. FIG. 6 is a flowchart showing a mailbox setting process according to the third embodiment.
図6に示すように、第3実施形態のメールボックス設定処理は、S410〜S440の処理が追加された点以外は第2実施形態と同じである。
すなわち、S310にて、未設定メールボックスMBが存在しない場合には(S310:NO)、S410にて、メールボックス設定仕様MBSに基づいて、S230で選択された未設定メッセージが「受信用」に設定されているか否かを判断する。
As shown in FIG. 6, the mailbox setting process of the third embodiment is the same as that of the second embodiment except that the processes of S410 to S440 are added.
That is, in S310, when there is no unset mailbox MB (S310: NO), in S410, the unset message selected in S230 based on the mailbox setting specification MBS is set to “receiving”. Determine whether it is set.
ここで、未設定メッセージが「受信用」に設定されている場合には(S410:YES)、S420にて、「受信用」に設定されたメールボックスMBの中で最もボックス番号が大きいメールボックスMB(以下、直前設定済受信メールボックスMBという)のIDフィルタを変更することにより、この直前設定済受信メールボックスMBのCANIDレジスタR1に格納されているCANIDを有するメッセージだけではなく、S230で選択された未設定メッセージも格納可能となるように、直前設定済受信メールボックスMBのIDフィルタ設定を実施し、その後S220に移行して、上述の処理を繰り返す。具体的には、直前設定済受信メールボックスMBのCANIDレジスタR1に格納されているCANIDと、S230で選択された未設定メッセージに設定されているCANIDと比較して、値が異なっているビットをマスクし、マスクされていない残りのビットが同一のCANIDを有するメッセージの格納を許可するように、直前設定済受信メールボックスMBのIDフィルタ設定を実施する。 If the unset message is set to “receiving” (S410: YES), the mailbox having the largest box number among the mailboxes MB set to “receiving” in S420. By changing the ID filter of the MB (hereinafter referred to as the previously set reception mailbox MB), not only the message having the CANID stored in the CANID register R1 of this immediately set reception mailbox MB but also the selection in S230 The ID filter setting of the immediately-set reception mailbox MB is performed so that the set unset message can also be stored, and then the process proceeds to S220 and the above-described processing is repeated. Specifically, the bit having a different value is compared with the CANID stored in the CANID register R1 of the immediately-set reception mailbox MB and the CANID set in the unset message selected in S230. The ID filter setting of the reception mailbox MB that has been set immediately before is performed so as to allow storage of a message that is masked and the remaining bits that are not masked have the same CANID.
一方、未設定メッセージが「送信用」に設定されている場合には(S410:NO)、S430にて、「送信用」に設定されたメールボックスMBの中で最もボックス番号が大きいメールボックスMB(以下、直前設定済送信メールボックスMBという)を、共有使用できるように設定する。さらにS440にて、直前設定済送信メールボックスMBに格納する前のメッセージを一時的に記憶するために制御部4のRAM43に設けられた記憶領域(以下、共有時送信用バッファという)の記憶容量を、S230で選択された未設定メッセージのデータ長分増加させ、その後S220に移行して、上述の処理を繰り返す。
On the other hand, if the unset message is set to “for sending” (S410: NO), the mailbox MB having the largest box number among the mailboxes MB set to “for sending” in S430. (Hereinafter referred to as the immediately-set transmission mailbox MB) is set so that it can be shared. Further, in S440, the storage capacity of a storage area (hereinafter referred to as a shared transmission buffer) provided in the
このように構成された電子制御装置1では、メールボックスMBの割り当てが行われた結果、メールボックスMBに割り当てられなかった受信用メッセージ(以下、未割当受信用メッセージという)が存在する場合には(S310:NO、S410:YES)、「受信用」に設定されたメールボックスMBの中で最もボックス番号が大きいメールボックスMB(直前設定済受信メールボックスMB)について、既に割り当てられている受信用メッセージの他に未割当受信用メッセージを格納できるように設定する(S420)。 In the electronic control device 1 configured as described above, when there is a reception message (hereinafter referred to as an unassigned reception message) that is not assigned to the mailbox MB as a result of the assignment of the mailbox MB. (S310: NO, S410: YES), the mailbox MB having the largest box number among the mailboxes MB set to “receiving” (the reception mailbox MB set immediately before) is already assigned for reception. In addition to the message, setting is made so that an unallocated reception message can be stored (S420).
また、メールボックスMBの割り当てが行われた結果、メールボックスMBに割り当てられなかった送信用メッセージ(以下、未割当送信用メッセージという)が存在する場合には(S310:NO、S410:NO)、「送信用」に設定されたメールボックスMBの中で最もボックス番号が大きいメールボックスMB(以下、直前設定済送信メールボックスMBという)について、既に割り当てられている送信用メッセージの他に未割当送信用メッセージを格納できるように設定する(S430)。 Further, as a result of the assignment of the mailbox MB, if there is a transmission message that is not assigned to the mailbox MB (hereinafter referred to as an unassigned transmission message) (S310: NO, S410: NO), For the mailbox MB having the largest box number among the mailboxes MBs set to “for sending” (hereinafter referred to as the previously set outgoing mailbox MB), in addition to the already assigned transmission message, unassigned transmission A setting is made so that the trust message can be stored (S430).
これにより、1つのメールボックスMBを複数のメッセージの格納用として共有することができる。このため、正常なメールボックスMBの数が、メールボックス設定仕様MBSで設定されているメッセージの数より少ない場合であっても、メッセージの通信がメールボックス不足のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 Thereby, one mailbox MB can be shared for storing a plurality of messages. For this reason, even when the number of normal mailboxes MB is smaller than the number of messages set in the mailbox setting specification MBS, there is a situation in which message communication cannot be performed due to a shortage of mailboxes. The reliability of communication can be further improved.
また、識別コードが格納されているメールボックスの中で最も優先度が低いCANIDが格納されているメールボックスMB(すなわち、直前設定済受信メールボックスMBまたは直前設定済送信メールボックスMB)を、未割当受信用メッセージまたは未割当送信用メッセージと共有してメッセージを格納するためのメールボックスMBとすることができる。すなわち、優先度が高いメッセージを格納するためのメールボックスMBが、未割当受信用メッセージまたは未割当送信用メッセージと共有してメッセージを格納するためのメールボックスMBとして設定されるという状況の発生を抑制することができる。このため、メールボックスMBの共有設定に起因した異常により重要なメッセージの通信ができなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 In addition, the mailbox MB storing the CANID having the lowest priority among the mailboxes storing the identification code (that is, the previously set reception mailbox MB or the immediately set transmission mailbox MB) is not stored. It can be a mailbox MB for storing a message in common with an assigned reception message or an unassigned transmission message. That is, a situation occurs in which a mailbox MB for storing a message having a high priority is set as a mailbox MB for storing a message in common with an unassigned reception message or an unassigned transmission message. Can be suppressed. For this reason, it is possible to suppress the occurrence of a situation in which an important message cannot be communicated due to an abnormality caused by the sharing setting of the mailbox MB, and to further improve the reliability of communication.
以上説明した実施形態において、CANコントローラ2において「送信用」に設定されたメールボックスMBは本発明における送信用第1メールボックス、CANコントローラ2において「受信用」に設定されたメールボックスMBは本発明における受信用第1メールボックス、S430の処理は本発明における送信共有設定手段、S420の処理は本発明における受信共有設定手段である。
In the embodiment described above, the mailbox MB set for “transmission” in the
(第4実施形態)
以下に本発明の第4実施形態を図面とともに説明する。なお、第4実施形態では、第1実施形態と異なる部分のみを説明する。
(Fourth embodiment)
A fourth embodiment of the present invention will be described below with reference to the drawings. In the fourth embodiment, only parts different from the first embodiment will be described.
第4実施形態における電子制御装置1は、電子制御装置1の構成とメールボックス設定処理が変更された点以外は第1実施形態と同じである。
図7は、第4実施形態における電子制御装置1の構成を示すブロック図である。
The electronic control device 1 according to the fourth embodiment is the same as the first embodiment except that the configuration of the electronic control device 1 and the mailbox setting process are changed.
FIG. 7 is a block diagram illustrating a configuration of the electronic control device 1 according to the fourth embodiment.
第4実施形態における電子制御装置1は、図7に示すように、CANコントローラ6が追加された点と、CANコントローラ6とCANトランシーバ3とがデータ入出力可能に接続された点と、CANコントローラ6と制御部4とがデータ入出力可能に接続された点と、CANバスBS1と異なるCANバスBS2がCANトランシーバ3に接続されている点以外は第1実施形態と同じである。
As shown in FIG. 7, the electronic control device 1 according to the fourth embodiment includes a point where a CAN controller 6 is added, a point where the CAN controller 6 and the CAN transceiver 3 are connected so as to be able to input and output data, and a CAN controller. 6 and the
まずCANコントローラ6は、CANコントローラ2と同様に、データ格納部61とプロトコルコア部62とアクセス制御部63とを備えている。
またCANトランシーバ3は、通常時は、CANコントローラ2とCANバスBS1との間でデータを送受信する機能と、CANコントローラ6とCANバスBS2との間でデータを送受信する機能を備えるように設定されている。但し、CANトランシーバ3は、制御部4からのメールボックス共有指令によって、CANコントローラ6とCANバスBS1との間でデータを送受信する機能を備えるように設定される。
First, the CAN controller 6 includes a
The CAN transceiver 3 is normally set to have a function of transmitting / receiving data between the
図8は、第4実施形態のメールボックス設定処理を示すフローチャートである。
図8に示すように、第4実施形態のメールボックス設定処理は、S240の処理が変更された点と、S510〜S520の処理が追加された点以外は第1実施形態と同じである。
FIG. 8 is a flowchart illustrating mailbox setting processing according to the fourth embodiment.
As shown in FIG. 8, the mailbox setting process of the fourth embodiment is the same as that of the first embodiment except that the process of S240 is changed and the processes of S510 to S520 are added.
すなわち、S310にて、未設定メールボックスMBが存在しない場合には(S310:NO)、S510にて、CANコントローラ6が未使用であるか否かを判断する。ここで、CANコントローラ6が使用中である場合には(S510:NO)、メールボックス設定処理を終了する。 That is, if there is no unset mailbox MB in S310 (S310: NO), it is determined in S510 whether the CAN controller 6 is unused. If the CAN controller 6 is in use (S510: NO), the mailbox setting process is terminated.
一方、CANコントローラ6が未使用である場合には(S510:YES)、S520にて、CANトランシーバ3へ上述のメールボックス共有指令を出力することによって、CANコントローラ6とCANバスBS1との間でデータを送受信可能となるようにCANトランシーバ3を設定(すなわち、CANコントローラ6のメールボックスMBをCANコントローラ2側で共有使用できるように設定)し、S320に移行する。
On the other hand, if the CAN controller 6 is not used (S510: YES), the above-mentioned mailbox sharing command is output to the CAN transceiver 3 in S520, whereby the CAN controller 6 and the CAN bus BS1 are connected. The CAN transceiver 3 is set so that data can be transmitted and received (that is, the mailbox MB of the CAN controller 6 is set so that it can be shared on the
またS240では、ボックス番号カウンタC1の値が0以上31以下である場合には、CANコントローラ2について、ボックス番号カウンタC1が指示するボックス番号を有するメールボックスMBが正常であるか否かを、RAM43に記憶されたビット固着検査照合結果に基づいて判断する。
In S240, if the value of the box number counter C1 is 0 or more and 31 or less, the
さらにS240では、ボックス番号カウンタC1の値が32以上62以下である場合には、CANコントローラ6について、ボックス番号カウンタC1の値から32を減算した値に一致するボックス番号を有するメールボックスMBが正常であるか否かを、RAM43に記憶されたビット固着検査照合結果に基づいて判断する。例えば、ボックス番号カウンタC1の値が34である場合には、CANコントローラ6についてボックス番号が3であるメールボックスMBが正常であるか否かを判断する。
Further, in S240, when the value of the box number counter C1 is not less than 32 and not more than 62, the mailbox controller MB having a box number that matches the value obtained by subtracting 32 from the value of the box number counter C1 is normal. It is determined based on the result of bit sticking inspection collation stored in the
したがって、ボックス番号カウンタC1の値が32以上62以下である場合には、S250〜S300の処理により、CANコントローラ6のメールボックスMBについてレジスタ設定等が実施される。 Therefore, when the value of the box number counter C1 is not less than 32 and not more than 62, register setting or the like is performed for the mailbox MB of the CAN controller 6 by the processing of S250 to S300.
これにより、CANコントローラ2内のメールボックスMBに、メールボックス設定仕様MBSに記載されている全てのメッセージを割り当てることができない場合であっても、CANコントローラ6内のメールボックスMBを利用することによって、メールボックス設定仕様MBSに記載されている全メッセージをメールボックスMBに割り当てることができる。
As a result, even when all messages described in the mailbox setting specification MBS cannot be assigned to the mailbox MB in the
このように構成された電子制御装置1では、メールボックスMBの割り当てが行われた結果、メールボックスMBに割り当てられなかったメッセージ(以下、未割当メッセージという)が存在する場合には(S310:NO)、CANコントローラ6が使用中であるか否かを判断し(S510)、CANコントローラ6が使用中でないと判断された場合に(510:NO)、CANコントローラ6のメールボックスMBについて、このメールボックスMBに未割当メッセージのCANIDを格納することにより、CANIDが格納されたCANコントローラ6のメールボックスMBを未割当メッセージの格納用に割り当てる(S520,S320,S240〜S300)。 In the electronic control device 1 configured as described above, when a message that has not been assigned to the mailbox MB (hereinafter referred to as an unassigned message) exists as a result of the assignment of the mailbox MB (S310: NO). ), It is determined whether or not the CAN controller 6 is in use (S510). If it is determined that the CAN controller 6 is not in use (510: NO), this mail is sent to the mailbox MB of the CAN controller 6 By storing the CANID of the unallocated message in the box MB, the mailbox MB of the CAN controller 6 storing the CANID is allocated for storing the unallocated message (S520, S320, S240 to S300).
これにより、CANコントローラ2が送受信するメッセージを格納するためにCANコントローラ6のメールボックスMBを用いることができる。このため、CANコントローラ2の正常なメールボックスMBの数が、メールボックス設定仕様MBSで設定されているメッセージの数より少ない場合であっても、メッセージの通信がメールボックス不足のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。
Thus, the mailbox MB of the CAN controller 6 can be used to store messages transmitted and received by the
以上説明した実施形態において、CANコントローラ6のメールボックスMBは本発明における第2メールボックス、CANコントローラ6は本発明における第2送受信手段、S510の処理は本発明における第2送受信使用判断手段、S520,S320,S240〜S300の処理は本発明における第2割当手段である。 In the embodiment described above, the mailbox MB of the CAN controller 6 is the second mailbox in the present invention, the CAN controller 6 is the second transmitting / receiving means in the present invention, and the processing in S510 is the second transmitting / receiving use determining means in the present invention, S520. , S320, S240 to S300 are the second allocation means in the present invention.
以上、本発明の一実施形態について説明したが、本発明は上記実施形態に限定されるものではなく、本発明の技術的範囲に属する限り種々の形態を採ることができる。
例えば上記第1実施形態においては、メールボックス設定仕様MBSに記載されているメッセージについて、小さいボックス番号と対応付けられたメッセージから順にメールボックスMBの設定が実施されるものを示した。そこで、各メッセージについて、電子制御装置1が搭載されている車両の制御システムへの影響度を判定し、メッセージ仕様MSにおいて、影響度が高いメッセージが上位に記載されるように、設計者がメッセージの定義順を変更するようにしてもよい。これにより、メールボックス設定仕様MBSにおいて、影響度が高いメッセージが、小さいボックス番号と対応付けられるようにすることができ、影響度の高いメッセージを優先的にメールボックスMBに割り当てることができる。
As mentioned above, although one Embodiment of this invention was described, this invention is not limited to the said embodiment, As long as it belongs to the technical scope of this invention, a various form can be taken.
For example, in the first embodiment, for the messages described in the mailbox setting specification MBS, the mailbox MB is set in order from the message associated with the smaller box number. Therefore, for each message, the degree of influence on the control system of the vehicle on which the electronic control device 1 is mounted is determined, and the designer can send a message so that a message with a high degree of influence is listed in the message specification MS. The definition order may be changed. As a result, in the mailbox setting specification MBS, a message having a high influence degree can be associated with a small box number, and a message having a high influence degree can be preferentially assigned to the mailbox MB.
例えば図9に示すように、制御システムへの影響度を考慮しないで記述されたメッセージ仕様MS11では、上位からダイアグデータ、イモビデータ、トルクデータ、車速データ、水温データの順で記載されている。一方、制御システムへの影響度が例えばダイアグデータ<車速データ<水温データ<トルクデータ<イモビデータである場合には、制御システムへの影響度を考慮して記述されたメッセージ仕様MS12は、上位からイモビデータ、トルクデータ、水温データ、車速データ、ダイアグデータの順で記載される。 For example, as shown in FIG. 9, the message specification MS11 described without considering the degree of influence on the control system is described in the order of diagnostic data, immobility data, torque data, vehicle speed data, and water temperature data from the top. On the other hand, when the degree of influence on the control system is, for example, diagnosis data <vehicle speed data <water temperature data <torque data <imobi data, the message specification MS12 described in consideration of the degree of influence on the control system is It is described in the order of immobility data, torque data, water temperature data, vehicle speed data, and diagnostic data.
これにより、正常なメールボックスMBの数が、メールボックス設定仕様MBSで設定されているメッセージの数より少ない場合であっても、重要なメッセージの通信がメールボックスMBの異常のためにできなくなるという状況の発生を抑制し、通信の信頼性をさらに向上させることができる。 As a result, even if the number of normal mailboxes MB is smaller than the number of messages set in the mailbox setting specification MBS, communication of important messages cannot be performed due to an abnormality in the mailbox MB. It is possible to suppress the occurrence of the situation and further improve the reliability of communication.
1…電子制御装置、2…CANコントローラ、3…CANトランシーバ、4…制御部、6…CANコントローラ、21…データ格納部、22…プロトコルコア部、23…アクセス制御部、41…CPU、42…ROM、43…RAM、61…データ格納部、62…プロトコルコア部、63…アクセス制御部、MB…メールボックス、R1…CANIDレジスタ、R2…メッセージレジスタ、R3…送受信設定レジスタ、R4…DLCレジスタ DESCRIPTION OF SYMBOLS 1 ... Electronic control apparatus, 2 ... CAN controller, 3 ... CAN transceiver, 4 ... Control part, 6 ... CAN controller, 21 ... Data storage part, 22 ... Protocol core part, 23 ... Access control part, 41 ... CPU, 42 ... ROM, 43 ... RAM, 61 ... Data storage unit, 62 ... Protocol core unit, 63 ... Access control unit, MB ... Mailbox, R1 ... CANID register, R2 ... Message register, R3 ... Transmission / reception setting register, R4 ... DLC register
Claims (7)
前記第1メールボックスから前記メッセージと前記識別コードを抽出し、前記第1メールボックスから抽出した前記メッセージに、前記第1メールボックスから抽出した前記識別コードを付与したフレームを構成して通信バス上に送信するとともに、該通信バスを介して前記フレームを受信した場合には、受信した前記フレームから前記メッセージと前記識別コードを抽出し、抽出した前記識別コードと一致する前記識別コードが格納されている前記第1メールボックスに、前記フレームから抽出した前記メッセージを格納する第1送受信手段とを備えた通信装置であって、
前記複数の第1メールボックスのそれぞれについて異常が発生しているか否かを判断する異常判断手段と、
複数の前記第1メールボックスのうち、異常が発生していないと前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスに前記識別コードを格納することにより、該第1メールボックスを、該識別コードに対応する前記メッセージの格納用に割り当てる第1割当手段と、
複数の前記第1メールボックスのうち、異常が発生していると前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスへの前記識別コードの格納を禁止することにより、前記メッセージの格納用に割り当てることを禁止する割当禁止手段とを備え、
複数の前記メッセージにはそれぞれ、優先度が予め設定されており、
前記第1割当手段は、
複数の前記メッセージのうち、前記優先度が高い前記メッセージから順に前記第1メールボックスを割り当て、
前記第1メールボックスは、
前記第1割当手段によって、前記第1送受信手段が送信するメッセージである送信用メッセージを格納する送信用第1メールボックス、および、前記第1送受信手段が受信するメッセージである受信用メッセージを格納する受信用第1メールボックスの何れかに割り当てられ、
前記第1割当手段による前記第1メールボックスの割り当てが行われた結果、前記第1メールボックスに割り当てられなかった前記送信用メッセージである未割当送信用メッセージが存在する場合には、前記第1割当手段によって前記送信用第1メールボックスとして割り当てられた前記第1メールボックスの中から、予め設定された送信ボックス選択条件を満たす前記第1メールボックスを選択し、選択された前記送信用第1メールボックスについて、既に割り当てられている前記送信用メッセージの他に前記未割当送信用メッセージを格納できるように設定する送信共有設定手段を備える
ことを特徴とする通信装置。 A plurality of first mailboxes storing at least a message and an identification code indicating the type of the message;
The message and the identification code are extracted from the first mailbox, and a frame in which the identification code extracted from the first mailbox is added to the message extracted from the first mailbox is formed on the communication bus. When the frame is received via the communication bus, the message and the identification code are extracted from the received frame, and the identification code that matches the extracted identification code is stored. A first transmission / reception means for storing the message extracted from the frame in the first mailbox;
Abnormality determining means for determining whether an abnormality has occurred in each of the plurality of first mailboxes;
Of the plurality of first mailboxes, for the first mailbox determined by the abnormality determination means that no abnormality has occurred, the identification code is stored in the first mailbox, thereby the first mailbox. First allocating means for allocating one mailbox for storing the message corresponding to the identification code;
By prohibiting storage of the identification code in the first mailbox for the first mailbox determined by the abnormality determination means that an abnormality has occurred among the plurality of first mailboxes. Allocation prohibiting means for prohibiting allocation for storing the message ,
Each of the plurality of messages has a preset priority,
The first assigning means includes
Among the plurality of messages, assign the first mailbox in order from the message with the highest priority,
The first mailbox is
The first assigning means stores a transmission first mailbox for storing a transmission message that is a message transmitted by the first transmission / reception means, and a reception message that is a message received by the first transmission / reception means. Assigned to one of the primary mailboxes for receiving,
As a result of the assignment of the first mailbox by the first assigning means, there is an unassigned transmission message that is the transmission message that has not been assigned to the first mailbox. The first mailbox that satisfies a preset transmission box selection condition is selected from the first mailboxes that are allocated as the first mailbox for transmission by the assigning means, and the selected first transmission mailbox is selected. A communication apparatus comprising: a transmission sharing setting unit configured to store the unallocated transmission message in addition to the already allocated transmission message for a mailbox .
前記第1メールボックスから前記メッセージと前記識別コードを抽出し、前記第1メールボックスから抽出した前記メッセージに、前記第1メールボックスから抽出した前記識別コードを付与したフレームを構成して通信バス上に送信するとともに、該通信バスを介して前記フレームを受信した場合には、受信した前記フレームから前記メッセージと前記識別コードを抽出し、抽出した前記識別コードと一致する前記識別コードが格納されている前記第1メールボックスに、前記フレームから抽出した前記メッセージを格納する第1送受信手段とを備えた通信装置であって、
前記複数の第1メールボックスのそれぞれについて異常が発生しているか否かを判断する異常判断手段と、
複数の前記第1メールボックスのうち、異常が発生していないと前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスに前記識別コードを格納することにより、該第1メールボックスを、該識別コードに対応する前記メッセージの格納用に割り当てる第1割当手段と、
複数の前記第1メールボックスのうち、異常が発生していると前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスへの前記識別コードの格納を禁止することにより、前記メッセージの格納用に割り当てることを禁止する割当禁止手段とを備え、
前記第1送受信手段は、CAN(Controller Area Network)プロトコルに従って送受信を行い、
前記第1割当手段は、
複数の前記識別コードのうち、前記識別コードの値が小さい順に前記第1メールボックスに格納することにより、前記第1メールボックスを割り当て、
前記第1メールボックスは、
前記第1割当手段によって、前記第1送受信手段が送信するメッセージである送信用メッセージを格納する送信用第1メールボックス、および、前記第1送受信手段が受信するメッセージである受信用メッセージを格納する受信用第1メールボックスの何れかに割り当てられ、
前記第1割当手段による前記第1メールボックスの割り当てが行われた結果、前記第1メールボックスに割り当てられなかった前記送信用メッセージである未割当送信用メッセージが存在する場合には、前記第1割当手段によって前記送信用第1メールボックスとして割り当てられた前記第1メールボックスの中から、予め設定された送信ボックス選択条件を満たす前記第1メールボックスを選択し、選択された前記送信用第1メールボックスについて、既に割り当てられている前記送信用メッセージの他に前記未割当送信用メッセージを格納できるように設定する送信共有設定手段を備える
ことを特徴とする通信装置。 A plurality of first mailboxes storing at least a message and an identification code indicating the type of the message;
The message and the identification code are extracted from the first mailbox, and a frame in which the identification code extracted from the first mailbox is added to the message extracted from the first mailbox is formed on the communication bus. When the frame is received via the communication bus, the message and the identification code are extracted from the received frame, and the identification code that matches the extracted identification code is stored. A first transmission / reception means for storing the message extracted from the frame in the first mailbox;
Abnormality determining means for determining whether an abnormality has occurred in each of the plurality of first mailboxes;
Of the plurality of first mailboxes, for the first mailbox determined by the abnormality determination means that no abnormality has occurred, the identification code is stored in the first mailbox, thereby the first mailbox. First allocating means for allocating one mailbox for storing the message corresponding to the identification code;
By prohibiting storage of the identification code in the first mailbox for the first mailbox determined by the abnormality determination means that an abnormality has occurred among the plurality of first mailboxes. Allocation prohibiting means for prohibiting allocation for storing the message,
The first transmission / reception means performs transmission / reception according to a CAN (Controller Area Network) protocol,
The first assigning means includes
Assigning the first mailbox by storing in the first mailbox in ascending order of the value of the identification code among the plurality of identification codes;
The first mailbox is
The first assigning means stores a transmission first mailbox for storing a transmission message that is a message transmitted by the first transmission / reception means, and a reception message that is a message received by the first transmission / reception means. Assigned to one of the primary mailboxes for receiving,
As a result of the assignment of the first mailbox by the first assigning means, there is an unassigned transmission message that is the transmission message that has not been assigned to the first mailbox. The first mailbox that satisfies a preset transmission box selection condition is selected from the first mailboxes that are allocated as the first mailbox for transmission by the assigning means, and the selected first transmission mailbox is selected. Transmission share setting means for setting the mailbox so that the unallocated transmission message can be stored in addition to the transmission message already allocated
A communication device.
前記第1メールボックスから前記メッセージと前記識別コードを抽出し、前記第1メールボックスから抽出した前記メッセージに、前記第1メールボックスから抽出した前記識別コードを付与したフレームを構成して通信バス上に送信するとともに、該通信バスを介して前記フレームを受信した場合には、受信した前記フレームから前記メッセージと前記識別コードを抽出し、抽出した前記識別コードと一致する前記識別コードが格納されている前記第1メールボックスに、前記フレームから抽出した前記メッセージを格納する第1送受信手段とを備えた通信装置であって、
前記複数の第1メールボックスのそれぞれについて異常が発生しているか否かを判断する異常判断手段と、
複数の前記第1メールボックスのうち、異常が発生していないと前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスに前記識別コードを格納することにより、該第1メールボックスを、該識別コードに対応する前記メッセージの格納用に割り当てる第1割当手段と、
複数の前記第1メールボックスのうち、異常が発生していると前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスへの前記識別コードの格納を禁止することにより、前記メッセージの格納用に割り当てることを禁止する割当禁止手段とを備え、
複数の前記メッセージにはそれぞれ、優先度が予め設定されており、
前記第1割当手段は、
複数の前記メッセージのうち、前記優先度が高い前記メッセージから順に前記第1メールボックスを割り当て、
前記第1メールボックスは、
前記第1割当手段によって、前記第1送受信手段が送信するメッセージである送信用メッセージを格納する送信用第1メールボックス、および、前記第1送受信手段が受信するメッセージである受信用メッセージを格納する受信用第1メールボックスの何れかに割り当てられ、
前記第1割当手段による前記第1メールボックスの割り当てが行われた結果、前記第1メールボックスに割り当てられなかった前記受信用メッセージである未割当受信用メッセージが存在する場合には、前記第1割当手段によって前記受信用第1メールボックスとして割り当てられた前記第1メールボックスの中から、予め設定された受信ボックス選択条件を満たす前記第1メールボックスを選択し、選択された前記受信用第1メールボックスについて、既に割り当てられている前記受信用メッセージの他に前記未割当受信用メッセージを格納できるように設定する受信共有設定手段を備える
ことを特徴とする通信装置。 A plurality of first mailboxes storing at least a message and an identification code indicating the type of the message;
The message and the identification code are extracted from the first mailbox, and a frame in which the identification code extracted from the first mailbox is added to the message extracted from the first mailbox is formed on the communication bus. When the frame is received via the communication bus, the message and the identification code are extracted from the received frame, and the identification code that matches the extracted identification code is stored. A first transmission / reception means for storing the message extracted from the frame in the first mailbox ;
Abnormality determining means for determining whether an abnormality has occurred in each of the plurality of first mailboxes;
Of the plurality of first mailboxes, for the first mailbox determined by the abnormality determination means that no abnormality has occurred, the identification code is stored in the first mailbox, thereby the first mailbox. First allocating means for allocating one mailbox for storing the message corresponding to the identification code;
By prohibiting storage of the identification code in the first mailbox for the first mailbox determined by the abnormality determination means that an abnormality has occurred among the plurality of first mailboxes. Allocation prohibiting means for prohibiting allocation for storing the message,
Each of the plurality of messages has a preset priority,
The first assigning means includes
Among the plurality of messages, assign the first mailbox in order from the message with the highest priority,
The first mailbox is
The first assigning means stores a transmission first mailbox for storing a transmission message that is a message transmitted by the first transmission / reception means, and a reception message that is a message received by the first transmission / reception means. Assigned to one of the primary mailboxes for receiving,
As a result of the assignment of the first mailbox by the first assigning means, there is an unassigned reception message that is the reception message that has not been assigned to the first mailbox. The first mailbox selected by the assigning means as the first mailbox for reception is selected from the first mailboxes that satisfy a predetermined reception box selection condition, and the selected first reception mailbox is selected. Receiving sharing setting means for setting the mailbox so that the unallocated receiving message can be stored in addition to the already allocated receiving message
A communication device.
前記第1メールボックスから前記メッセージと前記識別コードを抽出し、前記第1メールボックスから抽出した前記メッセージに、前記第1メールボックスから抽出した前記識別コードを付与したフレームを構成して通信バス上に送信するとともに、該通信バスを介して前記フレームを受信した場合には、受信した前記フレームから前記メッセージと前記識別コードを抽出し、抽出した前記識別コードと一致する前記識別コードが格納されている前記第1メールボックスに、前記フレームから抽出した前記メッセージを格納する第1送受信手段とを備えた通信装置であって、
前記複数の第1メールボックスのそれぞれについて異常が発生しているか否かを判断する異常判断手段と、
複数の前記第1メールボックスのうち、異常が発生していないと前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスに前記識別コードを格納することにより、該第1メールボックスを、該識別コードに対応する前記メッセージの格納用に割り当てる第1割当手段と、
複数の前記第1メールボックスのうち、異常が発生していると前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスへの前記識別コードの格納を禁止することにより、前記メッセージの格納用に割り当てることを禁止する割当禁止手段とを備え、
前記第1送受信手段は、CAN(Controller Area Network)プロトコルに従って送受信を行い、
前記第1割当手段は、
複数の前記識別コードのうち、前記識別コードの値が小さい順に前記第1メールボックスに格納することにより、前記第1メールボックスを割り当て、
前記第1メールボックスは、
前記第1割当手段によって、前記第1送受信手段が送信するメッセージである送信用メッセージを格納する送信用第1メールボックス、および、前記第1送受信手段が受信するメッセージである受信用メッセージを格納する受信用第1メールボックスの何れかに割り当てられ、
前記第1割当手段による前記第1メールボックスの割り当てが行われた結果、前記第1メールボックスに割り当てられなかった前記受信用メッセージである未割当受信用メッセージが存在する場合には、前記第1割当手段によって前記受信用第1メールボックスとして割り当てられた前記第1メールボックスの中から、予め設定された受信ボックス選択条件を満たす前記第1メールボックスを選択し、選択された前記受信用第1メールボックスについて、既に割り当てられている前記受信用メッセージの他に前記未割当受信用メッセージを格納できるように設定する受信共有設定手段を備える
ことを特徴とする通信装置。 A plurality of first mailboxes storing at least a message and an identification code indicating the type of the message;
The message and the identification code are extracted from the first mailbox, and a frame in which the identification code extracted from the first mailbox is added to the message extracted from the first mailbox is formed on the communication bus. When the frame is received via the communication bus, the message and the identification code are extracted from the received frame, and the identification code that matches the extracted identification code is stored. A first transmission / reception means for storing the message extracted from the frame in the first mailbox;
Abnormality determining means for determining whether an abnormality has occurred in each of the plurality of first mailboxes;
Of the plurality of first mailboxes, for the first mailbox determined by the abnormality determination means that no abnormality has occurred, the identification code is stored in the first mailbox, thereby the first mailbox. First allocating means for allocating one mailbox for storing the message corresponding to the identification code;
By prohibiting storage of the identification code in the first mailbox for the first mailbox determined by the abnormality determination means that an abnormality has occurred among the plurality of first mailboxes. Allocation prohibiting means for prohibiting allocation for storing the message,
The first transmission / reception means performs transmission / reception according to a CAN (Controller Area Network) protocol,
The first assigning means includes
Assigning the first mailbox by storing in the first mailbox in ascending order of the value of the identification code among the plurality of identification codes;
The first mailbox is
The first assigning means stores a transmission first mailbox for storing a transmission message that is a message transmitted by the first transmission / reception means, and a reception message that is a message received by the first transmission / reception means. Assigned to one of the primary mailboxes for receiving,
As a result of the assignment of the first mailbox by the first assigning means, there is an unassigned reception message that is the reception message that has not been assigned to the first mailbox. The first mailbox selected by the assigning means as the first mailbox for reception is selected from the first mailboxes that satisfy a predetermined reception box selection condition, and the selected first reception mailbox is selected. Receiving sharing setting means for setting the mailbox so that the unallocated receiving message can be stored in addition to the already allocated receiving message
A communication device.
前記第1メールボックスから前記メッセージと前記識別コードを抽出し、前記第1メールボックスから抽出した前記メッセージに、前記第1メールボックスから抽出した前記識別コードを付与したフレームを構成して通信バス上に送信するとともに、該通信バスを介して前記フレームを受信した場合には、受信した前記フレームから前記メッセージと前記識別コードを抽出し、抽出した前記識別コードと一致する前記識別コードが格納されている前記第1メールボックスに、前記フレームから抽出した前記メッセージを格納する第1送受信手段とを備えた通信装置であって、
前記複数の第1メールボックスのそれぞれについて異常が発生しているか否かを判断する異常判断手段と、
複数の前記第1メールボックスのうち、異常が発生していないと前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスに前記識別コードを格納することにより、該第1メールボックスを、該識別コードに対応する前記メッセージの格納用に割り当てる第1割当手段と、
複数の前記第1メールボックスのうち、異常が発生していると前記異常判断手段により判断された前記第1メールボックスについては、該第1メールボックスへの前記識別コードの格納を禁止することにより、前記メッセージの格納用に割り当てることを禁止する割当禁止手段と、
メッセージと、該メッセージの種別を示す識別コードとが少なくとも格納される複数の第2メールボックスと、
前記第2メールボックスから前記メッセージと前記識別コードを抽出し、前記メールボックスから抽出した前記メッセージに、前記第2メールボックスから抽出した前記識別コードを付与したフレームを構成して通信バス上に送信するとともに、該通信バスを介して前記フレームを受信した場合には、受信した前記フレームから前記メッセージと前記識別コードを抽出し、抽出した前記識別コードと一致する前記識別コードが格納されている前記第2メールボックスに、前記フレームから抽出した前記メッセージを格納する第2送受信手段と、
前記第1割当手段による前記メールボックスの割り当てが行われた結果、前記メールボックスに割り当てられなかった前記メッセージである未割当メッセージが存在する場合に、前記第2送受信手段が使用中であるか否かを判断する第2送受信使用判断手段と、
前記第2送受信手段が使用中でないと前記第2送受信使用判断手段により判断された場合に、前記第2メールボックスについて、該第2メールボックスに前記未割当メッセージの識別コードを格納することにより、前記識別コードが格納された前記第2メールボックスを前記未割当メッセージの格納用に割り当てる第2割当手段とを備える
ことを特徴とする通信装置。 A plurality of first mailboxes storing at least a message and an identification code indicating the type of the message;
The message and the identification code are extracted from the first mailbox, and a frame in which the identification code extracted from the first mailbox is added to the message extracted from the first mailbox is formed on the communication bus. When the frame is received via the communication bus, the message and the identification code are extracted from the received frame, and the identification code that matches the extracted identification code is stored. A first transmission / reception means for storing the message extracted from the frame in the first mailbox;
Abnormality determining means for determining whether an abnormality has occurred in each of the plurality of first mailboxes;
Of the plurality of first mailboxes, for the first mailbox determined by the abnormality determination means that no abnormality has occurred, the identification code is stored in the first mailbox, thereby the first mailbox. First allocating means for allocating one mailbox for storing the message corresponding to the identification code;
By prohibiting storage of the identification code in the first mailbox for the first mailbox determined by the abnormality determination means that an abnormality has occurred among the plurality of first mailboxes. Allocation prohibiting means for prohibiting allocation for storing the message;
A plurality of second mailboxes storing at least a message and an identification code indicating the type of the message;
The message and the identification code are extracted from the second mailbox, and a frame in which the identification code extracted from the second mailbox is added to the message extracted from the mailbox is transmitted on the communication bus. In addition, when the frame is received via the communication bus, the message and the identification code are extracted from the received frame, and the identification code that matches the extracted identification code is stored. Second transmitting / receiving means for storing the message extracted from the frame in a second mailbox;
Whether or not the second transmitting / receiving means is in use when there is an unassigned message that is the message that has not been assigned to the mailbox as a result of the assignment of the mailbox by the first assigning means. Second transmission / reception usage determining means for determining whether or not
When the second transmission / reception use determining unit determines that the second transmission / reception unit is not in use, for the second mailbox, by storing the identification code of the unallocated message in the second mailbox, Second allocating means for allocating the second mailbox storing the identification code for storing the unallocated message.
A communication device.
前記第1割当手段により割り当てられた前記第1メールボックスのうち、前記第1割当手段により最も遅く割り当てられた前記送信用第1メールボックスであることである
ことを特徴とする請求項1または請求項2に記載の通信装置。 The transmission box selection condition is as follows:
One of the first mailbox assigned by the first allocation means, slowest allocated the fact that it is a first mailbox for sending and wherein the claim 1, wherein the first allocation means Item 3. The communication device according to Item 2 .
前記第1割当手段により割り当てられた前記第1メールボックスのうち、前記第1割当手段により最も遅く割り当てられた前記受信用第1メールボックスであることである
ことを特徴とする請求項3または請求項4に記載の通信装置。 The inbox selection condition is:
Among assigned the first mailbox by said first allocation unit, slowest allocated is that it is the first mailbox for the reception be characterized according to claim 3, wherein the first allocation means Item 5. The communication device according to Item 4 .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011193905A JP5605338B2 (en) | 2011-09-06 | 2011-09-06 | Communication device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011193905A JP5605338B2 (en) | 2011-09-06 | 2011-09-06 | Communication device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2013055593A JP2013055593A (en) | 2013-03-21 |
| JP5605338B2 true JP5605338B2 (en) | 2014-10-15 |
Family
ID=48132189
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2011193905A Expired - Fee Related JP5605338B2 (en) | 2011-09-06 | 2011-09-06 | Communication device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5605338B2 (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6390113B2 (en) * | 2014-02-14 | 2018-09-19 | オムロン株式会社 | Control system, development support apparatus, control apparatus, and control method |
| DE102014207422A1 (en) * | 2014-04-17 | 2015-10-22 | Robert Bosch Gmbh | Bus interface unit and method of operation therefor |
| JP6443066B2 (en) * | 2015-01-16 | 2018-12-26 | 株式会社デンソー | Electronic control unit |
| JP2019029683A (en) * | 2017-07-25 | 2019-02-21 | 日立オートモティブシステムズ株式会社 | Electronic control unit |
| CN114979058B (en) * | 2022-06-30 | 2023-10-03 | 东风电驱动系统有限公司 | CAN multi-mailbox multiplexing processing method and system |
| CN118869659B (en) * | 2024-06-25 | 2025-11-25 | 岚图汽车科技股份有限公司 | CAN bus CANID allocation methods, devices, media and electronic equipment |
| CN118612181B (en) * | 2024-08-09 | 2024-11-15 | 湖南进芯电子科技有限公司 | A coordinated sending method for CAN shared mailbox |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0644145A (en) * | 1992-07-24 | 1994-02-18 | Matsushita Electric Works Ltd | Memory error saving system |
| JP3687373B2 (en) * | 1998-12-04 | 2005-08-24 | 株式会社日立製作所 | Highly reliable distributed system |
| JP2000165384A (en) * | 1998-11-24 | 2000-06-16 | Oki Electric Ind Co Ltd | Signal assembling device |
| JP2004153650A (en) * | 2002-10-31 | 2004-05-27 | Fujitsu Ten Ltd | Network communication device |
| JP2009205528A (en) * | 2008-02-28 | 2009-09-10 | Denso Corp | Electronic control device |
| JP2009253464A (en) * | 2008-04-02 | 2009-10-29 | Fujitsu Ten Ltd | Gateway device and gateway method |
| JP2009288953A (en) * | 2008-05-28 | 2009-12-10 | Denso Corp | Electronic control device |
| JP5007315B2 (en) * | 2009-04-03 | 2012-08-22 | 本田技研工業株式会社 | In-vehicle gateway device |
-
2011
- 2011-09-06 JP JP2011193905A patent/JP5605338B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2013055593A (en) | 2013-03-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5605338B2 (en) | Communication device | |
| JP5454517B2 (en) | Gateway device | |
| JP5949417B2 (en) | Relay device | |
| US10153825B2 (en) | Vehicle-mounted control device | |
| JP2012222527A (en) | In-vehicle network, management node, and number assignment method | |
| JP5811140B2 (en) | Communications system | |
| JP5050653B2 (en) | Electronic control device | |
| JP2014226946A (en) | Abnormality response system and abnormality response method for vehicular communication device | |
| CN103946830A (en) | Sensor transmission device and method for transmitting payload data from a plurality of sensors to a bus control device for a vehicle | |
| JP3829679B2 (en) | Communication control device | |
| JP7394185B2 (en) | Communications system | |
| JP4804307B2 (en) | Gateway apparatus and transfer control method | |
| JP5147533B2 (en) | Relay device and relay method | |
| CN112438036B (en) | In-vehicle communication device, recording medium, and message transmission method | |
| CN104581819A (en) | Slot resource collision determination method and device | |
| JP2017017615A (en) | Communication apparatus and communication system | |
| JP5728043B2 (en) | Gateway device | |
| JP2013082352A (en) | Communication equipment for vehicle | |
| CN108063708A (en) | A kind of CAN communication loses method for diagnosing faults and electronic control unit | |
| US6697855B1 (en) | Adaptive hybrid method for access to a transmission channel | |
| JP2018121155A (en) | Vehicle controller | |
| JP2008005290A (en) | Relay connection unit and electronic control unit | |
| JP2007067654A (en) | Communication system and communication apparatus | |
| JP6485338B2 (en) | Communications system | |
| JP2003023440A (en) | Gateway, computer and communication evaluation system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20131018 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140512 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140520 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140709 |
|
| 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: 20140729 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140811 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 5605338 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |