JP2008084343A - Programmable controller and communication unit - Google Patents

Programmable controller and communication unit Download PDF

Info

Publication number
JP2008084343A
JP2008084343A JP2007324385A JP2007324385A JP2008084343A JP 2008084343 A JP2008084343 A JP 2008084343A JP 2007324385 A JP2007324385 A JP 2007324385A JP 2007324385 A JP2007324385 A JP 2007324385A JP 2008084343 A JP2008084343 A JP 2008084343A
Authority
JP
Japan
Prior art keywords
driver
data
internal bus
plc
ethernet
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.)
Granted
Application number
JP2007324385A
Other languages
Japanese (ja)
Other versions
JP2008084343A5 (en
JP4671056B2 (en
Inventor
Tadashi Motosugi
匡史 本杉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2007324385A priority Critical patent/JP4671056B2/en
Publication of JP2008084343A publication Critical patent/JP2008084343A/en
Publication of JP2008084343A5 publication Critical patent/JP2008084343A5/ja
Application granted granted Critical
Publication of JP4671056B2 publication Critical patent/JP4671056B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a programmable controller capable of transmitting and receiving data between devices connected to different networks without using an dedicated protocol. <P>SOLUTION: A CPU unit comprises a TCP/IP application group 21, a transport layer protocol stack 22 and an IP protocol stack 23 having a routing function, and a driver 26 for an internal bus is connected to the IP protocol stack 23. A communication unit comprises a TCP/IP application group 31, a transport layer protocol stack 32, an IP protocol stack 33 having no routing function, an Ethernet driver 34 and an Ethernet interface 35, and a driver 36 for an internal bus is connected to the Ethernet driver 34. The Ethernet driver 34 comprises a sorting function of transferring data transferred from the Ethernet interface 35, to the driver 36 and/or the IP protocol stack 33. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

この発明は、プログラマブルコントローラおよび通信ユニットに関するものである。   The present invention relates to a programmable controller and a communication unit.

FA(Factory Automation)におけるネットワークシステムは、生産設備の制御を司る1または複数のプログラマブルコントローラ(PLC)と、そのPLCにより動作が制御される機器とが、制御系のネットワークに接続される。それらPLCと機器は、その制御系のネットワークを介してサイクリックに通信を行なうことで、入力データ(INデータ)および出力データ(OUTデータ)の送受を行ない、生産設備を制御する。より具体的には、PLCは、複数のユニットが内部バス構造で接続されて、一体連結されてなる。ユニットの種類には、例えば、各ユニットに電源供給する電源ユニット、制御を司るCPUユニット、センサ等の入力機器が接続されてそこから入力データを得る入力ユニット、動作対象の出力機器が接続されてそこへ出力データを出力する出力ユニット、ネットワークを経由して外部装置と各種データを送受信する通信ユニット、リモートターミナル装置との間で配線を経由してINデータとOUTデータを送受信するマスタユニットなどがある。CPUユニットは、内部バスを経由して他のユニットとの間でデータ通信することで、制御に必要なデータを取込み、出力している。CPUユニットの具体的な動作を説明すると、まず、オン・オフ動作をするセンサやスイッチなどの単数または複数の入力機器からON/OFFの入力データを制御系のネットワークを介して取り込み(INリフレッシュ処理)、その入力データに基づいて論理演算し(演算実行処理)、その演算結果の出力データを制御系のネットワークを介してモータやアクチュエータなどの出力機器に出力する(出力リフレッシュ処理)。このINリフレッシュ処理、演算実行処理、OUTリフレッシュ処理をサイクリックに実行する。そしてPLCが、CPUユニットの演算結果であるところの出力データをOUTリフレッシュにより出力ユニットへ伝え、その出力データが出力ユニットから機器へ出力されることにより、生産設備の機器を制御する。   In a network system in FA (Factory Automation), one or a plurality of programmable controllers (PLCs) that control production facilities and devices whose operations are controlled by the PLCs are connected to a control system network. These PLCs and devices communicate with each other cyclically via the control system network to transmit and receive input data (IN data) and output data (OUT data), thereby controlling production facilities. More specifically, the PLC is formed by integrally connecting a plurality of units connected by an internal bus structure. The type of unit includes, for example, a power supply unit that supplies power to each unit, a CPU unit that performs control, an input device such as a sensor and an input unit that obtains input data therefrom, and an output device that is an operation target. An output unit that outputs output data there, a communication unit that transmits / receives various data to / from an external device via a network, a master unit that transmits / receives IN data and OUT data via a wiring to / from a remote terminal device, etc. is there. The CPU unit takes in and outputs data necessary for control by performing data communication with other units via the internal bus. The specific operation of the CPU unit will be described. First, ON / OFF input data is fetched from a single or a plurality of input devices such as sensors and switches that perform on / off operations via a control system network (IN refresh processing). ), Logical operation is performed based on the input data (calculation execution process), and output data of the calculation result is output to an output device such as a motor or an actuator via the control system network (output refresh process). The IN refresh process, calculation execution process, and OUT refresh process are cyclically executed. Then, the PLC transmits the output data, which is the calculation result of the CPU unit, to the output unit by OUT refresh, and the output data is output from the output unit to the equipment, thereby controlling the equipment of the production facility.

係る生産設備の制御を行なう制御系のシステムの上位に、主として生産指示や生産結果のような生産管理情報を扱う情報系のシステムを接続し、その情報系のシステムに連携される管理コンピュータが、制御系のネットワークに接続されたPLCその他の機器と通信を行ない、PLC等に対する設定をしたり、PLC等から送られてくる情報を取得したりする。制御系のシステムと情報系のシステムとの接続は、制御系に接続されたPLCを情報系システムのネットワークに接続したり、制御系のシステムのネットワークと、情報系のシステムのネットワークとの間にデータ送信の中継をする装置(PLC等)を設置したりすることで実現する。   An information system that mainly handles production management information such as production instructions and production results is connected to a higher level of the control system that controls the production facility, and a management computer linked to the information system is It communicates with PLCs and other devices connected to the control system network, and makes settings for the PLC and the like, and acquires information sent from the PLC and the like. The connection between the control system and the information system is made by connecting the PLC connected to the control system to the information system network, or between the control system network and the information system network. This is realized by installing a device (PLC or the like) that relays data transmission.

従って、管理コンピュータが、制御系システムのネットワークのみに接続されたPLCや、その他の機器とデータの送受を行なう場合、たとえば特許文献1に示すように係る処理を実行可能とする専用のプロトコルのコマンドを用いる。
特開平6−231113号公報
Therefore, when the management computer performs data transmission / reception with a PLC or other equipment connected only to the network of the control system, for example, a command of a dedicated protocol that can execute the processing as shown in Patent Document 1 Is used.
JP-A-6-231113

特許文献1等に開示された専用のプロトコルのコマンドを用いることで、管理コンピュータは、管理コンピュータが接続されているネットワークと異なるネットワークに接続されたPLC等とデータの送受を行なうことができる。しかしながら、係る処理を行なうためには、上記の専用のプロトコルに対応したPLC等を用いてネットワークシステムを構築する必要がある。通常、係る専用のプロトコルは、PLC等の製造メーカが独自に開発する。その結果、製造メーカが異なったPLC等が混在するネットワークシステムでは、上記の専用のプロトコルをすべての機器に共通して使用することができない。   By using a dedicated protocol command disclosed in Patent Document 1 or the like, the management computer can send and receive data to and from a PLC or the like connected to a network different from the network to which the management computer is connected. However, in order to perform such processing, it is necessary to construct a network system using a PLC or the like corresponding to the dedicated protocol. Usually, such a dedicated protocol is independently developed by a manufacturer such as a PLC. As a result, in a network system in which PLCs or the like having different manufacturers are mixed, the dedicated protocol cannot be used in common for all devices.

この発明の目的は、専用のプロトコルを用いることなく、互いに異なるネットワークに接続された装置(コンピュータ,PLC等)同士であってもデータの送受を行なうことができるプログラマブルコントローラおよび通信ユニットを提供することにある。   An object of the present invention is to provide a programmable controller and a communication unit that can transmit and receive data even between devices (computers, PLCs, etc.) connected to different networks without using a dedicated protocol. It is in.

この発明によるプログラマブルコントローラは、CPUユニットと通信ユニットとを内部バスで接続したプログラマブルコントローラであって、前記CPUユニットは、上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、ルーティング機能を有するインターネット層と、イーサネットドライバと、イーサネットインタフェースとを備えるとともに、前記インターネット層に第1の内部バス用のドライバを接続するように構成し、前記イーサネットドライバまたは第1の内部バス用ドライバから転送されてきたデータを、前記インターネット層にてルーティング処理し、ルーティング処理結果に基づきデータを前記トランスポート層及びまたは第1の内部バス用ドライバへ転送するものであり、前記通信ユニットは、上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、インターネット層と、イーサネットドライバと、イーサネットインタフェースと、を備えるとともに、前記イーサネットドライバに第2の内部バス用のドライバを接続するように構成し、前記イーサネットドライバは、第2の内部バス用のドライバから転送されてきたデータを前記イーサネットインタフェースに転送する機能と、前記イーサネットインタフェースから転送されてきたデータを、そのデータのプロトコルヘッダ部を解析し、その内容によって第2の内部バス用のドライバ及びまたは前記インターネット層に転送する振り分け機能とを備えた。   A programmable controller according to the present invention is a programmable controller in which a CPU unit and a communication unit are connected by an internal bus, and the CPU unit, in order from the upper level, conforms to the TCP / IP protocol, an application layer, a transport layer, An Internet layer having a routing function, an Ethernet driver, and an Ethernet interface, and configured to connect a driver for a first internal bus to the Internet layer, for the Ethernet driver or the first internal bus The data transferred from the driver is routed in the Internet layer, and the data is transferred to the transport layer and / or the first internal bus driver based on the routing processing result. The communication unit includes, in order from the top, an application layer, a transport layer, an Internet layer, an Ethernet driver, and an Ethernet interface that comply with the TCP / IP protocol. The Ethernet driver is configured to connect a bus driver, and the Ethernet driver has a function of transferring data transferred from the second internal bus driver to the Ethernet interface, and data transferred from the Ethernet interface. And a distribution function for analyzing the protocol header portion of the data and transferring it to the second internal bus driver and / or the Internet layer according to the contents.

本発明では、ルーティング機能をCPUユニットに設けた。これにより、通信ユニットにルーティング機能を備える必要がないので、ルーティングテーブル等が不要で簡易な構成とすることができる。そして、通信ユニットのイーサネットドライバに振り分け機能を設けたため、通信ユニットは、イーサネットインタフェースから受信したデータをCPUユニット側に転送することができる。また、CPUユニットは、内部バスを介して転送されてきたデータおよびCPUユニット自体のイーサネットインタフェースを介して受信したデータをインターネット層でルーティング処理し、CPUユニット宛なら上位のアプリケーション層側に転送し、必要な処理をすることができ、また、CPUユニット以外の宛先ならデータを内部バスを介して通信ユニットに転送することができる。通信ユニットは、内部バスを介して転送されて来たデータをネットワークに転送することもするので、CPUユニットはその通信ユニットに接続されたネットワークと同一のネットワークに接続されているPLCその他の機器等との間でデータの送受を行なうことができる。つまり、係るPLCその他の機器等は、直接接続されていないCPUユニットのアプリケーション層のアプリケーションをイーサネットを経由して利用できる。しかも、係るデータの送受は、汎用のTCP/IPプロトコルを用いて行なうことができる。   In the present invention, the routing function is provided in the CPU unit. Thereby, since it is not necessary to provide a routing function in a communication unit, a routing table etc. are unnecessary and it can be set as a simple structure. Since the distribution function is provided in the Ethernet driver of the communication unit, the communication unit can transfer the data received from the Ethernet interface to the CPU unit side. In addition, the CPU unit performs routing processing in the Internet layer for data transferred via the internal bus and data received via the Ethernet interface of the CPU unit itself, and if it is addressed to the CPU unit, transfers it to the upper application layer side. Necessary processing can be performed, and if the destination is other than the CPU unit, the data can be transferred to the communication unit via the internal bus. Since the communication unit also transfers the data transferred via the internal bus to the network, the CPU unit is connected to the same network as that connected to the communication unit. Can send and receive data to and from. That is, the PLC and other devices can use the application layer application of the CPU unit that is not directly connected via the Ethernet. Moreover, such data transmission / reception can be performed using a general-purpose TCP / IP protocol.

この発明によるプログラマブルコントローラは、CPUユニットと複数の通信ユニットとを内部バスで接続したプログラマブルコントローラであって、前記CPUユニットは、上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、ルーティング機能を有するインターネット層と、内部バス用のドライバとを備えるとともに、前記インターネット層に第1の内部バス用のドライバを接続するように構成し、第1の内部バス用ドライバから転送されてきたデータを、前記インターネット層にてルーティング処理し、ルーティング処理結果に基づきデータを前記トランスポート層及びまたは送信先の通信ユニット宛てに第1の内部バス用ドライバへ転送するものであり、前記複数の通信ユニットのそれぞれは、上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、インターネット層と、イーサネットドライバと、イーサネットインタフェースと、を備えるとともに、前記イーサネットドライバに第2の内部バス用ドライバを接続するように構成し、前記イーサネットドライバは、第2の内部バス用ドライバから転送されてきたデータを前記イーサネットインタフェースに転送する機能と、前記イーサネットインタフェースから転送されてきたデータを、そのデータのプロトコルヘッダ部を解析し、その解析内容によって第2の内部バス用ドライバ及びまたは前記インターネット層に転送する振り分け機能とを備えた。   A programmable controller according to the present invention is a programmable controller in which a CPU unit and a plurality of communication units are connected by an internal bus. The CPU unit, in order from the top, conforms to a TCP / IP protocol, an application layer, a transport A layer, an Internet layer having a routing function, and a driver for an internal bus, and configured to connect a driver for the first internal bus to the Internet layer, and transfer from the driver for the first internal bus The data that has been routed in the Internet layer, and based on the routing processing result, the data is transferred to the transport layer and / or the destination communication unit to the first internal bus driver, That of multiple communication units This includes, in order from the top, an application layer, a transport layer, an Internet layer, an Ethernet driver, and an Ethernet interface that comply with the TCP / IP protocol, and the Ethernet driver is provided for a second internal bus. The Ethernet driver is configured to connect a driver, and the Ethernet driver has a function of transferring the data transferred from the second internal bus driver to the Ethernet interface, and the data transferred from the Ethernet interface And a distribution function for transferring to the second internal bus driver and / or the Internet layer according to the analysis contents.

複数の通信ユニットの転送機能と、CPUユニットのルーティング機能により、複数の通信ユニット相互の間で、CPUユニットを経由してデータの転送が行える。これにより、一方の通信ユニットが接続されたネットワーク上の装置・機器等と、他方の通信ユニットが接続されたネットワーク上の装置・機器等とは、汎用のTCP/IPプロトコルを用いてデータの送受を行なうことができる。通信ユニットの個数は、3個以上でも良い。また、前記通信ユニットに、自ユニットのアプリケーション層が利用可能なポート番号の範囲を設定しておき、通信ユニットにおける振り分け機能は、受け取ったデータの宛先ポート番号と上記範囲から転送先を決定するものとしてよもよい。つまり、受け取ったデータの宛先ポート番号と上記範囲とを比べ、自ユニットのポート番号なら自ユニットのアプリケーション層に振り分け、それ以外のポート番号なら内部バスドライバまたはイーサネットドライバへ転送し、内部バスまたはイーサネットへ転送配信する。   With the transfer function of the plurality of communication units and the routing function of the CPU unit, data can be transferred between the plurality of communication units via the CPU unit. As a result, devices / devices on the network to which one communication unit is connected and devices / devices on the network to which the other communication unit is connected can send and receive data using a general-purpose TCP / IP protocol. Can be performed. The number of communication units may be three or more. In addition, a range of port numbers that can be used by the application layer of the own unit is set in the communication unit, and the distribution function in the communication unit determines the transfer destination from the destination port number of the received data and the above range. It's also good. In other words, the destination port number of the received data is compared with the above range. If the port number of the local unit is assigned, it is distributed to the application layer of the local unit, otherwise it is transferred to the internal bus driver or Ethernet driver, Deliver to and deliver.

本発明に係る通信ユニットは、内部バスを有し、CPUユニットが内部バスに接続されたプログラマブルコントローラに対して、連結するとともにその内部バスに接続する通信ユニットであって、上位から順に、アプリケーション層と、トランスポート層と、インターネット層と、イーサネットドライバと、イーサネットインタフェースと、を備えるとともに、イーサネットドライバに、内部バス用のドライバを接続するように構成する。そして、イーサネットドライバは、内部バス用のドライバから転送されてきたデータはイーサネットインタフェースに転送する機能と、イーサネットインタフェースから転送されてきたデータは、そのデータのプロトコルヘッダ部を解析し、その内容によって内部バス用のドライバ及びまたはインターネット層に転送する振り分け機能とを備えるようにした。   A communication unit according to the present invention is a communication unit having an internal bus, and a CPU unit connected to and connected to a programmable controller connected to the internal bus. A transport layer, an Internet layer, an Ethernet driver, and an Ethernet interface, and a driver for an internal bus is connected to the Ethernet driver. The Ethernet driver has a function to transfer the data transferred from the driver for the internal bus to the Ethernet interface, and the data transferred from the Ethernet interface analyzes the protocol header part of the data, A bus driver and / or a distribution function for transferring to the Internet layer are provided.

本発明では、CPUユニットに実装されたインターネット層のルーティング機能と、通信ユニットに実装されたイーサネットドライバの振り分け機能により、CPUユニットに接続されず、通信ユニットに接続された装置・機器がCPUユニットに対して汎用のプロトコルを用いてアクセスできる。また、プログラマブルコントローラが複数のネットワークに接続されている場合、互いに異なるネットワークに接続された装置(コンピュータ,PLC等)同士であっても本発明のプログラマブルコントローラを経由して汎用のプロトコルを用いてデータの送受を行なうことができる。   In the present invention, by the routing function of the Internet layer mounted on the CPU unit and the distribution function of the Ethernet driver mounted on the communication unit, the device / equipment connected to the communication unit is not connected to the CPU unit. On the other hand, it can be accessed using a general-purpose protocol. In addition, when the programmable controller is connected to a plurality of networks, even if the devices (computer, PLC, etc.) are connected to different networks, data can be transmitted using a general-purpose protocol via the programmable controller of the present invention. Can be sent and received.

図1は、本発明のPLCを含むネットワークシステムの一例を示している。このネットワークシステムは、複数のネットワークに、パソコン,PLC,その他の機器等が接続されている。第1ネットワーク10には、パソコン11と、第1PLC12とが接続されている。第1PLC12は、第2ネットワーク13にも接続される。この第2ネットワーク13には、第2PLC16と、第3PLC17と、リモートIO18とが接続される。もちろん、各ネットワーク10,13には、図示した装置以外の装置も適宜接続され、FAにおける生産管理・制御システムが構築される。なお、リモートIO18は、入力機器のみを接続する入力タイプ、出力機器のみを接続する出力タイプ、入力機器および出力機器を接続する入出力タイプがある。また、PLCのマスタユニットとの間でフィールドバスといわれる独自の回線を経由してデータ通信するタイプ(図示せず)と、PLCの通信ユニットとの間でネットワークを経由してデータ通信するタイプ(図示のもの)とがある。各PLCはINリフレッシュ処理、演算実行処理、OUTリフレッシュ処理をサイクリックに実行するもので、特に第2PLC16と第3PLC17は図示しない生産設備の機器を制御するものである。   FIG. 1 shows an example of a network system including a PLC according to the present invention. In this network system, a personal computer, a PLC, and other devices are connected to a plurality of networks. A personal computer 11 and a first PLC 12 are connected to the first network 10. The first PLC 12 is also connected to the second network 13. The second PLC 16, the third PLC 17, and the remote IO 18 are connected to the second network 13. Of course, devices other than the devices shown in the figure are appropriately connected to the networks 10 and 13, and a production management / control system in the FA is constructed. The remote IO 18 includes an input type that connects only input devices, an output type that connects only output devices, and an input / output type that connects input devices and output devices. In addition, a type (not shown) for data communication with a PLC master unit via a unique line called a field bus and a type for data communication with a PLC communication unit via a network (not shown) As shown). Each PLC cyclically executes an IN refresh process, an operation execution process, and an OUT refresh process. In particular, the second PLC 16 and the third PLC 17 control equipment of a production facility (not shown).

