JP7469142B2 - Communication control system and communication control method - Google Patents

Communication control system and communication control method Download PDF

Info

Publication number
JP7469142B2
JP7469142B2 JP2020092878A JP2020092878A JP7469142B2 JP 7469142 B2 JP7469142 B2 JP 7469142B2 JP 2020092878 A JP2020092878 A JP 2020092878A JP 2020092878 A JP2020092878 A JP 2020092878A JP 7469142 B2 JP7469142 B2 JP 7469142B2
Authority
JP
Japan
Prior art keywords
communication
slave
unit
message
packet
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.)
Active
Application number
JP2020092878A
Other languages
Japanese (ja)
Other versions
JP2021190784A (en
Inventor
多佳彦 松島
正博 佐伯
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.)
Fanuc Corp
Original Assignee
Fanuc 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 Fanuc Corp filed Critical Fanuc Corp
Priority to JP2020092878A priority Critical patent/JP7469142B2/en
Publication of JP2021190784A publication Critical patent/JP2021190784A/en
Application granted granted Critical
Publication of JP7469142B2 publication Critical patent/JP7469142B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Numerical Control (AREA)
  • Small-Scale Networks (AREA)

Description

本発明は、制御装置をマスタとして、前記制御装置に接続される複数の外部信号入出力用機器(以下、「I/Oユニット」という)をスレーブとして、制御装置及び複数のI/Oユニットの間でI/O通信を行う通信制御システム及び通信制御方法に関する。 The present invention relates to a communication control system and a communication control method for performing I/O communication between a control device as a master and multiple external signal input/output devices (hereinafter referred to as "I/O units") connected to the control device as slaves.

工作機械を制御する数値制御装置及び産業用ロボットを制御するロボット制御装置(以下「制御装置」ともいう)は、例えば、制御装置をマスタとして、電気信号ケーブルを介して、複数のスレーブとしての外部信号入出力用機器(以下、「I/Oユニット」という)と接続され、マスタは各スレーブと1対1で通信を行う。具体的には、マスタは、予め設定された一定周期毎に、全てのスレーブとの通信を1回ずつ、サイクリックな通信を行っている。
例えば、特許文献1に記載されているように、数値制御装置がDO信号(具体的にはDOデータ)をI/Oユニットに送信し、I/OユニットがDO信号を受信すると、DI信号(具体的にはDIデータ)を返信することで、DI信号及びDO信号(以下「I/O信号」ともいう)の入出力を行っている。ここで、上記DO信号及びDI信号のやり取りを「I/O通信」又は「DI/DO通信」ともいう。DIデータは、例えばスタートコード、ヘッダ、DIデータ、フッタ、CRC、ストップコードの集合体(以下「DIパケット」ともいう)として送信される。DOデータは、例えばスタートコード、ヘッダ、DOデータ、フッタ、CRC、ストップコードの集合体(以下「DOパケット」ともいう)として送信される。
A numerical control device that controls a machine tool and a robot control device that controls an industrial robot (hereinafter also referred to as a "control device"), for example, is connected to a plurality of external signal input/output devices (hereinafter referred to as "I/O units") as slaves via electric signal cables with the control device as a master, and the master communicates with each slave one-to-one. Specifically, the master performs cyclic communication, communicating with all slaves once at a preset fixed period.
For example, as described in Patent Document 1, a numerical control device transmits a DO signal (specifically, DO data) to an I/O unit, and when the I/O unit receives the DO signal, it returns a DI signal (specifically, DI data), thereby inputting and outputting a DI signal and a DO signal (hereinafter also referred to as an "I/O signal"). Here, the exchange of the DO signal and the DI signal is also referred to as "I/O communication" or "DI/DO communication". The DI data is transmitted, for example, as a collection of a start code, a header, DI data, a footer, a CRC, and a stop code (hereinafter also referred to as a "DI packet"). The DO data is transmitted, for example, as a collection of a start code, a header, DO data, a footer, a CRC, and a stop code (hereinafter also referred to as a "DO packet").

以下、マスタとして数値制御装置を、スレーブとしてI/Oユニットを、通信接続形態として、デイジーチェーンを例示して説明する。図1は、数値制御装置と複数のI/Oユニットとを電気通信ケーブルで接続して構成される通信制御システムの一例を示す概略図である。
図1に示すように、数値制御装置は、CPU(以下、「制御部」ともいう)、I/Oメモリ、及び通信マスタを備え、I/Oユニットは、CPU(制御部)、及び通信スレーブを備える。なお、I/Oユニットは、その種類によっては、CPU(制御部)を備えない場合もある。
In the following, a description will be given of a daisy chain as an example of a communication connection configuration, with a numerical control device as a master and an I/O unit as a slave. Fig. 1 is a schematic diagram showing an example of a communication control system configured by connecting a numerical control device and a plurality of I/O units with electric communication cables.
As shown in Fig. 1, the numerical control device includes a CPU (hereinafter also referred to as a "controller"), an I/O memory, and a communication master, and the I/O unit includes a CPU (controller) and a communication slave. Note that, depending on the type of I/O unit, there are cases where the I/O unit does not include a CPU (controller).

図2は、数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)とのDI/DO通信に係る通信スケジュールの一例を示す図である。ここでは、予め設定された一定周期を2msとしている。図2に示すように、数値制御装置は、2ms毎に、全てのI/Oユニットとの通信(すなわち、数値制御装置がDOデータを送信し、I/OユニットがDOデータを受信すると、DIデータを返信するサイクリック通信)を1回ずつ行う。 Figure 2 shows an example of a communication schedule for DI/DO communication between a numerical control device (master) and multiple I/O units (slaves). Here, the preset fixed period is 2 ms. As shown in Figure 2, the numerical control device communicates with all I/O units once every 2 ms (i.e., cyclic communication in which the numerical control device transmits DO data, and the I/O units receive the DO data and then return DI data).

また、数値制御装置とI/Oユニットとは、I/O信号以外のデータであるメッセージを交換するための通信機能(以下「メッセージ通信」ともいう)を含むこともできる。具体的には、メッセージは、数値制御装置のCPU及びI/OユニットのCPUからの送信要求により、DO信号及びDI信号のサイクリック通信に組み込まれる形で行われる。すなわち、数値制御装置からI/Oユニットへのメッセージは、DOパケットに組み込まれ、例えばスタートコード、ヘッダ、DOデータ、メッセージ、フッタ、CRC、ストップコードの集合体であるDOパケットとして送信される。また、I/Oユニットから数値制御装置へのメッセージは、DIパケットに組み込まれ、例えばスタートコード、ヘッダ、DIデータ、メッセージ、フッタ、CRC、ストップコードの集合体であるDIパケットとして送信される。
なお、図2に記載されているように、マスタがスレーブに対してDO送信を行い、これに対して、スレーブがDI返信をする際に、スレーブは、マスタからDOパケットのヘッダを受信すると、DIパケットのヘッダ作成に移行するように構成される。
The numerical control device and the I/O unit may also include a communication function (hereinafter also referred to as "message communication") for exchanging messages, which are data other than I/O signals. Specifically, messages are transmitted in a form incorporated into cyclic communication of DO signals and DI signals in response to transmission requests from the CPU of the numerical control device and the CPU of the I/O unit. That is, messages from the numerical control device to the I/O unit are incorporated into DO packets and transmitted as DO packets, which are, for example, a collection of start codes, headers, DO data, messages, footers, CRCs, and stop codes. Messages from the I/O unit to the numerical control device are incorporated into DI packets and transmitted as DI packets, which are, for example, a collection of start codes, headers, DI data, messages, footers, CRCs, and stop codes.
As shown in FIG. 2, when the master transmits a DO packet to the slave and the slave responds by sending a DI packet, the slave is configured to transition to creating a DI packet header upon receiving the DO packet header from the master.

メッセージ通信の1つの例を説明する。例えば、数値制御装置(マスタ)には、指定されたI/Oユニット(スレーブ)の各種ステータスを表示する画面がある。オペレータが当該画面を開く操作をしたとき、数値制御装置(マスタ)が当該I/Oユニット(スレーブ)に対して、各種ステータスを送信するように要求するメッセージを送る。これに対して、当該I/Oユニット(スレーブ)は自身の各種ステータスを返信メッセージとして数値制御装置(マスタ)に返信する。そうすることで、数値制御装置(マスタ)は、オペレータから指示されたI/Oユニット(スレーブ)の各種ステータスを画面表示することができる。 Here is an example of message communication. For example, a numerical control device (master) has a screen that displays various statuses of a specified I/O unit (slave). When an operator performs an operation to open the screen, the numerical control device (master) sends a message to the I/O unit (slave) requesting it to send various statuses. In response, the I/O unit (slave) replies with its various statuses as a reply message to the numerical control device (master). In this way, the numerical control device (master) can display on the screen various statuses of the I/O unit (slave) specified by the operator.

メッセージ通信の別の例を説明する。例えば数値制御装置(マスタ)には、指定されたI/Oユニット(スレーブ)のフィルタ設定を行う画面がある。オペレータは当該画面を介して、当該I/Oユニット(スレーブ)のフィルタ設定について変更指示をすることができる。この場合、数値制御装置(マスタ)はオペレータにより指定されたI/Oユニット(スレーブ)に対して、フィルタ設定をオペレータの所望の値に変更するよう、変更要求メッセージを送る。これに対して、当該I/Oユニット(スレーブ)は、受信した変更要求メッセージに基づいて、フィルタ値を変更する。そうすることで、数値制御装置(マスタ)は、オペレータから指定されたI/Oユニット(スレーブ)のフィルタ設定を変更することができる。 Another example of message communication will be described. For example, a numerical control device (master) has a screen for setting the filter of a specified I/O unit (slave). An operator can instruct a change to the filter setting of the I/O unit (slave) via this screen. In this case, the numerical control device (master) sends a change request message to the I/O unit (slave) specified by the operator, requesting that the filter setting be changed to the operator's desired value. In response, the I/O unit (slave) changes the filter value based on the received change request message. In this way, the numerical control device (master) can change the filter setting of the I/O unit (slave) specified by the operator.

特許5837146号Patent No. 5837146

通常のDI/DOのサイクリック通信時に、数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)との間でメッセージ通信を行う場合、通信データ量が大幅に増加し、予め設定された一定周期(例えば、2ms)内に全てのDI/DO通信を完了できない可能性がある。
図3A及び図3Bは、それぞれ、数値制御装置(マスタ)と複数(N個:N≧3)のI/Oユニット(スレーブ)との間でメッセージ通信を行う場合の通信スケジュールの一例を示す図である。ここでは、予め設定された一定周期を2msとしている。図3Aを参照すると、2番目のI/Oユニットから数値制御装置に対して送信されるDIパケットにメッセージが組み込まれているが、N番目のI/Oユニット(スレーブ)とのDI/DO通信は予め設定された一定周期(例えば、2ms)以内に収まっているケースを例示している。
これに対して図3Bを参照すると、1番目と2番目のI/Oユニットから数値制御装置に対して送信されるDIパケットにメッセージが組み込まれている。このため、N番目のI/Oユニット(スレーブ)とのDI/DO通信が予め設定された一定周期(例えば、2ms)以内に収まらないケースを例示している。
During normal DI/DO cyclic communication, when message communication is performed between a numerical control device (master) and multiple I/O units (slaves), the amount of communication data increases significantly, and there is a possibility that all DI/DO communication cannot be completed within a preset fixed period (e.g., 2 ms).
3A and 3B are diagrams showing an example of a communication schedule when message communication is performed between a numerical control device (master) and multiple (N units: N≧3) I/O units (slaves). Here, the preset fixed period is 2 ms. Referring to FIG. 3A, a case is illustrated in which a message is incorporated in a DI packet transmitted from the second I/O unit to the numerical control device, but the DI/DO communication with the Nth I/O unit (slave) falls within the preset fixed period (e.g., 2 ms).
3B, a message is embedded in the DI packets sent from the first and second I/O units to the numerical control device, which illustrates a case in which the DI/DO communication with the Nth I/O unit (slave) does not fall within a preset fixed period (e.g., 2 ms).

図3Bに示すように、例えば数値制御装置(マスタ)とN番目のI/Oユニット(スレーブ)とのDI/DO通信が予め設定された一定周期(例えば、2ms)以内に収まらない場合、数値制御装置(通信マスタ)と複数のI/Oユニット(スレーブ)との間のDI/DOの更新周期(2ms毎に数値制御装置と複数のI/Oユニットとの間のDI/DO通信を1回ずつ行う)が担保されないこととなる。
このため、通常のサイクリック通信時に、数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)との間で、メッセージ通信を行う場合であっても、予め設定された一定周期以内に、全てのI/Oユニット(スレーブ)との間で、少なくともDI信号及びDO信号のやり取り(DI/DO通信)を完了できるようにして、I/O信号の更新周期を担保することが望まれる。
As shown in FIG. 3B , for example, if the DI/DO communication between a numerical control device (master) and an Nth I/O unit (slave) does not fall within a preset constant period (e.g., 2 ms), the update period of the DI/DO between the numerical control device (communication master) and multiple I/O units (slaves) (DI/DO communication between the numerical control device and multiple I/O units is performed once every 2 ms) will not be guaranteed.
For this reason, even when message communication is performed between a numerical control device (master) and multiple I/O units (slaves) during normal cyclic communication, it is desirable to ensure the update period of the I/O signals by completing the exchange of at least DI and DO signals (DI/DO communication) between all I/O units (slaves) within a predetermined fixed period.

(1)本開示の1態様は、 通信マスタを備える制御装置と、前記制御装置にデイジーチェーンにより通信可能に接続された通信スレーブをそれぞれ備える複数のI/Oユニットとの間で、予め設定された一定周期毎に、前記制御装置が全てのI/OユニットとI/O信号を送受信する通信制御システムにおいて、
前記通信マスタは、
各通信スレーブにそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブとのI/O信号送受信の周期ごとに、送信メッセージを除くDIデータ及びDOデータのみの通信に要した通信時間を計測し、各通信スレーブの通信帯域マージンデータ量を算出するマージンデータ量算出部と、
前記通信スレーブに対して、DOデータを送信するときに、前記通信帯域マージンデータ量を組み込んだDOパケットを作成し、前記通信スレーブに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割した部分メッセージを前記DOパケットに組み込むDOパケット作成部と、
前記DOパケットを前記通信スレーブに送信するDO送信部と、を備え、
前記通信スレーブは、
前記通信スレーブは、
前記通信マスタから送信されるDOパケットを受信するDO受信部と、
受信した前記DOパケットに含まれる前記通信帯域マージンデータ量を取得し、前記通信マスタに対して、DIデータを送信するときに、DIパケットを作成し、前記通信マスタに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割した部分メッセージを前記DIパケットに組み込むDIパケット作成部と、
前記DIパケットを前記通信マスタに送信するDI送信部と、を備える、
通信制御システムに関する。
(1) One aspect of the present disclosure is a communication control system in which a control device having a communication master and a plurality of I/O units each having a communication slave communicatively connected to the control device by a daisy chain are connected to the control device at a predetermined fixed period to transmit and receive I/O signals to and from all of the I/O units,
The communication master includes:
Each communication slave is assigned a communication cycle in advance.
a margin data amount calculation unit that measures a communication time required for communication of only DI data and DO data excluding transmission messages for each cycle of I/O signal transmission and reception with each communication slave, and calculates a communication band margin data amount of each communication slave;
a DO packet creation unit that creates a DO packet incorporating the communication bandwidth margin data amount when transmitting DO data to the communication slave, and when a message amount to be transmitted to the communication slave exceeds the communication bandwidth margin data amount, divides the transmission message into a plurality of communications, and incorporates a divided partial message of the transmission message, which does not exceed the communication bandwidth margin data amount, into the DO packet for each communication period;
a DO transmission unit that transmits the DO packet to the communication slave;
The communication slave is
The communication slave is
a DO receiving unit for receiving a DO packet transmitted from the communication master;
a DI packet creation unit that acquires the communication bandwidth margin data amount included in the received DO packet, creates a DI packet when transmitting DI data to the communication master, and when a message amount to be transmitted to the communication master exceeds the communication bandwidth margin data amount, divides the transmission message into a plurality of communications, and incorporates a divided partial message of the transmission message that does not exceed the communication bandwidth margin data amount into the DI packet for each communication period;
a DI transmission unit that transmits the DI packet to the communication master,
Regarding communication control systems.

(2) 本開示の1態様は、通信マスタを備える制御装置と、前記制御装置にデイジーチェーンにより通信可能に接続された通信スレーブをそれぞれ備える複数のI/Oユニットとの間で、予め設定された一定周期毎に、前記制御装置が全てのI/OユニットとI/O信号を送受信する通信制御方法であって、
前記通信マスタは、
各通信スレーブにそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブとのI/O信号送受信の周期ごとに、送信メッセージを除くDIデータ及びDOデータのみの通信に要した通信時間を計測し、各通信スレーブの通信帯域マージンデータ量を算出するマージンデータ量算出ステップと、
前記通信スレーブに対して、DOデータを送信するときに、前記通信帯域マージンデータ量を組み込んだDOパケットを作成し、前記通信スレーブに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割した部分メッセージを前記DOパケットに組み込むDOパケット作成ステップと、
前記DOパケットを前記通信スレーブに送信するDO送信ステップと、を備え、
前記通信スレーブは、
前記通信マスタから送信されるDOパケットを受信するDO受信ステップと、
受信した前記DOパケットに含まれる前記通信帯域マージンデータ量を取得し、前記通信マスタに対して、DIデータを送信するときに、DIパケットを作成し、前記通信マスタに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割された部分メッセージを前記DIパケットに組み込むDIパケット作成ステップと、
前記DIパケットを前記通信マスタに送信するDI送信ステップと、を備える、
通信制御方法に関する。
(2) One aspect of the present disclosure is a communication control method in which a control device including a communication master and a plurality of I/O units each including a communication slave communicatively connected to the control device by a daisy chain are used, the control device transmitting and receiving I/O signals to and from all of the I/O units at a constant period set in advance,
The communication master includes:
Each communication slave is assigned a communication cycle in advance.
a margin data amount calculation step of measuring a communication time required for communication of only DI data and DO data excluding a transmission message for each cycle of I/O signal transmission and reception with each communication slave, and calculating a communication band margin data amount of each communication slave;
a DO packet creation step of creating a DO packet incorporating the communication bandwidth margin data amount when transmitting DO data to the communication slave, and if the amount of a message to be transmitted to the communication slave exceeds the communication bandwidth margin data amount, dividing the transmission message into a plurality of communications and incorporating a partial message of the transmission message, which does not exceed the communication bandwidth margin data amount, into the DO packet for each communication period;
a DO transmission step of transmitting the DO packet to the communication slave;
The communication slave is
a DO receiving step of receiving a DO packet transmitted from the communication master;
a DI packet creation step of acquiring the communication bandwidth margin data amount included in the received DO packet, creating a DI packet when transmitting DI data to the communication master, and, if a message amount to be transmitted to the communication master exceeds the communication bandwidth margin data amount, dividing the transmission message into a plurality of communications and incorporating a divided partial message of the transmission message, which does not exceed the communication bandwidth margin data amount, into the DI packet for each communication period;
A DI transmission step of transmitting the DI packet to the communication master.
The present invention relates to a communication control method.

