Communication system, communication apparatus, communication method, and program

A communication system includes master and slave devices connectable to each other and forming a ring communication path. The master device outputs management data to manage communication along the ring communication path in a CW and CCW directions and receives the management data in the CW direction and in the CCW direction, and outputs, in the CW direction and in the CCW direction, control data to be used by the slave device to control equipment. The slave device acquires a history of transmission of the management data output from the master device and received by the slave device in the CW direction and in the CCW direction, and processes, based on the acquired history, one of the control data output from the master device in the CW direction and the control data output from the master device in the CCW direction to control the equipment.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is based on PCT filing PCT/JP2018/040508, filed Oct. 31, 2018, the entire contents of which are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to a communication system, a communication device, a communication method, and a program.

BACKGROUND ART

Factory automation (FA) systems using industrial networks are requested to operate with maintaining the FA systems against communication faults that are typically caused by cable breaks. This request may be satisfied by communication systems typically using ring networks to form ring communication paths with redundancy (see Patent Literature 1).

Patent Literature 1 describes a technique of routing on a ring network. The ring network includes two paths, a clockwise path and a counterclockwise path. With this technique, the nodes included in the ring network acquire information indicating the topology of the ring network, and select one of the two paths as a main path and the other as a backup path. The nodes output data onto the main path at normal times, and onto the backup path in response to detecting faults, thus maintaining communication against faults.

CITATION LIST

Patent Literature

Patent Literature 1: Unexamined Japanese Patent Application Publication No. 2009-284486

SUMMARY OF INVENTION

Technical Problem

With the technique described in Patent Literature 1, when a first node included in the ring network detects a malfunction in a link between the first node and a second node adjacent to the first node, the first node transmits a message through a link opposite to the second node to notify the malfunction to the other nodes. The other nodes receiving the massage to notify the malfunction then switch the communication direction from the main path to the backup path to maintain communication.

Transmitting the message causes a delay between the first node detecting the malfunction and the other nodes starting using the backup path for communication by switching the communication direction. Data transmitted through such a malfunctioning link may be lost before the communication path is switched. A communication fault in such a portion of the path may cause a fault in the entire communication system. Communication systems using ring communication paths are to have higher tolerance to such faults.

In response to the above issue, an objective of the present disclosure is to improve fault tolerance of a communication system using a ring communication path.

Solution to Problem

To achieve the above objective, a communication system according to an aspect of the present disclosure includes a master device and a slave device connectable to each other and forming a ring communication path. The master device outputs management data to manage communication along the ring communication path in a first direction and in a second direction opposite to the first direction and receives the management data in the first direction and in the second direction, and outputs, in the first direction and in the second direction, control data to be used by the slave device to control equipment. The slave device acquires a history of transmission of the management data output from the master device and received by the slave device in the first direction and in the second direction, and processes, based on the acquired history, one of the control data output from the master device in the first direction and the control data output from the master device in the second direction to control the equipment.

Advantageous Effects of Invention

The master device according to the above aspect of the present disclosure outputs control data in the first direction and in the second direction. The slave device according to the above aspect of the present disclosure processes one of the control data output from the master device in the first direction and the control data output from the master device in the second direction to control equipment. Thus, the master device transmits redundant control data in the first and second directions of the redundant communication path, and the slave device processes the control data transmitted in either the first or second direction. In response to any communication fault in one path, the slave device can receive control data without using the path with the fault. The communication system using the ring communication path thus has higher tolerance to faults.

DESCRIPTION OF EMBODIMENTS

A communication system100according to one or more embodiments of the present disclosure will now be described in detail with reference to the drawings.

The communication system100according to the present embodiment corresponds to a part of an FA system installed at a factory. The communication system100is a ring network formed by connecting pieces of equipment to one another with a communication channel. The pieces of equipment are components of the FA system for production, inspection, machining, or other purposes. As shown inFIG. 1, the communication system100includes a master device10and slave devices21,22,23,24, and25as communication devices.

The master device10and the slave devices21to25are, for example, programmable logic controllers (PLCs), devices to operate in cooperation with PLCs, or industrial personal computers (IPCs). The master device10and the slave devices21to25are connected to one another to form a ring communication path40. More specifically, the master device10and the slave devices21to25each have two ports. The master device10and the slave devices21to25have the ports mutually connected with a communication line for communication. The communication line is a network cable.