第1ネットワーク10は、主として生産指示や生産結果のような生産管理情報を扱う情報系ネットワークである。その第1ネットワーク10に接続されたパソコン11は、管理コンピュータであり、ネットワークシステムに接続された機器に対する設定を行なったり、装置等から送られてくる情報を取得したりする。第2ネットワーク13は、生産設備の制御を行なうための制御系ネットワークである。その第2ネットワーク13に接続された生産設備の制御を司る第2PLC16及び第3PLC17と、リモートIO18とは、第2ネットワーク13を介してサイクリックに通信を行ない、リモートIO18を経由してリモートIO18に接続された入出力機器のIOデータの送受を行なう。各ネットワーク10,13は、何れもイーサネット(EtherNet・登録商標)で実現される。これに伴い、各ネットワーク10,13に接続されるパソコン,PLCその他の機器は、イーサネットに接続可能な通信インタフェースを備える。   The first network 10 is an information network that mainly handles production management information such as production instructions and production results. The personal computer 11 connected to the first network 10 is a management computer, and makes settings for devices connected to the network system, and acquires information sent from the device or the like. The second network 13 is a control system network for controlling production facilities. The second PLC 16 and the third PLC 17 that control the production equipment connected to the second network 13 and the remote IO 18 communicate cyclically via the second network 13, and communicate with the remote IO 18 via the remote IO 18. The IO data of the connected input / output device is transmitted / received. Each of the networks 10 and 13 is realized by Ethernet (EtherNet (registered trademark)). Accordingly, personal computers, PLCs, and other devices connected to the networks 10 and 13 each have a communication interface that can be connected to Ethernet.

