The present application is related to and claims priority from Japanese patent application no. 2017-247373, filed on Dec. 25, 2017. The entire contents of the aforementioned application are hereby incorporated by reference herein.
The present technology relates to a control system and a control device which controls a control target.
A programmable controller (PLC), etc., is used as a control device for controlling various facilities and manufacturing apparatuses. Further, there is a safety system including a safety controller and various safety components.
With the advancement of information and communication technology (ICT), networking of such industrial controllers is ongoing. In a known configuration, for example, a communication unit in charge of communication processing is provided in addition to a CPU unit which executes arithmetic processing, as disclosed in Patent Document 1 (Japanese Unexamined Patent Application Publication No. 2009-223398). In general, a communication module which is an example of an IO module is provided separately from a CPU module to perform communication processing, as disclosed in Patent Document 2 (Japanese Unexamined Patent Application Publication No. 2017-027539).
In the configuration as disclosed in the aforementioned Patent Document 2, a CPU module and a communication module need to be provided one for one basically and thus a plurality of communication modules need to be prepared when a plurality of CPU modules perform communication processing.
Accordingly, there is a need for a configuration capable of flexibly realizing communication processing without requiring additional units even when a plurality of units having a communication function are present.
In one aspect, a control system according to an embodiment controls a control target. The control system includes a first unit having a first communication port for transmitting and receiving data and one or a plurality of second units electrically connected to the first unit. Each of the second units includes a logical communication unit for transmitting/receiving data to/from a device electrically connected to the first communication port of the first unit. The first unit includes a forwarding processing unit which forwards transmission data transmitted from the second unit to a device which is a transmission destination.
Embodiments of the present disclosure will be described with reference to the drawings. The same or corresponding parts in the figures are denoted by the same reference signs and description thereof will not be repeated.
<A. Example of Application>
First, an example of a situation to which the present disclosure may be applied will be described with reference to
For comparison, the control system 1X according to the technology related to the present disclosure will be described first. Referring to
Regarding the configuration of the control system 1X shown in
The CPU unit 100X is equivalent to an arithmetic processing unit which executes a control program for calculating command values for a control target. The communication units 200X-1, 200X-2 and 200X-3 are examples of the communication unit, and respectively execute a process of transmitting/receiving data such as a communication frame to/from the communication devices 300-1, 300-2 and 300-3. The communication units 200X-1, 200X-2 and 200X-3 respectively have communication ports 250X-1, 250X-2 and 250X-3 for transmitting/receiving data.
In this manner, the control system 1X shown in
(1) Since circuit components necessary for communication processing including the communication port of each communication unit 200X are operated, hardware costs increase.
(2) When a communication function needs to be realized in each communication unit 200X and corresponds to a plurality of communication protocols, development costs and development time for each communication unit 200X increase.
With respect to these problems, the control system 1 according to the present embodiment provides an environment in which a communication function of a specific unit can be used by other units. That is, a communication function of a specific unit is shared with other units to solve the aforementioned problems which may be generated in the control system 1X according to the technology related to the present disclosure.
More specifically, referring to
In the present description, “communication unit” includes a unit in which at least logical communication processing for transmitting/receiving data to/from a communication target (communication device 300 in the example shown in
For example, referring to an OSI reference model, the logical communication unit 270 has layers corresponding to a network layer, a transport layer, a session layer, a presentation layer, an application layer and the like. However, the logical communication unit 270 does not have a physical layer.
For example, a safety unit or the like which provides a safety function to a control target may be considered as the typical communication unit 200. The safety unit may have an arithmetic processing unit for cyclically executing safety logic in addition to the logical communication unit. However, “communication unit” in the present description is not limited to the safety unit and may be a unit which monitors a network to which the CPU unit 100 is connected, a unit which provides a database and various server functions, and the like, for example.
The CPU unit 100 is a kind of control device and has a communication port 150 for transmitting/receiving data. The communication port 150 of the CPU unit 100 is not limited to be in the CPU unit 100 and may be used by the communication unit 200 connected to the CPU unit 100. Accordingly, the logical communication unit 270 of the communication unit 200 is configured to transmit/receive data to/from the communication device 300 electrically connected to the communication port 150 of the CPU unit 100.
That is, the CPU unit 100 may relay (bridge) data received from the communication unit 200 to the communication port 150. In addition, the CPU unit 100 may relay (bridge) data received through the communication port 150 to the communication unit 200.
The CPU unit 100 has a forwarding processing unit which forwards transmission data transmitted from the communication unit 200 to a communication device 300 which is a transmission destination. According to this forwarding processing unit, data sent from the communication unit 200 is forwarded to the CPU unit 100 and sent from the communication port 150 of the CPU unit 100 to the communication device 300 which is a target.
The forwarding processing unit of the CPU unit 100 forwards reception data received from any communication device 300 to a communication unit 200 which is a transmission destination of the reception data. According to this forwarding processing unit, data sent from a certain communication device 300 is received by the communication port 150 of the CPU unit 100 and sent from the CPU unit 100 to the communication unit 200 which is a target.
Such relaying between each communication unit 200 and each communication device 300 is performed according to data exchange information 180 stored in the CPU unit 100.
As will be described later, the CPU unit 100 and each communication unit 200 are typically connected through a communication line (hereinafter referred to as an “internal bus”). The CPU unit 100 forwards data received from any communication device 300 through the communication port 150 to a communication unit 200 which is a transmission destination through the internal bus according to the data exchange information 180 and forwards data received from any communication unit 200 through the internal bus to a communication device 300 which is a transmission destination through the communication port 150.
When the configuration shown in
Meanwhile, as a communication protocol for transmitting/receiving data to/from the communication device 300 through the communication port 150 of the CPU unit 100, EtherNet/IP (registered trademark), EtherCAT (registered trademark), Functional Safety over EtherCAT (FSoE), CIP Safety (on EtherNet/IP or on DeviceNet), Profinet Safety and the like in addition to general TCP/IP may be used. Further, the communication protocol is not limited to these communication protocols and any communication protocol may be employed.
In the following description, main data transmitted/received between the communication unit 200 and the communication device 300 is described as a “communication frame.” However, “control information” may be added to a “communication frame” between the CPU unit 100 and the communication unit 200 which perform forwarding processing and in the inside of the CPU unit 100, and thus data which is a combination of the control information and the communication frame may be a transmission/reception target.
Meanwhile, data transmitted/received is not limitedly interpreted based on the term “communication frame” and there may be cases in which the data is transmitted/received in units of “packet” and in units of a longer data string, for example.
<B. Example of Hardware Configuration>
Next, an example of a hardware configuration of each unit constituting the control system 1 according to the present embodiment will be described.
(b1: Connection Configuration Between Units)
As an example, serial communication is employed for the internal buses 40 (downlink 42 and uplink 44) and data which is a communication target is sequentially transmitted in the form of arrangement in a line and in time series. Data is sequentially transmitted from the CPU unit 100 to the communication unit 200 in one direction on the downlink 42. On the other hand, data is sequentially transmitted from any communication unit 200 to the CPU unit 100 in one direction on the uplink 44.
When each communication unit 200 receives a communication frame transmitted on the downlink 42 or the uplink 44, each communication unit 200 decodes data from the communication frame and performs a required process. In addition, each communication unit 200 retransmits (forwards) the received communication frame to the communication unit 200 of the next stage.
To realize such a communication frame retransmission (forwarding) process, each communication unit 200 includes a reception unit (hereinafter represented as “RX”) 230R and a transmission unit (hereinafter represented as “TX”) 230T with respect to the downlink 42 and includes a reception unit 240R and a transmission unit 240T with respect to the uplink 44. In addition, each communication unit 200 includes a processor 202.
The CPU unit 100 includes a network communication unit 120 and an internal bus communication unit 130. The network communication unit 120 performs a process of sending a communication frame from the communication port 150 and a process of receiving a communication frame through the communication port 150. The internal bus communication unit 130 performs a process of sending a communication frame and a process of receiving a communication frame through the internal buses 40. The processes in the network communication unit 120 and the internal bus communication unit 130 are controlled by a processor 102. That is, the processor 102 realizes a forwarding process by executing a system program 106.
(b2: Example of Configuration of CPU Unit 100)
The processor 102 realizes a control process for the network communication unit 120 and the internal bus communication unit 130 by reading and executing the system program 106 stored in the flash memory 104. Processes performed by the processor 102 will be described in detail later.
The flash memory 104 stores configuration information 108 and the data exchange information 180 in addition to the system program 106.
The configuration information 108 includes set values and the like of the communication units 200 respectively connected to the CPU unit 100.
The data exchange information 180 includes route information and the like for controlling transmission and reception of communication frames between each communication unit 200 and the communication device 300 as will be described later.
Connection management information 182 in addition to working data which is not shown is disposed in the RAM 110. The connection management information 182 includes management information required for a process of transmitting a communication frame from the CPU unit 100 to the communication device 300 as will be described later. Typically, the connection management information 182 is appropriately generated or updated whenever connection with a transmission destination is established.
The network communication unit 120 includes a network controller 122, a transception (transmission/reception)circuit 124 and a shared memory 128.
The network controller 122 performs a forwarding process and the like on communication frames accumulated in the shared memory 128.
The transception circuit 124 modulates a data string provided from the network controller 122 into electric signals, sends the electric signals through a network cable connected to the communication port 150, demodulates the electric signals received through the network cable connected to the communication port 150 into a data string and outputs the data string to the network controller 122.
The shared memory 128 allows data access from the processor 102 and the internal bus communication unit 130 in addition to the network controller 122. The shared memory 128 has a reception buffer 128R and a transmission buffer 128T. Communication frames received through the communication port 150 are accumulated in the reception buffer 128R and communication frames scheduled to be sent through the communication port 150 are accumulated in the transmission buffer 128T.
The internal bus communication unit 130 includes an internal bus controller 132, a transmission circuit 134, a reception circuit 136 and a shared memory 138.
The internal bus controller 132 performs a forwarding process and the like on communication frames accumulated in the shared memory 138.
The transmission circuit 134 modules a data string provided from the internal bus controller 132 into electric signals and sends the electric signals through the internal bus 40 (downlink 42). The reception circuit 136 demodulates electric signals received through the internal bus 40 (uplink 44) into a data string and outputs the data string to the internal bus controller 132.
The shared memory 138 allows data access from the processor 102 and the network communication unit 120 in addition to the internal bus controller 132. The shared memory 138 has a reception buffer 138R and a transmission buffer 138T. Communication frames received through the internal bus 40 (uplink 44) are accumulated in the reception buffer 138R and communication frames scheduled to be sent through the internal bus 40 (downlink 42) are accumulated in the transmission buffer 138T.
(b3: Example of Configuration of Communication Unit 200)
The processor 202 realizes a control process for a control target by reading and executing a system program 216 and an application program 218 stored in the flash memory 204. A process of transmitting/receiving data to/from any communication device 300 may be defined in the application program 218.
That is, the logical communication unit 270 shown in
The functional module 206 is a hardware circuit for realizing a process performed by each communication unit 200 and may include a circuit for receiving an input signal from a field, a circuit for generating an output signal to the field, a circuit for performing serial communication with other controllers, and the like, for example. Meanwhile, the functional module 206 may be omitted when the processor 202 can realize a necessary process by executing the application program 218.
The shared memory 208 allows data access from the processor 202 and the like in addition to the internal bus communication unit 220. The shared memory 208 has a reception buffer 208R and a transmission buffer 208T. Communication frames received by the internal bus communication unit 220 are accumulated in the reception buffer 208R and communication frames scheduled to be sent by the internal bus communication unit 220 are accumulated in the transmission buffer 208T.
The internal bus communication unit 220 includes de-serializers (hereinafter referred to as “DES”) 232 and 242, serializers (hereinafter referred to as “SER”) 236 and 246, and forwarding controllers 234 and 244.
The DES 232, the forwarding controller 234 and the SER 236 correspond to the reception unit 230R and the transmission unit 230T with respect to the downlink 42 shown in
The internal bus communication unit 220 further includes a reception processing unit 250 and a transmission processing unit 260.
The reception processing unit 250 is connected to the forwarding controllers 234 and 244 and processes a communication frame received from the communication unit 200 of the previous stage. The reception processing unit 250 includes a decoding unit 252 and a CRC check unit 254. The decoding unit 252 decodes the communication frames received in the forwarding controllers 234 and 244 into data according to a predetermined algorithm. The CRC check unit 254 performs error check (e.g., cyclic redundancy check (CRC) code) based on a frame check sequence (FCS) added to the end of a communication frame. Data output from the reception processing unit 250 is accumulated in the reception buffer 208R.
The transmission processing unit 260 is connected to the forwarding controllers 234 and 244 and performs generation and timing control of a communication frame retransmitted (forwarded) to the communication unit 200 of the next stage, and the like according to an instruction from the processor 202 or the like. The transmission processing unit 260 includes a CRC generation unit 262 and an encoding unit 264. The CRC generation unit 262 adds an error control code (CRC) to data accumulated in the transmission buffer 208T. The encoding unit 264 encodes data from the CRC generation unit 262 and outputs the encoded data to the corresponding forwarding controller 234 or 244.
<C. Communication Processing Between Communication Unit and Communication Device>
Next, configurations and processes with respect to communication processing between the communication unit 200 and the communication device 300 will be described.
(c1: Connection Configuration)
Data is exchanged between the CPU unit 100 and each communication unit 200 in a predetermined update period. More specifically, OUT data (command value) transmitted from the CPU unit 100 to each communication unit 200 and IN data (measurement value, state value and the like) transmitted from each communication unit 200 to the CPU unit 100 are transmitted through the internal buses 40 in each predetermined update period, and thus data stored in the CPU unit 100 and each communication unit 200 is updated in each predetermined update period. Such data update in each predetermined period through the internal buses 40 is referred to as “IO refresh”.
In the present description, “IO refresh” includes a process of performing data exchange between the CPU unit 100 and one or a plurality of communication units 200 in each predetermined period (hereinafter referred to as “IO refresh period”).
In the CPU unit 100, data updated through IO refresh is stored in the shared memory 138 of the internal bus communication unit 130. The IO refresh period is hundreds of μs to several ms, in general, and may realize high-speed data update.
In the control system 1 according to the present embodiment, communication frames generated by the communication unit 200 and communication frames received from the communication device 300 are transmitted using IO refresh through the internal buses 40.
The internal bus communication unit 130 of the CPU unit 100 and the internal bus communication unit 220 of the communication unit 200 correspond to data communication units for performing data exchange in each IO refresh period.
Further, communication processing (communication frame transmission/reception process) between the CPU unit 100 and the communication device 300 is performed by the network communication unit 120 of the CPU unit 100. Communication frames transmitted/received to/from the communication device 300 are accumulated in the shared memory 128 of the network communication unit 120.
In the CPU unit 100, appropriate data exchange between communication frames accumulated in the shared memory 128 of the network communication unit 120 and communication frames accumulated in the shared memory 138 of the internal bus communication unit 130 is performed to realize communication processing between the one or a plurality of communication units 200 and the one or a plurality of communication devices 300. That is, the CPU unit 100 serves as a router which mediates communication processing between the communication unit 200 and the communication device 300 by mutually forwarding data transmitted/received through the internal buses 40 and data transmitted/received through the communication port 150 and network cables to each other.
As shown in
In IO refresh, data is exchanged between the shared memory 138 of the internal bus communication unit 130 of the CPU unit 100 and the communication unit 200.
Subsequently, data is exchanged between the shared memory 138 of the internal bus communication unit 130 of the CPU unit 100 and the shared memory 128 of the network communication unit 120 ((3) data exchange). Data exchange between the shared memory 138 and the shared memory 128 is executed according to data exchange information 180 prepared in advance.
Typically, the data exchange information 180 may be set by a user using a support device or the like. The data exchange information 180 includes a memory address of a transmission source, a memory address of a transmission destination, a transmission size, and the like.
Thereafter, the network communication unit 120 of the CPU unit 100 transmits communication frames accumulated in the shared memory 128 to the communication device 300 or accumulates communication frames received from the communication device 300 in the shared memory 128 ((4) communication frame transmission/reception). Further, when control information has been added to communication frames accumulated in the shared memory 128, communication frames from which the control information has been excluded are transmitted according to a communication protocol defined in the added control information.
A communication frame received by the CPU unit 100 from the communication device 300 is forwarded to a communication unit 200 of a target through a procedure reverses for the communication frame. In addition, the communication unit 200 processes the received communication frame ((5) communication frame processing).
As shown in
The CPU unit 100 performs data exchange between the first storage region (shared memory 138) and the second storage region (shared memory 128) according to the predetermined data exchange information 180. Communication frames are relayed between such storage regions to realize communication processing between the communication unit 200 and the communication device 300.
(c2: Memory Layout and Data Exchange Information)
Next, memory layouts in the shared memory 128 of the network communication unit 120 and the shared memory 138 of the internal bus communication unit 130 in the CPU unit 100 and the data exchange information 180 for exchanging data between the shared memories will be described.
A part of the IN data includes a communication frame transmitted from the communication unit 200 and the OUT data includes a communication frame forwarded to the communication unit 200.
Further, regions are respectively allocated to the communication units 200-1, 200-2, 200-3, . . . in the shared memory 128 of the network communication unit 120. Only communication frames transmitted/received to/from the communication device 300 are stored in the shared memory 128.
To match the layout of the shared memory 138 with the layout of the shared memory 128, the data exchange information 180 is referred to. That is, the data exchange information 180 defines whether a communication frame present in the shared memory 138 corresponds to a communication frame present at any position in the shared memory 128 and defines whether a communication frame present in the shared memory 128 corresponds to a communication frame present at any position in the shared memory 138.
In this manner, data exchange performed in the CPU unit 100 includes a process of writing a communication frame present in the shared memory 138 and transmitted from the communication unit 200 at an appropriate position in the shared memory 128 with reference to the data exchange information 180 and a process of writing a communication frame present in the shared memory 128 and directed to the communication unit 200 at an appropriate position in the shared memory 138.
One of the internal bus communication unit 130 and the network communication unit 120 is the transmission source and the other is the transmission destination. In addition, a memory address in the shared memory 128 or the shared memory 138 is defined as a memory address. The transmission size represents the size of a communication frame which is an exchange target, or the like.
For example, when a communication frame is transmitted from the communication unit 200 to any communication device 300, the data exchange information 180 includes (1) a path (copy source) of a storage region in the communication unit 200 which is the target, (2) a path (copy destination) of a storage region in the shared memory 138 of the internal bus communication unit 130 and (3) data sizes of the communication frame and control information addressed to the communication device 300.
On the contrary, when a communication frame is transmitted from any communication device 300 to the communication unit 200, the data exchange information 180 includes (1) a path (copy source) of a storage region in the shared memory 138 of the internal bus communication unit 130, (2) a path (copy destination) of a storage region in the communication unit 200 which is the target and (3) data sizes of the communication frame and control information addressed to the communication unit 200.
Meanwhile, a path of a storage region is allocated from the beginning in the order set for transmission and reception to control data arrangement so as not to exceed the size of the storage region.
(c3: Communication Frame Transmission Process)
Next, a process when a communication frame is transmitted from the communication unit 200 will be described.
In the control system 1 according to the present embodiment, a communication frame is transmitted using IO refresh which is high-speed and cyclic data transmission in order to guarantee responsiveness of the communication frame. However, when IO refresh is used, data exchange is performed in each IO refresh update period irrespective of whether a communication frame to be transmitted is newly added, and thus control information updated each time is added to a communication frame in order to detect generation of a new communication frame.
When the CPU unit 100 is requested to transmit communication frames using IO refresh in this manner, changes of communication frames need to be managed and control information is used to detect such changes of communication frames.
More specifically, when the communication unit 200 generates and transmits a communication frame, the contents of control information added to the communication frame is updated. The CPU unit 100 monitors the contents of control information added to each communication frame accumulated in the shared memory 128 for each predetermined period (hereinafter referred to as a “communication frame polling period”). When the CPU unit 100 detects the update of the contents of control information added to any communication frame, the CPU unit 100 starts a process of transmitting the communication frame to which the control information whose update has been detected has been added.
That is, the CPU unit 100 checks control information added to a communication frame data-exchanged with the communication unit 200 according to IO refresh for each communication frame polling period and transmits the communication frame by using a change in the control information as a trigger. By using such control information, communication frame transmission can be realized using IO refresh which is cyclic data exchange.
Although the communication frame polling period is basically set to a time longer than the IO refresh period, it may have the same duration as the IO refresh period or may be set to a time shorter than the IO refresh period.
Meanwhile, when a safety unit is used as the communication unit 200, the communication frame polling period may be set to the duration of a safety task period. That is, data transmission and reception may be performed in a safety task monitoring period.
When the communication frame 402 (transmission data) to be newly transmitted is generated, control information 404 having different contents from control information 404 added to a previously generated communication frame 402 (transmission data) is added to the communication frame 402 to be newly transmitted and data exchange with the CPU unit 100 is performed. As an example, the control information 404 added to the communication frame 402 includes a value which increments (or decrements) when communication frame 402 to be newly transmitted is generated. That is, when the communication frame 402 (transmission data) to be newly transmitted is generated, new control information 404 is generated by incrementing or decrementing the value of the control information 404 added to the previously generated communication frame 402 (transmission data).
In the example shown in
In this manner, the communication unit 200 generates the communication frame 402 in each predetermined transmission period and updates the value of the control information 404 added to the generated communication frame 402 according to a predetermined rule.
The communication frame 402 generated by the communication unit 200 and the control information 404 added to the communication frame 402 are targets of IO refresh and are transmitted to the shared memory 138 of the internal bus communication unit 130 in each IO refresh period. A communication frame 412 from the communication unit 200 and control information 414 added to the communication frame 412, which are stored in the shared memory 138, are updated in each IO refresh period ((2) IO refresh).
In the CPU unit 100, data is exchanged between the shared memory 138 of the internal bus communication unit 130 and the shared memory 128 of the network communication unit 120 ((3) data exchange). As a result of data exchange, the same communication frame 422 and the same control information 424 as those generated by the communication unit 200 are stored in the shared memory 128. Since data exchange between the shared memory 138 and the shared memory 128 is cyclically performed in a period equal to or shorter than the IO refresh period, update of the communication frame 412 and the control information 414 added to the communication frame 412 in the shared memory 128 and update of the communication frame 422 and the control information 424 added to the communication frame 422 in the shared memory 138 are performed almost simultaneously.
The network communication unit 120 monitors the value of the control information 424 in the shared memory 138 for each communication frame polling period. When a change in the value of the control information 424 is detected, the network communication unit 120 transmits a communication frame 432 corresponding to the communication frame 422 to which the control information 424 having the changed value has been added ((4) communication frame transmission and reception).
In the example shown in
At the subsequent third communication frame polling period, change of the control information 404 from “100” to “101” is detected, and thus the communication frame 432 is transmitted.
In this manner, the network communication unit 120 of the CPU unit 100 monitors whether a communication frame 432 to be transmitted has arrived for each predetermined transmission period (communication frame polling period) and starts transmission of the communication frame 432 when it is determined that the communication frame 432 has arrived.
When a communication frame stored in the shared memory 128 is transmitted, the application protocol stack 1222 searches for settings of the data exchange information 180 corresponding to the target communication frame and the connection management information 182.
For example, the connection management information 182 includes a connection ID, a transmission destination IP address, a used UDP port, a communication frame sequence count and the like. The application protocol stack 1222 establishes a connection with a transmission destination prior to transmission of a communication frame.
The TCP/IP protocol stack 1224 generates an Ethernet (registered trademark) frame on the basis of a communication frame which is a transmission target and the connection management information 182. The physical layer driver 1226 gives a command to the transmission/reception circuit 124 such that the Ethernet frame from the TCP/IP protocol stack 1224 can be output as an electric signal.
A communication frame generated by the communication unit 200 is transmitted to the communication device 300 through the CPU unit 100 according to the above-described procedure.
Referring to
If there is a communication frame to be transmitted (YES in step S100), the communication unit 200 determines the contents of control information added to the communication frame to be transmitted (step S102) and stores the communication frame to be transmitted and the determined control information in the transmission buffer 128T of the shared memory 128 (step S104).
Subsequently, the communication unit 200 determines whether an IO refresh period has arrived (step S106). If an IO refresh period has not been reached (NO in step S106), the communication unit 200 waits for arrival of an IO refresh period.
If the IO refresh period has arrived (YES in step S106), the communication unit 200 executes IO refresh and perform data exchange with the CPU unit 100 (step S108). Then, the process of step S100 and subsequent steps are repeated.
Meanwhile, first, the CPU unit 100 establishes a connection with a transmission destination of a communication frame which is a transmission target according to predetermined settings (step S200). When the connection is established, the connection management information 182 for managing the established connection is generated or updated. Subsequently, the CPU unit 100 determines whether the IO refresh period has arrived (step S202). If an IO refresh period has not arrived (NO in step S202), the CPU unit 100 waits for arrival of an IO refresh period.
If the IO refresh period has arrived (YES in step S202), the CPU unit 100 executes IO refresh and performs data exchange with the communication unit 200 (step S204). Data acquired through data exchange is stored in the shared memory 138 of the internal bus communication unit 130. Subsequently, the CPU unit 100 performs data exchange between the shared memory 138 of the internal bus communication unit 130 and the shared memory 128 of the network communication unit 120 according to the data exchange information 180 (step S206).
The CPU unit 100 determines whether a communication frame polling period has arrived (step S208). If the communication frame polling period has not arrived (NO in step S208), the process of step S202 and subsequent steps are repeated.
If the communication frame polling period has arrived (YES in step S208), the CPU unit 100 determines whether there is control information having a changed value among control information in the shared memory 138 of the internal bus communication unit 130 (step S210). If there is no control information having a changed value among the control information in the shared memory 138 of the internal bus communication unit 130 (NO in step S210), the process of step S202 and subsequent steps are repeated.
If there is control information having a changed value among the control information in the shared memory 138 of the internal bus communication unit 130 (YES in step S210), the CPU unit 100 determines whether connection with a transmission destination has been established with respect to a communication frame which is a transmission target corresponding to the control information having a changed value (step S212). If a connection with the transmission destination has not been established (NO in step S212), the process of step S200 and subsequent steps are repeated.
If the connection with the transmission destination has been established (YES in step S212), the CPU unit 100 transmits the communication frame which is a transmission target (step S214). Then, the process of step S202 and subsequent steps are repeated.
(c4: Communication Frame Reception Process)
Next, a process when the communication unit 200 receives a communication frame will be described.
As described above, a communication frame is transmitted using IO refresh which is high-speed cyclic data transmission in order to guarantee responsiveness of the communication frame in the control system 1 according to the present embodiment. However, when IO refresh is used, data exchange is performed in each IO refresh update period irrespective of whether a communication frame to be transmitted is newly added, and thus control information updated each time is added to a communication frame in order to detect the generation of a new communication frame.
More specifically, when the CPU unit 100 receives a communication frame from any communication device 300, the CPU unit 100 updates the contents of control information added to the communication frame when the received communication frame is forwarded to the communication unit 200 which is a target. The communication unit 200 monitors the contents of control information added to each communication frame IO refreshed between the communication unit 200 and the shared memory 138 for each predetermined period (communication frame polling period). When the communication unit 200 detects the update of the monitored contents of control information, the communication unit 200 starts a process of receiving the communication frame to which the control information whose update has been detected has been added.
That is, the communication unit 200 checks control information added to a communication frame data-exchanged with the CPU unit 100 according to IO refresh for each communication frame polling period and receives the communication frame by using a change in the control information as a trigger. By using such control information, reception of a communication frame can be realized using IO refresh which is cyclic data exchange.
Although the communication frame polling period is basically set to a time longer than an IO refresh period, it may be the same duration as the IO refresh period and may be set to a time shorter than the IO refresh period. Further, the IO refresh period set in the CPU unit 100 in the transmission process may be identical to or different from the IO refresh period set in the communication unit 200 in the reception process.
In this manner, whenever the CPU unit 100 receives a communication frame 442 from the communication device 300, the CPU unit 100 stores a communication frame 452 which is a copy of the received communication frame 442 in the shared memory 128 and updates the value of control information 454 added to the communication frame 452 according to a predetermined rule.
In the CPU unit 100, data is exchanged between the shared memory 128 of the network communication unit 120 and the shared memory 138 of the internal bus communication unit 130 ((3) data exchange). As a result of data exchange, the same communication frame 462 and control information 464 as those stored in the shared memory 128 are stored in the shared memory 138.
Since data exchange between the shared memory 128 and the shared memory 138 is cyclically performed in a period identical to or shorter than the IO refresh period, update of the communication frame 452 and the control information 454 added to the communication frame 452 in the shared memory 128 and update of the communication frame 462 and the control information 464 added to the communication frame 462 in the shared memory 138 are performed almost simultaneously.
Further, the communication frame 462 and the control information 464 stored in the shared memory 138 are targets of IO refresh and they are transmitted to the communication unit 200 in each IO refresh period ((2) IO refresh). That is, data exchange is cyclically performed between the shared memory 128 of the CPU unit 100 and the shared memory 208 of the communication unit 200.
In this manner, when the CPU unit 100 receives a communication frame (reception data) from any communication device 300, the CPU unit 100 adds control information having different contents from control information added to the previously received communication frame (reception data) and performs data exchange with the communication unit 200 which is a transmission destination of the reception data.
The communication unit 200 monitors the value of control information 474 in the shared memory 208 acquired by IO refresh for each communication frame polling period. When a change in the value of the control information 474 is detected, the communication unit 200 processes a communication frame 472 to which the control information 474 having the changed value has been added ((5) communication frame reception).
In the example of
Subsequently, when the third communication frame polling period has arrived, since a change of the control information 474 from “100” to “101” is detected, the communication frame 472 is processed.
In this manner, the communication unit 200 monitors whether the communication frame 472 to be processed has arrived for each predetermined reception period (communication frame polling period) and starts processing of the communication frame 472 when it is determined that the communication frame 472 has arrived.
The application protocol stack 1222 searches for an entry corresponding to a connection ID in the Ethernet frame from the TCP/IP protocol stack 1224 with reference to the connection management information 182. Entries are added to the connection management information 182 when a connection is established. Each entry includes information representing correlation with the data exchange information 180. The application protocol stack 1222 stores a received communication frame at a corresponding position of the shared memory 128 on the basis of the retrieved information of the data exchange information 180.
A communication frame from the communication device 300, received by the CPU unit 100, is transmitted to the communication unit 200 according to the above-described procedure.
If a communication frame has been received from any communication device 300 (YES in step S300), the CPU unit 100 identifies the communication unit 200 which is a transmission destination of the received communication frame with reference to the connection management information 182 (step S302). The CPU unit 100 determines the contents of control information added to the communication frame to be stored (step S304). Then, the CPU unit 100 writes the received communication frame and the corresponding control information to an address of the shared memory 128 of the network communication unit 120, which corresponds to the identified communication unit 200 (step S306).
Subsequently, the CPU unit 100 performs data exchange between the shared memory 128 of the network communication unit 120 and the shared memory 138 of the internal bus communication unit 130 according to the data exchange information 180 (step S308).
Then, the CPU unit 100 determines whether an IO refresh period has arrived (step S310). If an IO refresh period has not arrived (NO in step S310), the CPU unit 100 waits for arrival of an IO refresh period.
If an IO refresh period has arrived (YES in step S310), the CPU unit 100 performs IO refresh and performs data exchange with the communication unit 200 (step S312). Then, the process of step S300 and subsequent steps are repeated.
On the other hand, the communication unit 200 determines whether an IO refresh period has arrived first (step S400). If an IO refresh period has not arrived (NO in step S400), the communication unit 200 waits for arrival of an IO refresh period.
If an IO refresh period has arrived (YES in step S400), the communication unit 200 performs IO refresh and performs data exchange with the CPU unit 100 (step S402).
Subsequently, the communication unit 200 determines whether there is control information having a changed value among control information in the shared memory 208 of the communication unit 200 (step S404). If there is no control information having a changed value among the control information in the shared memory 208 of the communication unit 200 (NO in step S404), the processes following step S400 are repeated.
If there is control information having a changed value among the control information in the shared memory 208 of the communication unit 200 (YES in step S404), the communication unit 200 processes a communication frame corresponding to the control information having a changed value as a newly received communication frame (step S406). Then, the process of S400 and subsequent steps are repeated.
<D. Modified Examples>
Although a configuration in which one communication port of the CPU unit 100 is used by one or more communication units 200 has been exemplified in the above embodiment, the forwarding function or the relay function (bridge function) of the CPU unit 100 according to the present embodiment is applicable to other configurations as described below.
(d1: Use of Multiple Communication Ports)
As a first modified example, a configuration example in which a plurality of communication ports is used by one or a plurality of communication units 200 will be described.
The CPU unit 100A has two communication ports 150 and 150A for transmitting and receiving communication frames. That is, the CPU unit 100A has the communication port 150A different from the communication port 150 for transmitting and receiving data.
A communication protocol supported by the communication port 150 may be identical to or different from a communication protocol supported by the communication port 150A. Typically, a communication protocol for transmitting and receiving data through the communication port 150 differs from a communication protocol for transmitting and receiving data through the communication port 150A.
In the configuration example shown in
The CPU unit 100A relays a communication frame between one of the communication devices 300 connected to the communication port 150 and the communication device 300 connected to the communication port 150A and the communication unit 200. According to such selective relaying of a communication frame, each communication unit 200 can use both the communication port 150 and the communication port 150A.
Such relaying between each communication unit 200 and the communication device 300 connected to the communication port 150 or the communication port 150A is performed according to data exchange information 180A stored in the CPU unit 100A.
The internal bus communication unit 130 performs data exchange of a communication frame to be stored in the shared memory 138, which is transmitted/received to/from the communication unit 200 through the internal bus 40, with the shared memory 128 or the shared memory 128A according to the predetermined data exchange information 180A.
In this manner, the CPU unit 100A has a second storage region (shared memory 128) in which data transmitted/received to/from the communication device 300 through the communication port 150 is stored and a third storage region (shared memory 128A) in which data transmitted/received to/from the communication device 300 through the communication port 150A is stored. In addition, the CPU unit 100A selectively exchanges data of the first storage region (shared memory 138) with the second storage region (shared memory 128) and the third storage region (shared memory 128A) according to the predetermined data exchange information 180A.
The process relating to data exchange between the shared memory 138 and the shared memory 128 or the shared memory 128A is the same as data exchange in the above-described embodiment and thus detailed description thereof is not repeated.
In the data exchange information 180A shown in
The basic configuration and process of the control system 1A according to the first modified example of the present embodiment are the same as those of the control system 1 according to the present embodiment, and thus detailed description thereof is not repeated.
According to the first modified example of the present embodiment, a path through which a communication frame is relayed in the CPU unit 100A may be arbitrarily set by a user using a support device and the like. In this manner, it is possible to use a plurality of communication protocols installed in the CPU unit 100A without mounting a special communication protocol and the like in the communication unit 200 simply by setting the data exchange information 180A.
In addition, a utilization pattern in which one of two types of communication frame transmitted from the same communication unit 200 is transmitted from the communication port 150 of the CPU unit 100A and the other is transmitted from the communication port 150A of the CPU unit 100A is also possible.
As described above, the CPU unit 100A according to the first modified example of the present embodiment is able to relay a plurality of communication frames transmitted according to different communication protocols and relay communication frames to different communication ports. By using this configuration, a simple control configuration can also be realized in a control system using a plurality of communication protocols.
(d2: Relaying Between Communication Ports)
As a second modified example, an example of a configuration in which the CPU unit 100 having a plurality of communication ports serves as a router will be described.
The CPU unit 100B has two communication ports 150 and 150B for transmitting and receiving communication frames. A communication protocol supported by the communication port 150 may be identical to or different from a communication protocol supported by the communication port 150B.
In an example of a configuration shown in
The CPU unit 100B relays communication frames between the communication device 300-1 connected to the communication port 150 and the coupler unit 340 and the communication unit 200-4 connected to the communication port 150B. Transmission of communication frames between devices having different communication protocols, and the like can be performed according to relaying of communication frames between communication ports in the CPU unit 100B.
Such relaying between the communication device 300 connected to the communication port 150 and the coupler unit 340 connected to the communication port 150B (and the communication unit 200 connected to the coupler unit 340) is performed according to data exchange information 180B stored in the CPU unit 100B.
In the CPU unit 100B, data exchange is performed between the shared memory 128 associated with the communication port 150 and the shared memory 128B associated with the communication port 150B according to the predetermined data exchange information 180B.
In this manner, the CPU unit 100B has a second storage region (shared memory 128) in which data transmitted/received to/from the communication device 300 through the communication port 150 is stored and a third storage region (shared memory 128B) in which data transmitted/received to/from the communication device 300 through the communication port 150B is stored. In addition, the CPU unit 100B performs data exchange between the second storage region (shared memory 128) and the third storage region (shared memory 128B) according to the predetermined data exchange information 180B.
The basic configuration and process of the control system 1B according to the second modified example of the present embodiment are the same as those of the control system 1 according to the present disclosure, and thus detailed description thereof is not repeated.
According to the second modified example of the present embodiment, a path through which a communication frame is relayed in the CPU unit 100B may be arbitrarily set by a user using a support device and the like. In this manner, it is possible to transmit data between a plurality of communication protocols connected to the CPU unit 100B without installing a special communication protocol and the like in the communication unit 200 simply by setting the data exchange information 180.
In this manner, a path through which a communication frame is relayed can be freely determined in the CPU unit 100B according to the second modified example of the present embodiment, and thus communication frames from a communication device 300 connected to a different network as well as the communication unit 200 connected to the CPU unit 100 can also be relayed to other networks. That is, communication frames can be relayed between networks of a plurality of layers by means of the CPU unit 100B according to the second modified example of the present embodiment.
(d3: Use of Multiple Units)
As a third modified example, an example of a configuration in which a single communication unit uses communication ports disposed in a plurality of units will be described.
The CPU unit 100 has a communication port 150 for transmitting and receiving communication frames and the communication unit 200C has a communication port 150C for transmitting and receiving communication frames. A communication protocol supported by the communication port 150 of the CPU unit 100 may be identical to or different from a communication protocol supported by the communication port 150C of the communication unit 200C.
In the example of the configuration shown in
In this case, the communication unit 200-1 transmits communication frames to the CPU unit 100 through the internal bus 40 and transmits communication frames to the communication unit 200C through the internal bus 40.
In the CPU unit 100, communication frames from the communication unit 200-1 are relayed to the communication device 300-2 according to the data exchange information 180. On the other hand, in the communication unit 200C, communication frames from the communication unit 200-1 are relayed to the communication device 300-5 according to data exchange information 180C.
The basic configuration and process of the control system 1C according to the third modified example of the present embodiment are the same as those of the control system 1 according to the present embodiment and thus detailed description thereof is not repeated.
As described above, in the control system 1C according to the third modified example of the present embodiment, transmission of communication frames can be realized using communication ports of physically different communication units included in the control system 1C.
<E. Setting User Interface>
Next, an example of a user interface for setting the data exchange information 180 and the connection management information 182 used in the control system according to the present embodiment will be described.
For example, a configuration in which two communication ports 150 and 150A are disposed in the CPU unit 100, as shown in
As an example, an operation procedure for setting data which is an information sources of the data exchange information 180 and the connection management information 182 is as follows.
(1) Connection setting for performing relaying of communication frames is performed on the user interface screen as shown in
(2) A message addressed to the communication device 300-1 is allocated to the communication port 150 of the CPU unit 100 which relays communication frames on the user interface screen as shown in
(3) A message addressed to the communication device 300-3 is allocated to the communication port 150A of the CPU unit 100 which relays communication frames on the user interface screen as shown in
(4) A project including a user program and a setting file is built and the data exchange information 180 is generated.
(5) The user program and the setting file are downloaded to the CPU unit 100 and the communication unit 200.
Referring to
The target device setting region 512 corresponds to a list of communication ports which can be used in the CPU unit 100 which is a target. Data which is an information source of the connection management information 182 is generated by allocating a communication device which is a communication target to each target device setting region 512 through a tool box which is not shown.
An IP address indicating a destination, a communication period (packet interval) and the like may be set and changed for connection (that is, assigned connection) between the CPU unit 100 and a communication device which is a communication target.
Meanwhile, a list of communication devices which can be used in the CPU unit 100 may be displayed in the tool box which is not shown. When the tool box is displayed side by side with the user interface screen 500, it is possible to set a connection by dragging and dropping a communication device which is a target to the target device setting region 512.
Furthermore, types of communication protocols which can be used at each communication port, sizes of transmitted messages, and the like may be set and changed on the user interface screen 500.
A communication path through which communication frames are relayed (bridged) can be determined by performing various assignments using the user interface screen 500 as shown in
When the user interface screen 500 as shown in
<F. Supplementary Notes>
The present embodiment described above includes the following technical ideas.
A control system 1, 1A, 1B and 1C for controlling a control target includes a first unit 100, 100A and 100B having a first communication port 150 for transmitting and receiving data and one or a plurality of second units 200 electrically connected to the first unit, wherein each of the second units includes a logical communication unit 270 for transmitting/receiving data to/from a device electrically connected to the first communication port of the first unit, and the first unit includes a forwarding processing unit 102 which forwards transmission data transmitted from the second unit to a device which is a transmission destination.
The forwarding processing unit forwards reception data received from any device 300 to a second unit 200 which is a transmission destination of the reception data in the control system described in configuration 1.
The first unit and the one or the plurality of the second units include data communication units 130 and 220 for performing data exchange in each predetermined period. When transmission data to be newly transmitted is generated, the logical communication unit adds, control information 404 having different contents from control information added to previously generated transmission data, and performs data exchange with the first unit in the control system described in configuration 1 or 2.
When transmission data to be newly transmitted is generated, the logical communication unit generates new control information by incrementing or decrementing a value of the control information added to the previously generated transmission data in the control system described in configuration 3.
The first unit includes a first storage region 138 in which data exchanged with the one or the plurality of the second units is stored and a second storage region 128 in which data transmitted/received to/from the device through the first communication port is stored, and the forwarding processing unit performs data exchange between the first storage region and the second storage region according to predetermined data exchange information 180 in the control system described in configuration 3 or 4.
When reception data is received from any device, the forwarding processing unit adds control information 454 having different contents from control information added to previously received reception data to the received reception data and performs data exchange with the second unit which is a transmission destination of the reception data in the control system described in configuration 5.
The first unit further includes a second communication port 150A that is for transmitting/receiving data and different from the first communication port, and a communication protocol for transmitting and receiving data through the first communication port differs from a communication protocol for transmitting and receiving data through the second communication port in the control system described in configuration 6.
The first unit further includes a third storage region 128A in which data transmitted/received to/from the device through the second communication port is stored, and the forwarding processing unit selectively exchanges data of the first storage region between the second storage region and the third storage region according to predetermined data exchange information 180A in the control system described in configuration 7.
The first unit further includes a third storage region 128B in which data transmitted/received to/from the device through the second communication port 150B is stored, and the forwarding processing unit performs data exchange between the second storage region and the third storage region according to predetermined data exchange information 180B in the control system described in configuration 7.
A control device 100 constituting a control system for controlling a control target includes: a communication port 150 for transmitting and receiving data; a data communication unit 130 for performing data exchange with one or more communication units 200 in each predetermined period, wherein each of the communication units includes a logical communication unit 270 for transmitting/receiving data to/from a device electrically connected to the communication port; and a forwarding processing unit 102 which forwards transmission data transmitted from the communication unit to the device which is a transmission destination.
<G. Conclusion>
According to the present embodiment, a data (communication frame) relaying function (bridge function) is installed in the CPU unit 100 and thus other communication units 200 can perform communication using a communication port provided in the CPU unit 100. By employing this configuration, system simplification and reduction of development costs of the communication units 200 and the like can be realized without the necessity of installing a communication function in each of the communication units 200.
According to the present embodiment, a user is able to freely set a path defined as a data (communication frame) relaying function (bridge function) in the CPU unit 100. Accordingly, it is possible to forward communication frames to different networks or different communication ports by bridging communication frames according to a plurality of communication protocols without depending on communication protocols and the like, thereby constructing more flexible systems.
According to the present embodiment, each of the communication units 200 can have an application execution environment, and various processes and functions can be provided according to such an application execution environment independently of execution of a user program in the CPU unit 100. Accordingly, it is possible to realize a highly flexible autonomous distributed system in which each unit autonomously performs a task assigned thereto by constructing a control system including the CPU unit 100 and the one or more communication units 200.
<G. Other Configurations>
In one aspect, a control system according to an embodiment of the present disclosure controls a control target. The control system includes a first unit having a first communication port for transmitting and receiving data and one or a plurality of second units electrically connected to the first unit. Each of the second units includes a logical communication unit for transmitting/receiving data to/from a device electrically connected to the first communication port of the first unit. The first unit includes a forwarding processing unit which forwards transmission data transmitted from the second unit to a device which is a transmission destination.
According to this disclosure, the one or more second units as well as the first unit can use the one communication port included in the first unit, and thus it is possible to achieve high functionality of the second units while simplifying a system configuration.
In the above-described disclosure, the forwarding processing unit may forward reception data received from any device to the second unit which is a transmission destination of the reception data.
According to this disclosure, it is possible not only to transmit data from the second unit but also to receive data from any device.
In the above-described disclosure, the first unit and the one or the plurality of the second units may include data communication units for performing data exchange in each predetermined period. When transmission data to be newly transmitted is generated, the logical communication unit may add control information having different contents from control information added to previously generated transmission data, and perform data exchange with the first unit.
According to this disclosure, processes can be performed between the first unit and the second units particularly when data is newly generated and/or when data is newly received even in a configuration in which data exchange is performed in each predetermined period irrespective of whether data is updated. Accordingly, it is possible to prevent processes from being complicated while maintaining high response performance.
In the above-described disclosure, when transmission data to be newly transmitted is generated, the logical communication unit may generate new control information by incrementing or decrementing a value of the control information added to the previously generated transmission data.
According to this disclosure, the generation of new transmission data can be detected according to increment or decrement of control information.
In the above-described disclosure, the first unit may include a first storage region in which data exchanged with the one or the plurality of the second units is stored and a second storage region in which data transmitted/received to/from the device through the first communication port is stored. The forwarding processing unit may perform data exchange between the first storage region and the second storage region according to predetermined data exchange information.
According to this disclosure, only data transmitted/received to/from a device among data exchanged between the first unit and the one or more second units can be efficiently exchanged. Consequently, it is possible to prevent processes in the first unit from being complicated.
In the above-described disclosure, when reception data is received from any device, the forwarding processing unit may add control information having different contents from control information added to previously received reception data to the received reception data and perform data exchange with the second unit which is a transmission destination of the reception data.
According to this disclosure, the one or more second units can immediately detect that the first unit has newly received new reception data from any device.
In the above-described disclosure, the first unit may further have a second communication port that is for transmitting/receiving data and different from the first communication port. A communication protocol for transmitting and receiving data through the first communication port may differ from a communication protocol for transmitting and receiving data through the second communication port.
According to this disclosure, it is possible to realize various applications by selectively using a plurality of communication ports provided in the first unit.
In the above-described disclosure, the first unit may further include a third storage region in which data transmitted/received to/from the device through the second communication port is stored. The forwarding processing unit may selectively exchange data of the first storage region between the second storage region and the third storage region according to predetermined data exchange information.
According to this disclosure, it is possible to transmit data using an appropriate communication protocol and an appropriate device which is a transmission destination at the request of a second unit which has generated the data.
In the above-described disclosure, the first unit may further include a third storage region in which data transmitted/received to/from the device through the second communication port is stored. The forwarding processing unit may perform data exchange between the second storage region and the third storage region according to predetermined data exchange information.
According to another embodiment of the present disclosure, a control device constituting a control system for controlling a control target is provided. The control device includes a communication port for transmitting and receiving data and a data communication unit for performing data exchange with one or more communication units in each predetermined period. Each of the communication units includes a logical communication unit for transmitting/receiving data to/from a device electrically connected to the communication port. The control device includes a forwarding processing unit which forwards transmission data transmitted from the communication unit to the device which is a transmission destination.
According to this disclosure, the one or more second units as well as the first unit can use the one communication port included in the first unit, and thus it is possible to achieve high functionality of the second units while simplifying a system configuration.
According to embodiments of the present disclosure, it is possible to flexibly realize communication processing without requiring additional units even when a plurality of units having a communication function are present.
The embodiments disclosed herein are to be construed in all aspects as illustrative and not restrictive. The scope of the present disclosure should be determined by the appended claims and their legal equivalents, not by the above description, and all changes coming within the meaning and equivalency range of the appended claims are intended to be embraced therein.
Number | Date | Country | Kind |
---|---|---|---|
2017-247373 | Dec 2017 | JP | national |