More specifically, as shown inFIG. 1, the master device10has a port10afor connecting to the slave device21with a communication line, and a port10bfor connecting to the slave device25with a communication line. The slave device21has a port21afor connecting to the slave device22with a communication line, and a port21bfor connecting to the master device10with the communication line. The slave device22has a port22afor connecting to the slave device23with a communication line, and a port22bfor connecting to the slave device21with the communication line. The slave device23has a port23afor connecting to the slave device24with a communication line, and a port23bfor connecting to the slave device22with the communication line. The slave device24has a port24afor connecting to the slave device25with a communication line, and a port24bfor connecting to the slave device23with the communication line. The slave device25has a port25afor connecting to the master device10with the communication line, and a port25bfor connecting to the slave device24with the communication line. The master device10and the slave devices21to25are thus connected in a ring topology to form a ring network.

The communication system100as a ring network includes a redundant communication path40defining two paths. More specifically, the communication system100includes a path in a clockwise (CW) direction31from the master device10through the slave devices21,22,23,24, and25in this order and back to the master device10, and a path in a counterclockwise (CCW) direction32from the master device10through the slave devices25,24,23,22, and21in this order and back to the master device10. The CW direction31and the CCW direction32are the directions of the communication path40opposite to each other.

The master device10corresponds to a master node in the ring network, and the slave devices21to25all correspond to slave nodes in the ring network. The master device10provides a control instruction to each of the slave devices21to25through the redundant communication path in the CW direction31and the CCW direction32. In response to the control instruction, the slave devices21to25each control equipment70connected to the corresponding one of the slave devices21to25. Examples of the equipment70include sensor devices, actuators, and robots.

The hardware configuration of the master device10and the slave devices21to25will now be described. The slave devices21to25are hereafter collectively referred to as a slave device20or slave devices20as appropriate. Each of the master device10and the slave device20is a computer including a processor51, a main memory52, an auxiliary memory53, an input device54, an output device55, and a communicator56as shown inFIG. 2. The main memory52, the auxiliary memory53, the input device54, the output device55, and the communicator56are all connected to the processor51with an internal bus57.

The processor51includes a central processing unit (CPU) or a micro processing unit (MPU). The processor51executes a program58stored in the auxiliary memory53to implement the various functions of the master device10and the slave device20and perform the processing described later.

The main memory52includes a random-access memory (RAM). The main memory52stores the program58loaded from the auxiliary memory53. The main memory52is used as a work area by the processor51.

The auxiliary memory53includes a nonvolatile memory, typically an electrically erasable programmable read-only memory (EEPROM). The auxiliary memory53stores, in addition to the program58, various data items used in the processing performed by the processor51. The auxiliary memory53provides data usable by the processor51to the processor51, and stores data provided by the processor51, as instructed by the processor51.

The input device54includes input devices, typically a switch, input keys, a pointing device, and a camera. The input device54acquires information input by the user, and provides the acquired information to the processor51.

The output device55includes output devices, typically a light-emitting diode (LED), a liquid crystal display (LCD), and a speaker. The output device55presents various pieces of information to the user as instructed by the processor51.

The communicator56includes a communication interface circuit for communicating with external devices. The communicator56receives signals from external devices and outputs data represented by the signals to the processor51. The communicator56also transmits signals representing data output from the processor51to external devices.

The functional components of the master device10and the slave device20will now be described. The master device10and the slave device20perform various functions with the above hardware components operating in cooperation.

The master device10as a master node outputs two types of data onto the redundant communication path40. More specifically, the master device10outputs, as first data of the two types of data, management data to manage communication in the ring network. The master device10outputs the management data in each of the CW direction31and the CCW direction32, and then receives the management data that has circulated through the ring network in each of the two directions. The master device10also outputs, as second data, control data to be used by the slave device20to control the equipment70. The master device10outputs the control data in each of the CW direction31and the CCW direction32. The control data is not limited to data representing the details of a control instruction provided from the master device10, but may be data received by the master device10. The control data received by the master device10corresponds to, for example, data provided from a slave node in response to a control instruction.

As shown inFIG. 3, the master device10includes, as the functional components, the ports10aand10b, a receiver11for receiving data, an identifier12for identifying control data and management data, a management data processor13for processing management data, a control data processor14for processing control data, and a transmitter15for transmitting data.

The ports10aand10bcorrespond to the communicator56. The ports10aand10beach have a slot for receiving the communication line and a terminal. The ports10aand10bmay be implemented as separate hardware components, or as a communication interface in a software component. The port10areceives data input in the CCW direction32, and outputs data in the CW direction31. The port10breceives data input in the CW direction31, and outputs data in the CCW direction32.

The receiver11is implemented by the processor51and the communicator56operating in cooperation. The receiver11receives data transmitted through the communication lines and through the ports10aand10b. The receiver11outputs received data to the identifier12, together with the port number representing the port10aor10bthat has received the data. The identifier12is implemented mainly by the processor51. The identifier12identifies data output from the receiver11to be management data or control data. The identifier12then outputs the management data to the management data processor13or the control data to the control data processor14, together with the port number of the port10aor10bthat has received the data.

