JP4458279B2 - Programmable controller system communication method - Google Patents
Programmable controller system communication method Download PDFInfo
- Publication number
- JP4458279B2 JP4458279B2 JP2005252758A JP2005252758A JP4458279B2 JP 4458279 B2 JP4458279 B2 JP 4458279B2 JP 2005252758 A JP2005252758 A JP 2005252758A JP 2005252758 A JP2005252758 A JP 2005252758A JP 4458279 B2 JP4458279 B2 JP 4458279B2
- Authority
- JP
- Japan
- Prior art keywords
- slave
- frame
- master
- message
- communication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Programmable Controllers (AREA)
- Small-Scale Networks (AREA)
Description
この発明は、通信マスタ局と通信スレーブ局とをフィールドバスで結んだプログラマブル・コントローラ(以下、PLCと言う)・システムに適用される通信方法に関する。 The present invention relates to a communication method applied to a programmable controller (hereinafter referred to as PLC) system in which a communication master station and a communication slave station are connected by a field bus.
通信機能を有するPLCであるマスタと通信機能を有するI/Oターミナル(入力ユニット、出力ユニット、入出力混在ユニット)である複数のスレーブがフィールドバスに接続され、マスタからスレーブに出力データを一括して1つのOUTフレームで転送し、スレーブは決められた時間帯に入力データを含むINフレームをそれぞれ返送するようにしたPLCシステムの通信方法において、マスタがスレーブの状況を知るための技術は既に知られている(例えば、特許文献1参照)。 Plural slaves that are masters that have communication functions and I / O terminals that have communication functions (input units, output units, input / output mixed units) are connected to the fieldbus, and output data is batched from master to slave. In the communication method of the PLC system in which the IN frame including the input data is sent back in a predetermined time zone, the technique for the master to know the status of the slave is already known. (For example, refer to Patent Document 1).
また、イーサネット(登録商標)に代表されるようなCSMA/CD方式のバス(又はネットワーク)では、同一バス(又はネットワーク)上に接続されたマスタやスレーブなどの各ノードが、バス(又はネットワーク)上でのデータの衝突を起こさないようしてデータを送信する必要がある。データを送信するノードは、バス(又はネットワーク)上のデータの衝突を回避するために最初にバス(又はネットワーク)の状況を確認してからデータを送信する。
しかしながら、上記特許文献1に示された発明では、マスタがスレーブの特定のスタータスなどを読み取るのみで、能動的にスレーブからマスタにステータスなどを報告する手段を有していない。また、CSMA/CD方式のバス/ネットワークでは、各ノードが相互にデータを転送することが可能であるが、データ衝突の発生により転送効率が落ちてしまう。
However, in the invention disclosed in
この発明は、上記問題点に着目してなされたものであり、その目的とするところは、マスタからスレーブに出力データを一括して1つのOUTフレームで転送し、スレーブは決められた時間帯に入力データを含むINフレームをそれぞれ返送するようにした転送効率のよい通信方法において、スレーブが能動的にマスタに対してデータを送信する手段を提供することにある。 The present invention has been made paying attention to the above-mentioned problems, and the object of the invention is to transfer output data from the master to the slave in one OUT frame, and the slave is in a predetermined time zone. An object of the present invention is to provide a means for a slave to actively transmit data to a master in a communication method with high transfer efficiency in which an IN frame including input data is returned.
この発明のさらに他の目的並びに作用効果については、明細書の以下の記述を参照することにより、当業者であれば容易に理解されるであろう。 Other objects and operational effects of the present invention will be easily understood by those skilled in the art by referring to the following description of the specification.
上記課題を解決するために、本発明のPLCシステムの通信方法は、次の構成を採用するものである。 In order to solve the above-described problems, the PLC system communication method of the present invention employs the following configuration.
すなわち、本発明のPLCシステムの通信方法は、通信機能を有するプログラマブル・コントローラであるマスタと通信機能を有するI/Oターミナル装置である複数のスレーブがフィールドバスに接続され、マスタからスレーブに出力データを一括して1つのOUTフレームで転送し、スレーブは決められた時間帯に入力データを含むINフレームをそれぞれ返送するようにしたPLCシステムの通信方法において、OUTフレームにてマスタがメッセージ通信要求の有無を確認したい単数または複数のスレーブを指定し、OUTフレームで指定されたスレーブがメッセージ要求の有無を示す応答フレームを返送する、ようにしたことを特徴とするものである。 That is, according to the PLC system communication method of the present invention, a master that is a programmable controller having a communication function and a plurality of slaves that are I / O terminal devices having a communication function are connected to a fieldbus, and output data from the master to the slaves. In the PLC system communication method in which the master frame is transferred in one OUT frame and the slave returns the IN frame including the input data in a predetermined time zone, the master sends a message communication request in the OUT frame. One or a plurality of slaves whose presence / absence is to be confirmed are designated, and the slave designated by the OUT frame returns a response frame indicating the presence / absence of a message request.
このような構成によれば、マスタからスレーブに出力データを一括して1つのOUTフレームで転送し、スレーブは決められた時間帯に入力データを含むINフレームをそれぞれ返送するようにした転送効率のよい通信方法を維持しつつも、スレーブが能動的にマスタに対してデータを送信する手段を提供することが可能となり、この種のPLCシステムにおける応答性乃至機能性を向上させることができる。 According to such a configuration, the output data is transferred from the master to the slave in a batch in one OUT frame, and the slave returns the IN frame including the input data in a predetermined time zone. While maintaining a good communication method, it is possible to provide means for the slave to actively transmit data to the master, and the responsiveness or functionality in this type of PLC system can be improved.
本発明のPLCシステムの通信方法においては、OUTフレームで指定されたスレーブは、メッセージ要求の有無を示す応答フレーム加えて、メッセージの種類を示す応答フレームを返送する、ようにしてもよい。このような構成によれば、変更されたメッセージ種別をマスタ側におけるメッセージ取得必要性の判断要素として使用可能となり、マスタ側におけるメッセージ取得自由度を向上させることができる。 In the communication method of the PLC system of the present invention, the slave specified by the OUT frame may return a response frame indicating the type of message in addition to a response frame indicating the presence or absence of a message request. According to such a configuration, the changed message type can be used as a determination element for the message acquisition necessity on the master side, and the degree of freedom of message acquisition on the master side can be improved.
本発明のPLCシステムの通信方法においては、OUTフレームで指定されたスレーブは、メッセージ要求の有無を示す応答フレーム加えて、メッセージ送信要求を示す応答フレームを返送する、ようにしてもよい。このような構成によれば、実際にスレーブが能動的になって、スレーブからマスタへとメッセージ送信を行うことが可能となる。 In the communication method of the PLC system of the present invention, the slave specified by the OUT frame may return a response frame indicating a message transmission request in addition to a response frame indicating the presence or absence of a message request. According to such a configuration, the slave is actually activated, and it is possible to transmit a message from the slave to the master.
上述した種々の本発明のPLCシステムの通信方法においては、マスタは、スレーブに対してメッセージ送信許可フレームを送信し、スレーブにバス権を渡し、バス権をもったスレーブがマスタに対してメッセージを送信する、ようにしてもよい。このような構成によれば、マスタ・スレーブ通信の主導権の変更によりスレーブの自由度を向上させつつ、スレーブが主導権を持ってマスタに対して所望のデータを含むメッセージを送信することが可能となる。 In the communication methods of the various PLC systems of the present invention described above, the master transmits a message transmission permission frame to the slave, passes the bus right to the slave, and the slave having the bus right sends a message to the master. You may make it transmit. According to such a configuration, it is possible to send a message including desired data to the master with the initiative of the slave while improving the flexibility of the slave by changing the initiative of the master / slave communication. It becomes.
本発明のPLCシステムの通信方法の好ましい実施の形態においては、スレーブから送信されるメッセージの内容としては、スレーブに供給される電源の電圧とすることができる。このような構成によれば、スレーブに供給される電源の電圧を必要に応じてマスタの側で確認することが可能となる。 In a preferred embodiment of the communication method of the PLC system of the present invention, the content of the message transmitted from the slave can be the voltage of the power source supplied to the slave. According to such a configuration, the voltage of the power supplied to the slave can be confirmed on the master side as necessary.
本発明のPLCシステムの通信方法の好ましい実施の形態においては、スレーブから送信されるメッセージの内容としては、スレーブで検出された通信エラー回数の累積値とすることができる。このような構成によれば、スレーブで検出された通信エラー回数の累積値を必要に応じてマスタの側で確認することが可能となる。 In a preferred embodiment of the communication method of the PLC system of the present invention, the content of the message transmitted from the slave can be an accumulated value of the number of communication errors detected by the slave. According to such a configuration, the cumulative value of the number of communication errors detected by the slave can be confirmed on the master side as necessary.
本発明によれば、マスタからスレーブに出力データを一括して1つのOUTフレームで転送し、スレーブは決められた時間帯に入力データを含むINフレームをそれぞれ返送するようにした転送効率のよい通信方法を維持しつつも、スレーブが能動的にマスタに対してデータを送信する手段を提供することが可能となり、これを利用すれば、この種のPLCシステムにおける応答性乃至機能性を向上させることができる。 According to the present invention, the output data is transferred from the master to the slave in one OUT frame, and the slave returns the IN frame including the input data in a predetermined time zone. While maintaining the method, it is possible to provide a means for the slave to actively transmit data to the master, and this can be used to improve the responsiveness or functionality in this type of PLC system. Can do.
以下に、この発明のPLCシステムの通信方法の好適な実施の一形態を添付図面を参照しながら詳細に説明する。 Hereinafter, a preferred embodiment of a communication method for a PLC system of the present invention will be described in detail with reference to the accompanying drawings.
マスタ及びスレーブを含むPLCシステムの構成図が図7に示されている。同図に示されるように、このPLCシステムは、通信機能を有するPLC1であるマスタ(M)と、通信機能を有するI/Oターミナル2である1もしくは2以上のスレーブ(S)とをフィールドバス(バス型ネットワーク)6にて結んで構成されている。
A block diagram of a PLC system including a master and a slave is shown in FIG. As shown in the figure, this PLC system includes a master (M) which is a
また、フィールドバス6上にあって、マスタ(M)と所定のスレーブ(S)とを結ぶ経路上には、1段又は2段以上に亘って中継局4として機能するリピータ(R)が介在されている。図7には、マスタ局(M)とスレーブ局(S)とを結ぶ経路にリピータ(R)が存在しない場合と、同経路に1台のリピータ(R)が介在されている場合と、同経路に2台のリピータ(R)が介在されている場合とが混在する形態のネットワークが示されている。なお、3はPCであり、5はフィールドバス6の終端における反射を低減する終端装置である。
Further, a repeater (R) that functions as the
図示のPLC1としては、パラレルバスの敷設された図示しないバックプレーン上に多数のコネクタを配置し、それらのコネクタに対して、CPUユニット、I/Oユニット、その他各種の特殊機能ユニット等々を任意に装着可能とした所謂ビルディングブロック型のPLCが採用されている。
The illustrated
特に、この例では、バックプレーン上の1のコネクタに対して通信マスタユニット10を装着することにより、通信マスタ局(M)として機能する「通信機能を有するPLC」1が構成されている。図では、それらのユニットのうちで、CPUユニット20及び通信マスタユニット10のみに参照符号が付されている。
In particular, in this example, the “PLC having a communication function” 1 that functions as the communication master station (M) is configured by mounting the
通信マスタユニット10の内部構成を示すハードウェア構成図が図8に示されている。同図に示されるように、通信マスタユニット10は、通信物理層として機能する通信インタフェース(通信I/F)801と、所望の通信機能を実現するための回路をLSI化してなるマスタ用ASIC802と、CPUユニット20との間で受け渡される送受信データのバッファエリアや、後述するCPU806の演算用ワークエリア等として機能するRAM803と、マイクロプロセッサを主体として構成されて装置全体を統括制御するためのCPU806と、各種の設定データが格納される不揮発性メモリ(EEPROM)805と、各種の動作表示等を行うためのLED表示部807と、各種の設定操作等に使用される設定スイッチ(設定SW)808と、CPUユニット20へ通ずる内部バスへのインタフェースとして機能する内部バスインタフェース(内部バスI/F)804とを含んでいる。
A hardware configuration diagram showing the internal configuration of the
当業者にはよく知られているように、この種のPLCシステムにおいては、CPUユニット(図7参照)20は、共通処理、I/Oリフレッシュ処理、ユーザプログラム実行処理、周辺サービス処理等を繰り返し一巡実行しており、I/Oリフレッシュ処理の実行の際には、バックプレーン上に装着されたローカルI/Oユニット(図示せず)との間のみならず、通信マスタユニット10内のRAM803のI/O共有エリアとの間においても、I/Oリフレッシュ処理を実行する。
As is well known to those skilled in the art, in this type of PLC system, the CPU unit (see FIG. 7) 20 repeatedly performs common processing, I / O refresh processing, user program execution processing, peripheral service processing, and the like. When the I / O refresh process is executed, the
具体的には、CPUユニット20の図示しないI/Oメモリ内のOUTデータは、通信マスタユニット10のRAM803内のOUTエリアに転送され、同RAM803のINエリアのINデータは、CPUユニット20のI/Oメモリ内のINエリアに転送される。これらの動作は、CPUユニット20内のMPUにより実行される。
Specifically, the OUT data in the I / O memory (not shown) of the
一方、後に詳細に説明するように、通信マスタユニット10と各I/Oターミナル装置(スレーブS)2との間では、CPUユニット20のI/Oリフレッシュ動作とは非同期にフィールドバス6を介する通信が行われており、これにより各I/Oターミナル装置2と通信マスタユニット10内のRAM103との間においても、一種のI/Oリフレッシュ処理が実行される。これらの動作は、通信マスタユニット10内のMPUにより実行される。
On the other hand, as will be described in detail later, communication between the
具体的には、スレーブ(S)であるI/Oターミナル装置2から受信されたINデータは、通信マスタユニット10内のRAM803のINエリアに書き込まれ、同RAM803のOUTエリアのOUTデータは、該当するI/Oターミナル装置2へと送信される。
Specifically, the IN data received from the I /
このようにして、CPUユニット20内のI/Oメモリと各I/Oターミナル装置2,2・・との間において、通信マスタユニット10を経由してI/Oリフレッシュ処理が実行され、その結果として、リモート設置された各I/Oターミナル装置2,2・・・に接続されたI/O機器をCPUユニット20で取り扱うことが可能となるのである。
In this way, the I / O refresh process is executed between the I / O memory in the
次に、スレーブ(S)であるI/Oターミナル内部のハードウェア構成図が図9に示されている。同図に示されるように、I/Oターミナル装置2は、通信物理層として機能する通信インタフェース(通信I/F)901と、所望の通信機能を実現するための回路をLSI化してなるスレーブ用ASIC902と、マイクロプロセッサを主体として構成されて装置全体を統括制御するためのCPU903と、各種の設定データが格納される不揮発性メモリ(EEPROM)908と、各種の動作表示等を行うためのLED表示部907と、各種の設定操作等に使用される設定スイッチ(設定SW)906と、I/O機器との間でデータをやり取りするための外部インタフェース部(I/F)部903と、装置全体に安定化直流電源を供給するための変圧機能を有する直流電源部904とを含んでいる。
Next, FIG. 9 shows a hardware configuration diagram inside the I / O terminal which is the slave (S). As shown in the figure, the I /
そして、PLC1と各I/Oターミナル2との間では、PLC1を通信マスタ(M)、各I/Oターミナル2を通信スレーブ局(S)とする1対N或いは1対1のマスタ・スレーブ通信を通じて、I/Oデータや各種メッセージデータ等々のやり取りが行われる。
Between the
I/Oデータに関して言えば、具体的には、PLC1から受信されるOUTデータは、I/Oターミナル装置2のI/F部207を介してI/O機器へと送り出され、I/O機器からI/F部903を介してI/Oターミナル装置2に取り込まれたINデータは、PLC装置1へ宛てて送信される。これらの入出力データのやり取りについては、後にさらに詳細に説明する。
Speaking of I / O data, specifically, OUT data received from the
次に、本発明に係るPLCシステムの通信方法が採用する通信プロトコルを図1を参照しつつ説明する。 Next, a communication protocol employed by the communication method of the PLC system according to the present invention will be described with reference to FIG.
本プロトコルの開始タイミングはマスタが管理する。図1に示されるように、通信サイクルは、マスタから送信するOUTフレーム(100)、OUTフレームにより指定されたスレーブからマスタに対して送信されるCNフレーム(110)〜(11n)、INスレーブから送信されるINフレーム(120)〜(12m)と続く。 The master manages the start timing of this protocol. As shown in FIG. 1, the communication cycle includes an OUT frame (100) transmitted from the master, CN frames (110) to (11n) transmitted from the slave specified by the OUT frame to the master, and an IN slave. This is followed by IN frames (120) to (12m) to be transmitted.
マスタユニット(M)と各スレーブ(S)との間の通信サイクルの開始タイミングはOUTフレーム(100)の正常受信完了をもって時間合わせされる。そして、それにつづくCNフレーム(110)〜(11n)、INフレーム(120)〜(12m)のフレーム長、送信されるフレーム数は固定であるため、各フレームの送信タイミングは、OUTフレーム(100)の正常送信完了を開始タイミングとして定められた時間監視により行うことができる。 The start timing of the communication cycle between the master unit (M) and each slave (S) is timed when normal reception of the OUT frame (100) is completed. Since the CN frames (110) to (11n), the IN frames (120) to (12m), and the number of frames to be transmitted are fixed, the transmission timing of each frame is the OUT frame (100). The normal transmission completion can be performed by monitoring the time determined as the start timing.
OUTフレームの構造の一例が図2に示されている。OUTフレーム(100)は、フレームの開始を示す「スタート」201と、OUTフレームを示す「コマンド」202と、CNフレーム送信要求するスレーブを示す「CN_frame送信要求アドレス」203と、OUTデータのデータ長を示す「レングス」204と、OUTスレーブ、MIXスレーブへの出力データを格納している「OUTデータ」205と、フレームの異常を検出するための「CRC」206からなる。 An example of the structure of the OUT frame is shown in FIG. The OUT frame (100) includes a “start” 201 indicating the start of a frame, a “command” 202 indicating an OUT frame, a “CN_frame transmission request address” 203 indicating a slave requesting CN frame transmission, and a data length of OUT data. "Length" 204, "OUT data" 205 storing output data to the OUT slave and the MIX slave, and "CRC" 206 for detecting a frame abnormality.
マスタ(M)は、各OUTスレーブ(出力専用ユニット)宛またはMIXスレーブ(入出力混在ユニット)宛の出力データをOUTフレームのどこに割り当てるかの管理を行っており、そして各OUTスレーブのそれぞれは自局が受け取る出力データが、OUTフレームのどこに割り当てられているのかを通信サイクルが始まる前に、マスタから通知されている。 The master (M) manages where in the OUT frame the output data addressed to each OUT slave (output dedicated unit) or MIX slave (input / output mixed unit) is assigned, and each OUT slave Before the communication cycle starts, the master notifies the output data received by the station where the output data is assigned in the OUT frame.
INフレームの構造の一例が図3に示されている。INフレームは、フレームの開始を示す「スタート」301と、INフレーム種類を示す「コマンド」302と、当該INフレームを送信したスレーブを示す「アドレス」303と、INデータのデータ長を示す「レングス」304と、INスレーブ、MIXスレーブからの入力データを格納している「INデータ」305と、フレームの異常を検出するための「CRC」306からなる。 An example of the structure of the IN frame is shown in FIG. The IN frame includes a “start” 301 indicating the start of the frame, a “command” 302 indicating the IN frame type, an “address” 303 indicating the slave that transmitted the IN frame, and a “length” indicating the data length of the IN data. ”304,“ IN data ”305 storing input data from the IN slave and the MIX slave, and“ CRC ”306 for detecting a frame abnormality.
マスタ(M)は、各INスレーブまたはMIXスレーブが、OUTフレーム正常受信後どの時間に送信するかの管理を行っており、通信サイクルが始まる前に、マスタから各INスレーブまたはMIXスレーブに対してINフレームを送信するタイミングがそれぞれ通知されている。各INスレーブまたはMIXスレーブは、マスタから通知されたINフレームを送信するタイミングの値を保持しており、それぞれのINスレーブまたはMIXスレーブはその値に従ってINフレームを送信する。 The master (M) manages the time at which each IN slave or MIX slave transmits after receiving the OUT frame normally. Before the communication cycle starts, the master (M) sends each IN slave or MIX slave to each IN slave or MIX slave. The timing for transmitting the IN frame is notified. Each IN slave or MIX slave holds a value of the timing to transmit the IN frame notified from the master, and each IN slave or MIX slave transmits an IN frame according to the value.
INフレームは、INスレーブまたはMIXスレーブがマスタに送信することができるが、OUTスレーブはINフレームを発行することができないため、INフレーム内にメッセージ通信要求を行う手段を持たせることはできない。このため、すべての種類のスレーブが発行可能なCNフレームにメッセージ通信要求を行う手段を持たせる。 The IN frame or the MIX slave can transmit the IN frame to the master. However, since the OUT slave cannot issue the IN frame, the IN frame cannot have a means for making a message communication request. For this reason, the CN frame that can be issued by all types of slaves is provided with means for making a message communication request.
CNフレームの構造の一例が図4に示されている。CNフレームは、フレームの開始を示す「スタート」401と、CNフレームを示す「コマンド」402と、当該CNフレームを送信したスレーブを示す「アドレス」403と、メッセージの種類又はメッセージ送信要求を示す「アラーム」404と、フレームの異常を検出するための「CRC」405からなる。 An example of the structure of the CN frame is shown in FIG. CN frame shows the "start" 401 indicating the start of a frame, and shows the CN frame "command" 402, and the CN frame indicating the transmission slave "Address" 403, the message type or a message transmission request An “alarm” 404 and a “CRC” 405 for detecting a frame abnormality are included.
アラームビットとメッセージ種の対応例が図5に示されている。「アラーム」404は単数または複数ビットからなり、アラームビットとメッセージ種の対応はマスタと各スレーブ間とで事前に取れている。 An example of correspondence between alarm bits and message types is shown in FIG. The “alarm” 404 includes a single bit or a plurality of bits, and the correspondence between the alarm bit and the message type is established in advance between the master and each slave.
CNフレームの「コマンド」フィールドの一例が図6に示されている。「コマンド」フィールドは、当該CNフレームを送信したスレーブのメッセージ送信要求の有無を示すビットを有している。 An example of the “command” field of the CN frame is shown in FIG. The “command” field has a bit indicating whether or not there is a message transmission request of the slave that transmitted the CN frame.
次に、本発明に関連して実行されるマスタ並びにスレーブの動作の概略を図15〜図20のフローチャートを参照して説明する。 Next, the outline of the master and slave operations executed in connection with the present invention will be described with reference to the flowcharts of FIGS.
I/O通信サイクル時のマスタの処理(ファームウェアの動作)を示すフローチャートが図15に、I/O通信サイクル時のマスタの処理(ASICによるOUTフレーム送信動作)を示すフローチャートが、図16にそれぞれ示されている。 FIG. 15 is a flowchart showing master processing (firmware operation) in the I / O communication cycle, and FIG. 16 is a flowchart showing master processing (OUT frame transmission operation by the ASIC) in the I / O communication cycle. It is shown.
図15に示される処理はI/O通信サイクルタイマによるタイマ割込にて周期的に実行される。処理が開始されると、先ず、CNフレームにアラームビットの有無が判定され(ステップ1501)、アラームビットがあるときに限り(ステップ1501YES)、アラームビットの内容がPLCへと通知される(ステップ1502)。 The processing shown in FIG. 15 is periodically executed by timer interruption by the I / O communication cycle timer. When the process is started, first, the presence or absence of an alarm bit is determined in the CN frame (step 1501). Only when there is an alarm bit (YES in step 1501), the content of the alarm bit is notified to the PLC (step 1502). ).
続いて、CNフレームメッセージ要求の有無が判定され(ステップ1503)、メッセージ要求ありの場合に限り(ステップ1503YES)、メッセージキューにその旨が登録される(ステップ1504)。
Subsequently, the presence or absence of a CN frame message request is determined (step 1503), and only when there is a message request (
続いて、メッセージキュー内に送信要求の有無か判定され(ステップ1505)、送信要求ありの場合に限り(ステップ1505YES)、メッセージ送信処理が実行される(ステップ1506)。
Subsequently, it is determined whether or not there is a transmission request in the message queue (step 1505), and only when there is a transmission request (
しかるのち、OUTフレームの作成処理(ステップ1507)、次の処理で使用するCNフレーム送信要求アドレスの作成処理(ステップ1508)、及びI/O通信サイクルタイマの起動処理(ステップ1509)を実行した後、OUTフレーム送信起動処理(ステップ1510)が実行される。 After that, after executing OUT frame creation processing (step 1507), CN frame transmission request address creation processing (step 1508) used in the next processing, and I / O communication cycle timer activation processing (step 1509). OUT frame transmission activation processing (step 1510) is executed.
図16に移って、ASIC802の側では、OUTフレームの送信処理が開始されると、スタートコードの送信処理(ステップ1601)、ファームウェアに設定されたコマンド、CNフレームの送信、並びに、要求アドレス、OUTデータの送信を行った後(ステップ1602)、CRCの送信処理(ステップ1603)を行い、送信処理を終了する。
Referring to FIG. 16, on the
I/O通信サイクル時のスレーブの処理(ASICによるI/Oサイクル処理)を示すフローチャートが図18に、I/O通信サイクル時のスレーブの処理(ファームウェアによるI/Oサイクルの処理)を示すフローチャートが図19にそれぞれ示されている。 FIG. 18 is a flowchart showing slave processing (I / O cycle processing by ASIC) in the I / O communication cycle. FIG. 18 is a flowchart showing slave processing (I / O cycle processing by firmware) in the I / O communication cycle. Are shown in FIG.
図18において、I/O通信サイクル処理が開始されると、OUTフレームの正常受信が判定され(ステップ1801)、異常受信と判定されると(ステップ1801NO)、通信エラー回数の加算処理が実行される(ステップ1802)。これに対して、OUTフレームが正常に受信された場合には(ステップ1801YES)、自機がOUTスレーブか或いはMIXスレーブかの判定が行われる(ステップ1803)。
In FIG. 18, when I / O communication cycle processing is started, normal reception of an OUT frame is determined (step 1801), and when abnormal reception is determined (NO in step 1801), communication error count addition processing is executed. (Step 1802). On the other hand, if the OUT frame is normally received (
ここで、肯定判定である場合には(ステップ1803YES)、OUT受信割込の発生処理(ステップ1804)が実行されるのに対して、否定判定である場合には(ステップ1803NO)、CNフレーム送信タイマの起動処理が実行される(ステップ1805)。続いて、自機がINスレーブ宛か或いはMIXスレーブ宛かの判定が行われる(ステップ1803)。
Here, when the determination is affirmative (
ここで、肯定判定である場合には(ステップ1806YES)、INフレーム送信タイマの起動処理(ステップ1807)が実行されるのに対して、否定判定の場合には(ステップ1806NO)、自局がCNフレーム要求アドレスであるか否かの判定が行われる(ステップ1808)。 Here, if the determination is affirmative (YES at step 1806), the IN frame transmission timer activation process (step 1807) is executed, whereas if the determination is negative (NO at step 1806), the local station determines that the CN is CN. A determination is made as to whether it is a frame request address (step 1808).
ここで、肯定判定の場合には(ステップ1808YES)、CNフレーム送信タイマのタイムアップを待って(ステップ1809YES)、CNフレーム送信処理(ステップ1810)が実行されるのに対して、否定判定の場合には(ステップ1808NO)、自機がINスレーブか或いはMIXスレーブかの判定が行われる(ステップ1811)。
Here, in the case of an affirmative determination (YES in step 1808), the CN frame transmission timer is timed up (YES in step 1809), and the CN frame transmission process (step 1810) is executed, whereas in the case of a negative determination (
ここで、肯定判定である場合には(ステップ1811YES)、INフレーム送信タイマのタイムアップを待って(ステップ1812YES)、INフレーム送信処理(ステップ1803)が実行されたのち、I/O通信サイクル処理は終了するのに対して、否定判定の場合には(ステップ1811NO)、直ちにI/O通信サイクル処理は終了する。 If the determination is affirmative (YES in step 1811), the IN frame transmission timer is awaited (YES in step 1812), and after the IN frame transmission process (step 1803) is executed, the I / O communication cycle process is performed. In contrast, if the determination is negative (NO in step 1811), the I / O communication cycle process is immediately terminated.
図19に示されるように、OUTフレームの受信割込においては、当該スレーブに対応するデータを読み出し(ステップ1901)、ASICのI/O出力レジスタに書き込む処理(ステップ1902)が実行される。また、INリフレッシュ処理においてはねASICのI/O入力レジスタの読み出し処理(ステップ1911)、INフレームの作成処理(ステップ1912)、及びINリフレッシュタイマの起動処理(ステップ1903)が実行される。 As shown in FIG. 19, in the OUT frame reception interrupt, data corresponding to the slave is read (step 1901) and written to the ASIC I / O output register (step 1902). In addition, in the IN refresh process, an ASIC I / O input register read process (step 1911), an IN frame creation process (step 1912), and an IN refresh timer start process (step 1903) are executed.
次に、以上説明した各フレーム並びにマスタ・スレーブの機能を使用して行われるマスタと各スレーブとの間におけるI/O通信サイクルによるデータ転送を時系列的に説明する。 Next, data transfer in the I / O communication cycle between the master and each slave performed using the above-described frame and master / slave functions will be described in time series.
[1]まず、マスタユニットがOUTフレームを生成し送信する。このとき、「CN_frame送信要求アドレス」にCNフレームの送信を要求するスレーブを指定する。スレーブの指定の方法については、本フィールドに書かれたアドレスのスレーブのみCNフレームを送信するのか、本フィールドに書かれたアドレスからある範囲のアドレスを持つ複数のスレーブがCNフレームを送信するのか、事前に決めておけばどちらでもよい。 [1] First, the master unit generates and transmits an OUT frame. At this time, a slave requesting transmission of a CN frame is designated in “CN_frame transmission request address”. Regarding the method of specifying the slave, whether the CN frame is transmitted only to the slave having the address written in this field, or whether a plurality of slaves having a range of addresses from the address written in this field transmit the CN frame, Either one is acceptable if it is determined in advance.
[2]OUTフレームを正常受信したOUTスレーブおよびMIXスレーブは「OUTデータ」内の自局に対応するデータを取り込む。 [2] The OUT slave and the MIX slave that have normally received the OUT frame take in the data corresponding to their own station in the “OUT data”.
[3]「CN_frame送信要求アドレス」にてCNフレームの送信要求を指示されたスレーブは、メッセージ送信要求の有無に関わらずCNフレームを返信する。メッセージの有無に関わらずCNフレームを返信することにより、マスタは当該アドレスのスレーブが接続されていることを確認することができる。複数のスレーブがCNフレームを返信する場合は、CNフレームが衝突しないようにINフレームと同様の方法で、各スレーブがCNフレームを送信するタイミングをずらす必要がある。 [3] "CN_frame transmission request address" slave instructed a transmission request for the CN frame in returns the CN frame regardless of the message transmission request. The master can confirm that the slave of the address is connected by returning the CN frame regardless of the presence or absence of the message. When a plurality of slaves return CN frames, it is necessary to shift the timing at which each slave transmits a CN frame in the same manner as the IN frame so that the CN frames do not collide.
[4]OUTフレームを正常受信したINスレーブおよびMIXスレーブは、事前に決められたINフレーム送信タイミングに従ってINフレームをマスタに送信する。 [4] The IN slave and the MIX slave that have normally received the OUT frame transmit the IN frame to the master in accordance with a predetermined IN frame transmission timing.
なお、マスタは、CN送信要求アドレスを順次変更してOUTフレームを送信することにより、すべてのスレーブのメッセージ送信要求の有無を確認することができる。 Note that the master can confirm the presence / absence of message transmission requests of all slaves by sequentially changing the CN transmission request address and transmitting the OUT frame.
以上説明したI/O通信サイクル時のマスタの処理フローが図15〜図17に、スレーブの処理フローが図18,19に、図15〜17に記載のメッセージキューの構造が図20に示されている。メッセージキューは、マスタおよびPLCからアクセス可能である。 15 to 17 show the processing flow of the master during the I / O communication cycle described above, FIGS. 18 and 19 show the processing flow of the slave, and FIG. 20 shows the structure of the message queue shown in FIGS. ing. The message queue is accessible from the master and the PLC.
次にメッセージ通信について説明する。メッセージ通信に使用するフレームの構造が図10に示されている。メッセージフレームは、フレームの開始を示す「スタート」1001と、メッセージフレームを示す「コマンド」1002と、当該メッセージフレームの宛先ノードを示す「宛先アドレス」1003と、当該メッセージフレームを送信したノードを示す「発信元アドレス」1004と、メッセージデータのデータ長を示す「レングス」1005と、メッセージ種に対応した「メッセージデータ」1006と、フレームの異常を検出するための「CRC」1007からなる。 Next, message communication will be described. The structure of the frame used for message communication is shown in FIG. The message frame includes a “start” 1001 indicating the start of the frame, a “command” 1002 indicating the message frame, a “destination address” 1003 indicating the destination node of the message frame, and a node indicating the node that transmitted the message frame “ “Source address” 1004, “Length” 1005 indicating the data length of the message data, “Message data” 1006 corresponding to the message type, and “CRC” 1007 for detecting a frame abnormality.
メッセージフレームには用途がいくつかあり、メッセージフレームの送信許可を行うフレーム、データを転送するためのイベントフレーム、メッセージデータを正常受信したことを示すACKフレーム、メッセージデータが受信できないことをしめすBUSYフレームなどがあり、これらの区別には、上記の「コマンド」フィールドを使用する。なお、「メッセージデータ」は必ずしもあるとは限らない。 There are several uses for message frames: frames that allow message frames to be transmitted, event frames for transferring data, ACK frames that indicate that message data has been received normally, and BUSY frames that indicate that message data cannot be received These are distinguished by using the “command” field described above. The “message data” is not always present.
メッセージフレームの「コマンド」フィールドを図14に示す。メッセージフレームは、図1に示されるI/O通信サイクルとは異なり、メッセージ通信サイクルと呼ばれる通信サイクルにて送受信される。通信サイクルとメッセージサイクルとの関係が図11に示されている。メッセージ通信サイクルは、マスタがメッセージを送信する場合またはスレーブがマスタに対してメッセージ通信を要求しマスタが許可する場合にのみ挿入される。 The “command” field of the message frame is shown in FIG. Unlike the I / O communication cycle shown in FIG. 1, the message frame is transmitted and received in a communication cycle called a message communication cycle. The relationship between the communication cycle and the message cycle is shown in FIG. The message communication cycle is inserted only when the master sends a message or when the slave requests message communication from the master and the master permits it.
まず、マスタからスレーブに対して最初にメッセージを送信する場合について説明する。先ほどのCNフレームの中にマスタからスレーブへのメッセージ通信を要求するメッセージ種が指定された場合、マスタはその重要度に応じて当該スレーブに対してメッセージ送信を行う。この場合のメッセージ通信の流れを以下に示す。 First, a case where a message is first transmitted from the master to the slave will be described. When a message type for requesting message communication from the master to the slave is specified in the previous CN frame, the master transmits a message to the slave according to its importance. The flow of message communication in this case is shown below.
[1]マスタは、「スタート」1001、イベントフレームを示す「コマンド」1002、メッセージ送信を要求してきたスレーブのアドレスを「宛先アドレス」1003、自局のアドレスを「発信元アドレス」1004、送信するメッセージデータ量に応じたデータ長を「レングス」1005、メッセージの内容を「メッセージデータ」1006、「CRC」1007を生成し、メッセージフレームを送信する。 [1] The master transmits “start” 1001, “command” 1002 indicating an event frame, “destination address” 1003 as the address of the slave that requested message transmission, and “source address” 1004 as the address of the local station. The data length corresponding to the message data amount is “length” 1005, the message content is “message data” 1006 and “CRC” 1007, and the message frame is transmitted.
[2]スレーブは、「宛先アドレス」1003により自局宛かどうか判断する。自局宛ではない場合、フレームを破棄する。 [2] The slave determines whether it is addressed to its own station based on “destination address” 1003. If it is not addressed to the local station, the frame is discarded.
[3]「宛先アドレス」1003により自局宛と判断したスレーブは、フレームが正常受信した場合は、「スタート」1001、ACKフレームを示す「コマンド」1002、マスタのアドレスを「宛先アドレス」1003、自局のアドレスを「送信元アドレス」1004、「CRC」1007をセットし、メッセージを送信する。フレームを正常受信できない場合は、「スタート」1001、BUSYフレームを示す「コマンド」1002、マスタのアドレスを「宛先アドレス」1003、自局のアドレスを「送信元アドレス」1004、データ長‘0’を「レングス」1005、適切な値を「CRC」1007にセットし、メッセージを送信する。 [3] A slave that is determined to be addressed to itself by “destination address” 1003 “start” 1001, “command” 1002 indicating an ACK frame, and “master address” “destination address” 1003 when the frame is normally received. The address of the own station is set to “source address” 1004 and “CRC” 1007, and the message is transmitted. If the frame cannot be normally received, “start” 1001, “command” 1002 indicating a BUSY frame, master address “destination address” 1003, own station address “source address” 1004, and data length “0” are set. Set "Length" 1005, appropriate value to "CRC" 1007, and send the message.
上記のマスタからスレーブに対してメッセージを送信する場合のメッセージサイクルが図12に示されている。図12に示されるように、1つのメッセージ通信サイクル内にて、複数のイベントフレームを送受信してもよい。 FIG. 12 shows a message cycle when a message is transmitted from the master to the slave. As shown in FIG. 12, a plurality of event frames may be transmitted and received within one message communication cycle.
次に、スレーブからマスタに対してメッセージ送信する場合について説明する。この場合のメッセージ通信の流れを以下に示す。 Next, a case where a message is transmitted from the slave to the master will be described. The flow of message communication in this case is shown below.
[1]マスタは、「スタート」1001、メッセージ送信許可フレームを示す「コマンド」1002、メッセージ送信許可を要求してきたスレーブのアドレスを「宛先アドレス」1003、自局のアドレスを「発信元アドレス」1004、データ長‘0’を「レングス」1005、適切な値を「CRC」1007にセットし、メッセージフレームを送信する。 [1] The master has a “start” 1001, a “command” 1002 indicating a message transmission permission frame, a “destination address” 1003 as the address of the slave that has requested the message transmission permission, and a “source address” 1004 as the address of the local station. The data length “0” is set to “length” 1005, the appropriate value is set to “CRC” 1007, and the message frame is transmitted.
[2]スレーブは、「宛先アドレス」1003により自局宛かどうか判断する。自局宛ではない場合、フレームを破棄する。 [2] The slave determines whether it is addressed to its own station based on “destination address” 1003. If it is not addressed to the local station, the frame is discarded.
[3]「宛先アドレス」1003により自局宛と判断したスレーブは、「スタート」1001、イベントフレームを示す「コマンド」1002、マスタのアドレスを「宛先アドレス」1003、送信元のマスタのアドレスを「発信元アドレス」1004、送信するメッセージデータ量に応じたデータ長を「レングス」1005、メッセージの内容を「メッセージデータ」1006、「CRC」1007をセットし、メッセージを送信する。 [3] The slave determined to be addressed to the own station by “destination address” 1003 is “start” 1001, “command” 1002 indicating an event frame, master address is “destination address” 1003, and transmission source master address is “ “Source address” 1004, data length corresponding to the amount of message data to be transmitted “length” 1005, message contents “message data” 1006, “CRC” 1007 are set, and the message is transmitted.
[4]マスタおよびスレーブは、「宛先アドレス」1003により自局宛かどうか判断する。自局宛ではない場合、フレームを破棄する。 [4] The master and the slave determine whether or not they are addressed to their own stations based on the “destination address” 1003. If it is not addressed to the local station, the frame is discarded.
[5]「宛先アドレス」1003により自局宛と判断したマスタは、フレームが正常受信した場合は、「スタート」1001、ACKフレームを示す「コマンド」1002、メッセージの送信元アドレスを「宛先アドレス」1003、自局のアドレスを「発信元アドレス」1004、「CRC」1007をセットし、メッセージを送信する。フレームを正常受信できない場合は、「スタート」1001、BUSYフレームを示す「コマンド」1002、メッセージの送信元アドレスを「宛先アドレス」1003、自局のアドレスを「発信元アドレス」1004、「CRC」1007をセットし、メッセージを送信する。 [5] A master that has been determined to be addressed to itself by “destination address” 1003 “start” 1001, “command” 1002 indicating an ACK frame, and “source address” as the message source address when the frame is normally received 1003, “Origin address” 1004 and “CRC” 1007 are set as the address of the own station, and the message is transmitted. If the frame cannot be received normally, “Start” 1001, “Command” 1002 indicating a BUSY frame, “Destination address” 1003 as the source address of the message, “Source address” 1004 as the address of the own station, and “CRC” 1007 Set and send a message.
上記のスレーブからマスタに対してメッセージを送信する場合のメッセージサイクルが図13に示されている。図13に示されているように、1つのメッセージ通信サイクル内にて、マスタは複数のメッセージ送信許可フレームを送信し、スレーブに対して複数のイベントフレームの送信を許可してもよい。 FIG. 13 shows a message cycle when a message is transmitted from the slave to the master. As shown in FIG. 13, within one message communication cycle, the master may transmit a plurality of message transmission permission frames and allow the slave to transmit a plurality of event frames.
本発明において、スレーブとマスタ間で、メッセージ通信が行われる具体的な例としては、次のものを挙げることかできる。 In the present invention, specific examples in which message communication is performed between a slave and a master include the following.
[1]スレーブに供給されている電源電圧をスレーブがモニタしており、モニタ値がある閾値を超えた場合に、スレーブはマスタに対して、電源電圧値異常のアラームをCNフレームを使用して通知する。この通知のみで電源異常は判断するシステムや、さらにマスタがスレーブに対してメッセージ通信許可フレームを送信し、メッセージ送信を許可されたスレーブは、具体的な電源電圧値をメッセージフレームを使用して、マスタに通知するシステムなどが考えられる。 [1] The slave monitors the power supply voltage supplied to the slave, and when the monitor value exceeds a certain threshold, the slave uses the CN frame to notify the master of an abnormal power supply voltage value. Notice. A system that judges power failure only by this notification, and further, the master sends a message communication permission frame to the slave, and the slave that is allowed to send a message uses the message frame to specify a specific power supply voltage value, A system that notifies the master can be considered.
[2]スレーブが、通信エラーの回数をモニタしており、モニタ値がある閾値を超えた場合に、スレーブはマスタに対して、通信異常多発のアラームをCNフレームを使用して通知する。この通知のみで通信異常は判断するシステムや、さらにマスタがスレーブに対してメッセージ通信許可フレームを送信し、メッセージ送信を許可されたスレーブは、具体的な発生回数をメッセージフレームを使用してマスタに通知するシステムなどが考えられる。 [2] The slave monitors the number of communication errors, and when the monitored value exceeds a certain threshold, the slave notifies the master of an alarm with frequent communication abnormalities using the CN frame. A system that determines a communication error based only on this notification, and the master sends a message communication permission frame to the slave, and the slave that is permitted to send a message uses the message frame to indicate the specific number of occurrences to the master. A system for notification may be considered.
具体的な例として、通信エラー回数を検出して、エラー回数を報告する場合の例を説明する。 As a specific example, an example in which the number of communication errors is detected and the number of errors is reported will be described.
[1]スレーブのファームウェアは、図18に示される「通信エラー回数」を定期的にモニタして、閾値が超えているか監視している。閾値を超えた場合は、CNフレームのアラームビットを設定する。 [1] The slave firmware periodically monitors the “communication error count” shown in FIG. 18 to see if the threshold is exceeded. If the threshold is exceeded, the alarm bit of the CN frame is set.
[2]図15に示されるように、マスタのファームウェアは、CNフレーム送信要求アドレスを逐次更新してOUTフレームを送信しているため、いずれCNフレーム送信要求アドレスフィールドに当該スレーブのアドレスを含むOUTフレームが送信される。 [2] As shown in FIG. 15, the master firmware sequentially updates the CN frame transmission request address and transmits the OUT frame, so that the OUT containing the slave address in the CN frame transmission request address field will be included. A frame is transmitted.
[3]図18及び図19に示すように、スレーブは、自局のアドレスがCNフレーム送信要求アドレスフィールドに含まれているため、[1]で設定したアラームビットを含むCNフレームを送信する。 [3] As shown in FIGS. 18 and 19, the slave transmits the CN frame including the alarm bit set in [1] because the address of the local station is included in the CN frame transmission request address field.
[4]図15〜図17に示されるように、マスタのASICは、受信したCNフレームのアラームの内容と、メッセージ送信要求の有無をASIC内のメモリ領域に格納しておく。 [4] As shown in FIGS. 15 to 17, the master ASIC stores the contents of the alarm of the received CN frame and the presence / absence of a message transmission request in a memory area in the ASIC.
[5]図15〜図17に示すように、次のI/O通信サイクルで、マスタのファームウェアはアラームのメッセージ内容を確認し、PLCに通信エラー回数が閾値を超えていることを報告する。 [5] As shown in FIGS. 15 to 17, in the next I / O communication cycle, the master firmware confirms the content of the alarm message and reports to the PLC that the number of communication errors exceeds the threshold.
[6]PLCのアプリケーションに依存するが、ここではさらに通信エラーの回数を読み出す場合について述べる。この場合、PLCはマスタに対して通信エラーの回数読み出しを指示する。 [6] Although it depends on the application of the PLC, here, a case where the number of communication errors is read will be described. In this case, the PLC instructs the master to read the number of communication errors.
[7]通信エラーの回数読み出しを指示されたマスタは、通信エラーの回数読み出し要求を意味するメッセージの送信要求を、メッセージキューに登録する。メッセージキューはI/O通信サイクル毎に実行されていくため、いずれ当該メッセージ要求は読み出される。 [7] The master that is instructed to read the communication error count registers a message transmission request in the message queue, which means a communication error count read request. Since the message queue is executed every I / O communication cycle, the message request is eventually read out.
[8]図15〜図17に示されるように、[7]で登録されたメッセージ要求が読み出された場合、マスタのファームウェアは、宛先に当該スレーブを、メッセージデータに当該メッセージを示すイベントフレームを作成し、メッセージを送信する。マスタのファームは、図12に示すようなメッセージ通信サイクルに必要な時間経過後、「OUTフレームの生成」処理に移る。 [8] As shown in FIGS. 15 to 17, when the message request registered in [7] is read, the master firmware sends an event frame indicating the slave as a destination and the message as message data. Create and send a message. After the time required for the message communication cycle as shown in FIG. 12 elapses, the master firmware shifts to “OUT frame generation” processing.
[9]通信エラーの回数読み出し要求を受信したスレーブのASICは、ACKフレームまたはBUSYフレームを返信し、イベントフレーム受信割り込みをファームウェアに通知する。 [9] The slave ASIC that has received the request to read the number of communication errors returns an ACK frame or a BUSY frame and notifies the firmware of an event frame reception interrupt.
[10]割り込みを受けたスレーブのファームウェアは、ASIC内の通信エラー回数を格納しているレジスタからデータを読み出し、その値を含んだイベントフレームを作成する。イベントフレームの作成が完了すると、メッセージ送信要求ありのCNフレームを設定する。 [10] The firmware of the slave that has received the interrupt reads the data from the register storing the number of communication errors in the ASIC, and creates an event frame including the value. When the creation of the event frame is completed, a CN frame with a message transmission request is set.
[11][2],[3],[4]と同様に、[10]で設定したCNフレームはいずれマスタのASIC内に格納される。 [11] Similar to [2], [3], and [4], the CN frame set in [10] will eventually be stored in the ASIC of the master.
[12]図15〜図17に示されるように、次のI/O通信サイクルで、マスタのファームウェアはスレーブからメッセージ送信要求があったことを認識し、メッセージ送信許可フレームを送信要求をメッセージキューに登録する。[7]と同様に、メッセージキューはI/O通信サイクル毎に実行されていくため、いずれ当該メッセージ要求は読み出される。 [12] As shown in FIGS. 15 to 17, in the next I / O communication cycle, the master firmware recognizes that there is a message transmission request from the slave and sends a message transmission permission frame to the message queue. Register with. Similar to [7], since the message queue is executed for each I / O communication cycle, the message request is eventually read out.
[13]図15〜図17に示されるように、[12]で登録されたメッセージ要求が読み出された場合、マスタのファームウェアは、宛先に当該スレーブを示すメッセージ送信許可フレームを作成し、メッセージを送信する。マスタのファームは、図13に示すようなメッセージ通信サイクルに必要な時間経過後、「OUTフレームの生成」処理に移る。 [13] As shown in FIGS. 15 to 17, when the message request registered in [12] is read, the master firmware creates a message transmission permission frame indicating the slave at the destination, Send. After the time required for the message communication cycle as shown in FIG. 13 has elapsed, the master firm proceeds to the “out frame generation” process.
[14]メッセージ送信許可フレームを受信したスレーブのASICは、項10で作成したイベントフレームを送信する。
[14] The slave ASIC that has received the message transmission permission frame transmits the event frame created in the
[15]イベントフレームを受信したマスタのASICは、ACKフレームまたはBUSYフレームを返信し、イベントフレーム受信割り込みをファームウェアに通知する。 [15] The master ASIC that has received the event frame returns an ACK frame or a BUSY frame, and notifies the firmware of an event frame reception interrupt.
[16]割り込みを受けたマスタのファームウェアはイベントフレーム中に含まれる通信エラー回数をPLCに通知する。 [16] The master firmware that has received the interrupt notifies the PLC of the number of communication errors included in the event frame.
本発明によれば、マスタからスレーブに出力データを一括して1つのOUTフレームで転送し、スレーブは決められた時間帯に入力データを含むINフレームをそれぞれ返送するようにした転送効率のよい通信方法を維持しつつも、スレーブが能動的にマスタに対してデータを送信する手段を提供することが可能となり、これを利用すれば、この種のPLCシステムにおける応答性乃至機能性を向上させることができる。 According to the present invention, the output data is transferred from the master to the slave in one OUT frame, and the slave returns the IN frame including the input data in a predetermined time zone. While maintaining the method, it is possible to provide a means for the slave to actively transmit data to the master, and this can be used to improve the responsiveness or functionality in this type of PLC system. Can do.
1 PLC
2 I/Oターミナル
3 PC
4 中継局
5 終端装置
6 バス型ネットワーク
10 通信マスタユニット
20 CPUユニット
801 通信I/F
802 マスタ用ASIC
803 RAM
804 内部バスI/F
805 EEPROM
806 CPU
807 LED表示
808 設定SW
901 通信I/F
902 スレーブ用ASIC
903 I/O部
904 電源
905 MPU
906 設定SW
907 LED表示
908 EEPROM
1 PLC
2 I / O terminal 3 PC
4 Relay station 5
802 ASIC for master
803 RAM
804 Internal bus I / F
805 EEPROM
806 CPU
807
901 Communication I / F
902 Slave ASIC
903 I /
906 Setting SW
907
Claims (3)
マスタは、OUTフレームにて動作状況を確認したい単数または複数のスレーブを指定して出力データとともに一括して送信し、OUTフレームで指定されたスレーブは、応答フレームを前記決められた時間帯とは別の時間帯にそれぞれ返送し、
前記応答フレームには、当該スレーブからのメッセージ通信要求の有無を示す情報と、メッセージ内容を示す情報とが含まれ、
前記メッセージ内容は、前記スレーブに供給される電源の電圧の異常検出の有無に関する情報、及び/又は、前記スレーブで検出された通信エラー回数の累積値が所定の閾値を超えたか否かに関する情報、であることを特徴とするPLCシステムの通信方法。 A plurality of slaves are I / O terminals with a master communication function is a programmable controller having a communication function is connected to the field bus, to collectively output data from the master to the slave transferred by one OUT frames, wherein The slave is a communication method of the PLC system in which each IN frame including input data is returned at a predetermined time zone.
The master designates one or more slaves whose operation status is to be confirmed in the OUT frame and transmits them together with the output data, and the slave designated in the OUT frame defines a response frame as the predetermined time zone. Return them at different times ,
The response frame includes information indicating the presence / absence of a message communication request from the slave, and information indicating the message content,
The message content is information on whether or not an abnormality is detected in the voltage of the power supply supplied to the slave, and / or information on whether or not the cumulative value of the number of communication errors detected by the slave exceeds a predetermined threshold, communication method PLC system characterized in that it.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005252758A JP4458279B2 (en) | 2005-08-31 | 2005-08-31 | Programmable controller system communication method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005252758A JP4458279B2 (en) | 2005-08-31 | 2005-08-31 | Programmable controller system communication method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007066111A JP2007066111A (en) | 2007-03-15 |
| JP4458279B2 true JP4458279B2 (en) | 2010-04-28 |
Family
ID=37928207
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005252758A Expired - Fee Related JP4458279B2 (en) | 2005-08-31 | 2005-08-31 | Programmable controller system communication method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4458279B2 (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| DE102007016917B4 (en) * | 2007-04-05 | 2009-12-17 | Phoenix Contact Gmbh & Co. Kg | Method and system for the secure transmission of cyclic process data to be transmitted |
| JP5510275B2 (en) | 2010-11-08 | 2014-06-04 | 株式会社デンソー | Communication system, master node, slave node |
| JP5510286B2 (en) | 2010-11-19 | 2014-06-04 | 株式会社デンソー | Communication system, node |
| WO2013150602A1 (en) * | 2012-04-02 | 2013-10-10 | 株式会社エニイワイヤ | Transmission error detection scheme, and slave station terminal using said scheme |
| JPWO2013150602A1 (en) * | 2012-04-02 | 2015-12-14 | 株式会社 エニイワイヤ | Transmission error detection method and slave station terminal used for that method |
-
2005
- 2005-08-31 JP JP2005252758A patent/JP4458279B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2007066111A (en) | 2007-03-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN1881120B (en) | Control method at startup of communication master station | |
| EP2455832B1 (en) | Programmable controller | |
| CN101960789B (en) | There is the communication system of CAN and for the method running this communication system | |
| JP5250047B2 (en) | Data transmission method in network | |
| CN110099402B (en) | Wireless IO link communication network with additional master and method of operation of the wireless IO link communication network | |
| US8230146B2 (en) | Communication method and master-slave system for a field bus configured according to the AS-interface standard | |
| US7792155B2 (en) | Communication system and slave and repeater units therefor | |
| KR101179431B1 (en) | Network Management System based on a EhterCAT And Managing Method thereof | |
| CN102843238A (en) | Energy saving in network node of automation network | |
| CN110268393A (en) | Communication device, communication method, program, and communication system | |
| JP4458279B2 (en) | Programmable controller system communication method | |
| CN110320829A (en) | Safety control system and security control unit | |
| JPH1041964A (en) | Programmable controller network system | |
| JP2004280304A (en) | Fieldbus system and communication method, and master and slave | |
| JP4458278B2 (en) | Communication cycle control method | |
| JP4623291B2 (en) | Method for teaching network configuration information in PLC system | |
| JP2004274395A (en) | Dual address detection method, slave, master, and field bus in field bus system | |
| CN102098837B (en) | Lighting control system | |
| CN110687854A (en) | PA bus controller and PA bus control system | |
| JP4407838B2 (en) | Communication master station startup control method | |
| JP4360888B2 (en) | File writing system | |
| JPH10232704A (en) | Redundant programmable controller | |
| CN114788248B (en) | Method and system for cyclically transmitting data between communication participants on a data transmission channel | |
| JP2004274396A (en) | Fieldbus system, connection confirmation method, master and slave | |
| KR100567033B1 (en) | Synchronous serial communication method with fixed master and slave |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080222 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091001 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091021 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091221 |
|
| 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: 20100120 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4458279 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100202 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130219 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140219 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |