COMMUNICATION CONTROL DEVICE AND METHOD FOR CONTROLLING COMMUNICATION CONTROL DEVICE

A communication control device stores reception data received from a network in any one of a plurality of reception queues to which different priorities have been given in advance to transfer the reception data to a main memory. The communication control device includes a reference table and a selection unit. In the reference table, at least one of a source address, a destination address, and an Ethernet frame type of the reception data to be stored is defined for at least one of the plurality of reception queues. The selection unit selects a reception queue in which the reception data is to be stored with reference to the reference table using at least one of the source address, the destination address, and the Ethernet frame type of the reception data.

TECHNICAL FIELD

The present invention relates to a communication control device and the like that stores reception data received from a network in one of a plurality of reception queues to which different priorities have been given in advance to transfer the reception data to a main memory.

BACKGROUND ART

In the related art, a technique of determining in which of a plurality of transfer queues a plurality of pieces of data are to be stored according to processing priorities of the plurality of pieces of data in a communication control device that transfers the plurality of received pieces of data to a main memory and that includes the plurality of transfer queues is known. For example, Patent Literature 1 discloses a communication control device that selects a transfer queue on the basis of a priority tag given to a data frame.

CITATION LIST

Patent Literature

SUMMARY OF INVENTION

Technical Problem

However, in the related art, there is a problem in that additional information (a “priority tag” in Patent Literature 1) added to data has to be used to select a transfer queue in which the data is to be stored out of a plurality of transfer queues.

An objective of an aspect of the present invention is to enable selecting a transfer queue in which data is to be stored out of a plurality of transfer queues according to a processing priority of the data without adding additional information indicating the processing priority to the data.

Solution to Problem

In order to achieve the aforementioned objective, according to an aspect of the present invention, there is provided a communication control device that stores reception data received from a network in any one of a plurality of reception queues to which different priorities have been given in advance to transfer the reception data to a main memory, the communication control device including: a reference table in which at least one of a source address, a destination address, and an Ethernet frame type of the reception data to be stored is defined for at least one of the plurality of reception queues; and a selection unit configured to select a reception queue in which the reception data is to be stored with reference to the reference table using at least one of the source address, the destination address, and the Ethernet frame type of the reception data.

In order to achieve the aforementioned objective, according to another aspect of the present invention, there is provided a method for controlling a communication control device that stores reception data received from a network in any one of a plurality of reception queues to which different priorities have been given in advance to transfer the reception data to a main memory, the method including: a selection step of selecting a reception queue in which the reception data is to be stored out of the plurality of reception queues using at least one of a source address, a destination address, and an Ethernet frame type of the reception data with reference to a reference table in which at least one of the source address, the destination address, and the Ethernet frame type of the reception data to be stored is defined for at least one of the plurality of reception queues; and a storage step of storing the reception data in the reception queue selected in the selection step.

Effects of Invention

According to the aspects of the present invention, it is possible to enable selecting a transfer queue in which data is to be stored out of a plurality of transfer queues according to a processing priority of the data without adding additional information indicating the processing priority to the data.

DESCRIPTION OF EMBODIMENTS

First Embodiment

Hereinafter, an embodiment of an aspect of the present invention (hereinafter also referred to as “this embodiment”) will be described with reference to the accompanying drawings. The same or corresponding elements will be referred to by the same reference signs, and description thereof will not be repeated. In this embodiment, a communication controller10included in a programmable logic controller (PLC)1that controls a control object such as a machine and a facility is described as a typical example of a communication control device.

In the following description, “n,” “N,” “p,” and “q” are integers equal to or greater than “1,” and “p” and “q” are different integers.

In the following description, a “reception queue” may be referred to as “RX” for the purpose of simplification of description. For example, a first reception queue13(0) may be referred to as “RX0,” and a second reception queue13(1) may be referred to as “RX1.” The first reception queue13(0) (that is, RX0) and the second reception queue13(1) (that is, RX1) may be simply referred to as a “reception queue13” or “RX” when they do not need to be particularly distinguished.

1. Application Examples

For the purpose of easy understanding of the communication controller10(communication control device) according to an aspect of the present invention, an example of a situation to which the present invention is applied, specifically, the outline of a control system0including the PLC1including the communication controller10, will be first described below with reference toFIG.2.

(Outline of Control System)

FIG.2is a diagram illustrating the outline of the control system0. The control system0includes the PLC1, a network hub2, and networks3(1) and3(2) connected to the PLC1via the network hub2. In the following description, the network3(1) and the network3(2) may be simply referred to as a “network3” when they do not need to be particularly distinguished. The network3may include one or more network devices.

In the control system0illustrated inFIG.2, a plurality of networks3are connected to the PLC1via the network hub2. Giga bands may be used for communication in the control system0.

The PLC1is a control device that controls the control system0as a whole, and the network hub2is a network hub or a network switch that manages communication between the PLC1and the plurality of networks3. In the control system0illustrated inFIG.2, a plurality of networks3, for example, the networks3(1) and3(2), are present for one network port of the PLC1(that is, a reception port11inFIG.1).

Here, both the networks3(1) and3(2) may be control networks, that is, all the networks3communicating with the PLC1may be control networks. One of the networks3(1) and3(2) may be a control network and the other may be a data network, that is, a control network and a data network may be mixed as the networks3that communicate with the PLC1.

For example, when a network3is a control network, the PLC1is a control device that takes charge of control of an input device and an output device in a production facility, and network devices are the input device and the output device in the production facility. The PLC1and the network devices transmit and receive IN data and OUT data (hereinafter referred to as “IO data”) by cyclically communicating with each other via the network3, and the PLC1controls the production facility as a whole. That is, when a network3is a control network, the control system0can be understood as a master-slave control system with the PLC1as a master device (a master device that manages transfer of data) and with the network devices as slave devices.

When a network3is a control network, the network3may be based on an industrial Ethernet (registered trademark) standard such as an EtherCAT (Ethernet for Control Automation Technology: registered trademark) standard. When a network3is a control network, the network3may be based on an Ethernet/IP (registered trademark) standard.

An example in which communication between the PLC1and the network devices (hereinafter also referred to as “network communication) inFIG.2is based on the Ethernet standard will be described below. It is assumed that a CPU30and the communication controller10be communicatively connected via peripheral component interconnect express (PCIe).

The control system0in which a plurality of networks3are connected to the PLC1via the network hub2is illustrated inFIG.2, but a plurality of networks3do not have to be connected to the PLC1via the network hub2in the control system0. In the control system0, one network3(particularly, one control network) may be connected to the PLC1without passing through the network hub2. For example, in the control system0which is a master-slave control system, the PLC1which is a master device and one or more network devices of which each is a slave device may be communicatively connected in a unicursal manner.

(Specific Example of Situation to be Resolved by Communication Controller According to Embodiment)

FIG.3is a diagram illustrating a situation which is to be resolved by the communication controller10(particularly, a transfer control unit12). Specifically,FIG.3is a diagram illustrating a situation which may occur when a plurality of pieces of reception data are transferred to (stored in) a main memory20in the reception order from the network3.

In the following description, “in what order the CPU30is to process” data received from the network3(reception data) by the PLC1(particularly, the communication controller10) is indicated by words “processing priority P.” Here, the processing priority P does not have to be given to the data (reception data) received from the network3by the PLC1(particularly, the communication controller10). Although details will be described later, this is because the PLC1(particularly, the communication controller10) can ascertain the processing priority P of the reception data using at least one of a source address, a destination address, and an Ethernet frame type (for example, information for distinguishing IPv4, ECAT, and the like) of the reception data.

That is, the processing priority P of reception data is not given to the reception data, but the word “processing priority P” is merely used to simply explain “in what order the CPU30is to process” the reception data.

The “processing priority P” becomes higher as the value thereof becomes smaller, and a “processing priority P=1” is higher than a “processing priority P=2.” Accordingly, it is preferable that data with the “processing priority P=1” be processed earlier than data with the “processing priority P=2” by the CPU30. The data with the “processing priority P=1” has a higher processing priority P than the data with the “processing priority P=2” and thus is also referred to as “high-priority data.” Similarly, the data with the “processing priority P=2” has a lower processing priority P than the data with the “processing priority P=1” (that is, high-priority data) and thus is also referred to as “low-priority data.”

The “order in which the PLC1(particularly, the communication controller10) has received data (reception data) from the network3” is also referred to as “reception order.” The “order in which the communication controller10transfers (stores) data received from the network3to the main memory20” is also referred to as “transfer order.” The data stored in the main memory20is processed by the CPU30in the order matching the transfer order in principle.

(A) ofFIG.3is a diagram illustrating a situation in which a plurality of pieces of reception data are transferred to (stored in) the main memory20in the reception order from the network3when a rate of network communication is higher than a rate of communication between the CPU30and the communication controller10.

With an increase of the rate of communication based on the Ethernet standard, the rate of network communication may be higher than the rate of communication between the CPU30and the communication controller10. For example, the communication rate of communication based on the Ethernet standard may be 10 Gbits/s, and the communication rate of PCIe Gen2 may be 5 Gbits/s.

In the case in which the communication rate of network communication is higher than the communication rate of communication between the CPU30and the communication controller10, the situation illustrated in (A) ofFIG.3may occur when the transfer order is matched with the reception order.

That is, the PLC1(particularly, the communication controller10) receives data D3from the network3subsequently to data D2and the transfer order is matched with the reception order, the data D3is transferred to the main memory20subsequently to the data D2.

Here, in (A) ofFIG.3, the data D3(with a processing priority P=1) is high-priority data, and the data D2(with a processing priority P=2) is low-priority data.

However, when the transfer order is matched with the reception order, the data D3which is high-priority data is transferred to the main memory20subsequently to the data D2which is low-priority data, that is, transfer of the data D3which is high-priority data to the main memory20is delayed. As a result, it is difficult to cause the CPU30to process the data D3which is high-priority data prior to the data D2which is low-priority data. Particularly, when the communication rate of network communication is higher than the communication rate of communication between the CPU30and the communication controller10, the delay of processing of the data D3which is high-priority data greatly affects the control of the control system0as a whole.

(B) ofFIG.3is a diagram illustrating a situation in which a plurality of pieces of reception data are transferred to (stored in) the main memory20in the reception order from the network3when a period in which access to the main memory20is prohibited (an access-prohibited period) is provided.

Here, “memory contention” occurs when a plurality of access requests for the main memory20are generated at the same timing. A period in which access to the main memory20is prohibited, that is, an “access-prohibited period,” may be provided to curb occurrence of memory contention without causing an arithmetic unit (that is, the CPU30) to perform a mediation process for preventing memory contention. When the CPU30is to perform an important process using data stored in the main memory20while a device (for example, the communication controller10) other than the CPU30is accessing the main memory20, a processing rate of the CPU30decreases. In order to prevent the decrease, an “access-prohibited period” which is a period in which a device other than the CPU30is prohibited from accessing the main memory20may be provided. An access-prohibited period may be provided in the PLC1(particularly, the communication controller10).

When an access-prohibited period is set, high-priority data is received in the access-prohibited period, and the transfer order to the main memory20is matched with the reception order of the data, the high-priority data may be transferred subsequently to low-priority data and transfer of the high-priority data may be greatly delayed.

That is, in (B) ofFIG.3, data D2(with a processing priority P=1) is high-priority data, and data D1(with a processing priority P=2) is low-priority data. The PLC1(particularly, the communication controller10) receives the data D2(with a processing priority P=1) from the network3in the access-prohibited period subsequently to the data D1(with a processing priority P=2).

When the transfer order is matched with the reception order, the data D2(with a processing priority P=1) is transferred to the main memory20after the data D1(with a processing priority P=2) has been transferred to the main memory20. When an access-prohibited period is provided, the communication controller10cannot access the main memory20in the access-prohibited period, and thus the data D1(with a processing priority P=2) is transferred to the main memory20after the access-prohibited period has elapsed. Accordingly, in comparison with a case in which an access-prohibited period is not provided, the timing at which the data D2(with a processing priority P=1) is transferred to the main memory20is further delayed when the access-prohibited period is provided.

As illustrated in (B) ofFIG.3, when the transfer order is matched with the reception order, it is difficult to cause the CPU30to process the data D2, which is high-priority data received subsequently to the data D1which is low-priority data, prior to the data D2. Particularly, when an access-prohibited period is provided and the transfer order is matched with the reception order, processing of the data D2which is high-priority data by the CPU30is delayed in comparison with a case in which an access-prohibited period is not provided.

(Specific Example of Transfer Order Realized by Communication Controller According to Embodiment)

FIG.4is a diagram illustrating a situation in which the transfer order of reception data to the main memory20is changed from the reception order of the reception data by the PLC1(particularly, the transfer control unit12).

In order to resolve the situation illustrated inFIG.3, the communication controller10transfers (stores) high-priority data to the main memory20prior to low-priority data. Specifically, the transfer control unit12of the communication controller10switches a reception queue13in which reception data is to be stored according to a source address, a destination address, and an Ethernet frame type (for example, information for distinguishing IPv4 and ECAT).

Here, the communication controller10includes a plurality of reception queues13and includes, for example, a first reception queue13(0) (that is, RX0) and a second reception queue13(1) (that is, RX1). Different priorities NP are given in advance to the plurality of reception queues13, that is, the priorities NP of the plurality of reception queues13are different from each other. For example, the priority NP(RX0) given in advance to the first reception queue13(0) (that is, RX0) is higher than the priority NP(RX1) given in advance to the second reception queue13(1) (that is, RX1).

The priorities NP given in advance to the plurality of reception queues13are different from processing priorities P indicating the “preferable order of processing of data (reception data) stored in the main memory20by the CPU30.”

When the first reception queue13(0) and the second reception queue13(1) request an access at the same time, a mediation unit14gives an access right to the reception queue13to which a higher priority NP has been given. The reception queue13having acquired the access right transfers data (reception data) stored in a data FIFO131to the main memory20. That is, reception data stored in the head of the reception queue13to which a higher priority NP has been given in advance is transferred to the main memory20prior to reception data stored in the head of the reception queue13to which a lower priority NP has been given in advance.

Accordingly, the communication controller10can transfer the reception data to the main memory20in the order different from the reception order from the network3by switching the reception queue13in which the reception data is to be stored. Specifically, the communication controller10can transfer high-priority data to the main memory20prior to low-priority data by storing only reception data of which the processing priority P is determined to be high in the reception queue13to which a high priority NP has been given in advance.

The communication controller10determine the processing priority P of reception data using at least one of a “destination address,” a “source address,” and an “Ethernet frame type (frame type)” of the reception data. The communication controller10may determine the processing priority P of reception data using only the “source address” of the reception data. All of the “destination address,” the “source address,” and the “frame type” are original information of the reception data, but are not information which is newly added to indicate the processing priority P of the reception data.

The “destination address” of reception data which is referred to by the transfer control unit12at the time of switching a storage destination of the reception data can be roughly classified into a unicast address, a multicast address, a broadcast address, and the like. When the communication controller10is realized as a general network interface card (NIC), a plurality of addresses can be registered as the multicast addresses. Accordingly, for example, when the “destination address” of reception data is “multicast address A,” the communication controller10(particularly, the transfer control unit12) may select the first reception queue13(0) as a storage destination of the reception data. Similarly, for example, when the “destination address” of reception data is “multicast address B,” the communication controller10(particularly, the transfer control unit12) may select the second reception queue13(1) as a storage destination of the reception data.

The transfer control unit12may select a storage destination of reception data according to a source address of the reception data. For example, when the “source address” of reception data is “addr_txa” or “addr_txb,” the communication controller10(particularly, the transfer control unit12) may select the first reception queue13(0) as a storage destination of the reception data. Similarly, for example, when the “source address” of reception data is neither “addr_txa” nor “addr_txb,” the communication controller10(particularly, the transfer control unit12) may select the second reception queue13(1) as a storage destination of the reception data.

The transfer control unit12may select a storage destination of reception data according to a frame type of the reception data. For example, when the “frame type” of reception data is “other than IPv4,” the communication controller10(particularly, the transfer control unit12) may select the first reception queue13(0) as a storage destination of the reception data. Similarly, for example, when the “frame type” of reception data is “IPv4,” the communication controller10(particularly, the transfer control unit12) may select the second reception queue13(1) as a storage destination of the reception data.

(A) ofFIG.4is a diagram illustrating a situation in which the communication controller10stores a plurality of pieces of reception data in the main memory20in the order different from the reception order even when the rate of network communication is higher than the rate of communication between the CPU30and the communication controller10.

In (A) ofFIG.4, data D3(with a processing priority P=1) is high-priority data, and data D2(with a processing priority P=2) is low-priority data. The PLC1(particularly, the communication controller10) receives the data D3from the network3subsequently to the data D2.