The management data processor13is implemented mainly by the processor51. The management data processor13discards received management data. More specifically, the management data processor13discards received management data having a source being the address of the master device10to avoid the received management data continuing to circulate through the ring network. The management data processor13periodically generates new management data and outputs the new management data to the transmitter15.

The control data processor14is implemented mainly by the processor51. The control data processor14processes received control data. More specifically, the control data processor14discards received control data having a source being the address of the master device10to avoid the received control data continuing to circulate through the ring network. The control data processor14also processes control data output from the slave device20as appropriate. For example, the master device10that has instructed the slave device20to prepare for operation may receive control data representing completion of the preparation from the slave device20. In this case, the control data processor14generates control data for instructing to start operation. In some embodiments, to provide a new control instruction to the slave device20, the control data processor14generates control data representing the new control instruction to the slave device20. The control data processor14then outputs the generated control data to the transmitter15.

The transmitter15is implemented by the processor51and the communicator56operating in cooperation. The transmitter15duplicates management data output from the management data processor13and outputs the duplicated data in the CW direction31and the CCW direction32. The management data output in the two directions circulates and is received by the receiver11in the ring network with no fault, but is not received by the receiver11in the ring network with any fault. The transmitter15also duplicates control data output from the control data processor14and outputs the duplicated data in the CW direction31and the CCW direction32. The control data output in the two directions arrives at the destination slave device20through the two paths in the CW direction31and the CCW direction32.

As shown inFIG. 4, the slave device20includes, as the functional components, ports20aand20b, a receiver210for receiving data, an identifier220for identifying control data and management data, a management data processor230for processing management data, a control data processor240for processing control data, a memory250for storing determination information251for determining control data to be assigned a higher priority selectively from control data transmitted in the CW direction31and control data transmitted in the CCW direction32, and a transmitter260for transmitting data.

The ports20aand20bcorrespond to the communicator56. The port20ais a collective term for the ports21a,22a,23a,24a, and25ashown inFIG. 1, and the port20bis a collective term for the ports21b,22b,23b,24b, and25b. The ports20aand20beach have a slot for receiving the communication line and a terminal. The ports20aand20bmay be implemented as separate hardware components, or as a communication interface in a software component. The port20areceives data input in the CCW direction32, and outputs data in the CW direction31. The port20breceives data input in the CW direction31, and outputs data in the CCW direction32.

The receiver210is implemented by the processor51and the communicator56operating in cooperation. The receiver210receives data transmitted through the communication lines and through the ports20aand20b. The receiver210outputs received data to the identifier220, together with the port number representing the port20aor20bthat has received the data. The identifier220is implemented mainly by the processor51. The identifier220identifies data output from the receiver210to be management data or control data. The identifier220then outputs the management data to the management data processor230or the control data to the control data processor240, together with the port number of the port20aor20bthat has received the data.

The management data processor230is implemented mainly by the processor51. The management data processor230receives management data in the CW direction31and transfers the management data in the CW direction31. The management data processor230also receives management data in the CCW direction32and transfers the management data in the CCW direction32.

The management data processor230updates the determination information251in the memory250based on received management data. More specifically, the management data processor230writes information, as the determination information251, onto the memory250based on the reception status of management data. The information is for determining which of control data received through the path in the CW direction31or control data received through the path in the CCW direction32is valid for reception. The management data processor230outputs the management data to the transmitter260and causes the transmitter260to transfer the management data.

The management data processor230also monitors the reception status of management data to be received periodically and detects a communication fault in the ring network. For example, in response to an interruption of management data to be received in the CW direction31, the management data processor230detects a fault in the communication channel extending from the master device10in the CW direction31. Upon detecting the interruption, the management data processor230writes the determination information251onto the memory250for indicating that control data received in the CCW direction32is to be assigned priority. In response to an interruption of management data to be received in the CCW direction32, the management data processor230detects a fault in the communication channel extending from the master device10in the CCW direction32. Upon detecting the interruption, the management data processor230writes the determination information251onto the memory250for indicating that control data received in the CW direction31is to be assigned priority.

The control data processor240is implemented mainly by the processor51. Upon receiving control data having the destination to be the slave device20including the control data processor240, the control data processor240determines, based on the determination information251, control data received in one of the CW direction31and the CCW direction32to be valid, and determines control data received in the other direction to be invalid. The control data processor240processes the control data determined to be valid and starts controlling the equipment70in accordance with the control instruction. The control data processor240also discards the control data determined to be invalid.

Upon receiving control data having the destination to be a slave device20different from the slave device20including the control data processor240, the control data processor240outputs, to the transmitter260, the control data with no change, and causes the transmitter260to transfer the control data. For example, the control data processor240in the slave device22receives control data having the destination to be the slave device23in the CW direction31, and causes this control data to be transferred in the CW direction31. In another example, the control data processor240in the slave device22receives control data having the destination to be the slave device21in the CCW direction32, and causes this control data to be transferred in the CCW direction32.