第1PLC12は、CPUユニット20と通信ユニット30とを備えている。もちろん、この第1PLC12は、図示省略する他のユニットも備えている。CPUユニット20は、電子メールクライアント、FTPサーバ、IPルーティングなどのTCP/IPアプリを内蔵し、第1ネットワーク10に接続されてパソコン11とメッセージデータの交換を行なう。つまり、パソコン11は、電子メールサーバやFTPクライアント等として機能する。通信ユニット20は、サイクリック通信機能を持ち、第2ネットワーク13に接続され、第2PLC16,第3PLCPLC17,リモートIO18等との間でIOデータの交換を行う。   The first PLC 12 includes a CPU unit 20 and a communication unit 30. Of course, the first PLC 12 also includes other units not shown. The CPU unit 20 has a built-in TCP / IP application such as an e-mail client, FTP server, and IP routing, and is connected to the first network 10 to exchange message data with the personal computer 11. That is, the personal computer 11 functions as an e-mail server, an FTP client, or the like. The communication unit 20 has a cyclic communication function, is connected to the second network 13, and exchanges IO data with the second PLC 16, the third PLCPLC 17, the remote IO 18, and the like.

第2PLC16及び第3PLC17も、TCP/IPアプリを内蔵するCPUユニット20と、サイクリック通信機能を持つ通信ユニット30とを備えている。これらのPLC16,17も図示省略する他のユニットを備えている。なお、図1に示すネットワークシステムの場合、各PLCの通信ユニット30並びに第1PLC12のCPUユニット20は、イーサネットに接続可能な通信インタフェースを備える。第2PLC16と第3PLC17のCPUユニット20も、イーサネットに接続可能な通信インタフェースを備えてもよい。   The second PLC 16 and the third PLC 17 also include a CPU unit 20 containing a TCP / IP application and a communication unit 30 having a cyclic communication function. These PLCs 16 and 17 are also provided with other units not shown. In the case of the network system shown in FIG. 1, the communication unit 30 of each PLC and the CPU unit 20 of the first PLC 12 include a communication interface that can be connected to Ethernet. The CPU units 20 of the second PLC 16 and the third PLC 17 may also include a communication interface that can be connected to Ethernet.

図2は、PLCを構成するCPUユニット20と通信ユニット30とにおけるデータを送受信する機能の内部構成を示している。本実施形態のユニット20,30は、データを送受信するためのプロトコルとして、ネットワークの標準プロトコルであるTCP/IPに対応させている。   FIG. 2 shows an internal configuration of a function for transmitting and receiving data between the CPU unit 20 and the communication unit 30 constituting the PLC. The units 20 and 30 of the present embodiment correspond to TCP / IP, which is a standard network protocol, as a protocol for transmitting and receiving data.

CPUユニット20は、上位から順に、アプリケーション層であるPLC用TCP/IPアプリ群21と、トランスポート層であるPLC用トランスポート層プロトコルスタック22と、インターネット層であるPLC用IPプロトコルスタック23と、リンク層であるイーサネットドライバ24,イーサネットインタフェース25と、を備える。さらに、CPUユニット20は、PLCの内部バス40に接続され、PLC内のユニット間でのデータ転送を行なうドライバ26(第1の内部バス用ドライバ)を備えている。このドライバ26は、PLC用IPプロトコルスタック23の下位に接続される。   The CPU unit 20 includes, in order from the top, a PLC TCP / IP application group 21 that is an application layer, a PLC transport layer protocol stack 22 that is a transport layer, a PLC IP protocol stack 23 that is an Internet layer, The Ethernet driver 24 and the Ethernet interface 25 which are link layers are provided. Further, the CPU unit 20 includes a driver 26 (first internal bus driver) that is connected to the PLC internal bus 40 and performs data transfer between the units in the PLC. The driver 26 is connected to a lower level of the PLC IP protocol stack 23.

PLC用トランスポート層プロトコルスタック22は、TCPプロトコルスタックとUDPプロトコルスタックを含む。PLC用IPプロトコルスタック23は、配下の通信インタフェースとしてイーサネットドライバ24を通じてイーサネットインタフェース25が接続され、また、ドライバ26を通じて、後述する通信ユニット30内のイーサネットインタフェース35が接続されているものとして動作する。   The transport layer protocol stack 22 for PLC includes a TCP protocol stack and a UDP protocol stack. The PLC IP protocol stack 23 operates as if the Ethernet interface 25 is connected through the Ethernet driver 24 as a subordinate communication interface, and the Ethernet interface 35 in the communication unit 30 described later is connected through the driver 26.

PLC用IPプロトコルスタック23は、ルーティング機能を持つ。よって、PLC用IPプロトコルスタック23は、IPルーティングを要求するパケット、すなわち、「自MACアドレスかつ他IPアドレス」宛のパケットを受信した場合、IPルーティングテーブルに従い転送する。   The PLC IP protocol stack 23 has a routing function. Therefore, when receiving a packet requesting IP routing, that is, a packet addressed to “the own MAC address and another IP address”, the IP protocol stack for PLC 23 transfers the packet according to the IP routing table.

一例を示すと、IPルーティングテーブルが、図3に示すように記述されている場合、PLC用IPプロトコルスタック23は、以下のAからCのいずれかの処理を実行する。A.受信したデータの宛先IPアドレスが自IP(192.168.100.1、192.168.200.1)の場合、PLC用IPプロトコルスタック23は、そのデータをPLC用トランスポート層プロトコルスタック22に転送する。
B.受信したデータの宛先IPアドレスが192.168.101.0/24に含まれる場合、PLC用IPプロトコルスタック23は、そのデータをイーサネットドライバ24からイーサネットインタフェース25に転送し192.168.100.10のノードに送信する。
C.宛先IPアドレスがA,B以外の場合、PLC用IPプロトコルスタック23は、そのデータをイーサネットドライバ24からイーサネットインタフェース25に転送し192.168.100.100のノードに送信する。つまり、PLC用IPプロトコルスタック23は、宛先が不明の場合、デフォルトスタンダードに送信する。
As an example, when the IP routing table is described as shown in FIG. 3, the PLC IP protocol stack 23 executes one of the following processes A to C. A. When the destination IP address of the received data is its own IP (192.168.100.1, 192.168.200.1), the PLC IP protocol stack 23 transfers the data to the PLC transport layer protocol stack 22.
B. When the destination IP address of the received data is included in 192.168.101.0/24, the PLC IP protocol stack 23 transfers the data from the Ethernet driver 24 to the Ethernet interface 25 and transmits it to the node at 192.168.100.10.
C. When the destination IP address is other than A and B, the PLC IP protocol stack 23 transfers the data from the Ethernet driver 24 to the Ethernet interface 25 and transmits it to the node of 192.168.100.100. That is, if the destination is unknown, the PLC IP protocol stack 23 transmits to the default standard.

上記のPLC用TCP/IPアプリ群21と、PLC用トランスポート層プロトコルスタック22と、PLC用IPプロトコルスタック23と、イーサネットドライバ24と、イーサネットインタフェース25とは、通常のTCP/IPを構成する4層構造における各層のプロトコルと同様である。これにより、イーサネットに接続可能な通信インタフェースを備えたパソコン11は、TCP/IPプロトコルを用いて第1PLC12のCPUユニット20とデータの送受を行なうことができる。つまり、パソコン11と第1PLC12との間でデータを送受する場合、専用のプロトコルは、不要となる。   The PLC TCP / IP application group 21, the PLC transport layer protocol stack 22, the PLC IP protocol stack 23, the Ethernet driver 24, and the Ethernet interface 25 constitute a normal TCP / IP. This is the same as the protocol of each layer in the layer structure. Thereby, the personal computer 11 provided with the communication interface connectable to Ethernet can transmit and receive data with the CPU unit 20 of the first PLC 12 using the TCP / IP protocol. That is, when data is transmitted and received between the personal computer 11 and the first PLC 12, a dedicated protocol is not necessary.

CPUユニット20の動作を説明しつつ、上記の各処理部の機能をさらに説明する。図4は、データ送信時の動作を示す。TCP/IPアプリ群21内のアプリケーションは、送信先のIPアドレスとポート番号を指定し、データをPLC用トランスポート層プロトコルスタック22へ転送する(S1)。PLC用トランスポート層プロトコルスタック22は、受け取ったデータに対してTCPヘッダ或いはUDPヘッダを付加し、PLC用IPプロトコルスタック23に転送する(S2)。PLC用IPプロトコルスタック23は、受け取ったデータにIPヘッダ,イーサネットヘッダを付加し(S3)、IPルーティングテーブルに登録されたルーティング規則に従い、取得したデータをイーサネットドライバ24またはドライバ26に転送する(S4)。イーサネットドライバ24は、受信したデータをイーサネットインタフェース25にそのまま転送する(S5)。イーサネットインタフェース25は、エラーチェックデータを付加し、イーサネット手順に従いデータを第1ネットワーク10へ送信する(S6)。また、ドライバ26は、受信したデータに通信ユニット宛内部バスヘッダを付加し、そのデータを内部バス40経由で通信ユニット30へ送信する(S7)。   While explaining the operation of the CPU unit 20, the functions of the above-described processing units will be further explained. FIG. 4 shows the operation at the time of data transmission. The application in the TCP / IP application group 21 designates the destination IP address and port number, and transfers the data to the PLC transport layer protocol stack 22 (S1). The PLC transport layer protocol stack 22 adds a TCP header or UDP header to the received data, and transfers the data to the PLC IP protocol stack 23 (S2). The PLC IP protocol stack 23 adds an IP header and an Ethernet header to the received data (S3), and transfers the acquired data to the Ethernet driver 24 or the driver 26 according to the routing rule registered in the IP routing table (S4). ). The Ethernet driver 24 transfers the received data to the Ethernet interface 25 as it is (S5). The Ethernet interface 25 adds error check data and transmits the data to the first network 10 according to the Ethernet procedure (S6). The driver 26 adds an internal bus header addressed to the communication unit to the received data, and transmits the data to the communication unit 30 via the internal bus 40 (S7).

図5は、イーサネットインタフェース25が受信したデータについての内部処理を示している。イーサネットインタフェース25は、受信したデータのヘッダを解析し、宛先アドレスが「自MACアドレス」か「ブロードキャストアドレス」の場合、その受信したデータをイーサネットドライバ24へ転送する(S11)。   FIG. 5 shows internal processing for data received by the Ethernet interface 25. The Ethernet interface 25 analyzes the header of the received data, and when the destination address is “own MAC address” or “broadcast address”, the received data is transferred to the Ethernet driver 24 (S11).

