JP7469142B2 - Communication control system and communication control method - Google Patents
Communication control system and communication control method Download PDFInfo
- 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
Links
- 238000004891 communication Methods 0.000 title claims description 710
- 238000000034 method Methods 0.000 title claims description 39
- 230000005540 biological transmission Effects 0.000 claims description 218
- 238000005259 measurement Methods 0.000 claims description 20
- 238000005457 optimization Methods 0.000 claims description 16
- 230000008054 signal transmission Effects 0.000 claims description 7
- 230000000750 progressive effect Effects 0.000 claims 1
- 230000015654 memory Effects 0.000 description 59
- 230000008569 process Effects 0.000 description 26
- 238000010586 diagram Methods 0.000 description 18
- 125000004122 cyclic group Chemical group 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 230000004044 response Effects 0.000 description 6
- 206010009944 Colon cancer Diseases 0.000 description 5
- 230000001934 delay Effects 0.000 description 4
- 102200048773 rs2224391 Human genes 0.000 description 3
- 230000001052 transient effect Effects 0.000 description 3
- 101100521334 Mus musculus Prom1 gene Proteins 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000012508 change request Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 102220637010 Actin-like protein 7A_S10T_mutation Human genes 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 102220070930 rs794728599 Human genes 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
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
以下、マスタとして数値制御装置を、スレーブとして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.
通常の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実施形態)
本発明の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
複数(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/
デイジーチェーン接続においては、通信スレーブ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
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
Next, each component of the
[数値制御装置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
制御部10は、当業者にとって公知の数値制御機能部(図示せず)、及びI/Oインタフェース部101を有する。数値制御機能部は、当業者にとって公知であり、説明は省略する。
The
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/
The I/
The
As will be described later, the
[通信マスタ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
通信マスタ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
The buffer memory unit _k (1≦k≦N) may store various data related to communication between the
<スレーブ毎通信周期割当部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
The per-slave communication
Specifically, the slave-specific communication
Furthermore, the slave communication
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
Furthermore, the slave-specific communication
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
<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
The DI/DO communication
<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
The DI/DO communication
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
The margin data amount
Specifically, if the data transfer rate is RATE, it may be calculated using the following
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
Specifically, the margin data amount
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
When a DO packet is transmitted from the
When the master transmission
<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
Next, the DO
The DO
<通常のDOパケット_ケース1>
各通信スレーブ35_k(1≦k≦N)に対して今回の周期において送信する、DOパケットを作成するとき、マスタ送信メッセージ判定部154により、前回の周期における次回通信に持ち越すメッセージ_k、及び今回新たに送信する送信メッセージ_kが無いと判定された場合、DOパケット作成部155は、マージンデータ量算出部153により算出された通信帯域マージンデータ量_kの値を例えばヘッダ部に設定したDOパケット(「ケース1のDOパケット」という)を作成する。
<Normal DO Packet -
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
<最後の持ち越し送信メッセージ_ケース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 -
If the master transmission
The
<さらなる持ち越し送信メッセージの発生_ケース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 -
When the master transmission
Since message_k remains to be carried over to the next communication, even if the DO packet is transmitted by a
<新たな送信メッセージ_ケース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
The
<新たな送信メッセージ_ケース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
The DO
Since message_k remains to be carried over to the next communication, even if the DO packet is transmitted by the
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
The
<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について説明する。
<
The
When a transmission message _k sent from each communication slave 35_k (1≦k≦N) is divided and transmitted, the
The
Next, the I/
[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/
4, the I/
The
The I/O interface unit 301 acquires DO signals and messages from the
Specifically, the I/O interface unit 301 may obtain DO signals and messages transmitted from the
The
Furthermore, the
通信スレーブ35は、スレーブ送信メッセージ判定部354と、DIパケット作成部355と、DI送信部358Aと、DO受信部358Bと、バッファメモリ359と、を有する。
以下、特に断らない限り、通信スレーブ35_k(1≦k≦N)機能部の説明に際しては、通信スレーブ35と記載する。
The
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
スレーブ送信メッセージ判定部354は、今回のDI/DO通信周期において、通信スレーブ35から通信マスタ15に対して、DIパケットを作成するときに、前回のDI/DO通信周期において次回通信に持ち越すメッセージが発生したか否かを判定するとともに、次回通信に持ち越すメッセージが発生した場合、さらに前記次回通信に持ち越すメッセージ長と、通信帯域マージンデータ量の値と、の大小関係を判定する。
スレーブ送信メッセージ判定部354は、未送信となった持ち越し送信メッセージが無いと判定した場合、前述したようにメモリ32を参照して、今回新たに送信する送信メッセージがあるか否かを判定するとともに、今回新たに送信する送信メッセージがある場合、さらに新たな送信メッセージの長さと、通信帯域マージンデータ量の値と、の大小関係を判定する。ここで、通信帯域マージンデータ量の値として、今回のDI/DO通信周期において、通信マスタ15から受信したDOパケットのヘッダ部に設定された値を用いる。
When creating a DI packet from the
When the slave transmission
次に、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
<
When creating a DI packet to be transmitted to the
<最後の持ち越し送信メッセージ_ケース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 -
If the slave transmission
The
<さらなる持ち越し送信メッセージの発生_ケース3>
スレーブ送信メッセージ判定部354により、通信マスタ15に対する前回の周期における次回通信に持ち越すメッセージがあると判定され、さらに前記次回通信に持ち越すメッセージの長さが、通信帯域マージンデータ量の値を超えると判定された場合、DIパケット作成部355は、前記次回通信に持ち越すメッセージのうち、通信帯域マージンデータ量に相当するメッセージの一部分を今回の周期で送信する送信メッセージとする。DIパケット作成部355は、今回の周期で送信する送信メッセージを除いた送信メッセージの残りの部分を次回通信に持ち越すメッセージとして、次回通信に持ち越すメッセージ長とともに例えばバッファメモリ359に記憶するようにしてもよい。DIパケット作成部355は、通信帯域マージンデータ量_kの値、次回通信に持ち越すメッセージ長_kを例えばヘッダ部に設定し、ヘッダ部に次回の周期に持ち越す持ち越し送信メッセージ長を設定するとともに、今回の周期において送信する送信メッセージを組み込んだDIパケット(「ケース3のDIパケット」という)を作成する。
なお、次回通信に持ち越すメッセージが残ることから、後述するDI送信部358Aにより、当該DIパケットを送信しても、制御部30から送信要求のあったメッセージは、送信完了とはならない。
<Further carryover transmission messages occur -
When the slave transmission
Since there remains a message to be carried over to the next communication, even if the DI packet is transmitted by a
<新たな送信メッセージ_ケース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
The
<新たな送信メッセージ_ケース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
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送信部358A>
DI送信部358Aは、周期毎にDIパケット作成部355により作成されたDIパケットを通信マスタ15に対して送信する。DI送信部358Aは、前述したように、ケース2のDIパケット及びケース4のDIパケットを送信完了すると、制御部30から送信要求された送信メッセージの送信完了を制御部30(I/Oインタフェース部301)に対して例えばメモリ32に記録することで、通知する。
<
The
<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
The
As described above, there are cases where the transmission message transmitted from the
The I/
次に、図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
図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
In step S11, the
ステップ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
In step S13, the communications master 15 (DI/DO communication
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
In step S16, if the created DO packet_i does not contain a DO message, the communications master 15 (DO transmitting
ステップ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
In step S18, the communication master 15 (DO transmitting
In step S19, if the received DI packet_i does not contain a DI message, the communications master 15 (
In step S20, if there is a message transmitted from the communication slave 35_i, the communication master 15 (
In step S21, the communication master 15 (
In step S22, the communication master 15 (DI/DO communication
ステップ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
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
次に、図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
7, in step S30, the communication slave 35_k (DO receiving
In step S31, the communications slave 35_k (DO receiving
In step S32, if the communication slave 35_k (DO receiving
In step S33, the communications slave 35_k (DO receiving
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
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 (
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 (
In step S39, the communications slave 35_k (
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
以上のようにして、マスタ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
第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
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/
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
[通信マスタ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
<スレーブ毎分割回数カウント部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
The per-slave
Specifically, the per-slave
<スレーブ毎通信周期最適化部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
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
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
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
図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
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/
図10Aを参照すると、ステップS10Aにおいては、通信マスタ15は、ステップ10における初期設定に加えて、スレーブ毎分割回数_k(1≦k≦N)の初期設定(ゼロ設定)を行う。
Referring to FIG. 10A, in step S10A, the
また、ステップ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
また、ステップ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
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
According to the second embodiment, the
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
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を例として説明したが、これに限られない。前述したように、ロボットコントローラ等、産業用機械の制御装置における高速シリアル通信にも適用してもよい。
<
In the above embodiment, the
以上を換言すると、本開示の通信制御システム、及び通信制御方法は、次のような構成を有する各種各様の実施形態を取ることができる。 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
The
A slave communication period is assigned to each
a margin data
a DO
a
The
a
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
and a
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
a slave
a per-slave communication
The above configuration may be adopted.
This allows the
(3) (1)又は(2)に記載の通信制御システム1000において、マージンデータ量算出部153は、各通信スレーブ35に割り当てたスレーブ毎通信周期と、各通信スレーブ35とのI/O信号送受信の周期ごとに前記DIデータ及びDOデータのみの通信に要した通信時間に基づいて算出される今回の計測時間及び過去の計測時間における最大値と、に基づいて、前記通信帯域マージンデータ量を算出するようにしてもよい。
これにより、通信帯域マージンデータ量をより安全な値とすることができる。
(3) In the
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
This allows the slave-specific communication cycle to be assigned to each
(5) (1)から(3)のいずれかに記載の通信制御システム1000において、スレーブ毎通信周期は、前記I/Oユニットの接続順序に基づいて、傾斜的に各I/Oユニットに算出する値とするようにしてもよい。
これにより、ケーブル長の長いI/Oユニットに対しては、ケーブル長に起因する通信の遅れを吸収することができる。
(5) In the
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
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
The
A slave communication period is assigned to each
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
a DO packet creation step of creating a DO packet incorporating a communication bandwidth margin data amount when transmitting DO data to the
a DO transmission step of transmitting the DO packet to the
The
a DO receiving step of receiving a DO packet transmitted from the
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
and a DI transmission step of transmitting the DI packet to the
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
Claims (8)
前記通信マスタは、
各通信スレーブにそれぞれスレーブ毎通信周期を予め割り当て、
各通信スレーブとの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信号送受信の周期ごとに、送信メッセージを除く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:
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)
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 |
-
2020
- 2020-05-28 JP JP2020092878A patent/JP7469142B2/en active Active
Patent Citations (3)
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 |