The memory250is implemented mainly by the auxiliary memory53. The determination information251stored in the memory250will be described in detail later.

The transmitter260is implemented by the processor51and the communicator56operating in cooperation. The transmitter260transfers management data output from the management data processor230, and transfers control data output from the control data processor240.

The master processing performed by the master device10will now be described with reference toFIGS. 5 to 7. The master processing shown inFIG. 5starts when the master device10is powered on.

In the master processing, the management data processor13generates management data (step S11). As shown inFIG. 6, management data includes a network header61defining a source611and a destination612of the management data, a type information storage area62storing type information621indicating that the data is management data, and a data storage area63corresponding to a payload and storing history information631. Management data includes the source611and the destination612both indicating the address of the master device10. Management data includes the destination612indicating the address that can be received by all the slave devices20, and the management data is broadcasted. Management data may include the destination612indicating an address that can be received by the master device10, or indicating the address of the master device10, in addition to the destination612indicating the address that can be received by all the slave devices20. Management data may include the source611and the destination612of any address that allows management data to circulate through the communication path40and then to be discarded.

The type information621in the management data is, for example, M-1234, with M indicating that the data is management data and the identifier1234identifying the management data. The history information631indicates the history of transmission of management data on the ring network. In other words, the history information631indicates the history of transmission of management data output from the master device10and received by the slave device20in each of the CW direction31and the CCW direction32. More specifically, the history information631indicates the count of relays, or more specifically, the count of slave devices20that have relayed the management data output from the master device10. The management data processor13generates management data with the count of relays being zero.

Referring back toFIG. 5, the transmitter15outputs the management data generated in step S11in each of the CW direction31and the CCW direction32(step S12). More specifically, the transmitter15outputs the management data through the port10ato the slave device21, and also outputs management data identical to this management data through the port10bto the slave device25. The transmitter15may output management data in the two directions at the same time, but may also be at different times. With no fault in the communication path40, the management data output in this manner circulates and is received by the receiver11.

The control data processor14then generates control data (step S13). As shown inFIG. 7, control data includes the network header61, the type information storage area62, and the data storage area63. Control data includes the source611and the destination612different from each other. For example, control data representing a control command from the master device10has the destination612indicating the address of a slave device20and the source611indicating the address of the master device10. The type information621in the control data is, for example, C-5678, with C indicating that the data is control data and the identifier5678identifying the control data. The data storage area63in control data stores control information632indicating the details of the control.

Referring back toFIG. 5, the transmitter15outputs the control data generated in step S13in each of the CW direction31and the CCW direction32(step S14). More specifically, the transmitter15outputs the control data through the port10ato the slave device21, and also outputs control data identical to this control data through the port10bto the slave device25. The transmitter15may output control data in the two directions at the same time or at different times.

The master device10then repeats the processing in step S11and subsequent steps, thus outputting management data and control data periodically. The master device10outputs these data items in predetermined cycles of, for example, 10 microseconds, 100 microseconds, 1 millisecond, or 10 milliseconds.

The slave processing performed by a slave device20will now be described with reference toFIGS. 8 to 17. The slave processing shown inFIG. 8starts when the slave device20is powered on.

In the slave processing, the determination is performed as to whether the receiver210has received data (step S21). More specifically, the determination is performed as to whether the receiver210has received data through either the port20aor20b.

When the data has not been received (No in step S21), the slave device20advances the processing to step S27. When the data has been received (Yes in step S21), the slave device20determines whether the received data in step S21is management data (step S22). More specifically, with the identifier220reading the type information621in the data, the slave device20determines whether the data is management data or control data.

When the data is determined to be management data (Yes in step S22), the management data processor230performs a data transfer (step S23).FIG. 9shows the details of the data transfer. In the data transfer, as shown inFIG. 9, the management data processor230acquires the history of transmission of management data to be transferred, and updates the determination information251stored in the memory250(step S231). More specifically, the management data processor230reads the history information631included in the management data, and updates the determination information251based on the read history information631.

As shown inFIG. 10, the determination information251is in a table that mutually associates the port number of the port that has received the management data, the direction of the communication path on which the management data has been received, and the history information631included in the management data. InFIG. 10, the port numbers are identical to the reference signs of the ports20aand20b, the communication paths are identical to the reference signs of the CW direction31and the CCW direction32, and the history information631indicates the count of relays. The determination information251includes the count of relays with an initial value of −1.

The management data processor230retrieves the history information631from the data storage area63in the received management frame, acquires the count of relays indicated by the history information631, and updates the determination information251by associating the port number of the port that has received the management data with the acquired count of relays.

