JP2015210667A - Communication unit and can(control area network) communication control program - Google Patents
Communication unit and can(control area network) communication control program Download PDFInfo
- Publication number
- JP2015210667A JP2015210667A JP2014091833A JP2014091833A JP2015210667A JP 2015210667 A JP2015210667 A JP 2015210667A JP 2014091833 A JP2014091833 A JP 2014091833A JP 2014091833 A JP2014091833 A JP 2014091833A JP 2015210667 A JP2015210667 A JP 2015210667A
- Authority
- JP
- Japan
- Prior art keywords
- communication
- frame
- microcomputer
- serial port
- message
- 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.)
- Pending
Links
Images
Landscapes
- Bus Control (AREA)
- Small-Scale Networks (AREA)
Abstract
Description
本発明は、通信ユニットおよびCAN通信制御プログラムに関する。 The present invention relates to a communication unit and a CAN communication control program.
CAN(Control Area Network)は、シンプルなネットワーク構成のため、低コストで構築できるネットワークである。さらには、CAN通信は、故障検出機能が優れており、信頼性が高い通信方式として知られている。 CAN (Control Area Network) is a network that can be constructed at low cost because of its simple network configuration. Furthermore, CAN communication is known as a highly reliable communication method that has an excellent failure detection function.
CANは、CANバスごとにCANコントローラが1つ設置される。CANコントローラは、CANを流通する信号が、CAN通信のプロトコルに従って各モジュールに正常に伝達されるように制御する。 In the CAN, one CAN controller is installed for each CAN bus. The CAN controller controls so that a signal flowing through the CAN is normally transmitted to each module in accordance with a CAN communication protocol.
しかしながら、CANが異なる通信速度のCANバスを含む場合には、異なるCANバス上のモジュール同士は直接通信出来ない。そのため、従来は、ゲートウェイを介して異なるCANバス上のモジュール同士が通信するが、ゲートウェイ設置などにより、ネットワークの構築コストが高くなるととともに、通信負荷が増大するという問題がある。 However, when CAN includes CAN buses having different communication speeds, modules on different CAN buses cannot directly communicate with each other. Therefore, conventionally, modules on different CAN buses communicate with each other via a gateway. However, there is a problem that a network construction cost is increased due to installation of a gateway and the communication load is increased.
本発明は、通信速度が異なるCANバスに接続された通信モジュール同士が、通信負荷を増大させずに通信可能にすることを目的とする。 An object of the present invention is to enable communication between communication modules connected to CAN buses having different communication speeds without increasing a communication load.
一態様の通信ユニットは、複数の異なる通信速度のCANバスにそれぞれ接続された複数のCANコントローラと、前記CANコントローラとそれぞれ接続された複数のシリアルポートを介して、前記異なる通信速度のCANバスにそれぞれ接続された装置間のCAN通信を制御するCPU(Central Processing Unit)を有したマイコンと、を有することを特徴とする。 The communication unit according to an aspect includes a plurality of CAN controllers respectively connected to a plurality of CAN buses having different communication speeds, and a plurality of serial ports connected to the CAN controllers to the CAN buses having different communication speeds. And a microcomputer having a CPU (Central Processing Unit) for controlling CAN communication between the devices connected to each other.
通信速度が異なるCANバスに接続された通信モジュール同士が、通信負荷を増大させずに通信できる。 Communication modules connected to CAN buses having different communication speeds can communicate without increasing the communication load.
以下に添付図面を参照して本願に係る通信ユニットおよびCAN通信制御プログラムについて説明する。なお、この実施例は開示の技術を限定するものではない。そして、各実施例は、処理内容を矛盾させない範囲で適宜組み合わせることが可能である。 Hereinafter, a communication unit and a CAN communication control program according to the present application will be described with reference to the accompanying drawings. Note that this embodiment does not limit the disclosed technology. Each embodiment can be appropriately combined within a range in which processing contents are not contradictory.
[実施例1に係るCANの構成]
図1は、実施例1に係るCANの構成の一例であるCAN1を示すブロック図である。図1に示すように、CAN1は、通信ユニット100と、バス10、20と、モジュール11、12、21、22とを有する。通信ユニット100は、CANバス10に接続するCANコントローラ110と、CANバス20に接続するCANコントローラ120と、CANバス10とCANバス20との通信を制御するマイクロコントローラ(以下、マイコン150とを有する。
[Configuration of CAN according to Embodiment 1]
FIG. 1 is a block diagram illustrating a
CANバス10とCANバス20とは通信速度が異なるバスであり、例えば、図1の例では、CANバス10の通信速度が500kbpsであり、CANバス20の通信速度が125kbpsである。CANバス10に接続されるモジュール11および12は、例えば、ABS(Antilock Brake System)やECM(Engine Control Module)など、モジュール21、22よりも高速通信を行うモジュールである。一方、CANバス20に接続されるモジュール21、22は、例えば、DIM(Driver Information Module)やCCM(Climate Control Module)など、モジュール11、12よりも低速通信を行うモジュールである。
The CAN
CANコントローラ110およびCANコントローラ120は、それぞれCANバス10およびCANバス20の通信速度に適応して、モジュール11、12、21、22とフレーム通信をおこなう。CANコントローラ110およびCANコントローラ120は、フレームの種類を識別し、フレームから情報を選択して所定規格のシリアルデータへ変換する。そして、CANコントローラ110およびCANコントローラ120は、マイコン150のシリアルポート151およびシリアルポート152を介してマイコン150へシリアルデータを送信する。
The
ここで、CANで流通するフレームには、(1)データフレーム、(2)リモートフレーム、(3)オーバーロードフレーム、(4)エラーフレーム、の4種類がある。フレームは、種類ごとにデータフォーマットが異なる。これらフレームのうちオーバーロードフレーム、エラーフレームは、それぞれオーバーロード、エラーの異常が発生したときに、モジュール11、12、21、22とマイコン150との間でやりとりされるフレームである。他のモジュールにデータを送るデータフレーム、他のモジュールにデータフレームをリクエストするリモートフレームが、通常時にモジュール11、12、21、22とマイコン150との間でやりとりされるフレームである。なお、データフレームおよびリモートフレームは、指令する処理内容に対応するメッセージIDを含んでいる。
Here, there are four types of frames distributed in CAN: (1) data frame, (2) remote frame, (3) overload frame, and (4) error frame. The frame has a different data format for each type. Of these frames, an overload frame and an error frame are frames exchanged between the
[実施例1に係るCANコントローラの構成]
図2は、実施例1に係るCANコントローラの内部構成の一例を示すブロック図である。実施例1に係るCANコントローラ110は、CANI/F(InterFace、以下同様)112、メッセージフィルタ114、シリアルI/F116、送信エンジン118を有する。CANI/F112は、モジュール11、12からCANバス10を介して受信したフレームの種類を判別し、フレームの種類に応じたフォーマットでフレームから所定情報を抽出して、メッセージフィルタ114へ出力する。また、CANI/F112は、送信エンジン118から受け付けたメッセージをフレームへ変換し、CANバス10を介してモジュール11、12へ送信する。
[Configuration of CAN Controller according to Embodiment 1]
FIG. 2 is a block diagram illustrating an example of the internal configuration of the CAN controller according to the first embodiment. The
メッセージフィルタ114は、CANI/F112から受信した所定情報を種別に基づきフィルタリングして、シリアルI/F116へ出力する。シリアルI/F116は、メッセージフィルタ114から受信したメッセージをシリアル変換し、シリアルポート151を介してマイコン150へ出力する。
The
また、シリアルI/F116は、シリアルポート151からしたメッセージを含むシリアルデータをCANコントローラ110の内部形式のデータへ変換し、送信エンジン118へ出力する。送信エンジン118は、シリアルI/F116から受信したメッセージを含むデータから所定情報を抽出し、所定情報に基づく種類のフォーマットでメッセージを含むデータを生成し、CANI/F112へ出力する。CANI/F112は、送信エンジン118からメッセージを含むデータを受信すると、フレームに変換してCANバス10を介してモジュール11、12へ送信する。
Further, the serial I /
図3は、マイコン150の内部構成の一例を示すブロック図である。図3では、シリアルポート151、152から入力されたシリアル信号のうち、SDAはデータ信号を伝送するデータ線であり、それぞれマイコン150を制御するCPU155に接続される。SCKはクロック線であり、シリアルポート151、152に対して共通の内部クロック信号が入力される。CPU155は、テーブル160を参照してシリアルポート151、152が受信したフレームに含まれる情報の内容を特定する。また、CPU150からシリアルポート151、152を経由してCANコントローラ110、120にフレームの作成と送信を指示する情報を送出する。
FIG. 3 is a block diagram showing an example of the internal configuration of the
図3に示しているシリアル通信は2線式であり、プロトコルとしては、例えば、I2C(Inter-Integrated Circuit、登録商標)バスを用いることができる。なお、図示していないが、3線のシリアル通信プロトコルを採用してもよく、その場合SPI(Serial Peripheral Interface、登録商標)などを用いることができる。 The serial communication shown in FIG. 3 is a two-wire system, and for example, an I2C (Inter-Integrated Circuit, registered trademark) bus can be used as a protocol. Although not shown, a three-wire serial communication protocol may be adopted, and in that case, SPI (Serial Peripheral Interface, registered trademark) or the like can be used.
図4は、テーブル160の例で、CPUに入力された信号に対応する処理を示すものである。ここで、シリアルポート番号161は、信号がシリアルポート151、152のいずれからの信号であるかを示すものである。メッセージID162は、信号が由来するフレームに含まれているIDであり、フレームの意図する処理を表すものである。テーブル160に示すように、シリアルポート番号161、メッセージID162の組み合わせに対応する処理内容163がテーブル160に登録されている。
FIG. 4 is an example of the table 160 and shows processing corresponding to a signal input to the CPU. Here, the
例えば、(シリアルポート1、メッセージID:#1)に対応する処理として、温度モジュールがこのフレーム(リモートフレーム)を受信した場合にデータを送信することを指示している。また、(シリアルポート1、メッセージID:#2)に対応する処理として、表示モジュールがこのフレーム(データフレーム)を受信した場合にデータを読み取って表示することを指示している。マイコン150は、温度モジュールでも、表示モジュールでもないので、これらメッセージを受信しても廃棄される。
For example, as a process corresponding to (
一方、(シリアルポート2、メッセージID:#1)に対応する処理は、エンジンモジュールがそのデータフレームを受信した場合にフレームに含まれるデータを読み取るように指示するものである。また、(シリアルポート2、メッセージID:#2)に対応する処理は、マイコンがこのフレーム(データフレーム)を受信した場合にデータを読み取って、所定の演算を行ってパラメータを求め、結果をエンジンモジュールへ送信することを指示している。後者のメッセージを受信した場合にはCPU155は所定の演算を行い、さらにその結果を含むデータフレームをエンジンモジュールへ送信する。
On the other hand, the process corresponding to (
図5は、CANコントローラ110が入力した受信フレームを処理する例を示すフローチャートである。CANI/F112は、入力した受信フレームから所定の情報を抽出し(S101)、メッセージフィルタ114に解析された情報を送信する(S102)。次にメッセージフィルタ114は、受信フレームの内容をマイコン150に送信する必要があるかどうかを判定し、送信が必要と判定された場合は(S103、Yes)、シリアルI/F116に解析された情報を送信し(S104)、送信先のシリアルポート151へ送信する(S105)。一方、受信フレームの内容をマイコン150に送信する必要がないと判定した場合は(S103、No)は、受信フレームを廃棄する(S106)。
FIG. 5 is a flowchart illustrating an example of processing a received frame input by the
例えば、CANコントローラ110が、(3)のオーバーロードフレームを受信した場合には、CANコントローラ110は、CANプロトコルに従い、CANコントローラ110はオーバーロードフラグを返信するが、オーバーロードフレーム自体はマイコン150に送信する必要はないと判定する。
For example, when the
また、CANコントローラ110は、(4)のエラーフレームを受信した場合には、エラーの状態に応じて、図示しないエラーカウンターの値を増加させるが、エラーフレーム自体はマイコン150に送信する必要はないと判定する。
In addition, when receiving the error frame (4), the
一方、(1)のデータフレーム、(2)のリモートフレームを受信した場合には、フレームからRTR(Remote Transmission Request)、メッセージIDなどが抽出される。ここでRTRはフレームがデータフレームであるかリモートフレームであるかを、メッセージIDは、データ内容や送信ノードを示す情報である。 On the other hand, when the data frame (1) and the remote frame (2) are received, an RTR (Remote Transmission Request), a message ID, and the like are extracted from the frame. Here, the RTR is information indicating whether the frame is a data frame or a remote frame, and the message ID is information indicating data contents or a transmission node.
なお、上記に示したCANコントローラの動作は、基本的な機能をいくつか示しただけだが、CANコントローラ110はCANプロトコルに規定される通信調停やエラー検出などの基本機能に関する処理も実行する。
The operation of the CAN controller described above shows only some basic functions, but the
また、CANコントローラは、メッセージフィルタ114は多種多様な選別機能を有し、マイコンの負荷を軽くするような、高機能なものであっても良い。
In addition, the CAN controller may have a high function such that the
図6は、CANコントローラ110からフレームを受信したマイコン150が受信したフレームを処理する例を示すフローチャートである。
FIG. 6 is a flowchart illustrating an example of processing a frame received by the
マイコン150は、シリアルポートをN個有し、CANバスの通信速度が高速な順で、番号の若いポートに接続されているものとする。まず、i=1にセットし(S201)、i番目のシリアルポート(以後、「シリアルポートi」などと呼ぶ)への受信の有無を調べ、受信がない場合は(S202 No)、i=i+1に増分して(S206)、i>Nでなければ(S207 No)S202へ戻り、i>Nなら(S207 Yes)S201へ戻る。
It is assumed that the
マイコン150は、S202で受信があった場合には(S202 Yes)、受信されたのがリモートフレームか否かを判定する(S203)。リモートフレームと判定した場合には(S203 Yes)、マイコン150は、メッセージIDを参照して、マイコン150自身が該リモートフレームに対しデータフレームを送信するかどうかを判定する(S204)。送信しないと判定した場合には(S204 No)、マイコン150は、フレームを受信したシリアルポートi以外のシリアルポートから受信したリモートフレームと同様のリモートフレームを送信するように指示し(S205)、処理を終了する。ここで、受信フレームがリモートフレームかどうかは、フレームに含まれる上述のRTRで判定することができる。
If there is a reception in S202 (S202 Yes), the
一方、マイコン150自身がデータフレームを送信すると判定した場合には(S204 Yes)、マイコン150は、CANコントローラ110からデータフレームを送信するようにシリアルポートiから指示を出力し(S209)、処理を終了する。
On the other hand, if the
また、受信されたのがリモートフレームでなかった場合は(S203 No)、上述のように、オーバーロードフレームとエラーフレームとは、CANコントローラ110で遮断されているため、受信したのはデータフレームなので、メッセージIDとデータを読み取って必要に応じて対応し(S208)、処理を終了する。
If the received frame is not a remote frame (No in S203), the overload frame and the error frame are blocked by the
以上、マイコン150がCANコントローラ、シリアルI/Fを介してCANバスからフレームを受信する手順の一例を示した。
Heretofore, an example of the procedure in which the
マイコン150は、データフレームの送信を要求するリモートフレームを受信した場合や、受信したデータが所定の条件を満たしていることを他のCANモジュールに通知する場合などには、CANコントローラにフレーム送信を指示する。図4の(シリアルポート2、メッセージID:#2)に対応する処理は、データが所定の条件を満たしていることを通知する例である。マイコン150からCANコントローラへのフレーム送信の指令処理を示すフローチャートの例を図7に示す。
When the
まず、CPUは送信内容と、送信対象とするCANバスに対応するシリアルポートを決定する(S301)。ここで送信は同一のCANバスに複数送出しても良いし、複数種類のCANバスの送出するものでも良い。次に送信フレームがデータフレームを含むかを判定し(S302)、データフレームを含まない場合は(S302 No)S304へ進み、データフレームを含む場合は(S302 Yes)送信データを決定して(S303)からS304に進む。ここで、マイコン150は図6と同様のものとする。S304で、i=1にセットされたのち、上記送信対象にシリアルポートiへの送信が含まれているかを調べ、送信が含まれていない場合は(S305 No)、i=i+1に増分して(S307)、i>Nでなければ(S308 No)S305へ戻る。上記送信対象にシリアルポートiへの送信が含まれている場合は(S305 Yes)、シリアルポートiに送信指令と決定した送信内容とを出力してから(S306)S307に進む。S308でi>Nなら(S308 Yes)処理を終了する。
First, the CPU determines the transmission contents and the serial port corresponding to the CAN bus to be transmitted (S301). Here, a plurality of transmissions may be transmitted to the same CAN bus, or a plurality of types of CAN buses may be transmitted. Next, it is determined whether the transmission frame includes a data frame (S302). If the data frame is not included (S302 No), the process proceeds to S304. If the data frame includes a data frame (S302 Yes), the transmission data is determined (S303). ) To S304. Here, the
図8は、前述の図7に示した、マイコン150からの指示に基づいて、フレーム送信指令が出されたシリアルI/Fに繋がれたCANコントローラ110が送信フレームを生成してCANバス10に送出する処理の例を示すフローチャートである。
In FIG. 8, based on the instruction from the
マイコン150から入力された送信指令は、シリアルI/F116を介し送信エンジン118に転送され(S401)、送信エンジン118は送られた送信指令から所定の情報を抽出してフレームを生成する(S402)。生成したフレームの送信が許可されれば(S403、Yes)、CANI/F112に生成したフレームを送信し(S404)、CANバス10に対応したCAN信号に変換して送信する(S405)。一方、フレーム送信が許可されなかった場合(S403、No)、所定時間待機後に(S406)、再度フレーム送信の許可を問い合わせる(S403)。
The transmission command input from the
ここで、フレーム送信が許可されないような場合には、例えば、CANコントローラ110自身のエラーカウンターが所定値を超えている場合がある。他に、CANバス10に繋がれた他のCANコントローラからエラーカウンターが所定値を超えていることを通知するエラーフレームを受信しているなどCANバス10上での通信がCANプロトコルで禁止される場合にもフレーム送信は許可されない。さらには、CANコントローラ110が送信フレーム用のバッファを有し、該バッファ上に生成したフレームより先に送信すべき未送信フレームが残っているような場合などCANコントローラ110自身の構成の問題でフレーム送信が許可されない場合もある。
Here, when frame transmission is not permitted, for example, the error counter of the
[実施例1の効果]
上述してきたように、本実施例に係る通信ユニットを用いることで、異なる通信速度のCANバス上のモジュール間の通信を、ゲートウェイなどを設けることなく、マイコンを介して実現できる。
[Effect of Example 1]
As described above, by using the communication unit according to the present embodiment, communication between modules on the CAN bus having different communication speeds can be realized via a microcomputer without providing a gateway or the like.
また、マイコンを介して異なる通信速度のCANバスにリモートフレームを選択的に送信することができるので、送信フレームの優先度に応じて適切な通信速度のCANバスを選択して送信する制御が実現する。 In addition, remote frames can be selectively transmitted to CAN buses with different communication speeds via a microcomputer, so that control for selecting and transmitting CAN buses with appropriate communication speeds according to the priority of transmission frames is realized. To do.
さらに、シリアルポート番号161とメッセージID162のペアに対し処理を割り当てるテーブルに基づいて処理を決定するので、同一のメッセージIDに対しシリアルポート毎に異なる処理を割り当てることができるので、処理の自由度が高くなる。
Furthermore, since the process is determined based on the table for assigning the process to the pair of the
さて、これまで開示の装置に関する実施例について説明したが、本発明は上述した実施例以外にも、種々の異なる形態にて実施されてよいものである。そこで、以下では、本発明に含まれる他の実施例を説明する。 Although the embodiments related to the disclosed apparatus have been described above, the present invention may be implemented in various different forms other than the above-described embodiments. Therefore, another embodiment included in the present invention will be described below.
上記実施例1では、図3のように、マイコン150の内部にテーブル160を備えた構成をとっていた。しかし、テーブル160を予めマイコン内部に所持せずに、外部から読み込ませる構成も考えられる。
In the first embodiment, as shown in FIG. 3, the
図9に示すマイコン150は、テーブル160を、USB(Universal Serial Bus)メモリやIC(Integrated Circuit)カードなどの外部メモリに格納してマイコンは該外部メモリからテーブル160を読み込む構成を示すものである。このように、着脱自在な外部メモリにマイコンの設定を格納すれば、その設定に基づきマイコンを動作させることができるので、マイコンの設定を別のマイコンに適用する処理が容易になる。
The
[実施例2の効果]
上述してきたように、本実施例ではCANメッセージに対する処理内容を示すテーブルを外部メモリに記憶させているので、メッセージに対する処理内容の変更が容易である。また、外部メモリの内容は、バックアップが容易であるし、その内容を他の大容量記憶に保存することで、複数の設定を容易に管理できる。
[Effect of Example 2]
As described above, in this embodiment, since the table indicating the processing contents for the CAN message is stored in the external memory, it is easy to change the processing contents for the message. The contents of the external memory can be easily backed up, and a plurality of settings can be easily managed by storing the contents in another large-capacity storage.
実施例1では、マイコン150は、図7のフローチャートに示すように、CANコントローラへフレーム送信を指令する場合、シリアルポート、送信内容を決定した上で、決定されたシリアルポートを介しCANコントローラへ送信指令、送信内容を出力している(S306)。
In the first embodiment, as illustrated in the flowchart of FIG. 7, when the
しかし、上記のようにフレーム送信するシリアルポートを1つに固定せずに、別のシリアルポートに変更したり、あるいは複数のシリアルポートから送信させたりするようにする制御が考えられる。 However, as described above, it is conceivable that the serial port for transmitting a frame is not fixed to one, but is changed to another serial port or transmitted from a plurality of serial ports.
具体的には、マイコンからCANコントローラへ送信指令を出す際に、CANコントローラにCANバスへの送信の可否を問い合わせるようにする。そして、送信が不可能な場合は問い合わせたCANコントローラからの送信を止め、代わりに、別のCANコントローラからの送信が可能になるのを待つようにS306でキューを制御してもよい。 Specifically, when a transmission command is issued from the microcomputer to the CAN controller, the CAN controller is inquired of whether or not transmission to the CAN bus is possible. If transmission is impossible, the queue may be controlled in step S306 so as to stop transmission from the inquired CAN controller and wait for transmission from another CAN controller instead.
上記のような制御を実現するための、出力キューとキューへの送信データ追加の例を、図10に示す。出力キュー170は、送信するシリアルポート番号171、メッセージID172、送信するデータ173、および待ち時間174を含んでいる。シリアルポート番号171はシリアルポート1が最も高速のCANバスに繋がれており、上にあるフレームほど送信の優先度が高くなっている。いま、S306で決定した送信データは、図10(a)では、送信データ177、178は、それぞれ矢印で示す出力するシリアルポートの待ちの最後部に挿入される。挿入後のキューは図10(b)のようになる。そして、図10(b)キューの上から順に出力可能な送信データが出力されていくことになる。上記のうち待ち時間174は、最初は送信データ177、178のように0だが、キューから送信データが出力される毎に、1ずつ加算されるようになっており、送信データがキューに登録されてから経過した時間を表している。
An example of the output queue and transmission data addition to the queue for realizing the above control is shown in FIG. The
いま、図10のように、高速なCANバスで通信されるデータは緊急性が高いので、そこに繋がれたシリアルポートの送信データが優先されるのは理にかなっている。しかし、通信速度の速い送信データが多い場合は通信速度の速い送信データのみが処理され、通信速度の遅いCANバスに対応するシリアルポートへの送信データは送信が大幅に遅延する恐れがある。そのような大幅な遅延を避けるために、待ち時間が所定の閾値を超えた送信データは、優先度の高いシリアルポートから送信されるように制御すればよい。 Now, as shown in FIG. 10, data communicated via a high-speed CAN bus is highly urgent, and it makes sense that priority is given to transmission data of a serial port connected thereto. However, when there is a lot of transmission data with a high communication speed, only the transmission data with a high communication speed is processed, and transmission of the transmission data to the serial port corresponding to the CAN bus with a low communication speed may be delayed significantly. In order to avoid such a large delay, transmission data whose waiting time exceeds a predetermined threshold may be controlled so as to be transmitted from a serial port having a high priority.
図11を用いて、所定の閾値を超えた送信データが生じた場合の制御を説明する。まず、送信データをキューから選び出す前に、登録されている送信データ中で、待ち時間が所定の閾値を超えたものがあるかどうかを調べる。図11(a)では、閾値が4と設定されており、矢印で示す最下行の送信データ179が待ち時間=5で、その条件に該当している。図11(b)で、当該送信データ179を抽出し、図11(c)で、抽出した送信データ179のシリアルポート番号を優先して処理されるようにシリアルポート番号1に変更し、同時に待ち時間を0に変更する。そして、変更した送信データ180を図11(d)でシリアルポート1の最後部に挿入する。このように処理することで、前記待ち時間が所定の閾値を超えた送信データの送信の順位が上がるので、キュー上の優先度の低いシリアルポートから送信される送信データの送信が大幅に遅延することが回避できる。
Control when transmission data exceeding a predetermined threshold occurs will be described with reference to FIG. First, before selecting transmission data from the queue, it is checked whether there is any registered transmission data whose waiting time exceeds a predetermined threshold. In FIG. 11A, the threshold value is set to 4, and the
なお、図11(c)では、抽出したシリアルポート3の送信データ179に対応する送信データ179を消去している。しかし、消去すると当該送信データは、当初送信先に設定されていたCANバスには送信されなくなるので、消去せずにそのまま残してもよい。
In FIG. 11C, the
[実施例3の効果]
上述してきたように、本実施例では 送信フレームの待ち時間が所定の時間を超えた場合に、より通信速度の高いCANバスから送信されるように制御するので、送信データの送信が大幅に遅延することを回避できる。
[Effect of Example 3]
As described above, in this embodiment, when the waiting time of a transmission frame exceeds a predetermined time, control is performed so that transmission is performed from a CAN bus having a higher communication speed, so transmission of transmission data is greatly delayed. Can be avoided.
10,20 CANバス
11,12,21,22 モジュール
100 通信ユニット
110,120 CANコントローラ
112 CANI/F
114 メッセージフィルタで
116 シリアルI/F
118 送信エンジン
150 マイコン
151,152 シリアルポート
155 CPU
160,170 テーブル
161,171 シリアルポート番号
162,172 メッセージID
163,173 処理内容
174 待ち時間
177,178,179,180 送信データ
10, 20
114 With
118
160, 170 Table 161, 171
163, 173
Claims (6)
前記CANコントローラとそれぞれ接続された複数のシリアルポートを介して、前記異なる通信速度のCANバスにそれぞれ接続された装置間のCAN通信を制御するマイコンと
を有することを特徴とする通信ユニット。 A plurality of CAN controllers respectively connected to CAN buses having different communication speeds;
A communication unit, comprising: a microcomputer for controlling CAN communication between devices connected to the CAN buses having different communication speeds via a plurality of serial ports respectively connected to the CAN controller.
ことを特徴とする請求項1または2に記載の通信ユニット。 The microcomputer controls the CAN communication with reference to a storage unit that stores definition information defining processing contents corresponding to a combination of the identification information of the serial port and the identification information of the CAN message. The communication unit according to claim 1 or 2.
ことを特徴とする請求項1〜3のいずれか一つに記載の通信ユニット。 The communication unit according to claim 1, wherein the microcomputer accesses the serial port in descending order of communication speed of a connected CAN bus and transmits a CAN signal.
ことを特徴とする請求項1〜4のいずれか一つに記載の通信ユニット。 In response to a CAN message whose transmission standby time exceeds a predetermined value, the microcomputer changes the transmission source to a serial port corresponding to a CAN bus whose communication speed is higher than the serial port currently set as the transmission source. The communication unit according to any one of claims 1 to 4, characterized in that:
異なる通信速度のCANバス上のCANメッセージを選別し、
選別されたCANメッセージをシリアル信号に変換し、
前記CANメッセージを、当該CANメッセージが入力されたシリアルポートのIDと当該CANメッセージのIDとに基づいて制御する、
処理を実行させることを特徴とするCAN通信制御プログラム。 On the computer,
Select CAN messages on CAN bus with different communication speeds,
Convert the selected CAN message into a serial signal,
Controlling the CAN message based on the ID of the serial port to which the CAN message is input and the ID of the CAN message;
A CAN communication control program for executing a process.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014091833A JP2015210667A (en) | 2014-04-25 | 2014-04-25 | Communication unit and can(control area network) communication control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014091833A JP2015210667A (en) | 2014-04-25 | 2014-04-25 | Communication unit and can(control area network) communication control program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015210667A true JP2015210667A (en) | 2015-11-24 |
Family
ID=54612801
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014091833A Pending JP2015210667A (en) | 2014-04-25 | 2014-04-25 | Communication unit and can(control area network) communication control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015210667A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2571302A (en) * | 2018-02-23 | 2019-08-28 | Grey Orange Pte Ltd | Hybrid can bus system |
-
2014
- 2014-04-25 JP JP2014091833A patent/JP2015210667A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2571302A (en) * | 2018-02-23 | 2019-08-28 | Grey Orange Pte Ltd | Hybrid can bus system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9170569B2 (en) | Method for electing an active master device from two redundant master devices | |
JP2016032274A (en) | Gateway unit | |
US11467566B2 (en) | Communication device, communication terminal, communication device and method for operating a communication system for transmitting time-critical data | |
JP2014045421A (en) | Network system | |
US10176128B2 (en) | Communication system for inter-chip communication | |
JP2006191337A (en) | Gateway device for transferring message between buses and network system using the device | |
CN110268348B (en) | Control device, control method, and computer-readable recording medium | |
CN104426793A (en) | Apparatus For Controlling Network Traffic | |
US20190268300A1 (en) | Communication device and method of controlling communication device | |
US9882737B2 (en) | Network system | |
JP2015210667A (en) | Communication unit and can(control area network) communication control program | |
WO2014007067A1 (en) | Communication system, relay apparatus and communication apparatus | |
JP2021166335A (en) | On-vehicle relay device, information processing method, and program | |
JP5458968B2 (en) | Safety control system | |
JP5728043B2 (en) | Gateway device | |
CN108243244B (en) | Vehicle-mounted communication system and control method thereof | |
JP4361540B2 (en) | Gateway device, data transfer method, and program | |
JP4873220B2 (en) | Field communication system | |
US20220137604A1 (en) | Coordination Device and Method for Providing Control Applications via a Communication Network for Transmitting Time-Critical Data | |
US11226611B2 (en) | Control device, control method, and control program | |
JP6276738B2 (en) | CAN communication unit and CAN communication program | |
JP2018055318A (en) | Electronic apparatus and program | |
JP7277206B2 (en) | Communication control device and method | |
JP6183281B2 (en) | Communication system and electronic control device | |
JP2012114724A (en) | Electronic control device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20151104 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20151221 |