イーサネットドライバ24は、イーサネットインタフェース25から転送されてきた全てのデータを、PLC用IPプロトコルスタック23へ転送する(S12)。PLC用IPプロトコルスタック23は、IPルーティングテーブルに登録されたルーティング規則に従い、取得したデータをPLC用トランスポート層プロトコルスタック22またはドライバ26に転送する(S13)。PLC用トランスポート層プロトコルスタック22は、転送されてきたデータの宛先ポートをチェックし、対応可能なアプリケーションのポート番号か否かを判断する(S14)。対応可能なアプリケーションのポート番号の場合、PLC用トランスポート層プロトコルスタック22は、そのデータをPLC用TCP/IPアプリ群21に送る(S15)。PLC用TCP/IPアプリ群21の対応するアプリケーションは、受信したデータに基づきデータ処理を行なう(S16)。なお、処理ステップS14の分岐判断で、対応するアプリケーションが存在しないと判断された場合、受信したデータ(パケット)を破棄する(S17)。また、ドライバ26は、受信したデータに通信ユニット宛内部バスヘッダを付加し、そのデータを内部バス40経由で通信ユニット30へ送信する(S18)。   The Ethernet driver 24 transfers all data transferred from the Ethernet interface 25 to the PLC IP protocol stack 23 (S12). The PLC IP protocol stack 23 transfers the acquired data to the PLC transport layer protocol stack 22 or the driver 26 in accordance with the routing rules registered in the IP routing table (S13). The PLC transport layer protocol stack 22 checks the destination port of the transferred data, and determines whether or not the port number is a compatible application (S14). In the case of a port number of a compatible application, the PLC transport layer protocol stack 22 sends the data to the PLC TCP / IP application group 21 (S15). The corresponding application of the PLC TCP / IP application group 21 performs data processing based on the received data (S16). If it is determined in the branching determination in processing step S14 that the corresponding application does not exist, the received data (packet) is discarded (S17). The driver 26 adds an internal bus header addressed to the communication unit to the received data, and transmits the data to the communication unit 30 via the internal bus 40 (S18).

図6は、内部バス40経由でドライバ26がデータを受信した場合の内部処理を示している。ドライバ26は、内部バス40を介して通信ユニット30からのパケットを受信すると(S21)、内部バスヘッダを削除し、PLC用IPプロトコルスタック23へ転送する(S22)。PLC用IPプロトコルスタック23は、IPルーティングテーブルに登録されたルーティング規則に従い、取得したデータをPLC用トランスポート層プロトコルスタック22またはイーサネットドライバ24に転送する(S23)。なお、PLC用IPプロトコルスタック23は、イーサネットドライバ24に転送する際にイーサネットヘッダを付加する(S28)。   FIG. 6 shows internal processing when the driver 26 receives data via the internal bus 40. When the driver 26 receives a packet from the communication unit 30 via the internal bus 40 (S21), the driver 26 deletes the internal bus header and transfers it to the PLC IP protocol stack 23 (S22). The PLC IP protocol stack 23 transfers the acquired data to the PLC transport layer protocol stack 22 or the Ethernet driver 24 in accordance with the routing rules registered in the IP routing table (S23). The PLC IP protocol stack 23 adds an Ethernet header when transferring to the Ethernet driver 24 (S28).

PLC用トランスポート層プロトコルスタック22は、転送されてきたデータの宛先ポートをチェックし、対応するアプリケーションのポート番号か否かを判断する(S24)。対応するアプリケーションの場合、PLC用トランスポート層プロトコルスタック22は、そのデータをPLC用TCP/IPアプリ群21に送る(S25)。PLC用TCP/IPアプリ群21の対応するアプリケーションは、受信したデータに基づきデータ処理を行なう(S26)。なお、処理ステップS24の分岐判断で、対応するアプリケーションが存在しないと判断された場合、受信したデータ(パケット)を破棄する(S27)。   The PLC transport layer protocol stack 22 checks the destination port of the transferred data and determines whether it is the port number of the corresponding application (S24). In the case of a corresponding application, the PLC transport layer protocol stack 22 sends the data to the PLC TCP / IP application group 21 (S25). The corresponding application of the PLC TCP / IP application group 21 performs data processing based on the received data (S26). If it is determined in the branching determination in processing step S24 that the corresponding application does not exist, the received data (packet) is discarded (S27).

PLC用IPプロトコルスタック23から転送されてきたデータを受け取ったイーサネットドライバ24は、受信したデータをイーサネットインタフェース25にそのまま転送する(S29)。イーサネットインタフェース25は、エラーチェックデータを付加し、イーサネット手順に従いデータを第1ネットワーク10へ送信する(S30)。   The Ethernet driver 24 that has received the data transferred from the PLC IP protocol stack 23 transfers the received data to the Ethernet interface 25 as it is (S29). The Ethernet interface 25 adds error check data and transmits the data to the first network 10 according to the Ethernet procedure (S30).

これにより、CPUユニット20は、PLC用TCP/IPアプリ群21から送られたデータを、イーサネットインタフェース25を経由して第1ネットワーク10に接続されたパソコン11等に送ることができる。また、CPUユニット20は、PLC用TCP/IPアプリ群21から送られたデータを、通信ユニット30側に送ることができる。CPUユニット20は、通信ユニット30から送られてきたデータをPLC用TCP/IPアプリ群21に転送したり、イーサネットインタフェース25から第1ネットワーク10側に送り出したりすることができる。   As a result, the CPU unit 20 can send data sent from the PLC TCP / IP application group 21 to the personal computer 11 connected to the first network 10 via the Ethernet interface 25. Further, the CPU unit 20 can send the data sent from the PLC TCP / IP application group 21 to the communication unit 30 side. The CPU unit 20 can transfer the data sent from the communication unit 30 to the PLC TCP / IP application group 21 or send it out from the Ethernet interface 25 to the first network 10 side.

通信ユニット30は、上位から順に、アプリケーション層であるTCP/IPアプリ群31と、トランスポート層であるトランスポート層プロトコルスタック32と、インターネット層であるIPプロトコルスタック33と、リンク層であるTCP/IPブリッジ内蔵イーサネットドライバ34,イーサネットインタフェース35と、を備える。さらに、通信ユニット30は、PLCの内部バス40に接続され、PLC内のユニット間でのデータ転送を行なうドライバ36(第2の内部バス用ドライバ)を備えている。このドライバ26は、TCP/IPブリッジ内蔵イーサネットドライバ34と接続され、IPプロトコルスタック33を経由することなく直接ドライバ間でデータの転送が行なわれる。   The communication unit 30 includes, in order from the top, a TCP / IP application group 31 that is an application layer, a transport layer protocol stack 32 that is a transport layer, an IP protocol stack 33 that is an Internet layer, and a TCP / IP that is a link layer. An IP bridge built-in Ethernet driver 34 and an Ethernet interface 35 are provided. Further, the communication unit 30 includes a driver 36 (second internal bus driver) that is connected to the PLC internal bus 40 and performs data transfer between units in the PLC. The driver 26 is connected to the Ethernet driver 34 with a built-in TCP / IP bridge, and directly transfers data between the drivers without going through the IP protocol stack 33.

TCP/IPアプリ群31を構成するアプリケーションは、通信ユニット固有のもので、PLC用TCP/IPアプリ群21を構成するアプリケーションとは必ずしも同じではない。トランスポート層プロトコルスタック32は、TCPプロトコルスタックとUDPプロトコルスタックを含む。IPプロトコルスタック33は、配下の通信インタフェースとしてTCP/IPブリッジ内蔵イーサネットドライバ34を通じてイーサネットインタフェース35が接続されているものとして動作する。通信ユニット30のIPプロトコルスタック33は、ルーティング機能を備えていない。通信ユニットにおけるインターネット層にはルーティング機能がない点で、CPUユニット20のPLC用IPプロトコルスタック23と相違している。よって、IPプロトコルスタック33は、IPルーティングを要求するパケット、すなわち「自MACアドレスかつ他IPアドレス」宛のパケットを受信した場合、当該パケットを破棄する。   The application constituting the TCP / IP application group 31 is unique to the communication unit, and is not necessarily the same as the application constituting the TCP / IP application group 21 for PLC. The transport layer protocol stack 32 includes a TCP protocol stack and a UDP protocol stack. The IP protocol stack 33 operates as if the Ethernet interface 35 is connected through a TCP / IP bridge built-in Ethernet driver 34 as a subordinate communication interface. The IP protocol stack 33 of the communication unit 30 does not have a routing function. The Internet layer in the communication unit is different from the PLC IP protocol stack 23 of the CPU unit 20 in that there is no routing function. Therefore, when the IP protocol stack 33 receives a packet requesting IP routing, that is, a packet addressed to “the own MAC address and another IP address”, the packet is discarded.

TCP/IPブリッジ内蔵イーサネットドライバ34は、通常のイーサネットドライバの機能と、TCP/IPブリッジ機能とを備えたドライバである。ここでTCP/IPブリッジ機能は、イーサネットインタフェース35から受信したデータのプロトコルヘッダ部を解析し、その内容によってデータの転送先を決定し、その決定した転送先に受信したデータを転送する機能である。転送先は、以下の3つのパターンがある。
(1)IPプロトコルスタック33とドライバ36の両方
(2)ドライバ36のみ
(3)IPプロトコルスタック33のみ
The TCP / IP bridge built-in Ethernet driver 34 is a driver having a function of a normal Ethernet driver and a TCP / IP bridge function. Here, the TCP / IP bridge function is a function of analyzing a protocol header portion of data received from the Ethernet interface 35, determining a data transfer destination according to the content, and transferring the received data to the determined transfer destination. . The transfer destination has the following three patterns.
(1) Both IP protocol stack 33 and driver 36 (2) Only driver 36 (3) Only IP protocol stack 33

この振り分け処理は、CPUユニット20のPLC用TCP/IPアプリ群21と通信ユニット30のTCP/IPアプリ群31に実装されるアプリケーションや、PLC用IPプロトコルスタック23,IPプロトコルスタック33の持つ機能等に依存する。そこで、CPUユニット20と通信ユニット30が、図7に示す機能を実装していると仮定して振り分け処理を説明する。   This distribution processing is performed by the applications installed in the PLC TCP / IP application group 21 of the CPU unit 20 and the TCP / IP application group 31 of the communication unit 30, the functions of the PLC IP protocol stack 23, the IP protocol stack 33, and the like. Depends on. Therefore, the distribution process will be described on the assumption that the CPU unit 20 and the communication unit 30 have the functions shown in FIG.

(1)IPプロトコルスタック33とドライバ36の両方に転送する条件
TCP/IPブリッジ内蔵イーサネットドライバ34は、受信したデータのデータ種別が「ARPレスポンスデータ」の場合(条件1)、そのデータをIPプロトコルスタック33とドライバ36に転送する。ARPレスポンスデータか否かの判断は、イーサネットヘッダのフレームタイプが、ARPであることを示す「0x806」で、そのイーサネットヘッダに続くARPヘッダのオペレーションの値がレスポンスを示す「2」であるか否かにより行なう(図8参照)。
(1) Conditions for transferring to both the IP protocol stack 33 and the driver 36 When the data type of the received data is “ARP response data” (condition 1), the TCP / IP bridge built-in Ethernet driver 34 transfers the data to the IP protocol. Transfer to the stack 33 and the driver 36. Whether the ARP response data is “ARP” is “0x806” indicating that the frame type of the Ethernet header is ARP, and the operation value of the ARP header following the Ethernet header is “2” indicating the response. (See FIG. 8).