本開示の1態様によれば、通常のサイクリック通信時に、数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)との間で、メッセージ通信を行う場合であっても、予め設定された一定周期以内に、全てのI/Oユニット(スレーブ)との間で、少なくともDI信号及びDO信号のやり取り(DI/DO通信)を完了できるようにして、I/O信号の更新周期を担保することが可能となる。 According to one aspect of the present disclosure, even when message communication is performed between a numerical control device (master) and multiple I/O units (slaves) during normal cyclic communication, it is possible to ensure the update period of the I/O signals by completing at least the exchange of DI and DO signals (DI/DO communication) between all I/O units (slaves) within a preset fixed period.

本実施形態の通信制御システムの一例を示す概略図である。1 is a schematic diagram illustrating an example of a communication control system according to an embodiment of the present invention. 数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)とのDI/DO通信に係る通信スケジュールの一例を示す図である。FIG. 2 is a diagram showing an example of a communication schedule relating to DI/DO communication between a numerical control device (master) and a plurality of I/O units (slaves). 数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)との間でメッセージ通信を行う場合の通信スケジュールの一例を示す図である。FIG. 13 is a diagram showing an example of a communication schedule when message communication is performed between a numerical control device (master) and a plurality of I/O units (slaves). 数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)との間でメッセージ通信を行う場合の通信スケジュールの一例を示す図である。FIG. 13 is a diagram showing an example of a communication schedule when message communication is performed between a numerical control device (master) and a plurality of I/O units (slaves). マスタとしての数値制御装置1及びスレーブとしてのI/Oユニット3の機能ブロックを示す概略図である。2 is a schematic diagram showing functional blocks of a numerical control device 1 as a master and an I/O unit 3 as a slave. FIG. 通信マスタによる通信帯域マージンデータ量_kを算出する一例を示す図である。FIG. 13 is a diagram illustrating an example of calculation of a communication band margin data amount_k by a communication master. メッセージが通信帯域マージンデータ量_kに収まるように必要に応じてメッセージを分割する一例を示す図である。FIG. 13 is a diagram illustrating an example of dividing a message as necessary so that the message fits within a communication band margin data amount_k. マスタとしての数値制御装置1の動作を示すフローチャートの一例である。4 is an example of a flowchart showing an operation of the numerical control device 1 serving as a master. スレーブとしてのI/Oユニット3の動作を示すフローチャートの一例である。10 is an example of a flowchart showing an operation of the I/O unit 3 as a slave. マスタとしての数値制御装置1の機能ブロックを示す概略図である。FIG. 2 is a schematic diagram showing functional blocks of the numerical control device 1 serving as a master. スレーブ毎分割回数_kに基づいて、スレーブ毎通信周期を最適化する一例を示す図である。FIG. 13 is a diagram illustrating an example of optimizing a per-slave communication period based on per-slave division number_k. マスタとしての数値制御装置1の動作を示すフローチャートの一例である。4 is an example of a flowchart showing an operation of the numerical control device 1 serving as a master. マスタとしての数値制御装置1の動作を示すフローチャートの一例である。4 is an example of a flowchart showing an operation of the numerical control device 1 serving as a master.

(第1実施形態)
本発明の1つの実施形態について説明する。1つの実施形態として、数値制御装置と、I/Oユニットと、を電気信号ケーブルで接続し、データ通信(高速シリアル通信)を行う形態を例示して説明する。なお、高速シリアル通信を行う装置は数値制御装置に限られない。例えば、産業用ロボットを含む産業用機械の制御装置であってもよい。
前述したように、図1は、上記実施形態に係る、マスタとしての数値制御装置1と、スレーブとしての複数のI/Oユニット3と、を電気信号ケーブル6でデイジーチェーン接続して構成される通信制御システム1000の一例を示す概略図である。図1に示すように、マスタとしての数値制御装置1は、制御部10、I/Oメモリ12、及び通信マスタ15を備える。スレーブとしてのI/Oユニット3は、通信スレーブ35を含む。なお、I/Oユニットは、制御部30を備えてもよい。
First Embodiment
An embodiment of the present invention will be described. As an embodiment, a numerical control device and an I/O unit are connected by an electric signal cable to perform data communication (high-speed serial communication). Note that the device performing high-speed serial communication is not limited to a numerical control device. For example, it may be a control device for industrial machinery including an industrial robot.
As described above, Fig. 1 is a schematic diagram showing an example of a communication control system 1000 according to the embodiment, which is configured by daisy-chaining a numerical control device 1 as a master and a plurality of I/O units 3 as slaves with an electric signal cable 6. As shown in Fig. 1, the numerical control device 1 as a master includes a control unit 10, an I/O memory 12, and a communication master 15. The I/O unit 3 as a slave includes a communication slave 35. The I/O unit may include a control unit 30.

複数(N個:N≧2)のI/Oユニット3は、制御装置1に接続される順序k(1≦k≦N)により識別することができる。具体的には、制御装置1に直接接続されるI/Oユニット3をI/Oユニット3_1と識別し、I/Oユニット3_1に直接接続されるI/Oユニット3をI/Oユニット3_2、以下同様にI/Oユニット3_kに直接接続されるI/Oユニット3をI/Oユニット3_(k+1)等と識別することができる。以下特に断らないかぎり、N個(N≧2)のI/Oユニット3_k(1≦k≦N)がデイジーチェーン接続されているものとする。また、特に断らない限り、I/Oユニット3_kに含まれる制御部30を制御部30_k、通信スレーブ35を通信スレーブ35_kという。 The multiple (N units: N≧2) I/O units 3 can be identified by the order k (1≦k≦N) in which they are connected to the control device 1. Specifically, the I/O unit 3 directly connected to the control device 1 can be identified as I/O unit 3_1, the I/O unit 3 directly connected to I/O unit 3_1 can be identified as I/O unit 3_2, and similarly, the I/O unit 3 directly connected to I/O unit 3_k can be identified as I/O unit 3_(k+1), etc. Unless otherwise specified below, it is assumed that N (N≧2) I/O units 3_k (1≦k≦N) are daisy-chained. Furthermore, unless otherwise specified, the control unit 30 included in I/O unit 3_k is referred to as control unit 30_k, and the communication slave 35 is referred to as communication slave 35_k.

デイジーチェーン接続においては、通信スレーブ35_kは、前段に接続されている通信マスタ15(k=1の場合)又は通信スレーブ35_(k-1)(k≧2の場合)から信号を受信すると、受信した信号をそのまま後段の通信スレーブ35_(k+1)に送信する。また、通信スレーブ35_kは、後段に接続されている35_(k+1)から信号を受信すると、受信した信号をそのまま前段に接続されている通信マスタ15(k=1の場合)又は通信スレーブ35_(k-1)(k≧2の場合)に送信する。これにより、通信マスタ15は、複数の通信スレーブ35_kとの間で通信することができる。
そうすることで、各I/Oユニット3_kは、数値制御装置1との間で、入力信号(DI信号)/出力信号(DO信号)の入出力を行うことができる。
次に、通信制御システム1000の各構成要素について詳細に説明する。
In the daisy chain connection, when a communication slave 35_k receives a signal from the communication master 15 (when k=1) or communication slave 35_(k-1) (when k≧2) connected in the previous stage, it transmits the received signal as is to the communication slave 35_(k+1) in the subsequent stage. Also, when a communication slave 35_k receives a signal from the communication master 15 (when k=1) or communication slave 35_(k-1) (when k≧2) connected in the subsequent stage, it transmits the received signal as is to the communication master 15 (when k=1) or communication slave 35_(k-1) (when k≧2) connected in the previous stage. This allows the communication master 15 to communicate with a plurality of communication slaves 35_k.
In this way, each I/O unit 3_k can input and output input signals (DI signals)/output signals (DO signals) to and from the numerical control device 1.
Next, each component of the communication control system 1000 will be described in detail.

[数値制御装置1]
図4は、マスタとしての数値制御装置1及びスレーブとしてのI/Oユニット3の機能ブロックを示す概略図である。数値制御装置1は、図4に示すように、例えば、制御部10、I/Oメモリ12、及び通信マスタ15と、を備える。
[Numerical control device 1]
4 is a schematic diagram showing functional blocks of the numerical control device 1 as a master and the I/O unit 3 as a slave. As shown in FIG. 4, the numerical control device 1 includes, for example, a control unit 10, an I/O memory 12, and a communication master 15.

制御部10は、当業者にとって公知の数値制御機能部(図示せず)、及びI/Oインタフェース部101を有する。数値制御機能部は、当業者にとって公知であり、説明は省略する。 The control unit 10 has a numerical control function unit (not shown) that is known to those skilled in the art, and an I/O interface unit 101. The numerical control function unit is known to those skilled in the art, and a description thereof will be omitted.

I/Oインタフェース部101は、制御部10からの指示により、通信マスタ15からI/Oユニット3_k(1≦k≦N)に送信するDOデータ及びメッセージをI/Oメモリ12を介して設定する。また、I/Oインタフェース部101は、通信マスタ15がI/Oユニット3_k(1≦k≦N)から受信するDIデータ及びメッセージをI/Oメモリ12を介して取得する。ここで、I/Oメモリ12はI/Oユニット3_k(1≦k≦N)毎に対応するI/Oメモリ部_k(1≦k≦N)を含むようにしてもよい。
I/Oインタフェース部101は、通信マスタ15からI/Oユニット3_k(1≦k≦N)に対して送信するDOデータ及びメッセージを例えばI/Oメモリ部_k(1≦k≦N)に設定するとともに、通信マスタ15がI/Oユニット3_k(1≦k≦N)から受信したDIデータ及びメッセージを例えばI/Oメモリ部_k(1≦k≦N)から取得する。
通信マスタ15は、例えばI/Oメモリ部_k(1≦k≦N)から各I/Oユニット3_k(1≦k≦N)へ送信するDOデータ及び送信メッセージを入力し、通信スレーブ35_k(1≦k≦N)に対して送信する。後述するように、通信マスタ15は、各I/Oユニット3_k(1≦k≦N)に対して送信した送信メッセージ_kが送信完了となった場合、当該送信メッセージ_kの送信完了を制御部10(I/Oインタフェース部101)に対して例えばI/Oメモリ部_k(1≦k≦N)を介して、通知する。
また、後述するように、通信マスタ15は、各通信スレーブ35_k(1≦k≦N)からDIデータ及びメッセージ_kを受信し、I/Oユニット3_kからの送信メッセージ_kが受信完了となった場合、当該送信メッセージ_kの受信完了及び当該送信メッセージ_kを例えばI/Oメモリ部_k(1≦k≦N)に記録することで、制御部10(I/Oインタフェース部101)に対して通知することができる。そうすることで、制御装置1とI/Oユニット3_k(1≦k≦N)間でDI/DO通信及びメッセージの送受信を行うようにしてもよい。
The I/O interface unit 101 sets DO data and messages to be transmitted from the communication master 15 to the I/O unit 3_k (1≦k≦N) via the I/O memory 12 in response to an instruction from the control unit 10. The I/O interface unit 101 also acquires DI data and messages received by the communication master 15 from the I/O unit 3_k (1≦k≦N) via the I/O memory 12. Here, the I/O memory 12 may include an I/O memory unit_k (1≦k≦N) corresponding to each I/O unit 3_k (1≦k≦N).
The I/O interface unit 101 sets the DO data and messages to be sent from the communication master 15 to the I/O unit 3_k (1≦k≦N) in, for example, the I/O memory unit _k (1≦k≦N), and also acquires the DI data and messages received by the communication master 15 from the I/O unit 3_k (1≦k≦N) from, for example, the I/O memory unit _k (1≦k≦N).
The communication master 15 inputs, for example, DO data and a transmission message to be transmitted from an I/O memory unit_k (1≦k≦N) to each I/O unit 3_k (1≦k≦N) and transmits them to a communication slave 35_k (1≦k≦N). As will be described later, when the transmission of a transmission message_k transmitted to each I/O unit 3_k (1≦k≦N) is completed, the communication master 15 notifies the control unit 10 (I/O interface unit 101) of the completion of transmission of the transmission message_k via, for example, the I/O memory unit_k (1≦k≦N).
As will be described later, the communication master 15 receives DI data and a message_k from each communication slave 35_k (1≦k≦N), and when reception of a transmission message_k from an I/O unit 3_k is completed, the communication master 15 can notify the control unit 10 (I/O interface unit 101) of the completion of reception of the transmission message_k and by recording the transmission message_k in, for example, an I/O memory unit_k (1≦k≦N). In this way, DI/DO communication and transmission/reception of messages may be performed between the control device 1 and the I/O unit 3_k (1≦k≦N).

[通信マスタ15]
図4に示すように、通信マスタ15は、スレーブ毎通信周期割当部151と、DI/DO通信時間計測部152Aと、DI/DO通信時間算出部152Bと、マージンデータ量算出部153と、マスタ送信メッセージ判定部154と、DOパケット作成部155と、DO送信部158Aと、DI受信部158Bと、バッファメモリ159と、を有する。
[Communication Master 15]
As shown in FIG. 4, the communication master 15 includes a per-slave communication period allocation unit 151, a DI/DO communication time measurement unit 152A, a DI/DO communication time calculation unit 152B, a margin data amount calculation unit 153, a master transmission message determination unit 154, a DO packet creation unit 155, a DO transmission unit 158A, a DI reception unit 158B, and a buffer memory 159.

通信マスタ15の有する各機能部を説明する前に、バッファメモリ159について説明する。バッファメモリ159は、例えば各I/Oユニット3_k(1≦k≦N)の通信スレーブ35_k(1≦k≦N)に対応するバッファメモリ部_k(1≦k≦N)を含む。
バッファメモリ部_k(1≦k≦N)には、通信マスタ15と通信スレーブ35_k(1≦k≦N)との周期毎の通信に係る各種データが記憶されるようにしてもよい。具体的には、バッファメモリ部_kには、後述するスレーブ毎通信周期_k、DI/DO基本通信計測時間_k、DI/DO基本通信時間_k、通信帯域マージンデータ量_k、次回通信に持ち越すメッセージ長_k、及び次回通信に持ち越すメッセージ_kが、通信マスタ15により記憶されるようにしてもよい。こうすることで、通信マスタ15と各通信スレーブ35_k(1≦k≦N)との間でやりとりされる送信メッセージを複数回に分けて通信するように制御することができ、数値制御装置(マスタ)と複数のI/Oユニット(スレーブ)との間で、メッセージ通信を行う場合であっても、予め設定された一定周期以内に、全てのI/Oユニット(スレーブ)との間で、少なくともDI信号及びDO信号のやり取り(DI/DO通信)を完了できるようにして、I/O信号の更新周期を担保することができる。
Before describing each functional unit of the communication master 15, a description will be given of the buffer memory 159. The buffer memory 159 includes, for example, a buffer memory unit_k (1≦k≦N) corresponding to the communication slave 35_k (1≦k≦N) of each I/O unit 3_k (1≦k≦N).
The buffer memory unit _k (1≦k≦N) may store various data related to communication between the communication master 15 and the communication slave 35_k (1≦k≦N) for each period. Specifically, the buffer memory unit _k may store the slave-specific communication period _k, the DI/DO basic communication measurement time _k, the DI/DO basic communication time _k, the communication band margin data amount _k, the message length _k to be carried over to the next communication, and the message _k to be carried over to the next communication, which will be described later. In this way, it is possible to control the transmission message exchanged between the communication master 15 and each communication slave 35_k (1≦k≦N) to be communicated in multiple parts, and even when message communication is performed between the numerical control device (master) and multiple I/O units (slaves), it is possible to complete the exchange of at least DI and DO signals (DI/DO communication) between all the I/O units (slaves) within a preset fixed period, thereby ensuring the update period of the I/O signals.