For example, the slave device22receives management data in the CW direction31through the port22a. In this case, the management data has been relayed once by the slave device21and thus has the count of relays being 1. As shown inFIG. 11, the management data processor230updates the count of relays associated with the port number22aand the communication path31to 1. The port number22binFIG. 11is associated with the count of relays being the initial value of −1.

The slave device22may further receive management data in the CCW direction32through the port22b. In this case, the management data has been relayed three times by the slave devices25,24, and23in this order and thus has the count of relays being 3. As shown inFIG. 12, the management data processor230updates the count of relays associated with the port number22band the communication path32to 3.

Referring back toFIG. 9, after step S231, the management data processor230determines whether the management data has been received in the CW direction31based on the port number of the port that has received the management data (step S232). When determining that the management data has been received in the CW direction31(Yes in step S232), the management data processor230increments, by 1, the count of relays indicated by the history information631, and transfers the management data in the CW direction31(step S233). For example, the slave device22receives management data with the count of relays being 1 from the slave device21, increments the count of relays to 2, and transfers this management data to the slave device23. The slave device22thus transmits the management data with the count of relays being 2 to the slave device23. The processing performed by the slave devices20then returns from the data transfer to the slave processing shown inFIG. 8.

When determining that the management data has not been received in the CW direction31(No in step S232), the management data processor230determines that the management data has been received in the CCW direction32. The management data processor230then increments, by 1, the count of relays indicated by the history information631, and transfers the management data in the CCW direction32(step S234). For example, the slave device22receives management data with the count of relays being 3 from the slave device23, increments the count of relays to 4, and transfers this management data to the slave device21. The slave device22thus transmits the management data with the count of relays being 4 to the slave device21. The processing performed by the slave devices20then returns from the data transfer to the slave processing shown inFIG. 8.

When determining, in step S22inFIG. 8, that the received data is not management data (No in step S22), the control data processor240determines that the data is control data. The control data processor240then determines whether the control data has been received in the CW direction31based on the port number of the port that has received the control data (step S24).

When determining that the control data has been received in the CW direction31(Yes in step S24), the control data processor240performs a reception in the CW direction31(step S25).FIG. 13shows the details of the reception in the CW direction31.

As shown inFIG. 13, in the reception in the CW direction31, the control data processor240determines whether the received control data has the destination to be the slave device20including the control data processor240(step S251). More specifically, the control data processor240reads the destination612of the control data and determines whether the destination612is identical to the address of the slave device20including the control data processor240.

When determining that the control data does not have the destination to be the slave device20including the control data processor240(No in step S251), the control data processor240transfers, in the CW direction31, the received control data with no change (step S252). The processing performed by the slave device20then returns from the reception in the CW direction31to the slave processing shown inFIG. 8.

When determining that the control data has the destination to be the slave device20including the control data processor240(Yes in step S251), the control data processor240determines whether data in the CCW direction32is interrupted (step S253). More specifically, the control data processor240reads the determination information251and determines whether the count of relays associated with the path in the CCW direction32is −1. The count of relays is set to −1 in response to an interruption of management data to be received in the CCW direction32, as described later. Thus, the control data processor240referring to the determination information251can determine whether a communication fault has occurred.

When determining that data in the CCW direction32is interrupted (Yes in step S253), the control data processor240determines that the received control data is valid and processes this control data (step S254). More specifically, the control data processor240starts control using the control information632included in the control data to control the equipment70. Thus, in response to an interruption of data in the CCW direction32, the control data processor240processes control data in the CW direction31.

When determining that data in the CCW direction32is not interrupted (No in step S253), the control data processor240determines whether the count of relays is smaller in the CW direction31(step S255). More specifically, the control data processor240reads the determination information251and determines whether the count of relays associated with the CW direction31is smaller than the count of relays associated with the CCW direction32. Thus, the control data processor240determines whether the hop count from the master device10or the master node is lower in the CW direction31than in the CCW direction32. For example, in the example shown inFIG. 12, the control data processor240determines that the count of relays is smaller in the CW direction31. When the CW direction31and the CCW direction32have the same count of relays, the control data processor240may assign priority to a predetermined one of the CW direction31and the CCW direction32.

When determining that the count of relays is smaller in the CW direction31(Yes in step S255), the control data processor240advances the processing to step S254. Thus, the control data processor240assigns priority to the path with the lower hop count to process the control data.

When determining that the count of relays is not smaller in the CW direction31(No in step S255), the control data processor240determines that the control data is invalid and discards this control data (step S256). Thus, with no interruption of data in the CCW direction32, the control data processor240discards, without processing, data in the CW direction31that has the higher hop count. The processing performed by the slave device20then returns from the reception in the CW direction31to the slave processing shown inFIG. 8.

