CONTROL DEVICE, COMMUNICATION CONTROL METHOD, AND CONTROL PROGRAM
The control device adapts operation modes based on threshold times to stabilize control performance and reduce round trip times in EtherCAT networks, addressing the instability caused by failures in ring configurations.
Patent Information
- Application Number
- JP2020194427
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2024-10-16
- Estimated Expiration
- 2040-11-24
AI Technical Summary
In ring configurations of networks like EtherCAT, failures can lead to increased round trip times and destabilization of control performance due to changes in network configuration, which is not effectively addressed by existing technologies.
A control device with a communication unit and arithmetic processing unit that switches between operation modes based on threshold times for receiving communication frames, allowing it to stabilize control performance by using preliminary input data when frames are delayed or lost, thereby reducing round trip times.
The solution effectively reduces round trip times and stabilizes control performance even in the presence of failures, ensuring consistent operation by adapting to changes in network configuration.
Smart Images

Figure 0007567394000001 
Figure 0007567394000002 
Figure 0007567394000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a control device connectable to a network, a communication control method in the control device, and a control program for implementing the control device. [Background technology]
[0002] For example, in a network conforming to EtherCAT (registered trademark), a communication frame transmitted by a communication master (hereinafter also simply referred to as a "master") circulates through all communication slaves (hereinafter also simply referred to as "slaves") before returning to the master.
[0003] As a topology for circulating communication frames, in addition to a form in which there are slaves on a path having ports for receiving and transmitting communication frames, a form in which the ports of the slaves on the path only receive or transmit communication frames may be adopted. For convenience of explanation, the former is also called a "non-ring configuration" and the latter is also called a "ring configuration." In a ring configuration, communication frames are transmitted in one direction through each cable connected to the slave. Note that there may also be a form including both a ring configuration and a non-ring configuration.
[0004] Regarding such a ring configuration, Japanese Patent Application Laid-Open No. 2020-167554 (Patent Document 1) discloses a master device that can easily detect unauthorized routes in a network including a ring topology.
[0005] In addition, in a network conforming to EtherCAT, the time it takes for a communication frame sent from the master to make a complete loop and return to the master (hereinafter also referred to as the "round trip time") must be taken into consideration in the design. More specifically, an increase in the round trip time may lengthen the update cycle of data exchanged between the communication master and communication slaves, resulting in a decrease in control performance.
[0006] The round trip time increases as the number of communication slaves increases, but by adopting a ring configuration, the increase in round trip time can be suppressed more effectively than when a non-ring configuration is adopted. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] JP 2020-167554 A Summary of the Invention [Problem to be solved by the invention]
[0008] The ring configuration is a kind of redundant network, and if any failure occurs in the network, the non-ring configuration network is automatically reconfigured to continue transmitting communication frames. However, as the network configuration changes, the round trip time may become longer.
[0009] An object of one aspect of the present invention is to provide a new mechanism that can achieve both a shorter round trip time achieved by a ring configuration and stable control when some kind of failure occurs in the ring configuration. [Means for solving the problem]
[0010] A control device according to an embodiment of the present invention includes a communication unit connected to a network configured to circulate communication frames, and an arithmetic processing unit that repeatedly executes, for each execution period, a control operation based on input data included in a communication frame received via the communication unit, and a transmission of a communication frame including output data determined by the control operation. The arithmetic processing unit is configured to be able to select between a first operation mode in which, if the transmitted communication frame is not received within a first threshold time after the transmission of the communication frame, the control operation is executed based on preliminary input data, which is input data included in the communication frame received prior to the transmission of the communication frame, and a second operation mode in which, if the transmitted communication frame is not received within a second threshold time shorter than the first threshold time after the transmission of the communication frame, the control operation is executed based on preliminary input data, which is input data included in the communication frame received prior to the transmission of the communication frame. In a first operating mode, if the calculation processing unit receives the transmitted communication frame by a first threshold time, it updates the preliminary input data with the input data contained in the received communication frame, and in a second operating mode, if the calculation processing unit receives the transmitted communication frame by a third threshold time that is longer than the second threshold time, it updates the preliminary input data with the input data contained in the received communication frame.
[0011] According to this configuration, in the first operation mode, the input data to be used in the control operation and the update of the preliminary input data are determined based on whether or not the communication frame transmitted by the first threshold time can be received. On the other hand, in the second operation mode, the input data to be used in the control operation is determined based on whether or not the communication frame transmitted by the second threshold time can be received, but the update of the preliminary input data can be performed for the communication frames received by the third threshold time, which is longer than the second threshold time. Therefore, in the second operation mode, even if the time from transmitting the communication frame to starting the execution of the control operation is set shorter than in the first operation mode, the preliminary input data can be appropriately updated as long as the communication frame can be received by the third threshold time. Therefore, the control can be stabilized.
[0012] The network may include a ring configuration in which a communication frame is transmitted in only one direction in each of the cables connected to the communication slaves. The arithmetic processing unit may be capable of enabling the second operation mode when the network includes the ring configuration. These configurations make it possible to provide an operation mode suitable for the ring configuration. The network may include a daisy-chain configuration.
[0013] The second threshold time may be determined based on the time required for a communication frame transmitted from a communication unit to make a complete loop and return to the communication unit in a ring configuration. The third threshold time may be determined based on the time required for a communication frame transmitted from a communication unit to make a complete loop and return to the communication unit in a state in which any cable included in the ring configuration cannot transmit the communication frame. With this configuration, it is possible to predict changes in the network configuration and determine an appropriate threshold time.
[0014] The ring configuration may include a relay device connected to the communication unit and a plurality of communication slaves. With this configuration, a ring configuration having junction redundancy can be realized.
[0015] The communication unit may have a plurality of ports each connected to a different communication slave. With this configuration, a ring configuration having cable redundancy can be realized.
[0016] The execution period in the second operation mode may be set to be shorter than the execution period in the first operation mode. With this configuration, it is possible to shorten the execution period of the control calculation and / or increase the amount of calculation that can be performed.
[0017] The operation mode of the arithmetic processing unit may be referred to by an instruction included in a user program executed by the arithmetic processing unit. With this configuration, it is possible to easily vary the processing depending on the operation mode of the arithmetic processing unit.
[0018] According to another embodiment of the present invention, there is provided a communication control method executed by a control device including a communication unit connected to a network configured to circulate a communication frame. The communication control method includes the steps of: executing an input process according to an operation mode selected from a first operation mode and a second operation mode; executing a control operation based on input data included in the communication frame received via the communication unit; and transmitting a communication frame including output data determined by the control operation. The step of executing the input process includes the steps of: in the first operation mode, if the transmitted communication frame is not received within a first threshold time after the transmission of the communication frame, using preliminary input data, which is input data included in the communication frame received before the transmission, for the control operation; and, if the transmitted communication frame is received within the first threshold time, updating the preliminary input data with the input data included in the received communication frame. The step of executing the input processing includes a step of using preliminary input data, which is input data contained in the communication frame received before the transmission, for the control calculation if the transmitted communication frame is not received within a second threshold time that is shorter than the first threshold time after the transmission of the communication frame in the second operating mode, and a step of updating the preliminary input data with the input data contained in the received communication frame if the transmitted communication frame is received within a third threshold time that is longer than the second threshold time.
[0019] According to yet another embodiment of the present invention, there is provided a control program executed by a computer including a communication unit connected to a network configured to circulate a communication frame. The control program causes the computer to execute, according to a selected operation mode from a first operation mode and a second operation mode, the steps of executing an input process, executing a control operation based on input data included in the communication frame received via the communication unit, and transmitting a communication frame including output data determined by the control operation. The step of executing the input process includes, in the first operation mode, if the transmitted communication frame is not received within a first threshold time after transmission of the communication frame, using preliminary input data, which is input data included in a communication frame received before the transmission, for the control operation, and, if the transmitted communication frame is received within the first threshold time, updating the preliminary input data with the input data included in the received communication frame. The step of executing the input processing includes a step of using preliminary input data, which is input data contained in the communication frame received before the transmission, for the control calculation if the transmitted communication frame is not received within a second threshold time that is shorter than the first threshold time after the transmission of the communication frame in the second operating mode, and a step of updating the preliminary input data with the input data contained in the received communication frame if the transmitted communication frame is received within a third threshold time that is longer than the second threshold time. Effect of the Invention
[0020] According to an embodiment of the present invention, it is possible to achieve both the shortened round trip time achieved by the ring configuration and the stabilization of control in the event of some kind of failure in the ring configuration. [Brief description of the drawings]
[0021] [Figure 1] FIG. 1 is a schematic diagram showing an example of a control system according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a schematic diagram showing an example of processing in a PLC of the control system according to the present embodiment. [Diagram 3] FIG. 11 is a schematic diagram showing another example of processing in the PLC of the control system according to the present embodiment. [Figure 4] FIG. 11 is a schematic diagram showing yet another example of processing in the PLC of the control system according to the present embodiment. [Diagram 5] FIG. 2 is a schematic diagram showing an example of a hardware configuration of a PLC in the control system according to the present embodiment. [Figure 6] FIG. 2 is a schematic diagram showing an example of a hardware configuration of a device in the control system according to the present embodiment. [Figure 7] 2 is a schematic diagram showing an example of a hardware configuration of a relay device in the control system according to the present embodiment. FIG. [Figure 8] 11 is a diagram for illustrating a process relating to communication time in the control system according to the present embodiment. FIG. [Figure 9] 4 is a diagram for explaining an example of input processing in a PLC of the control system according to the present embodiment. FIG. [Figure 10] 10 is a flowchart showing a processing procedure in a data synchronism priority mode by a PLC of the control system according to the present embodiment. [Figure 11] 10 is a flowchart showing a processing procedure in a control performance priority mode by a PLC of the control system according to the present embodiment. [Figure 12] 5 is a time chart showing an example of the operation of the control system according to the present embodiment. [Figure 13] FIG. 2 is a schematic diagram showing an example of a hardware configuration of a support device of the control system according to the present embodiment. [Figure 14] 4 is a schematic diagram showing an example of a user interface screen provided by a support device of the control system according to the present embodiment. FIG. [Figure 15] FIG. 2 is a diagram showing an example of a ring configuration that can be adopted in the control system according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0022] Embodiments of the present invention will be described in detail with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and their description will not be repeated.
[0023] <A. Application Example> First, with reference to FIGS. 1 to 3, an example of a scenario to which the present invention is applied will be described.
[0024] FIG. 1 is a schematic diagram showing an example of a control system according to the present embodiment. The control system 1 shown in FIGS. 1(A) to 1(C) includes a PLC 100 which is an example of a control device functioning as a communication master (master), devices 200-1 to 200-5 such as input / output devices functioning as communication slaves (slaves) (hereinafter also collectively referred to as "devices 200"), and a relay device 300.
[0025] In this specification, the "ring configuration" means a network configured such that a communication frame is transmitted only in one direction in each of the cables connected to the slaves. In other words, each of the slaves has a plurality of ports, and a configuration in which one port performs only one of transmission and reception of a communication frame means the "ring configuration".
[0026] On the other hand, in this specification, the "non-ring configuration" means a network configured such that a communication frame is transmitted in both directions in any of the cables connected to the slaves. In other words, a configuration in which any port of the slave performs both transmission and reception of a communication frame means the "non-ring configuration".
[0027] Regarding the network of the control system 1, the PLC 100 has a port 151 for transmitting and receiving a communication frame. Each of the devices 200-1 to 200-5 has a first port 251 and a second port 252 for transmitting and receiving a communication frame. Basically, the first port 251 is a port (IN port) to which a communication frame is input, and the second port 252 is a port (OUT port) from which a communication frame is output.
[0028] The relay device 300 has a first port 351, a second port 352, and a third port 353 for transmitting and receiving a communication frame. When the relay device 300 receives a communication frame at a certain port, it transmits the received frame from another port determined according to a predetermined rule. In the example shown in Fig. 1, the predetermined rule may be that the port is determined cyclically in the order of first port 351 -> second port 352 -> third port 353 -> first port 351 ->...
[0029] 1A shows an example of a ring configuration. A communication frame transmitted from a port 151 of the PLC 100 travels in the following order: cable 20, a first port 351 of the relay device 300, a second port 352 of the relay device 300, a cable 21, a first port 251 of the device 200-1, a second port 252 of the device 200-1, a cable 22, a first port 251 of the device 200-2, a second port 252 of the device 200-2, a cable 23, a first port 251 of the device 200-3, a second port 252 of the device 200-3, a cable 24, a first port 251 of the device 200-4, a second port 252 of the device 200-4, a cable 25, a first port 251 of the device 200-5, a second port 252 of the device 200-5, a cable 26, a third port 353 of the relay device 300, and a cable 20, before returning to the port 151 of the PLC 100. In this case, the communication frame transmitted from port 151 of the PLC 100 passes through 14 ports.
[0030] 1(B) shows a case where the cable 24 connecting the device 200-3 and the device 200-4 is disconnected for some reason. In this case, since the device 200-3 cannot transmit a communication frame from the second port 252, the device 200-3 transmits the communication frame from the first port 251. In other words, the device 200-3 returns the communication frame via the same path. Thereafter, the communication frame returns to port 151 of PLC 100 in the following order: cable 23, second port 252 of device 200-2, first port 251 of device 200-2, cable 22, second port 252 of device 200-1, first port 251 of device 200-1, second port 352 of relay device 300, third port 353 of relay device 300, cable 26, second port 252 of device 200-5, first port 251 of device 200-5, cable 25, second port 252 of device 200-4, cable 25, first port 251 of device 200-5, second port 252 of device 200-5, cable 26, third port 353 of relay device 300, and cable 20. In this case, the number of ports through which the communication frame transmitted from port 151 of PLC 100 passes is 22.
[0031] 1C shows an example of a non-ring configuration. A communication frame transmitted from port 151 of PLC 100 is transmitted through cable 20, first port 351 of relay device 300, second port 352 of relay device 300, cable 21, first port 251 of device 200-1, second port 252 of device 200-1, cable 22, first port 251 of device 200-2, second port 252 of device 200-2, cable 23, first port 251 of device 200-3, second port 252 of device 200-3, cable 24, device 200 The signal passes through the first port 251 of -4, cable 24, second port 252 of device 200-3, first port 251 of device 200-3, cable 23, second port 252 of device 200-2, first port 251 of device 200-2, cable 22, second port 252 of device 200-1, first port 251 of device 200-1, cable 21, second port 352 of relay device 300, first port 351 of relay device 300, and cable 20 in that order, before returning to port 151 of PLC 100. In this case, the number of ports through which the communication frame transmitted from port 151 of PLC 100 has passed is 22.
[0032] The round trip time is determined by the sum of the port transit time and the cable transit time, with the port transit time being the dominant factor. Therefore, the round trip time increases as the number of ports through which a communication frame passes increases. Compared to the round trip time Tr1 in the ring configuration shown in Figure 1(A), the round trip time Tr2 (Tr2>Tr1) in the configuration shown in Figure 1(B) is longer. Since the number of passing ports is the same, the round trip time Tr2 in the configuration shown in Figure 1(B) is almost the same as the round trip time Tr3 in the configuration shown in Figure 1(C) (Tr2≈Tr3).
[0033] In other words, if a system is designed based on the round-trip time in a ring configuration, if a failure occurs in the ring configuration and it changes to a non-ring configuration, the round-trip time may increase and the system may not operate as designed.
[0034] Therefore, the control system according to the present embodiment provides a mechanism for suppressing the influence on the control performance even when the ring configuration is changed to a non-ring configuration. Note that the communication control method provided by the control system according to the present embodiment is not only applicable when the ring configuration is changed to a non-ring configuration, but is also applicable to various network configurations.
[0035] First, the system design will be described. Fig. 2 is a schematic diagram showing an example of processing in the PLC 100 of the control system 1 according to the present embodiment.
[0036] 2(A) to 2(C), the PLC 100 periodically executes a series of processes including a control operation 160, an output process 162, and an input process 164. Hereinafter, the period in which the series of processes is executed is also referred to as a "task execution period."
[0037] The input process 164 is a process of collecting input data such as measured values from the device 200. The control calculation 160 performs calculations for controlling a control target based on the input data collected by the input process 164, and determines output data such as command values to the device 200. The output process 162 is a process of transmitting the output data determined by the control calculation 160 to the target device 200. In this way, the calculation processing unit (processor 102 shown in FIG. 5) of the PLC 100 repeatedly executes the control calculation 160 based on the input data included in the communication frame received via the field network controller 112, and transmits the communication frame including the output data determined by the control calculation 160, for each task execution period.
[0038] The output process 162 and the input process 164 are implemented using communication frames. Therefore, the time from the end of the output process 162 to the start of the input process 164 depends on the time from when the PLC 100 transmits the communication frame to when the communication frame returns, that is, the round trip time.
[0039] A non-ring configuration is assumed in Fig. 2(A) to Fig. 2(C). Fig. 2(A) shows a time chart in the case where the number of devices 200 connected to the PLC 100 and the amount of calculation of the control calculation 160 are both relatively small. Fig. 2(B) shows a time chart in the case where the number of devices 200 connected to the PLC 100 is increased compared to Fig. 2(A).
[0040] 2(A) and 2(B), it can be seen that as the number of connected devices 200 increases, the time from the end of output processing 162 to the start of input processing 164, i.e., communication time Tt1 (see FIG. 2(A)), increases to communication time Tt2 (see FIG. 2(B)). This means that the response performance of input / output is degraded. However, since the amount of calculation of the control calculation 160 is relatively small, the task execution period Tc1 is maintained in either case.
[0041] Fig. 2(C) shows a time chart when the amount of calculation of the control calculation 160 is increased compared to Fig. 2(B). In Fig. 2(C), the processing time of the control calculation 160 increases with the increase in the amount of calculation, so a task execution period Tc2 longer than the task execution period Tc1 is required. In other words, as the number of connected devices 200 and the amount of calculation of the control calculation 160 increase, the task execution period extends by ΔTc.
[0042] Therefore, it is preferable to make the communication time as short as possible. By adopting a ring configuration instead of a non-ring configuration, the number of ports that must be passed through can be reduced, and the round trip time, i.e., the communication time, can be shortened.
[0043] Fig. 3 is a schematic diagram showing another example of processing in the PLC 100 of the control system 1 according to the present embodiment. Fig. 3(A) shows a time chart in the case where a non-ring configuration is adopted, similar to Fig. 2(B), and Fig. 3(B) shows a time chart in the case where a ring configuration is adopted.
[0044] Comparing FIG. 3(A) and FIG. 3(B), the communication time Tt2 is shortened to communication time Tt3 (<communication time Tt2). If the task execution period Tc1 is set to the same value, the shortened communication time becomes slack time 166, and more calculations can be executed as control calculation 160.
[0045] In this way, by adopting a ring configuration, communication time can be shortened, which in turn improves control performance, such as shortening the task execution cycle and executing more control calculations. However, if a fault such as a disconnection occurs in the network, the ring configuration will change to a non-ring configuration, and communication time will increase.
[0046] Fig. 4 is a schematic diagram showing yet another example of processing in the PLC 100 of the control system 1 according to the present embodiment. Fig. 4(A) shows a time chart in the case where a ring configuration is adopted, similar to Fig. 3(B), and Fig. 4(B) shows a time chart in the case where the ring configuration is changed to a non-ring configuration.
[0047] As shown in FIG. 4(A), by adopting a ring configuration, the communication time Tt3 can be shortened, and even if the amount of calculation of the control calculation 160 is relatively large, a series of processes consisting of the control calculation 160, output processing 162, and input processing 164 can be executed periodically at a task execution period Tc1.
[0048] On the other hand, if a fault such as a disconnection occurs in the ring configuration, it changes to a non-ring configuration, and the communication time Tt4 (> communication time Tt3) will be extended as shown in Fig. 4(B). As a result, the series of processes consisting of the control calculation 160, the output process 162, and the input process 164 cannot be executed periodically in the task execution cycle Tc1 (this state is also called "task execution cycle exceeded").
[0049] In consideration of such a situation where communication time increases, the system may be designed as shown in Fig. 4(C) on the premise of the communication time in the non-ring configuration. That is, in the time chart shown in Fig. 4(C), a task execution cycle Tc3 is set with a certain time margin. However, in the system design shown in Fig. 4(C), although it is robust, the merit of shortening the round-trip time due to adopting the ring configuration is not utilized.
[0050] In consideration of such background art, in the control system according to the present embodiment, a new mechanism that can adopt any of the following design methods is provided.
[0051] (1) System design based on the round-trip time in the non-ring configuration as shown in Fig. 1(C) and Fig. 4(C).
[0052] (2) System design in which a mode for suppressing the influence on control performance is activated while setting a task execution cycle based on the round-trip time in the ring configuration as shown in Fig. 1(A) and Fig. 4(B), even when it changes to the non-ring configuration as shown in Fig. 1(B) and Fig. 4(C).
[0053] Hereinafter, the configuration, processing, functions, etc. for realizing such a mechanism will be described in detail. <B. Hardware Configuration Example> Next, a hardware configuration example of each device constituting the control system 1 according to the present embodiment will be described.
[0054] (b1: Control Device (PLC100)) Fig. 5 is a schematic diagram showing a hardware configuration example of the PLC100 of the control system 1 according to the present embodiment. Referring to Fig. 5, the PLC100 includes, as main hardware components, a processor 102, a main memory 104, a storage 110, a field network controller 112, and a local bus controller 114. These hardware components are electrically connected via an internal bus 118.
[0055] The processor 102 corresponds to an arithmetic processing unit that executes control calculations, and is composed of a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), etc. Specifically, the processor 102 reads out a program stored in the storage 110, expands it in the main memory 104, and executes it to realize control calculations according to a control target and various processes as described later.
[0056] The main memory 104 is configured with a volatile storage device such as a dynamic random access memory (DRAM) or a static random access memory (SRAM). The storage 110 is configured with a non-volatile storage device such as a solid state drive (SSD) or a hard disk drive (HDD).
[0057] The storage 110 stores a system program 1102 for implementing basic functions, a user program 1104 created according to a control target, and system setting information 1106 for determining processing as described below. The system program 1102 implements basic functions in the PLC 100 and can therefore be regarded as at least a part of the control program.
[0058] The field network controller 112 corresponds to a communication unit, and is connected to a network configured to circulate communication frames. More specifically, the field network controller 112 has a port 151, and is responsible for transmitting and receiving communication frames. The field network controller 112 of the PLC 100 functions as a communication master. The field network controller 112 may have a synchronization counter for periodically transmitting and receiving communication frames.
[0059] The local bus controller 114 is electrically connected to one or more functional units 116 via an internal bus 118. The functional units 116 include functions for exchanging various signals with the controlled object. The functional units 116 have, for example, one or more of a DI (Digital Input) function for receiving a digital signal from the controlled object, a DO (Digital Output) function for outputting a digital signal to the controlled object, an AI (Analog Input) function for receiving an analog signal from the controlled object, and an AO (Analog Output) function for outputting an analog signal to the controlled object. Furthermore, the functional units 116 may include a controller that implements special functions such as PID (Proportional Integral Derivative) control and motion control.
[0060] FIG. 5 shows an example of a configuration in which the processor 102 executes a program to provide the necessary functions, but some or all of these provided functions may be implemented using a dedicated hardware circuit (e.g., an Application Specific Integrated Circuit (ASIC) or a Field-Programmable Gate Array (FPGA)). Alternatively, the main part of the PLC 100 may be realized using hardware that conforms to a general-purpose architecture (e.g., an industrial PC based on a general-purpose PC). In this case, virtualization technology may be used to run multiple operating systems (OSs) with different uses in parallel, and necessary applications may be executed on each OS.
[0061] Furthermore, the PLC 100 may be configured to integrate the functions of a display device, a support device, and the like.
[0062] (b2:Device 200) Fig. 6 is a schematic diagram showing an example of a hardware configuration of a device 200 of a control system 1 according to the present embodiment. Referring to Fig. 6, the device 200 includes, as main hardware components, a control circuit 206, a field network controller 212, and a functional module 220.
[0063] The control circuit 206 is an arithmetic processing unit that mainly executes processing in the device 200. The control circuit 206 typically includes a processor 202, a main memory 204, and a storage 210. The processor 202 is configured with a CPU, a GPU, or the like. The main memory 204 is configured with a volatile storage device such as a DRAM or an SRAM, or the like. The storage 210 is configured with a non-volatile storage device such as an SSD, or the like. Note that a ROM (Read Only Memory) may be adopted as the storage 210.
[0064] The control circuit 206 may be implemented using a dedicated hardware circuit (eg, ASIC or FPGA).
[0065] The field network controller 212 has a first port 251 and a second port 252, and is responsible for transmitting and receiving communication frames. The field network controller 212 of the device 200 functions as a communication slave. The field network controller 212 may have a synchronization counter for periodically transmitting and receiving communication frames.
[0066] The functional module 220, like the functional unit 116 shown in FIG. 5, is responsible for processing such as exchanging various signals with the controlled object.
[0067] (b3: relay device 300) Fig. 7 is a schematic diagram showing an example of a hardware configuration of relay device 300 of control system 1 according to the present embodiment. Referring to Fig. 7, relay device 300 includes, as main hardware components, a control circuit 306 and a field network interface 312.
[0068] The control circuit 306 is an arithmetic processing unit that mainly executes the transfer processing of communication frames in the relay device 300. The control circuit 306 typically includes a processor 302, a main memory 304, and a storage 310. The processor 302 is composed of a CPU, a GPU, or the like. The main memory 304 is composed of a volatile storage device such as a DRAM or an SRAM. The storage 310 is composed of a non-volatile storage device such as an SSD, for example. Note that a ROM may be adopted as the storage 310.
[0069] Note that the control circuit 306 may be implemented using a dedicated hardware circuit (for example, an ASIC or an FPGA).
[0070] The field network interface 312 has a first port 351, a second port 352, and a third port 353, and includes a receiving circuit and a transmitting circuit (not shown) for communication frames.
[0071] <C. Transmission and reception processing of communication frames> As described above, when a ring configuration is adopted, it may change to a non-ring configuration due to a failure such as a disconnection, and as a result, the round-trip time may increase. Also, a communication frame transmitted through the network may be damaged or disappear. Therefore, if the communication frame does not return within a predetermined time after the master PLC 100 transmits a certain communication frame, the master determines that the communication frame has been damaged or disappeared on the way (hereinafter, also referred to as "frame loss").
[0072] Therefore, when a non-ring configuration is adopted, the behavior of the communication frame transmitted from the master is assumed to be of two types: (1) the communication frame returns to the master within a predetermined time, and (2) the communication frame is lost and does not return to the master.
[0073] On the other hand, when a ring configuration is adopted, the behavior of a communication frame sent from the master is expected to be one of three types: (1) the communication frame returns to the master within a specified time, (2) the configuration changes to a non-ring configuration and the communication frame returns to the master after a specified time has elapsed, or (3) the communication frame is lost and does not return to the master.
[0074] Fig. 8 is a diagram for explaining processing relating to communication time in control system 1 according to the present embodiment. Fig. 8(A) shows an example of a non-ring configuration, and Fig. 8(B) shows an example of a ring configuration.
[0075] Referring to FIG. 8(A), when a system design based on a non-ring configuration is adopted, the time from the end of output process 162 to the start of input process 164 is set relatively long, regardless of whether the ring configuration is normal or not.
[0076] 8(B), in a normal ring configuration, a communication frame transmitted from PLC 100 immediately after output process 162 ends returns to PLC 100 before input process 164 starts ("Normal" in FIG. 8(B)). On the other hand, if some kind of failure occurs in the ring configuration and it changes to a non-ring configuration, the round trip time increases and the communication frame cannot return to PLC 100 before input process 164 starts ("Delay" in FIG. 8(B)).
[0077] Furthermore, if a communication frame is damaged or lost midway, the communication frame will not return to the PLC 100 ("frame lost" in FIG. 8(B)). Note that if the communication frame returns later than the "delay" in FIG. 8(B), this may also be treated in the same way as a frame lost.
[0078] Thus, in the example shown in FIG. 8(A), there is no concept of “delay” as in FIG. 8(B), and there are cases where a communication frame sent from PLC 100 immediately after the end of output process 162 returns to PLC 100 before the start of input process 164 (referred to as “normal” in FIG. 8(A)) and other cases (referred to as “frame lost” in FIG. 8(A)).
[0079] Therefore, in the non-ring configuration of Fig. 8(A), threshold time Th1 is set based on the end timing T0 of output process 162. On the other hand, in the ring configuration of Fig. 8(B), threshold times Th2 and Th3 are set based on the end timing T0 of output process 162. Note that threshold times Th1 and Th3 correspond to communication timeout times, and threshold time Th2 corresponds to a threshold time for determining that some kind of failure has occurred in the ring configuration.
[0080] Here, the threshold times Th1 and Th3 are determined based on the round trip time of a non-ring structure, and the threshold time Th2 is determined based on the round trip time of a ring structure. Note that the threshold times Th1 and Th3 may be the same value or different values.
[0081] In the control system 1 according to the present embodiment, different processes are performed for each of the three types: normal, delayed, and frame lost.
[0082] Fig. 9 is a diagram for explaining an example of input processing 164 in PLC 100 of control system 1 according to the present embodiment. Referring to Fig. 9, data from device 200 and the like contained in a communication frame returned to PLC 100 (hereinafter, input data) is held in main memory 104 of PLC 100 as current cycle input data 170 and auxiliary input data 172, which are independent of each other.
[0083] Current cycle input data 170 is input data contained in a communication frame received in the current task execution cycle. Auxiliary input data 172 is input data contained in the most recently successfully received communication frame outside the current task execution cycle.
[0084] In the "normal" state shown in Figures 8(A) and 8(B), the control operation 160 uses current cycle input data 170 as input data. On the other hand, in the "delay" state shown in Figure 8(B) and in the "frame lost" state shown in Figures 8(A) and 8(B), the control operation 160 uses auxiliary input data 172 as input data. That is, in the "delay" and "frame lost" states, the communication frame of the current task execution cycle cannot be used, so the control operation 160 is executed using a communication frame that was received previously.
[0085] If it is "normal", the input data included in the communication frame received in the current task execution cycle is held as current cycle input data 170 and also held as auxiliary input data 172. In other words, if it is "normal", the current cycle input data 170 and the auxiliary input data 172 are the same input data.
[0086] On the other hand, if "frame lost", a communication frame cannot be received in the current task execution cycle, so that neither the current cycle input data 170 nor the auxiliary input data 172 are updated and remain as they are.
[0087] On the other hand, if there is a "delay", the communication frame cannot be received in the current task execution cycle, so the current cycle input data 170 is not updated, but the communication frame itself has been received, so it can be held as preliminary input data 172. Therefore, if there is a "delay", the input data included in the received communication frame is held as preliminary input data 172 after execution of the control operation 160.
[0088] As described above, in a control system that can employ a ring configuration, it is possible to design the system assuming that the ring configuration changes to a non-ring configuration and the round trip time increases (worst case value) (see FIG. 1(C) and FIG. 4(C) etc.). In this case, it is sufficient to consider "normal" and "frame loss" without considering the "delay" shown in FIG. 8(B). In such a system design, as long as no frame loss occurs, the input process 164 can be executed using the input data contained in the communication frame received in each task execution cycle. Therefore, no time lag occurs between the timing when the input data is acquired and the timing when the input process 164 is executed. In light of this advantage, the operation mode of the PLC 100 in this case is called a "data synchronism priority mode".
[0089] In the data synchronism priority mode, if the PLC 100 does not receive a transmitted communication frame by threshold time Th1 (first threshold time) after transmitting the communication frame, the PLC 100 executes the control calculation 160 based on the auxiliary input data 172, which is input data contained in a communication frame received before the transmission. Regarding the auxiliary input data 172, if the PLC 100 receives a transmitted communication frame by threshold time Th1, the PLC 100 updates the auxiliary input data 172 with the input data contained in the received communication frame.
[0090] On the other hand, the system can also be designed on the premise of the round-trip time obtained in the ring configuration. In this case, it is necessary to consider the "delay" shown in Fig. 8(B). When the ring configuration changes to a non-ring configuration, the input data used in the input process 164 will be the data included in the communication frame received in the previous task execution cycle. That is, even if the ring configuration changes to a non-ring configuration, the time shift between the timing when the input data is acquired and the execution timing of the input process 164 can be suppressed to only one cycle of the task execution cycle. At this time, since the task execution cycle itself can be shortened, the control performance can be improved from the viewpoints of the input / output response performance and the amount of calculation of the control operation 160. Focusing on such advantages, the operation mode of the PLC 100 in this case is referred to as the "control performance priority mode".
[0091] In the control performance priority mode, if the PLC 100 does not receive the transmitted communication frame by the threshold time Th2 (the second threshold time) after transmitting the communication frame, it executes the control operation 160 based on the preliminary input data 172, which is the input data included in the communication frame received before the transmission. Regarding the preliminary input data 172, if the PLC 100 receives the communication frame transmitted by the threshold time Th3 (the third threshold time) longer than the threshold time Th2, it updates the preliminary input data 172 with the input data included in the received communication frame.
[0092] As described above, the execution cycle in the control performance priority mode can also be set shorter than the execution cycle in the data synchronization priority mode. Note that in the PLC 100, when the network includes a ring configuration, the control performance priority mode may be enabled.
[0093] <D. Processing Procedure> Next, the processing procedures in the PLC 100 for each of the above-described data synchronization priority mode and control performance priority mode will be described. The PLC 100 periodically executes processing including input processing as described below according to the selected operation mode among the data synchronization priority mode and the control performance priority mode.
[0094] (d1: Data synchronization priority mode) Fig. 10 is a flowchart showing a processing procedure in the data synchronism priority mode by the PLC 100 of the control system 1 according to the present embodiment. Typically, each step shown in Fig. 10 is realized by the processor 102 of the PLC 100 executing the system program 1102 and the user program 1104 (see Fig. 5).
[0095] 10, the PLC 100 determines whether a task execution period has arrived (step S100). If a task execution period has arrived (YES in step S100), the PLC 100 generates and transmits a communication frame including output data calculated by the previous control calculation (step S102). That is, the PLC 100 transmits a communication frame including output data determined by the control calculation.
[0096] Thereafter, the PLC 100 determines whether or not the communication frame that has made a round trip around the network has been received (step S104).
[0097] When the PLC 100 receives a communication frame that has circulated around the network (YES in step S104), the PLC 100 stores the input data included in the received communication frame as current cycle input data 170 (step S106), and executes a control calculation using the current cycle input data 170 (step S108). At the same time, the PLC 100 updates the preliminary input data 172 with the current cycle input data 170 (step S110). In this way, when the PLC 100 receives a communication frame that has been transmitted up to threshold time Th1 (first threshold time), it updates the preliminary input data 172 with the input data included in the received communication frame. Then, the processing from step S100 onwards is repeated.
[0098] On the other hand, if the communication frame that has circulated around the network has not been received (NO in step S104), the PLC 100 determines whether or not the threshold time Th1 has elapsed since the transmission of the communication frame (step S112). If the threshold time Th1 has not elapsed (NO in step S112), the process from step S104 onwards is repeated.
[0099] If the threshold time Th1 has elapsed (YES in step S112), the PLC 100 selects the auxiliary input data 172 as input data to be used in the control calculation (step S114), and executes the control calculation using the auxiliary input data 172 (step S116). In this way, if the PLC 100 does not receive a communication frame within threshold time Th1 (first threshold time) after transmitting the communication frame, the PLC 100 uses, for the control calculation, the auxiliary input data, which is input data contained in a communication frame received prior to the transmission. At this time, the auxiliary input data 172 is not updated. Then, the processing from step S100 onwards is repeated.
[0100] (d2: Control performance priority mode) Fig. 11 is a flowchart showing a processing procedure in the control performance priority mode by the PLC 100 of the control system 1 according to the present embodiment. Each step shown in Fig. 11 is typically realized by the processor 102 of the PLC 100 executing a system program 1102 and a user program 1104 (see Fig. 5).
[0101] 11, the PLC 100 determines whether a task execution period has arrived (step S200). If a task execution period has arrived (YES in step S200), the PLC 100 generates and transmits a communication frame including output data calculated by the previous control calculation (step S202). That is, the PLC 100 transmits a communication frame including output data determined by the control calculation.
[0102] Thereafter, the PLC 100 determines whether or not the communication frame that has made a round trip around the network has been received (step S204).
[0103] When the PLC 100 receives the communication frame that has circulated around the network (YES in step S204), the PLC 100 stores the input data contained in the received communication frame as current cycle input data 170 (step S206), and executes a control operation using the current cycle input data 170 (step S208). At the same time, the PLC 100 updates the auxiliary input data 172 with the current cycle input data 170 (step S210). Then, the process from step S200 onwards is repeated.
[0104] On the other hand, if the communication frame that has circulated around the network has not been received (NO in step S204), the PLC 100 determines whether or not the threshold time Th2 has elapsed since the transmission of the communication frame (step S212). If the threshold time Th2 has not elapsed (NO in step S212), the process from step S204 onwards is repeated.
[0105] If the threshold time Th2 has elapsed (YES in step S212), the PLC 100 selects the preliminary input data 172 as input data to be used in the control calculation (step S214), and executes the control calculation using the preliminary input data 172 (step S216). In this way, if the PLC 100 does not receive a communication frame within threshold time Th2 (second threshold time) after transmitting the communication frame, the PLC 100 uses, for the control calculation, the preliminary input data that was included in the communication frame received prior to the transmission.
[0106] Furthermore, the PLC 100 determines whether it has received a communication frame that has completed one round of the network before the threshold time Th3 elapses (step S218). If it has received a communication frame that has completed one round of the network before the threshold time Th3 elapses (YES in step S218), the PLC 100 updates the preliminary input data 172 with the input data included in the received communication frame (step S220). In this way, if the PLC 100 receives the communication frame that it has transmitted before the threshold time Th3 (the third threshold time), it updates the preliminary input data 172 with the input data included in the received communication frame. Then, the processes below step S200 are repeated.
[0107] On the other hand, if it has not received a communication frame that has completed one round of the network before the threshold time Th3 elapses (NO in step S218), the preliminary input data 172 is not updated, and the processes below step S100 are repeated.
[0108] <E. Operation Example> Next, an operation example in the control system 1 according to the present embodiment will be described.
[0109] FIG. 12 is a time chart showing an operation example of the control system 1 according to the present embodiment. FIG. 12(A) shows an operation example in a ring configuration. In the operation example shown in FIG. 12(A), since the communication frame 30 completes one round between the end of the output process 162 and the start of the input process 164, the input data included in the communication frame 30 is stored as the current cycle input data 170 and used in the control operation 160 of the same task execution cycle.
[0110] On the other hand, FIG. 12(B) shows an operation example when the ring configuration changes to a non-ring configuration. In the operation example shown in FIG. 12(B), since the communication frame 30 cannot make a full round between the end of the output process 162 and the start of the input process 164, the preliminary input data 172 updated in the previous task execution cycle is used in the control operation 160. Note that the input data included in the communication frame 30 received in the same task execution cycle is stored as the preliminary input data 172 and used in the control operation 160 of the next task execution cycle.
[0111] FIG. 12(C) shows an operation example when returning from the non-ring configuration to the ring configuration. When returning from the non-ring configuration to the ring configuration, the communication frame 30 can make a full round between the end of the output process 162 and the start of the input process 164. Accordingly, instead of the preliminary input data 172 updated in the previous task execution cycle, the input data (current cycle input data 170) included in the communication frame 30 received in the same task execution cycle is used in the control operation 160.
[0112] As described above, in the control system 1 according to the present embodiment, even if the ring configuration changes to a non-ring configuration during the execution of the control operation, or even if the non-ring configuration changes to the ring configuration, the execution of the control operation can be continued while minimizing the impact on the control performance.
[0113] <F. System Design and User Support> Next, the configuration and processing for performing system design in the control system 1 according to the present embodiment will be described.
[0114] (f1: Support Device) The user program 1104 and the system setting information 1106 stored in the PLC 100 can be created and set using a support device 400 connectable to the PLC 100.
[0115] Fig. 13 is a schematic diagram showing an example of a hardware configuration of support device 400 in control system 1 according to the present embodiment. Referring to Fig. 13, support device 400 is realized, as an example, using hardware (for example, a general-purpose personal computer) conforming to a general-purpose architecture.
[0116] The support device 400 provides an integrated development environment that enables settings for the PLC 100 and the device 200 of the control system 1, and the creation of a user program 1104 executed by the PLC 100 in an integrated manner. In the integrated development environment, debugging, simulation, and the like may be possible.
[0117] 13, the support device 400 includes, as main hardware components, a processor 402, a main memory 404, an input unit 406, a display unit 408, a storage 410, a communication controller 412, an optical drive 416, and a USB controller 424. These hardware components are electrically connected via an internal bus 228.
[0118] The processor 402 is composed of a CPU, a GPU, and the like, and realizes the functions of the support device 400 by reading out a program stored in the storage 410, expanding it in the main memory 404, and executing it.
[0119] The main memory 404 is configured with a volatile storage device such as a DRAM or an SRAM, etc. The storage 410 is configured with a non-volatile storage device such as an HDD or an SSD, etc.
[0120] The storage 410 stores an OS 4102 for implementing basic functions, a development program 4104 for implementing an integrated development environment, and the like. The development program 4104 provides the integrated development environment by being executed by the processor 402.
[0121] The input unit 406 is composed of a keyboard, a mouse, and the like, and accepts user operations. The display unit 408 is composed of a display and various indicators, and outputs the processing results from the processor 402, etc.
[0122] The communication controller 412 exchanges data with any information processing device via any higher-level network.
[0123] The optical drive 416 can read any data from a storage medium 418 (eg, an optical storage medium such as a DVD) that non-transiently stores a computer-readable program, and can write any data to the storage medium 418 .
[0124] A USB controller 424 transmits and receives data to and from any information processing device via a USB connection.
[0125] A computer-readable program may be read from a storage medium 418 that non-transiently stores the program and installed in the storage 410. Alternatively, various programs executed by the support device 400 may be installed by downloading them from a server device on a network. In addition, the functions provided by the support device 400 according to the present embodiment may be realized by utilizing some of the modules provided by the OS 4102.
[0126] During operation of the control system 1, the support device 400 may be removed from the PLC 100.
[0127] (f2: threshold time) The support device 400 may have a function of determining each of the above-mentioned threshold times Th1, Th2, and Th3.
[0128] The threshold time Th1 (first threshold time) is a time for determining whether a frame has been lost, and is determined based on the round trip time in the target network.
[0129] The threshold time Th2 (second threshold time) is determined based on the round trip time when no failure occurs in the ring configuration. In other words, the threshold time Th1 is determined based on the time it takes for a communication frame transmitted from the field network controller 112 (communication unit) of the PLC 100 to make a round trip and return to the field network controller 112 (communication unit) in the ring configuration.
[0130] The threshold time Th3 (third threshold time) is determined based on the round trip time when no failure occurs in the ring configuration. That is, the threshold time Th3 is determined based on the time it takes for a communication frame transmitted from the field network controller 112 (communication unit) to make a round trip and return to the field network controller 112 (communication unit) when any cable included in the ring configuration cannot transmit the communication frame.
[0131] For example, the support device 400 may measure the time it takes for a communication frame to make one round in the network of the control system 1, and determine the threshold time Th2 and / or the threshold time Th3 based on the measured time.
[0132] Alternatively, the support device 400 may determine the threshold time Th2 and / or the threshold time Th3 by simulation. For example, the support device 400 may determine the threshold time Th1 and / or the threshold time Th2 according to a predetermined calculation formula based on the number of devices 200 connected to the network and information on the connection form (network topology) of the network.
[0133] (f3: User interface screen) The user uses the integrated development environment provided by the support device 400 to create the user program 1104 and also to perform various settings related to the control system 1. At this time, the support device 400 can estimate the execution time of the user program 1104 and the like by simulation in response to user operations. Then, the support device 400 can advise the user on changing the operation mode and the like based on the simulation results.
[0134] Fig. 14 is a schematic diagram showing an example of a user interface screen 450 provided by the support device 400 of the control system 1 according to the present embodiment. Referring to Fig. 14, the user interface screen 450 includes a graph 452 showing the execution time of the user program 1104 calculated under the current settings, and a graph 454 showing the execution time of the user program 1104 in the case where the control performance priority mode is adopted after changing the network configuration. Note that the execution time shown in the graph 452 may be a measured value measured by the PLC 100.
[0135] By comparing the graph 452 and the graph 454, the user can grasp in advance how much the execution time (task execution period) of the user program 1104 can be reduced.
[0136] In the example of user interface screen 450 shown in FIG. 14, a message 460 is displayed based on the simulation results, stating, "By changing to a ring configuration and selecting the control performance priority mode, the task execution period can be shortened from 2 ms to 1 ms."
[0137] The user refers to message 460, changes the network configuration of the control system 1 from a non-ring configuration to a ring configuration, and then enables the control performance priority mode by checking check box 458. When the control performance priority mode is enabled, the user may be notified that data synchronicity may be lost if any failure occurs in the network.
[0138] In the example shown in FIG. 14, it can be seen that the checkbox 456 is checked and the data synchronization priority mode is selected.
[0139] (f4: Confirmation / Acquisition of Operating Mode) The operating mode of the PLC 100 and the execution time of the user program 1104 may be confirmed and acquired by any method.
[0140] Typically, the support device 400 may be connected to the PLC 100, and on the support device 400, the operating mode of the PLC 100 (whether it is the data synchronization priority mode or the control performance priority mode), as well as the execution time of the user program 1104, etc. may be monitored.
[0141] Alternatively, an HMI (Human Machine Interface) may be provided in the control system 1, and the operating mode of the PLC 100 and the execution time of the user program 1104, etc. may be displayed on the HMI.
[0142] Furthermore, by using system variables or special events held by the PLC 100, etc., the operating mode of the PLC 100 and the execution time of the user program 1104, etc. may be acquired by dedicated instructions included in the user program 1104. In this way, it may be configured such that the current operating mode can be referred to by instructions included in the user program 1104 executed by the PLC 100. For example, a user program 1104 that varies the input processing according to the operating mode of the PLC 100 may also be created.
[0143] <Variations of Ring Configuration> In the above description, an example of a ring configuration using the relay device 300 has been described, but it is not limited to this, and other configurations may be adopted.
[0144] FIG. 15 is a diagram showing an example of a ring configuration that can be adopted in the control system 1 according to the present embodiment.
[0145] FIG. 15(A) shows an example of a ring configuration using a relay device 300 having three or more ports. By having three or more ports, the relay device 300 provides junction redundancy. In the ring configuration shown in FIG. 15(A), it includes a relay device 300 connected to the field network controller 112 (communication unit) of the PLC 100 and a plurality of devices 200 (slaves).
[0146] FIG. 15(B) shows an example of a ring configuration using a PLC 100 having two or more ports 151, 152. By having two or more ports, the PLC 100 provides cable redundancy. In the ring configuration shown in FIG. 15(B), the field network controller 112 (communication unit) of the PLC 100 has a plurality of ports respectively connected to different devices 200 (slaves).
[0147] Also, a ring configuration may be configured by arbitrarily combining the relay device 300 shown in FIG. 15(A) and the PLC 100 shown in FIG. 15(B).
[0148] The communication control method according to the present embodiment is applicable not only to the above-described configuration examples but also to any ring configuration. Also, as the communication protocol, it is applicable not only to EtherCAT but also to various communication protocols for industrial networks having timing.
[0149] <H. Supplementary Note> The present embodiment as described above includes the following technical ideas. [Configuration 1] A communication unit (112) connected to a network configured such that a communication frame (30) makes a round trip, a control operation (160) based on input data included in the communication frame received via the communication unit, and transmission of a communication frame including output data determined by the control operation Trusta calculation processing unit (102) which repeatedly executes the calculation every execution period, The arithmetic processing unit is a first operation mode in which, if the transmitted communication frame is not received within a first threshold time (Th1) after the transmission of the communication frame, a control operation is executed based on preliminary input data (172) that is input data included in the communication frame received prior to the transmission of the communication frame; a second operation mode in which, if the transmitted communication frame is not received within a second threshold time (Th2) that is shorter than the first threshold time after the transmission of the communication frame, a control operation is executed based on preliminary input data (172) that is input data included in the communication frame received prior to the transmission of the communication frame; The arithmetic processing unit is in the first operation mode, if the transmitted communication frame is received by the first threshold time, updating the preliminary input data with input data included in the received communication frame; In the second operating mode, if the transmitted communication frame is received by a third threshold time (Th3) that is longer than the second threshold time, the control device (100) updates the preliminary input data with the input data contained in the received communication frame. [Configuration 2] 2. The control device according to configuration 1, wherein the network includes a ring configuration configured such that a communication frame is transmitted in only one direction in each of the cables (21-26) connected to the communication slaves. [Configuration 3] 3. The control device according to configuration 2, wherein the calculation processing unit is capable of enabling the second operation mode when the network includes the ring configuration. [Configuration 4] the second threshold time is determined based on a time required for a communication frame transmitted from the communication unit to make a round and return to the communication unit in the ring configuration; The control device according to configuration 2 or 3, wherein the third threshold time is determined based on the time it takes for a communication frame transmitted from the communication unit to make a full loop and return to the communication unit when any cable included in the ring configuration is unable to transmit the communication frame. [Configuration 5] 5. The control device according to any one of configurations 2 to 4, wherein the ring configuration includes a relay device (300) connected to the communication unit and a plurality of communication slaves (200). [Configuration 6] 5. The control device according to any one of configurations 2 to 4, wherein the communication unit has a plurality of ports (151, 152) each connected to a different communication slave. [Configuration 7] 2. The control device according to configuration 1, wherein an execution period (Tc1) in the second operation mode is set to be shorter than an execution period (Tc2) in the first operation mode. [Configuration 8] The control device according to any one of configurations 1 to 7, configured so that an operation mode of the arithmetic processing unit can be referenced by an instruction included in a user program (1104) executed by the arithmetic processing unit. [Configuration 9] A communication control method executed by a control device (100) including a communication unit (112) connected to a network configured to circulate a communication frame, comprising: executing an input process according to a selected operation mode of the first operation mode and the second operation mode (S104, S106, S110, S114; S204, S206, S210, S212, S214, S218, S220); Executing a control calculation based on input data included in the communication frame received via the communication unit (S108, S116; S208, S216); and transmitting a communication frame including output data determined by the control calculation (S102, S202); The step of executing the input process includes: In the first mode of operation: a step (S114) of using preliminary input data, which is input data included in a communication frame received prior to the transmission of the communication frame, for the control calculation if the transmitted communication frame is not received within a first threshold time from the transmission of the communication frame; and if the transmitted communication frame is received by the first threshold time, updating the preliminary input data with input data included in the received communication frame (S110); In the second mode of operation, a step (S214) of using preliminary input data, which is input data included in a communication frame received prior to the transmission of the communication frame, for the control calculation if the transmitted communication frame is not received within a second threshold time that is shorter than the first threshold time after the transmission of the communication frame; and if the transmitted communication frame is received by a third threshold time that is longer than the second threshold time, updating the preliminary input data with the input data contained in the received communication frame (S220). [Configuration 10] A control program (1102) executed on a computer (100) including a communication unit (112) connected to a network configured to circulate a communication frame, the control program causing the computer to: executing an input process according to a selected operation mode of the first operation mode and the second operation mode (S104, S106, S110, S114; S204, S206, S210, S212, S214, S218, S220); Executing a control calculation based on input data included in the communication frame received via the communication unit (S108, S116; S208, S216); and transmitting a communication frame including output data determined by the control calculation (S102, S202). The step of executing the input process includes: In the first mode of operation: If the transmitted communication frame is not received by the first threshold time after transmission, using, for the control operation, preliminary input data which is the input data included in the communication frame received before the transmission (step S114); If the transmitted communication frame is received by the first threshold time, updating the preliminary input data with the input data included in the received communication frame (step S110); In the second operation mode, If the transmitted communication frame is not received by a second threshold time shorter than the first threshold time after transmission, using, for the control operation, preliminary input data which is the input data included in the communication frame received before the transmission (step S214); If the transmitted communication frame is received by a third threshold time longer than the second threshold time, updating the preliminary input data with the input data included in the received communication frame (step S220).
[0150] <I. Advantages> The control system according to the present embodiment can achieve both shortening of the round-trip time obtained by the ring configuration and stabilization of control when some failure occurs in the ring configuration.
[0151] The embodiments disclosed this time should be considered as illustrative in all respects and not restrictive. The scope of the present invention is shown not by the above description but by the claims, and it is intended that all modifications within the meaning and scope equivalent to the claims are included.
Description of Reference Numerals
[0152] 1 Control system, 20, 21, 22, 23, 24, 25, 26 Cable, 30 Communication frame, 100 PLC, 102, 202, 302, 402 Processor, 104, 204, 304, 404 Main memory, 110, 210, 310, 410 Storage, 112, 212 Field network controller, 114 Local bus controller, 116 Functional unit, 118, 228 Internal bus, 151, 152 Port, 160 Control operation, 162 Output processing, 164 Input processing, 166 Slack time, 170 Current cycle input data, 172 Reserve input data, 200 Device, 206, 306 Control circuit, 220 Functional module, 251, 351 First port, 252, 352 Second port, 300 Relay device, 312 Field network interface, 353 third port, 400 support device, 406 input section, 408 display section, 412 communication controller, 416 optical drive, 418 storage medium, 424 USB controller, 450 user interface screen, 452, 454 graphs, 456, 458 check boxes, 460 messages, 1102 system program, 1104 user program, 1106 system setting information, 4102 OS, 4104 development program, T0 end timing, Tc1, Tc2, Tc3 task execution period, Th1, Th2, Th3 threshold time, Tr1, Tr2, Tr3 round trip time, Tt1, Tt2, Tt3, Tt4 communication time.
Claims
1. A communication unit connected to a network configured so that a communication frame circulates; a calculation processing unit that repeatedly executes a control calculation based on input data included in a communication frame received via the communication unit, and a transmission of a communication frame including output data determined by the control calculation, for each execution period; the network includes a ring configuration configured such that communication frames are transmitted in only one direction in each of the cables connected to the communication slaves; The arithmetic processing unit is a first operation mode in which, if the transmitted communication frame is not received within a first threshold time after the transmission of the communication frame, a control operation is executed based on preliminary input data that is input data included in the communication frame received prior to the transmission of the communication frame; a second operation mode in which, if the transmitted communication frame is not received within a second threshold time that is shorter than the first threshold time after the transmission of the communication frame, a control operation is executed based on preliminary input data that is input data included in the communication frame received prior to the transmission of the communication frame; The arithmetic processing unit is in the first operation mode, if the transmitted communication frame is received by the first threshold time, updating the preliminary input data with input data included in the received communication frame; a control device that, in the second operating mode, if the transmitted communication frame is received by a third threshold time that is longer than the second threshold time, updates the preliminary input data with the input data contained in the received communication frame.
2. The control device according to claim 1 , wherein the calculation processing unit is capable of enabling the second operation mode when the network includes the ring configuration.
3. the second threshold time is determined based on a time required for a communication frame transmitted from the communication unit to make a round and return to the communication unit in the ring configuration; 3. The control device according to claim 1 or 2, wherein the third threshold time is determined based on the time it takes for a communication frame transmitted from the communication unit to make a complete loop and return to the communication unit when any cable included in the ring configuration is unable to transmit the communication frame.
4. 4. The control device according to claim 1, wherein the ring configuration includes a relay device connected to the communication unit and a plurality of communication slaves.
5. 4. The control device according to claim 1, wherein the communication unit has a plurality of ports each connected to a different communication slave.
6. The control device according to claim 1 , wherein an execution period in the second operation mode is set to be shorter than an execution period in the first operation mode.
7. 7. The control device according to claim 1, configured so that an operation mode of said arithmetic processing unit can be referenced by an instruction included in a user program executed by said arithmetic processing unit.
8. A communication control method executed by a control device including a communication unit connected to a network configured to circulate a communication frame, comprising: the network includes a ring configuration configured such that communication frames are transmitted in only one direction in each of the cables connected to the communication slaves; The communication control method includes: executing an input process according to a selected operation mode from a first operation mode and a second operation mode; executing a control calculation based on input data included in a communication frame received via the communication unit; transmitting a communication frame including output data determined by the control calculation; The step of executing the input process includes: In the first mode of operation: if the transmitted communication frame is not received within a first threshold time from the transmission of the communication frame, using preliminary input data, which is input data included in a communication frame received prior to the transmission of the communication frame, for the control calculation; and if the transmitted communication frame is received by the first threshold time, updating the preliminary input data with input data included in the received communication frame; In the second mode of operation: if the transmitted communication frame is not received within a second threshold time, which is shorter than the first threshold time, from the transmission of the communication frame, using preliminary input data, which is input data included in the communication frame received prior to the transmission of the communication frame, for the control calculation; and if the transmitted communication frame is received by a third threshold time that is longer than the second threshold time, updating the preliminary input data with input data contained in the received communication frame.
9. A control program executed on a computer including a communication unit connected to a network configured to circulate a communication frame, the network includes a ring configuration configured such that communication frames are transmitted in only one direction in each of the cables connected to the communication slaves; The control program is written to the computer. executing an input process according to a selected operation mode from a first operation mode and a second operation mode; executing a control calculation based on input data included in a communication frame received via the communication unit; and transmitting a communication frame including output data determined by the control calculation. The step of executing the input process includes: In the first mode of operation: if the transmitted communication frame is not received within a first threshold time from the transmission of the communication frame, using preliminary input data, which is input data included in a communication frame received prior to the transmission of the communication frame, for the control calculation; and if the transmitted communication frame is received by the first threshold time, updating the preliminary input data with input data included in the received communication frame; In the second mode of operation: if the transmitted communication frame is not received within a second threshold time, which is shorter than the first threshold time, from the transmission of the communication frame, using preliminary input data, which is input data included in the communication frame received prior to the transmission of the communication frame, for the control calculation; and if the transmitted communication frame is received within a third threshold time that is longer than the second threshold time, updating the preliminary input data with input data contained in the received communication frame.
Citation Information
Patent Citations
JP1992080149U
Method and device for controlling transmission of traffic of two class
JP1993219081A
Programmable controller and control program
JP2015210752A
Master unit, arithmetic processing unit, programmable logic controller, network, and information processing method
JP2020167554A
Control system, control device, and control method
WO2015133175A1