<スレーブ毎通信周期割当部151>
スレーブ毎通信周期割当部151は、予め設定された一定周期毎に、全てのI/Oユニット3_k(1≦k≦N)とのI/O通信を可能とするために、通信スレーブ35_k(1≦k≦N)毎にスレーブ毎通信周期_kを割り当てる。
具体的には、スレーブ毎通信周期割当部151は、予め設定された一定周期を前記I/Oユニットの個数Nにより等分したスレーブ毎通信周期を各通信スレーブ35_k(1≦k≦N)に割り当てるようにしてもよい。
また、スレーブ毎通信周期割当部151は、I/Oユニット3_k(1≦k≦N)の接続順序に基づいて、スレーブ毎通信周期を傾斜的に各通信スレーブ35_k(1≦k≦N)に割り当てるようにしてもよい。具体的には、通信スレーブ35_k(1≦k≦N)のスレーブ毎通信周期_k(1≦k≦N)の値を、
j≦kの場合、スレーブ毎通信周期_j ≦ スレーブ毎通信周期_k
となるように、傾斜的に割り当ててもよい。デイジーチェーン接続においては、前述したように、後段の通信スレーブ35_(k+1)は、前段の通信スレーブ35_kを介して、通信マスタ15と送受信することから、後段の通信スレーブ35のスレーブ毎通信周期を前段の通信スレーブ35のスレーブ毎通信周期の値以上としてもよい。なお、具体的な算出式については、例えばケーブル長に比例する等、任意に設定してもよい。
また、スレーブ毎通信周期割当部151は、各I/Oユニット3_k(1≦k≦N)のDI/DO点数に基づいて、スレーブ毎通信周期を各通信スレーブ35_k(1≦k≦N)に割り当てるようにしてもよい。具体的には、通信スレーブ35_k(1≦k≦N)のスレーブ毎通信周期3_k(1≦k≦N)の値を、DI/DO点数が大きいものほど大きくなるように傾斜的に割り当ててもよい。具体的には、I/Oユニット3_jのDI/DO点数≦I/Oユニット3_kのDI/DO点数の場合、
スレーブ毎通信周期_j ≦ スレーブ毎通信周期_k
となるように、傾斜的に割り当ててもよい。なお、具体的な算出式については例えばDI/DO点数に比例する等、任意に設定してもよい。
また、スレーブ毎通信周期割当部151は、管理者から入力される値に基づいて設定するようにしてもよい。
<Slave-by-Slave Communication Cycle Allocation Unit 151>
The per-slave communication cycle allocation unit 151 allocates a per-slave communication cycle_k to each communication slave 35_k (1≦k≦N) to enable I/O communication with all I/O units 3_k (1≦k≦N) at a predetermined fixed cycle.
Specifically, the slave-specific communication cycle allocation unit 151 may allocate a slave-specific communication cycle that is a preset fixed cycle divided equally by the number N of I/O units to each communication slave 35_k (1≦k≦N).
Furthermore, the slave communication cycle allocation unit 151 may allocate the slave communication cycles to each communication slave 35_k (1≦k≦N) in a graded manner based on the connection order of the I/O units 3_k (1≦k≦N). Specifically, the value of the slave communication cycle_k (1≦k≦N) of the communication slave 35_k (1≦k≦N) may be set as follows:
If j≦k, then slave communication cycle_j≦slave communication cycle_k
In a daisy chain connection, as described above, the subsequent communication slave 35_(k+1) transmits and receives data to and from the communication master 15 via the previous communication slave 35_k, so the slave-by-slave communication period of the subsequent communication slave 35 may be set to be equal to or greater than the slave-by-slave communication period of the previous communication slave 35. Note that the specific calculation formula may be set arbitrarily, for example, proportional to the cable length.
Furthermore, the slave-specific communication cycle allocation unit 151 may allocate a slave-specific communication cycle to each communication slave 35_k (1≦k≦N) based on the DI/DO points of each I/O unit 3_k (1≦k≦N). Specifically, the value of the slave-specific communication cycle 3_k (1≦k≦N) of the communication slave 35_k (1≦k≦N) may be allocated in a gradient such that the value increases as the DI/DO points increase. Specifically, when the DI/DO points of I/O unit 3_j≦the DI/DO points of I/O unit 3_k,
Slave-by-slave communication cycle_j≦slave-by-slave communication cycle_k
The allocation may be made in a gradual manner so that the following formula is satisfied: The specific calculation formula may be set arbitrarily, for example, to be proportional to the DI/DO points.
The slave communication cycle allocation unit 151 may also perform setting based on a value input by an administrator.

<DI/DO通信時間計測部152A>
DI/DO通信時間計測部152Aは、予め設定された一定周期毎に、各通信スレーブ35_k(1≦k≦N)との、送信メッセージを除くDIデータ及びDOデータのみの通信(I/O通信)に要した通信時間を計測する。すなわち、DI/DO通信時間計測部152Aは、通信マスタ15と通信スレーブ35_k(1≦k≦N)間において、DI/DO通信に加えてメッセージの送信中の時間を含む場合、当該メッセージの送信中の計測時間を除くDIデータ及びDOデータのみの通信(I/O通信)に要した通信時間を計測する。以下、当該計測時間を「DI/DO基本通信計測時間_k」ともいう。
<DI/DO communication time measurement unit 152A>
The DI/DO communication time measurement unit 152A measures the communication time required for communication (I/O communication) of only DI data and DO data excluding transmission messages with each communication slave 35_k (1≦k≦N) at a preset fixed period. In other words, when the time during which a message is transmitted is included in addition to the DI/DO communication between the communication master 15 and the communication slave 35_k (1≦k≦N), the DI/DO communication time measurement unit 152A measures the communication time required for communication (I/O communication) of only DI data and DO data excluding the measurement time during which the message is transmitted. Hereinafter, this measured time is also referred to as "DI/DO basic communication measurement time_k".

<DI/DO通信時間算出部152B>
DI/DO通信時間算出部152Bは、DI/DO通信時間計測部152Aにより、予め設定された一定周期毎に現時点までに計測された、DI/DO基本通信計測時間_kの集合に基づいて、所定の計算式により、通信スレーブ35_k(1≦k≦N)毎にDIデータ及びDOデータのみの通信(I/O通信)に要した通信時間に係る統計値を算出する。以下、算出された通信時間に係る統計値を、「DI/DO基本通信時間_k」ともいう。具体的には、DI/DO通信時間算出部152Bは、予め設定された一定周期毎に、通信スレーブ35_k(1≦k≦N)毎にDI/DO基本通信時間_kを算出する。
ここで、上記算出式は、各通信スレーブ35_k(1≦k≦N)の前記計測時間の集合に含まれる最大値を算出して、通信スレーブ35_k(1≦k≦N)のDI/DO基本通信時間_kとしてもよい。また、前記計測集合に含まれる計測値の平均時間を通信スレーブ35_k(1≦k≦N)のDI/DO基本通信時間_kとしてもよい。
<DI/DO communication time calculation unit 152B>
The DI/DO communication time calculation unit 152B calculates a statistical value related to the communication time required for communication (I/O communication) of only DI data and DO data for each communication slave 35_k (1≦k≦N) using a predetermined formula based on a set of DI/DO basic communication measurement times_k measured by the DI/DO communication time measurement unit 152A at a preset fixed cycle up to the present time. Hereinafter, the calculated statistical value related to the communication time is also referred to as "DI/DO basic communication time_k." Specifically, the DI/DO communication time calculation unit 152B calculates the DI/DO basic communication time_k for each communication slave 35_k (1≦k≦N) at a preset fixed cycle.
Here, the above calculation formula may calculate the maximum value included in the set of measurement times of each communication slave 35_k (1≦k≦N) and use this as the DI/DO basic communication time_k of the communication slave 35_k (1≦k≦N). Also, the average time of the measurement values included in the measurement set may be used as the DI/DO basic communication time_k of the communication slave 35_k (1≦k≦N).

<マージンデータ量算出部153>
マージンデータ量算出部153は、通信スレーブ35_k(1≦k≦N)毎に、前記スレーブ毎通信周期割当部151により当該通信スレーブ35_k(1≦k≦N)に割り当てられたスレーブ毎通信周期_kと、前記DI/DO通信時間算出部152Bにより算出された当該通信スレーブ35_k(1≦k≦N)のDI/DO基本通信時間_kと、通信開始から現時点までのデータ転送レートと、に基づいて、通信スレーブ35_k(1≦k≦N)毎の通信帯域マージンデータ量_kを算出する。
具体的には、データ転送レートをRATEとすると、以下の式1より算出してもよい。

通信帯域マージンデータ量_k =
(スレーブ毎通信周期_k - DI/DO基本通信時間_k)/ RATE (式1)

この値は、具体的には、通信マスタ15と各通信スレーブ35_k(1≦k≦N)間において、DI/DO基本通信時間_kを除いた、例えばメッセージ送信に利用可能なデータ量となる。
具体的には、マージンデータ量算出部153は、予め設定された一定周期毎に、通信スレーブ35_k(1≦k≦N)毎に通信帯域マージンデータ量_kを算出する。したがって、通信帯域マージンデータ量_kは、固定値ではなく、通信周期毎に変動する変動値となる。
図5Aは、通信帯域マージンデータ量_kの算出例を示す図である。図5Aに示すように、通信帯域マージンデータ量_kは、通信周期毎に算出される。
<Margin Data Amount Calculation Unit 153>
The margin data amount calculation unit 153 calculates, for each communication slave 35_k (1≦k≦N), a communication bandwidth margin data amount _k for each communication slave 35_k (1≦k≦N) based on the per-slave communication cycle _k assigned to the communication slave 35_k (1≦k≦N) by the per-slave communication cycle allocation unit 151, the DI/DO basic communication time _k of the communication slave 35_k (1≦k≦N) calculated by the DI/DO communication time calculation unit 152B, and the data transfer rate from the start of communication to the present time.
Specifically, if the data transfer rate is RATE, it may be calculated using the following formula 1.

Communication bandwidth margin data volume_k =
(Slave-by-slave communication cycle_k - DI/DO basic communication time_k) / RATE (Formula 1)

Specifically, this value is the amount of data available for message transmission, for example, between the communication master 15 and each communication slave 35_k (1≦k≦N), excluding the DI/DO basic communication time_k.
Specifically, the margin data amount calculation unit 153 calculates the communication band margin data amount_k for each communication slave 35_k (1≦k≦N) at a preset fixed period. Therefore, the communication band margin data amount_k is not a fixed value but a variable value that varies at each communication period.
Fig. 5A is a diagram showing an example of calculation of communication band margin data amount_k. As shown in Fig. 5A, communication band margin data amount_k is calculated for each communication cycle.

<マスタ送信メッセージ判定部154>
マスタ送信メッセージ判定部154は、今回のDI/DO通信周期において、通信マスタ15から各通信スレーブ35_k(1≦k≦N)に対して、DOパケットを送信するときに、前回のDI/DO通信周期において次回通信に持ち越すメッセージ_kが発生したか否か、を判定するとともに、次回通信に持ち越すメッセージ_kが発生した場合、さらに前記次回通信に持ち越すメッセージ長_kと、通信帯域マージンデータ量_kの値と、の大小関係を判定する。
マスタ送信メッセージ判定部154は、未送信となった持ち越し送信メッセージ_kが無いと判定した場合、前述したようにI/Oメモリ12(I/Oメモリ部_k)を参照して、今回新たに送信する送信メッセージ_kがあるか否か、を判定するとともに、今回新たに送信する送信メッセージ_kがある場合、さらに新たな送信メッセージ_kの長さと、通信帯域マージンデータ量_kの値と、の大小関係を判定する。
<Master transmission message determination unit 154>
When a DO packet is transmitted from the communication master 15 to each communication slave 35_k (1≦k≦N) in the current DI/DO communication cycle, the master transmission message determination unit 154 determines whether or not a message_k to be carried over to the next communication occurred in the previous DI/DO communication cycle, and if a message_k to be carried over to the next communication occurs, it further determines the magnitude relationship between the message length_k to be carried over to the next communication and the value of the communication bandwidth margin data amount_k.
When the master transmission message determination unit 154 determines that there is no carried-over transmission message _k that has not been transmitted, it refers to the I/O memory 12 (I/O memory unit _k) as described above to determine whether or not there is a transmission message _k to be newly transmitted this time, and if there is a transmission message _k to be newly transmitted this time, it further determines whether the length of the new transmission message _k is larger than the value of the communication bandwidth margin data amount _k.

<DOパケット作成部155>
次に、DOパケット作成部155について詳細に説明する。DOパケット作成部155は、例えば前述したようにスタートコード、ヘッダ、DOデータ、メッセージ、フッタ、CRC、ストップコードの集合体であるDOパケットを作成する。ここで、DOデータは、予め設定された一定周期毎にI/Oユニット3_k(1≦k≦N)に送信されるDO信号である。メッセージは、I/Oユニット3_k(1≦k≦N)に送信するメッセージがある場合に、設定される。ヘッダには、通常のパケット通信に設定されるデータの外、送信メッセージの有無、送信メッセージ長、次回通信に持ち越すメッセージ長、マージンデータ量算出部153により算出された通信帯域マージンデータ量_kの値が設定されるようにしてもよい。
DOパケット作成部155は、以下に述べる5つのケースに対応して、DOパケットを作成する。
<DO Packet Creation Unit 155>
Next, the DO packet creation unit 155 will be described in detail. The DO packet creation unit 155 creates a DO packet, which is a collection of a start code, a header, DO data, a message, a footer, a CRC, and a stop code, as described above. Here, the DO data is a DO signal transmitted to the I/O unit 3_k (1≦k≦N) at a preset fixed period. The message is set when there is a message to be transmitted to the I/O unit 3_k (1≦k≦N). In addition to data set in normal packet communication, the header may be set with the presence or absence of a transmission message, the transmission message length, the message length carried over to the next communication, and the value of the communication band margin data amount_k calculated by the margin data amount calculation unit 153.
The DO packet creating unit 155 creates a DO packet in response to the following five cases.

<通常のDOパケット_ケース1>
各通信スレーブ35_k(1≦k≦N)に対して今回の周期において送信する、DOパケットを作成するとき、マスタ送信メッセージ判定部154により、前回の周期における次回通信に持ち越すメッセージ_k、及び今回新たに送信する送信メッセージ_kが無いと判定された場合、DOパケット作成部155は、マージンデータ量算出部153により算出された通信帯域マージンデータ量_kの値を例えばヘッダ部に設定したDOパケット(「ケース1のDOパケット」という)を作成する。
<Normal DO Packet - Case 1>
When creating a DO packet to be transmitted to each communication slave 35_k (1≦k≦N) in the current cycle, if the master transmission message determination unit 154 determines that there is no message _k to be carried over to the next communication in the previous cycle and no transmission message _k to be newly transmitted this time, the DO packet creation unit 155 creates a DO packet (referred to as a "DO packet of case 1") in which the value of the communication bandwidth margin data amount _k calculated by the margin data amount calculation unit 153 is set, for example, in the header portion.

<最後の持ち越し送信メッセージ_ケース2>
マスタ送信メッセージ判定部154により、前回の周期における次回通信に持ち越すメッセージ_kがあると判定され、さらに前記次回通信に持ち越すメッセージ長_kが、通信帯域マージンデータ量_kの値を超えないと判定された場合、DOパケット作成部155は、通信帯域マージンデータ量_kの値を例えばヘッダ部に設定し、前記次回通信に持ち越すメッセージ_kを今回の送信メッセージ_kとして組み込んだDOパケット(「ケース2のDOパケット」という)を作成する。
後述するDO送信部158Aにより、当該DOパケット(「ケース2のDOパケット」)を送信することで、制御部10から送信要求のあったメッセージは送信完了となる。この場合、後述するように、DO送信部158Aは、制御部10から送信要求された送信メッセージ_kの送信完了を制御部10(I/Oインタフェース部101)に対して例えばI/Oメモリ部_k(1≦k≦N)を介して、通知するようにしてもよい。
<Last Carry-Over Sent Message - Case 2>
If the master transmission message determination unit 154 determines that there is a message _k to be carried over to the next communication in the previous cycle and further determines that the message length _k to be carried over to the next communication does not exceed the value of the communication bandwidth margin data amount _k, the DO packet creation unit 155 sets the value of the communication bandwidth margin data amount _k, for example, in the header section, and creates a DO packet (referred to as a "DO packet of case 2") that incorporates the message _k to be carried over to the next communication as the current transmission message _k.
The DO transmitting unit 158A, which will be described later, transmits the DO packet ("DO packet of case 2"), thereby completing the transmission of the message requested for transmission by the control unit 10. In this case, as will be described later, the DO transmitting unit 158A may notify the control unit 10 (I/O interface unit 101) of the completion of transmission of the transmission message_k requested for transmission by the control unit 10 via, for example, an I/O memory unit_k (1≦k≦N).

<さらなる持ち越し送信メッセージの発生_ケース3>
マスタ送信メッセージ判定部154により、通信スレーブ35_k(1≦k≦N)に対する前回の周期における次回通信に持ち越すメッセージ_kがあると判定され、さらに前記次回通信に持ち越すメッセージ_kの長さが、通信帯域マージンデータ量_kの値を超えると判定された場合、DOパケット作成部155は、前記次回通信に持ち越すメッセージ_kのうち、通信帯域マージンデータ量_kに相当する、メッセージ_kの一部分を今回の周期で送信する送信メッセージ_kとする。DOパケット作成部155は、今回の周期で送信する送信メッセージ_kを除いた送信メッセージ_kの残りの部分を次回通信に持ち越すメッセージ_kとして、次回通信に持ち越すメッセージ長_kとともに例えばバッファメモリ部_kに記憶する。DOパケット作成部155は、通信帯域マージンデータ量_kの値、次回通信に持ち越すメッセージ長_kを例えばヘッダ部に設定し、今回の周期において送信する送信メッセージ_kを組み込んだDOパケット(「ケース3のDOパケット」という)を作成する。
なお、次回通信に持ち越すメッセージ_kが残ることから、後述するDO送信部158Aにより、当該DOパケットを送信しても、制御部10から送信要求のあったメッセージは、送信完了とはならない。
<Further carryover transmission messages occur - Case 3>
When the master transmission message determination unit 154 determines that there is a message_k to be carried over to the next communication in the previous cycle for the communication slave 35_k (1≦k≦N) and further determines that the length of the message_k to be carried over to the next communication exceeds the value of the communication band margin data amount_k, the DO packet creation unit 155 sets a part of the message_k, which corresponds to the communication band margin data amount_k, among the messages_k to be carried over to the next communication, as the transmission message_k to be transmitted in the current cycle. The DO packet creation unit 155 stores the remaining part of the transmission message_k, excluding the transmission message_k to be transmitted in the current cycle, together with the message length_k to be carried over to the next communication, in, for example, the buffer memory unit_k. The DO packet creation unit 155 sets the value of the communication band margin data amount_k and the message length_k to be carried over to the next communication, for example, in the header part, and creates a DO packet (referred to as a "DO packet of case 3") incorporating the transmission message_k to be transmitted in the current cycle.
Since message_k remains to be carried over to the next communication, even if the DO packet is transmitted by a DO transmitting unit 158A (described later), the transmission of the message requested by the control unit 10 is not completed.