(2)ドライバ36のみに転送する条件
TCP/IPブリッジ内蔵イーサネットドライバ34は、受信したデータのデータ種別が「IPルーティングデータ」(条件2−1),「PLC宛ICMPエラーデータ」(条件2−2),「TCP共通アプリケーション(クライアント)」(条件2−3),「UDP共通アプリケーション(クライアント)」(条件2−4),「UDP共通アプリケーション(クライアント、フラグメントデータ)」(条件2−5),「TCPアプリケーション(サーバ)」(条件2−6),「TCPアプリケーション(クライアント)」(条件2−7),「UDPアプリケーション(サーバ)」(条件2−8),「UDPアプリケーション(クライアント)」(条件2−9)の場合、そのデータをドライバ36に転送する。
(2) Conditions for transferring only to the driver 36 In the Ethernet driver 34 with built-in TCP / IP bridge, the data type of the received data is “IP routing data” (condition 2-1), “PLC-addressed ICMP error data” (condition 2- 2), “TCP common application (client)” (condition 2-3), “UDP common application (client)” (condition 2-4), “UDP common application (client, fragment data)” (condition 2-5) , “TCP application (server)” (condition 2-6), “TCP application (client)” (condition 2-7), “UDP application (server)” (condition 2-8), “UDP application (client)” In the case of (Condition 2-9), the data is transferred to the driver 36. To send.

各条件のプロトコル識別に基づく具体的な判断は、以下の通りである。まず、受信したデータのIPヘッダの宛先IPアドレスが、通信ユニット30のIPアドレスでない場合、そのデータは条件2−1を充足する(図9参照)。   Specific judgment based on the protocol identification of each condition is as follows. First, when the destination IP address in the IP header of the received data is not the IP address of the communication unit 30, the data satisfies the condition 2-1 (see FIG. 9).

受信したデータのICMPヘッダのタイプが3,4,5,11,12のいずれかであり、かつ、添付IPデータグラムが条件2−3から2−9に合致する場合、そのデータは条件2−2を充足する(図10参照)。   If the ICMP header type of the received data is any of 3, 4, 5, 11, and 12, and the attached IP datagram satisfies the conditions 2-3 to 2-9, the data is the condition 2- 2 is satisfied (see FIG. 10).

受信したデータのTCPヘッダの宛先ポート番号がCPUユニットに割り当てられた範囲内の場合、そのデータは条件2−3を充足する(図11参照)。すなわち、PLC用TCP/IPアプリ群21並びにTCP/IPアプリ群31を構成する各アプリケーションが利用するポート番号の範囲は、予め各ユニットごとに決めておく。一例を示すと、CPUユニット20に実装されるアプリケーションは、10001〜20000番の範囲内のポート番号を利用し、通信ユニット30に実装されるアプリケーションは、20001〜30000番の範囲内のポート番号を利用するものとする。すると、受信したデータのTCPヘッダの宛先ポート番号が10001〜20000番の範囲内であれば、CPUユニット20に実装されたアプリケーションが利用するデータの可能性があるとともに、通信ユニット30に実装されたアプリケーションが利用するデータの可能性がない。よって、係る場合、受け取ったデータをドライバ36へ転送し、CPUユニット20側に渡すようにする。   If the destination port number in the TCP header of the received data is within the range assigned to the CPU unit, the data satisfies Condition 2-3 (see FIG. 11). That is, the range of port numbers used by the applications constituting the PLC TCP / IP application group 21 and the TCP / IP application group 31 is determined in advance for each unit. For example, an application mounted on the CPU unit 20 uses a port number in the range of 10001 to 20000, and an application mounted on the communication unit 30 uses a port number in the range of 20001 to 30000. Shall be used. Then, if the destination port number of the TCP header of the received data is within the range of 10001 to 20000, there is a possibility of data used by the application installed in the CPU unit 20 and the data installed in the communication unit 30 There is no possibility of data used by the application. Therefore, in such a case, the received data is transferred to the driver 36 and passed to the CPU unit 20 side.

同様に、受信したデータのUDPヘッダの宛先ポート番号がCPUユニットに割り当てられた範囲内の場合、そのデータは条件2−4を充足する(図12参照)。また、UDPプロトコルに従ったパケットの場合、IPによるフラグメント(データ分割)が発生すると、2つ目以降のパケット(データ)にはUDPヘッダが付加されない。一方、IPヘッダの識別子の欄には、分割の有無とシリアルNo.が格納される(図13参照)。従って、係る識別子に基づき、条件2−4を充足するデータと対となるデータは、条件2−5を充足する。   Similarly, when the destination port number in the UDP header of the received data is within the range assigned to the CPU unit, the data satisfies the condition 2-4 (see FIG. 12). In the case of a packet according to the UDP protocol, if a fragment (data division) by IP occurs, a UDP header is not added to the second and subsequent packets (data). On the other hand, in the identifier field of the IP header, the presence / absence of division and serial number Is stored (see FIG. 13). Therefore, based on such an identifier, data paired with data that satisfies condition 2-4 satisfies condition 2-5.

受信したデータのTCPヘッダの宛先ポート番号が、通信ユニット30のTCP/IPアプリ群31のサポートサーバポート(サーバアプリA)でない場合、そのデータは条件2−6を充足する(図11参照)。すなわち、通信ユニット30がサポートしていないデータの場合、TCP/IPアプリ群31にとって不要なデータであるため、CPUユニット20側へ転送するようにする。   When the destination port number of the TCP header of the received data is not the support server port (server application A) of the TCP / IP application group 31 of the communication unit 30, the data satisfies the condition 2-6 (see FIG. 11). That is, since the data not supported by the communication unit 30 is unnecessary for the TCP / IP application group 31, it is transferred to the CPU unit 20 side.

受信したデータのTCPヘッダの発信元ポート番号が、通信ユニット30のTCP/IPアプリ群31のサポートクライアントポート(クライアントアプリB)でない場合、そのデータは条件2−7を充足する(図11参照)。   When the transmission source port number of the TCP header of the received data is not the support client port (client application B) of the TCP / IP application group 31 of the communication unit 30, the data satisfies the condition 2-7 (see FIG. 11). .

また、受信したデータのUDPヘッダの宛先ポート番号が、通信ユニット30のTCP/IPアプリ群31のサポートサーバポート(サーバアプリE)でない場合、そのデータは条件2−8を充足する(図12参照)。   Further, when the destination port number of the UDP header of the received data is not the support server port (server application E) of the TCP / IP application group 31 of the communication unit 30, the data satisfies the condition 2-8 (see FIG. 12). ).

さらに、受信したデータのUDPヘッダの発信元ポート番号が、通信ユニット30のTCP/IPアプリ群31のサポートクライアントポート(クライアントアプリF)でない場合、そのデータは条件2−9を充足する(図12参照)。   Furthermore, when the transmission source port number in the UDP header of the received data is not the support client port (client application F) of the TCP / IP application group 31 of the communication unit 30, the data satisfies the condition 2-9 (FIG. 12). reference).

(3)IPプロトコルスタック33のみに転送する条件
受信したデータが、上記の条件1並びに条件2−1〜条件2−9の何れにも充足しなかった場合、そのデータはIPプロトコルスタック33に転送する。
(3) Conditions for transferring only to the IP protocol stack 33 If the received data does not satisfy any of the above conditions 1 and 2-1 to 2-9, the data is transferred to the IP protocol stack 33. To do.

通信ユニット30の動作を説明しつつ、上記の各処理部の機能をさらに説明する。図14は、データ送信時の動作を示す。TCP/IPアプリ群31内のアプリケーションは、送信先のIPアドレスとポート番号を指定し、データをトランスポート層プロトコルスタック32へ転送する(S31)。トランスポート層プロトコルスタック32は、受け取ったデータに対してTCPヘッダ或いはUDPヘッダを付加し、IPプロトコルスタック23に転送する(S32)。IPプロトコルスタック23は、受け取ったデータにIPヘッダ,イーサネットヘッダを付加しTCP/IPブリッジ内蔵イーサネットドライバ34に転送する(S33)。TCP/IPブリッジ内蔵イーサネットドライバ34は、受信したデータをイーサネットインタフェース35にそのまま転送する(S34)。イーサネットインタフェース35は、エラーチェックデータを付加し、イーサネット手順に従いデータを第2ネットワーク13へ送信する(S35)。   While describing the operation of the communication unit 30, the functions of the above-described processing units will be further described. FIG. 14 shows an operation during data transmission. The application in the TCP / IP application group 31 designates the destination IP address and port number, and transfers the data to the transport layer protocol stack 32 (S31). The transport layer protocol stack 32 adds a TCP header or a UDP header to the received data and transfers the data to the IP protocol stack 23 (S32). The IP protocol stack 23 adds an IP header and an Ethernet header to the received data and transfers them to the TCP / IP bridge built-in Ethernet driver 34 (S33). The TCP / IP bridge built-in Ethernet driver 34 transfers the received data to the Ethernet interface 35 as it is (S34). The Ethernet interface 35 adds error check data and transmits the data to the second network 13 according to the Ethernet procedure (S35).

図15は、イーサネットインタフェース35が受信したデータについての内部処理を示している。イーサネットインタフェース35は、受信したデータのヘッダを解析し、宛先アドレスが「自MACアドレス」か「ブロードキャストアドレス」の場合、その受信したデータをTCP/IPブリッジ内蔵イーサネットドライバ34へ転送する(S41)。TCP/IPブリッジ内蔵イーサネットドライバ34は、ブリッジ振り分け処理のルールに従い、取得したデータをIPプロトコルスタック33およびまたはドライバ36に転送する(S42)。   FIG. 15 shows internal processing for data received by the Ethernet interface 35. The Ethernet interface 35 analyzes the header of the received data, and if the destination address is “own MAC address” or “broadcast address”, the received data is transferred to the TCP / IP bridge built-in Ethernet driver 34 (S41). The TCP / IP bridge built-in Ethernet driver 34 transfers the acquired data to the IP protocol stack 33 and / or the driver 36 in accordance with the rules of the bridge distribution process (S42).

IPプロトコルスタック33は、パケットの宛先IPアドレスをチェックする(S43)。そして、宛先IPアドレスが自IPアドレスの場合、IPプロトコルスタック33は、取得したデータをトランスポート層プロトコルスタック32に転送する(S44)。宛先IPアドレスが他IPアドレスの場合、取得したデータは破棄される(S48)。   The IP protocol stack 33 checks the destination IP address of the packet (S43). Then, when the destination IP address is its own IP address, the IP protocol stack 33 transfers the acquired data to the transport layer protocol stack 32 (S44). If the destination IP address is another IP address, the acquired data is discarded (S48).

