Relay device, program, relay method, and data communication system
The introduction of a relay device within the EtherCAT system addresses the inefficiency in detecting communication abnormalities by replicating communication frames and monitoring states, thereby enhancing communication efficiency and system stability.
Patent Information
- Application Number
- PCT/JP2023/045110
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2025-06-19
AI Technical Summary
Existing EtherCAT systems face limitations in communication efficiency due to the inability to immediately detect communication abnormalities, such as link down, in remotely installed slaves, which hinders efficient disconnection and reconnection of proxy slaves.
A relay device is introduced that operates as a slave within the EtherCAT system, featuring a first input/output unit for short-period communication with the master and a second input/output unit for long-period communication with a remote slave. The device replicates communication frames and includes a control unit that monitors communication states and notifies changes to the master or upstream slaves.
This solution enhances communication efficiency by enabling immediate detection and response to changes in communication states, allowing for efficient disconnection and reconnection of proxy slaves and maintaining system stability.
Smart Images

Figure JP2023045110_19062025_PF_FP_ABST
Abstract
Description
Relay device, program, relay method, and data communication system
[0001] The present disclosure relates to a relay device, a program, a relay method, and a data communication system.
[0002] Non-Patent Document 1 describes an overview of EtherCAT (registered trademark) technology.
[0003] “EtherCAT - Ethernet Fieldbus”, [online], EtherCAT Technology Group, [Retrieved May 17, 2022], Internet <URL: https: / / www.ethercat.org / download / documents / ETG_Brochure_JP.pdf>
[0004] In existing systems using EtherCAT® technology, the location of slaves is limited by the location of the master. Therefore, a method for extending EtherCAT® transmission can be considered, which involves installing a proxy slave to act as a proxy for a remotely installed slave without affecting the existing system. In this method, the proxy slave communicates with the remote slave over a long period and corrects the long-period time to the short-period time of the existing system, allowing data received from the remote slave to be transmitted to the master. However, with such a method, if the proxy slave can communicate normally with the upstream slave, the upstream slave cannot immediately detect a communication abnormality, such as a link down, with the remote slave. This creates a problem: it is not possible to transition to efficient communication, such as by disconnecting the proxy slave and the remote slave.
[0005] The present disclosure has been made in view of the above circumstances, and aims to improve the efficiency of communication in response to changes in communication conditions.
[0006] a control unit that reads data written by the remote slave device in each communication frame received by the second input / output unit, writes the read data into a corresponding communication frame transmitted from the first input / output unit, and, upon detecting a change in the communication state between the relay device and the remote slave device, notifies the master device or a slave device in the plurality of slave devices that is located upstream of the relay device of the detected change via the first input / output unit;
[0007] A program according to one embodiment causes a computer to function as the relay device.
[0008] A relay method according to one embodiment is a relay method for operating a relay device as one slave device among a plurality of slave devices, the relay device comprising: a first input / output unit of the relay device transmitting and receiving a communication frame that is transmitted from a master device at each first period, that circulates through the plurality of slave devices, that is read or written by each slave device of the plurality of slave devices, and that returns to the master device; a second input / output unit of the relay device transmitting and receiving a communication frame that is transmitted from the relay device at each second period, that is read or written by a remote slave device other than the plurality of slave devices, and that returns to the relay device; a duplicating unit of the relay device generating each communication frame that is transmitted from the second input / output unit by duplicating each communication frame received by the first input / output unit; a control unit of the relay device reading data that is written by the remote slave device in each communication frame received by the second input / output unit; and the control unit writing the read data into a corresponding communication frame that is transmitted from the first input / output unit. When the control unit detects a change in the communication state between the relay device and the remote slave device, the control unit notifies the detected change to the master device or one of the multiple slave devices that is located in a stage preceding the relay device via the first input / output unit.
[0009] a control unit that, upon detecting a change in a communication state between the relay device and the remote slave device, notifies the master device or a slave device preceding the relay device of the detected change via the first input / output unit; a control unit that, upon detecting a change in a communication state between the relay device and the remote slave device, notifies the master device or a slave device preceding the relay device of the detected change via the first input / output unit;
[0010] According to the present disclosure, it is possible to improve the efficiency of communication in response to changes in communication conditions.
[0011] Fig. 1 is a block diagram showing a configuration of a data communication system according to one embodiment; Fig. 2 is a block diagram showing a configuration of a relay device provided in the data communication system; Fig. 3 is a table showing an example of a management database of a slave management unit provided in the relay device; Fig. 4 is a flowchart showing an operation of the relay device; Fig. 5 is a block diagram showing a configuration of a data communication system according to a comparative example;
[0012] A comparative example will be described below with reference to the drawings.
[0013] The configuration of a data communication system 90 according to a comparative example will be described with reference to FIG.
[0014] The data communication system 90 includes a master device 11 and multiple slave devices 12. The multiple slave devices 12 include three slave devices: slave device 12A, slave device 12B, and slave device 12C.
[0015] The data communication system 90 has a physical configuration in which the slave devices are directly connected in a daisy chain. Specifically, the slave device 12A is connected to the master device 11, the slave device 12B is connected to the slave device 12A, and the slave device 12C is connected to the slave device 12B. A communication frame is transmitted from the master device 11 at each first cycle, circulates through the multiple slave devices 12, and is read or written by each of the multiple slave devices 12 before returning to the master device 11. In other words, the communication frame is looped back at the last slave device, the slave device 12C. Therefore, the data communication system 90 has a logical ring-type connection configuration.
[0016] If a communication abnormality such as a link down of a slave device is detected, the communication frame is returned by an upstream slave device that is not abnormal, and communication continues with only the normal slave devices. For example, if slave device 12B detects a communication abnormality such as a link down of downstream slave device 12C, slave device 12B determines that the downstream slave devices 12C and beyond are abnormal. Then, slave device 12B begins communication by returning the communication frame.
[0017] The transmission and reception of data by EtherCAT (registered trademark) communication in the data communication system 90 will be further described.
[0018] A communication frame is transmitted from the master device 11, which controls the entire system, passes through all of the multiple slave devices 12 in the order in which they are connected, and when it arrives at the terminal slave device 12C, it travels back along the same route and returns to the master device 11. In EtherCAT (registered trademark) communication, time-synchronized communication is achieved by measuring the time difference between the transmission and return of the communication frame and correcting it from the master clock. That is, time synchronization is achieved by the master device 11 writing the time into the communication frame, and each slave device reading that time and calculating the time delay.
[0019] The data portion of the communication frame stores all the processing data for each slave device. When each slave device receives and transmits a communication frame, it reads and writes the processing data on the fly. This allows the processing data to be transmitted in short cycles. As a result, real-time performance, i.e., low latency, is achieved.
[0020] In EtherCAT® communication, a communication frame passes unidirectionally from the master device 11 through all of the slave devices 12 in order. Processing data is read and written during the first pass, but processing data is not read or written during the second pass, i.e., upon return. Therefore, communication between slave devices must be achieved by repeating two cycles of sending and receiving communication frames. For example, the slave device 12A transmits data to the slave device 12B in two cycles, cycle C1 and cycle C2. That is, the slave device 12A writes data addressed to the slave device 12B to an area of the communication frame allocated to the slave device 12A in cycle C1. The master device 11 reads the data addressed to the slave device 12B when the communication frame returns. The master device 11 transmits a communication frame including data addressed to the slave device 12B in cycle C2. The slave device 12A receives the communication frame and transmits it to the slave device 12B. The slave device 12B then reads the data addressed to the slave device 12B from the area of the communication frame allocated to the slave device 12B.
[0021] The communication between slave devices is, for example, feedback control communication. "FB" is an abbreviation for feedback. Feedback control communication is communication that controls the output to an appropriate target value or reference value by sending the output back to the input side. The delay in feedback control communication depends on the communication distance between the master device 11 and the slave device. Therefore, it is not possible to mix short-period feedback control communication with short communication times and long-period feedback control communication with long communication times on the same system.
[0022] The multiple slave devices 12 are installed at a master installation location 21. That is, the multiple slave devices 12 are installed at the same location as the master device 11 or close to the master device 11. Therefore, the master device 11 can perform short-cycle communication with the multiple slave devices 12. However, if the slave device 12C must be moved to a location far enough away that long-cycle communication with a long communication time is required, the master device 11 will no longer be able to perform short-cycle communication with the slave device 12C.
[0023] An embodiment will be described below with reference to the drawings.
[0024] In each drawing, the same or corresponding parts are denoted by the same reference numerals. In the description of this embodiment, the description of the same or corresponding parts will be omitted or simplified as appropriate.
[0025] The configuration of a data communication system 10 according to this embodiment will be described with reference to FIG.
[0026] Similar to the data communication system 90 according to the comparative example, the data communication system 10 includes a master device 11 and multiple slave devices 12. In this embodiment, the multiple slave devices 12 include two slave devices, slave device 12A and slave device 12B, as well as a relay device 13 as one slave device. The multiple slave devices 12 may include only one slave device other than the relay device 13, or may include three or more slave devices other than the relay device 13.
[0027] In this embodiment, the data communication system 10 further includes a remote slave device 14 separate from the multiple slave devices 12. The remote slave device 14 is installed in a remote location 22. The remote slave device 14 corresponds to the slave device 12C in the comparative example, which has been moved to a location far enough away that long-cycle communication is required. Therefore, the master device 11 cannot directly perform short-cycle communication with the remote slave device 14.
[0028] Similar to the data communication system 90 according to the comparative example, the data communication system 10 has a physical configuration in which slave devices are directly connected in a chain. Specifically, a slave device 12A is connected to a master device 11, a slave device 12B is connected to the slave device 12A, and a relay device 13 is connected to the slave device 12B. The short-cycle communication between the master device 11 and each slave device is EtherCAT (registered trademark) communication. A communication frame for the short-cycle communication is transmitted from the master device 11 every first cycle, circulates through the multiple slave devices 12, and is read or written by each slave device of the multiple slave devices 12 before returning to the master device 11. In other words, the communication frame for the short-cycle communication is looped back by the relay device 13, which is the last slave device. Therefore, similar to the data communication system 90 according to the comparative example, the data communication system 10 has a logical ring-type connection configuration. The relay device 13 may be located upstream of the slave device 12B or the slave device 12A.
[0029] The relay device 13 is connected to the carrier network 16 via an adapter 15. The remote slave device 14 is connected to the carrier network 16 via an adapter 17. Communication between the adapters 15 and 17 is Ethernet (registered trademark) communication, specifically, TSN communication. "TSN" is an abbreviation for Time-Sensitive Networking. Long-cycle communication between the relay device 13 and the remote slave device 14 is EtherCAT (registered trademark) communication via the carrier network 16. This EtherCAT (registered trademark) communication is made possible by protocol conversion performed by the adapters 15 and 17. A communication frame for long-cycle communication is transmitted from the relay device 13 every second cycle, read or written by the remote slave device 14, and then returned to the relay device 13. In other words, the communication frame for long-cycle communication is looped back by the remote slave device 14. One or more other remote slave devices may be further disposed above, below, or both the remote slave device 14 and the remote slave device 14.
[0030] A communication frame for short-cycle communication passes unidirectionally through all of the multiple slave devices 12 in order, starting from the master device 11. Processing data is read and written during the first pass, but processing data is not read or written during the second pass, i.e., upon return. Therefore, communication between slave devices included in the multiple slave devices 12 must be achieved by repeating two cycles of sending and receiving communication frames. On the other hand, the first communication between the remote slave device 14 and a slave device included in the multiple slave devices 12 requires X cycles, where X is an integer greater than or equal to 3. Since the time required for one cycle of long-cycle communication between the relay device 13 and the remote slave device 14 depends on the communication distance, X varies depending on how many cycles of short-cycle communication the master device 11 can perform within that time. The second and subsequent communications between the remote slave device 14 and a slave device included in the multiple slave devices 12 use the same cycle as short-cycle communication.
[0031] In this embodiment, a relay device 13 is installed as a proxy slave device that substitutes for the remote slave device 14, establishing a method for extending EtherCAT® transmission without affecting the existing system. In this method, the relay device 13 communicates with the remote slave device 14 over a long period and corrects the long-period time to the short-period time of the existing system, thereby enabling data received from the remote slave device 14 to be transmitted to the master device 11. However, if the relay device 13 is able to communicate normally with the upstream slave device 12B, the slave device 12B cannot directly detect a communication abnormality, such as a link down, of the remote slave device 14. If the slave device 12B were unable to detect a communication abnormality, such as a link down, of the remote slave device 14, it would be impossible to transition to efficient communication, such as by disconnecting the relay device 13 and the remote slave device 14.
[0032] Therefore, in this embodiment, the relay device 13 monitors the status of long-cycle communication with the remote slave device 14, and when a change in the status is detected, it immediately notifies the upstream slave device or the master device 11 of a link up, link down, or error depending on the change. As a result, the slave device 12B can immediately detect a communication abnormality such as a link down of the remote slave device 14, and it becomes possible to transition to efficient communication by disconnecting the relay device 13 and the remote slave device 14. After that, the slave device 12B can immediately detect the recovery of communication with the remote slave device 14, and it becomes possible to reintegrate the relay device 13 and the remote slave device 14.
[0033] The configuration of the relay device 13 according to this embodiment will be described with reference to FIG.
[0034] The relay device 13 includes a first input / output unit 30 , a second input / output unit 40 , a duplicating unit 50 , and a control unit 60 .
[0035] The first input / output unit 30 includes interfaces 31 and 32 that transmit and receive communication frames for short-cycle communication. The interfaces 31 and 32 are, for example, communication ports compatible with the physical layer of Ethernet (registered trademark). The interface 31 is connected to a node higher than the relay device 13, i.e., the master device 11 or a slave device in the preceding stage of the relay device 13 among the multiple slave devices 12. The interface 32 is connected to a node lower than the relay device 13, i.e., a slave device in the following stage of the relay device 13 among the multiple slave devices 12, if there is such a slave device.
[0036] The second input / output unit 40 includes an interface 41 that transmits and receives communication frames for long-period communication. The interface 41 is, for example, a communication port compatible with the physical layer of Ethernet (registered trademark). The interface 41 is connected to the remote slave device 14. Specifically, the interface 41 is connected to the remote slave device 14 via the adapters 15 and 17 and the carrier network 16.
[0037] The duplicating unit 50 is a circuit that generates each communication frame to be transmitted from the second input / output unit 40 by duplicating each communication frame received by the first input / output unit 30 .
[0038] The control unit 60 includes at least one processor, at least one programmable circuit, at least one dedicated circuit, or any combination thereof. The processor may be a general-purpose processor such as a CPU, GPU, or DSP, or a dedicated processor specialized for a specific process. "CPU" is an abbreviation for central processing unit. "GPU" is an abbreviation for graphics processing unit. "DSP" is an abbreviation for digital signal processor. The programmable circuit may be, for example, an FPGA. "FPGA" is an abbreviation for field-programmable gate array. The dedicated circuit may be, for example, an ASIC. "ASIC" is an abbreviation for application-specific integrated circuit. The control unit 60 controls each component of the relay device 13 and executes processing related to the operation of the relay device 13. Specifically, the control unit 60 reads data written by the remote slave device 14 in each communication frame received by the second input / output unit 40. The control unit 60 writes the read data into the corresponding communication frame transmitted from the first input / output unit 30. In this embodiment, when the control unit 60 detects a change in the communication state between the relay device 13 and the remote slave device 14, it notifies the master device 11 or one of the multiple slave devices 12 that is located before the relay device 13 of the detected change via the first input / output unit 30.
[0039] The control unit 60 includes a slave control unit 61 , a proxy control unit 62 , a slave management unit 63 , and a memory management unit 64 .
[0040] The slave control unit 61 has a memory 65. The memory 65 is, for example, a semiconductor memory such as a RAM, a ROM, or a flash memory. "RAM" is an abbreviation for random access memory. "ROM" is an abbreviation for read only memory. RAM is, for example, an SRAM or a DRAM. "SRAM" is an abbreviation for static random access memory. "DRAM" is an abbreviation for dynamic random access memory. ROM is, for example, an EEPROM. "EEPROM" is an abbreviation for electrically erasable programmable read only memory. Flash memory is, for example, an SSD. "SSD" is an abbreviation for solid-state drive. Communication frames of short-cycle communication are sequentially written to the memory 65 from the first input / output unit 30 via the duplicating unit 50, and data read from communication frames of long-cycle communication is sequentially written to the memory 65 as update data from the proxy control unit 62.
[0041] The slave control unit 61 outputs the communication frame of the long-cycle communication input from the duplicating unit 50 to the proxy control unit 62. The slave control unit 61 aligns the absolute time of the first cycle with the absolute time of the second cycle. That is, the slave control unit 61 associates the communication frame of the short-cycle communication written in the memory 65 with the communication frame of the long-cycle communication from which the update data written in the memory 65 is read. When outputting the communication frame of the short-cycle communication written in the memory 65 to the first input / output unit 30, the slave control unit 61 writes the update data read from the corresponding communication frame of the long-cycle communication written in the memory 65 on the fly to an area of the communication frame of the short-cycle communication allocated to the remote slave device 14. The update data is, for example, data addressed to the master device 11, data addressed to the slave device 12A, or data addressed to the slave device 12B.
[0042] The proxy control unit 62 outputs the communication frame of the long-cycle communication input from the slave control unit 61 to the second input / output unit 40. When terminating the communication frame of the long-cycle communication input from the second input / output unit 40, i.e., before discarding the communication frame of the long-cycle communication input from the second input / output unit 40, the proxy control unit 62 reads the data written by the remote slave device 14 from the communication frame of the long-cycle communication. The proxy control unit 62 writes the read data to the memory 65.
[0043] The slave management unit 63 has a management database 66 as shown in FIG. 3. The management database 66 includes at least three columns: management number, connected slave, and status. The management number is a number for identifying each remote slave device, especially when two or more remote slave devices exist. The connected slave is the name of the remote slave device corresponding to the management number. The status is the communication status between the relay device 13 and the remote slave device corresponding to the management number.
[0044] The slave management unit 63 monitors the communication status between the relay device 13 and the remote slave device 14. When the slave management unit 63 detects a change in the communication status, it updates the status in the management database 66 to reflect the detected change and controls the slave control unit 61 to write a code corresponding to the detected change on the fly into the communication frame of the short-cycle communication. The change in the communication status may be from a normal state to an abnormal state, or from an abnormal state to a normal state. There are, for example, the following three cases for a change to an abnormal state. The first case is when a link down, i.e., a communication interruption, is detected in the remote interface 41. The second case is when a response packet that should arrive periodically from the remote slave device 14 cannot be received. The third case is when a response packet can be received, but the value of the response packet is abnormal.
[0045] For example, when the slave management unit 63 detects a communication interruption with the remote slave device 14, it sets the master-side interface 31 to link down. Link down is a state in which communication is cut off, that is, a state in which communication through the interface 31 is turned off. During link down, negotiation is not possible. With Ethernet (registered trademark), when negotiation is not possible, the communication speed or communication mode cannot be matched with that of the other device, and therefore communication with the other device is not possible. During link down, the slave management unit 63 controls the proxy control unit 62 to periodically send diagnostic frames to the remote slave device 14.
[0046] For example, when the slave management unit 63 detects that communication with the remote slave device 14 has been restored, it sets the interface 31 on the master side to link-up. Link-up is a state in which communication is enabled, that is, a state in which communication through the interface 31 is turned on. Negotiation is possible during link-up. With Ethernet (registered trademark), when negotiation is possible, the communication speed and communication mode can be matched with those of the other device, making communication with the other device possible.
[0047] The memory manager 64 indicates the location in the memory 65 where the update data is to be read and written.
[0048] The functions of the relay device 13 are realized by executing a program according to this embodiment on a processor serving as the control unit 60. That is, the functions of the relay device 13 are realized by software. The program causes a computer to execute the operations of the relay device 13, thereby causing the computer to function as the relay device 13. That is, the computer functions as the relay device 13 by executing the operations of the relay device 13 in accordance with the program.
[0049] The program can be stored on a non-transitory computer-readable medium. Examples of the non-transitory computer-readable medium include flash memory, magnetic recording devices, optical disks, magneto-optical recording media, and ROMs. The program can be distributed by selling, transferring, or lending portable media such as SD cards, DVDs, or CD-ROMs that store the program. "SD" is an abbreviation for Secure Digital. "DVD" is an abbreviation for digital versatile disc. "CD-ROM" is an abbreviation for compact disc read only memory. The program can also be distributed by storing it in the storage of a server and transferring it from the server to another computer. The program can also be provided as a program product.
[0050] A computer temporarily stores a program stored on a portable medium or transferred from a server in its main storage device. The computer then reads the program stored in the main storage device with its processor and executes processing in accordance with the read program. The computer may also read the program directly from the portable medium and execute processing in accordance with the program. The computer may also execute processing in accordance with the received program each time a program is transferred from the server to the computer. Processing may also be executed using a so-called ASP-type service that realizes functions simply by issuing execution instructions and obtaining results, without transferring the program from the server to the computer. "ASP" is an abbreviation for application service provider. A program is information used for processing by a computer and includes something equivalent to a program. For example, data that is not a direct instruction to a computer but has properties that define computer processing falls under the category of "something equivalent to a program."
[0051] Some or all of the functions of the relay device 13 may be implemented by a programmable circuit or a dedicated circuit as the control unit 60. That is, some or all of the functions of the relay device 13 may be implemented by hardware.
[0052] The operation of the relay device 13 according to this embodiment will be described with reference to Figures 4 and 5. The operation described below corresponds to the relay method according to this embodiment. That is, the relay method according to this embodiment includes, for example, steps S101 to S110 shown in Figure 4 and steps S111 to S115 shown in Figure 5.
[0053] In S101, the first input / output unit 30 receives a communication frame for short-cycle communication that is transmitted from the master device 11 and circulates among the slave devices 12A and 12B, and is read or written by the slave devices 12A and 12B. The first input / output unit 30 outputs the received communication frame for short-cycle communication to the duplicating unit 50.
[0054] In S102, the control unit 60 determines whether a communication interruption has occurred as a change in the communication state between the relay device 13 and the remote slave device 14. If it is determined that a communication interruption has not occurred, i.e., if a communication interruption has not been detected, step S103 is executed. If it is determined that a communication interruption has occurred, i.e., if a communication interruption has been detected, step S111 is executed.
[0055] In S103, the duplication unit 50 generates a communication frame for long-cycle communication by duplicating the communication frame for short-cycle communication input in S101. The duplication unit 50 writes the input communication frame for short-cycle communication into the memory 65 of the control unit 60, and outputs the generated communication frame for long-cycle communication to the control unit 60.
[0056] In S104, the control unit 60 outputs the communication frame for long-cycle communication input in S103 to the second input / output unit 40. The second input / output unit 40 transmits the input communication frame for long-cycle communication to the remote slave device 14.
[0057] In S105, the control unit 60 determines whether a communication frame for long-cycle communication, which was transmitted from the relay device 13 and read / written by the remote slave device 14, has been received by the second input / output unit 40. If it is determined that the communication frame for long-cycle communication has not yet been received by the second input / output unit 40, i.e., if X cycles have not yet elapsed, step S106 is executed. If it is determined that the communication frame for long-cycle communication has already been received by the second input / output unit 40, i.e., if X cycles have elapsed, step S107 is executed.
[0058] In S106, the control unit 60 outputs the communication frame for short-cycle communication written to the memory 65 in S103 to the first input / output unit 30. The first input / output unit 30 transmits the input communication frame for short-cycle communication to the slave device 12B.
[0059] In S107, the control unit 60 determines whether or not an error is contained in the communication frame of the long-cycle communication received by the second input / output unit 40 as a change in the communication state between the relay device 13 and the remote slave device 14. If it is determined that no error is contained, i.e., if no error is detected, step S108 is executed. If it is determined that an error is contained, i.e., if an error is detected, step S110 is executed.
[0060] In S108, the control unit 60 reads the data written by the remote slave device 14 in the communication frame of the long-cycle communication received by the second input / output unit 40. The control unit 60 temporarily writes the read data in the memory 65.
[0061] In S109, the control unit 60 writes on the fly the data that was temporarily written to the memory 65 in S108 into the communication frame for short cycle communication that was written to the memory 65 in S103. After S109, step S106 is executed.
[0062] In S110, the control unit 60 writes on the fly a code indicating the error detected in S107 into the communication frame of the short-cycle communication written to the memory 65 in S103. After S110, step S106 is executed. As a result, the error can be notified to the master device 11 or the slave device 12B.
[0063] In S111, the control unit 60 writes on the fly the code indicating the communication interruption detected in S102 into the communication frame of the short cycle communication written in the memory 65 in S103.
[0064] In S112, the control unit 60 outputs the communication frame of the short-cycle communication written to the memory 65 in S103 to the first input / output unit 30. The first input / output unit 30 transmits the input communication frame of the short-cycle communication to the slave device 12B. As a result, the master device 11 or the slave device 12B can be notified of the communication interruption.
[0065] In this embodiment, when an abnormality is detected by writing a code indicating an abnormality in a specific slave device among the multiple slave devices 12 in one or more communication frames transmitted from the master device 11, a communication is initiated in which each communication frame transmitted from the master device 11 is returned by a slave device in the multiple slave devices 12 that is located upstream of the specific slave device. The control unit 60 writes the code indicating a communication interruption in the same format as the code indicating an abnormality in the relay device 13. As a result, even if the relay device 13 is communicating normally with the upstream slave device 12B, the slave device 12B can directly detect a communication abnormality, such as a link down in the remote slave device 14, as an abnormality in the relay device 13. Therefore, the slave device 12B can begin communication by returning the communication frame. In other words, a transition to efficient communication in which the relay device 13 and the remote slave device 14 are separated is possible.
[0066] In S113, the control unit 60 determines whether the communication interruption has been resolved as a change in the communication state between the relay device 13 and the remote slave device 14. If it is determined that the communication interruption has not been resolved, i.e., if communication recovery has not been detected, step S113 is executed again. If it is determined that the communication interruption has been resolved, i.e., if communication recovery has been detected, step S114 is executed.
[0067] In S114, the control unit 60 generates a new frame indicating the recovery of communication.
[0068] In S115, the control unit 60 outputs the new frame generated in S114 to the first input / output unit 30. The first input / output unit 30 transmits the input new frame to the slave device 12B. As a result, it is possible to notify the master device 11 or the slave device 12B of communication recovery. After S115, step S101 is executed again.
[0069] As described above, in this embodiment, the proxy slave monitors the communication status between the proxy slave and one or more subordinate slaves. When the proxy slave detects a change in the communication status, it outputs a frame containing a code corresponding to the change in communication status to the master. If the change in communication status is a loss of communication with one of the subordinate slaves, the proxy slave sets the master-side input / output unit to link down. In other words, according to this embodiment, by corresponding a loss of communication with a remote slave to a link down of the master-side port of the proxy slave, it is possible to immediately notify the master or an upstream slave of the communication loss without waiting for periodic communication from the master. Therefore, when a remote slave becomes abnormal, it is possible to immediately transition to communication in which that slave and the proxy slave are separated.
[0070] According to this embodiment, an existing system can be utilized, eliminating the need to build a new master-slave system. As a result, the total system cost is reduced. The cost includes both the initial cost and the running cost.
[0071] According to this embodiment, although it takes X cycles, which corresponds to the transmission delay of communication between the proxy slave and the remote slave, until the first feedback control based on information from the remote slave, feedback control based on information from the remote slave becomes possible in short cycles thereafter. This is because packets are sent from the master to the slave one after another in short cycles.
[0072] The following additional notes are provided regarding the above-described embodiments.
[0073] (Supplementary Item 1) A relay device operating as one slave device among a plurality of slave devices, comprising: a first input / output unit that transmits and receives communication frames that are transmitted from a master device every first period, that circulate through the plurality of slave devices, that are read or written by each slave device of the plurality of slave devices, and that return to the master device; a second input / output unit that transmits and receives communication frames that are transmitted from the relay device every second period, that are read or written by a remote slave device other than the plurality of slave devices, and that return to the relay device; a duplicating unit that generates communication frames that are transmitted from the second input / output unit by duplicating each communication frame received by the first input / output unit; and a control unit that reads data that has been written by the remote slave device in each communication frame received by the second input / output unit, writes the read data into a corresponding communication frame that is transmitted from the first input / output unit, and, upon detecting a change in communication status between the relay device and the remote slave device, notifies the master device or a slave device that is located before the relay device among the plurality of slave devices of the detected change via the first input / output unit. (Supplementary Item 2) The relay device according to Supplementary Item 1, wherein, when the control unit detects a communication interruption as a change in the communication state, the control unit notifies the master device or a slave device located before the relay device of the communication interruption by writing a code indicating the communication interruption in one or more communication frames transmitted from the first input / output unit. (Supplementary Item 3) The relay device according to Supplementary Item 2, wherein, when the abnormality is detected by writing a code indicating an abnormality in a specific slave device of the multiple slave devices in one or more communication frames transmitted from the master device, communication is started in which each communication frame transmitted from the master device is returned by a slave device located before the specific slave device of the multiple slave devices, and the control unit writes the code indicating the communication interruption in the same format as the code indicating the abnormality in the relay device.(Supplementary Item 4) The relay device according to any one of Supplementary Items 1 to 3, wherein, when the control unit detects communication recovery as a change in the communication state, the control unit generates a new frame indicating the communication recovery and transmits the generated new frame from the first input / output unit, thereby notifying the master device or a slave device located at a previous stage of the relay device of the communication recovery. (Supplementary Item 5) The relay device according to any one of Supplementary Items 1 to 4, wherein, when the control unit detects an error in one communication frame received by the second input / output unit as a change in the communication state, the control unit writes a code indicating the error in a corresponding communication frame transmitted from the first input / output unit, thereby notifying the master device or a slave device located at a previous stage of the relay device of the error. (Supplementary Item 6) A program that causes a computer to function as the relay device according to any one of Supplementary Items 1 to 5. (Supplementary Item 7) A relay method for operating a relay device as one slave device among a plurality of slave devices, wherein a first input / output unit of the relay device transmits and receives a communication frame that is transmitted from a master device at each first period, that circulates through the plurality of slave devices, that is read or written by each slave device of the plurality of slave devices, and that returns to the master device; a second input / output unit of the relay device transmits and receives a communication frame that is transmitted from the relay device at each second period, that is read or written by a remote slave device other than the plurality of slave devices, and that returns to the relay device; a duplicating unit of the relay device generates each communication frame that is transmitted from the second input / output unit by duplicating each communication frame received by the first input / output unit; a control unit of the relay device reads data that has been written by the remote slave device in each communication frame received by the second input / output unit; and the control unit writes the read data into a corresponding communication frame that is transmitted from the first input / output unit. and when the control unit detects a change in the communication state between the relay device and the remote slave device, notifying the detected change via the first input / output unit to the master device or one of the plurality of slave devices that is a slave device in a stage preceding the relay device.(Supplementary Item 8) A system comprising: a master device; a plurality of slave devices including a relay device as one slave device; and a remote slave device other than the plurality of slave devices, wherein the relay device comprises: a first input / output unit that transmits and receives communication frames that are transmitted from the master device every first period, circulate through the plurality of slave devices, are read or written by each slave device of the plurality of slave devices, and return to the master device; a second input / output unit that transmits and receives communication frames that are transmitted from the relay device every second period, are read or written by the remote slave device, and return to the relay device; a duplication unit that generates communication frames that are transmitted from the second input / output unit by duplicating each communication frame received by the first input / output unit; and a control unit that reads data written by the remote slave device in each communication frame received by the second input / output unit, writes the read data into a corresponding communication frame transmitted from the first input / output unit, and, upon detecting a change in communication state between the relay device and the remote slave device, notifies the master device or a slave device preceding the relay device among the plurality of slave devices of the detected change via the first input / output unit. A data communication system comprising:
[0074] The present disclosure is not limited to the above-described embodiments. For example, two or more blocks shown in the block diagram may be integrated, or one block may be divided. Two or more steps shown in the flowchart may be executed in parallel or in a different order, instead of being executed in chronological order as described, depending on the processing capabilities of the device executing each step, or as needed. Other modifications are possible within the scope of the present disclosure.
[0075] 10, 90 Data communication system 11 Master device 12 Multiple slave devices 12A, 12B, 12C Slave device 13 Relay device 14 Remote slave device 15, 17 Adapter 16 Carrier network 21 Master installation location 22 Remote location 30 First input / output unit 31, 32, 41 Interface 40 Second input / output unit 50 Duplicating unit 60 Control unit 61 Slave control unit 62 Proxy control unit 63 Slave management unit 64 Memory management unit 65 Memory 66 Management database
Claims
1. A relay device that operates as one of a plurality of slave devices, comprising: A first input / output unit that transmits and receives a communication frame that is transmitted from a master device every first cycle, is read and written by each of the plurality of slave devices while circulating through the plurality of slave devices, and returns to the master device; A second input / output unit that transmits and receives a communication frame that is transmitted from the relay device every second cycle, is read and written by a remote slave device different from the plurality of slave devices, and returns to the relay device; A replication unit that generates each communication frame transmitted from the second input / output unit by replicating each communication frame received by the first input / output unit; A control unit that reads data written by the remote slave device in each communication frame received by the second input / output unit, writes the read data into a corresponding communication frame transmitted from the first input / output unit, and when detecting a change in the communication state between the relay device and the remote slave device, notifies the detected change to the master device via the first input / output unit or a slave device in front of the relay device among the plurality of slave devices.
2. The relay device according to claim 1, wherein when the control unit detects a communication interruption as a change in the communication state, the control unit writes a code indicating the communication interruption into one or more communication frames transmitted from the first input / output unit to notify the communication interruption to the master device or a slave device in front of the relay device.
3. When an abnormality of a specific slave device among the plurality of slave devices is detected by writing a code indicating the abnormality of the specific slave device into one or more communication frames transmitted from the master device, communication is started to fold back each communication frame transmitted from the master device at a slave device in front of the specific slave device among the plurality of slave devices. The control unit writes the code indicating the communication interruption in the same format as the code indicating the abnormality of the relay device. The relay device according to claim 2.
4. When the control unit detects communication recovery as a change in the communication state, it generates a new frame indicating the communication recovery and transmits the generated new frame from the first input / output unit, thereby notifying the master device or the slave device in the previous stage of the relay device of the communication recovery. The relay device according to claim 1.
5. When the control unit detects an error in one communication frame received by the second input / output unit as a change in the communication state, it writes a code indicating the error into the corresponding communication frame transmitted from the first input / output unit, thereby notifying the master device or the slave device in the previous stage of the relay device of the error. The relay device according to claim 1.
6. A program for causing a computer to function as the relay device according to any one of claims 1 to 5.
7. A relay method for operating a relay device as one of a plurality of slave devices, wherein the first input / output unit of the relay device transmits a communication frame that is transmitted from a master device every first period, reads and writes are performed by each of the plurality of slave devices while circulating through the plurality of slave devices, and then returns to the master device; the second input / output unit of the relay device transmits a communication frame that is transmitted from the relay device every second period, reads and writes are performed by a remote slave device different from the plurality of slave devices, and then returns to the relay device; the replication unit of the relay device generates each communication frame transmitted from the second input / output unit by replicating each communication frame received by the first input / output unit; the control unit of the relay device reads data written by the remote slave device in each communication frame received by the second input / output unit; the control unit writes the read data into the corresponding communication frame transmitted from the first input / output unit; and when the control unit detects a change in the communication state between the relay device and the remote slave device, it notifies the detected change to the master device or the slave device in the previous stage of the relay device among the plurality of slave devices via the first input / output unit. The relay method includes the above steps.
8. A data communication system comprising a master device, a plurality of slave devices including a relay device as one slave device, and a remote slave device different from the plurality of slave devices, wherein the relay device: - A first input / output unit that transmits and receives a communication frame that is transmitted from the master device every first cycle, is read and written by each slave device of the plurality of slave devices while circulating through the plurality of slave devices, and returns to the master device; - A second input / output unit that transmits and receives a communication frame that is transmitted from the relay device every second cycle, is read and written by the remote slave device, and returns to the relay device; - A replication unit that generates each communication frame transmitted from the second input / output unit by replicating each communication frame received by the first input / output unit; - A control unit that reads data written by the remote slave device in each communication frame received by the second input / output unit, writes the read data to a corresponding communication frame transmitted from the first input / output unit, and when detecting a change in the communication state between the relay device and the remote slave device, notifies the detected change to the master device via the first input / output unit or a slave device in front of the relay device among the plurality of slave devices.
Citation Information
Patent Citations
Control system, and proxy slave, proxy master, and control method used for the same
JP2013197656A
Control system, communication control method for control system, and relay device
WO2019082579A1