<新たな送信メッセージ_ケース4>
マスタ送信メッセージ判定部154により、通信スレーブ35_k(1≦k≦N)に対する前回の周期における次回通信に持ち越すメッセージ_kがなく、今回の周期における新たな送信メッセージ_kがあると判定され、さらに当該新たな送信メッセージ_kの長さが、通信帯域マージンデータ量_kの値を超えないと判定された場合、DOパケット作成部155は、通信帯域マージンデータ量_kの値を例えばヘッダ部に設定し、今回の周期における新たな送信メッセージ_kを今回の送信メッセージ_kとして組み込んだDOパケット(「ケース4のDOパケット」という)を作成する。
後述するDO送信部158Aにより、当該DOパケット(「ケース4のDOパケット」)を送信することで、制御部10から送信要求のあった新たな送信メッセージは送信完了となる。この場合、後述するように、DO送信部158Aは、送信要求された送信メッセージ_kの送信完了を制御部10(I/Oインタフェース部101)に対して例えばI/Oメモリ部_k(1≦k≦N)を介して、通知する。
<New sent message - Case 4>
If the master transmission message determination unit 154 determines that there was no message _k to be carried over to the next communication with the communication slave 35_k (1≦k≦N) in the previous cycle and that there is a new transmission message _k in the current cycle, and further determines that the length of the new transmission message _k does not exceed the value of the communication bandwidth margin data amount _k, the DO packet creation unit 155 sets the value of the communication bandwidth margin data amount _k, for example, in the header section, and creates a DO packet (referred to as a “DO packet of case 4”) in which the new transmission message _k in the current cycle is incorporated as the current transmission message _k.
The DO transmitting unit 158A, which will be described later, transmits the DO packet ("DO packet of case 4"), thereby completing the transmission of the new transmission message requested by the control unit 10. In this case, as will be described later, the DO transmitting unit 158A notifies the control unit 10 (I/O interface unit 101) of the completion of transmission of the requested transmission message_k, for example, via an I/O memory unit_k (1≦k≦N).

<新たな送信メッセージ_ケース5>
マスタ送信メッセージ判定部154により、通信スレーブ35_k(1≦k≦N)に対する前回の周期における次回通信に持ち越すメッセージ_kがなく、今回の周期における新たな送信メッセージ_kがあると判定され、さらに当該新たな送信メッセージ_kの長さが、通信帯域マージンデータ量_kの値を超えると判定された場合、DOパケット作成部155は、今回の周期における新たな送信メッセージ_kのうち、通信帯域マージンデータ量_kに相当する、当該メッセージ_kの一部分を今回の周期で送信する送信メッセージ_kとする。DOパケット作成部155は、今回の周期で送信する送信メッセージ_kを除いた当該メッセージ_kの残りの部分を次回通信に持ち越すメッセージ_kとして、次回通信に持ち越すメッセージ長_kとともに例えばバッファメモリ部_kに記憶する。
DOパケット作成部155は、通信帯域マージンデータ量_kの値、次回通信に持ち越すメッセージ長_kを例えばヘッダ部に設定し、今回の周期において送信する送信メッセージ_kを組み込んだDOパケット(「ケース5のDOパケット」)を作成する。
なお、次回通信に持ち越すメッセージ_kが残ることから、後述するDO送信部158Aにより、当該DOパケットを送信しても、制御部10から送信要求のあった新たな送信メッセージは、送信完了とはならない。
図5Bは、メッセージが通信帯域マージンデータ量_kに収まるように必要に応じてメッセージを分割する一例を示す図である。図5Bに示すように、メッセージ量が通信帯域マージンデータ量_k以下ならば、一度に当該メッセージを送信し、メッセージ量が通信帯域マージンデータ量_kを超える場合、先ず通信帯域マージンデータ量分を送信し、次回以降の通信で残りを送信するように構成される。
<New sent message - Case 5>
When the master transmission message determination unit 154 determines that there is no message _k to be carried over to the next communication for the communication slave 35_k (1≦k≦N) in the previous cycle and that there is a new transmission message _k in the current cycle, and further determines that the length of the new transmission message _k exceeds the value of the communication band margin data amount _k, the DO packet creation unit 155 determines that a part of the new transmission message _k in the current cycle, which corresponds to the communication band margin data amount _k, is the transmission message _k to be transmitted in the current cycle. The DO packet creation unit 155 stores the remaining part of the message _k, excluding the transmission message _k to be transmitted in the current cycle, as the message _k to be carried over to the next communication, together with the message length _k to be carried over to the next communication, for example, in the buffer memory unit _k.
The DO packet creation unit 155 sets the value of the communication bandwidth margin data amount _k and the message length _k to be carried over to the next communication, for example, in the header section, and creates a DO packet ("DO packet for case 5") that incorporates the transmission message _k to be transmitted in the current cycle.
Since message_k remains to be carried over to the next communication, even if the DO packet is transmitted by the DO transmitting unit 158A described later, the new transmission message requested by the control unit 10 is not considered to have been completely transmitted.
5B is a diagram showing an example of dividing a message as necessary so that the message fits within the communication band margin data amount_k. As shown in FIG. 5B, if the message amount is equal to or less than the communication band margin data amount_k, the message is transmitted at once, and if the message amount exceeds the communication band margin data amount_k, the communication band margin data amount is transmitted first, and the remainder is transmitted in the next or subsequent communication.

<DO送信部158A>
DO送信部158Aは、周期毎にDOパケット作成部155により作成されたDOパケットを通信スレーブ35_k(1≦k≦N)に対して送信する。DO送信部158Aは、前述したように、ケース2のDOパケット及びケース4のDOパケットを送信完了すると、制御部10から送信要求された送信メッセージ_kの送信完了を制御部10(I/Oインタフェース部101)に対して例えばI/Oメモリ部_k(1≦k≦N)に記録することで、通知するようにしてもよい。
<DO transmission unit 158A>
The DO transmission unit 158A periodically transmits the DO packet created by the DO packet creation unit 155 to the communication slave 35_k (1≦k≦N). As described above, when the DO transmission unit 158A completes transmission of the DO packet of case 2 and the DO packet of case 4, the DO transmission unit 158A may notify the control unit 10 (I/O interface unit 101) of the completion of transmission of the transmission message_k requested by the control unit 10, for example, by recording it in the I/O memory unit_k (1≦k≦N).

<DI受信部158B>
DI受信部158Bは、各通信スレーブ35_k(1≦k≦N)から送信されるDIデータ及び送信メッセージ_kを例えばバッファメモリ部_kを介して受信する。各通信スレーブ35_k(1≦k≦N)から送信される送信メッセージ_kは、後述するように分割されて送信されるケースがある。
DI受信部158Bは、各通信スレーブ35_k(1≦k≦N)から送信される送信メッセージ_kが分割されて送信される場合は、分割されたメッセージを全て受信すると、当該メッセージ_kを復元して、I/Oユニット3_k(1≦k≦N)から受信した当該メッセージ_kの送信完了及び復元したメッセージ_kを、制御部10(I/Oインタフェース部101)に対して例えばI/Oメモリ部_k(1≦k≦N)に記録することで、通知することができる。
以上、マスタとしての数値制御装置1について説明した。
次に、スレーブとしてのI/Oユニット3について説明する。
<DI receiving unit 158B>
The DI receiving unit 158B receives the DI data and the transmission message _k transmitted from each communication slave 35_k (1≦k≦N) via, for example, a buffer memory unit _k. The transmission message _k transmitted from each communication slave 35_k (1≦k≦N) may be divided and transmitted as described later.
When a transmission message _k sent from each communication slave 35_k (1≦k≦N) is divided and transmitted, the DI receiving unit 158B, upon receiving all the divided messages, restores the message _k and can notify the control unit 10 (I/O interface unit 101) of the completion of transmission of the message _k received from the I/O unit 3_k (1≦k≦N) and the restored message _k, for example, by recording it in the I/O memory unit _k (1≦k≦N).
The numerical control device 1 serving as the master has been described above.
Next, the I/O unit 3 as a slave will be described.

[I/Oユニット3]
図4に、スレーブとしてのI/Oユニット3の機能ブロックを示す。
I/Oユニット3は、図4に示すように、例えば、制御部30、メモリ32、及び通信スレーブ35を備える。以降、特に断らない限り、I/Oユニット3_k(1≦k≦N)に共通の構成を説明する際に、I/Oユニット3と記載する。
制御部30は、当業者にとって公知のI/O信号制御機能部(図示せず)、及びI/Oインタフェース部301を有する。I/O信号制御機能部は、当業者にとって公知であり、説明は省略する。
I/Oインタフェース部301は、メモリ32を介して、数値制御装置1からのDO信号及びメッセージを通信スレーブ35から取得する。また、I/Oインタフェース部301は、マスタとしての数値制御装置1へのDI信号及び送信メッセージを、通信スレーブ35に対して送信するように、例えばメモリ32を介して設定するようにしてもよい。
具体的には、I/Oインタフェース部301は、数値制御装置1から送信されるDO信号及びメッセージを当該メモリ32から取得するとともに、数値制御装置1に対して送信するDI信号及びメッセージを当該メモリ32に設定するようにしてもよい。
通信スレーブ35は、通信マスタ15から受信したDO信号及びメッセージを受信し、数値制御装置1からの送信メッセージが受信完了となった場合、当該送信メッセージの受信完了及び当該送信メッセージを例えばメモリ32に記録することで、制御部30(I/Oインタフェース部101)に対して通知することができる。
また、通信スレーブ35は、例えばメモリ32から数値制御装置1へのDIデータ及び送信メッセージを入力し、数値制御装置1に対してDI信号及び送信メッセージを送信する。後述するように、通信スレーブ35は、送信要求された送信メッセージが送信完了となった場合、当該送信メッセージの送信完了を制御部30(I/Oインタフェース部301)に対して例えばメモリ32を介して、通知する。
[I/O unit 3]
FIG. 4 shows a functional block diagram of the I/O unit 3 acting as a slave.
4, the I/O unit 3 includes, for example, a control unit 30, a memory 32, and a communication slave 35. Hereinafter, unless otherwise specified, when describing a configuration common to I/O units 3_k (1≦k≦N), it will be referred to as an I/O unit 3.
The control unit 30 has an I/O signal control function unit (not shown) known to those skilled in the art, and an I/O interface unit 301. The I/O signal control function unit is known to those skilled in the art, and a description thereof will be omitted.
The I/O interface unit 301 acquires DO signals and messages from the numerical control device 1 from the communication slave 35 via the memory 32. The I/O interface unit 301 may also be set, for example, via the memory 32, so as to transmit DI signals and transmission messages to the numerical control device 1 as the master to the communication slave 35.
Specifically, the I/O interface unit 301 may obtain DO signals and messages transmitted from the numerical control device 1 from the memory 32, and set DI signals and messages to be transmitted to the numerical control device 1 in the memory 32.
The communication slave 35 receives the DO signal and message from the communication master 15, and when the reception of the transmitted message from the numerical control device 1 is completed, it can notify the control unit 30 (I/O interface unit 101) of the completion of reception of the transmitted message and by recording the transmitted message, for example, in memory 32.
Furthermore, the communication slave 35 inputs DI data and a transmission message to the numerical control device 1 from, for example, the memory 32, and transmits a DI signal and a transmission message to the numerical control device 1. As will be described later, when the transmission of a transmission message requested to be transmitted is completed, the communication slave 35 notifies the control unit 30 (I/O interface unit 301) of the completion of transmission of the transmission message via, for example, the memory 32.

通信スレーブ35は、スレーブ送信メッセージ判定部354と、DIパケット作成部355と、DI送信部358Aと、DO受信部358Bと、バッファメモリ359と、を有する。
以下、特に断らない限り、通信スレーブ35_k(1≦k≦N)機能部の説明に際しては、通信スレーブ35と記載する。
The communication slave 35 includes a slave transmission message determining unit 354 , a DI packet creating unit 355 , a DI transmitting unit 358 A, a DO receiving unit 358 B, and a buffer memory 359 .
Hereinafter, unless otherwise specified, in describing the functional unit of a communication slave 35_k (1≦k≦N), the communication slave will be referred to as a communication slave 35.

スレーブ送信メッセージ判定部354は、今回のDI/DO通信周期において、通信スレーブ35から通信マスタ15に対して、DIパケットを作成するときに、前回のDI/DO通信周期において次回通信に持ち越すメッセージが発生したか否かを判定するとともに、次回通信に持ち越すメッセージが発生した場合、さらに前記次回通信に持ち越すメッセージ長と、通信帯域マージンデータ量の値と、の大小関係を判定する。
スレーブ送信メッセージ判定部354は、未送信となった持ち越し送信メッセージが無いと判定した場合、前述したようにメモリ32を参照して、今回新たに送信する送信メッセージがあるか否かを判定するとともに、今回新たに送信する送信メッセージがある場合、さらに新たな送信メッセージの長さと、通信帯域マージンデータ量の値と、の大小関係を判定する。ここで、通信帯域マージンデータ量の値として、今回のDI/DO通信周期において、通信マスタ15から受信したDOパケットのヘッダ部に設定された値を用いる。
When creating a DI packet from the communication slave 35 to the communication master 15 in the current DI/DO communication cycle, the slave transmission message determination unit 354 determines whether or not a message to be carried over to the next communication occurred in the previous DI/DO communication cycle, and if a message to be carried over to the next communication occurred, it further determines the relative size of the message length to be carried over to the next communication and the value of the communication bandwidth margin data amount.
When the slave transmission message determination unit 354 determines that there is no unsent carried-over transmission message, it refers to the memory 32 as described above to determine whether there is a new transmission message to be transmitted this time, and if there is a new transmission message to be transmitted this time, it further determines whether the length of the new transmission message is larger than the value of the communication bandwidth margin data amount. Here, as the value of the communication bandwidth margin data amount, the value set in the header part of the DO packet received from the communication master 15 in the current DI/DO communication cycle is used.

次に、DIパケット作成部355について詳細に説明する。前述したように、通信スレーブ35は、DOパケットのヘッダを受信すると、DIパケット作成部355により、DIパケットのヘッダの作成に移行することができる。その後、DIデータ、メッセージ作成に移行することができる。
<通常のDIパケット_ケース1>
通信マスタ15に対して今回の周期において送信する、DIパケットを作成するとき、スレーブ送信メッセージ判定部354により、前回の周期における次回通信に持ち越すメッセージ、及び今回新たに送信する送信メッセージが無いと判定された場合、DIパケット作成部355は、例えば、ヘッダ部における次回の通信周期に持ち越す送信メッセージ長及び新たな送信メッセージ長をともにゼロとしたDIパケット(「ケース1のDIパケット」という)を作成する。
Next, the DI packet creation unit 355 will be described in detail. As described above, when the communication slave 35 receives the header of the DO packet, the DI packet creation unit 355 can move on to creating the header of the DI packet. After that, the communication slave 35 can move on to creating the DI data and message.
<Normal DI packet_Case 1>
When creating a DI packet to be transmitted to the communication master 15 in the current cycle, if the slave transmission message determination unit 354 determines that there is no message to be carried over to the next communication in the previous cycle and no new transmission message to be transmitted this time, the DI packet creation unit 355 creates a DI packet (referred to as a "DI packet of case 1") in which, for example, the transmission message length to be carried over to the next communication cycle and the new transmission message length in the header section are both set to zero.

<最後の持ち越し送信メッセージ_ケース2>
スレーブ送信メッセージ判定部354により、前回の周期における次回通信に持ち越すメッセージがあると判定され、さらに前記次回通信に持ち越すメッセージ長が、通信帯域マージンデータ量の値を超えないと判定された場合、DIパケット作成部355は、例えばヘッダ部における次回の周期に持ち越す送信メッセージ長をゼロにするとともに、前回の周期における持ち越し送信メッセージを今回の送信メッセージとして組み込んだDIパケット(「ケース2のDIパケット」という)を作成する。
後述するDI送信部358Aにより、当該DIパケット(「ケース2のDIパケット」)を送信することで、制御部30から送信要求のあったメッセージは送信完了となる。この場合、後述するように、DI送信部358Aは、送信要求された送信メッセージの送信完了を制御部30(I/Oインタフェース部301)に対して例えばメモリ32を介して、通知するようにしてもよい。
<Last Carry-Over Sent Message - Case 2>
If the slave transmission message determination unit 354 determines that there is a message in the previous cycle that will be carried over to the next communication, and further determines that the length of the message to be carried over to the next communication does not exceed the value of the communication bandwidth margin data amount, the DI packet creation unit 355 sets the transmission message length to be carried over to the next cycle, for example in the header section, to zero, and creates a DI packet (referred to as a "DI packet of case 2") that incorporates the carried over transmission message from the previous cycle as the current transmission message.
The DI transmission unit 358A, which will be described later, transmits the DI packet ("DI packet of case 2"), thereby completing the transmission of the message requested by the control unit 30. In this case, as will be described later, the DI transmission unit 358A may notify the control unit 30 (I/O interface unit 301) of the completion of the transmission of the requested transmission message via, for example, the memory 32.

