[go: up one dir, main page]

JP2008048395A - Master / slave synchronous communication system - Google Patents

Master / slave synchronous communication system Download PDF

Info

Publication number
JP2008048395A
JP2008048395A JP2007189059A JP2007189059A JP2008048395A JP 2008048395 A JP2008048395 A JP 2008048395A JP 2007189059 A JP2007189059 A JP 2007189059A JP 2007189059 A JP2007189059 A JP 2007189059A JP 2008048395 A JP2008048395 A JP 2008048395A
Authority
JP
Japan
Prior art keywords
slave
master
synchronous communication
cycle
timing
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
Application number
JP2007189059A
Other languages
Japanese (ja)
Inventor
Toshiyuki Miyamatsu
利行 宮松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yaskawa Electric Corp
Original Assignee
Yaskawa Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yaskawa Electric Corp filed Critical Yaskawa Electric Corp
Priority to JP2007189059A priority Critical patent/JP2008048395A/en
Publication of JP2008048395A publication Critical patent/JP2008048395A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

【課題】 IEEE1394ネットワーク上に接続されたマスタと全スレーブが制御周期内に制御データの授受を行う同期通信システムにおいて、制御周期によらず、通信遅延を一定にする。
【解決手段】 マスタは、同期単位、制御周期、スレーブ数に基いて、マスタの制御データの送受信のタイミングや制御処理のタイミングが設定された同期通信管理テーブルを作成する。また、その同期通信管理テーブルに基いてスレーブの制御データの送受信のタイミングや指令実行や応答作成のタイミングが設定された同期通信情報データテーブルを作成しスレーブに通知する。マスタとスレーブは、それらの同期通信管理テーブルおよび同期通信情報データテーブルに従って通信する。
また、制御周期が複数ある場合は、タイミングを同期単位だけずらした同期通信管理テーブルおよび同期通信情報データテーブルを作成する。
【選択図】図1
PROBLEM TO BE SOLVED: To make a communication delay constant regardless of a control cycle in a synchronous communication system in which a master and all slaves connected on an IEEE 1394 network exchange control data within a control cycle.
A master creates a synchronous communication management table in which master control data transmission / reception timing and control processing timing are set based on a synchronization unit, a control cycle, and the number of slaves. Also, based on the synchronous communication management table, a synchronous communication information data table in which slave control data transmission / reception timing, command execution and response generation timing are set is created and notified to the slave. The master and the slave communicate according to their synchronous communication management table and synchronous communication information data table.
When there are a plurality of control cycles, a synchronous communication management table and a synchronous communication information data table in which the timing is shifted by the synchronization unit are created.
[Selection] Figure 1

Description

本発明は、IEEE1394ネットワークを使用したマスタとスレーブの同期通信システムおよび同期通信方式に関する。   The present invention relates to a master-slave synchronous communication system and synchronous communication system using an IEEE 1394 network.

従来のIEEE1394通信システムのアイソクロナス転送は、アイソクロナス転送をする機器は、予め、Isochronous Resource Manager(以下、IRMとする)から帯域幅とチャネルを獲得し、サイクル開始パケットを受けると、バスの使用権を獲得した機器がデータを送信する。各通信機器はアイソクロナス転送期間にバスの使用権を順に獲得してデータを送信するようになっている(例えば非特許文献1参照)。   In the isochronous transfer of the conventional IEEE 1394 communication system, the device that performs the isochronous transfer acquires the bandwidth and channel from the isochronous resource manager (hereinafter referred to as IRM) in advance, and when the cycle start packet is received, the right to use the bus is obtained. The acquired device sends data. Each communication device acquires the right to use the bus in order during the isochronous transfer period and transmits data (for example, see Non-Patent Document 1).

通常、アイソクロナス転送期間で、すべての通信機器はデータを転送する仕組みになっているので、新たな機器を追加したいが残っている帯域が獲得したい帯域より少ない場合には、一つの機器に対するデータが減ってしまうか、新たな機器の追加ができないことになる。   Normally, all communication devices are configured to transfer data during the isochronous transfer period, so if you want to add a new device but the remaining bandwidth is less than the bandwidth you want to acquire, the data for one device will be It will decrease, or you will not be able to add new equipment.

このような問題に対して、アイソクロナスサイクルの整数倍を制御周期として、マスタが制御対象のスレーブを制御周期分のアイソクロナスサイクルに送信可能な数だけ割り付け、その割り付けに従って、順にスレーブと制御データの授受を行うことで、汎用な高速通信ネットワークであるIEEE1394を使用したマスタとスレーブの同期通信システムか構築できるようにする技術が開示されている。これを図18、図19を用いて説明する。 To solve such a problem, the control cycle is an integer multiple of the isochronous cycle, the master assigns the number of slaves to be controlled to the isochronous cycle for the control cycle, and the control data is transferred to and from the slaves in order according to the assignment. By performing the above, there is disclosed a technique that enables construction of a master-slave synchronous communication system using IEEE 1394, which is a general-purpose high-speed communication network. This will be described with reference to FIGS.

図18は、1局のマスタと8局のスレーブが500μsの制御周期で同期通信するための通信タイミング管理テーブルであり、1アイソクロナスサイクルに4局分割り付けられ、500μs分に相当する4アイソクロナスサイクルのうち先頭の2アイソクロナスサイクルを使用して通信を行うよう設定されている。図19は図18の通信タイミング管理テーブルに従い通信をしたタイミングチャートであり、500μsの最初の125μsでマスタがスレーブ1〜4までへの指令データC1〜C4を送信し、スレーブ1〜4はマスタへの応答データR1〜R4を送信している。さらに2番目のアイソクロナスサイクルである125μs〜250μsの間にマスタがスレーブ5〜8までへの指令データC5〜C8を送信し、スレーブ5〜8はマスタへの応答データR5〜R8を送信している。(特許文献1参照)
特開2005−229142号公報(図2、3) IEEE Std 1394-1995, IEEE Standard for a High Performance Serial Bus
FIG. 18 is a communication timing management table for synchronously communicating one master station and eight slave stations with a control period of 500 μs, and is divided into four isochronous cycles, with four isochronous cycles corresponding to 500 μs. Of these, communication is set to be performed using the first two isochronous cycles. FIG. 19 is a timing chart in which communication is performed in accordance with the communication timing management table of FIG. 18. In the first 125 μs of 500 μs, the master transmits command data C1 to C4 to the slaves 1 to 4, and the slaves 1 to 4 transmit to the master. Response data R1 to R4 are transmitted. Further, during the second isochronous cycle of 125 μs to 250 μs, the master transmits command data C5 to C8 to the slaves 5 to 8, and the slaves 5 to 8 transmit response data R5 to R8 to the master. . (See Patent Document 1)
Japanese Patent Laying-Open No. 2005-229142 (FIGS. 2 and 3) IEEE Std 1394-1995, IEEE Standard for a High Performance Serial Bus

しかしながら、特許文献1に記載されている同期通信システムでは、図20に示すように、マスタの制御部と通信部、スレーブの制御部と通信部は、制御周期(アイソクロナスサイクルの整数倍)で同期してデータの送受信を行っている。
すなわち、ある制御周期Nに注目すると、2周期前の制御周期N−2のサイクルカウンタが#3のアイソクロナスサイクルで全スレーブの制御部が一斉に応答データを作成し、スレーブ通信部へ渡す。スレーブ通信部は制御周期N−1の決められたアイソクロナスサイクルで応答データを送信する。
マスタ通信部は、制御周期N−1のサイクル毎に応答データを受信し、次の制御周期Nのサイクルカウンタが#0のサイクルで全スレーブの応答データをマスタ制御部に渡し、マスタ制御部はその制御周期内で応答データを基に指令データを作成し、マスタ通信部へ指令データを渡す。
マスタ通信部は制御周期N+1で順に各スレーブに指令データを送信する。
そして、スレーブ通信部は制御周期分経過後の制御周期N+2のサイクルカウンタ#0で一斉に指令データをスレーブ制御部に渡している。
However, in the synchronous communication system described in Patent Document 1, as shown in FIG. 20, the master control unit and the communication unit, and the slave control unit and the communication unit are synchronized in the control cycle (an integral multiple of the isochronous cycle). Data transmission / reception.
That is, when paying attention to a certain control cycle N, the control units of all slaves simultaneously generate response data in the isochronous cycle of # 3 in the cycle counter of the control cycle N-2 two cycles before and pass it to the slave communication unit. The slave communication unit transmits response data in the determined isochronous cycle of the control cycle N-1.
The master communication unit receives the response data for each cycle of the control cycle N−1, passes the response data of all slaves to the master control unit in the cycle in which the cycle counter of the next control cycle N is # 0, and the master control unit Command data is created based on the response data within the control cycle, and the command data is passed to the master communication unit.
The master communication unit transmits command data to each slave in order at a control cycle N + 1.
And the slave communication part delivers command data to the slave control part all at once by the cycle counter # 0 of the control period N + 2 after the lapse of the control period.

すなわち、スレーブからマスタへの応答データの送信、その応答データに基く次の指令データの作成、その指令データのスレーブへの送信、その指令データのスレーブでの処理の実行が、制御周期に同期して実行されていた。
従って、応答データの受信・指令データの送信のそれぞれで通信にかかる遅れ(以降、通信遅延と呼ぶ)に制御周期が含まれており、図19のサイクル#2、#3ように通信が行われないアイソクロナスサイクルが有っても、通信遅延は制御周期より短くならず、制御性能の向上の妨げになるという問題があった。
また、制御処理に時間がかかるために制御周期が長くなるシステムでは、通信遅延が長くなり、制御性能の向上の妨げになるという問題があった。
本発明は、このような問題点に鑑みてなされたものであり、マスタがスレーブからの応答データを受信し、スレーブへの指令データを作成し、それをスレーブへ送信するタイミング、および、スレーブがマスタから指令データを受信し、その指令データを実行し、マスタへの応答データを作成し、マスタへ送信するタイミングを定めたテーブルを自動的に生成し、該テーブルをマスタとスレーブに備え、通信遅延を確実に制御周期以下の一定値に抑制したマスタ・スレーブ同期通信システムを提供するものである。
That is, transmission of response data from the slave to the master, creation of the next command data based on the response data, transmission of the command data to the slave, execution of processing of the command data in the slave are synchronized with the control cycle. Was running.
Therefore, the control period is included in the delay (hereinafter referred to as “communication delay”) of communication in response data reception and command data transmission, and communication is performed as shown in cycles # 2 and # 3 in FIG. Even if there is no isochronous cycle, the communication delay is not shorter than the control cycle, which hinders improvement in control performance.
Further, in a system in which the control cycle is long because control processing takes time, there is a problem that communication delay becomes long and hinders improvement in control performance.
The present invention has been made in view of such problems. The master receives response data from the slave, creates command data for the slave, and transmits the command data to the slave. Receives command data from the master, executes the command data, creates response data to the master, automatically generates a table that defines the timing for transmission to the master, prepares the table in the master and slave, and communicates The present invention provides a master / slave synchronous communication system in which the delay is reliably suppressed to a constant value equal to or less than the control period.