When determining that the control data has not been received in the CW direction31in step S24inFIG. 8(No in step S24), the control data processor240performs a reception in the CCW direction32(step S26). The reception in the CCW direction32corresponds to the above reception in the CW direction31but with the CW direction31replaced with the CCW direction32.FIG. 14shows the details of the reception in the CCW direction32.

As shown inFIG. 14, in the reception in the CCW direction32, the control data processor240determines whether the control data has the destination to be the slave device20including the control data processor240(step S261). When determining that the control data does not have the destination to be the slave device20including the control data processor240(No in step S261), the control data processor240transfers, in the CCW direction32, the control data with no change (step S262). The processing performed by the slave device20then returns from the reception in the CCW direction32to the slave processing shown inFIG. 8.

When determining that the control data has the destination to be the slave device20including the control data processor240(Yes in step S261), the control data processor240determines whether data in the CW direction31is interrupted (step S263). When determining that data in the CW direction31is interrupted (Yes in step S263), the control data processor240determines that the control data is valid and processes this control data (step S264). The processing performed by the slave device20then returns from the reception in the CCW direction32to the slave processing shown inFIG. 8.

When determining that data in the CW direction31is not interrupted (No in step S263), the control data processor240determines whether the count of relays is smaller in the CCW direction32(step S265). When determining that the count of relays is smaller in the CCW direction32(Yes in step S265), the control data processor240advances the processing to step S264.

When determining that the count of relays is not smaller in the CCW direction32(No in step S265), the control data processor240determines that the control data is invalid and discards this control data (step S266). The processing performed by the slave device20then returns from the reception in the CCW direction32to the slave processing shown inFIG. 8.

Referring back toFIG. 8, after steps S23, S25, and S26, the management data processor230performs an interruption detection (step S27). In the interruption detection, the slave device20determines the communication status of each of the two directions based on whether management data has been received, and detects a communication fault in the ring network.FIG. 15shows the details of the interruption detection.

As shown inFIG. 15, in the interruption detection, the management data processor230determines whether management data to be received periodically in at least one of the CW direction31and the CCW direction32is interrupted for a predetermined period of time (step S271). More specifically, the management data processor230determines whether a predetermined period of time has elapsed with no reception of new management data after the last reception of management data in the CW direction31, and determines whether a predetermined period of time has elapsed with no reception of new management data after the last reception of management data in the CCW direction32. The predetermined period of time corresponds to, for example, 1.5, 2, or 5 times the transmission cycle of management data. The predetermined period of time is a time length in detecting the fault after a communication fault and thus may be minimized.

FIG. 16shows an example of a broken link resulting from a communication fault between the slave device21and the slave device22. In this case, the slave device21determines that management data to be received periodically in the CCW direction32has been interrupted, and thus detects a communication fault in the communication channel from the master device10to the slave device21in the CCW direction32. The slave devices22to25determine that management data to be received periodically in the CW direction31has been interrupted, and thus detect a communication fault in the communication channel from the master device10to the slave devices22to25in the CW direction31. In response to the interruption of management data to be received periodically in the CW direction31and the CCW direction32, the master device10detects a communication fault in the ring network. Neither the master device10nor the slave devices20identifies the location of a communication fault in the ring network.

Referring back toFIG. 15, when management data is determined not to be interrupted in step S271(No in step S271), the processing performed by the slave devices20then returns from the interruption detection to the slave processing shown inFIG. 8. When determining that management data is interrupted (Yes in step S271), the management data processor230writes information indicating an interruption to update the determination information251(step S272). More specifically, the management data processor230sets, to an initial value of −1, the count of relays associated with the communication path having an interruption of management data. For example, in the example communication fault as shown inFIG. 16, the slave device22updates the determination information251as shown inFIG. 17. The processing performed by the slave devices20then returns from the interruption detection to the slave processing shown inFIG. 8.

At least one of the master device10and the slave devices20may identify the location of a fault by comparing the determination information251among the slave devices20. More specifically, in the example inFIG. 16, comparing the determination information251between the slave devices21and22determines that the slave devices21and22have different paths associated with the value −1 indicating an interruption. This indicates that a fault has occurred in the communication channel between the slave devices21and22. For example, in response to a communication fault, the master device10may request each slave device20to provide the determination information251and compare the determination information251among the slave devices20.

Referring back toFIG. 8, after step S27, the slave device20repeats the processing in step S21and subsequent steps. Thus, the slave device20repeats the transfer of management data, the update of the determination information251, and the reception of control data. For example, when the ring network recovers from a communication fault shown inFIG. 16, the slave device20receives management data in the two directions again and updates the determination information251. The slave device20then causes the control data processor240to perform a reception based on this determination information251.