<さらなる持ち越し送信メッセージの発生_ケース3>
スレーブ送信メッセージ判定部354により、通信マスタ15に対する前回の周期における次回通信に持ち越すメッセージがあると判定され、さらに前記次回通信に持ち越すメッセージの長さが、通信帯域マージンデータ量の値を超えると判定された場合、DIパケット作成部355は、前記次回通信に持ち越すメッセージのうち、通信帯域マージンデータ量に相当するメッセージの一部分を今回の周期で送信する送信メッセージとする。DIパケット作成部355は、今回の周期で送信する送信メッセージを除いた送信メッセージの残りの部分を次回通信に持ち越すメッセージとして、次回通信に持ち越すメッセージ長とともに例えばバッファメモリ359に記憶するようにしてもよい。DIパケット作成部355は、通信帯域マージンデータ量_kの値、次回通信に持ち越すメッセージ長_kを例えばヘッダ部に設定し、ヘッダ部に次回の周期に持ち越す持ち越し送信メッセージ長を設定するとともに、今回の周期において送信する送信メッセージを組み込んだDIパケット(「ケース3のDIパケット」という)を作成する。
なお、次回通信に持ち越すメッセージが残ることから、後述するDI送信部358Aにより、当該DIパケットを送信しても、制御部30から送信要求のあったメッセージは、送信完了とはならない。
<Further carryover transmission messages occur - Case 3>
When the slave transmission message determination unit 354 determines that there is a message to be carried over to the next communication in the previous cycle with the communication master 15, and further determines that the length of the message to be carried over to the next communication exceeds the value of the communication band margin data amount, the DI packet creation unit 355 sets a part of the message corresponding to the communication band margin data amount among the messages to be carried over to the next communication as a transmission message to be transmitted in the current cycle. The DI packet creation unit 355 may store the remaining part of the transmission message excluding the transmission message to be transmitted in the current cycle as a message to be carried over to the next communication together with the message length to be carried over to the next communication, for example, in the buffer memory 359. The DI packet creation unit 355 sets the value of the communication band margin data amount_k and the message length_k to be carried over to the next communication, for example, in the header part, sets the carryover transmission message length to be carried over to the next cycle in the header part, and creates a DI packet (referred to as a "DI packet of case 3") incorporating the transmission message to be transmitted in the current cycle.
Since there remains a message to be carried over to the next communication, even if the DI packet is transmitted by a DI transmitting unit 358A (described later), the message requested for transmission by the control unit 30 does not complete transmission.

<新たな送信メッセージ_ケース4>
スレーブ送信メッセージ判定部354により、通信マスタ15に対する前回の周期における次回通信に持ち越すメッセージがなく、今回の周期における新たな送信メッセージがあると判定され、さらに当該新たな送信メッセージの長さが通信帯域マージンデータ量の値を超えないと判定された場合、DIパケット作成部355は、次回の周期に持ち越す持ち越し送信メッセージ長(=ゼロ)を例えばヘッダ部に設定し、今回の周期における新たな送信メッセージを今回の送信メッセージ_kとして組み込んだDIパケット(「ケース4のDIパケット」という)を作成する。
後述するDI送信部358Aにより、当該DIパケット(「ケース4のDIパケット」)を送信することで、制御部30から送信要求のあった新たな送信メッセージは送信完了となる。この場合、後述するように、DI送信部358Aは、送信要求された送信メッセージの送信完了を制御部30(I/Oインタフェース部301)に対して例えばメモリ32を介して、通知する。
<New sent message - Case 4>
If the slave transmission message determination unit 354 determines that there was no message carried over to the next communication with the communication master 15 in the previous cycle, and that there is a new transmission message in the current cycle, and further determines that the length of the new transmission message does not exceed the value of the communication bandwidth margin data amount, the DI packet creation unit 355 sets the carried over transmission message length (= zero) to be carried over to the next cycle, for example, in the header section, and creates a DI packet (referred to as a "DI packet of case 4") that incorporates the new transmission message in the current cycle as the current transmission message_k.
The DI transmitting unit 358A, which will be described later, transmits the DI packet ("DI packet of case 4"), thereby completing the transmission of the new transmission message requested by the control unit 30. In this case, as will be described later, the DI transmitting unit 358A notifies the control unit 30 (I/O interface unit 301) of the completion of the transmission of the transmission message requested by the control unit 30, for example, via the memory 32.

<新たな送信メッセージ_ケース5>
スレーブ送信メッセージ判定部354により、通信マスタ15に対する前回の周期における次回通信に持ち越すメッセージがなく、今回の周期における新たな送信メッセージがあると判定され、さらに当該新たな送信メッセージの長さが通信帯域マージンデータ量の値を超えると判定された場合、DIパケット作成部355は、今回の周期における新たな送信メッセージのうち、通信帯域マージンデータ量に相当する、当該メッセージの一部分を今回の周期で送信する送信メッセージとする。DIパケット作成部355は、今回の周期で送信する送信メッセージを除いた当該メッセージkの残りの部分を次回通信に持ち越すメッセージとして、次回通信に持ち越すメッセージ長とともに例えばバッファメモリ359に記憶するようにしてもよい。
DIパケット作成部355は、次回通信に持ち越すメッセージ長を例えばヘッダ部に設定し、今回の周期において送信する送信メッセージを組み込んだDIパケット(「ケース5のDIパケット」)を作成する。
なお、次回通信に持ち越すメッセージが残ることから、後述するDI送信部358Aにより、当該DIパケットを送信しても、制御部30から送信要求のあった新たな送信メッセージは、送信完了とはならない。
<New sent message - Case 5>
When the slave transmission message determination unit 354 determines that there is no message to be carried over to the next communication in the previous cycle with the communication master 15, but that there is a new transmission message in the current cycle, and further determines that the length of the new transmission message exceeds the value of the communication bandwidth margin data amount, the DI packet creation unit 355 sets a part of the new transmission message in the current cycle, which corresponds to the communication bandwidth margin data amount, as the transmission message to be transmitted in the current cycle. The DI packet creation unit 355 may store the remaining part of the message k, excluding the transmission message to be transmitted in the current cycle, as the message to be carried over to the next communication, together with the message length to be carried over to the next communication, for example, in the buffer memory 359.
The DI packet creating unit 355 sets the message length to be carried over to the next communication, for example, in the header, and creates a DI packet ("DI packet for case 5") incorporating the transmission message to be transmitted in the current cycle.
Since there remains a message to be carried over to the next communication, even if the DI packet is transmitted by a DI transmission unit 358A (described later), the new transmission message requested by the control unit 30 is not considered to have been completely transmitted.

<DI送信部358A>
DI送信部358Aは、周期毎にDIパケット作成部355により作成されたDIパケットを通信マスタ15に対して送信する。DI送信部358Aは、前述したように、ケース2のDIパケット及びケース4のDIパケットを送信完了すると、制御部30から送信要求された送信メッセージの送信完了を制御部30(I/Oインタフェース部301)に対して例えばメモリ32に記録することで、通知する。
<DI transmission unit 358A>
The DI transmission unit 358A periodically transmits the DI packet created by the DI packet creation unit 355 to the communication master 15. As described above, when the DI transmission unit 358A completes transmission of the DI packet of case 2 and the DI packet of case 4, the DI transmission unit 358A notifies the control unit 30 (I/O interface unit 301) of the completion of transmission of the transmission message requested by the control unit 30, for example, by recording it in the memory 32.

<DO受信部358B>
DO受信部358Bは、通信マスタ15から送信されるDOデータ及び送信メッセージをバッファメモリを介して受信する。DOパケットのヘッダを受信すると、DIパケット作成部355は、前述したとおり、DIパケットのヘッダ作成に移行するように構成される。
なお、通信マスタ15から送信される送信メッセージは、前述したように分割されて送信されるケースがある。このため、DO受信部358Bは、通信マスタ15から送信される送信メッセージが分割されて送信される場合は、分割されたメッセージを全て受信すると、当該メッセージを復元して、制御装置1から受信した当該メッセージの送信完了及び復元したメッセージを、制御部30(I/Oインタフェース部301)に対して例えばメモリ32に記録することで、通知することができる。
以上、スレーブとしてのI/Oユニット3について説明した。
<DO receiving unit 358B>
The DO receiving unit 358B receives, via the buffer memory, DO data and a transmission message transmitted from the communication master 15. Upon receiving the header of a DO packet, the DI packet creating unit 355 is configured to transition to creating a header of a DI packet, as described above.
As described above, there are cases where the transmission message transmitted from the communication master 15 is divided before being transmitted. Therefore, when the DO receiving unit 358B receives all the divided messages in the case where the transmission message transmitted from the communication master 15 is divided before being transmitted, the DO receiving unit 358B can restore the message and notify the control unit 30 (I/O interface unit 301) of the completion of transmission of the message received from the control device 1 and the restored message by recording the message in the memory 32, for example.
The I/O unit 3 as a slave has been described above.

次に、図6及び図7のフローチャートを参照して、本実施形態の動作について説明する。図6は、マスタとしての数値制御装置1が、予め設定された一定周期毎に、スレーブとしての全てのI/Oユニット3_k(1≦k≦N)との通信を1回ずつ、サイクリックに通信を行う動作を示すフローチャートの一例である。図7は、スレーブとしてのI/Oユニット3_k(1≦k≦N)の動作を示すフローチャートの一例である。前述の一定周期は、予め設定されているものとする。なお、図6及び図7に示すフローチャートは一例であって、これに限られない。 Next, the operation of this embodiment will be described with reference to the flowcharts of FIG. 6 and FIG. 7. FIG. 6 is an example of a flowchart showing the operation of the numerical control device 1 as a master cyclically communicating with all I/O units 3_k (1≦k≦N) as slaves once at a preset fixed period. FIG. 7 is an example of a flowchart showing the operation of the I/O unit 3_k (1≦k≦N) as a slave. The aforementioned fixed period is assumed to be preset. Note that the flowcharts shown in FIG. 6 and FIG. 7 are merely examples and are not limiting.

図6を参照すると、ステップS10において、マスタとしての数値制御装置1(以下、簡単のため「マスタ1」ともいう)は、スレーブとしてのI/Oユニット3_k(1≦k≦N)(以下、簡単のため「スレーブ3_k」ともいう)との通信開始に先立ち、通信マスタ15は、例えばバッファメモリ部_kに、スレーブ毎通信周期_k(1≦k≦N)、DI/DO基本通信時間_k(1≦k≦N)、通信帯域マージンデータ量_k(1≦k≦N)、次回の周期に持ち越す、持ち越し送信メッセージ_kの長さ(1≦k≦N)(以下「制御パラメータ」という)の初期設定を行う。
ステップS11において、通信マスタ15は、予め設定された一定周期毎に全ての通信スレーブ35_k(1≦k≦N)との通信を1回ずつ、サイクリックに通信を行うことを制御するため、iを初期設定(iに1を設定)する。
6, in step S10, before the numerical control device 1 as the master (hereinafter, for simplicity, also referred to as “master 1”) starts communication with the I/O unit 3_k (1≦k≦N) as the slave (hereinafter, for simplicity, also referred to as “slave 3_k”), the communication master 15 performs initial settings in the buffer memory unit _k, for example, of a per-slave communication cycle _k (1≦k≦N), a DI/DO basic communication time _k (1≦k≦N), a communication bandwidth margin data amount _k (1≦k≦N), and a length of a carried-over transmission message _k to be carried over to the next cycle (1≦k≦N) (hereinafter referred to as “control parameters”).
In step S11, the communication master 15 initializes i (sets i to 1) in order to control cyclic communication with all communication slaves 35_k (1≦k≦N) once at a predetermined fixed period.

ステップS12において、通信マスタ15は、通信スレーブ35_iと一定周期毎の周期開始タイミングを検知する。
ステップS13において、通信マスタ15(DI/DO通信時間計測部152A)は、通信スレーブ35_iとのDI/DO基本通信計測時間_iを計測する。
ステップS14において、通信マスタ15(DOパケット作成部155)は通信スレーブ35_iに対して送信するDOパケット_iを作成する。
ステップS15において、通信マスタ15(DO送信部158A)は、通信スレーブ35_iに対してDOパケット_iを送信するとともに、通信マスタ15(DI受信部158B)は、通信スレーブ35_iから送信されるDIパケット_iを受信する。
ステップ16において、通信マスタ15(DO送信部158A)は、作成したDOパケット_iにDOメッセージが無い場合、ステップS19に移る。
In step S12, the communication master 15 detects the cycle start timing of each fixed cycle with the communication slave 35_i.
In step S13, the communications master 15 (DI/DO communication time measurement unit 152A) measures a DI/DO basic communication measurement time_i with the communications slave 35_i.
In step S14, the communications master 15 (DO packet generating unit 155) generates a DO packet_i to be transmitted to the communications slave 35_i.
In step S15, the communication master 15 (DO transmitting unit 158A) transmits a DO packet_i to the communication slave 35_i, and the communication master 15 (DI receiving unit 158B) receives the DI packet_i transmitted from the communication slave 35_i.
In step S16, if the created DO packet_i does not contain a DO message, the communications master 15 (DO transmitting unit 158A) proceeds to step S19.

ステップS17において、通信マスタ15(DO送信部158A)は、次回に持ち越すメッセージ_iの有無を検出する。次回に持ち越すメッセージ_iの無い場合、ステップS18に移る。次回に持ち越すメッセージ_iのある場合、ステップS19に移る。
ステップS18において、通信マスタ15(DO送信部158A)は、制御部10から送信要求のあった1つのメッセージ_iを送信完了したと判定し、I/Oメモリ12(I/Oメモリ部_i)に、送信メッセージ_iの送信完了を記録する。
ステップ19において、通信マスタ15(DI受信部158B)は、受信したDIパケット_iにDIメッセージが無い場合、ステップS22に移る。
ステップS20において、通信マスタ15(DI受信部158B)は、通信スレーブ35_iから送信されるメッセージがあれば、次回に持ち越すメッセージの有無を検出する。次回に持ち越すメッセージ_iの無い場合、ステップS21に移る。次回に持ち越すメッセージ_iのある場合、ステップS22に移る。
ステップS21において、通信マスタ15(DI受信部158B)は、スレーブ3_iからの1つの送信メッセージ_iを受信完了したと判定し、I/Oメモリ12(I/Oメモリ部_i)に、スレーブ3_iからの送信メッセージ_iを記録する。
ステップS22において、通信マスタ15(DI/DO通信時間算出部152B)は、DI/DO基本通信時間_iを算出し、更新する。また、通信マスタ15(マージンデータ量算出部153)は、通信帯域マージンデータ量_iを算出し、更新する。
In step S17, the communication master 15 (DO transmission unit 158A) detects whether or not there is a message_i to be carried over to the next time. If there is no message_i to be carried over to the next time, the process proceeds to step S18. If there is a message_i to be carried over to the next time, the process proceeds to step S19.
In step S18, the communication master 15 (DO transmitting unit 158A) determines that it has completed transmission of one message_i for which a transmission request was made by the control unit 10, and records the completion of transmission of the transmission message_i in the I/O memory 12 (I/O memory unit_i).
In step S19, if the received DI packet_i does not contain a DI message, the communications master 15 (DI receiving unit 158B) proceeds to step S22.
In step S20, if there is a message transmitted from the communication slave 35_i, the communication master 15 (DI receiving unit 158B) detects whether or not there is a message to be carried over to the next time. If there is no message_i to be carried over to the next time, the process proceeds to step S21. If there is a message_i to be carried over to the next time, the process proceeds to step S22.
In step S21, the communication master 15 (DI receiving unit 158B) determines that reception of one transmission message_i from the slave 3_i has been completed, and records the transmission message_i from the slave 3_i in the I/O memory 12 (I/O memory unit_i).
In step S22, the communication master 15 (DI/DO communication time calculation unit 152B) calculates and updates the DI/DO basic communication time_i. Also, the communication master 15 (margin data amount calculation unit 153) calculates and updates the communication band margin data amount_i.

ステップS23において、通信マスタ15は、全てのスレーブ3_i(通信スレーブ35_i)(1≦i≦N)との通信を1回ずつサイクリックに通信を行ったか否か(i=Nか否か)を判定する。Yesの場合(すなわち、i=Nの場合)、ステップS11に移る。Noの場合(すなわち、i<Nの場合)、ステップS24に移る。
ステップ24において、i=i+1として、ステップS12に移る。
以上、マスタとしての数値制御装置1が、予め設定された一定周期毎に、スレーブとしての全てのI/Oユニット3_i(1≦i≦N)との通信を1回ずつ、サイクリックにDI/DO通信を行うとともに、メッセージを(必要に応じて分割して)送信する処理フローを示した。
In step S23, the communication master 15 judges whether or not it has cyclically communicated with all the slaves 3_i (communication slaves 35_i) (1≦i≦N) once each (whether or not i=N). If the answer is Yes (i.e., if i=N), the process proceeds to step S11. If the answer is No (i.e., if i<N), the process proceeds to step S24.
In step S24, i=i+1 is set, and the process proceeds to step S12.
The above has shown a process flow in which the numerical control device 1 as a master cyclically performs DI/DO communication with all I/O units 3_i (1≦i≦N) as slaves once each at a preset fixed period, and transmits a message (divided as necessary).