上記問題を解決するため、本発明は、次のようにするものである。
請求項1に記載の発明は、1局のマスタと1局以上のスレーブがIEEE1394ネットワーク上に接続され、アイソクロナスサイクルの整数倍の制御周期に同期して、前記マスタと前記スレーブが通信するマスタ・スレーブ同期通信システムにおいて、
前記マスタが、全ての前記スレーブとの通信に必要なアイソクロナスサイクル単位での時間を意味する同期単位を、前記スレーブからの受信の場合には前記制御周期の最後から設定し、前記スレーブへの送信の場合には前記同期単位を前記制御周期の最初から設定した同期通信管理テーブルを備え、
前記スレーブが、前記マスタへの送信の場合には前記同期単位を前記制御周期の最後から設定し、前期マスタからの受信の場合には前記同期単位を前記制御周期の最初から設定した同期通信情報データテーブルを備えたことを特徴とするものである。
In order to solve the above problems, the present invention is as follows.
According to the first aspect of the present invention, a master station in which one master and one or more slaves are connected to an IEEE 1394 network, and the master and the slave communicate with each other in synchronization with a control cycle that is an integral multiple of an isochronous cycle. In a slave synchronous communication system,
In the case of reception from the slave, a synchronization unit that means a time in an isochronous cycle unit necessary for communication with all the slaves is set from the end of the control cycle, and transmission to the slave is performed by the master. In the case of, comprising a synchronous communication management table in which the synchronization unit is set from the beginning of the control cycle,
Synchronous communication information in which the slave sets the synchronization unit from the end of the control cycle when transmitting to the master, and sets the synchronization unit from the beginning of the control cycle when receiving from the previous period master. A data table is provided.

また、請求項2に記載の発明は、請求項1に記載の発明において、前記マスタが備える前記同期通信管理テーブルが、前記マスタが前記スレーブへの指令データを作成する制御処理を起動するタイミングと、前記マスタが送信する前記スレーブの数と前記スレーブ番号および前記マスタが受信する前記スレーブの数と前記スレーブ番号とを前記タイミング毎に保持し、
前記スレーブが備える前記同期通信情報データテーブルが、前記スレーブが、前記マスタから指令データを受信する前記タイミングと、前記指令データを実行する前記タイミングと、前記マスタへの応答データを作成する前記タイミングと、前記マスタへ応答データを送信する前記タイミングとを保持することを特徴とするものである。
The invention according to claim 2 is the timing according to the invention according to claim 1, wherein the synchronous communication management table provided in the master starts a control process in which the master creates command data for the slave. The number of slaves and the slave number transmitted by the master and the number of slaves and the slave number received by the master are held for each timing,
The synchronous communication information data table included in the slave includes the timing at which the slave receives command data from the master, the timing at which the command data is executed, and the timing at which response data to the master is created. And the timing for transmitting response data to the master.

また、請求項3に記載の発明は、請求項1に記載の発明において、前記マスタに備えられたスレーブ割付部が、あらかじめ設定された前記同期単位と前記制御周期と、前記同期単位内において通信する前記スレーブ数と、前記スレーブをユニークに指定するスレーブ番号の配列とから構成される制御周期データをもとに前記同期通信管理テーブルを作成し、該同期通信管理テーブルに基づいて前記同期通信情報データテーブルを作成することを特徴とするものである。   According to a third aspect of the present invention, in the first aspect of the present invention, the slave allocating unit provided in the master communicates within the preset synchronization unit, the control period, and the synchronization unit. The synchronous communication management table is created based on control period data composed of the number of slaves to be performed and an array of slave numbers that uniquely specify the slaves, and the synchronous communication information is based on the synchronous communication management table It is characterized by creating a data table.

また、請求項4に記載の発明は、請求項1に記載の発明において、前記マスタが、前記同期通信管理テーブルに従い、前記制御処理を起動するタイミングを検出すると前記制御処理を実行し、前記スレーブからの受信タイミングを検出すると受信を実行し、前記スレーブへの送信タイミングを検出すると送信を実行し、
前記スレーブが、前記同期通信情報データテーブルに従い、前記指令データを受信するタイミングを検出すると前記マスタからの指令データを受信し、前記指令データを実行するタイミングを検出すると前記指令データの処理を実行し、前記応答データを作成するタイミングを検出すると前記応答データを作成し、前記応答データを送信するタイミングを検出すると前記マスタへ前記応答データを送信することを特徴とするものである。
According to a fourth aspect of the present invention, in the first aspect of the present invention, when the master detects a timing for starting the control process according to the synchronous communication management table, the control process is executed, and the slave When the reception timing from is detected, reception is performed, and when the transmission timing to the slave is detected, transmission is performed,
According to the synchronous communication information data table, the slave receives command data from the master when detecting the timing to receive the command data, and executes processing of the command data when detecting the timing to execute the command data. The response data is generated when the response data generation timing is detected, and the response data is transmitted to the master when the response data transmission timing is detected.

また、請求項5に記載の発明は、請求項1〜請求項4の何れかに記載の発明において、前記マスタと前記スレーブが通信する前記制御周期が複数存在し、前記スレーブは前記制御周期毎にグループ化され、前記グループ毎に前記同期単位ずつ前記制御周期をずらして前記同期通信管理テーブルと前記同期通信情報データテーブルを作成することを特徴とするものである。   The invention according to claim 5 is the invention according to any one of claims 1 to 4, wherein there are a plurality of the control cycles in which the master and the slave communicate, and the slave is in each control cycle. The synchronous communication management table and the synchronous communication information data table are created by shifting the control cycle by the synchronization unit for each group.

また、請求項6に記載の発明は、請求項1〜5の何れかに記載の発明において、前記スレーブ割付部が前期制御周期データをもとに同期通信管理テーブルを作成する際に、前期同期単位内に通信を行わないアイソクロナスサイクルを検出すると、前記同期単位を最適値に短縮することを特徴とするものである。   According to a sixth aspect of the present invention, in the invention according to any of the first to fifth aspects, when the slave allocation unit creates a synchronous communication management table based on the previous period control period data, When an isochronous cycle that does not perform communication within a unit is detected, the synchronization unit is shortened to an optimum value.

また、請求項7に記載の発明は、請求項1〜5の何れかに記載の発明において、前期スレーブ割付部が前期制御周期データをもとに同期通信管理テーブルを作成する際に、通信にかかる時間が前期同期単位を超えることを検出すると、前記同期単位を最適値に延長することを特徴とするものである。   Further, in the invention according to claim 7, in the invention according to any one of claims 1 to 5, communication is performed when the slave allocation unit prepares the synchronous communication management table based on the control period data of the previous period. When it is detected that the time exceeds the previous synchronization unit, the synchronization unit is extended to an optimum value.

また、請求項8に記載の発明は、請求項1〜7の何れかに記載の発明において、前期マスタもしくは前期スレーブもしくは前期マスタおよび前期スレーブは最適化された前記同期単位をユーザーに通知することを特徴とするものである。   The invention according to claim 8 is the invention according to any one of claims 1 to 7, wherein the first-term master or first-term slave or first-term master and first-term slave notifies the user of the optimized synchronization unit. It is characterized by.

請求項1〜請求項4に記載の発明によれば、マスタとスレーブは、マスタに備えられた同期通信管理テーブルと、スレーブに備えられた同期通信情報データテーブルに基いて、
制御周期以下の同期単位で通信を行うので、通信遅延は同期単位のまま一定となり、制御性能の向上を図ることができる。
また、マスタでの制御処理に時間がかかり制御周期が長くなっても通信遅延は同期単位のまま一定となり、制御性能の向上を図ることができる。
According to the invention described in claims 1 to 4, the master and the slave are based on the synchronous communication management table provided in the master and the synchronous communication information data table provided in the slave.
Since communication is performed in synchronization units equal to or less than the control period, the communication delay remains constant in the synchronization units, and control performance can be improved.
Further, even if the control process in the master takes time and the control cycle becomes long, the communication delay remains constant in the synchronization unit, and the control performance can be improved.

請求項5に記載の発明によれば、制御周期が異なるグループ毎に通信タイミングを同期単位だけずらしながら、制御周期以下の同期単位で通信データの授受を行うので、各グループの通信遅延は同期単位のまま一定となり、制御性能の向上を図ることができる。
また、マスタでの制御処理に時間がかかり制御周期が長くなっても、通信遅延は同期単位のまま一定となり、制御性能の向上を図ることができる。
According to the fifth aspect of the present invention, since communication data is exchanged in synchronization units equal to or less than the control period while shifting the communication timing by the synchronization unit for each group having a different control period, the communication delay of each group is the synchronization unit. As a result, the control performance can be improved.
Moreover, even if the control processing at the master takes time and the control cycle becomes long, the communication delay remains constant in the synchronization unit, and the control performance can be improved.

また、スレーブをグループ化して制御することで、一つの制御周期で複数の機能の指令データを作成する必要が無くなる。
例えば2足歩行ロボットの下半身と上半身のようにグループを分け、ロボットが転倒しないように、より応答性能が求められる下半身は制御周期も短く設定し、逆にマスタの負荷を軽減させるため、上半身の制御周期を長く設定しても、通信遅延は一定となり、制御性能を確保することが出来る。
例えば同じ制御周期でも双腕ロボットの右腕と左腕をそれぞれ別のグループにすることで、1つのグループ内のスレーブ数が減り、グループ毎にスレーブと制御データの授受にかかるアイソクロナスサイクルが短くなるため、右腕と左腕との間の動作は、制御に影響のない程度で同期を確保しつつ、それぞれの通信遅延は短くなり、片腕としての性能を向上させることが出来る。
Further, by controlling slaves in groups, it is not necessary to create command data for a plurality of functions in one control cycle.
For example, the lower body and upper body of a biped robot are divided into groups, and the lower body that requires more response performance is set to have a shorter control cycle so that the robot does not fall down. Even if the control cycle is set to be long, the communication delay is constant and the control performance can be ensured.
For example, by making the right arm and left arm of a double-arm robot in separate groups even in the same control cycle, the number of slaves in one group is reduced, and the isochronous cycle for transferring control data to and from each group is shortened. The operation between the right arm and the left arm ensures synchronization without affecting control, and each communication delay is shortened, so that the performance as one arm can be improved.

請求項6〜7に記載の発明によれば、自動的に最適な同期単位で動作することが可能となり、通信速度や、ハードウェアの制約等により、1アイソクロナスサイクル内に通信可能なスレーブ数が変わる度に、設定を変更する必要がなくなる。   According to the inventions described in claims 6 to 7, it is possible to automatically operate in an optimum synchronization unit, and the number of slaves that can communicate within one isochronous cycle depends on the communication speed, hardware restrictions, and the like. There is no need to change the settings each time it changes.

請求項8に記載の発明によれば、請求項6〜7で最適化された同期単位を認識することが可能となり、通信遅延を考慮したアプリケーションプログラムを作成することができる。   According to the eighth aspect of the present invention, the synchronization unit optimized in the sixth to seventh aspects can be recognized, and an application program can be created in consideration of communication delay.

以下、本発明の方法の具体的実施例について、図に基づいて説明する。   Hereinafter, specific examples of the method of the present invention will be described with reference to the drawings.