As described above, the master device10outputs management data in each of the CW direction31and the CCW direction32. The slave device20acquires a history of transmission of the management data output from the master device10and received by the slave device20in each of the CW direction31and the CCW direction32. The master device10outputs control data in the CW direction31and the CCW direction32. The slave device20processes, based on the acquired transmission history of management data, one of the control data output from the master device10in the CW direction31and the control data output from the master device10in the CCW direction32to control equipment. Thus, the master device10transmits redundant control data in the two directions of the redundant communication path, and the slave device20processes the control data transmitted in either the CW direction31or the CCW direction32. In response to any communication fault in one path, the slave device can receive control data without using the path with the fault. The communication system using the ring communication path thus has higher tolerance to faults.

The master device10repeatedly outputs management data in each of the CW direction31and the CCW direction32, and outputs control data having the destination to be a slave device20in the two directions. The slave device20determines the status of communication in each of these two directions based on whether management data has been received in the CW direction31and the CCW direction32. In response to an interruption of management data to be received in either the CW direction31or the CCW direction32, the slave device20receives and processes the control data output in the other direction. Thus, at the interruption of management data resulting from a communication fault, the slave device20can receive control data output in the other direction without long delay or without waiting for a notification of such a communication fault. This improves real-time data provision during maintaining communication against any communication faults.

The management data includes the history information631. The control data processor240compares the history information631included in management data received in the CW direction31with the history information631included in management data received in the CCW direction32. Based on the comparison result, the control data processor240receives and processes control data output in one of the CW direction31and the CCW direction32. Thus, control data can be processed appropriately depending on the status of each of the two paths from the master device10to the slave device20.

The history information631indicates the count of relays corresponding to a hop count. The slave device20, upon receiving management data in each of the CW direction31and the CCW direction32, acquires the count of relays indicated by the management data, and receives and processes control data received through the path with the smaller count of relays. In other words, the slave device20processes, selectively from control data output from the master device10in the CW direction31and control data output from the master device10in the CCW direction32, the control data received in the direction in which the management data with the smaller count of relays is received. Thus, the slave device20processes control data transmitted through the path with the lower hop count. The control data is usually transmitted in a shorter time with a lower hop count. The slave device20can process the control data arriving at the slave device20earlier, selectively from control data transmitted through a path and control data transmitted through another path of the redundant path.

Embodiment 2 will now be described focusing on the differences from Embodiment 1 described above. The same or corresponding components as in Embodiment 1 are given the same reference signs, and will not be described or will be described briefly. In Embodiment 1, the count of relays indicated by the history information631is used to determine the communication path to be assigned a higher priority selectively from the two communication paths. However, this determination may be based on the time taken for data transmission. An embodiment of selecting a path to be assigned priority based on the time taken for transmission will now be described.

FIG. 18is a diagram of management data in the present embodiment. As shown inFIG. 18, management data includes the data storage area63storing the history information631indicating the output time of this management data. The master device10generates the history information631and outputs management data including the generated history information631. The history information631indicates the output time at which the master device10outputs this management data.

FIG. 19is a flowchart showing a data transfer performed by the management data processor230in the slave device20. In the data transfer, the management data processor230performs the processing corresponding to steps S231and S232shown inFIG. 9. However, in updating the determination information251in step S231, the management data processor230acquires the traveling period that has elapsed from when the master device10outputs management data to when the slave device20receives the management data. More specifically, the management data processor230acquires the output time included in management data, and calculates the time elapsed between the output time and the reception time of the management data. As shown inFIG. 20, the management data processor230writes the traveling period in a manner associated with the port number of the port and the communication path through which the management frame has been received. The management data processor230thus updates the determination information251. The traveling period has an initial value of −1.

Referring back toFIG. 19, when the determination result in step S232is affirmative (Yes in step S232), the management data processor230transfers, in the CW direction31, the management data with no change (step S235). When the determination result in step S232is negative (No in step S232), the management data processor230transfers, in the CCW direction32, the management data with no change (step S236). The processing performed by the slave device20then returns from the data transfer to the slave processing shown inFIG. 8.

FIG. 21shows the details of the reception in the CW direction31. In the reception in the CW direction31, when the determination result in step S253is negative (No in step S253), the control data processor240determines whether the traveling period is shorter in the CW direction31(step S257). More specifically, the control data processor240reads the determination information251and determines whether the traveling period associated with the CW direction31is shorter than the traveling period associated with the CCW direction32.

When determining that the traveling period is shorter in the CW direction31(Yes in step S257), the control data processor240advances the processing to step S254. When determining that the traveling period is not shorter in the CW direction31(No in step S257), the control data processor240advances the processing to step S256.