The communication controller10(the transfer control unit12) stores the data D3in RX0to which a higher priority NP than RX1has been given according to at least one of a source address, a destination address, and an Ethernet frame type of the data D3. That is, the transfer control unit12stores the data D3in the first reception queue13(0) to which a higher priority NP than the second reception queue13(1) has been given.

Similarly, the communication controller10(the transfer control unit12) stores the data D2in RX1to which a lower priority NP than RX0has been given according to at least one of a source address, a destination address, and an Ethernet frame type of the data D2. That is, the transfer control unit12stores the data D2in the second reception queue13(1) to which a lower priority NP than the first reception queue13(0) has been given.

Since a higher priority NP than RX1has been given to RX0, the mediation unit14gives an access right to RX0to which the higher priority NP has been given when RX0and RX1request an access at the same time.

As a result, RX0can transfer the data D3to the main memory20earlier than the timing at which RX1transfers the data D2to the main memory20. That is, the communication controller10can transfer the “data D3which is high-priority data” received subsequently to the “data D2which is low-priority data” to the main memory20prior to the “data D2which is low-priority data.”

In this way, by “transferring high-priority data received subsequently to low-priority data to the main memory20prior to the low-priority data,” the communication controller10can cause the CPU30to process the high-priority data prior to the low-priority data. Particularly, when the rate of network communication is higher than the rate of communication between the CPU30and the communication controller10, the communication controller10can prevent a “processing delay of high-priority data” which greatly affects control of the control system0as a whole.

(B) ofFIG.4is a diagram illustrating a situation in which the communication controller10stores a plurality of pieces of reception data in the main memory20in the order different from the reception order even when an access-prohibited period is provided.

In (B) ofFIG.4, data D2(with a processing priority P=1) is high-priority data, and data D1(with a processing priority P=2) is low-priority data. The PLC1(particularly, the communication controller10) receives the data D2(with a processing priority P=1) from the network3subsequently to the data D1(with a processing priority P=2) in the access-prohibited period.

The communication controller10(the transfer control unit12) stores the data D2in RX0to which a higher priority NP than RX1has been given according to at least one of a source address, a destination address, and an Ethernet frame type of the data D2. That is, the transfer control unit12stores the data D2in the first reception queue13(0) to which a higher priority NP than the second reception queue13(1) has been given.

Similarly, the communication controller10(the transfer control unit12) stores the data D1in RX1to which a lower priority NP than RX0has been given according to at least one of a source address, a destination address, and an Ethernet frame type of the data D1. That is, the transfer control unit12stores the data D1in the second reception queue13(1) to which a lower priority NP than the first reception queue13(0) has been given.

Since a higher priority NP than RX1has been given to RX0, the mediation unit14gives an access right to RX0to which the higher priority NP has been given when RX0and RX1request an access at the same time.

As a result, RX0can transfer the data D2to the main memory20earlier than the timing at which RX1transfers the data D1to the main memory20. Specifically, RX0transfers the data D2to the main memory20immediately after the access-prohibited period has elapsed, and then RX1transfers the data D1to the main memory20. That is, the communication controller10can transfer the “data D2which is high-priority data” received subsequently to the “data D1which is low-priority data” to the main memory20prior to the “data D1which is low-priority data.”

In this way, by “transferring high-priority data received subsequently to low-priority data to the main memory20prior to the low-priority data,” the communication controller10can cause the CPU30to process the high-priority data prior to the low-priority data. Particularly, when the access-prohibited period is provided, the communication controller10can prevent a “processing delay of high-priority data” which is greater in comparison with a case in which the access-prohibited period is not provided.

(Summary of Communication Controller According to Embodiment)

The communication controller10of which the outline has been described above with reference toFIGS.2,3, and4will be summarized as follows for the purpose of easy understanding thereof.

That is, the communication controller10is a communication control device that stores data (reception data) received from a network3in any one of a plurality of reception queues13to which different priorities NP have been given in advance to transfer the reception data to the main memory20. The communication controller10includes a queue selection table121(a reference table) and a selection unit122.

The queue selection table121defines at least one of a “source address,” a “destination address,” and an “Ethernet frame type” of the reception data to be stored for at least one of the plurality of reception queues13.

The selection unit122selects a reception queue13in which the reception data is to be stored with reference to the queue selection table121using at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data.

With this configuration, the communication controller10selects a reception queue13in which reception data is to be stored out of the plurality of reception queues13using at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data.

Here, all of the “source address,” the “destination address,” and the “Ethernet frame type” are original information of the reception data, but are not information which is newly added to select the reception queue13in which the reception data is to be stored.

Accordingly, the communication controller10can store reception data in a desired reception queue13selected out of the plurality of reception queues13to which different priorities NP have been given in advance without using additional information indicating processing priorities P.

In the communication controller10, the selection unit122may select a reception queue13in which reception data is to be stored out of a plurality of reception queues13with reference to the queue selection table121using only the “source address” of the reception data.

For example, only the “source address” of reception data to be stored in the first reception queue13(0) may be defined in the queue selection table121. When a “source address” of reception data matches the “source address” defined in the queue selection table121, the selection unit122may select the first reception queue13(0) as a storage destination of the reception data.

With this configuration, the communication controller10selects a reception queue13in which reception data is to be stored out of the plurality of reception queues13with reference to the queue selection table121using only the “source address” of the reception data. Accordingly, the communication controller10can store reception data in a desired reception queue13selected out of the plurality of reception queues13to which different priorities NP have been given in advance using only the “source address” of the reception data.

2. Configuration Example

Details of the communication controller10and the PLC1including the communication controller10of which the outlines have been described above will be described below with referenceFIG.1.

FIG.1is a diagram illustrating an example of a configuration of the PLC1. As illustrated inFIG.1, the PLC1includes the communication controller10, the main memory20, the CPU30, and a nonvolatile memory40as hardware constituents. The PLC1may further include a USB connector for connecting the PLC1to an external device. The communication controller10, the main memory20, the CPU30, and the nonvolatile memory40are coupled via various buses (internal buses).

The CPU30typically has a configuration based on a general-purpose computer architecture and sequentially analyzes and executes command codes according to an internal clock. The CPU30includes one or more CPU cores and a network control unit as hardware constituents. The CPU30illustrated inFIG.1includes a table generating unit31as a functional block.

The table generating unit31generates a queue selection table121on the basis of “various setting information42including a network configuration or the like of the control system0” which is generated using a setting PC by a user. The queue selection table121generated by the table generating unit31is used for the transfer control unit12(particularly, the selection unit122) of the communication controller10to select a reception queue13in which reception data is to be stored.

The main memory20is a storage means of the PLC1and stores, for example, data (reception data) which is received from the network3by the PLC1(particularly, the communication controller10). The CPU30performs various arithmetic processes on data stored in the main memory20.

The main memory20is a volatile storage area (RAM) and stores various programs which are to be executed by the CPU30after the PLC1is powered on as well as reception data which is received from the network3and on which various arithmetic processes are to be performed by the CPU30. The main memory20is also used as a work memory when the CPU30executes various programs. For example, a dynamic random access memory (DRAM) or a static random access memory (SRAM) may be used as the main memory20.

In the main memory20illustrated inFIG.1, reception data and descriptor data (descriptor) corresponding to the reception data are stored. The descriptor includes information indicating a storage address of the corresponding reception data in the main memory20, a data size of the corresponding reception data in the main memory20, and the like.

The nonvolatile memory40stores data such as various programs and parameters in a nonvolatile manner. Such data is copied to the main memory20such that the CPU30can access the main memory20according to necessity. A semiconductor memory such as a flash memory can be used as the nonvolatile memory. Alternatively, a magnetic recording medium such as a hard disk drive or an optical recording medium such as a digital versatile disk random access memory (DVD-RAM) can be used.

“Various setting information42including a network configuration or the like of the control system0” generated using a setting PC by a user is stored in the nonvolatile memory40illustrated inFIG.1. The nonvolatile memory40includes a log table41in which various logs generated by a log generating unit16of the communication controller10are stored.

The communication controller10is a data transfer device that receives data from the network3and stores the received data (reception data) in the main memory20, and is realized, for example, as a network interface card (NIC). The communication controller10is typically constituted by a hardware logical circuit such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). The communication controller10is configured to transmit and receive data to and from the main memory20, the CPU30, and the nonvolatile memory40.