まず、以下の説明の中で出てくる、IEEE1394規格にて規定された機能名、信号名について説明しておく   First, function names and signal names defined in the IEEE 1394 standard, which appear in the following description, will be described.

図14はIEEE1394機器が持つコンフィグレーションROMの最小形式のフォーマットを表す図であり、ベンダーIDと言う、ベンダー固有の情報を表す、24ビットのvendor_idが含まれる。   FIG. 14 is a diagram showing the format of the minimum format of the configuration ROM possessed by the IEEE 1394 equipment, and includes a vendor ID called 24-bit vendor_id representing vendor-specific information.

図15はIEEE1394機器が持つコンフィグレーションROMの一般形式のフォーマットを表す図であり、図16は図15に含まれるbus_info_blockのフォーマットを表す図である。図14と同様のベンダーID(node_vendor_id)や、ベンダー内で機器を固有にする、8ビットのchip_id_hiと32ビットのchip_id_loを連結した40ビットのチップIDが含まれる。ベンダーIDとチップIDをあわせた64ビットの情報はEUI−64(Extended Unique Identifer、拡張固有識別子、64ビット)と呼ばれ全てのIEEE1394機器の中で、ユニークに識別できる情報である。   FIG. 15 is a diagram illustrating a general format format of a configuration ROM included in the IEEE 1394 device, and FIG. 16 is a diagram illustrating a format of a bus_info_block included in FIG. 14 includes a vendor ID (node_vendor_id) similar to that in FIG. 14 and a 40-bit chip ID in which an 8-bit chip_id_hi and a 32-bit chip_id_lo are concatenated to make a device unique within the vendor. The 64-bit information combining the vendor ID and the chip ID is called EUI-64 (Extended Unique Identifier, extended unique identifier, 64 bits), and is information that can be uniquely identified in all IEEE 1394 devices.

図17はIEEE1394機器が持つCYCLE_TIMEレジスタのフォーマットを表す図であり、secound_countや、cycle_count、cycle_offsetが含まれる。secound_countはcycle_countからの桁上がりが発生するたびに増加し、値が127のときに増加すると循環して0に戻る。cycle_countはcycle_offsetからの桁上がりが発生するたびに増加し、値が7999のときに増加すると循環して0に戻り、secound_countに桁上がりする。cycle_countの単位は125μsである。cycle_offsetは24.576MHzのローカルクロックの1ティックごとに増加し、値が3071のときに増加すると、循環して0に戻り、cycle_countに桁上がりする。   FIG. 17 is a diagram showing the format of the CYCLE_TIME register of the IEEE 1394 device, and includes second_count, cycle_count, and cycle_offset. Second_count increases each time a carry from cycle_count occurs, and when it increases when the value is 127, it circulates and returns to zero. The cycle_count increases each time a carry from the cycle_offset occurs. When the value increases when the value is 7999, the cycle_count circulates back to 0, and rises to the second_count. The unit of cycle_count is 125 μs. The cycle_offset increases every tick of the 24.576 MHz local clock. When the value increases when the value is 3071, it cyclically returns to 0 and is carried to the cycle_count.

サイクル開始パケットとは、IEEE1394規格にて規定されているアイソクロナスサイクルの開始を示すパケットのことで固有周期の125μs毎にサイクルマスタとなった機器が送信する。   The cycle start packet is a packet indicating the start of an isochronous cycle defined in the IEEE 1394 standard, and is transmitted by the device that becomes the cycle master every 125 μs of the natural period.

図1は、本発明の実施例を示すマスタ・スレーブ同期通信システムの構成図である。図において1はマスタ、2i(i=1、2、・・・n)はスレーブ、3はIEEE1394ネットワークである。 FIG. 1 is a configuration diagram of a master-slave synchronous communication system showing an embodiment of the present invention. In the figure, 1 is a master, 2i (i = 1, 2,... N) is a slave, and 3 is an IEEE 1394 network.

マスタ1は、制御周期データ11と、スレーブ検出部12と、スレーブ検出部12により検出された接続スレーブ情報121と、通信タイミング等の割付を行うスレーブ割付部13と、割り付けられた同期通信用の情報を格納する同期通信管理テーブル14と、処理タイミングを算出するサイクル開始パケット受信処理部15と、指令データ送信部16と送信する指令データ161と、応答データ受信部17と受信した応答データ171と、応答データ171を読み込み、指令データ161を作成する制御処理部18とで構成される。   The master 1 includes a control cycle data 11, a slave detection unit 12, a connection slave information 121 detected by the slave detection unit 12, a slave allocation unit 13 that allocates communication timings, etc., and an allocated synchronous communication A synchronous communication management table 14 for storing information, a cycle start packet reception processing unit 15 for calculating processing timing, a command data transmitting unit 16 and command data 161 to be transmitted, a response data receiving unit 17 and received response data 171 The control processing unit 18 reads the response data 171 and creates the command data 161.

但し、請求項1〜2および4に記載のシステムでは、同期通信管理テーブル14は予めプログラムとして作成されていてもよいし、他の機器から設定させるなど、別の手段でマスタ1へ通知してもよく、制御周期データ11、スレーブ検出部12、接続スレーブ情報121、スレーブ割付部13は省くことも出来る。 However, in the systems according to claims 1 to 2 and 4, the synchronous communication management table 14 may be created as a program in advance, or may be set by other devices to notify the master 1 by other means. Alternatively, the control cycle data 11, the slave detection unit 12, the connection slave information 121, and the slave allocation unit 13 can be omitted.

一方、スレーブ2iは、指令データ受信部2i1と受信した指令データ2i11と、応答データ2i2と送信する応答データ2i21と、送受信処理を行う同期通信処理部2i3と、各処理タイミングが格納された同期通信情報データテーブル2i31と、各処理タイミングを算出するサイクル開始パケット受信処理2i4と、応答データを作成する応答作成部2i5と、指令データを実行する指令処理部2i6とで構成される。 On the other hand, the slave 2i includes a command data receiving unit 2i1, received command data 2i11, response data 2i2, response data 2i21 to be transmitted, a synchronous communication processing unit 2i3 for performing transmission / reception processing, and synchronous communication in which each processing timing is stored. An information data table 2i31, a cycle start packet reception process 2i4 for calculating each processing timing, a response creation unit 2i5 for creating response data, and a command processing unit 2i6 for executing command data.

図2は、本発明の第1の実施例となる制御周期データの詳細図で、図1の制御周期データ11の詳細図であり、同期単位、スレーブを分けたグループ数、制御周期、制御スレーブ数と制御スレーブ番号で構成される。本実施例では、同期単位を250μsとし、制御周期を500μs、制御スレーブ数を4局、制御スレーブ番号をS1,S2,S3,S4とした1つのグループの例を示している。
なお、同期単位とは、マスタが全てのスレーブと通信(受信または送信)を行うために必要な連続したアイソクロナスサイクル数分の時間であってアイソクロナスサイクル時間である125μsを単位とした時間である。
FIG. 2 is a detailed diagram of the control cycle data according to the first embodiment of the present invention, and is a detailed diagram of the control cycle data 11 of FIG. 1, in which the synchronization unit, the number of groups into which the slave is divided, the control cycle, and the control slave It consists of a number and a control slave number. In the present embodiment, an example of one group in which the synchronization unit is 250 μs, the control cycle is 500 μs, the number of control slaves is 4, and the control slave numbers are S1, S2, S3, and S4 is shown.
The synchronization unit is a time corresponding to the number of consecutive isochronous cycles required for the master to communicate (receive or transmit) with all the slaves, and is a time in units of 125 μs, which is an isochronous cycle time.

図3は、本発明の第1の実施例となる、図1の同期通信管理テーブル14の詳細図である。同期通信管理テーブル14は制御周期に相当するアイソクロナスサイクルのサイクル数が格納される全サイクル数と、マスタの制御処理起動タイミングと、各サイクルにおいて指令データを送信するスレーブ数を表す送信スレーブ数、送信先のスレーブを表す送信スレーブ番号、応答データを受信するスレーブ数を表す応答スレーブ数、送信元のスレーブを表す受信スレーブ番号から構成される。本発明の実施例として図2の制御周期データと同じ設定の制御周期500μsでスレーブ4局の設定で、1サイクルで通信できるスレーブ数が2局の場合のデータを示している。 FIG. 3 is a detailed view of the synchronous communication management table 14 of FIG. 1 according to the first embodiment of this invention. The synchronous communication management table 14 includes the total number of cycles in which the number of isochronous cycles corresponding to the control cycle is stored, the control processing start timing of the master, the number of transmission slaves indicating the number of slaves that transmit command data in each cycle, and the transmission It consists of a transmission slave number that represents the previous slave, a response slave number that represents the number of slaves that receive response data, and a reception slave number that represents the source slave. As an embodiment of the present invention, data is shown in the case where the number of slaves that can communicate in one cycle is set in four slave stations with the same control cycle 500 μs as the control cycle data in FIG.

ここで、サイクル#はサイクル開始パケット受信時のCYCLE_TIMEのcycle_count値を制御周期に相当するアイソクロナスサイクル数で割った時の余り(剰余)の値とする。つまり、0〜アイソクロナスサイクル数−1の値を循環して増加する値となり、各タイミングの値はサイクル#が設定値となったタイミングを意味する。   Here, cycle # is the value of the remainder (remainder) when the cycle_count value of CYCLE_TIME at the time of receiving the cycle start packet is divided by the number of isochronous cycles corresponding to the control period. That is, the value increases by circulating 0 to the number of isochronous cycles minus 1, and the value of each timing means the timing when the cycle # becomes the set value.

図4は、本発明の第1の実施例となる、図1の同期通信情報データテーブル2i31(i=1〜4)の詳細図である。同期通信情報データテーブル2i31は制御周期に相当するアイソクロナスサイクル数と、指令データを受信するタイミングと、指令データを実行するタイミングと、応答データを作成するタイミングと、応答データを送信するタイミングから構成される。本発明の第1および第2の実施例として図3の同期通信管理テーブルに対応するスレーブ2i(i=1〜4)のデータを示している。   FIG. 4 is a detailed view of the synchronous communication information data table 2i31 (i = 1 to 4) of FIG. 1 according to the first embodiment of the present invention. The synchronous communication information data table 2i31 is composed of the number of isochronous cycles corresponding to the control period, the timing for receiving command data, the timing for executing command data, the timing for creating response data, and the timing for transmitting response data. The As the first and second embodiments of the present invention, data of the slave 2i (i = 1 to 4) corresponding to the synchronous communication management table of FIG. 3 is shown.

図5は本発明の第1の実施例となる通信タイミングチャートである。マスタは、図3の同期通信管理テーブル、各スレーブは図4の同期通信情報データテーブルに従って動作した時のもので、ある制御周期Nのマスタ制御処理に注目し、制御周期N−1の各スレーブの応答データを基に指令データを作成し、制御周期N+1で各スレーブに指令データを送信し、各スレーブが指令データを取り込んで実行している様子を表した図である。実際には、制御周期毎に同じ処理が実行されているが、ここでは、図に現れる処理について、制御周期N−1のスレーブの応答から制御周期N+1のマスタの指令の順に説明していく。   FIG. 5 is a communication timing chart according to the first embodiment of the present invention. The master is the synchronous communication management table of FIG. 3, and each slave is operated according to the synchronous communication information data table of FIG. 4. Paying attention to the master control processing of a certain control cycle N, each slave of the control cycle N−1 FIG. 9 is a diagram showing a state in which command data is created based on the response data of the above, command data is transmitted to each slave in the control cycle N + 1, and each slave takes in and executes the command data. Actually, the same processing is executed for each control cycle, but here, the processing appearing in the figure will be described in the order of the slave response in the control cycle N-1 to the master command in the control cycle N + 1.