次に、図7を参照して、スレーブとしての各I/Oユニット3_k(1≦k≦N)(以下、「スレーブ3_k」ともいう)が、通信マスタ15からDOを受信して、DIを返信する際の動作について説明する。なお、図7において、ステップS33の処理と、ステップS34以降の処理と、は並列に実行することができる。
図7を参照すると、ステップS30において、通信スレーブ35_k(DO受信部358B)は、通信マスタ15からのDO通信を検知する。
ステップS31において、通信スレーブ35_k(DO受信部358B)は、通信マスタ15から送信されるDOパケットを受信する。(前述したように、DO受信部358BがDOパケットのヘッダを受信すると、ステップS32に移行することができる)。
ステップS32において、通信スレーブ35_k(DO受信部358B)は、受信したDOパケット_iにDOメッセージが無い場合、ステップS35に移る。
ステップS33において、通信スレーブ35_k(DO受信部358B)は、次回に持ち越される受信メッセージの有無を検出する。次回に持ち越される受信メッセージの無い場合、ステップS34に移る。次回に持ち越されるメッセージのある場合、ステップS35に移る。
ステップS34において、通信スレーブ35_k(DO受信部358B)は、数値制御装置1からの1つの送信メッセージを受信したと判定し、メモリ32に、通信マスタ15からの1つの送信メッセージを記録する。
ステップS35において、通信スレーブ35_k(DIパケット作成部355)は、DIパケットを作成する。
ステップS36において、通信スレーブ35_k(DI送信部358A)は、DIパケットを通信マスタ15に対して送信する。
ステップS37において、DIパケット_iにDIメッセージが無い場合、ステップS30に移る。
ステップS38において、通信スレーブ35_k(DI送信部358A)は、通信マスタ15へ送信するメッセージにおいて、次回に持ち越すメッセージの有無を検出する。次回に持ち越すメッセージの無い場合、ステップS39に移る。次回に持ち越すメッセージのある場合、ステップS30に移る。
ステップS39において、通信スレーブ35_k(DI送信部358A)は、スレーブ3_iからの1つの送信メッセージを送信完了したと判定し、メモリ32に、当該送信メッセージの送信完了を記録する。その後、ステップS30に移る。
以上、スレーブとしてのI/Oユニット3_k(1≦k≦N)が、予め設定された一定周期毎に、マスタとしての数値制御装置1との通信を1回ずつ、サイクリックにDI/DO通信を行うとともに、メッセージを(必要に応じて分割して)送信する処理フローを示した。
Next, with reference to Fig. 7, an operation of each I/O unit 3_k (1 <= k <= N) (hereinafter also referred to as "slave 3_k") as a slave when it receives a DO from the communication master 15 and returns a DI will be described. In Fig. 7, the process of step S33 and the process of step S34 and thereafter can be executed in parallel.
7, in step S30, the communication slave 35_k (DO receiving unit 358B) detects the DO communication from the communication master 15.
In step S31, the communications slave 35_k (DO receiving unit 358B) receives a DO packet transmitted from the communications master 15. (As described above, when the DO receiving unit 358B receives the header of the DO packet, the process can proceed to step S32).
In step S32, if the communication slave 35_k (DO receiving unit 358B) receives a DO packet_i containing no DO message, the communication slave 35_k (DO receiving unit 358B) proceeds to step S35.
In step S33, the communications slave 35_k (DO receiving unit 358B) detects whether or not there is a received message to be carried over to the next time. If there is no received message to be carried over to the next time, the process proceeds to step S34. If there is a message to be carried over to the next time, the process proceeds to step S35.
In step S<b>34 , the communication slave 35_k (DO receiving unit 358</b>B) determines that one transmission message has been received from the numerical control device 1 , and records the one transmission message from the communication master 15 in the memory 32 .
In step S35, the communication slave 35_k (DI packet creating unit 355) creates a DI packet.
In step S36, the communication slave 35_k (DI transmission unit 358A) transmits a DI packet to the communication master 15.
In step S37, if there is no DI message in the DI packet_i, the process proceeds to step S30.
In step S38, the communications slave 35_k (DI transmission unit 358A) detects whether or not there is a message to be carried over to the next time in the message to be transmitted to the communications master 15. If there is no message to be carried over to the next time, the process proceeds to step S39. If there is a message to be carried over to the next time, the process proceeds to step S30.
In step S39, the communications slave 35_k (DI transmission unit 358A) determines that one transmission message from the slave 3_i has been transmitted, and records the transmission completion of the transmission message in the memory 32. Then, the process proceeds to step S30.
The above has shown a process flow in which the I/O unit 3_k (1≦k≦N) as a slave cyclically performs DI/DO communication with the numerical control device 1 as a master once at a preset regular period, and transmits a message (divided as necessary).

以上のようにして、マスタ1は複数のスレーブ3_k(1≦k≦N)と、同時にメッセージ通信を行う場合であっても、スレーブ3_k(1≦k≦N)毎の通信帯域マージンデータ量_kを自動的に調整して、予め設定された一定周期以内に、全てのスレーブ3_kとの間で、少なくともDI信号及びDO信号のやり取り(DI/DO通信)を完了することができる。以上で第1実施形態について説明した。 In this way, even when the master 1 simultaneously communicates messages with multiple slaves 3_k (1≦k≦N), it can automatically adjust the communication bandwidth margin data amount_k for each slave 3_k (1≦k≦N) and complete the exchange of at least DI and DO signals (DI/DO communication) with all slaves 3_k within a preset fixed period. This concludes the description of the first embodiment.

第1実施形態においては、通信マスタ15は、DOを送信する周期毎に各通信スレーブ35_k(1≦k≦N)に対して、ヘッダ部に通信帯域マージンデータ量_kを組み込むことで、各通信スレーブ35_k(1≦k≦N)が送信できるメッセージ_kの長さの最大値を伝えるようにした。
他方、各通信スレーブ35_k(1≦k≦N)は、今回の周期で送信するメッセージ_kの長さが通信帯域マージンデータ量_kを超える場合、通信帯域マージンデータ量_kに相当する、メッセージの一部分を今回の周期で送信する送信メッセージ_kとし、今回の周期で送信する送信メッセージ_kを除いた送信メッセージの残りの部分を次回通信に持ち越すメッセージ_kとすることで、複数回の通信に分けてメッセージ通信を行うように構成した。
これにより、通常のサイクリック通信時に、数値制御装置1(マスタ)と複数のI/Oユニット3_k(1≦k≦N)(スレーブ)との間で、メッセージ通信を行う場合であっても、予め設定された一定周期以内に、全てのI/Oユニット3_k(1≦k≦N)(スレーブ)との間で、少なくともDI信号及びDO信号のやり取り(DI/DO通信)を完了できるようにして、I/O信号の更新周期を担保することを可能とした。
In the first embodiment, the communication master 15 incorporates a communication bandwidth margin data amount _k into the header section of each communication slave 35_k (1≦k≦N) at each period for transmitting DO, thereby notifying each communication slave 35_k (1≦k≦N) of the maximum length of message _k that each communication slave 35_k (1≦k≦N) can transmit.
On the other hand, when the length of a message_k to be transmitted in the current cycle exceeds the communication bandwidth margin data amount_k, each communication slave 35_k (1≦k≦N) sets a part of the message equivalent to the communication bandwidth margin data amount_k as a transmission message_k to be transmitted in the current cycle, and sets the remaining part of the transmission message excluding the transmission message_k to be transmitted in the current cycle as a message_k to be carried over to the next communication, thereby performing message communication in multiple communications.
As a result, even when message communication is performed between the numerical control device 1 (master) and multiple I/O units 3_k (1≦k≦N) (slaves) during normal cyclic communication, it is possible to complete the exchange of at least DI and DO signals (DI/DO communication) between all I/O units 3_k (1≦k≦N) (slaves) within a predetermined fixed period, thereby ensuring the update period of the I/O signals.

しかしながら、スレーブとなるI/Oユニット3には様々な種類があり、メッセージ通信の量・頻度も多様となる。従って、第1実施形態のように、スレーブ毎通信周期_k(1≦k≦N)を初期設定のままの固定値とすると、あるI/Oユニット3(スレーブ)において「複数回に分けてメッセージ通信を行う」場合が多発する可能性がある。そうすると、あるI/Oユニット3(スレーブ)において、メッセージ送信要求からの遅延が大きくなる可能性がある。
したがって、各I/Oユニット3_k(1≦k≦N)において、特定のI/Oユニット3(スレーブ)において「複数回に分けてメッセージ通信を行う」場合が多発することを防ぐことが望まれる。
However, there are various types of I/O units 3 that become slaves, and the amount and frequency of message communication are also diverse. Therefore, if the slave communication cycle_k (1≦k≦N) is left as a fixed value as the initial setting as in the first embodiment, there is a possibility that a certain I/O unit 3 (slave) will frequently perform message communication in multiple separate sessions. This may result in a large delay from a message transmission request in a certain I/O unit 3 (slave).
Therefore, in each I/O unit 3_k (1≦k≦N), it is desirable to prevent frequent occurrence of cases in which "message communication is performed in multiple parts" in a specific I/O unit 3 (slave).

(第2実施形態)
第2実施形態では、通信スレーブ35_k(1≦k≦N)毎に、メッセージ通信が複数回に分割された回数をカウントして、当該カウント値に基づいて、各スレーブ毎通信周期_k(1≦k≦N)を動的に変更することで、特定のI/Oユニット3(スレーブ)において「複数回に分けてメッセージ通信を行う」場合が多発することを防ぐ。
このため、第2実施形態において、通信マスタ15は、第1実施形態の機能部に加えて、スレーブ毎分割回数カウント部156、及びスレーブ毎通信周期最適化部157を備える。図8は、マスタとしての数値制御装置1の機能ブロックを示す概略図である。上述したように、スレーブ毎分割回数カウント部156及びスレーブ毎通信周期最適化部157以外の機能部は、図4に記載の第1実施形態における数値制御装置1の機能部と同じであり、説明は省略する。
Second Embodiment
In the second embodiment, the number of times that message communication is divided into multiple times is counted for each communication slave 35_k (1≦k≦N), and the communication cycle_k (1≦k≦N) for each slave is dynamically changed based on the count value, thereby preventing frequent cases in which "message communication is divided into multiple times" from occurring in a specific I/O unit 3 (slave).
For this reason, in the second embodiment, the communication master 15 includes, in addition to the functional units of the first embodiment, a per-slave division count unit 156 and a per-slave communication cycle optimization unit 157. Fig. 8 is a schematic diagram showing functional blocks of the numerical control device 1 as a master. As described above, the functional units other than the per-slave division count unit 156 and the per-slave communication cycle optimization unit 157 are the same as the functional units of the numerical control device 1 in the first embodiment described in Fig. 4, and therefore description thereof will be omitted.

[通信マスタ15]
図8に示すように、通信マスタ15は、スレーブ毎通信周期割当部151と、DI/DO通信時間計測部152Aと、DI/DO通信時間算出部152Bと、マージンデータ量算出部153と、マスタ送信メッセージ判定部154と、DOパケット作成部155と、スレーブ毎分割回数カウント部156と、スレーブ毎通信周期最適化部157(これは、第2実施形態)と、DO送信部158Aと、DI受信部158Bと、バッファメモリ159と、を有する。
[Communication Master 15]
As shown in FIG. 8, the communication master 15 has a per-slave communication cycle allocation unit 151, a DI/DO communication time measurement unit 152A, a DI/DO communication time calculation unit 152B, a margin data amount calculation unit 153, a master transmission message determination unit 154, a DO packet creation unit 155, a per-slave division number counting unit 156, a per-slave communication cycle optimization unit 157 (this is the second embodiment), a DO transmission unit 158A, a DI reception unit 158B, and a buffer memory 159.

<スレーブ毎分割回数カウント部156>
スレーブ毎分割回数カウント部156は、通信マスタ15から各通信スレーブ35_k(1≦k≦N)に送信される1つの送信メッセージ_kが複数回に分割されて送信される回数と、当該通信スレーブ35_k(1≦k≦N)から通信マスタ15に対して送信される、送信メッセージ_kに対する1つの返信メッセージ_kが複数回に分割されて送信される回数と、の合計値(「スレーブ毎分割回数_k」という)を通信周期毎にカウントし、更新する。
具体的には、スレーブ毎分割回数カウント部156は、通信マスタ15と通信スレーブ35_k(1≦k≦N)との間で、例えば、DI/DO通信を開始するときに、スレーブ毎分割回数_kをゼロに初期設定する。その後、今回の周期において、通信マスタ15側で次回通信に持ち越すメッセージが発生した場合、スレーブ毎分割回数_kに1を加算し、通信スレーブ35_k側で次回通信に持ち越すメッセージが発生した場合、スレーブ毎分割回数_kに1を加算する。
<Slave division count unit 156>
The per-slave division counting unit 156 counts and updates the total number of times that one transmission message _k is divided and transmitted multiple times from the communication master 15 to each communication slave 35_k (1≦k≦N) and the number of times that one reply message _k in response to the transmission message _k is divided and transmitted multiple times from the communication slave 35_k (1≦k≦N) to the communication master 15 (referred to as the "per-slave division number _k") for each communication period.
Specifically, the per-slave division counting unit 156 initializes the per-slave division count_k to zero when, for example, DI/DO communication is started between the communication master 15 and the communication slave 35_k (1≦k≦N). After that, if a message to be carried over to the next communication occurs on the communication master 15 side in the current cycle, 1 is added to the per-slave division count_k, and if a message to be carried over to the next communication occurs on the communication slave 35_k side, 1 is added to the per-slave division count_k.

<スレーブ毎通信周期最適化部157>
スレーブ毎通信周期最適化部157は、スレーブ毎分割回数カウント部156によりカウントされた各通信スレーブ35_k(1≦k≦N)におけるスレーブ毎分割回数_k(1≦k≦N)のうち、少なくとも1つの通信スレーブ35_iにおけるスレーブ毎分割回数_iが予め設定された閾値以上又は閾値を超えた場合、当該通信スレーブ35_iに割り当てられているスレーブ毎通信周期_iに予め設定される調整量を加算する。また、スレーブ毎通信周期最適化部157は、その際、通信スレーブ35_k(1≦k≦N)に割り当てられているスレーブ毎通信周期_kから前記調整量を減算した場合であっても、DI/DO基本通信時間_kを超える通信スレーブ35_k(1≦k≦N)の集合(すなわち、通信帯域マージンデータ量_kの値がプラス値となる通信スレーブ35(1≦k≦N)の集合)から、スレーブ毎分割回数_k(1≦k≦N)の値が最も小さい値となる1つの通信スレーブ35_jを選択して、当該通信スレーブ35_jに割り当てたスレーブ毎通信周期_jから前記調整量を減算する。
調整量は、全ての通信スレーブ35_k(1≦k≦N)において、
DI/DO基本通信時間_k > (スレーブ毎通信周期_k - 調整量)
となるように設定することが好ましい。そうすることで、スレーブ毎分割回数_k(1≦k≦N)の値が最も小さい値となる1つの通信スレーブ35_jを選択して、当該通信スレーブ35_jに割り当てたスレーブ毎通信周期_jから前記調整量を減算するようにしてもよい。
図9は、スレーブ毎分割回数_kに基づいて、スレーブ毎通信周期を最適化する様子を示す一例を示す図である。図9に示すように、N番目の通信スレーブにおいて、スレーブ毎分割回数が閾値(例えば、100)以上となった場合に、N番目の通信スレーブのスレーブ毎通信周期にXmsを加算し、スレーブ毎分割回数が最小値である、1番目の通信スレーブのスレーブ毎通信周期からXmsを減算するように構成される。
なお、スレーブ毎通信周期最適化部157は、上記最適化処理を行う際に、スレーブ毎通信周期_iに予め設定される調整量を加算したI/Oユニット3_iにおけるスレーブ毎分割回数_iを初期化するようにしてもよい。
第2実施形態の構成によると、第1実施形態と同様に、予め設定された一定周期以内に、行われる全てのDI/DO通信の周期を担保した上で、メッセージ通信を要求からの遅延が小さくなるようにすることができる。
以上、第2実施形態における通信マスタ15の機能部の構成について説明した。次に、第2実施形態の動作について説明する。
<Slave-by-Slave Communication Period Optimization Unit 157>
When the per-slave division number _i for at least one communication slave 35_i among the per-slave division number _k (1≦k≦N) for each communication slave 35_k (1≦k≦N) counted by the per-slave division number counting unit 156 is equal to or exceeds a preset threshold, the per-slave communication cycle optimization unit 157 adds a preset adjustment amount to the per-slave communication cycle _i assigned to the communication slave 35_i. Furthermore, at that time, even if the per-slave communication cycle optimization unit 157 subtracts the adjustment amount from the per-slave communication cycle_k assigned to the communication slave 35_k (1≦k≦N), it selects one communication slave 35_j having the smallest per-slave division count_k (1≦k≦N) from the set of communication slaves 35_k (1≦k≦N) that exceed the DI/DO basic communication time_k (i.e., the set of communication slaves 35 (1≦k≦N) whose communication bandwidth margin data amount_k has a positive value), and subtracts the adjustment amount from the per-slave communication cycle_j assigned to that communication slave 35_j.
The adjustment amount is, for all communication slaves 35 k (1≦k≦N),
DI/DO basic communication time_k > (per slave communication cycle_k - adjustment amount)
By doing so, one communication slave 35_j having the smallest value of per-slave division count_k (1≦k≦N) may be selected, and the adjustment amount may be subtracted from per-slave communication period_j assigned to the communication slave 35_j.
9 is a diagram showing an example of optimizing the per-slave communication period based on the per-slave division number_k. As shown in Fig. 9, when the per-slave division number in the Nth communication slave becomes equal to or greater than a threshold value (e.g., 100), X ms is added to the per-slave communication period of the Nth communication slave, and X ms is subtracted from the per-slave communication period of the first communication slave, which has the smallest per-slave division number.
In addition, when performing the above-mentioned optimization process, the slave-specific communication cycle optimization unit 157 may initialize the slave-specific division number_i in the I/O unit 3_i by adding a preset adjustment amount to the slave-specific communication cycle_i.
According to the configuration of the second embodiment, similarly to the first embodiment, it is possible to ensure that the periods of all DI/DO communications are performed within a preset fixed period, while minimizing delays in message communications from requests.
The configuration of the functional parts of the communication master 15 in the second embodiment has been described above. Next, the operation of the second embodiment will be described.

図10A及び図10Bは、第2実施形態におけるマスタとしての数値制御装置1の動作を示すフローチャートの一例である。なお、図10Aに記載のフローチャートは、図5に記載の第1実施形態における数値制御装置1の動作を示すフローチャートのステップ番号と同じステップ番号のステップにおける処理は、第1実施形態の対応するステップ番号と同じ動作をする。
第2実施形態において追加された機能に係る動作については、ステップ番号にAを付与したステップにおいて処理を追加している。以下の説明では、機能追加されたステップについてのみ説明し、図5に記載のフローチャートにおけるステップ番号と同じステップについては、説明を省略する。
なお、スレーブとしてのI/Oユニット3の動作については、第1実施形態の場合(図7参照)と同じであり、説明は省略する。
10A and 10B are examples of a flowchart showing the operation of the numerical control device 1 as a master in the second embodiment. In the flowchart shown in Fig. 10A, the processing in the steps having the same step numbers as those in the flowchart showing the operation of the numerical control device 1 in the first embodiment shown in Fig. 5 performs the same operation as the corresponding step numbers in the first embodiment.
In the second embodiment, the operation related to the added function is added in the step numbered with A. In the following explanation, only the steps where the function has been added will be explained, and the explanation of the steps with the same step numbers as those in the flowchart shown in FIG.
The operation of the I/O unit 3 as a slave is the same as that in the first embodiment (see FIG. 7), and a description thereof will be omitted.