FIG. 22shows the details of the reception in the CCW direction32. In the reception in the CCW direction32, when the determination result in step S263is negative (No in step S263), the control data processor240determines whether the traveling period is shorter in the CCW direction32(step S267). More specifically, the control data processor240reads the determination information251and determines whether the traveling period associated with the CCW direction32is shorter than the traveling period associated with the CW direction31.

When determining that the traveling period is shorter in the CCW direction32(Yes in step S267), the control data processor240advances the processing to step S264. When determining that the traveling period is not shorter in the CCW direction32(No in step S267), the control data processor240advances the processing to step S266.

The slave device20also performs the processing corresponding to the interruption detection shown inFIG. 15. However, in step S272performed in the interruption detection, the management data processor230rewrites the traveling period to an initial value of −1 as information indicating an interruption.

As described above, the history information631indicates an output time. The control data processor240receives and processes control data transmitted through the path in the shorter traveling period. More specifically, the control data processor240processes, selectively from control data output from the master device10in the CW direction31and control data output from the master device10in the CCW direction32, the control data received in the direction in which the management data with the shorter time elapsed between the acquired output time and the reception time of the management data is received. Thus, the control data processor240can reliably assign, selectively from the two paths, priority to the path through which data has been transmitted in the shorter time. For example, the control data processor240can select a path with the higher hop count but with the shorter traveling period.

Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above embodiments.

For example, although the communication system100corresponds to a ring network in the above example, the communication system100may be any other network. For example, the communication system100may be a mesh network as shown inFIG. 23. Such a network may define, as a redundant communication path of management data and control data, the communication path40in the CW direction31from a master node through slave nodes and back to the master node and the communication path40in the CCW direction32, opposite to the CW direction31, from the master node through the slave nodes and back to the master node. Such a network has the same advantageous effects as in the above embodiments.

The start and end points of the path in the CW direction31and the path in the CCW direction32are not limited to the master device10. The path in the CW direction31and the path in the CCW direction32each may be a loop with no start point or end point. The master node and the slave nodes may not be distinguished from each other. One of multiple nodes that equally output and receive control data may be specified as a node for outputting management data.

In the above examples, the communication system has the redundant communication path of control data with no communication fault, and assigns priority to the path that has the smaller count of relays or the shorter traveling period selectively from the paths in the CW direction31and the CCW direction32. However, priority may be assigned to the path selected in any other manner. For example, the communication system may assign priority to the path with the larger count of relays or with the longer traveling period. When the paths have an equal count of relays, the communication system may determine the path to be assigned priority in accordance with the length of traveling period. When the paths have an equal traveling period, the communication system may determine the path to be assigned priority in accordance with the count of relays.

The path to be assigned priority may be determined using a criterion other than the determination information251. For example, the slave device20may store, in the memory250, control data received in the past, and determine whether control data is identical to the stored data for each reception of control data. When control data is identical to the stored data, the slave device20may discard the control data. When control data is not identical to the stored data, the slave device20may determine that the control data is valid and process the control data.

The slave device20may update the determination information251to incorporate a flag indicating the path to be assigned priority selectively from the two paths. Thus, the control data processor240can determine whether control data is valid or invalid by simply referring to the flag without comparing the numbers of relays or the traveling period.

Although the master device10outputs control data and management data in equal cycles in the above embodiments, the master device10may output the data in any other manner. In some embodiments, the master device10may output control data and management data in different cycles, or may output control data irregularly as appropriate.

The functions of the master device10and the slave device20can be implemented by dedicated hardware or a general-purpose computer system.

For example, the program58executable by the processor51may be stored in a non-transitory computer-readable recording medium for distribution. The program58is installed in a computer to provide a device that performs the above processing. Examples of such recording media include a flexible disk, a compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), and a magneto-optical (MO) disk.

The program58may be stored in a disk device included in a server on a communication network, typically the Internet, and may be, for example, superimposed on carrier waves to be downloaded to a computer.

The processing described above may also be performed by the program58being activated and executed while being transferred through a communication network.

The processing described above may also be performed by the program58being entirely or partially executed on a server with a computer transmitting and receiving information about the processing through a communication network while executing a program.

In the system with the above functions implementable, for example, partly by the operating system (OS) or through cooperation between the OS and applications, portions related to the part other than the OS may be stored in a medium for distribution or may be downloaded to a computer.

Means for implementing the functions of the master device10and the slave device20is not limited to software. The functions may be partly or entirely implemented by dedicated hardware including circuits.

INDUSTRIAL APPLICABILITY

The present disclosure may be used for creating robust networks with fault tolerance.

REFERENCE SIGNS LIST

13Management data processor

14Control data processor

230Management data processor

240Control data processor

251Determination information

62Type information storage area

63Data storage area

621Type information

631History information

632Control information