まず、制御周期N−1、サイクル#1のタイミングでは、スレーブ2i(i=1〜4)は、同じタイミングで応答データを作成する。   First, at the timing of the control cycle N-1 and cycle # 1, the slave 2i (i = 1 to 4) creates response data at the same timing.

更に、制御周期N−1、サイクル#2のタイミングで、スレーブ2i(i=1、2)は、応答データRi(i=1、2)を送信し、制御周期N−1、サイクル#3のタイミングで、スレーブ2i(i=3、4)は、応答データRi(i=3、4)を送信する。   Further, at the timing of the control cycle N-1 and cycle # 2, the slave 2i (i = 1, 2) transmits the response data Ri (i = 1, 2), and the control cycle N-1 and cycle # 3. At the timing, the slave 2i (i = 3, 4) transmits response data Ri (i = 3, 4).

次に、制御周期N、サイクル#0のタイミングでは、マスタ1が制御処理を起動して、受信した応答データRi(i=1〜4)を基に指令データCi(i=1〜4)を作成する。この制御処理は通信処理を妨げない高速な処理、または低優先度の処理として実行される。   Next, at the timing of the control cycle N and cycle # 0, the master 1 activates the control process, and receives the command data Ci (i = 1 to 4) based on the received response data Ri (i = 1 to 4). create. This control process is executed as a high-speed process that does not interfere with the communication process or a low-priority process.

そして、制御周期N+1、サイクル#0のタイミングでマスタ1は指令データCi(i=1、2)を送信、スレーブ2i(i=1、2)が受信し、制御周期N+1、サイクル#1のタイミングでマスタ1は指令データCi(i=3、4)を送信、スレーブ2i(i=3、4)が受信する。   The master 1 transmits the command data Ci (i = 1, 2) at the timing of the control cycle N + 1 and cycle # 0, and the slave 2i (i = 1, 2) receives it, and the timing of the control cycle N + 1, cycle # 1. Then, the master 1 transmits the command data Ci (i = 3, 4), and the slave 2i (i = 3, 4) receives it.

最後に、制御周期N+1、サイクル#2のタイミングでスレーブ2i(i=1〜4)は、一斉に指令を実行する。スレーブの指令実行処理もスレーブの通信処理を妨げない高速な処理、または低優先度の処理として実行される。 Finally, the slaves 2i (i = 1 to 4) execute commands simultaneously at the timing of the control cycle N + 1 and cycle # 2. Slave command execution processing is also executed as high-speed processing that does not interfere with slave communication processing or low-priority processing.

よって、応答データに関しては、同期単位前、つまり250μs前(125〜250μsのタイミング)に全スレーブが一斉に応答データを作成し、250〜375μsの間にマスタ1とスレーブ2i(i=1、2)が、375〜500μsの間にマスタ1とスレーブ2i(i=3、4)が応答データを授受することができ、制御周期前のデータではなく、一定の通信遅延前、つまり設定された同期単位前の同じタイミングのスレーブの情報を応答データとして、マスタが取得することができる。   Therefore, with respect to the response data, all slaves simultaneously generate response data before the synchronization unit, that is, 250 μs before (125 to 250 μs timing), and the master 1 and slave 2 i (i = 1, 2) between 250 and 375 μs. ), The master 1 and the slave 2i (i = 3, 4) can send and receive response data during 375 to 500 μs, not the data before the control period, but before a certain communication delay, that is, the set synchronization The master can acquire the slave information at the same timing before the unit as response data.

また、指令データに関しては、最初の125μsにてマスタ1とスレーブ2i(i=1、2)が、125〜250μsの間にマスタ1とスレーブ2i(i=3、4)が、指令データの授受を行い、全スレーブに対しての指令データの授受が終った、同期単位後の250μs(250〜375μsのタイミング)に、全スレーブが一斉に指令実行を開始することができ、設定された同期単位後にスレーブが同期して指令データを実行することができる。   As for command data, master 1 and slave 2i (i = 1, 2) in the first 125 μs, and master 1 and slave 2 i (i = 3, 4) send and receive command data between 125 and 250 μs. All slaves can start command execution at the same time 250 μs after the synchronization unit (command timing is 250 to 375 μs) after the command data has been transferred to all slaves. Later, the slave can execute the command data synchronously.

実際には、サイクル#で処理が定義され、制御周期毎に同じ処理が実行され、制御周期は500μsなので、サイクル#は0〜3の繰返しとなる。   Actually, the process is defined in cycle #, the same process is executed for each control period, and the control period is 500 μs. Therefore, cycle # is repeated from 0 to 3.

以上により、制御周期500μs内にマスタ1が全スレーブ2i(i=1〜4)と通信データの授受することができ、かつ制御周期後まで待つことなく、一定の通信遅延後、つまり設定された同期単位後にスレーブが同期して指令データを実行し、また、制御周期前のデータではなく、一定の通信遅延前、つまり設定された同期単位前の同じタイミングのスレーブの情報を応答データとして、マスタが取得することができる。   As described above, the master 1 can exchange communication data with all the slaves 2i (i = 1 to 4) within the control period of 500 μs, and is set after a certain communication delay, that is, without waiting until after the control period. The slave synchronizes to execute the command data after the synchronization unit, and the master data is not the data before the control cycle, but the slave data at the same timing before the set communication unit as a response data before a certain communication delay. Can get.

図6は、本発明の第1のマスタ・スレーブ同期通信システムにおける、同期通信方式の通信初期化処理手順を示すフローチャートである。この図を用いて、制御周期データからマスタのスレーブ割付部13が同期通信で使用する同期通信管理テーブルと、スレーブが同期通信で使用する同期通信情報データテーブルを作成する手順を順を追って説明する。   FIG. 6 is a flowchart showing the communication initialization processing procedure of the synchronous communication method in the first master-slave synchronous communication system of the present invention. The procedure for creating a synchronous communication management table used by the slave assignment unit 13 of the master for synchronous communication and a synchronous communication information data table used by the slave for synchronous communication from the control cycle data will be described in order. .

はじめにS010で制御周期やスレーブ数、スレーブ番号等があらかじめ設定された制御周期データ11を取り出す。 First, in step S010, control cycle data 11 in which a control cycle, the number of slaves, a slave number, and the like are set in advance is extracted.

次にS020で制御周期データ11に設定されているスレーブとネットワーク上に接続されている機器を対応付ける。これは、非特許文献1記載のIEEE1394規格の機能を利用してネットワーク上に接続されている全てのスレーブ情報121と、該スレーブとマスタが通信するための通信スレーブ番号を検出する。ここで、スレーブ情報121とは、図14のベンダーID、もしくは図16のEUI−64の情報を指し、スレーブとなる機器の判別にスレーブ情報121を使用する。またスレーブ番号は、スレーブ局に登録されている情報でもよいし、IEEE1394の規格の機能としてネットワーク上に接続されているIEEE1394機器に割り付けられるノードIDを利用してもよい。 Next, in S020, the slave set in the control cycle data 11 is associated with the device connected on the network. This detects all slave information 121 connected on the network using the function of the IEEE 1394 standard described in Non-Patent Document 1, and a communication slave number for communication between the slave and the master. Here, the slave information 121 indicates the vendor ID shown in FIG. 14 or the information on the EUI-64 shown in FIG. 16, and the slave information 121 is used to determine a device that is a slave. The slave number may be information registered in the slave station, or may be a node ID assigned to an IEEE 1394 device connected on the network as a function of the IEEE 1394 standard.

S030でサイクル内通信可能スレーブ数として1アイソクロナスサイクルで同期通信することが可能なスレーブの数を算出する。ここでサイクル内通信可能スレーブ数はOHCI準拠のIEEE1394インターフェースを使用している場合はDMAコンテキスト数のハードウェアの制約となり、ハードウェアの制約がない場合は、指令データの帯域、応答データの帯域、機器の通信速度により、式(1)で求められる。(本実施例ではサイクル内通信可能スレーブ数を2としている) In S030, the number of slaves capable of synchronous communication in one isochronous cycle is calculated as the number of slaves capable of communication in the cycle. Here, the number of slaves that can be communicated in the cycle is a hardware restriction of the number of DMA contexts when using an OHCI-compliant IEEE 1394 interface. If there is no hardware restriction, the bandwidth of the command data, the bandwidth of the response data, According to the communication speed of the device, it can be obtained by equation (1). (In this embodiment, the number of slaves that can communicate in a cycle is 2)


サイクル内通信可能スレーブ数
= アイソクロナス転送の帯域 ÷ 1スレーブ分の送受信の帯域 ・・・(1)
1スレーブ分の送受信の帯域
={(ヘッダ+指令データ分の帯域)+ 指令データ送信時のギャップ
+(ヘッダ+応答データ分の帯域)+ 応答データ送信時のギャップ}

なお、ヘッダ、指令データ送信時のギャップ、応答データ送信時のギャップはIEEE1394規格において規定された帯域である。

Number of slaves that can communicate within a cycle = Isochronous transfer bandwidth ÷ Send / receive bandwidth for one slave (1)
Transmission / reception bandwidth for one slave = {(header + command data bandwidth) + command data transmission gap
+ (Header + response data bandwidth) + response data transmission gap}

The header, the gap at the time of command data transmission, and the gap at the time of response data transmission are bands specified in the IEEE 1394 standard.

次にS040で通信タイミング割付け可能かどうかを式(2)にて判断するが、式(2)が成り立てば050に進み、不成立の場合はS041でエラー処理を行い終了となる。

全スレーブ数 ÷ サイクル内通信可能スレーブ数 ≦ 全サイクル数・・・(2)
全サイクル数 = 制御周期[μs] ÷ 125[μs]・・・(3)
125μs:IEEE1394規格で規定されているアイソクロナスサイクル時間
Next, whether or not communication timing allocation is possible is determined in S040 using equation (2). If equation (2) is established, the process proceeds to 050. If not established, error processing is performed in S041 and the process is terminated.

Total number of slaves ÷ Number of slaves that can communicate within a cycle ≦ Total number of cycles (2)
Total number of cycles = Control period [μs] ÷ 125 [μs] (3)
125 μs: Isochronous cycle time defined by the IEEE 1394 standard

次にS050で制御周期データ11、サイクル内通信可能スレーブ数から、制御周期を構成するアイソクロナスサイクル数分の同期通信管理テーブル14の送信データ部である、送信スレーブ数と送信スレーブ番号で構成される送信タイミングテーブルを作成し、設定されたスレーブを前詰めに順に割りつける。 Next, in S050, it is composed of the number of transmission slaves and the number of transmission slaves, which are the transmission data part of the synchronous communication management table 14 for the number of isochronous cycles constituting the control cycle, from the control cycle data 11 and the number of slaves capable of communication within the cycle. Create a transmission timing table, and assign the set slaves in order.