トランスポート層プロトコルスタック32は、転送されてきたデータの宛先ポートをチェックし、対応可能なアプリケーションのポート番号か否かを判断する(S45)。対応可能なアプリケーションのポート番号の場合、トランスポート層プロトコルスタック32は、そのデータをTCP/IPアプリ群31に送る(S46)。TCP/IPアプリ群31の対応するアプリケーションは、受信したデータに基づきデータ処理を行なう(S47)。なお、処理ステップS45の分岐判断で、対応するアプリケーションが存在しないと判断された場合、受信したデータ(パケット)を破棄する(S48)。また、ドライバ36は、受信したデータにCPUユニット宛内部バスヘッダを付加し、そのデータを内部バス40経由でCPUユニット20へ送信する(S49)。   The transport layer protocol stack 32 checks the destination port of the transferred data, and determines whether or not the port number is a compatible application (S45). In the case of a port number of an applicable application, the transport layer protocol stack 32 sends the data to the TCP / IP application group 31 (S46). The corresponding application of the TCP / IP application group 31 performs data processing based on the received data (S47). If it is determined in the branching determination in processing step S45 that there is no corresponding application, the received data (packet) is discarded (S48). The driver 36 adds an internal bus header addressed to the CPU unit to the received data, and transmits the data to the CPU unit 20 via the internal bus 40 (S49).

図16は、内部バス40経由でドライバ36がデータを受信した場合の内部処理を示している。ドライバ36は、内部バス40を介してCPUユニット20からのパケットを受信すると(S51)、内部バスヘッダを削除し、TCP/IPブリッジ内蔵イーサネットドライバ34へ転送する(S52)。TCP/IPブリッジ内蔵イーサネットドライバ34は、受信したデータをイーサネットインタフェース35にそのまま転送する(S53)。イーサネットインタフェース35は、エラーチェックデータを付加し、イーサネット手順に従いデータを第2ネットワーク13へ送信する(S54)。   FIG. 16 shows internal processing when the driver 36 receives data via the internal bus 40. When the driver 36 receives a packet from the CPU unit 20 via the internal bus 40 (S51), the driver 36 deletes the internal bus header and transfers it to the TCP / IP bridge built-in Ethernet driver 34 (S52). The TCP / IP bridge built-in Ethernet driver 34 transfers the received data to the Ethernet interface 35 as it is (S53). The Ethernet interface 35 adds error check data and transmits the data to the second network 13 according to the Ethernet procedure (S54).

これにより、通信ユニット30は、TCP/IPアプリ群31から送られたデータを、イーサネットインタフェース35を経由して第2ネットワーク13に接続されたPLCその他の機器等に送ることができる。また、通信ユニット30は、CPUユニット20側から送られてきたデータを第2ネットワーク13側に送信することができる。つまり、通信ユニット30は、PLC用TCP/IPアプリ群21のアプリケーションから送られたデータや、パソコン11からCPUユニット20経由で受信したデータを、第2ネットワーク13上のPLC等に送信することができる。逆に、第2ネットワーク13に接続されたPLC等は、通信ユニット30経由で第1PLC12のCPUユニットのPLC用TCP/IPアプリ群21の所定のアプリケーションとデータの送受をしたり、さらに上位の第1ネットワーク10に接続されたパソコン11等とデータの送受をしたりすることができる。   As a result, the communication unit 30 can send the data sent from the TCP / IP application group 31 to the PLC and other devices connected to the second network 13 via the Ethernet interface 35. The communication unit 30 can transmit data sent from the CPU unit 20 side to the second network 13 side. That is, the communication unit 30 can transmit data sent from the application of the PLC TCP / IP application group 21 or data received from the personal computer 11 via the CPU unit 20 to the PLC or the like on the second network 13. it can. Conversely, a PLC or the like connected to the second network 13 transmits / receives data to / from a predetermined application of the PLC TCP / IP application group 21 of the CPU unit of the first PLC 12 via the communication unit 30, Data can be transmitted to and received from a personal computer 11 connected to one network 10.

次に、具体的な応用例を説明する。図17では、説明の便宜上、第1PLC12のCPUユニットの符号を20a、通信ユニットの符号を30aとする。また、第2PLC16のCPUユニットの符号を20b、通信ユニットの符号を30bとする。この図17に示すネットワークシステムにおいて、パソコン11が、第2PLC16のCPUユニット20bのFTPサーバにアクセスする場合、以下の手順に従ってデータの送受が行なわれる。この例での第2PLC16のCPUユニット20bはイーサネットドライバおよびイーサネットインタフェースを備えていても、備えていなくてもよい。もし備えていても使用しない状態となる。   Next, a specific application example will be described. In FIG. 17, for convenience of explanation, the symbol of the CPU unit of the first PLC 12 is 20a, and the symbol of the communication unit is 30a. Also, the code of the CPU unit of the second PLC 16 is 20b, and the code of the communication unit is 30b. In the network system shown in FIG. 17, when the personal computer 11 accesses the FTP server of the CPU unit 20b of the second PLC 16, data is transmitted and received according to the following procedure. The CPU unit 20b of the second PLC 16 in this example may or may not include an Ethernet driver and an Ethernet interface. Even if it is equipped, it will not be in use.

まず、パソコン11は、第2PLC16のCPUユニット20b宛(IPアドレス=192.168.1.3)にFTPアクセスを行う。第2PLC16は、パソコン11が接続されているネットワークと異なるネットワークに接続されているためパソコン11のデフォルトゲートウェイ情報に従い、第1PLC12のCPUユニット20aにFTPアクセス用パケットを送信する。   First, the personal computer 11 performs FTP access to the CPU unit 20b of the second PLC 16 (IP address = 192.168.1.3). Since the second PLC 16 is connected to a network different from the network to which the personal computer 11 is connected, the second PLC 16 transmits an FTP access packet to the CPU unit 20a of the first PLC 12 according to the default gateway information of the personal computer 11.

第1PLC12のCPUユニット20aは図5で説明した処理を行う。そして、受信したFTPアクセス用パケットが第2PLC16のCPUユニット20b宛であると認識する。また、CPUユニット20aは、通信ユニット30aと第2PLC16とが第2ネットワーク13に接続されていると認識している。そこで、CPUユニット20aは、PLC用IPプロトコルスタック23のルーティング機能により、通信ユニット30aにFTPアクセス用パケットを転送する(図5のS18に対応)。通信ユニット30aは、図16で説明した処理を行い、CPUユニット20aから転送されてきたFTPアクセス用パケットを第2PLC16の通信ユニット30b宛に送信する。   The CPU unit 20a of the first PLC 12 performs the processing described with reference to FIG. Then, it recognizes that the received FTP access packet is addressed to the CPU unit 20b of the second PLC 16. Further, the CPU unit 20 a recognizes that the communication unit 30 a and the second PLC 16 are connected to the second network 13. Therefore, the CPU unit 20a transfers the FTP access packet to the communication unit 30a by the routing function of the PLC IP protocol stack 23 (corresponding to S18 in FIG. 5). The communication unit 30a performs the processing described in FIG. 16, and transmits the FTP access packet transferred from the CPU unit 20a to the communication unit 30b of the second PLC 16.

通信ユニット30bは図15で説明した処理を行う。通信ユニット30bは、FTPサーバ機能をサポートしていないためTCP/IPブリッジ振り分け条件2−6により受信したFTPアクセス用パケットをCPUユニット20bに転送する(図15のS49に対応)。CPUユニット20bでは、図5で説明した処理によって、FTPアクセス用パケットの受け付け処理を行なう。   The communication unit 30b performs the processing described with reference to FIG. Since the communication unit 30b does not support the FTP server function, the communication unit 30b transfers the FTP access packet received under the TCP / IP bridge distribution condition 2-6 to the CPU unit 20b (corresponding to S49 in FIG. 15). The CPU unit 20b performs FTP access packet acceptance processing by the processing described with reference to FIG.

第2PLC16のCPUユニット20bは、図4で説明した処理をし、パソコン11に対するレスポンスを以下のように実行する。CPUユニット20bは、パソコン11宛(IPアドレス=192.168.0.1)にFTPレスポンスを生成する。パソコン11は、CPUユニット20b2が接続されているネットワークと異なるネットワークに接続されているため、CPUユニット20bのデフォルトゲートウェイ情報に従い、第1PLC12の通信ユニット30aにFTPレスポンス用パケットを送信するために、そのパケットを通信ユニット30bに転送する(図4のS7に対応)。通信ユニット30bは、図16で説明した処理を行い、CPUユニット20bから転送されてきたFTPレスポンス用パケットを通信ユニット30a宛に送信する。   The CPU unit 20b of the second PLC 16 performs the processing described in FIG. 4 and executes a response to the personal computer 11 as follows. The CPU unit 20b generates an FTP response addressed to the personal computer 11 (IP address = 192.168.0.1). Since the personal computer 11 is connected to a network different from the network to which the CPU unit 20b2 is connected, in order to send an FTP response packet to the communication unit 30a of the first PLC 12 according to the default gateway information of the CPU unit 20b, The packet is transferred to the communication unit 30b (corresponding to S7 in FIG. 4). The communication unit 30b performs the processing described with reference to FIG. 16, and transmits the FTP response packet transferred from the CPU unit 20b to the communication unit 30a.

通信ユニット30aは図15で説明した処理を行う。通信ユニット30aは、受信したFTPレスポンス用パケットが自IPアドレス宛ではないため、TCP/IPブリッジ振り分け条件2−1に従い、そのFTPレスポンス用パケットをCPUユニット20aに転送する。(図15のS49に対応)   The communication unit 30a performs the processing described with reference to FIG. Since the received FTP response packet is not addressed to its own IP address, the communication unit 30a transfers the FTP response packet to the CPU unit 20a according to the TCP / IP bridge distribution condition 2-1. (Corresponding to S49 in FIG. 15)

第1PLC12のCPUユニット20aは、通信ユニット30aから転送されてきたFTPレスポンス用パケットがパソコン11宛であると認識する。CPUユニット20aは、パソコン11とCPUユニット20aとが同一ネットワークに接続されていると認識しているためCPUユニット20aはパソコン11にFTPレスポンス用パケットを送信する。(図5のS15に対応)   The CPU unit 20a of the first PLC 12 recognizes that the FTP response packet transferred from the communication unit 30a is addressed to the personal computer 11. Since the CPU unit 20a recognizes that the personal computer 11 and the CPU unit 20a are connected to the same network, the CPU unit 20a transmits an FTP response packet to the personal computer 11. (Corresponding to S15 in FIG. 5)

パソコン11は、CPUユニット20aから送られてきたFTPレスポンス用パケットの受け付け処理を行う。これにより、パソコン11とPLC16(CPUユニット20b)との間で、汎用のプロトコルを用いてデータの送受を行なうことができる。   The personal computer 11 performs reception processing of the FTP response packet sent from the CPU unit 20a. Thereby, data can be transmitted and received between the personal computer 11 and the PLC 16 (CPU unit 20b) using a general-purpose protocol.