The communication controller10is connected to the network3via a reception port11, controls exchange of data with the network3, and controls particularly reception of reception data. For example, the communication controller10provides functions of a physical layer and a data link layer in the network3. That is, the communication controller10controls transmission of transmission data and reception of reception data on the basis of a basic standard of the network3. Specifically, the communication controller10receives reception data from a network device connected to the network3and stores the received data (reception data) in a reception queue13. Particularly, the communication controller10selects a reception queue13in which reception data is to be stored out of a plurality of reception queues13to which different priorities NP have been given in advance and stores the reception data in the selected reception queue13.

Although details will be described later, the PLC1controls the transfer order of reception data received from the network3to the main memory20using the communication controller10configured as a hardware logical circuit, not using the CPU30. Accordingly, the PLC1can control the transfer order of reception data to the main memory20such that it is desired order using the communication controller10configured as a hardware logical circuit without increasing a processing load of the CPU30.

The communication controller10illustrated inFIG.1includes a reception port11, a transfer control unit12, two or more reception queues13, a mediation unit14, an IF15, and a log generating unit16as functional blocks.

In the example illustrated inFIG.1, the communication controller10includes a first reception queue13(0) (that is, RX0) and a second reception queue13(1) (that is, RX1) as the reception queues13. Different priorities NP are given to a plurality of reception queues13in advance, and for example, the priority NP(RX0) given in advance to the first reception queue13(0) is higher than the priority NP(RX1) given in advance to the second reception queue13(1).

Elements not directly associated with this embodiment such as an element for transmitting transmission data to the network3via a transmission port in the communication controller10illustrated inFIG.1are omitted for the purpose of simplification of description. Here, the communication controller10may include the omitted configurations according to the actual circumstances.

The transfer control unit12selects a reception queue13in which data (reception data) received from the network3via the reception port11is to be stored out of a plurality of reception queues13to which different priorities NP have been given in advance. The transfer control unit12illustrated inFIG.1selects in which of the first reception queue13(0) and the second reception queue13(1) the data (reception data) received from the network3via the reception port11is to be stored. The transfer control unit12includes a queue selection table121, a selection unit122, and a storage unit123.

In the queue selection table121, information indicating conditions of reception data to be stored is stored for at least one of the plurality of reception queues13. Specifically, information for defining at least one of a “source address,” a “destination address,” and an “Ethernet frame type” of reception data to be stored is stored for at least one of the plurality of reception queues13in the queue selection table121. In the queue selection table121illustrated inFIG.1, information indicating conditions of reception data to be stored in the first reception queue13(0) to which a higher priority NP than a priority NP(RX1) given to the second reception queue13(1) has been given in advance is stored.

The selection unit122selects a reception queue13in which reception data is to be stored with reference to the queue selection table121using at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data. The selection unit122illustrated inFIG.1selects the first reception queue13(0) or the second reception queue13(1) as a storage destination of the reception data using at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data. Particularly, when at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data satisfies the conditions defined in the queue selection table121, the selection unit122selects the first reception queue13(0) as the storage destination. The selection unit122notifies the storage unit123of the reception queue13selected as the storage destination of the reception data, that is, the first reception queue13(0) or the second reception queue13(1).

The storage unit123stores the reception data in the reception queue13selected by the selection unit122and particularly stores the reception data in a data FIFO131of the reception queue13selected by the selection unit122. For example, when the first reception queue13(0) is selected by the selection unit122, the storage unit123stores the reception data in a first data FIFO131(0) of the first reception queue13(0). Similarly, when the second reception queue13(1) is selected by the selection unit122, the storage unit123stores the reception data in a second data FIFO131(1) of the second reception queue13(1).

The reception queue13temporarily stores data (reception data) received from the network3by the PLC1(particularly, the communication controller10) and transfers the reception data to the main memory20on the basis of the descriptor. The reception queue13includes a data FIFO131, a descriptor FIFO132, and a direct memory access controller (DMAC)133.

The data (reception data) received from the network3by the PLC1(particularly, the communication controller10) is stored in the data FIFO131in a first-in first-out (FIFO) manner.

A descriptor (descriptor data) is stored in the descriptor FIFO132in the FIFO manner. When the CPU30completes setting of descriptor data in the main memory20and issues a reception permission to the communication controller10, the communication controller10reads a descriptor from the main memory20and stores the read descriptor in the descriptor FIFO132.

The DMAC133performs data exchange between the main memory20and the data FIFO131and the descriptor FIFO132. For example, the DMAC133reads descriptor data set in the main memory20by the CPU30and stores the read descriptor data in the descriptor FIFO132. When an access is permitted by the mediation unit14, the DMAC133stores reception data stored in the data FIFO131in the main memory20sequentially from the head of the reception data. Particularly, the DMAC133stores reception data stored in the data FIFO131in an address of the main memory20defined in the descriptor on the basis of the descriptor stored in the descriptor FIFO132. When an access is permitted by the mediation unit14, the DMAC133transfers a write-back descriptor to the main memory20, that is, overwrites the descriptor in the main memory20with the write-back descriptor.

The mediation unit14mediates between a plurality of access requests to the main memory20, that is, mediates between access requests from a plurality of reception queues13. Specifically, when access requests are received from the plurality of reception queues13substantially at the same time, the mediation unit14gives an access right to only the reception queue13to which the highest priority NP has been given, that is, permits an access thereto. For example, when an access request from the first reception queue13(0) and an access request from the second reception queue13(1) are issued substantially at the same time, the mediation unit14permits an access to the first reception queue13(0) to which the highest priority NP than the second reception queue13(1) has been given.

The IF15is an interface that is used for the communication controller10(particularly, the DMAC133) to communicate with the main memory20, the CPU30, and the nonvolatile memory40.

The log generating unit16generates a log indicating various times associated with reception and transfer of reception data (specifically, a start time log, an order change log, and an end time log). The log generating unit16stores the generated log in a log table41of the nonvolatile memory40. Details of the log generated by the log generating unit16will be described later with reference toFIG.6.

FIG.5is a diagram illustrating the queue selection table121, where (A) ofFIG.5illustrates an example of the queue selection table121. (B) ofFIG.5is a diagram illustrating an example of a method of generating the queue selection table121. InFIG.5, the “queue selection table121in which conditions of reception data to be stored in the reception queue13to which a high priority NP has been given are defined” is illustrated as an example of the queue selection table121.

In the queue selection table121illustrated in (A) ofFIG.5, conditions of reception data to be stored in the first reception queue13(0) (that is, RX0) are defined. That is, in the queue selection table121illustrated in (A) ofFIG.5, a condition that the “source address” is “addr_txa” is defined as “condition: 1” of the reception data to be stored in the first reception queue13(0). Similarly, in the queue selection table121illustrated in (A) ofFIG.5, a condition that the “source address” is “addr_txb” is defined as “condition: 2.”

In the queue selection table121illustrated in (A) ofFIG.5, a condition that the “destination address” is “multicast (addr_rxa)” and the “frame type” is “!IPv4 (that is, other than IPv4)” is defined as “condition: n.”

The transfer control unit12includes the queue selection table121used to select a storage destination of reception data by the selection unit122. The queue selection table121is set by software (that is, the CPU30) before communication. In the queue selection table121, for example, conditions of reception data to be stored in the reception queue13(for example, the first reception queue13(0)) to which a high priority NP has been given are set in advance. In the queue selection table121illustrated in (A) ofFIG.5, at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of reception data is set as conditions of the reception data to be stored in the first reception queue13(0).

A plurality of conditions used to select the reception queue13in which reception data is to be stored can be set for each item (that is, the “source address,” the “destination address,” and the “Ethernet frame type” of reception data) or for each combination of a plurality of items.

A combination of a plurality of items can be set as a condition, and all items do not need to be set. For example, only a “source address” may be set and the other items may not be set. In this case, when a source address of reception data satisfies the “source address” set as the conditions, it is determined that the “reception data satisfies the conditions” regardless of the destination address and the Ethernet frame.

When each item is “other than 00,” that is, other than a set value (that is, 00), the selection unit122may set a condition for determining that the “condition is satisfied.” For example, when a condition “!IPv4 (that is, other than IPv4)” is set for the “frame type” and the frame type of reception data is other than “IPv4,” the selection unit122determines that “the reception data satisfies the condition.”

(B) ofFIG.5illustrates a method of causing the PLC1(particularly, the CPU30) to generate the queue selection table121as an example of the method of generating the queue selection table121.

A user generates device setting information and program data using a setting PC, that is, generates “various setting information42including a network configuration of the control system0.” Here, in general, an industrial controller and a device (for example, the “network device” inFIG.2) perform exchange of data with a predetermined cycle. In the example illustrated in (B) ofFIG.5, the user sets one or more data exchange cycles for a unit group including one or more devices D and a communication priority CP of the unit group using the setting PC. The user may set the data exchange cycle and the communication priority CP for each of a plurality of unit groups using the setting PC. That is, the various setting information42generated using the setting PC by the user include the communication priority CP of the unit group.