次にS060で式(3)により算出された全サイクル数分の同期通信管理テーブル14の領域を確保、0クリアし、全サイクル数を設定、送信データ部は送信タイミングテーブルに従いデータを格納する。 Next, in S060, the area of the synchronous communication management table 14 for the total number of cycles calculated by the expression (3) is secured, cleared to 0, the total number of cycles is set, and the transmission data part stores data according to the transmission timing table.

S120で最初に送信するスレーブが割り付けられたサイクルをマスタの制御処理起動タイミングとして設定する。   In S120, the cycle in which the slave to be transmitted first is assigned is set as the master control processing start timing.

S130で受信スレーブ番号の割り付けを開始するサイクル#として、受信割付開始サイクル#を式(4)で算出する。

受信割付開始サイクル# = 全サイクル数 − 同期単位サイクル数 ・・・(4)
同期単位サイクル数 = 同期単位[μs] ÷ 125[μs]
As a cycle # for starting the allocation of the reception slave number in S130, the reception allocation start cycle # is calculated by the equation (4).

Receive allocation start cycle # = total number of cycles-number of synchronization unit cycles (4)
Synchronization unit cycle count = Synchronization unit [μs] ÷ 125 [μs]

S140でサイクル#0の送信スレーブ数、送信スレーブ番号を、受信割付開始サイクル#の応答スレーブ数、受信スレーブ番号へコピーする。この処理を送信のサイクル#と受信のサイクル#を1サイクルずつずらしながら、全サイクル数分繰り返し、同期通信管理テーブルの受信データ部を作成する。 In S140, the number of transmission slaves and transmission slave number in cycle # 0 are copied to the number of response slaves and reception slave number in reception allocation start cycle #. This process is repeated for the total number of cycles while shifting the transmission cycle # and the reception cycle # one cycle at a time to create a reception data portion of the synchronous communication management table.

S150でスレーブの指令実行タイミングおよび応答作成タイミングをそれぞれ式(5)、(6)で算出する。

