Japanese Patent Application JP2006-070431 filed on Mar. 15, 2006 is hereby incorporated by reference in its entirety for all purposes.
The present disclosure relates generally to programmable controllers and communication units.
In a network system used for factory automation, a programmable logic controller (PLC) and a computer are often connected through different networks. For example, Japanese Laid-open Patent Application No. 6-231113 describes a system in which a dedicated set of commands compatible for a dedicated protocol is used. However, such a dedicated protocol is designed by a manufacture of a PLC, and is used only with the corresponding PLC. Therefore, when there are PLCs made by different manufactures, a single protocol cannot commonly be used for such PLCs using different protocols.
In view of the above, it would be desirable to provide improved programmable logic controllers (PLCs) and communication units which can exchange data with each other through different networks.
The invention described herein provides a programmable controller including a CPU (central processing unit) unit; and a communication unit coupled to the CPU unit via an internal bus. Each of the CPU unit and the communication unit provides, in a descending order, an application layer, a transport layer, an internet layer, an Ethernet driver, and an Ethernet interface, which are compatible with a TCP/IP protocol. The internal bus is coupled to the internet layer of the CPU unit, and is coupled to the Ethernet driver of the communication unit. The internet layer of the CPU unit has a routing function which routes incoming data to at least one of the Ethernet driver of the CPU unit, or the internal bus. The Ethernet driver of the communication unit has a switching function which routes incoming data to at least one of the internet layer of the communication unit, or the internal bus.
The invention described herein provides a communication unit coupled to a CPU unit via an internal bus including an application layer; a transport layer; an internet layer; an Ethernet driver; and an Ethernet interface. The application layer, the transport layer, the internet layer, the Ethernet driver, and the Ethernet interface are compatible with a TCP/IP protocol. The internal bus is coupled to the Ethernet driver. The Ethernet driver has a switching function which routes incoming data to at least one of the internet layer, or the internal bus.
The invention described herein provides a programmable controller including a CPU (central processing unit) unit; and a plurality of communication units each coupled to the CPU unit via an internal bus. The CPU unit provides, in a descending order, an application layer, a transport layer, and an internet layer, which are compatible with a TCP/IP protocol. Each of the communication units provides, in a descending order, an application layer, a transport layer, an internet layer, an Ethernet driver, and an Ethernet interface, which are compatible with a TCP/IP protocol. The internal bus is coupled to the internet layer of the CPU unit, and is coupled to the Ethernet drivers of the communication units. The internet layer of the CPU unit has a routing function which routes incoming data to at least one of the Ethernet driver of the CPU unit, or the internal bus. The Ethernet drivers of the communication units have a switching function which routes incoming data to at least one of the internet layers of the communication units, or the internal bus.
These and other features and advantages of the invention will be described in more detail below with reference to associated drawings.
The invention may best be understood by reference to the following description taken in conjunction with the accompanying drawings, which illustrate specific embodiments of the present invention. In the drawings, similar reference numerals/symbols correspond to similar elements.
The first network 10 is an information network which primarily deals with manufacturing management information such as manufacturing instructions and manufacturing results. The PC 11 connected to the first network 10 is a management computer which performs setups for devices connected to the network system, and retrieves information sent from other devices. The second network 13 is a control network which controls manufacturing equipments. The second PLC 16 and the third PLC 17, and the remote I/Os 18 connected to the second network 13 communicate with each other through the second network 13 in a cyclic manner, and receive/transmit I/O (input/output) data of an input/output device connected to the remote I/Os 18. Each of the networks 10 and 13 may be implemented by the Ethernet®. As such, a PC, PLCs, and other devices connected to the network 10 and 13 have communication interfaces which can be connected to the Ethernet.
The first PLC 12 includes a CPU unit 20 and a communication unit 30. The first PLC 12 may include other suitable units which are not shown in
Each of the second PLC 16 and the third PLC 17 also includes the CPU unit 20 which contains TCP/IP applications, and the communication unit 30 which has a cyclic communication function. These PLCs 16 and 17 may include any suitable units which are not shown in the figure. The communication units 30 of the PLCs 30 and the CPU unit 20 of the first PLC 12 include communication interfaces which can be connected to the Ethernet. The CPU units 20 of the second PLC 16 and the third PLC 17 may include communication interfaces which can be connected to the Ethernet.
The CPU unit 20 includes, from the highest layer to the lowest layer, TCP/IP applications 21 for the PLC as the application layer, a transport layer protocol stack 22 for the PLC as the transport layer, an IP protocol stack 23 for the PLC as the Internet layer, and the Ethernet driver 24 and the Ethernet interface 25 as the link layer. The CPU unit 20 is connected to an internal bus 40 of the PLC, and includes driver 26 (or a first driver for the internal bus) which performs data transfer between units in the PLC. The driver 26 is coupled to the IP protocol stack 23 for the PLC, and is positioned lower than the IP protocol 23.
The transport layer protocol stack 22 for the PLC includes a TCP protocol stack and a UDP (user datagram protocol) protocol stack. The IP protocol stack 23 for the PLC is connected to the Ethernet interface 25 through the Ethernet driver 24 as a lower communication interface, and is connected to the Ethernet interface 35 in the communication unit 30 described later through driver 26.
The IP protocol stack 23 for the PLC has a routing function. Therefore, when the IP protocol stack 23 for the PLC receives a packet requiring IP routing, i.e., a packet with a destination of “its own MAC address and different IP address,” the stack 23 transfers the packet based on a IP routing table.
The TCP/IP applications 21 for the PLC, the transport layer protocol stack 22 for the PLC, the IP protocol stack 23 for the PLC, the Ethernet driver 24, and the Ethernet interface 25 are the same as the four-layer protocols constituting the standard TCP/IP. As such, the PC 11 having a communication interface which can be connected to the Ethernet is capable of exchanging data with the CPU unit 20 of the first PLC 12 using the TCP/IP protocol. In other words, when exchanging data between the PC 11 and the first PLC 12, a dedicated (or customized) protocol is not necessary, and thus, the standard TCP/IP protocol can be utilized.
Functions of each processing unit will be described below while describing the operation of the CPU unit 20.
The Ethernet driver 24 transfers all data transferred from the Ethernet interface 25 to the IP protocol stack 23 for the PLC (S12). The IP protocol stack 23 transfers the received data to the transport layer protocol stack 22 or the driver 26 based on the routing rules defined in the IP routing table (S13). The transport layer protocol stack 22 checks the destination port of the transferred data to see if it is a port number of a corresponding application (S14). If the destination port is a port of a compatible application, the transport layer protocol stack 22 transfers the data to the TCP/IP applications 21 (S15). The corresponding application in the TCP/IP applications 21 performs data processing based on the received data (S16). If the branch decision of the process step S14 determines that there is no corresponding application, the received data (or packets) is discarded (S17). Alternatively, the driver 26 adds an internal bus header for the communication unit to the received data, and transmits the data to the communication unit 30 through the internal bus 40 (S18).
The transport layer protocol stack 22 for the PLC checks the destination port of the transferred data to see if it is a port number of a corresponding application (S24). If the destination port is a port of a compatible application, the transport layer protocol stack 22 transfers the data to the TCP/IP applications 21 (S25). The corresponding application in the TCP/IP applications 21 performs data processing based on the received data (S26). If the branch decision of the process step S24 determines that there is no corresponding application, the received data (or packets) is discarded (S27).
The Ethernet driver 24 which has received the data transferred from the IP protocol stack 23 then 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 based on the Ethernet protocol (S30).
The above processes enable the CPU unit 20 to send data transferred from the TCP/IP applications 21 to the PC 11, etc. connected to the first network 10 through the Ethernet interface 25. The CPU unit also can send data transferred from the TCP/IP applications 21 to the communication unit 30. In addition, the CPU unit 20 can transfer data transferred from the communication unit 30 to the TCP/IP applications 21, or send the data to the first network 10 from the Ethernet interface 25.
The communication unit 30 includes, from the highest layer to the lowest layer, TCP/IP applications 31 as the application layer, a transport layer protocol stack 32 as the transport layer, an IP protocol stack 33 as the Internet layer, and the Ethernet driver 34 and the Ethernet interface 35 as the link layer. The Ethernet driver 34 in the communication unit 30 has a bridge function which is typically performed by a TCP/IP layer, and thus, may be referred to as an “Ethernet driver with a built-in bridge function.” The communication unit 30 is connected to an internal bus 40 of the PLC, and includes driver 36 (or a second driver for the internal bus) which performs data transfer between units in the PLC. The driver 36 is connected to the Ethernet driver 34, thereby exchanging data between the drivers 26 and 36 without going through the IP protocol stack 33.
The applications constituting the TCP/IP applications 31 are typically related only to the communication unit, and thus, are not necessarily the same as those of the applications constituting the TCP/IP applications 21 for the PLC. The transport layer protocol stack 32 includes a TCP protocol stack and a UDP protocol stack. The IP protocol stack 33 is connected to the Ethernet interface 35 through the Ethernet driver 34 as a lower communication interface. In this example embodiment, the IP protocol stack 33 of the communication unit 30 does not have a routing function. Thus, the stack 33 is different from the IP protocol stack 23 for the PLC in the CPU unit 20 in that the Internet layer of the communication unit 30 does not have a routing function. As such, when the IP protocol stack 33 receives a packet requiring IP routing, i.e., a packet with a destination of “its own MAC address and different IP address,” the stack 33 discards the packet.
According to the example embodiment of the invention, the Ethernet driver 34 is a driver which has functions of a typical Ethernet driver, and a “TCP/IP bridge function.” Here, the TCP/IP bridge function refers to functions of parsing (or analyzing) a protocol header of data received by the Ethernet interface 35, determining a destination based on the header, and forwarding the received data to the determined destination. A pattern of such a destination may be one of the followings: (1) both the IP protocol stack 33 and the driver 36, (2) the driver 36 only, and (3) the IP protocol stack 33 only.
This switching (or forwarding to one of the different destinations) process may depend on the TCP/IP applications 21 for the PLC of the CPU unit 20, the applications implemented by the TCP/IP applications 31 of the communication unit 30, or the functions achieved by the IP protocol stack 23 for the PLC, and by the IP protocol stack 33. Here, it is assume that the CPU unit 20 and the communication unit 30 implement the functions shown in
(1) Condition for Forwarding to Both the IP Protocol Stack 33 and the Driver 36
When the data type of the data received by the Ethernet driver 34 is “ARP (address resolution protocol) response data” (condition 1), the data is forwarded to the IP protocol stack 33 and the driver 36. The determination whether the data is ARP response data is made by checking if the frame type of the Ethernet header is “0x806” indicating that it is an ARP, and if the operation value of the ARP header following the Ethernet header is “2” indicating that it is a response (see,
(2) Condition for Forwarding Only to the Driver 36
When the data type of the received data is the IP routing data (Condition 2-1), ICMP error data addressed to the PLC (Condition 2-2), a TCP common application (client) (Condition 2-3), a UDP common application (client) (Condition 2-4), a UDP common application (client, fragment data) (Condition 2-5), a TCP application (server) (Condition 2-6), a TCP application (client) (Condition 2-7), a UDP application (server) (Condition 2-8), or a UDP application (client) (Condition 2-9), the Ethernet driver 34 transfers the data to the driver 36.
Specific determination for each condition based on protocol identification is performed as follows. First, if the destination IP address of the IP header of the received data is not the IP address of the communication unit 30, then the data satisfies Condition 2-1 (see,
If the type of the ICMP header of the received data is one of 3, 4, 5, 11, or 12, and if the attached IP datagram meets one of Conditions 2-3 to 2-9, then the data satisfies Condition 2-2 (see,
If the destination port number of the TCP header of the received data is within a range of ports assigned to the CPU unit, then the data satisfies Condition 2-3 (see,
Similarly, if the destination port number of the UDP header of the received data is within a range of ports assigned to the CPU unit, then the data satisfies Condition 2-4 (see,
If the destination port number of the TCP header of the received data is not a support server port (server application A) of the TCP/IP applications 31 of the communication unit 30, then the data satisfies Condition 2-6 (see,
If the origin port number of the TCP header of the received data is not a support client port (client application B) of the TCP/IP applications 31 of the communication unit 30, then the data satisfies Condition 2-7 (see,
If the destination port number of the UDP header of the received data is not a support server port (server application E) of the TCP/IP applications 31 of the communication unit 30, then the data satisfies Condition 2-8 (see,
If the origin port number of the UDP header of the received data is not a support client port (client application F) of the TCP/IP applications 31 of the communication unit 30, then the data satisfies Condition 2-9 (see,
(3) Condition for Forwarding Only to the IP Protocol Stack 33
If the received data satisfies none of Conditions 2-1 to 2-9, the data is forwarded to the IP protocol stack 33.
Functions of each processing unit will be described below while describing the operation of the communication unit 30.
The IP protocol stack 33 checks the destination IP address of the packet (S43). If the destination IP address is its own IP address, then the IP protocol stack 33 transfers the received data to the transport layer protocol stack 32 (S44). If the destination IP address is other than its own IP address, then the received data is discarded (S48).
The transport layer protocol stack 32 checks the destination port of the transferred data to see if it is a port number of a corresponding application (S45). If the destination port is a port of a compatible application, the transport layer protocol stack 32 transfers the data to the TCP/IP applications 31 (S46). The corresponding application in the TCP/IP applications 31 performs data processing based on the received data (S47). If the branch decision of the process step S45 determines that there is no corresponding application, the received data (or packets) is discarded (S48). Alternatively, the driver 36 adds an internal bus header for the CPU unit to the received data, and transmits the data to the CPU unit 20 through the internal bus 40 (S49).
The above processes enable the communication unit 30 to send data transferred from the TCP/IP applications 31 to the PLCs, etc. connected to the second network 13 through the Ethernet interface 35. The communication unit 30 also can send data transferred from the CPU unit 20 to the second network 13. In other words, the communication unit 30 can transfer data transferred from an application of the TCP/IP applications 21 for the PLC, or data received from the PC 11 through the CPU unit 20 to the PLCs, etc. connected to the second network 13. Conversely, the PLCs or other devices connected to the second network 13 can exchange data through the communication unit 30 with an application of the TCP/IP applications 21 for the PLC of the CPU unit in the first PLC 12, and further can exchange data with the PC 11, etc. connected to the first network 10.
An example of a specific implementation will now be described. In
First, the PC 11 performs an 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 that connected to the PC 11, the PLC 16 transmits packets for FTP access to the CPU unit 20a of the first PLC 12 according to default gateway information of the PC 11.
The CPU unit 20a of the first PLC 12 performs the process described above referring to
The communication unit 30b performs the process described above referring to
The CPU unit 20b of the second PLC 16 performs the process described referring to
The communication unit 30a performs the process described above referring to
The CPU unit 20a of the first PLC 12 recognizes that the transferred FTP response packets from the communication unit 30a are addressed to the PC 11. Since the CPU unit 20a recognizes that the PC 11 and the CPU unit 20a are connected to the same network, the CPU unit 20a transmits the FTP response packets to the PC 11 (corresponding to S15 of
The PC 11 performs a receiving process of the FTP response packets sent from the CPU unit 20a. The above process enables data exchange between the PC 11 and the PLC 16 (i.e., the CPU unit 20b) utilizing a general-purpose protocol.
Assume that the PC 11 accesses to an FTP server of the CPU unit 20b in the second PLC 16. Specifically, the PC 11 here performs an 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 that connected to the PC 11, the PLC 16 transmits FTP access packets to the second communication unit 30c of the first PLC 12 according to default gateway information of the PC 11.
The PC 11 transmits the FTP access packets. First, the second communication unit 30c of the first PLC 12 performs a process shown in
The IP protocol stack 23 for the PLC of the CPU unit 20a in the first PLC 12 recognizes that the FTP access packets transferred from the second communication unit 30c are addressed to the CPU unit 20b of the second PLC 16. The CPU unit 20a also recognizes that the first communication unit 30a and the second PLC 16 are connected to the second network 13. Then, the CPU unit 20a transfers the FTP access packets from the driver 28a to the communication unit 30a through the internal bus 40 (corresponding to S18). The communication unit 30a performs the process described above referring to
The communication unit 30b of the second PLC 16 performs the process described above referring to
The CPU unit 20b of the second PLC 16 performs a response to the PC 11 as follows. The CPU unit 20b transmits an FTP response addressed to the PC 11 (IP address=192.168.0.1). Since the PC 11 is connected to a network different from that connected to the CPU unit 20b, the PC 11 transmits the FTP access packets to the communication unit 30b in order to transmit the FTP access packets to the CPU unit 30a of the first PLC 12 according to default gateway information of the CPU unit 20b (corresponding to S7 of
The first communication unit 30a transfers the received FTP response packets to the CPU unit 20a through the internal bus 40 according to the TCP/IP bridge (switch) Condition 2-1 since the received FTP response packets are addressed to its own IP address (S49 of
The CPU unit 20a receives the FTP response packets at the driver 28a, and performs the receiving process shown in
The PC 11 performs a receiving process for the FTP response packets sent from the CPU unit 20a. According to the above processes, the PC 11 and the PLC 16 (i.e., the CPU unit 20b) can exchange data by utilizing a general-purpose protocol.
In the above example embodiment, the drivers 28a and 28b for the internal bus in the CPU unit 20a correspond to the communication units 30a and 30c, respectively. In this configuration, the driver 28a for the internal bus performs data bus communication with the communication unit 30a one-by-one, and the driver 28b for the internal bus performs data bus communication with the communication unit 30c. However, the invention is not limited to such a configuration. Specifically, a single driver for the internal bus is commonly used for all communication units. In such a case, since the internal bus 40 is a single common bus, a common driver for the internal bus may have a function of transferring data to a destination communication unit by identifying the destination communication unit.
According to the example embodiment of the invention, the routing function is provided within the CPU unit. Since such a configuration does not require a communication unit including the routing function, the system does not need a routing table, etc. and enables a simple configuration. Since the Ethernet driver in the communication unit has a switching function, the communication unit can transfer data received from the Ethernet driver of the communication unit to the CPU unit. In addition, the CPU unit can perform a routing process on data transferred through the internal bus, and data received through the Ethernet interface of its own CPU unit. When the data is addressed to the CPU unit, the system can transfer the data to the upper application layer, thereby performing necessary processing on the data.
Further, if the data is addressed to a destination other than the CPU unit, the system can transfer the data through the internal bus to the communication unit. The communication unit can also transfer the data transferred through the internal bus to an external network. As such, the CPU unit can exchange data with the PLCs or other devices connected to the network to which the communication unit is connected. In other words, through the Ethernet, such PLCs and other devices can utilize the applications in the application layer of the CPU unit which are not directly connected to PLCs and other devices. In addition, such data exchange can be performed using a general-purpose TCP/IP protocol.
Data can be transferred between multiple communication units through a CPU unit by utilizing a transferring function of the multiple communication units, and the routing function of the CPU unit. Such system enables data exchange between devices on a network connected to one communication unit, and devices on a network connected to another communication unit by utilizing a general-purpose TCP/IP protocol. The number of the communication units may be three or more.
In addition, the communication unit may assign a range of the port numbers available to the application layer of the unit of interest. The switching function at the communication unit may be implemented based on the destination port number of the received data, and the assigned range of the port numbers. In other words, by comparing the destination port number of the received data to the range, the data can be switched to the application layer of its own unit if the port number is within the range, or to the internal bus driver or the Ethernet driver if it is not, thereby directly transferring the data to the internal bus or the Ethernet.
The example embodiment of the invention utilizes the routing function of the Internet layer implemented in the CPU unit, and the switching function of the Ethernet driver implemented in the communication unit. Such a system enables access from devices connected to the communication unit to the CPU unit using a general-purpose network protocol. When multiple PLCs are connected to multiple networks, devices (computers, PLCs, etc.) connected to such different networks can exchange data through a PLC according to the invention using a general-purpose protocol.
Although the foregoing invention has been described in some detail for purposes of clarity of understanding, it will be apparent that certain changes and modifications may be practiced without departing from the spirit and scope of the invention as defined in the claims. Further, features of the invention described herein may be provided alone or in any combination.
Number | Date | Country | Kind |
---|---|---|---|
JP2006-070431 | Mar 2006 | JP | national |
Number | Date | Country | |
---|---|---|---|
61007913 | May 2007 | US |