図10Aを参照すると、ステップS10Aにおいては、通信マスタ15は、ステップ10における初期設定に加えて、スレーブ毎分割回数_k(1≦k≦N)の初期設定(ゼロ設定)を行う。 Referring to FIG. 10A, in step S10A, the communication master 15 performs the initial setting (setting to zero) of the division count per slave_k (1≦k≦N) in addition to the initial setting in step 10.

また、ステップS11Aにおいては、スレーブ毎通信周期_iを更新する機能を追加している。このため、ステップ11AはステップS11_1からステップS11_4を含む。図10BにステップS11Aに係るフローチャートを示す。
図10Bを参照すると、先ず、ステップS11_1において、マスタ1(スレーブ毎通信周期最適化部157)は、スレーブ毎分割回数_k(1≦k≦N)のうち、その値が最大となるk1、及び最小となるk2を選択する。
ステップS11_2において、マスタ1(スレーブ毎通信周期最適化部157)スレーブ毎分割回数_k1が、予め設定された閾値以上か否かを判定する。閾値以上の場合(Yesの場合)、ステップS11_3に移る。閾値未満の場合(Noの場合)、ステップS11_4に移る。
ステップS11_3において、マスタ1(スレーブ毎通信周期最適化部157)は、スレーブ毎通信周期_k1に予め設定される調整量を加算するとともに、スレーブ毎通信周期_k2から調整量を減算する。なお、スレーブ毎通信周期_k1を初期化するようにしてもよい。その後、ステップS12に移る。
ステップS11_4は、第1実施形態における数値制御装置1の動作を示すフローチャートのステップS11と同じ処理を行う。すなわち、ステップS11_4において、iを初期設定(iに1を設定)する。その後、ステップS12に移る。
In addition, in step S11A, a function of updating the slave-specific communication cycle_i is added. Therefore, step S11A includes steps S11_1 to S11_4. Fig. 10B shows a flowchart relating to step S11A.
10B, first, in step S11_1, master 1 (slave-based communication cycle optimization unit 157) selects k1 having the maximum value and k2 having the minimum value from among the slave-based division count_k (1≦k≦N).
In step S11_2, the master 1 (slave-by-slave communication cycle optimization unit 157) determines whether the slave-by-slave division count_k1 is equal to or greater than a preset threshold. If it is equal to or greater than the threshold (Yes), the process proceeds to step S11_3. If it is less than the threshold (No), the process proceeds to step S11_4.
In step S11_3, the master 1 (per-slave communication cycle optimization unit 157) adds a preset adjustment amount to the per-slave communication cycle_k1 and subtracts the adjustment amount from the per-slave communication cycle_k2. Note that the per-slave communication cycle_k1 may be initialized. Then, the process proceeds to step S12.
Step S11_4 performs the same process as step S11 in the flowchart showing the operation of the numerical control device 1 in the first embodiment. That is, in step S11_4, i is initialized (i is set to 1). Then, the process proceeds to step S12.

また、ステップS22Aにおいては、通信マスタ15は、ステップS22における処理に加えて、通信マスタ(スレーブ毎分割回数カウント部156)は、今回の周期における、通信マスタ15と通信スレーブ35_i間のスレーブ毎分割回数_iを更新する。
以上、マスタとしての数値制御装置1が、予め設定された一定周期毎に、スレーブとしての全てのI/Oユニット3_i(1≦i≦N)との通信を1回ずつ、サイクリックに通信を行う場合に、スレーブ毎分割回数_iが閾値以上となった場合に、スレーブ毎通信周期_iを更新する処理フローを示した。
第2実施形態により、数値制御装置1は、各I/Oユニット3_k(1≦k≦N)において、特定のI/Oユニット3(スレーブ)において「複数回に分けてメッセージ通信を行う」場合が多発することを防ぐことができる。すなわち、数値制御装置1は、一定周期で行われるDI/DO通信の周期を担保したうえで。メッセージ通信を要求からの遅延が小さくなるように、制御することができる。
以上、第2実施形態について説明した。
Furthermore, in step S22A, in addition to the process in step S22, the communications master 15 (slave-based division number counting unit 156) updates the slave-based division number_i between the communications master 15 and the communications slave 35_i in the current cycle.
The above has shown a process flow for updating the per-slave communication period _i when the per-slave division count _i becomes equal to or greater than a threshold value when the numerical control device 1 as the master cyclically communicates with all I/O units 3_i (1≦i≦N) as slaves once each at a preset constant period.
According to the second embodiment, the numerical control device 1 can prevent frequent occurrence of "message communication divided into multiple times" in a specific I/O unit 3 (slave) in each I/O unit 3_k (1≦k≦N). In other words, the numerical control device 1 can control message communication so that the delay from a request is small while ensuring the period of DI/DO communication that is performed at a constant period.
The second embodiment has been described above.