Here, the communication priority CP and the processing priority P may be correlated. When the communication priority CP of a certain unit group (for example, a unit group U1) is higher than the communication priority CP of another unit group (for example, a unit group U2), it may mean that a communication cycle of the certain unit group needs to be more highly maintained than the other unit group. When the communication priority CP of a certain unit group (for example, a unit group U1) is higher than the communication priority CP of another unit group (for example, a unit group U2), it may mean that a communication cycle of the certain unit group is smaller (shorter) than the communication cycle of the other unit group.

In other words, a communication cycle with high necessity for maintaining the communication cycle may be referred to as a “high-priority cycle,” and a small (short) communication cycle may be referred to as a “high-priority cycle.” That is, a “high-priority cycle” may mean that the set communication priority CP is high, and may mean at least one a communication cycle with high necessity for maintaining the communication cycle and a small (shorter) communication cycle.

For example, in (B) ofFIG.5, an example in which the user gives a high communication priority CP and a data exchange cycle to the unit group U1including devices D1-1, D1-2, . . . , D1-nusing a setting PC is illustrated. That is, an example in which the “user sets a high-priority cycle for the unit group U1” is illustrated in (B) ofFIG.5.

In the example illustrated in (B) ofFIG.5, the user gives a low communication priority CP and a data exchange cycle to the unit group U2including devices D2-1, D2-2, . . . , D2-nusing the setting PC. That is, an example in which the “user sets a low-priority cycle for the unit group U2” is illustrated in (B) ofFIG.5.

In the following description, the devices D1-1, D1-2, . . . , D1-nand the devices D2-1, D2-2, . . . , D2-nare simply abbreviated as a “device D” when they do not have to be distinguished. Similarly, the devices D1-1, D1-2, . . . , D1-nare simply abbreviated as a “device D1” when they do not have to be distinguished, and the devices D2-1, D2-2, . . . , D2-nare simply abbreviated as a “device D2” when they do not have to be distinguished.

The setting PC notifies the PLC1of the various setting information42generated by the user (uploading). The PLC1stores the various setting information42loaded from the setting PC in the nonvolatile memory40. When “preparation of a queue selection table” is validated, the table generating unit31of the CPU30acquires a source address of the device D connected to the PLC1(particularly, the communication controller10). The table generating unit31identifies a unit group U including the device D from the acquired source address. Then, the table generating unit31acquires a communication priority CP set for the unit group U including the device D with reference to the various setting information42stored in the nonvolatile memory40.

The table generating unit31stores a transmission address corresponding to the device D included in the unit group U to which a high communication priority CP has been given in an entry of “source address” in the queue selection table121with reference to the various setting information42. That is, the table generating unit31stores the source address corresponding to the device D included in the unit group U for which a high-priority cycle has been set in the entry of “source address” in the queue selection table121.

For example, the table generating unit31acquires the source address of a certain device Dp when the certain device Dp is connected to the PLC1(particularly, the communication controller10). The table generating unit31identifies that the device Dp is a device D1-1and the unit group U including the device D1-1is the unit group U1using the acquired source address with reference to the various setting information42. The table generating unit31ascertains that a “high-priority cycle” is set for the unit group U1with reference to the various setting information42.

The table generating unit31stores a transmission address corresponding to a device D1included in the unit group U1in the entry of “source address” in the queue selection table121, that is, sets (generates) the queue selection table121. For example, the table generating unit31stores the transmission address of the device Dp which is the device D1-1in the entry of “source address” in the queue selection table121.

Conditions for identifying a “device communicatively connected to the PLC1(particularly, the communication controller10) without using an industrial network” are set for “destination address” and “frame type” in the queue selection table121. Examples of the industrial network include EtherCAT (registered trademark) and Ethernet/IP.

The table generating unit31ascertains whether there is a “device connected to the PLC1(particularly, the communication controller10) without using an industrial network” with reference to the various setting information42stored in the nonvolatile memory40. When there is a “device connected to the PLC1without using an industrial network,” the table generating unit31sets the conditions of “destination address” and “frame type” in the queue selection table121such that reception data from the device satisfies the conditions.

The table generating unit31stores the queue selection table121generated with reference to the various setting information42stored in the nonvolatile memory40in the nonvolatile memory40and notifies the communication controller10. The communication controller10(particularly, the transfer control unit12) acquires the queue selection table121generated by the table generating unit31.

Description made above with reference to (B) ofFIG.5can be summarized as follows. That is, the queue selection table121used by the communication controller10is generated using various setting information42defined for the network3by the user and including configuration information of the network3.

With this configuration, the communication controller10selects a reception queue13in which reception data is to be stored with reference to the queue selection table121generated using various setting information42defined for the network3by a user and including configuration information of the network3.

For example, the PLC1may ascertain whether there is a device D (a high-priority device, for example, D1-1) with higher necessity for maintaining the communication cycle than those of other devices D out of the devices D periodically communicating with the PLC1via the network3with reference to the various setting information42. When a high-priority device is defined in the various setting information42, the PLC1generates or updates the queue selection table121such that reception data with a high-priority device as a “source address” is stored in a reception queue13to which a high priority NP has been given.

Similarly, when necessity for maintaining a communication cycle with a certain unit group U (device group) is set to be higher than necessity for maintaining a communication cycle with another unit group U in the various setting information42, the PLC1may generate or update the queue selection table121as follows. That is, the PLC1may generate or update the queue selection table121such that reception data with a device D included in the certain unit group U (for example, the unit group U1) as a “source address is stored in the first reception queue13(0). The PLC1may generate or update the queue selection table121such that reception data with a device included in the other unit group U (for example, the unit group U2) as a “source address” is stored in the second reception queue13(1).

When a communication priority CP of communication with a certain destination address is set to be higher than a communication priority CP of communication with another destination address in the various setting information42, the PLC1may generate or update the queue selection table121as follows. That is, the PLC1may generate or update the queue selection table121such that reception data with the certain destination address as a “destination address” is stored in the first reception queue13(0). The PLC1may generate or update the queue selection table121such that reception data with the other destination address as a “destination address” is stored in the second reception queue13(1).

When a processing priority P of reception data of a certain frame type is set to be higher than a processing priority P of reception data of another frame type in the various setting information42, the PLC1may generate or update the queue selection table121as follows. That is, the communication controller10may generate or update the queue selection table121such that the reception data of the certain frame type is stored in the first reception queue13(0). The PLC1may generate or update the queue selection table121such that the reception data of the other frame type is stored in the second reception queue13(1).

Accordingly, the communication controller10can appropriately select a reception queue13in which reception data is to be stored with reference to the queue selection table121generated without causing a user to labor two times.

FIG.6is a diagram illustrating a start time log or the like generated by the communication controller10(particularly, the log generating unit16). Specifically, (A) ofFIG.6illustrates a reception start time and a transfer start time of a start time log, and (B) ofFIG.6illustrates an example of a storage destination of the start time log.

As illustrated in (A) ofFIG.6, the log generating unit16generates a start time log including a reception start time which is a time point at which reception of data from the network3has started and a transfer start time which is a time point at which transfer to the main memory20has started are organized as a set for each piece of data (each piece of reception data).

In the example illustrated (A) ofFIG.6, the PLC1(particularly, the communication controller10) receives data D1, D2, and D3in this order from the network3. Particularly, the PLC1starts reception of data D1at a reception start time T1-0(D1), starts reception of data D2at a reception start time T1-0(D2), and starts reception of data D3at a reception start time T0-0(D3).

The communication controller10stores the data D1(with a processing priority P=2) and the data D2(with a processing priority P=2) in the second reception queue13(1) (that is, RX1) and stores the data D3(with a processing priority P=1) in the first reception queue13(0) (that is, RX0).

As a result, a time point at which transfer of the data D1(with a processing priority P=2) from RX1to the main memory20is the transfer start time T1-1(D1). A time point at which transfer of the data D2(with a processing priority P=2) from RX1to the main memory20is the transfer start time T1-1(D2). A time point at which transfer of the data D3(with a processing priority P=1) from RX0to the main memory20is the transfer start time T0-1(D3). As illustrated in (A) ofFIG.6, the transfer start time T0-1(D3) is earlier than the transfer start time T1-1(D2).