図18は、別の実施形態を示している。本実施形態では、2つのネットワーク10,13に接続される第1PLC12が、通信ユニットを2つ備える。そして、第1通信ユニット30aが第2ネットワーク13に接続され、第2通信ユニット30cが第1ネットワーク10に接続される。図19に示すように、各通信ユニット30a,30cの内部構造は、図2に示すものと基本的に同様である。また、CPUユニット20aは、内部バス40に接続するドライバ28a,28b(請求項2の第1の内部バス用ドライバに相当)が、2つ用意されている。各ドライバ28a,28bは、それぞれ対応する通信ユニット30a,30cが決まっており、PLC用IPプロトコルスタック23は、ルーティングにより転送すべき通信ユニットが決まると、その通信ユニットに対応するドライバにデータを転送する。図では内部バス用ドライバは2つだが、通信ユニットが3台以上接続される場合でも適用できるように、内部バス用ドライバを3つ以上設けた構成としてもよい。なお、内部バス40は、CPUユニット20aと各通信ユニット30a、30c、他のユニット(図示せず)とで共通のものであり、1つのバス構造となっている。便宜上、図中では、CPUユニット20aと通信ユニット30bとの間の内部バスと、CPUユニット20aと通信ユニット30cとの間の内部バスとを分離して示しているが、実際には、両者の内部バス40はつながっており、1つのバス構造となっている。また、この実施形態のCPUユニット20aは、図19におけるイーサネットドライバ24およびイーサネットインタフェース25の構成を必要とせず、持たないものであってもよい。もちろんそれらの構成を持っていてもよいが、インタフェース25にはネットワークを接続しないので、用いない。第2PLC16のCPUユニット20bもイーサネットドライバおよびイーサネットインタフェースを備えていても、備えていなくてもよい。   FIG. 18 shows another embodiment. In the present embodiment, the first PLC 12 connected to the two networks 10 and 13 includes two communication units. Then, the first communication unit 30 a is connected to the second network 13, and the second communication unit 30 c is connected to the first network 10. As shown in FIG. 19, the internal structure of each communication unit 30a, 30c is basically the same as that shown in FIG. The CPU unit 20a is provided with two drivers 28a and 28b (corresponding to the first internal bus driver of claim 2) connected to the internal bus 40. Each driver 28a, 28b has a corresponding communication unit 30a, 30c. When the communication unit to be transferred is determined by routing, the PLC IP protocol stack 23 transfers data to the driver corresponding to the communication unit. To do. Although two internal bus drivers are shown in the figure, a configuration in which three or more internal bus drivers are provided may be applied even when three or more communication units are connected. The internal bus 40 is common to the CPU unit 20a, the communication units 30a and 30c, and other units (not shown), and has a single bus structure. For convenience, in the drawing, the internal bus between the CPU unit 20a and the communication unit 30b and the internal bus between the CPU unit 20a and the communication unit 30c are shown separately. The internal bus 40 is connected and has a single bus structure. Further, the CPU unit 20a of this embodiment does not require or have the configuration of the Ethernet driver 24 and the Ethernet interface 25 in FIG. Of course, you may have those structures, but since the network is not connected to the interface 25, it is not used. The CPU unit 20b of the second PLC 16 may or may not include an Ethernet driver and an Ethernet interface.

さて、パソコン11が、第2PLC16のCPUユニット20bのFTPサーバにアクセスする場合を例にする。すなわち、ここでのパソコン11は、第2PLC16のCPUユニット20b宛(IPアドレス=192.168.1.3)にFTPアクセスを行い、第2PLC16は、パソコン11が接続されたネットワークと異なるネットワークに接続されているためパソコン11のデフォルトゲートウェイ情報に従い、第1PLC12の第2通信ユニット30cにFTPアクセス用パケットを送信する例における処理を説明する。   Now, a case where the personal computer 11 accesses the FTP server of the CPU unit 20b of the second PLC 16 is taken as an example. That is, the personal computer 11 here performs FTP access to the CPU unit 20b of the second PLC 16 (IP address = 192.168.1.3), and the second PLC 16 is connected to a network different from the network to which the personal computer 11 is connected. Processing in an example of transmitting an FTP access packet to the second communication unit 30c of the first PLC 12 according to the default gateway information of the personal computer 11 will be described.

パソコン11はFTPアクセス用パケットを送信する。まず、第1PLC12の第2通信ユニット30cは図15の処理をし、ステップ42に対応する処理として、宛先IPアドレスが自IPアドレスと異なるためTCP/IPブリッジ振り分け条件2−1によりFTPアクセス用パケットを、ドライバ36から内部バス40を経由してCPUユニット20aに転送する(S49)。   The personal computer 11 transmits an FTP access packet. First, the second communication unit 30c of the first PLC 12 performs the process of FIG. 15, and as a process corresponding to step 42, since the destination IP address is different from its own IP address, the FTP access packet according to the TCP / IP bridge distribution condition 2-1. Are transferred from the driver 36 to the CPU unit 20a via the internal bus 40 (S49).

第1PLC12のCPUユニット20aのPLC用IPプロトコルスタック23は、第2通信ユニット30cから転送されたFTPアクセス用パケットが第2PLC16のCPUユニット20b宛であると認識する。また、CPUユニット20aは、第1通信ユニット30aと第2PLC16とが第2ネットワーク13に接続されていると認識している。そこで、CPUユニット20aは、ドライバ28aから内部バス40を介して通信ユニット30aにFTPアクセス用パケットを転送する(S18に対応)。第1通信ユニット30aは、図16の処理をし、CPUユニット20aから内部バス40を経由して転送されてきたFTPアクセス用パケットをそのままイーサネットドライバ35から第2ネットワーク13を介して第2PLC16の通信ユニット30b宛に送信する。   The PLC IP protocol stack 23 of the CPU unit 20a of the first PLC 12 recognizes that the FTP access packet transferred from the second communication unit 30c is addressed to the CPU unit 20b of the second PLC 16. Further, the CPU unit 20 a recognizes that the first communication unit 30 a and the second PLC 16 are connected to the second network 13. Therefore, the CPU unit 20a transfers the FTP access packet from the driver 28a to the communication unit 30a via the internal bus 40 (corresponding to S18). The first communication unit 30a performs the processing of FIG. 16, and the FTP access packet transferred from the CPU unit 20a via the internal bus 40 is directly transmitted from the Ethernet driver 35 to the second PLC 16 via the second network 13. Transmit to the unit 30b.

第2PLC16の通信ユニット30bは、図15の処理をし、FTPサーバ機能をサポートしていないためTCP/IPブリッジ振り分け条件2−6により受信したFTPアクセス用パケットをドライバ36から内部バス40を経由してCPUユニット20bに転送する(S49に対応)。第2PLC16のCPUユニット20bでは、図5の処理を行い、FTPアクセス用パケットの受け付け処理を行なう(S16相当)。   The communication unit 30b of the second PLC 16 performs the processing of FIG. 15 and does not support the FTP server function. Therefore, the FTP access packet received under the TCP / IP bridge distribution condition 2-6 is sent from the driver 36 via the internal bus 40. To the CPU unit 20b (corresponding to S49). The CPU unit 20b of the second PLC 16 performs the process of FIG. 5 and performs an FTP access packet acceptance process (corresponding to S16).

第2PLC16のCPUユニット20bからパソコン11に対するレスポンスは、以下の手順で実行される。CPUユニット20bは、パソコン11宛(IPアドレス=192.168.0.1)にFTPレスポンスを送信する。パソコン11は、CPUユニット20b2が接続させたネットワークと異なるネットワークに接続されているため、CPUユニット20bのデフォルトゲートウェイ情報に従い、第1PLC12の第1通信ユニット30aにFTPレスポンス用パケットを送信するために、そのパケットを通信ユニット30bに転送する(図4のS7に対応)。通信ユニット30bは、CPUユニット20bから転送されてきたFTPレスポンス用パケットをそのままイーサネットドライバからイーサネットを介して第1通信ユニット30a宛に送信する。   The response from the CPU unit 20b of the second PLC 16 to the personal computer 11 is executed in the following procedure. The CPU unit 20b transmits an FTP response to the personal computer 11 (IP address = 192.168.0.1). Since the personal computer 11 is connected to a network different from the network to which the CPU unit 20b2 is connected, in order to transmit the FTP response packet to the first communication unit 30a of the first PLC 12 according to the default gateway information of the CPU unit 20b, The packet is transferred to the communication unit 30b (corresponding to S7 in FIG. 4). The communication unit 30b transmits the FTP response packet transferred from the CPU unit 20b as it is from the Ethernet driver to the first communication unit 30a via Ethernet.

第1通信ユニット30aは、受信したFTPレスポンス用パケットが自IPアドレス宛ではないため、TCP/IPブリッジ振り分け条件2−1に従い、そのFTPレスポンス用パケットを内部バス40を介してCPUユニット20aに転送する(図15のS49)。   Since the received FTP response packet is not addressed to its own IP address, the first communication unit 30a transfers the FTP response packet to the CPU unit 20a via the internal bus 40 in accordance with the TCP / IP bridge distribution condition 2-1. (S49 in FIG. 15).

CPUユニット20aは、ドライバ28aにてFTPレスポンス用パケットを受け、図5の受信処理を行うが、第1通信ユニット30aから転送されてきたFTPレスポンス用パケットがパソコン11宛であると認識する。CPUユニット20aは、パソコン11と第2通信ユニット30cとが同一ネットワークに接続されていると認識しているためCPUユニット20aはドライバ28bから第2通信ユニット30cにFTPレスポンス用パケットを転送する(図5のS13、S18)。第2通信ユニット30cは、CPUユニット20aから内部バス40を経由して転送されてきたFTPアクセス用パケットをそのままパソコン11宛に送信する。   The CPU unit 20a receives the FTP response packet in the driver 28a and performs the reception process of FIG. 5, but recognizes that the FTP response packet transferred from the first communication unit 30a is addressed to the personal computer 11. Since the CPU unit 20a recognizes that the personal computer 11 and the second communication unit 30c are connected to the same network, the CPU unit 20a transfers the FTP response packet from the driver 28b to the second communication unit 30c (see FIG. 5 S13, S18). The second communication unit 30c transmits the FTP access packet transferred from the CPU unit 20a via the internal bus 40 to the personal computer 11 as it is.

パソコン11は、CPUユニット20aから送られてきたFTPレスポンス用パケットの受け付け処理を行う。これにより、パソコン11とPLC16(CPUユニット20b)との間で、汎用のプロトコルを用いてデータの送受を行なうことができる。   The personal computer 11 performs reception processing of the FTP response packet sent from the CPU unit 20a. Thereby, data can be transmitted and received between the personal computer 11 and the PLC 16 (CPU unit 20b) using a general-purpose protocol.

なお、CPUユニット20aの内部バス用ドライバ28a,28bを、通信ユニット30a,30cに対応させて設けた例を説明した。この構成は、内部バス用ドライバ28aは通信ユニット30aとの間で1対1にデータバス通信し、内部バス用ドライバ28bは通信ユニット30cとの間で1対1にデータバス通信するような構成である。しかし、それに限らず、内部バス用ドライバをすべての通信ユニットに共通した構成としてもよい。内部バス40は1つの共通のバスであるから、共通の内部バス用ドライバを、転送先の通信ユニットを1つ特定してデータ転送する機能を持った構成とすればよい。   The example in which the internal bus drivers 28a and 28b of the CPU unit 20a are provided corresponding to the communication units 30a and 30c has been described. In this configuration, the internal bus driver 28a performs one-to-one data bus communication with the communication unit 30a, and the internal bus driver 28b performs one-to-one data bus communication with the communication unit 30c. It is. However, the configuration is not limited thereto, and the internal bus driver may be configured to be common to all communication units. Since the internal bus 40 is one common bus, the common internal bus driver may be configured to have a function of specifying one transfer destination communication unit and transferring data.