本発明において、数値制御装置1の各種機能部は、例えばROM11等に格納された所定のソフトウェアとハードウェアとの協働で実現されてもよいし、ハードウェア(電子回路、LSI等)のみで実現されてもよい。I/Oユニット3の各種機能部についても同様である。
また、本発明で使用する動作プログラムを初めとするプログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えば、フレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば、光磁気ディスク)、CD-ROM(Read Only Memory)、CD-R、CD-R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(random access memory)を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。
In the present invention, the various functional parts of the numerical control device 1 may be realized by cooperation between hardware and predetermined software stored in, for example, the ROM 11, or may be realized only by hardware (electronic circuits, LSIs, etc.). The same applies to the various functional parts of the I/O unit 3.
In addition, the programs, including the operating programs, used in the present invention can be stored in various types of non-transitory computer readable media and supplied to a computer. The non-transitory computer readable media includes various types of tangible recording media. Examples of non-transitory computer-readable media include magnetic recording media (e.g., flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R/Ws, semiconductor memories (e.g., mask ROMs, PROMs (Programmable ROMs), EPROMs (Erasable PROMs), flash ROMs, and RAMs (random access memories). The program may also be provided to the computer by various types of transient computer-readable media. Examples of transient computer-readable media include electrical signals, optical signals, and electromagnetic waves. The transient computer-readable medium can provide the program to the computer via a wired communication path such as an electric wire or optical fiber, or via a wireless communication path.

上述した実施形態は、本発明の好適な実施形態の1つではあるが、上記実施形態のみに本発明の範囲を限定するものではなく、本発明の要旨を逸脱しない範囲において種々の変更を施した形態での実施が可能である。 The above-described embodiment is one of the preferred embodiments of the present invention, but the scope of the present invention is not limited to the above-described embodiment, and the present invention can be implemented in various modified forms without departing from the spirit of the present invention.

<変形例1>
上述した実施形態では、制御装置として数値制御装置1を例として説明したが、これに限られない。前述したように、ロボットコントローラ等、産業用機械の制御装置における高速シリアル通信にも適用してもよい。
<Modification 1>
In the above embodiment, the numerical control device 1 has been described as an example of a control device, but the present invention is not limited to this. As described above, the present invention may also be applied to high-speed serial communication in a control device for industrial machinery, such as a robot controller.

以上を換言すると、本開示の通信制御システム、及び通信制御方法は、次のような構成を有する各種各様の実施形態を取ることができる。 In other words, the communication control system and communication control method disclosed herein can take on a variety of different embodiments having the following configurations:

(1)本開示の通信制御システム1000は、通信マスタ15を備える制御装置1と、制御装置1にデイジーチェーンにより通信可能に接続された通信スレーブ35をそれぞれ備える複数のI/Oユニットとの間で、予め設定された一定周期毎に、制御装置1が全てのI/OユニットとI/O信号を送受信する通信制御システム1000であって、
通信マスタ15は、
各通信スレーブ35にそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブ35とのI/O信号送受信の周期ごとに、送信メッセージを除くDIデータ及びDOデータのみの通信に要した通信時間を計測し、各通信スレーブ35の通信帯域マージンデータ量を算出するマージンデータ量算出部153と、
通信スレーブ35に対して、DOデータを送信するときに、通信帯域マージンデータ量を組み込んだDOパケットを作成し、通信スレーブ35に対する送信メッセージ量が通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、通信帯域マージンデータ量を超えない、送信メッセージの分割した部分メッセージをDOパケットに組み込むDOパケット作成部155と、
DOパケットを通信スレーブ35に送信するDO送信部158Aと、を備え、
通信スレーブ35は、
通信マスタ15から送信されるDOパケットを受信するDO受信部358Bと、
受信したDOパケットに含まれる通信帯域マージンデータ量を取得し、通信マスタ15に対して、DIデータを送信するときに、DIパケットを作成し、通信マスタ15に対する送信メッセージ量が通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、通信帯域マージンデータ量を超えない、送信メッセージの分割した部分メッセージをDIパケットに組み込むDIパケット作成部355と、
DIパケットを通信マスタ15に送信するDI送信部358Aと、を備える。
これにより、通常のサイクリック通信時に、数値制御装置1(マスタ)と複数のI/Oユニット(スレーブ)との間で、メッセージ通信を行う場合であっても、予め設定された一定周期以内に、全てのI/Oユニット(スレーブ)との間で、少なくともDI信号及びDO信号のやり取り(DI/DO通信)を完了できるようにして、I/O信号の更新周期を担保することができる。
(1) A communication control system 1000 according to the present disclosure is a communication control system in which a control device 1 including a communication master 15 and a plurality of I/O units each including a communication slave 35 communicatively connected to the control device 1 by a daisy chain are arranged so that the control device 1 transmits and receives I/O signals to and from all of the I/O units at a constant period set in advance,
The communication master 15 is
A slave communication period is assigned to each communication slave 35 in advance.
a margin data amount calculation unit 153 that measures a communication time required for communication of only DI data and DO data excluding transmission messages for each period of I/O signal transmission and reception with each communication slave 35 and calculates a communication band margin data amount of each communication slave 35;
a DO packet creation unit 155 that creates a DO packet incorporating a communication bandwidth margin data amount when transmitting DO data to a communication slave 35, and when a message amount to be transmitted to the communication slave 35 exceeds the communication bandwidth margin data amount, divides the transmitted message into a plurality of communications, and incorporates a divided partial message of the transmitted message, which does not exceed the communication bandwidth margin data amount, into the DO packet for each communication period;
a DO transmission unit 158A that transmits a DO packet to the communication slave 35;
The communication slave 35 is
a DO receiving unit 358B that receives a DO packet transmitted from the communication master 15;
a DI packet creation unit 355 that acquires a communication bandwidth margin data amount included in a received DO packet, creates a DI packet when transmitting DI data to the communication master 15, and, if a message amount to be transmitted to the communication master 15 exceeds the communication bandwidth margin data amount, divides the transmission message into a plurality of communications, and incorporates a partial message obtained by dividing the transmission message and not exceeding the communication bandwidth margin data amount into a DI packet for each communication period;
and a DI transmission unit 358A that transmits a DI packet to the communication master 15.
As a result, even when message communication is performed between the numerical control device 1 (master) and multiple I/O units (slaves) during normal cyclic communication, the exchange of at least DI and DO signals (DI/DO communication) can be completed between all I/O units (slaves) within a predetermined fixed period, thereby ensuring the update period of the I/O signals.

(2) (1)に記載の通信制御システム1000において、通信マスタ15は、さらに、
各通信スレーブ35との間で送受信される1つの送信メッセージが複数回に分割されて送信された回数である送信メッセージ分割回数をカウントするスレーブ毎分割回数カウント部156と、
少なくとも1つの通信スレーブ35における、前記送信メッセージ分割回数が予め設定された閾値以上又は閾値を超えた場合、前記通信スレーブ35に割り当てたスレーブ毎通信周期に予め設定される調整量を加算するとともに、前記送信メッセージ分割回数が最も少ない1つの通信スレーブ35に割り当てたスレーブ毎通信周期から前記調整量を減算し、前記調整量の加算された通信スレーブ35における前記送信メッセージ分割回数を初期化するスレーブ毎通信周期最適化部157と、
を備えるようにしてもよい。
これにより、制御装置1は、一定周期で行われるDI/DO通信の周期を担保したうえで。メッセージ通信を要求からの遅延が小さくなるように、制御することができる。
(2) In the communication control system 1000 according to (1), the communication master 15 further comprises:
a slave division counting unit 156 for counting a transmission message division number, which is the number of times that one transmission message transmitted and received between each communication slave 35 is divided and transmitted multiple times;
a per-slave communication cycle optimization unit 157 which, when the number of divisions of the transmission message in at least one communication slave 35 is equal to or exceeds a preset threshold value, adds a preset adjustment amount to the per-slave communication cycle assigned to the communication slave 35, subtracts the adjustment amount from the per-slave communication cycle assigned to the communication slave 35 having the smallest number of divisions of the transmission message, and initializes the number of divisions of the transmission message in the communication slave 35 to which the adjustment amount has been added;
The above configuration may be adopted.
This allows the control device 1 to control message communication so as to reduce delays from requests while ensuring the period of DI/DO communication, which is performed at a constant cycle.

(3) (1)又は(2)に記載の通信制御システム1000において、マージンデータ量算出部153は、各通信スレーブ35に割り当てたスレーブ毎通信周期と、各通信スレーブ35とのI/O信号送受信の周期ごとに前記DIデータ及びDOデータのみの通信に要した通信時間に基づいて算出される今回の計測時間及び過去の計測時間における最大値と、に基づいて、前記通信帯域マージンデータ量を算出するようにしてもよい。
これにより、通信帯域マージンデータ量をより安全な値とすることができる。
(3) In the communication control system 1000 described in (1) or (2), the margin data amount calculation unit 153 may calculate the communication bandwidth margin data amount based on the slave communication period assigned to each communication slave 35 and the current measurement time and the maximum value of the past measurement time calculated based on the communication time required for communicating only the DI data and DO data for each period of sending and receiving an I/O signal with each communication slave 35.
This allows the communication band margin data volume to be set to a safer value.

(4) (1)から(3)のいずれかに記載の通信制御システム1000において、スレーブ毎通信周期は、前記予め設定された一定周期を前記I/Oユニットの個数により等分した値とするようにしてもよい。
これにより、各通信スレーブ35に対して、スレーブ毎通信周期を特定のスレーブに偏らずに割り当てることができる。
(4) In the communication control system 1000 described in any one of (1) to (3), the slave communication period may be a value obtained by equally dividing the predetermined fixed period by the number of the I/O units.
This allows the slave-specific communication cycle to be assigned to each communication slave 35 without bias toward a specific slave.

(5) (1)から(3)のいずれかに記載の通信制御システム1000において、スレーブ毎通信周期は、前記I/Oユニットの接続順序に基づいて、傾斜的に各I/Oユニットに算出する値とするようにしてもよい。
これにより、ケーブル長の長いI/Oユニットに対しては、ケーブル長に起因する通信の遅れを吸収することができる。
(5) In the communication control system 1000 described in any one of (1) to (3), the slave communication period may be a value that is calculated incrementally for each I/O unit based on the connection order of the I/O units.
This makes it possible to absorb communication delays caused by the cable length for I/O units with long cables.

(6) (1)から(3)のいずれかに記載の通信制御システム1000において、スレーブ毎通信周期は、前記I/OユニットのDI/DO点数に基づいて、算出する値とするようにしてもよい。
これにより、DI/DO点数の多いI/Oユニットに対しては、DI/DO点数に起因する通信の遅れを吸収することができる。
(6) In the communication control system 1000 according to any one of (1) to (3), the slave-specific communication period may be a value calculated based on the number of DI/DO points of the I/O unit.
This makes it possible to absorb communication delays caused by the number of DI/DO points for I/O units with a large number of DI/DO points.

(7) 本開示の通信制御方法は、
通信マスタ15を備える制御装置1と、制御装置1にデイジーチェーンにより通信可能に接続された通信スレーブ35をそれぞれ備える複数のI/Oユニットとの間で、予め設定された一定周期毎に、制御装置1が全てのI/OユニットとI/O信号を送受信する通信制御方法であって、
通信マスタ15は、
各通信スレーブ35にそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブ35とのI/O信号送受信の周期ごとに、送信メッセージを除くDIデータ及びDOデータのみの通信に要した通信時間を計測し、各通信スレーブ35の通信帯域マージンデータ量を算出するマージンデータ量算出ステップと、
通信スレーブ35に対して、DOデータを送信するときに、通信帯域マージンデータ量を組み込んだDOパケットを作成し、通信スレーブ35に対する送信メッセージ量が通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、通信帯域マージンデータ量を超えない、送信メッセージの分割した部分メッセージを前記DOパケットに組み込むDOパケット作成ステップと、
DOパケットを通信スレーブ35に送信するDO送信ステップと、を備え、
通信スレーブ35は、
通信マスタ15から送信されるDOパケットを受信するDO受信ステップと、
受信したDOパケットに含まれる通信帯域マージンデータ量を取得し、通信マスタ15に対して、DIデータを送信するときに、DIパケットを作成し、通信マスタ15に対する送信メッセージ量が通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、通信帯域マージンデータ量を超えない、送信メッセージの分割された部分メッセージをDIパケットに組み込むDIパケット作成ステップと、
DIパケットを通信マスタ15に送信するDI送信ステップと、を備える。
これにより、(1)と同様の効果を奏することができる。
(7) The communication control method according to the present disclosure includes:
A communication control method in which a control device 1 having a communication master 15 and a plurality of I/O units each having a communication slave 35 communicably connected to the control device 1 by a daisy chain are used, and the control device 1 transmits and receives I/O signals to and from all of the I/O units at a preset fixed period,
The communication master 15 is
A slave communication period is assigned to each communication slave 35 in advance.
a margin data amount calculation step of measuring a communication time required for communication of only DI data and DO data excluding a transmission message for each period of I/O signal transmission and reception with each communication slave 35, and calculating a communication band margin data amount of each communication slave 35;
a DO packet creation step of creating a DO packet incorporating a communication bandwidth margin data amount when transmitting DO data to the communication slave 35, and if the amount of a message to be transmitted to the communication slave 35 exceeds the communication bandwidth margin data amount, dividing the message into a plurality of communications and incorporating a partial message of the transmitted message, which does not exceed the communication bandwidth margin data amount, into the DO packet for each communication period;
a DO transmission step of transmitting the DO packet to the communication slave 35;
The communication slave 35 is
a DO receiving step of receiving a DO packet transmitted from the communication master 15;
a DI packet creation step of acquiring a communication bandwidth margin data amount included in the received DO packet, creating a DI packet when transmitting DI data to the communication master 15, and, if the amount of a message to be transmitted to the communication master 15 exceeds the communication bandwidth margin data amount, dividing the message into a plurality of communications and incorporating a divided partial message of the transmitted message, which does not exceed the communication bandwidth margin data amount, into a DI packet for each communication period;
and a DI transmission step of transmitting the DI packet to the communication master 15.
This makes it possible to achieve the same effect as (1).

(8) (7)に記載の通信制御方法において、
前記通信マスタは、さらに、
各通信スレーブとの間で送受信される1つの送信メッセージが複数回に分割されて送信された回数である送信メッセージ分割回数をカウントするスレーブ毎分割回数カウントステップと、
少なくとも1つの通信スレーブにおける、前記送信メッセージ分割回数が予め設定された閾値以上又は閾値を超えた場合、前記通信スレーブに割り当てたスレーブ毎通信周期に予め設定される調整量を加算するとともに、前記送信メッセージ分割回数が最も少ない1つの通信スレーブに割り当てたスレーブ毎通信周期から前記調整量を減算し、前記調整量の加算された通信スレーブにおける前記送信メッセージ分割回数を初期化するスレーブ毎通信周期最適化ステップと、
を備えるようにしてもよい。
これにより、(2)と同様の効果を奏することができる。
(8) In the communication control method according to (7),
The communication master further comprises:
a slave division counting step of counting a transmission message division number, which is the number of times that one transmission message transmitted and received between each communication slave is divided and transmitted;
a per-slave communication cycle optimization step of, when the number of divisions of the transmission message in at least one communication slave is equal to or exceeds a preset threshold value, adding a preset adjustment amount to the per-slave communication cycle assigned to the communication slave, and subtracting the adjustment amount from the per-slave communication cycle assigned to the communication slave having the smallest number of divisions of the transmission message, thereby initializing the number of divisions of the transmission message in the communication slave to which the adjustment amount has been added;
The above configuration may be adopted.
This can provide the same effect as (2).

1 数値制御装置
10 制御部
101 I/Oインタフェース部
12 I/Oメモリ
15 通信マスタ
151 スレーブ毎通信周期割当部
152A DI/DO通信時間計測部
152B DI/DO通信時間算出部
153 マージンデータ量算出部
154 マスタ送信メッセージ判定部
155 DOパケット作成部
156 スレーブ毎分割回数カウント部
157 スレーブ毎通信周期最適化部
158A DO送信部
158B DI受信部
159 バッファメモリ
3 I/Oユニット
30 制御部
301 I/Oインタフェース部
32 メモリ
35 通信スレーブ
354 スレーブ送信メッセージ判定部
355 DIパケット作成部
358A DI送信部
358B DO受信部
359 メモリ部
6 電気信号ケーブル
1000 通信制御システム
1 Numerical control device 10 Control unit 101 I/O interface unit 12 I/O memory 15 Communication master 151 Slave-by-slave communication cycle allocation unit 152A DI/DO communication time measurement unit 152B DI/DO communication time calculation unit 153 Margin data amount calculation unit 154 Master transmission message determination unit 155 DO packet creation unit 156 Slave-by-slave division number count unit 157 Slave-by-slave communication cycle optimization unit 158A DO transmission unit 158B DI reception unit 159 Buffer memory 3 I/O unit 30 Control unit 301 I/O interface unit 32 Memory 35 Communication slave 354 Slave transmission message determination unit 355 DI packet creation unit 358A DI transmission unit 358B DO reception unit 359 Memory unit 6 Electric signal cable 1000 Communication control system

Claims (8)

通信マスタを備える制御装置と、前記制御装置にデイジーチェーンにより通信可能に接続された通信スレーブをそれぞれ備える複数のI/Oユニットとの間で、予め設定された一定周期毎に、前記制御装置が全てのI/OユニットとI/O信号を送受信する通信制御システムにおいて、
前記通信マスタは、
各通信スレーブにそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブとのI/O信号送受信の周期ごとに、送信メッセージを除くDIデータ及びDOデータのみの通信に要した通信時間を計測し、各通信スレーブの通信帯域マージンデータ量を算出するマージンデータ量算出部と、
前記通信スレーブに対して、DOデータを送信するときに、前記通信帯域マージンデータ量を組み込んだDOパケットを作成し、前記通信スレーブに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割した部分メッセージを前記DOパケットに組み込むDOパケット作成部と、
前記DOパケットを前記通信スレーブに送信するDO送信部と、を備え、
前記通信スレーブは、
前記通信マスタから送信されるDOパケットを受信するDO受信部と、
受信した前記DOパケットに含まれる前記通信帯域マージンデータ量を取得し、前記通信マスタに対して、DIデータを送信するときに、DIパケットを作成し、前記通信マスタに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割した部分メッセージを前記DIパケットに組み込むDIパケット作成部と、
前記DIパケットを前記通信マスタに送信するDI送信部と、を備える、
通信制御システム。
A communication control system in which a control device having a communication master and a plurality of I/O units each having a communication slave communicatively connected to the control device by a daisy chain are arranged so that the control device transmits and receives I/O signals to and from all of the I/O units at a constant period set in advance,
The communication master includes:
Each communication slave is assigned a communication cycle in advance.
a margin data amount calculation unit that measures a communication time required for communication of only DI data and DO data excluding transmission messages for each cycle of I/O signal transmission and reception with each communication slave, and calculates a communication band margin data amount of each communication slave;
a DO packet creation unit that creates a DO packet incorporating the communication bandwidth margin data amount when transmitting DO data to the communication slave, and when a message amount to be transmitted to the communication slave exceeds the communication bandwidth margin data amount, divides the transmission message into a plurality of communications, and incorporates a divided partial message of the transmission message, which does not exceed the communication bandwidth margin data amount, into the DO packet for each communication period;
a DO transmission unit that transmits the DO packet to the communication slave;
The communication slave is
a DO receiving unit for receiving a DO packet transmitted from the communication master;
a DI packet creation unit that acquires the communication bandwidth margin data amount included in the received DO packet, creates a DI packet when transmitting DI data to the communication master, and when a message amount to be transmitted to the communication master exceeds the communication bandwidth margin data amount, divides the transmission message into a plurality of communications, and incorporates a divided partial message of the transmission message that does not exceed the communication bandwidth margin data amount into the DI packet for each communication period;
a DI transmission unit that transmits the DI packet to the communication master,
Communications control system.
前記通信マスタは、さらに、
各通信スレーブとの間で送受信される1つの送信メッセージが複数回に分割されて送信された回数である送信メッセージ分割回数をカウントするスレーブ毎分割回数カウント部と、
少なくとも1つの通信スレーブにおける、前記送信メッセージ分割回数が予め設定された閾値以上又は閾値を超えた場合、前記通信スレーブに割り当てたスレーブ毎通信周期に予め設定される調整量を加算するとともに、前記送信メッセージ分割回数が最も少ない1つの通信スレーブに割り当てたスレーブ毎通信周期から前記調整量を減算し、前記調整量の加算された通信スレーブにおける前記送信メッセージ分割回数を初期化するスレーブ毎通信周期最適化部と、
を備える、請求項1に記載の通信制御システム。
The communication master further comprises:
a slave division counting unit that counts a transmission message division count, which is the number of times that one transmission message transmitted and received between each communication slave is divided and transmitted;
a per-slave communication cycle optimization unit that, when the number of transmission message divisions in at least one communication slave is equal to or exceeds a preset threshold value, adds a preset adjustment amount to the per-slave communication cycle assigned to the communication slave, subtracts the adjustment amount from the per-slave communication cycle assigned to the communication slave having the smallest number of transmission message divisions, and initializes the number of transmission message divisions in the communication slave to which the adjustment amount has been added;
The communication control system according to claim 1 .
前記マージンデータ量算出部は、
各通信スレーブに割り当てたスレーブ毎通信周期と、各通信スレーブとのI/O信号送受信の周期ごとに前記DIデータ及びDOデータのみの通信に要した通信時間に基づいて算出される今回の計測時間及び過去の計測時間における最大値と、に基づいて、前記通信帯域マージンデータ量を算出する、請求項1又は請求項2に記載の通信制御システム。
The margin data amount calculation unit is
3. The communication control system according to claim 1, wherein the communication bandwidth margin data amount is calculated based on a slave-specific communication period assigned to each communication slave and a maximum value of a current measurement time and a past measurement time calculated based on the communication time required for communication of only the DI data and DO data for each period of I/O signal transmission and reception with each communication slave.
前記スレーブ毎通信周期は、前記予め設定された一定周期を前記I/Oユニットの個数により等分した値とする、請求項1から請求項3のいずれか1項に記載の通信制御システム。 The communication control system according to any one of claims 1 to 3, wherein the slave-specific communication period is a value obtained by equally dividing the preset fixed period by the number of the I/O units. 前記スレーブ毎通信周期は、前記I/Oユニットの接続順序に基づいて、傾斜的に各I/Oユニットに算出する値とする、請求項1から請求項3のいずれか1項に記載の通信制御システム。 The communication control system according to any one of claims 1 to 3, wherein the slave-specific communication period is a value calculated for each I/O unit in a progressive manner based on the connection order of the I/O units. 前記スレーブ毎通信周期は、前記I/OユニットのDI/DO点数に基づいて、算出する値とする、請求項1から請求項3のいずれかに記載の通信制御システム。 The communication control system according to any one of claims 1 to 3, wherein the slave-specific communication period is a value calculated based on the number of DI/DO points of the I/O unit. 通信マスタを備える制御装置と、前記制御装置にデイジーチェーンにより通信可能に接続された通信スレーブをそれぞれ備える複数のI/Oユニットとの間で、予め設定された一定周期毎に、前記制御装置が全てのI/OユニットとI/O信号を送受信する通信制御方法であって、
前記通信マスタは、
各通信スレーブにそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブとのI/O信号送受信の周期ごとに、送信メッセージを除くDIデータ及びDOデータのみの通信に要した通信時間を計測し、各通信スレーブの通信帯域マージンデータ量を算出するマージンデータ量算出ステップと、
前記通信スレーブに対して、DOデータを送信するときに、前記通信帯域マージンデータ量を組み込んだDOパケットを作成し、前記通信スレーブに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割した部分メッセージを前記DOパケットに組み込むDOパケット作成ステップと、
前記DOパケットを前記通信スレーブに送信するDO送信ステップと、を備え、
前記通信スレーブは、
前記通信マスタから送信されるDOパケットを受信するDO受信ステップと、
受信した前記DOパケットに含まれる前記通信帯域マージンデータ量を取得し、前記通信マスタに対して、DIデータを送信するときに、DIパケットを作成し、前記通信マスタに対する送信メッセージ量が前記通信帯域マージンデータ量を超える場合、複数回の通信に分けて各通信の周期ごとに、前記通信帯域マージンデータ量を超えない、前記送信メッセージの分割された部分メッセージを前記DIパケットに組み込むDIパケット作成ステップと、
前記DIパケットを前記通信マスタに送信するDI送信ステップと、を備える、
通信制御方法。
A communication control method in which a control device having a communication master and a plurality of I/O units each having a communication slave communicatively connected to the control device by a daisy chain are used, the control device transmitting and receiving I/O signals to and from all of the I/O units at a constant period set in advance, the method comprising:
The communication master includes:
Each communication slave is assigned a communication cycle in advance.
a margin data amount calculation step of measuring a communication time required for communication of only DI data and DO data excluding a transmission message for each cycle of I/O signal transmission and reception with each communication slave, and calculating a communication band margin data amount of each communication slave;
a DO packet creation step of creating a DO packet incorporating the communication bandwidth margin data amount when transmitting DO data to the communication slave, and if the amount of a message to be transmitted to the communication slave exceeds the communication bandwidth margin data amount, dividing the transmission message into a plurality of communications and incorporating a partial message of the transmission message, which does not exceed the communication bandwidth margin data amount, into the DO packet for each communication period;
a DO transmission step of transmitting the DO packet to the communication slave;
The communication slave is
a DO receiving step of receiving a DO packet transmitted from the communication master;
a DI packet creation step of acquiring the communication bandwidth margin data amount included in the received DO packet, creating a DI packet when transmitting DI data to the communication master, and, if a message amount to be transmitted to the communication master exceeds the communication bandwidth margin data amount, dividing the transmission message into a plurality of communications and incorporating a divided partial message of the transmission message, which does not exceed the communication bandwidth margin data amount, into the DI packet for each communication period;
A DI transmission step of transmitting the DI packet to the communication master.
Communications control method.
前記通信制御方法において、
前記通信マスタは、さらに、
各通信スレーブとの間で送受信される1つの送信メッセージが複数回に分割されて送信された回数である送信メッセージ分割回数をカウントするスレーブ毎分割回数カウントステップと、
少なくとも1つの通信スレーブにおける、前記送信メッセージ分割回数が予め設定された閾値以上又は閾値を超えた場合、前記通信スレーブに割り当てたスレーブ毎通信周期に予め設定される調整量を加算するとともに、前記送信メッセージ分割回数が最も少ない1つの通信スレーブに割り当てたスレーブ毎通信周期から前記調整量を減算し、前記調整量の加算された通信スレーブにおける前記送信メッセージ分割回数を初期化するスレーブ毎通信周期最適化ステップと、
を備える、請求項7に記載の通信制御方法。
In the communication control method,
The communication master further comprises:
a slave division counting step of counting a transmission message division number, which is the number of times that one transmission message transmitted and received between each communication slave is divided and transmitted;
a per-slave communication cycle optimization step of, when the number of transmission message divisions in at least one communication slave is equal to or exceeds a preset threshold value, adding a preset adjustment amount to the per-slave communication cycle assigned to the communication slave, and subtracting the adjustment amount from the per-slave communication cycle assigned to the communication slave having the smallest number of transmission message divisions, thereby initializing the number of transmission message divisions in the communication slave to which the adjustment amount has been added;
The communication control method according to claim 7, comprising:
JP2020092878A 2020-05-28 2020-05-28 Communication control system and communication control method Active JP7469142B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020092878A JP7469142B2 (en) 2020-05-28 2020-05-28 Communication control system and communication control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020092878A JP7469142B2 (en) 2020-05-28 2020-05-28 Communication control system and communication control method

Publications (2)

Publication Number Publication Date
JP2021190784A JP2021190784A (en) 2021-12-13
JP7469142B2 true JP7469142B2 (en) 2024-04-16

Family

ID=78847533

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020092878A Active JP7469142B2 (en) 2020-05-28 2020-05-28 Communication control system and communication control method

Country Status (1)

Country Link
JP (1) JP7469142B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018129708A (en) 2017-02-09 2018-08-16 オムロン株式会社 Communication system, communication device and communication method
JP2018129707A (en) 2017-02-09 2018-08-16 オムロン株式会社 Communication system, communication device and communication method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018129708A (en) 2017-02-09 2018-08-16 オムロン株式会社 Communication system, communication device and communication method
JP2018129707A (en) 2017-02-09 2018-08-16 オムロン株式会社 Communication system, communication device and communication method
US20200119975A1 (en) 2017-02-09 2020-04-16 Omron Corporation Communication System, Communication Apparatus, and Communication Method

Also Published As

Publication number Publication date
JP2021190784A (en) 2021-12-13

Similar Documents

Publication Publication Date Title
US7944838B2 (en) Apparatus, method and computer program for traffic control
EP2453612A1 (en) Bus control device
CN107809391B (en) Apparatus and method for controlling message communication load
CN112311628B (en) Network speed measuring method, system, network equipment and storage medium
CN110874314B (en) Pressure measurement method, device, equipment and medium
EP3474499A1 (en) Network performance detection method and apparatus
CN113364638B (en) Method, electronic device and storage medium for EPA networking
CN114764233A (en) Detecting component degradation in an industrial process plant based on loop component responsiveness
CN112714081B (en) Data processing method and device
JP7469142B2 (en) Communication control system and communication control method
CN110636109B (en) Node scheduling optimization method, server and computer readable storage medium
CN115413051A (en) Method for processing data related to transmission of multiple data streams
CN114826977A (en) Baud rate detection method and device, terminal equipment and storage medium
US20220368559A1 (en) Communication device, communication system, communication control method and program
CN108023938B (en) Message sending method and server
EP3399704B1 (en) Method and apparatus for determining routing policy
CN108833276B (en) Method and device for determining preferred path and server
JP7453061B2 (en) Communication control system and communication control method
US20230280718A1 (en) Communication device, communication system, communication control method, and program
CN112650737B (en) Data processing method, data processing device, storage medium and electronic equipment
CN112205023B (en) Cellular telecommunication network
JPWO2022019014A5 (en)
JP2014112779A (en) Data transmission controller, data transmission control method, and computer program
KR101813165B1 (en) Adaptive control plane management method for software defined network and apparatus thereof
CN111490940B (en) Method for determining data forwarding path, electronic device and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230308

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240126

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240206

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240208

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240305

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240404

R150 Certificate of patent or registration of utility model

Ref document number: 7469142

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150