The log generating unit16generates a start time log in which the reception start time T1-0(D1) and the transfer start time T1-1(D1) are correlated, and generates a start time log in which the reception start time T1-0(D2) and the transfer start time T1-1(D2) are correlated. The log generating unit16generates a start time log in which the reception start time T0-0(D3) and the transfer start time T0-1(D3) are correlated.

By using the start time log generated by the log generating unit16, for example, a user can perform data trace including behavior in the communication controller10for each of the data pieces D1, D2, and D3.

In the example illustrated in (A) ofFIG.6, the communication controller10having received the data pieces D1, D2, and D3in this order transfers the data pieces D1, D3, and D2to the main memory20in this order, that is, changes the transfer order from the reception order.

Therefore, the communication controller10(particularly, the log generating unit16) increments a counter whenever the transfer order is changed from the reception order, and generates a log (an order change log) serving as an index indicting occurrence of data contention. In the example illustrated inFIG.6, the transfer order is changed from the reception order “one time.”

The log generating unit16additionally generates an end time log in which a reception end time which is a time point at which reception from the network3has ended and a transfer end time which is a time point at which transfer to the main memory20has ended are organized as a set for each data piece (each reception data piece). In the example illustrated inFIG.6, the log generating unit16generates an end time log in which a reception end time at which reception of the data D1from the network3has ended and a transfer end time at which transfer of the data D1to the main memory20has ended are organized as a set. The log generating unit16generates an end time log in which a reception end time at which reception of the data D2from the network3has ended and a transfer end time at which transfer of the data D2to the main memory20has ended are organized as a set. The log generating unit16generates an end time log in which a reception end time at which reception of the data D3from the network3has ended and a transfer end time at which transfer of the data D3to the main memory20has ended are organized as a set.

For example, the log generating unit16calculates a reception end time and a transfer end time of reception data using the reception start time and the transfer start time of the reception data and a data size of the reception data.

Here, the PLC1prepares a record (log) for (1) a communication rate associated with communication with the network3(that is, network communication) and (2) a communication rate of communication between the CPU30and the communication controller10at the time of start and during operation. The PLC1prepares a record (log) for data sizes of the reception data.

Accordingly, the log generating unit16can calculate a time period (a receiving operation period) required from start of reception of reception data to end thereof from the communication rate associated with network communication and the data size of the reception data. Then, the log generating unit16can calculate a reception end time of the reception data by adding the calculated receiving operation period to the reception start time of the reception data.

The log generating unit16can calculate a time period (a transfer operation period) required from start of transfer of reception data to end thereof from the communication rate of communication between the CPU30and the communication controller10and the data size of the reception data. Then, the log generating unit16can calculate a transfer end time of the reception data by adding the calculated transfer operation period to the transfer start time of the reception data.

Then, the log generating unit16generates an end time log in which the calculated reception end time and the calculated transfer end time are correlated. By using the end time log generated by the log generating unit16, for example, a user can perform data trace including behavior in the communication controller10for each of the data pieces D1, D2, and D3.

That is, the user can monitor reception data using the logs (the start time log, the order change log, and the end time log) generated by the log generating unit16.

An example in which the start time log, the order change log, and the end time log are generated by the communication controller10(particularly, the log generating unit16) has been described above, but the entity that generates the start time log, the order change log, and the end time log does not have to be the communication controller10. At least one of the start time log, the order change log, and the end time log may be generated by the CPU30, and the start time log, the order change log, and the end time log have only to be generated by the PLC1. For example, a configuration in which the CPU30includes the log generating unit16may be employed.

(B) ofFIG.6is a diagram illustrating an example of a storage destination of the log (the start time log, the order change log, and the end time log) generated by the communication controller10(particularly, the log generating unit16). As illustrated in (B) ofFIG.6, the storage destination of the log generated by the log generating unit16may be a nonvolatile memory outside of the communication controller10or may be a nonvolatile memory inside of the communication controller10.

That is, the log generated by the log generating unit16may be stored in a nonvolatile memory which is provided outside of the communication controller10and which is managed by the CPU30. A log stored in the nonvolatile memory which is provided outside of the communication controller10and which is managed by the CPU30may be generated by the CPU30by acquiring necessary data from a reception descriptor, that is, the CPU30may include the log generating unit16.

The log generated by the log generating unit16may be stored in a nonvolatile memory which is provided inside of the communication controller10. That is, the log generating unit16may store the generated log in a nonvolatile memory which is provided inside of the communication controller10.

The log generated by the log generating unit16may be stored in a nonvolatile memory which is provided outside of the communication controller10. That is, the log generating unit16may store the generated log in a nonvolatile memory which is provided outside of the communication controller10.

Description made above with reference toFIG.6(particularly, (A) ofFIG.6) can be summarized as follows. That is, the log generating unit16generates a start time log in which the reception start time which is a time point at which reception of reception data from the network3has started and the transfer start time which is a time point at which transfer of the reception data to the main memory20has started are correlated.

With this configuration, the communication controller10generates a start time log in which the reception start time and the transfer start time of reception data are correlated. Accordingly, the communication controller10can enable data trace of reception data including behavior in the communication controller10using the start time log.

The log generating unit16generates an order change log indicating the number of times other reception data received after certain reception data has been received has been transferred to the main memory20prior to the certain reception data.

With this configuration, the communication controller10generates the order change log indicating the number of times other reception data received after certain reception data has been received has been transferred to the main memory20prior to the certain reception data.

Accordingly, the communication controller10can enable using the order change log as an index indicting occurrence of data contention such as “reception data received subsequently to previously received reception data is earlier transferred to the main memory20.”

The log generating unit16generates an end time log in which the reception end time which is a time point at which reception of reception data from the network3has ended and the transfer end time which is a time point at which transfer of the reception data to the main memory20has ended are correlated.

With this configuration, the communication controller10generates the end time log in which the reception end time and the transfer end time of reception data are correlated. Accordingly, the communication controller10can enable data trace of reception data including behavior in the communication controller10using the end time log.

Here, the reception end time of the end time log is calculated from the reception start time which is a time point at which reception of the reception data from the network3has started, the communication rate of the network3, and the data size of the reception data. The transfer end time is calculated from the transfer start time which is a time point at which transfer of the reception data to the main memory20has started, a transfer rate to the main memory20, and the data size of the reception data.

With this configuration, the communication controller10calculates the reception end time and the transfer end time. Accordingly, the communication controller10can enable monitoring communication of reception data as a whole using the reception start time, the transfer start time, the calculated reception end time, and the calculated transfer end time.

The logs (the start time log, the order change log, and the end time log) generated by the communication controller10(particularly, the log generating unit16) is stored in the nonvolatile memory40inside or outside of the communication controller10.

With this configuration, the communication controller10stores the start time log, the order change log, and the end time log in the nonvolatile memory40inside or outside of the communication controller10. Accordingly, the communication controller10can appropriately store the start time log, the order change log, and the end time log in the nonvolatile memory40inside or outside of the communication controller10such that the logs can be easily used.

3. Operation Example

As described above with reference toFIG.1or the like, the communication controller10includes a plurality of reception queues13to which different priorities NP have been given in advance. The communication controller10selects a reception queue13in which reception data is to be stored with reference to the queue selection table121using at least one of a “source address,” a “destination address,” and an “Ethernet frame type” of the reception data. Details of a routine which is performed by the PLC1(particularly, the communication controller10) will be described below with reference toFIGS.7to10.

(Entire Outline of Routine Performed by PLC)

FIG.7is a flowchart illustrating an outline of a routine which is performed by the PLC1as a whole. As illustrated inFIG.7, first, the CPU30sets a queue selection table121of the communication controller10in advance (S10). Thereafter, the CPU30sets (stores) a reception descriptor (that is, descriptor data) to the main memory20(S20). The CPU30notifies the communication controller10of completion of setting of a reception descriptor and permission of reception thereof (S30).

When a notification from the CPU30is received in S30, the communication controller10reads the reception descriptor stored in the main memory20into the communication controller10(S40), that is, stores the reception descriptor in the descriptor FIFO132of the reception queue13.

The communication controller10(particularly, the transfer control unit12) determines whether reception has started (S50), and waits until reception starts when start of reception has not been detected (NO in S50). When start of reception is detected (YES in S50), the transfer control unit12(particularly, the selection unit122) performs a “queue selecting process” (S60) and selects a reception queue13in which the received data (reception data) is to be stored.

The storage unit123stores the reception data in the data FIFO131of the reception queue13selected by the selection unit122in S60, and the reception queue13transfers the reception data stored in the data FIFO131to the main memory20(S70: transfer process).