指令実行タイミング
= MOD((制御処理起動タイミング+同期単位サイクル数),
制御周期サイクル数) ・・・(5)
応答作成タイミング
= MOD((受信割付開始サイクル# + 制御周期サイクル数 − 1),
制御周期サイクル数)・・・(6)
MOD(A,B):AのBによる剰余
In S150, the slave command execution timing and response creation timing are calculated by equations (5) and (6), respectively.

Command execution timing = MOD ((Control processing start timing + number of synchronization unit cycles),
Number of control cycle cycles) (5)
Response creation timing = MOD ((reception allocation start cycle # + number of control cycle cycles-1),
Number of control cycle cycles) (6)
MOD (A, B): remainder of A by B

S160で上記までのステップにて作成された同期通信管理テーブル14からそれぞれのスレーブに対する指令受信タイミングと応答送信タイミングを抽出し、制御周期に相当するサイクル数と指令実行タイミングおよび応答作成タイミングのデータとあわせて同期通信情報データテーブルとして全スレーブへ通知する。 In S160, the command reception timing and response transmission timing for each slave are extracted from the synchronous communication management table 14 created in the above steps, and the number of cycles corresponding to the control cycle, command execution timing, and response creation timing data, In addition, it notifies all slaves as a synchronous communication information data table.

以上により、マスタ1に図3の同期通信管理テーブル14および、各スレーブ2iに図4の同期通信情報データテーブル2i31が作成される。
なお、同期通信管理テーブル14および、同期通信情報データテーブル2i31は、本マスタ・スレーブ同期通信システムの外部に存在するパソコン等に実装されるエンジニアリングツールで作成し、ネットワーク等を介して本システムのマスタやスレーブにダウンロードしても構わない。
Thus, the synchronous communication management table 14 in FIG. 3 is created in the master 1 and the synchronous communication information data table 2 i 31 in FIG. 4 is created in each slave 2 i.
The synchronous communication management table 14 and the synchronous communication information data table 2i31 are created by an engineering tool mounted on a personal computer or the like that exists outside the master / slave synchronous communication system, and the master of the system via a network or the like. Or download it to the slave.

図7は本発明のマスタ・スレーブ同期通信システムにおける、マスタの同期通信開始後のサイクル開始パケット受信時の処理手順を示すフローチャートである。この図でマスタがサイクル開始パケットを受信した時のイベント処理を順を追って説明する。 FIG. 7 is a flowchart showing a processing procedure when a cycle start packet is received after the master synchronous communication is started in the master-slave synchronous communication system of the present invention. In this figure, event processing when the master receives a cycle start packet will be described step by step.

まず、S1000でサイクル#を算出する。   First, in S1000, cycle # is calculated.

次に、S1010で同期通信管理テーブルから送信スレーブ数および、送信スレーブ番号、応答スレーブ数および、受信スレーブ番号について、サイクル#のタイミングのデータを抽出する。   Next, in step S1010, cycle # timing data is extracted from the synchronous communication management table for the number of transmission slaves, the transmission slave number, the number of response slaves, and the reception slave number.

S1020で抽出した応答スレーブ数が0でない場合は、受信スレーブ番号の応答データを受信する。   If the response slave number extracted in S1020 is not 0, the response data of the reception slave number is received.

S1030で抽出した送信スレーブ数が0でない場合は、送信スレーブ番号の指令データを送信する。 If the number of transmission slaves extracted in S1030 is not 0, the transmission slave number command data is transmitted.

S1040で制御処理起動タイミングがサイクル#と一致していれば、該当する制御処理を起動する。 If the control process start timing coincides with cycle # in S1040, the corresponding control process is started.

S1000からS1040により、マスタのサイクル開始パケット受信時のイベント処理として同期通信処理が実行される。   From S1000 to S1040, a synchronous communication process is executed as an event process when a master cycle start packet is received.

図8は本発明のマスタ・スレーブ同期通信システムにおける、スレーブの同期通信開始後のサイクル開始パケット受信時の処理手順を示すフローチャートである。この図でスレーブがサイクル開始パケットを受信した時のイベント処理を順を追って説明する。 FIG. 8 is a flowchart showing a processing procedure when a cycle start packet is received after the slave synchronous communication is started in the master-slave synchronous communication system of the present invention. In this figure, event processing when the slave receives a cycle start packet will be described step by step.

まず、S2000でサイクル#を算出する。   First, in step S2000, cycle # is calculated.

次に、S2010で同期通信情報データテーブルを読み出し、S2020で指令受信タイミングがサイクル#と等しい時はS2030で指令データを受信する。   Next, the synchronous communication information data table is read in S2010, and when the command reception timing is equal to cycle # in S2020, the command data is received in S2030.

S2040で指令実行タイミングがサイクル#と等しい時は、S2050で指令を実行する。もしくは指令処理を起動する。   When the command execution timing is equal to cycle # in S2040, the command is executed in S2050. Or start command processing.

S2060で応答作成タイミングがサイクル#と等しい時は、S2070で応答データを作成する。   When the response creation timing is equal to cycle # in S2060, response data is created in S2070.

S2080で応答送信タイミングがサイクル#と等しい時は、S2090で応答データを送信する。   When the response transmission timing is equal to cycle # in S2080, response data is transmitted in S2090.

S2000からS2080により、スレーブのサイクル開始パケット受信時のイベント処理として同期通信処理が実行される。   From S2000 to S2080, a synchronous communication process is executed as an event process when a slave cycle start packet is received.

図6〜図8のフローチャートに従えば、図2の制御周期データから図3の同期通信管理テーブル、図4の同期通信情報データテーブルが作成され、マスタおよびスレーブが図5の通信タイミングチャートの通りに通信することができるので、制御周期内にマスタと全てのスレーブが制御データの授受を行うことができ、かつ、制御周期に依存しない制御周期以下の一定の通信遅延で同期通信が行えるのである。   6 to 8, the synchronous communication management table of FIG. 3 and the synchronous communication information data table of FIG. 4 are created from the control cycle data of FIG. 2, and the master and slave are as shown in the communication timing chart of FIG. Therefore, the master and all slaves can exchange control data within the control cycle, and synchronous communication can be performed with a constant communication delay that is less than the control cycle and does not depend on the control cycle. .

図9は、本発明の第2の実施例となる図1の制御周期データ11の詳細図である。図2の制御周期データを複数のグループ分持たせた例で、本実施例では、同期単位を250μsとし、制御周期を500μs、制御スレーブ数を4局、制御スレーブ番号をS1,S2,S3,S4としたグループ1と制御周期を1ms=1000μs、制御スレーブ数を4局、制御スレーブ番号をS5,S6,S7,S8としたグループ2の2グループの例を示している。 FIG. 9 is a detailed view of the control cycle data 11 of FIG. 1 according to the second embodiment of the present invention. In the example in which the control cycle data of FIG. 2 is provided for a plurality of groups, in this embodiment, the synchronization unit is 250 μs, the control cycle is 500 μs, the number of control slaves is 4, and the control slave numbers are S1, S2, S3. An example of two groups, group 1 with S4 and control period 1 ms = 1000 μs, number of control slaves 4 stations, and group 2 with control slave numbers S5, S6, S7, and S8 is shown.

図10は、本発明の第2の実施例となる、図1の同期通信管理テーブル14の詳細図である。構成は図3と同様で、制御周期が1msのグループ2があるため、全サイクル数が8となっている。本発明の実施例として図9の制御周期データの設定において、1アイソクロナスサイクルで通信できるスレーブ数は2局とした場合のデータを示している。   FIG. 10 is a detailed view of the synchronous communication management table 14 of FIG. 1 according to the second embodiment of the present invention. The configuration is the same as in FIG. 3, and since there is a group 2 with a control period of 1 ms, the total number of cycles is 8. As an embodiment of the present invention, in the setting of the control cycle data in FIG. 9, data is shown when the number of slaves that can communicate in one isochronous cycle is two stations.

図11は、本発明の第2の実施例となる、図1の同期通信情報データテーブル2i31(i=1〜8)の詳細図である。同期通信情報データテーブル2i31(i=1〜8)は制御周期に相当するアイソクロナスサイクル数と、指令データを受信するタイミングと、指令データを実行するタイミングと、応答データを作成するタイミングと、応答データを送信するタイミングから構成される。本発明の第3および第4の実施例として図9の同期通信管理テーブルに対応するスレーブ2i(i=1〜8)のデータを示している。ここで、2i(i=1〜4)に関する同期通信情報データテーブル2i31(i=1〜4)は図4と同じである。   FIG. 11 is a detailed view of the synchronous communication information data table 2i31 (i = 1 to 8) of FIG. 1 according to the second embodiment of the present invention. The synchronous communication information data table 2i31 (i = 1 to 8) includes the number of isochronous cycles corresponding to the control cycle, the timing of receiving command data, the timing of executing command data, the timing of creating response data, and the response data It is comprised from the timing which transmits. As the third and fourth embodiments of the present invention, data of the slave 2i (i = 1 to 8) corresponding to the synchronous communication management table of FIG. 9 is shown. Here, the synchronous communication information data table 2i31 (i = 1 to 4) regarding 2i (i = 1 to 4) is the same as FIG.

図12は、本発明の第2の実施例となる通信タイミングチャートである。マスタは、図10の同期通信管理テーブル、各スレーブは図11の同期通信情報データテーブルに従って動作した時のものである。2i(i=1〜4)に関するタイミングチャートは図5と同じであり、スレーブ2i(i=5〜8)についても基本的な動作は図5と同じため説明を省略する。   FIG. 12 is a communication timing chart according to the second embodiment of the present invention. The master operates in accordance with the synchronous communication management table in FIG. 10, and each slave operates in accordance with the synchronous communication information data table in FIG. The timing chart regarding 2i (i = 1 to 4) is the same as FIG. 5, and the basic operation of the slave 2i (i = 5 to 8) is the same as FIG.

図12より、図5と同様に、グループ1は制御周期500μs内にマスタ1がグループに設定されている全スレーブ2i(i=1〜4)と通信データを授受することができ、かつ制御周期後まで待つことなく、一定の通信遅延後、つまり設定された同期単位後にスレーブが同期して指令データを実行し、また、制御周期前のデータではなく、一定の通信遅延前、つまり設定された同期単位前の同じタイミングのスレーブの情報を応答データとして、マスタが取得することが出来る。   From FIG. 12, as in FIG. 5, the group 1 can exchange communication data with all the slaves 2i (i = 1 to 4) in which the master 1 is set in the group within the control period of 500 μs, and the control period. Without waiting until later, the slave executes the command data synchronously after a certain communication delay, that is, after the set synchronization unit, and before the certain communication delay, that is, the data set before the control cycle. The master can acquire the slave information at the same timing before the synchronization unit as response data.

グループ2に関しても、制御処理の起動タイミング、送受信のタイミング、指令実行タイミング、をグループ1から同期単位分だけずらすことで、制御周期1000μs内にマスタ1かグループに設定されている全スレーブ2i(i=5〜8)と通信データを授受することができ、制御周期に依存せず、マスタとスレーブの通信遅延は、同期単位の設定値で一定とすることが出来る。   Regarding the group 2 as well, by shifting the control processing start timing, transmission / reception timing, and command execution timing by the synchronization unit from the group 1, all slaves 2i (i = 5 to 8), communication data can be exchanged, and the communication delay between the master and the slave can be made constant by the set value of the synchronization unit without depending on the control cycle.

図13は、本発明の第2のマスタ・スレーブ同期通信システムにおける、同期通信方式の通信初期化処理手順を示すフローチャートである。図6のフローチャートに対して複数のグループ化に対応した処理となっている。ここでは、図6のフローチャートと差異がある部分についてのみ説明する。   FIG. 13 is a flowchart showing the communication initialization processing procedure of the synchronous communication method in the second master / slave synchronous communication system of the present invention. The processing shown in FIG. 6 corresponds to a plurality of groupings. Here, only a part different from the flowchart of FIG. 6 will be described.

S010〜S030までは図6と同じである。   Steps S010 to S030 are the same as those in FIG.

S040で、通信タイミング割付け可能かどうかの判断は式(2’)および(7)で行う。式(2’)、(7)いずれかの条件が成り立たない場合はS041でエラー処理となる。式(2’)、(7)のいずれも成り立つ場合のみ、通信タイミング割付け可能となり、S050に進む。

全スレーブ数 ÷ サイクル内通信可能スレーブ数 ≦ 全サイクル数・・・(2’)
グループスレーブ数j ÷ サイクル内通信可能スレーブ数
≦ 同期単位サイクル数 ・・・(7)

全スレーブ数:グループjで制御するスレーブ数の和
全サイクル数 = 制御周期jの最小公倍数[μs] ÷ 125[μs]・・・(3’)
125μs:IEEE1394規格で規定されているアイソクロナスサイクル時間
制御周期j:制御周期データ11のグループjの制御周期
通信スレーブ数j = 制御周期jの最小公倍数 ÷ 制御周期j
× グループスレーブ数j
グループスレーブ数j: グループjで制御するスレーブ数
同期単位サイクル数 = 同期単位[μs] ÷ 125[μs]
(j=1,2,…:グループ番号)
In S040, whether or not communication timing allocation is possible is determined by equations (2 ′) and (7). If either of the expressions (2 ′) and (7) is not satisfied, error processing is performed in S041. Only when both formulas (2 ′) and (7) hold, communication timing assignment is possible, and the process proceeds to S050.

Total number of slaves ÷ Number of slaves that can communicate within a cycle ≤ Total number of cycles ... (2 ')
Number of group slaves j ÷ Number of slaves that can communicate within a cycle
≦ Number of synchronization unit cycles (7)

Total number of slaves: Sum of the number of slaves controlled by group j Total number of cycles = Least common multiple of control period j [μs] ÷ 125 [μs] (3 ')
125 μs: Isochronous cycle time defined in the IEEE 1394 standard Control cycle j: Control cycle of group j of control cycle data 11 Number of communication slaves j = Least common multiple of control cycle j ÷ Control cycle j
× Number of group slaves j
Number of group slaves j: Number of slaves controlled by group j Number of synchronization unit cycles = Synchronization unit [μs] ÷ 125 [μs]
(J = 1, 2,...: Group number)

S050では、図6で作成した送信タイミングテーブルをグループ数分作成する。   In S050, the transmission timing tables created in FIG. 6 are created for the number of groups.

次にS060で式(3’)により算出された全サイクル数分の同期通信管理テーブル14の領域を確保、0クリアし、全サイクル数を設定する。 Next, in S060, areas of the synchronous communication management table 14 for the total number of cycles calculated by the equation (3 ') are secured, cleared to 0, and the total number of cycles is set.

S070で全サイクル数分のサイクル使用済みフラグを確保し、0クリアする。   In S070, the cycle used flags for the total number of cycles are secured and cleared to zero.

S080でサイクル使用済みフラグを先頭から検索して、グループで使用する送信サイクル(式(7)の左辺の値)分、連続して未使用な領域があるかどうかを判断し、あればS090へ、なければS041でエラー処理をして終了する。   In S080, the cycle used flag is searched from the head, and it is determined whether there is a continuous unused area for the transmission cycle (value on the left side of Expression (7)) used in the group. If not, error processing is performed in S041 and the process is terminated.

S090でグループ毎の送信タイミングテーブルからスレーブの割り付けられたタイミングを取り出し、未使用な連続領域の先頭サイクルを加算したサイクルに相当する、同期通信管理テーブル14のサイクルの送信スレーブ数に1を加え、送信先スレーブ番号にスレーブ番号を格納する。S090の処理をグループに設定された全スレーブ数分繰り返す。 In S090, the slave assigned timing is extracted from the transmission timing table for each group, and 1 is added to the number of transmission slaves in the cycle of the synchronous communication management table 14 corresponding to the cycle obtained by adding the top cycle of the unused continuous area. Stores the slave number in the destination slave number. The process of S090 is repeated for all the slaves set in the group.

S100で同期通信管理テーブルデータのグループ内の全スレーブの割付結果を全サイクル数分、制御周期で繰り返してコピーして、コピーしたサイクルのサイクル使用済みフラグを設定し、S110でグループ内のスレーブのうち、最初に送信するスレーブが割り付けられたサイクルから同期単位分のサイクル使用済みフラグを使用済みに設定する。   In S100, the allocation results of all slaves in the group of the synchronous communication management table data are copied repeatedly for the total number of cycles in the control cycle, the cycle used flag of the copied cycle is set, and the slaves in the group are set in S110. Among them, the cycle used flag for the synchronization unit is set to used from the cycle in which the slave to be transmitted first is allocated.

S120で式(8)のように、グループ内で最初に送信するスレーブが割り付けられたサイクルをマスタのグループj制御処理起動タイミングとして設定する。

グループj制御処理起動タイミング
= MIN(グループjで制御するスレーブの送信サイクル#) ・・・(8)
(j=1,2,…:グループ番号)
MIN(A,B,C,…):括弧内の値の最小値
In S120, as shown in Expression (8), the cycle in which the first slave to be transmitted in the group is allocated is set as the master group j control processing start timing.

Group j control processing start timing = MIN (slave transmission cycle # controlled by group j) (8)
(J = 1, 2,...: Group number)
MIN (A, B, C, ...): Minimum value in parentheses

S080からS120までの処理をグループ数分繰り返す。   The processing from S080 to S120 is repeated for the number of groups.

S130、S140は全サイクル数の値が式(3’)となるだけで処理は同じである。   The processes in S130 and S140 are the same except that the value of the total number of cycles is the expression (3 ').

S150でグループ毎のスレーブの指令実行タイミングおよび応答作成タイミングをそれぞれ式(5’)、(6’)で算出する。

指令実行タイミング
= MOD((グループj制御処理起動タイミング+同期単位サイクル数),
制御周期jサイクル数) ・・・(5’)
応答作成タイミング
= MOD((受信割付開始サイクル# +制御周期jサイクル数 −1),
制御周期jサイクル数) ・・・(6’)
MOD(A,B):AのBによる剰余
(j=1,2,…:グループ番号)
In S150, slave command execution timing and response creation timing for each group are calculated by equations (5 ′) and (6 ′), respectively.

Command execution timing = MOD ((Group j control processing start timing + number of synchronization unit cycles),
(Control cycle j number of cycles) (5 ')
Response creation timing = MOD ((reception allocation start cycle # + control period j cycle number -1),
(Control cycle j number of cycles) (6 ')
MOD (A, B): remainder of A by B (j = 1, 2,...: Group number)

S160で上記までのステップにて作成された同期通信管理テーブル14からそれぞれのスレーブに対する指令受信タイミングと応答送信タイミングを抽出し、制御周期に相当するサイクル数と指令実行タイミングおよび応答作成タイミングのデータとあわせて同期通信情報データテーブルとしてグループ内の全スレーブへ通知する。   In S160, the command reception timing and response transmission timing for each slave are extracted from the synchronous communication management table 14 created in the above steps, and the number of cycles corresponding to the control cycle, command execution timing, and response creation timing data, In addition, it notifies all slaves in the group as a synchronous communication information data table.

S150からS160までの処理をグループ数分繰り返す。
以上により、マスタ1に図10の同期通信管理テーブル14および、各スレーブに図11の同期通信情報データテーブル2i31が作成される。
The processing from S150 to S160 is repeated for the number of groups.
As described above, the synchronous communication management table 14 in FIG. 10 is created in the master 1 and the synchronous communication information data table 2 i 31 in FIG. 11 is created in each slave.

マスタ、スレーブの同期通信開始後のサイクル開始パケット受信時の処理手順を示すフローチャートは図7、図8とそれぞれ同じである。   The flowcharts showing the processing procedure when the cycle start packet is received after the master and slave synchronous communications are started are the same as those in FIGS.

図13および、図7、図8のフローチャートに従えば、図9の制御周期データから、図10の同期通信管理テーブル、図11の同期通信情報データテーブルが作成され、マスタおよびスレーブが図12の通信タイミングチャート通りに通信することが出来るので、制御するスレーブを複数のグループ分けても、それぞれの制御周期内にマスタと全てのスレーブが制御データの授受を行うことができ、かつ、制御周期に依存しない制御周期以下の一定の通信遅延で同期通信が行えるのである。 According to the flowcharts of FIGS. 13, 7, and 8, the synchronous communication management table of FIG. 10 and the synchronous communication information data table of FIG. 11 are created from the control cycle data of FIG. Since communication can be performed according to the communication timing chart, even if the slaves to be controlled are divided into a plurality of groups, the master and all slaves can exchange control data within each control cycle, and within the control cycle Synchronous communication can be performed with a constant communication delay that is not dependent on the control cycle.

本発明の第3の発明として、同期単位時間の自動最適化についての実施例を、本発明の第1の実施例において、1アイソクロナスサイクルで通信できるスレーブ数が4局の場合として説明する。   As a third aspect of the present invention, an embodiment of automatic optimization of synchronization unit time will be described as a case where the number of slaves that can communicate in one isochronous cycle is four in the first embodiment of the present invention.

図21は本発明の第3の実施例となる、同期通信管理テーブル14の詳細図である。図3の同期通信管理テーブルに対して、1アイソクロナスサイクルに割り付けられるスレーブ数が2局から4局に増えているため、送受信のスレーブ番号を格納するテーブルがそれぞれ4個となっており、スレーブS1〜S4がすべて1アイソクロナスサイクルに割り付けられている。   FIG. 21 is a detailed view of the synchronous communication management table 14 according to the third embodiment of the present invention. In contrast to the synchronous communication management table of FIG. 3, the number of slaves allocated to one isochronous cycle has increased from two to four, so that there are four tables each for storing transmission / reception slave numbers, and slave S1 -S4 are all assigned to one isochronous cycle.

図22は本発明の第3の実施例となる、同期通信情報データテーブル2i31(i=1〜4)の詳細図である。図21の同期通信管理テーブルより、各スレーブの同期通信情報データテーブルはすべて同じタイミングとなるため、同じ値となっている。   FIG. 22 is a detailed view of the synchronous communication information data table 2i31 (i = 1 to 4) according to the third embodiment of the present invention. From the synchronous communication management table of FIG. 21, the synchronous communication information data tables of the slaves all have the same timing and therefore have the same value.

図23は本発明の第3の実施例となる通信タイミングチャートである。マスタは、図21の同期通信管理テーブル、各スレーブは図22の同期通信情報データテーブルに従って動作した時のもので、図5の動作に対して、スレーブ4局との通信が1アイソクロナスで可能なため、制御周期N−1、サイクル#2のタイミングで全スレーブが応答データを作成、サイクル#3のタイミングで全スレーブが応答送信し、制御周期N+1、サイクル#0のタイミングでマスタは全スレーブの指令データを送信、各スレーブは指令データを受信し、サイクル#1のタイミングで全スレーブは一斉に指令を実行するように変更される。   FIG. 23 is a communication timing chart according to the third embodiment of the present invention. The master operates in accordance with the synchronous communication management table of FIG. 21, and each slave operates in accordance with the synchronous communication information data table of FIG. 22. In contrast to the operation of FIG. 5, communication with four slave stations is possible with one isochronous. Therefore, all slaves create response data at the timing of control cycle N-1 and cycle # 2, all slaves send responses at the timing of cycle # 3, and the master is all slaves at the timing of control cycle N + 1 and cycle # 0. The command data is transmitted, each slave receives the command data, and at the timing of cycle # 1, all slaves are changed to execute the command all at once.

制御周期データからマスタのスレーブ割付部13が同期通信で使用する同期通信管理テーブルと、スレーブが同期通信で使用する同期通信情報データテーブルを作成する手順を示す、同期通信方式の通信初期化処理手順を示すフローチャートは図6と同様で、差異となる、同期単位の最適化に関する部分について説明する。 Communication initialization processing procedure of the synchronous communication method showing a procedure of creating a synchronous communication management table used by the slave assignment unit 13 of the master for synchronous communication and a synchronous communication information data table used by the slave for the synchronous communication from the control cycle data 6 is the same as that in FIG. 6, and the difference will be described regarding the synchronization unit optimization.

S120までは図6と同じ処理を実行する。S130で、まず、式(4)で使用する同期単位サイクル数を、S050で作成された送信タイミングテーブルにおいて実際にスレーブが割り付けられたアイソクロナスサイクル数に置き換えることによって最適化する。また、同期単位をその置き換えられた同期単位サイクル数に相当する時間に変更する。   The same processing as in FIG. 6 is executed up to S120. In S130, first, the number of synchronization unit cycles used in Expression (4) is optimized by replacing it with the number of isochronous cycles to which the slave is actually allocated in the transmission timing table created in S050. In addition, the synchronization unit is changed to a time corresponding to the replaced number of synchronization unit cycles.

S140以降も同期単位サイクル数を最適化された同期単位サイクル数に置き換えた値を使用することで同様の処理となる。 The same processing is performed after S140 by using a value obtained by replacing the synchronization unit cycle number with the optimized synchronization unit cycle number.

よって、図2の同期単位があらかじめ設定された250μsに対し、最短の125μsに短縮して最適化することができ、より短い通信遅延で動作させることが可能となる。   Therefore, the synchronization unit in FIG. 2 can be optimized by shortening to 125 μs, which is the shortest, with respect to 250 μs in which the synchronization unit is set in advance, and can be operated with a shorter communication delay.

同様に、S050で、実際にスレーブが割り付けられたアイソクロナスサイクル数が、あらかじめ設定された同期単位を超える場合も、S130であらかじめ設定された同期単位を延長して最適化することによって、適切な通信遅延で動作させることが可能となる。 Similarly, when the number of isochronous cycles to which slaves are actually allocated in S050 exceeds the preset synchronization unit, the synchronization unit set in advance in S130 is optimized by extending the synchronization unit. It becomes possible to operate with a delay.

ここで、S130にて同期単位サイクル数を最適化する際に、パラメータ等による設定もしくはエンジニアリングツールを介してのユーザーへの問い合わせにより、最適化処理の実行する/しないを切り替える処理にしてもよい。
また、最適化を実行する/しないにかかわらず、同期単位をアプリケーションプログラムやエンジニアリングツール等の機器で読み出せるデータとして保持することで、ユーザに同期単位を通知することができる。
Here, when optimizing the number of synchronization unit cycles in S130, the optimization processing may be switched between execution and non-execution by setting with parameters or an inquiry to the user through an engineering tool.
Regardless of whether or not optimization is performed, the synchronization unit can be stored as data that can be read by a device such as an application program or an engineering tool to notify the user of the synchronization unit.

以上により、1局のマスタと1局以上のスレーブがIEEE1394ネットワーク上に接続され、一定時間の制御周期に同期して、通信データを授受するマスタ・スレーブ同期通信システムにおいて、グループ毎に通信タイミングをずらしながら、制御周期以下の同期単位で通信データの授受を行うので、制御周期が長くなっても、通信遅延は影響を受けず、同期単位のまま一定となるので制御性能を向上させることが出来る。   As described above, in a master / slave synchronous communication system in which one master and one or more slaves are connected to the IEEE 1394 network and exchange communication data in synchronization with a control period of a predetermined time, communication timing is set for each group. Since communication data is exchanged in synchronization units that are less than or equal to the control period while shifting, even if the control period becomes longer, the communication delay is not affected and remains constant in the synchronization unit, so control performance can be improved. .

制御周期の設定によらずマスタとスレーブの送受信データの通信に必要分の通信時間でマスタとスレーブが同期して通信できるので、マスタでキネマティクスを使ったような制御指令の作成に時間がかかるロボットコントロールシステムや、モーションコントロールシステムという用途にも適用できる。   Because the master and slave can communicate synchronously with the communication time required for communication between the master and slave transmission / reception data regardless of the control cycle setting, it takes time to create a control command that uses kinematics at the master. It can also be applied to applications such as robot control systems and motion control systems.

本発明の実施例を示すマスタ・スレーブ同期通信システムの構成図Configuration diagram of master-slave synchronous communication system showing an embodiment of the present invention 本発明の第1の実施例となる制御周期データの詳細図Detailed view of control cycle data according to the first embodiment of the present invention 本発明の第1の実施例となる同期通信管理テーブルの詳細図Detailed view of the synchronous communication management table according to the first embodiment of the present invention. 本発明の第1の実施例となる同期通信情報データテーブルの詳細図Detailed view of synchronous communication information data table according to the first embodiment of the present invention 本発明の第1の実施例となる通信タイミングチャートCommunication timing chart according to the first embodiment of the present invention 本発明の第1のマスタ・スレーブ同期通信システムにおける、同期通信方式の通信初期化処理手順を示すフローチャートThe flowchart which shows the communication initialization processing procedure of a synchronous communication system in the 1st master-slave synchronous communication system of this invention. 本発明のマスタ・スレーブ同期通信システムにおける、マスタの同期通信開始後のサイクル開始パケット受信時の処理手順を示すフローチャートThe flowchart which shows the process sequence at the time of the cycle start packet reception after the synchronous communication start of a master in the master slave communication system of this invention 本発明のマスタ・スレーブ同期通信システムにおける、スレーブの同期通信開始後のサイクル開始パケット受信時の処理手順を示すフローチャートThe flowchart which shows the process sequence at the time of the cycle start packet reception after the synchronous communication start of a slave in the master-slave synchronous communication system of this invention 本発明の第2の実施例となる制御周期データの詳細図Detailed view of control cycle data according to the second embodiment of the present invention 本発明の第2の実施例となる同期通信管理テーブルの詳細図Detailed view of synchronous communication management table according to the second embodiment of the present invention 本発明の第2の実施例となる同期通信情報データテーブルの詳細図Detailed view of synchronous communication information data table according to the second embodiment of the present invention 本発明の第2の実施例となる通信タイミングチャートCommunication timing chart according to the second embodiment of the present invention 本発明の第2のマスタ・スレーブ同期通信システムにおける、同期通信方式の通信初期化処理手順を示すフローチャートThe flowchart which shows the communication initialization processing procedure of a synchronous communication system in the 2nd master-slave synchronous communication system of this invention IEEE1394機器が持つコンフィグレーションROMの最小形式のフォーマットを表す図The figure showing the format of the minimum form of the configuration ROM which the IEEE1394 equipment has IEEE1394機器が持つコンフィグレーションROMの一般形式のフォーマットを表す図The figure showing the format of the general form of the configuration ROM which the IEEE1394 equipment has bus_info_blockのフォーマットを表す図The figure showing the format of bus_info_block CYCLE_TIMEのフォーマットを表す図The figure showing the format of CYCLE_TIME 従来の方法を適用した通信タイミング管理テーブルの詳細図Detailed view of the communication timing management table applying the conventional method 従来の方法を適用した通信タイミングチャートCommunication timing chart using the conventional method 従来の方法を適用した通信遅延Communication delay using conventional methods 本発明の第3の実施例となる同期通信管理テーブルの詳細図Detailed view of synchronous communication management table according to the third embodiment of the present invention 本発明の第3の実施例となる同期通信情報データテーブルの詳細図Detailed view of synchronous communication information data table according to the third embodiment of the present invention 本発明の第3の実施例となる通信タイミングチャートCommunication timing chart according to the third embodiment of the present invention

符号の説明Explanation of symbols

1 マスタ
11 制御周期データ
12 スレーブ検出部
121 接続スレーブ情報
13 スレーブ割付部
14 同期通信管理テーブル
15 サイクル開始パケット受信処理部
16 指令データ送信部
161 指令データ
17 応答データ受信部
171 応答データ
18 制御処理部
2i スレーブ
2i1 指令データ受信部
2i11 指令データ
2i2 応答データ送信部
2i21 応答データ
2i3 同期通信処理部
2i31 同期通信情報データテーブル
2i4 サイクル開始パケット受信処理部
2i5 応答作成部
2i6 指令処理部
3 IEEE1394ネットワーク
Ci マスタ1からスレーブiへの指令データ
Ri スレーブiからマスタ1への応答データ
DESCRIPTION OF SYMBOLS 1 Master 11 Control period data 12 Slave detection part 121 Connection slave information 13 Slave allocation part 14 Synchronous communication management table 15 Cycle start packet reception process part 16 Command data transmission part 161 Command data 17 Response data reception part 171 Response data 18 Control process part 2i Slave 2i1 Command data reception unit 2i11 Command data 2i2 Response data transmission unit 2i21 Response data 2i3 Synchronous communication processing unit 2i31 Synchronous communication information data table 2i4 Cycle start packet reception processing unit 2i5 Response creation unit 2i6 Command processing unit 3 IEEE 1394 network Ci master 1 Command data from slave i to slave i Response data from slave i to master 1

Claims (8)

1局のマスタと1局以上のスレーブがIEEE1394ネットワーク上に接続され、アイソクロナスサイクルの整数倍の制御周期に同期して、前記マスタと前記スレーブが通信するマスタ・スレーブ同期通信システムにおいて、
前記マスタは、全ての前記スレーブとの通信に必要なアイソクロナスサイクル単位での時間を意味する同期単位を、前記スレーブからの受信の場合には前記制御周期の最後から設定し、前記スレーブへの送信の場合には前記同期単位を前記制御周期の最初から設定した同期通信管理テーブルを備え、
前記スレーブは、前記マスタへの送信の場合には前記同期単位を前記制御周期の最後から設定し、前期マスタからの受信の場合には前記同期単位を前記制御周期の最初から設定した同期通信情報データテーブルを備えた
ことを特徴とするマスタ・スレーブ同期通信システム。
In a master-slave synchronous communication system in which one master and one or more slaves are connected to an IEEE 1394 network and the master and the slave communicate with each other in synchronization with a control cycle that is an integral multiple of an isochronous cycle.
In the case of reception from the slave, the master sets a synchronization unit that means a time in an isochronous cycle unit necessary for communication with all the slaves from the end of the control cycle, and transmits to the slave. In the case of, comprising a synchronous communication management table in which the synchronization unit is set from the beginning of the control cycle,
In the case of transmission to the master, the slave sets the synchronization unit from the end of the control period, and in the case of reception from the previous period master, the synchronous communication information in which the synchronization unit is set from the beginning of the control period. A master / slave synchronous communication system comprising a data table.
前記マスタが備える前記同期通信管理テーブルは、前記マスタが前記スレーブへの指令データを作成する制御処理を起動するタイミングと、前記マスタが送信する前記スレーブの数と前記スレーブ番号および前記マスタが受信する前記スレーブの数と前記スレーブ番号とをアイソクロナスサイクル毎に保持し、
前記スレーブが備える前記同期通信情報データテーブルは、前記スレーブが、前記マスタから指令データを受信する前記タイミングと、前記指令データを実行する前記タイミングと、前記マスタへの応答データを作成する前記タイミングと、前記マスタへ応答データを送信する前記タイミングとを保持する、
ことを特徴とする請求項1に記載のマスタ・スレーブ同期通信システム。
The synchronous communication management table included in the master receives the timing at which the master starts control processing for creating command data to the slave, the number of slaves transmitted by the master, the slave number, and the master Holding the number of slaves and the slave number for each isochronous cycle;
The synchronous communication information data table provided in the slave includes the timing at which the slave receives command data from the master, the timing at which the command data is executed, and the timing at which response data to the master is created. Holding the timing of sending response data to the master,
The master / slave synchronous communication system according to claim 1.
前記マスタに備えられたスレーブ割付部が、あらかじめ設定された前記同期単位と前記制御周期と、前記同期単位内において通信する前記スレーブ数と、前記スレーブをユニークに指定するスレーブ番号の配列とから構成される制御周期データをもとに前記同期通信管理テーブルを作成し、該同期通信管理テーブルに基づいて前記同期通信情報データテーブルを作成する
ことを特徴とする請求項1に記載のマスタ・スレーブ同期通信システム。
The slave allocation unit provided in the master is configured from the preset synchronization unit and the control period, the number of slaves communicating within the synchronization unit, and an array of slave numbers that uniquely specify the slave 2. The master / slave synchronization according to claim 1, wherein the synchronous communication management table is generated based on the control cycle data to be generated, and the synchronous communication information data table is generated based on the synchronous communication management table. Communications system.
前記マスタは、前記同期通信管理テーブルに従い、前記制御処理を起動するタイミングを検出すると前記制御処理を実行し、前記スレーブからの受信タイミングを検出すると受信を実行し、前記スレーブへの送信タイミングを検出すると送信を実行し、
前記スレーブは、前記同期通信情報データテーブルに従い、前記指令データを受信するタイミングを検出すると前記マスタからの指令データを受信し、前記指令データを実行するタイミングを検出すると前記指令データの処理を実行し、前記応答データを作成するタイミングを検出すると前記応答データを作成し、前記応答データを送信するタイミングを検出すると前記マスタへ前記応答データを送信する、
ことを特徴とするマスタ・スレーブ同期通信システム。
In accordance with the synchronous communication management table, the master executes the control process when it detects the timing to start the control process, performs reception when it detects the reception timing from the slave, and detects the transmission timing to the slave Then execute transmission,
According to the synchronous communication information data table, the slave receives the command data from the master when detecting the timing to receive the command data, and executes the processing of the command data when detecting the timing to execute the command data. The response data is created when the response data creation timing is detected, and the response data is sent to the master when the response data transmission timing is detected.
A master-slave synchronous communication system characterized by the above.
前記マスタと前記スレーブが通信する前記制御周期が複数存在し、前記スレーブは前記制御周期毎にグループ化され、前記グループ毎に前記同期単位ずつ前記制御周期をずらして前記同期通信管理テーブルと前記同期通信情報データテーブルを作成することを特徴とする請求項1〜請求項4の何れかに記載のマスタ・スレーブ同期通信システム。   There are a plurality of the control cycles for communication between the master and the slave, the slaves are grouped for each control cycle, and the synchronization communication management table and the synchronization are shifted by shifting the control cycle by the synchronization unit for each group. 5. The master / slave synchronous communication system according to claim 1, wherein a communication information data table is created. 前記スレーブ割付部が前期制御周期データをもとに同期通信管理テーブルを作成する際に、前期同期単位内に通信を行わないアイソクロナスサイクルを検出すると、前記同期単位を最適値に短縮することを特徴とする請求項1〜5の何れかに記載のマスタ・スレーブ同期通信システム。   When the slave allocation unit creates a synchronous communication management table based on the previous period control cycle data, and detects an isochronous cycle in which communication is not performed within the previous period synchronization unit, the synchronization unit is shortened to an optimum value. The master-slave synchronous communication system according to any one of claims 1 to 5. 前期スレーブ割付部が前期制御周期データをもとに同期通信管理テーブルを作成する際に、通信にかかる時間が前期同期単位を超えることを検出すると、前記同期単位を最適値に延長することを特徴とする請求項1〜5の何れかに記載のマスタ・スレーブ同期通信システム。   When the slave allocation unit in the previous period creates a synchronous communication management table based on the previous period control cycle data, the synchronization unit is extended to the optimum value if it detects that the communication time exceeds the previous period synchronization unit. The master-slave synchronous communication system according to any one of claims 1 to 5. 前期マスタもしくは前期スレーブもしくは前期マスタおよび前期スレーブは最適化された前記同期単位をユーザーに通知することを特徴とする請求項1〜7の何れかに記載のマスタ・スレーブ同期通信システム。   The master-slave synchronous communication system according to any one of claims 1 to 7, wherein the first-term master, the first-term slave, or the first-term master and the first-term slave notify the user of the optimized synchronization unit.
JP2007189059A 2006-07-21 2007-07-20 Master / slave synchronous communication system Pending JP2008048395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007189059A JP2008048395A (en) 2006-07-21 2007-07-20 Master / slave synchronous communication system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006199687 2006-07-21
JP2007189059A JP2008048395A (en) 2006-07-21 2007-07-20 Master / slave synchronous communication system

Publications (1)

Publication Number Publication Date
JP2008048395A true JP2008048395A (en) 2008-02-28

Family

ID=39181640

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007189059A Pending JP2008048395A (en) 2006-07-21 2007-07-20 Master / slave synchronous communication system

Country Status (1)

Country Link
JP (1) JP2008048395A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014053741A (en) * 2012-09-06 2014-03-20 Denso Corp Communication system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014053741A (en) * 2012-09-06 2014-03-20 Denso Corp Communication system
US9672175B2 (en) 2012-09-06 2017-06-06 Denso Corporation Communication system

Similar Documents

Publication Publication Date Title
JP7214891B2 (en) Method, related apparatus and computer program for realizing time-sensitive network data transmission
JP4077833B2 (en) Adaptive address reconfiguration method due to changes in wireless network standards
CN1266574A (en) Method and bus system for automatic address allocation and communication station adaptable to the same
JPS5818656B2 (en) Distributed data processing system
JP2009507422A (en) Media access control architecture
US10602530B2 (en) Access method with access slots and priority resolution
TW522688B (en) Efficient time-division multiplexed addressing protocol
EP1193914A2 (en) Data transmission and reception
CN112894805B (en) Robot communication method and system based on industrial broadband bus
JP5454266B2 (en) Node, communication program, and communication method
KR20040053326A (en) Method and device for address allocation for transmitting packets over a transparent bridge
EP1091523B1 (en) Speed converter for IEEE-1394 serial bus network
CN111587560A (en) Master-slave bus system and method for operating a bus system
JP2008048395A (en) Master / slave synchronous communication system
CN108650296A (en) The means of communication, device and system
JP2009049621A (en) Master / slave synchronous communication system
CN115589398A (en) I 2 C address allocation method and computing device
CN106170937B (en) Communication device, communication system and method for synchronously sending messages
WO2016185710A1 (en) Packet transmission method and packet transmission device
JP5215894B2 (en) Communication control circuit, communication node, communication system, and communication control method and program
JP6328324B2 (en) Wireless communication apparatus, wireless communication method, and wireless communication program
JP2005318191A (en) Master / slave synchronous communication system using IEEE1394 network and automatic allocation method of synchronous communication resource
KR100424754B1 (en) Communication terminal accommodation apparatus and scheduling method
US8605733B2 (en) Method of data transmission, data transmitting apparatus, and network system
JP5400577B2 (en) Communication control device and communication control method