本発明のプログラマブルコントローラを含むネットワークシステムの一例を示す図である。It is a figure which shows an example of the network system containing the programmable controller of this invention. 本発明のプログラマブルコントローラの一実施の形態を示す図である。It is a figure which shows one Embodiment of the programmable controller of this invention. ルーティングテーブルの一例を示す図である。It is a figure which shows an example of a routing table. CPUユニットの送信機能を説明するフローチャートである。It is a flowchart explaining the transmission function of a CPU unit. CPUユニットの受信機能を説明するフローチャートである。It is a flowchart explaining the reception function of a CPU unit. CPUユニットの受信機能を説明するフローチャートである。It is a flowchart explaining the reception function of a CPU unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットにおける振り分け機能を説明する図である。It is a figure explaining the distribution function in a communication unit. 通信ユニットの送信機能を説明するフローチャートである。It is a flowchart explaining the transmission function of a communication unit. 通信ユニットの受信機能を説明するフローチャートである。It is a flowchart explaining the reception function of a communication unit. 通信ユニットの受信機能を説明するフローチャートである。It is a flowchart explaining the reception function of a communication unit. 互いに異なるネットワークに接続された装置同士がデータを送受する手順を説明する図である。It is a figure explaining the procedure in which the apparatuses connected to a mutually different network transmit / receive data. 互いに異なるネットワークに接続された装置同士がデータを送受する手順を説明する図である。It is a figure explaining the procedure in which the apparatuses connected to a mutually different network transmit / receive data. 本発明のプログラマブルコントローラの別の実施の形態を示す図である。It is a figure which shows another embodiment of the programmable controller of this invention.

符号の説明Explanation of symbols

10 第1ネットワーク
11 パソコン
12 第1PLC
13 第2ネットワーク
16 第2PLC
17 第3PLC
18 リモートIO
20 CPUユニット
21 PLC用TCP/IPアプリ群
22 PLC用トランスポート層プロトコルスタック
23 PLC用IPプロトコルスタック
24 イーサネットドライバ
25 イーサネットインタフェース
26 ドライバ
30 通信ユニット
31 TCP/IPアプリ群
32 トランスポート層プロトコルスタック
33 IPプロトコルスタック
34 TCP/IPブリッジ内蔵イーサネットドライバ
35 イーサネットインタフェース
36 ドライバ
40 内部バス
10 First network 11 Personal computer 12 First PLC
13 Second network 16 Second PLC
17 3rd PLC
18 Remote IO
20 CPU unit 21 PLC TCP / IP application group 22 PLC transport layer protocol stack 23 PLC IP protocol stack 24 Ethernet driver 25 Ethernet interface 26 driver 30 communication unit 31 TCP / IP application group 32 transport layer protocol stack 33 IP Protocol stack 34 Ethernet driver with built-in TCP / IP bridge 35 Ethernet interface 36 Driver 40 Internal bus

Claims (3)

CPUユニットと複数の通信ユニットとを内部バスで接続したプログラマブルコントローラであって、
前記CPUユニットは、
上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、ルーティング機能を有するインターネット層と、内部バス用のドライバとを備えるとともに、前記インターネット層に第1の内部バス用のドライバを接続するように構成し、第1の内部バス用ドライバから転送されてきたデータを、前記インターネット層にてルーティング処理し、ルーティング処理結果に基づきデータを前記トランスポート層及びまたは送信先の通信ユニット宛てに第1の内部バス用ドライバへ転送するものであり、
前記複数の通信ユニットのそれぞれは、
上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、インターネット層と、イーサネット(登録商標(以下、同様))ドライバと、イーサネットインタフェースと、を備えるとともに、前記イーサネットドライバに第2の内部バス用ドライバを接続するように構成し、
前記イーサネットドライバは、第2の内部バス用ドライバから転送されてきたデータを前記イーサネットインタフェースに転送する機能と、前記イーサネットインタフェースから転送されてきたデータを、そのデータのプロトコルヘッダ部を解析し、その解析内容によって第2の内部バス用ドライバ及びまたは前記インターネット層に転送する振り分け機能とを備えたものである
ことを特徴とするプログラマブルコントローラ。
A programmable controller in which a CPU unit and a plurality of communication units are connected by an internal bus,
The CPU unit is
In order from the top, it is provided with an application layer, a transport layer, an Internet layer having a routing function, and an internal bus driver compliant with the TCP / IP protocol, and the Internet layer has a first internal bus driver. The driver is configured to connect, the data transferred from the first internal bus driver is routed in the Internet layer, and the data is transferred to the transport layer and / or the destination communication based on the routing processing result To the first internal bus driver addressed to the unit,
Each of the plurality of communication units is
In order from the top, the Ethernet driver is provided with an application layer, a transport layer, an Internet layer, an Ethernet (registered trademark (hereinafter the same)) driver, and an Ethernet interface that comply with the TCP / IP protocol. Configured to connect a second internal bus driver;
The Ethernet driver has a function of transferring the data transferred from the second internal bus driver to the Ethernet interface, and analyzes the protocol header portion of the data transferred from the Ethernet interface. A programmable controller comprising a second internal bus driver and / or a distribution function for transferring to the Internet layer depending on the analysis content.
前記通信ユニットに、自ユニットのアプリケーション層が利用可能なポート番号の範囲を設定しておき、
通信ユニットにおける振り分け機能は、受け取ったデータの宛先ポート番号と上記範囲から転送先を決定するものであることを特徴とする請求項1に記載のプログラマブルコントローラ。
In the communication unit, a range of port numbers that can be used by the application layer of the own unit is set,
The programmable controller according to claim 1, wherein the distribution function in the communication unit determines a transfer destination from a destination port number of the received data and the range.
内部バスを有し、CPUユニットが内部バスに接続されたプログラマブルコントローラに対して、連結するとともにその内部バスに接続する通信ユニットであって、
上位から順に、TCP/IPプロトコルに準拠した、アプリケーション層と、トランスポート層と、インターネット層と、イーサネットドライバと、イーサネットインタフェースと、を備えるとともに、前記イーサネットドライバに、内部バス用のドライバを接続するように構成し、
前記イーサネットドライバは、前記内部バス用のドライバから転送されてきたデータは前記イーサネットインタフェースに転送する機能と、前記イーサネットインタフェースから転送されてきたデータは、そのデータのプロトコルヘッダ部を解析し、その内容によって前記内部バス用のドライバ及びまたは前記インターネット層に転送する振り分け機能とを備えた
ことを特徴とする通信ユニット。
A communication unit that has an internal bus and that is connected to the internal bus and connected to the programmable controller with the CPU unit connected to the internal bus,
In order from the top, it is provided with an application layer, a transport layer, an Internet layer, an Ethernet driver, and an Ethernet interface compliant with the TCP / IP protocol, and an internal bus driver is connected to the Ethernet driver. Configured as
The Ethernet driver has a function of transferring the data transferred from the driver for the internal bus to the Ethernet interface, and the data transferred from the Ethernet interface analyzes the protocol header part of the data, and the contents A communication unit comprising a driver for the internal bus and a distribution function for transferring to the Internet layer.
JP2007324385A 2007-12-17 2007-12-17 Programmable controller and communication unit Active JP4671056B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007324385A JP4671056B2 (en) 2007-12-17 2007-12-17 Programmable controller and communication unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007324385A JP4671056B2 (en) 2007-12-17 2007-12-17 Programmable controller and communication unit

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2006070431A Division JP4172490B2 (en) 2006-03-15 2006-03-15 Programmable controller

Publications (3)

Publication Number Publication Date
JP2008084343A true JP2008084343A (en) 2008-04-10
JP2008084343A5 JP2008084343A5 (en) 2008-11-20
JP4671056B2 JP4671056B2 (en) 2011-04-13

Family

ID=39355067

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007324385A Active JP4671056B2 (en) 2007-12-17 2007-12-17 Programmable controller and communication unit

Country Status (1)

Country Link
JP (1) JP4671056B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018045399A (en) * 2016-09-14 2018-03-22 株式会社日立産機システム Programmable controller
EP3547055A1 (en) 2018-03-30 2019-10-02 OMRON Corporation Control apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04149705A (en) * 1990-10-15 1992-05-22 Omron Corp Inter-network communication control system for programmable controller
JPH04172502A (en) * 1990-11-07 1992-06-19 Omron Corp Internetwork communication method in programmable controller
JP2001156793A (en) * 1999-11-29 2001-06-08 Pfu Ltd Dialup router with usb

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04149705A (en) * 1990-10-15 1992-05-22 Omron Corp Inter-network communication control system for programmable controller
JPH04172502A (en) * 1990-11-07 1992-06-19 Omron Corp Internetwork communication method in programmable controller
JP2001156793A (en) * 1999-11-29 2001-06-08 Pfu Ltd Dialup router with usb

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018045399A (en) * 2016-09-14 2018-03-22 株式会社日立産機システム Programmable controller
EP3547055A1 (en) 2018-03-30 2019-10-02 OMRON Corporation Control apparatus

Also Published As

Publication number Publication date
JP4671056B2 (en) 2011-04-13

Similar Documents

Publication Publication Date Title
JP4172490B2 (en) Programmable controller
EP2562970B1 (en) Switch, and flow table control method
JP5565476B2 (en) Network system and network flow tracking method
US20020059485A1 (en) Controller internal bus supporting the TCP/IP Protocol
US10523629B2 (en) Control apparatus, communication system, communication method, and program
US6738829B1 (en) System and method for implementing a generic enhanced network driver
US10594551B2 (en) Modular industrial automation device and method for configuring a modular industrial automation device
JP4671056B2 (en) Programmable controller and communication unit
US10374834B2 (en) Modular industrial automation appliance and method for transmitting messages via a backplane bus system of the modular industrial automation appliance
JP4513506B2 (en) Device management system and gateway device
JP2004306200A (en) Robot control system
US20040114591A1 (en) IP Routing Between Modules on a PLC Backplane
JP5089476B2 (en) Communication start system
US20130110973A1 (en) Programmable logic controller
JP2010028505A (en) Field network system and field controller
JP2010098429A (en) Network switching device, network switching device network switching apparatus, method and program for controlling the same
JP2005268988A (en) Heterogeneous network gateway system
JP2007172048A (en) Polling communication system and server system
JP2007174209A (en) Security communication system
JP7390879B2 (en) Communication processing device, communication processing method and program, and data structure of the header part of the network layer
JP3675806B2 (en) Address assignment method and apparatus in communication network
US20100205338A1 (en) Network connection system
JP2024018734A (en) Communication processing device and communication method
JP5543566B2 (en) Network device and device setting method
JP5768420B2 (en) Control system, control device, operation terminal and program

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081003

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090212

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: 20101222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101224

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110104

R150 Certificate of patent or registration of utility model

Ref document number: 4671056

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140128

Year of fee payment: 3