(Details of Queue Selecting Process)

FIG.8is a flowchart illustrating a detailed example of the queue selecting process (S60) inFIG.7, that is, a flowchart illustrating an example of a queue selecting process which is performed by the transfer control unit12(particularly, the selection unit122).

As illustrated inFIG.8, first, the selection unit122acquires various types of information from a header part (a reception header) of reception data, and specifically acquires at least one of the “source address, the destination address, and the Ethernet frame type” of the reception data (S610).

The selection unit122sets a “condition number variable Num” to “1” (S620). The selection unit122acquires data (that is, a condition) corresponding to “condition=condition number variable Num” from the queue selection table121(S630).

For example, when “condition number variable Num=1,” the selection unit122acquires a condition corresponding to “Condition 1” from the queue selection table121, and acquires a condition “source address=addr_txa” when the queue selection table121is the same as illustrated in (A) ofFIG.5. Similarly, when “condition number variable Num=2,” the selection unit122acquires a condition corresponding to “Condition 2” from the queue selection table121, and acquires a condition “source address=addr_txb” when the queue selection table121is the same as illustrated in (A) ofFIG.5. When “condition number variable Num=n,” the selection unit122acquires a condition corresponding to “Condition n” from the queue selection table121, and acquires the following conditions when the queue selection table121is the same as illustrated in (A) ofFIG.5. That is, the selection unit122acquires “Condition n” that the “destination address is multicast (addr_rxa)” and the “frame type is !IPv4 (that is, other than IPv4).”

The selection unit122determines whether at least one of the “source address, the destination address, and the Ethernet frame type” of the reception data matches the condition acquired in S630(that is, satisfies the conditions) (S640).

When it is determined in S640that the at least one matches the conditions (YES in S640), the selection unit122selects RX0(S650), that is, selects the first reception queue13(0) (particularly, the first data FIFO131(0)) as the storage destination of the reception data.

When it is determined in S640that none matches the conditions (NO in S640), the selection unit122determines “whether the condition number variable Num matches Condition number: n” (S670). That is, the selection unit122determines “whether determination of S640has been performed” on all conditions from Condition 1 to Condition n defined in the queue selection table121.

When the “condition number variable Num matches Condition number: n (that is, the determination of S640has been performed on all the conditions defined in the queue selection table121)” (YES in S670), the selection unit122selects RX1(S680). That is, when it is determined that the “reception data satisfies none of the conditions defined in the queue selection table121,” the selection unit122selects the second reception queue13(1) (particularly, the second data FIFO131(1)) as the storage destination of the reception data.

When the “condition number variable Num does not match Condition number: n” (NO in S670), the selection unit122performs “condition number variable Num=condition number variable Num+1” (S660). That is, when “a condition for which the determination of S640has not been performed remains in the conditions defined in the queue selection table121,” the selection unit122sets the “condition number variable Num” to condition number variable Num+1 (a value obtained by adding 1 to the condition number variable Num).” Then, the selection unit122performs the steps of S630and subsequent thereto again.

(Details of Transfer Process)

FIG.9is a flowchart illustrating a detailed example of the transfer process (S70) inFIG.7, that is, a flowchart illustrating an example of a reception data transferring process which is performed by the storage unit123, the reception queue13selected by the selection unit122in S60, and the mediation unit14.

As illustrated inFIG.9, first, the storage unit123stores reception data in the data FIFO131of the reception queue13selected by the selection unit122in S60(S710). For example, when the first reception queue13(0) (that is, RX0) is selected by the selection unit122in S60, the storage unit123stores the reception data in the first data FIFO131(0) of the first reception queue13(0). Similarly, for example, when the second reception queue13(1) (that is, RX1) is selected by the selection unit122in S60, the storage unit123stores the reception data in the second data FIFO131(1) of the second reception queue13(1).

The reception queue13performs check for ascertaining that the “reception data stored in the data FIFO131is normal data” such as a data size and an error field of the reception data stored in the data FIFO131(S720). Then, the reception queue13determines “whether there is no abnormality” in the reception data stored in the data FIFO131(S730).

When “there is an abnormality” in the reception data stored in the data FIFO131(NO in S730), the reception queue13discards the reception data stored in the data FIFO131(S750) and ends this process.

When “there is no abnormality” in the reception data stored in the data FIFO131(YES in S730), the reception queue13acquires a reception descriptor with reference to the descriptor FIFO132(S740). For example, when the first reception queue13(0) (that is, RX0) is selected by the selection unit122in S60, the first reception queue13(0) acquires the reception descriptor stored in the head of the first descriptor FIFO132(0). Similarly, when the second reception queue13(1) (that is, RX1) is selected by the selection unit122in S60, the second reception queue13(1) acquires the reception descriptor stored in the head of the second descriptor FIFO132(1).

The reception queue13sets an address (a storage destination address in the main memory20) and a reception data size defined in the acquired reception descriptor in the DMAC133(S760). For example, when the first reception queue13(0) (that is, RX0) is selected by the selection unit122in S60, the first reception queue13(0) sets the address and the data size defined in the reception descriptor acquired in S740in the first DMAC133(0). Similarly, when the second reception queue13(1) (that is, RX1) is selected by the selection unit122in S60, the second reception queue13(1) sets the address and the data size defined in the reception descriptor acquired in S740in the second DMAC133(1).

The DMAC133set in S760and the mediation unit14perform a mediation process and a storage process (S770). When the mediation process and the storage process using the DMAC133and the mediation unit14are completed, the reception queue13prepares a write-back descriptor in which an end bit and log data are set (S780). Then, the reception queue13sets details defined in the prepared write-back descriptor in the DMAC133again.

The DMAC133in which details defined in the write-back descriptor are set and the mediation unit14perform the mediation process and the storage process again (S790). When the mediation process and the storage process of S790are completed, the reception queue13issues a transfer end interruption notification to the CPU30(S800).

Description made above with reference toFIGS.7,8, and9can be summarized as follows. That is, the control method which is performed by the communication controller10is a method for controlling a communication control device that stores reception data received from a network3in any one of a plurality of reception queues13to which different priorities NP have been given in advance to transfer the reception data to the main memory20. The control method which is performed by the communication controller10includes a queue selection process (a selection step, S60inFIG.7) and a storage step (S70inFIG.7, particularly, S710inFIG.9) of storing reception data in the reception queue13selected in the selection step.

In the selection step, a reception queue13in which the reception data is to be stored is selected out of the plurality of reception queues13with reference to a queue selection table121(reference table). Particularly, in the selection step, the reception queue13in which the reception data is to be stored is selected using at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data. In the queue selection table121, at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data to be stored is defined for at least one of the plurality of reception queues13as described above.

With this configuration, in the control method performed by the communication controller10, a reception queue13in which reception data is to be stored is selected using at least one of the “source address,” the “destination address,” and the “Ethernet frame type” of the reception data.

Here, all of the “source address,” the “destination address,” and the “Ethernet frame type” are original information of the reception data, but are not information which is newly added to select the reception queue13in which the reception data is to be stored.

Accordingly, the control method can store reception data in a desired reception queue13selected out of the plurality of reception queues13to which different priorities NP have been given in advance without using additional information indicating processing priorities P.

(Details of Mediation Process and Storage Process)

FIG.10is a flowchart illustrating a detailed example of the mediation process and the storage process (S770and S790) inFIG.9and specifically a flowchart illustrating an example of the mediation process performed by the mediation unit14and the storage process performed by the DMAC133.

As illustrated inFIG.10, the DMAC133in which details defined in a descriptor are set issues an access request to the mediation unit14(S771). Then, the DMAC133determines “whether an access has been permitted by the mediation unit14” (S772). When an access has not been permitted by the mediation unit14(NO in S772), the DMAC133waits until an access is permitted by the mediation unit14.

When an access has been permitted by the mediation unit14(YES in S772), the DMAC133stores data in the main memory20according to details defined in the descriptor (S773). For example, the DMAC133stores reception data stored in the data FIFO131in a predetermined address of the main memory20according to details defined in the reception descriptor, that is, transfers the reception data to the main memory20. For example, the DMAC133stores the updated reception descriptor with additional information added thereto in a write-back area of the main memory20according to details defined in the write-back descriptor. The DMAC133may overwrite details of the descriptor data stored in the main memory20with details of the updated reception descriptor according to the details defined in the write-back descriptor. The additional information included in the updated reception descriptor may indicate, for example, at least one of a size of reception data written to the address designated by the reception descriptor and an end determination flag indicating writing completion of the reception data.

Then, the DMAC133determines whether all data to be stored in the main memory20has been completely stored in the main memory20(S774). When all data to be stored in the main memory20has been completely stored in the main memory20(YES in S774), the DMAC133ends the process. When all data to be stored in the main memory20has not been completely stored in the main memory20(NO in S774), the processes of S771and subsequent thereto are performed on data of which storage in the main memory20has not been completed.

4. Modified Example

(Example of Network Configuration)

In the control system0illustrated inFIG.2, a plurality of networks3are connected to the PLC1via the network hub2. However, in the control system0, one network3may be connected to the PLC1without using the network hub2, for example, the PLC1and one or more network devices may be communicatively connected in a unicursal manner.

(Process of Generating Various Logs and Storage Destinations of Logs)

An example in which the “communication controller10includes the log generating unit16as a functional block” is illustrated inFIG.1, but the log generating unit16as a functional block may be included by the CPU30. That is, the CPU30may generate various logs such as the start time log, the order change log, and the end time log.

An example in which various logs such as the start time log, the order change log, and the end time log are stored in the nonvolatile memory40outside of the communication controller10is illustrated inFIG.1. However, these various logs do not have to be stored in the nonvolatile memory outside of the communication controller10. A nonvolatile memory may be provided inside of the communication controller10, and at least one of the various logs may be stored in the nonvolatile memory inside of the communication controller10.

A communication control device according to an aspect of the present invention is a communication control device that stores reception data received from a network in any one of a plurality of reception queues to which different priorities have been given in advance to transfer the reception data to a main memory, the communication control device including: a reference table in which at least one of a source address, a destination address, and an Ethernet frame type of the reception data to be stored is defined for at least one of the plurality of reception queues;

and a selection unit configured to select a reception queue in which the reception data is to be stored with reference to the reference table using at least one of the source address, the destination address, and the Ethernet frame type of the reception data.

With this configuration, the communication control device selects a reception queue in which reception data is to be stored out of the plurality of reception queues using at least one of the source address, the destination address, and the Ethernet frame type of the reception data.

Here, all of the source address, the destination address, and the Ethernet frame type are original information of the reception data, but are not information which is newly added to select the reception queue in which the reception data is to be stored.

Accordingly, the communication control device can store the reception data in a desired reception queue selected out of the plurality of reception queues to which different priorities have been given in advance without using additional information indicating processing priorities.

The communication control device according to the aspect of the present invention may generate a start time log which is a log in which a reception start time which is a time point at which reception of the reception data from the network has started and a transfer start time which is a time point at which transfer of the reception data to the main memory has started are correlated.

With this configuration, the communication control device generates the start time log in which the reception start time and the transfer start time of the reception data are correlated. Accordingly, the communication control device can enable data trace of the reception data including behavior in the communication control device using the start time log.

The communication control device according to the aspect of the present invention may generate an order change log indicating the number of times other reception data received after certain reception data has been received has been transferred to the main memory prior to the certain reception data.

With this configuration, the communication control device generates the order change log indicating the number of times other reception data received after certain reception data has been received has been transferred to the main memory prior to the certain reception data.

Accordingly, the communication control device can enable using the order change log as an index indicating occurrence of data contention such as “reception data received subsequently to previously received reception data is earlier transferred to the main memory.”

The communication control device according to the aspect of the present invention may generate an end time log which is a log in which a reception end time which is a time point at which reception of the reception data from the network has ended and a transfer end time which is a time point at which transfer of the reception data to the main memory has ended are correlated.

With this configuration, the communication control device generates the end time log in which the reception end time and the transfer end time of the reception data are correlated. Accordingly, the communication control device can enable data trace of the reception data including behavior in the communication control device using the end time log.

In the communication control device according to the aspect of the present invention, the reception end time may be calculated on the basis of a reception start time which is a time point at which reception of the reception data from the network has started, a data rate of the network, and a data size of the reception data, and the transfer end time may be calculated on the basis of a transfer start time which is a time point at which transfer of the reception data to the main memory has started, a transfer rate to the main memory, and the data size of the reception data.

With this configuration, the communication control device calculates the reception end time and the transfer end time. Accordingly, the communication control device can monitor entire communication of the reception data using the reception start time, the transfer start time, the calculated reception end time, and the calculated transfer end time.

In the communication control device according to the aspect of the present invention, the selection unit may select a reception queue in which the reception data is to be stored out of the plurality of reception queues with reference to the reference table using only the source address of the reception data.

With this configuration, the communication control device selects a reception queue in which the reception data is to be stored out of the plurality of reception queues with reference to the reference table using only the source address of the reception data. Accordingly, the communication control device can store the reception data in the desired reception queue selected out of the plurality of reception queues to which different priorities have been given in advance using only the source address of the reception data.

In the communication control device according to the aspect of the present invention, the reference table may be generated using various setting information which is defined for the network by a user and which includes configuration information of the network.

With this configuration, the communication control device selects a reception queue in which the reception data is to be stored with reference to the reference table generated using various setting information which are defined for the network by a user and which include configuration information of the network.

For example, a control device including the communication control device may ascertain whether there is a device of which necessity for maintaining a communication cycle is set to be higher than that of other devices (a high-priority device) in devices that periodically communicate with the control device via the network in the various setting information. When a high-priority device is defined in the various setting information, the control device generates or updates the reference table such that reception data with the high-priority device as a source address is stored in a reception queue to which a high priority has been given.

Similarly, when necessity for maintaining a communication cycle with respect to a certain device group is set to be higher than that with respect to other device groups in the various setting information, the control device may generate or update the reference table as follows. That is, the control device may generate or update the reference table such that reception data with a device included in the certain device group as a source address is stored in a first reception queue to which a higher priority than that of a second reception queue has been given. The control device may generate or update the reference table such that reception data with a device included in the other device group as a source address is stored in a second reception queue to which a lower priority than that of the first reception queue has been given.

When a communication priority of communication with a certain destination address is defined to be higher than that of communication with other destination addresses in the various setting information, the control device may generate or update the reference table as follows. That is, the control device may generate or update the reference table such that reception data with the certain destination address as a destination address is stored in a first reception queue to which a higher priority than that of a second reception queue has been given. The control device may generate or update the reference table such that reception data with the other destination address as a destination address is stored in a second reception queue to which a lower priority than that of the first reception queue has been given.

When a processing priority of reception data of a certain frame type is defined to be higher than that of reception data of another frame type in the various setting information, the control device may generate or update the reference table as follows. That is, the control device may generate or update the reference table such that reception data of the certain frame type is stored in a first reception queue to which a higher priority than that of a second reception queue has been given. The control device may generate or update the reference table such that reception data of the other frame type is stored in a second reception queue to which a lower priority than that of the first reception queue has been given.

Accordingly, the communication control device can appropriately select a reception queue in which the reception data is to be stored with reference to the generated reference table without causing a user to labor two times.

In the communication control device according to the aspect of the present invention, the start time log may be stored in a nonvolatile memory inside or outside of the communication control device.

With this configuration, the communication control device stores the start time log in a nonvolatile memory inside or outside of the communication control device. Accordingly, the communication control device can appropriately store the start time log in a nonvolatile memory inside or outside of the communication control device such that the start time log can be easily used.

A control method according to another aspect of the present invention is a method for controlling a communication control device that stores reception data received from a network in any one of a plurality of reception queues to which different priorities have been given in advance to transfer the reception data to a main memory, the method including: a selection step of selecting a reception queue in which the reception data is to be stored out of the plurality of reception queues using at least one of a source address, a destination address, and an Ethernet frame type of the reception data with reference to a reference table in which at least one of the source address, the destination address, and the Ethernet frame type of the reception data to be stored is defined for at least one of the plurality of reception queues; and a storage step of storing the reception data in the reception queue selected in the selection step.

With this configuration, the control method includes selecting a reception queue in which reception data is to be stored out of the plurality of reception queues using at least one of the source address, the destination address, and the Ethernet frame type of the reception data.

Here, all of the source address, the destination address, and the Ethernet frame type are original information of the reception data, but are not information which is newly added to select the reception queue in which the reception data is to be stored.

Accordingly, the control method can enable storing the reception data in a desired reception queue selected out of the plurality of reception queues to which different priorities have been given in advance without using additional information indicating processing priorities.

The present invention is not limited to the aforementioned embodiments and can be modified in various forms within the scope described in the appended claims. Embodiments which are obtained by appropriately combining technical means described above in different embodiments are included in the technical scope of the present invention.

REFERENCE SIGNS LIST