Communication device, communication system, communication control method, and program
By allocating time slots in the communication device, the slave device is allowed to independently process the secondary data in a short period, which solves the problem of difficulty in periodically transmitting or receiving secondary data in the existing technology, improves the utilization efficiency of the communication frequency band, and is suitable for industrial use Timing and real-time requirements of the network.
Patent Information
- Application Number
- CN202080089220.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-12-25
- Filing Date
- 2020-12-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-10
AI Technical Summary
It is difficult for existing communication devices to periodically transmit or receive secondary data from connected devices, and there is a problem of low communication band utilization efficiency.
By providing a processing unit in the communication device, performing communication processing and setting processing, transmitting a main frame including main data to the slave device, and allocating time slots in a second cycle shorter than the main cycle, the slave device is allowed to be Send or receive secondary data independently in two cycles.
It makes it easy to periodically send or receive auxiliary data in an industrial network, improves the utilization efficiency of communication frequency bands, and meets the timing and real-time requirements of industrial networks.
Smart Images

Figure CN114868366B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to a communication device, a communication system, a communication control method, and a program. More specifically, the present disclosure relates to a communication device, a communication system, a communication control method, and a program for communicating with one or more slave devices. Background Art
[0002] Patent document 1 discloses a communication device connected to a network that updates data at predetermined intervals. The communication device includes a first scheduling unit and a second scheduling unit. The first scheduling unit is used to ensure a first communication frequency band required for updating first data used in controlling a manufacturing device or a production device at predetermined intervals. The second scheduling unit is used to ensure a second communication frequency band required for the second data to reach a destination within a specified time in a communication frequency band other than the first communication frequency band among the communication frequency bands possessed by the network.
[0003] In the communication device described in Patent Document 1, the second data (sub-data) can be transmitted using an idle frequency band other than the communication frequency band required for the communication of the first data (primary data). However, in the communication device, there is a problem that it is difficult to periodically transmit or receive, or transmit and receive, the second data (sub-data) in a device (slave device) connected to the communication device.
[0004] Prior art literature
[0005] Patent Literature
[0006] Patent Document 1: Japanese Patent Application Publication No. 2018-64245 Summary of the invention
[0007] The present disclosure has been made in view of the above-mentioned aspects, and an object of the present disclosure is to provide a communication device, a communication system, a communication control method, and a program that can easily transmit or receive sub-data periodically in a slave device connected to the communication device.
[0008] A communication device according to one embodiment of the present disclosure includes: a processing unit; and a communication unit that communicates with one or more slave devices. The processing unit has a function of performing communication processing and setting processing. The communication processing is a process in which a master frame including master data is sent from the communication unit to the one or more slave devices in a first cycle. The setting processing is a process in which a second cycle shorter than the first cycle and a time slot allocated to at least one of the one or more slave devices in each of the second cycles is set.
[0009] A communication system according to another aspect of the present disclosure includes the above-mentioned communication device and the above-mentioned one or more slave devices. The one or more slave devices are connected to the communication device to communicate with the communication device.
[0010] A communication control method according to another embodiment of the present disclosure includes a communication step and a setting step. The communication step includes sending a master frame including master data to one or more slave devices connected to a communication device in a first cycle. The setting step includes setting a second cycle shorter than the first cycle and a time slot allocated to at least one of the one or more slave devices in each of the second cycles.
[0011] A program according to another aspect of the present disclosure causes one or more processors to execute the above-mentioned communication control method.
[0012] The present disclosure has the following advantages: it is easy to periodically transmit or receive, or transmit and receive, sub data in a slave device connected to a communication device. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a block diagram showing an overview of a communication system including a communication device according to an embodiment of the present disclosure.
[0014] Figure 2 This is an explanatory diagram of the communication processing and the split communication processing performed by the same communication device.
[0015] Figure 3 This is a flowchart of the setting process performed by the same communication device as above.
[0016] Figure 4 This is a diagram for explaining communication processing performed by a communication device according to a comparative example. DETAILED DESCRIPTION
[0017] (1) Summary
[0018] Figure 1 1 is a block diagram showing an overview of a communication system 100 including a communication device 1 according to an embodiment of the present disclosure. Figure 1 As shown, the communication device 1 of this embodiment is connected to one or more (here n ("n" is a natural number)) slave devices 2 connected to the communication device 1 directly or via a network to form a communication system 100. That is, the communication device 1 is a master device equivalent to a host device of one or more slave devices 2. The communication device 1 and the one or more slave devices 2 are connected to the same network. That is, the communication system 100 includes the communication device 1 and one or more slave devices 2. Moreover, the one or more slave devices 2 are connected to the communication device 1 to communicate with the communication device 1.
[0019] In this embodiment, the communication device 1 and one or more slave devices 2 are connected to an industrial network. The "industrial network" referred to in this disclosure is, for example, a field network used in factory automation, which is used to communicate between multiple devices installed in a factory. As an example, an industrial network may include Ethernet / IP (registered trademark), EtherCAT (registered trademark) or PROFINET (registered trademark), etc. As an example, devices connected to the industrial network may include controllers (for example, PLC (Programmable Logic Controller)), sensors (for example, displacement sensors, flow meters, pressure gauges, image sensors, etc.) or remote I / O (Input / Output), etc. In addition, as an example, devices connected to the industrial network may include servo amplifiers, inverters, robots, actuators or valves, etc.
[0020] Compared to the standard best-effort networks used in offices, etc., industrial networks require robustness, timing, and real-time performance. For example, in industrial networks, when control data is periodically sent from a controller to a controlled device such as a servo amplifier, no delay is allowed compared to best-effort networks. In addition, the response speed to control data is required to be faster.
[0021] like Figure 1 As shown, the communication device 1 of this embodiment includes a processing unit 11 and a communication unit 12. The communication unit 12 is a communication interface for communicating with one or more slave devices 2. The processing unit 11 has a function of executing communication processing and setting processing.
[0022] Figure 2 It is an explanatory diagram of the communication processing and the split communication processing performed by the communication device 1 involved in the embodiment of the present disclosure. The communication processing is a process of sending the main frame F1 containing the main data from the communication unit 12 to one or more slave devices 2 in the first period CT1. That is, the communication device 1 sends the main data to the one or more slave devices 2 in the first period CT1 by performing the communication processing. For example, if the communication device 1 is a controller and the one or more slave devices 2 are devices such as servo amplifiers as the control objects, the main data may include control data for controlling the slave devices 2. As an example, the first period CT1 is a few tenths of a ms to a few ms. When receiving the main data, each slave device 2 performs processing corresponding to the received main data. For example, when the main data contains one or more control data corresponding to each of the one or more slave devices 2, each slave device 2 obtains the corresponding control data contained in the main data when receiving the main data, and performs processing corresponding to the obtained control data.
[0023] The setting process is to set the second cycle CT2 shorter than the first cycle CT1 (refer to Figure 2 ), and time slot S0 (refer to Figure 2 ) processing. In each second cycle CT2, the time slot S0 is allocated to at least one of the one or more slave devices 2. The time slot S0 set in the setting process is included in at least the subframe F2 (refer to Figure 2 ). The sub-frame F2 is a frame transmitted from the communication device 1 at the second period CT2 set in the setting process, and its transmission time is shorter than the transmission time of the main frame F1. In addition, the second period CT2 is longer than the transmission time of the sub-frame F2. Each slave device 2 can obtain the data contained in the corresponding time slot S0, or use the corresponding time slot S0 to send data to other devices (communication device 1 or other slave devices 2).
[0024] As described above, the slave device 2 to which the time slot S0 is assigned by the setting process can periodically receive the sub-data using the time slot S0 in each second cycle CT2 separately from the main data transmitted in the first cycle CT1. The slave device 2 to which the time slot S0 is assigned by the setting process can periodically transmit the sub-data using the time slot S0 in each second cycle CT2 separately from the main data. That is, in this embodiment, there is an advantage that it is easy to periodically transmit or receive or transmit and receive the sub-data in the slave device 2 connected to the communication device 1.
[0025] (2) Details
[0026] Below, use Figure 1 A communication system 100 having a communication device 1 is described in detail. The communication device 1 is connected to a plurality of (here, n) slave devices 2. A plurality of slave devices 2 (in other words, more than one slave device 2) are connected to the communication device 1 in a daisy chain manner. Specifically, the first slave device 21, the second slave device 22, the third slave device 23, ..., the nth slave device 2n are connected to the communication device 1 in a ring in sequence. Therefore, a frame (for example, a main frame F1) sent from the communication device 1 is transmitted in the order of the first slave device 21, the second slave device 22, the third slave device 23, ..., the nth slave device 2n, and the communication device 1.
[0027] In the communication system 100, one of the plurality of slave devices 2 is a sensor, and the remaining slave devices 2 are servo amplifiers. In other words, at least one of the one or more slave devices 2 is a motor driving device for driving a motor. In the communication system 100, the communication device 1 is a controller that controls the plurality of slave devices 2 (that is, the plurality of servo amplifiers and sensors) individually or as a whole.
[0028] The communication device 1 includes a processing unit 11 and a communication unit 12. In the communication device 1, data is stored in a memory included in the processing unit 11, but a storage unit may be included separately from the processing unit 11. As an example, the storage unit is an electrically erasable nonvolatile memory such as an EEPROM (Electrically Erasable Programmable Read-Only Memory), a volatile memory such as a RAM (Random Access Memory), etc.
[0029] The processing unit 11 includes, for example, a computer system. The computer system is mainly composed of a processor and a memory as hardware. The function of the processing unit 11 is realized by the processor executing the program recorded in the memory of the computer system. The program can be pre-recorded in the memory of the computer system, or provided through an electrical communication line, or recorded in a non-temporary recording medium such as a memory card, an optical disk, a hard disk drive, etc. that can be readable by the computer system. In addition, at least a part or the whole of the communication unit 12 may be integrally formed with a part or the whole of the processing unit 11. For example, the communication unit 12 includes a computer system. In this structure, the function of the processing unit 11 can also be realized by executing a program in the computer system in the communication unit 12.
[0030] The communication unit 12 is a communication interface for communicating with a plurality of slave devices 2, and has, for example, a wired communication module based on the industrial Ethernet (registered trademark) protocol. The communication unit 12 sends frames (main frame F1 and sub-frame F2) to the slave device 2 ( Figure 1 The communication unit 12 receives the data from the slave device 2 (the first slave device 21) at the last stage directly connected to the communication device 1. Figure 1 Frames (main frame F1 and sub-frame F2) are sent by the communication unit 202 of the n-th slave device 2n).
[0031] The processing unit 11 has the function of executing communication processing (main communication processing), split communication processing, and setting processing. Hereinafter, in order to distinguish the communication processing (main communication processing) from the split communication processing, the communication processing is referred to as the main communication processing. The setting processing is a processing performed before the communication system 100 including the communication device 1 is operated. Both the main communication processing and the split communication processing are processing performed during the operation of the communication system 100 including the communication device 1.
[0032] The main communication process is a process of sending a main frame F1 from the communication unit 12 to the plurality of slave devices 2 in the first cycle CT1. The first cycle CT1 is preset by the communication device 1. In the present embodiment, the communication device 1 sends the main frame F1 to the first slave device 21, thereby transmitting the main frame F1 in the order of the first slave device 21, the second slave device 22, the third slave device 23, ..., the nth slave device 2n.
[0033] like Figure 2 As shown, the main frame F1 includes a header D100, a main data area D1, a sub-data area D2, and a footer D101. The header D100 includes an identifier for identifying that a frame received by each slave device 2 is the main frame F1.
[0034] The master data area D1 is divided into a plurality of (here, n) time slots D11, D12, ..., D1n. The plurality of time slots D11, D12, ..., D1n are respectively allocated to a plurality of slave devices 21, 22, ..., 2n.
[0035] The slave device 2 receiving the master frame F1 can use the allocated time slot in the master data area D1 to obtain the master data from the communication device 1. The master data may include control data of each slave device 2 sent from the communication device 1 to each slave device 2. The master data may include response data to the control data of each slave device 2.
[0036] The sub-data area D2 is divided into a plurality of (here, n) time slots D21, D22, ..., D2n. The plurality of time slots D21, D22, ..., D2n are all equivalent to the time slot S0 set by the setting process, and the plurality of time slots are respectively allocated to the plurality of slave devices 21, 22, ..., 2n. That is, the main frame F1 includes the time slot S0. The time slot S0 is set by the setting process.
[0037] The slave device 2 receiving the master frame F1 can obtain the secondary data contained in the allocated time slot S0 in the secondary data area D2, or use the time slot S0 to send the secondary data to other devices (communication device 1 or other slave devices 2). The secondary data may include various data sent from the slave device 2 to other slave devices 2. That is, the time slot S0 is used for communication between more than one slave device 2.
[0038] The split communication process is a process of sending a sub-frame F2 from the communication unit 12 to a plurality of slave devices 2 in a second cycle CT2. The second cycle CT2 is shorter than the first cycle CT1, and the second cycle CT2 is set by the setting process. The sub-frame F2 includes a header D200, a sub-data area D2, and a footer D201. The header D200 includes an identifier for identifying that the frame received by each slave device 2 is a sub-frame F2.
[0039] like Figure 2 As shown, first, the processing unit 11 of the communication device 1 performs the main communication process in the first cycle CT1 to transmit the main frame F1 from the communication unit 12. Thereafter, the processing unit 11 of the communication device 1 performs the split communication process in the first cycle CT1 to transmit the sub-frame F2 from the communication unit 12 every second cycle CT2.
[0040] Here, in the present embodiment, the processing unit 11 updates the master data every first cycle CT1. Specifically, the processing unit 11 generates the master data included in the next master frame F1 during the period after the master frame F1 is sent until the next master frame F1 starts to be sent. That is, the processing unit 11 generates the master data to prepare the master frame F1 during a period shorter than the first cycle CT1. As an example, when generating the master data, the processing unit 11 refers to the instruction information from the upper system as the communication device 1, and the response information received from each slave device 2. For example, the processing unit 11 generates the control data (master data) for controlling each servo amplifier (each slave device 2) by referring to the detection information received from the sensor (slave device 2). Therefore, the first cycle CT1 needs to be set to a degree that can perform the processing for generating the master data, which depends on the processing performance of the processing unit 11.
[0041] The setup process is a process for setting the second cycle CT2 and time slot S0 used in the main communication process and the split communication process. In other words, the main communication process and the split communication process are performed based on the parameters set in the setup process. The second cycle CT2 is shorter than the first cycle CT1. The processing unit 11 sets the second cycle CT2 based on the transmission time (maximum transmission time Mt) of the main frame F1 as described later. In addition, the second cycle CT2 is longer than the maximum transmission time Mt. In each second cycle CT2, the time slot S0 is allocated to the slave device 2. The processing unit 11 allocates the time slot S0 to all the slave devices 2. The time slot S0 allocated to each slave device 2 in the setup process constitutes the above-mentioned sub-data area D2. The setup process is described in detail in "(3) Setup Process" described later. In addition, the time slot length of the time slot S0 allocated to each slave device 2 may also be different depending on the data size.
[0042] The slave device 2 includes a processing unit 201 and a communication unit 202. In the slave device 2, data is stored in a memory included in the processing unit 201, but a storage unit may be included separately from the processing unit 201. As an example, the storage unit is an electrically erasable nonvolatile memory such as an EEPROM, a volatile memory such as a RAM, or the like.
[0043] The processing unit 201 includes, for example, a computer system. The computer system is mainly composed of a processor and a memory as hardware. The processor executes a program recorded in the memory of the computer system to realize the function of the processing unit 201. The program can be pre-recorded in the memory of the computer system, or provided through an electrical communication line, or recorded in a non-temporary recording medium such as a memory card, an optical disk, a hard disk drive, etc. that can be read by the computer system.
[0044] The processing unit 201 has a function of executing a process based on corresponding data (here, control data) in the main data received by the communication unit 202. In addition, the processing unit 201 has a function of executing a process based on corresponding data in the sub-data received by the communication unit 202. The processing unit 201 has a function of executing a process of transmitting the sub-data to other devices using the allocated time slot S0 in the sub-data area D2 of the received main frame F1 or sub-frame F2.
[0045] The communication unit 202 is a communication interface for communicating with the communication device 1 or other slave devices 2, and has, for example, a wired communication module based on the industrial Ethernet (registered trademark) protocol. The communication unit 202 receives a frame (main frame F1 and sub-frame F2) sent from the communication unit 12 of the communication device 1 located at the previous stage directly connected to the slave device 2 or the communication unit 202 of the slave device 2. The communication unit 202 sends the received frame (main frame F1 and sub-frame F2) to the communication unit 12 of the communication device 1 located at the subsequent stage directly connected to the slave device 2 or the communication unit 202 of the slave device 2. As an example, the communication unit 202 of the first slave device 21 receives a frame sent from the communication unit 12 of the communication device 1, and sends the received frame to the communication unit 202 of the second slave device 22. At this time, the communication unit 202 of the first slave device 21 may also appropriately update the received frame and send it.
[0046] (3) Setting process
[0047] Below, use Figure 3 The setting process executed by the processing unit 11 of the communication device 1 according to the present embodiment will be described in detail. Figure 3 This is a flowchart of a setting process performed by the communication device 1 according to the embodiment of the present disclosure.
[0048] For example, before the communication system 100 is operated, the processing unit 11 executes a setting process by a user performing a predetermined operation using a user interface provided in the communication device 1. Before executing the setting process, the user inputs setting data required for executing the setting process into the communication device 1 using the user interface.
[0049] The setting data includes the total data size of the main data, the total data size of the sub data, and the minimum communication cycle CT.min The total data size of the main data is the sum of the data sizes of the main data that can be received by each slave device 2. The total data size of the sub-data is the sum of the data sizes of the sub-data that can be sent or received or sent and received by each slave device 2. The minimum communication cycle CT min It is the minimum communication cycle allowed for communication between the communication device 1 and one or more slave devices 2 .
[0050] Alternatively, when the communication device 1 sends an initialization frame to each slave device 2 after establishing communication between the communication device 1 and each slave device 2, the communication device 1 acquires the setting data from each slave device 2. That is, in response to the initialization frame, the communication device 1 acquires the setting data from each slave device 2. In this case, it is assumed that the setting data is set in advance in each slave device 2, for example, by inputting the setting data by a user.
[0051] In the setting process, when the setting data is input (step ST1), the processing unit 11 first calculates the maximum transmission time Mt of the main frame F1 using the setting data (step ST2). Specifically, the processing unit 11 calculates the maximum transmission time Mt of the main frame F1 by performing calculations based on the following formula (1).
[0052] [Number 1].
[0053]
[0054] In the above formula (1), "Sh" represents the data size of the header of the main frame F1, "Sm" represents the total data size of the main data, "Ss" represents the total data size of the sub-data, and "Sf" represents the data size of the tail of the main frame F1. In the above formula (1), "Tr" represents the transmission rate, "n" represents the number of devices (communication device 1 and slave device 2) belonging to the communication system 100, "Td1" represents the delay time of each device, and "Td2" represents the delay time of the communication system 100 as a whole.
[0055] In the setting process, the processing unit 11 then sets the maximum transmission time Mt and the minimum communication cycle CT min Specifically, the processing unit 11 compares the sum of the maximum transmission time Mt and the margin time α taking jitter into consideration with the minimum communication cycle CT. min When the sum of the maximum transmission time Mt and the margin time α is less than the minimum communication cycle CT min In the case of (“Yes” in step ST3), the processing unit 11 sets the minimum communication cycle CT minOn the other hand, in the communication cycle CT where the sum of the maximum transmission time Mt and the margin time α is the smallest, min In the above case (No in step ST3 ), the processing unit 11 sets the second cycle CT2 by performing calculation based on the following equation (2).
[0056] [Number 2]
[0057]
[0058] In the above formula (2), "β" is the number of divisions. The number of divisions β is a quotient calculated by dividing the first cycle CT1 by the sum of the maximum transmission time Mt and the margin time α. That is, in the setting process, the processing unit 11 calculates the number of divisions β (step ST5), and uses the calculated number of divisions β to calculate the second cycle CT2 (step ST6).
[0059] Thus, in the setting process, the processing unit 11 calculates the transmission time (maximum transmission time Mt) of the master frame F1 based on at least the first cycle CT1, the number of at least one slave device 2, and the data size of the master data. Then, the processing unit 11 sets the second cycle CT2 based on the calculated transmission time (maximum transmission time Mt). In particular, as described above, when the sum of the maximum transmission time Mt and the margin time α is less than the minimum communication cycle CT min In the case of min That is, in the setting process, the processing unit 11 sets the minimum communication cycle CT allowed for communication with one or more slave devices 2 to min Set to the second cycle CT2.
[0060] In the setting process, the processing unit 11 then sets the sub-data area D2 to be transmitted from the communication unit 12 in each set second cycle CT2 (step ST7). In other words, the processing unit 11 allocates the time slot S0 to each slave device 2. In the present embodiment, the processing unit 11 allocates the time slots D21, D22, ..., D2n to the slave devices 21, 22, ..., 2n, respectively, as the time slot S0.
[0061] A specific example of the setting process is described below. In the following description, it is assumed that the first cycle CT1 is 500 μs. In addition, in the following description, it is assumed that the communication system 100 has three slave devices 2 (a first slave device 21, a second slave device 22, and a third slave device 23). That is, in the following description, the number n of devices (communication device 1 and slave device 2) belonging to the communication system 100 is four. Furthermore, in the following description, it is assumed that the transmission rate Tr is 100 Mbps, the delay time Td1 of each slave device 2 is 3 μs, the delay time Td2 of the communication system 100 as a whole is 1.5 μs, and the margin time α is 3 μs.
[0062] First, a case where the setting data of each slave device 2 is the data shown in the following Table 1 will be described.
[0063] [Table 1]
[0064]
[0065] In this case, the total data size Sm of the main data is 80 (= 32 + 16 + 32) bytes, and the total data size Ss of the sub-data is 16 (= 4 + 4 + 8) bytes, so the maximum transmission time Mt is calculated as 24.36 μs according to formula (1). In addition, in this case, among the communication cycles that all the slave devices 21, 22, and 23 can support, the communication cycle that the first slave device 21 and the third slave device 23 can support is the longest, so the minimum communication cycle CT is set to min Therefore, since the sum of the maximum transmission time Mt and the margin time α (24.36μs+3μs=27.36μs) is less than the minimum communication cycle CT min (31.25 μs), so the processing unit 11 sets the minimum communication cycle CT min (31.25 μs) is set as the second period CT2.
[0066] Next, a case where the setting data of each slave device 2 is the data shown in the following Table 2 will be described.
[0067] [Table 2]
[0068]
[0069] In this case, the total data size Sm of the main data is 160 (= 64 + 64 + 32) bytes, and the total data size Ss of the sub-data is 44 (= 8 + 4 + 32) bytes, so the maximum transmission time Mt is calculated as 33 μs according to formula (1). In addition, in this case, among the communication cycles that all the slave devices 21, 22, and 23 can support, the communication cycle that the first slave device 21 and the third slave device 23 can support is the longest, so the minimum communication cycle CT is set tomin Therefore, the sum of the maximum transmission time Mt and the margin time α (33μs+3μs=36μs) is greater than the minimum communication cycle CT. min (31.25μs), the processing unit 11 calculates the number of divisions β, calculates the second period CT2 based on the calculated number of divisions β, and sets the second period CT2. Here, the number of divisions β is the quotient calculated by dividing the first period CT1 (500μs) by the sum of the maximum transmission time Mt and the margin time α (36μs), and is therefore calculated as "13". Therefore, the second period CT2 is calculated as 38.46μs according to formula (2).
[0070] Here, when the calculated second period CT2 is inconsistent with the integer multiple of the communication period that each slave device 2 can support, the second period CT2 is set to a value greater than the calculated second period CT2 and an integer multiple of the communication period that each slave device 2 can support. Here, the second period CT2 is set to 62.5 μs, which is twice the communication period 31.25 μs that each slave device 2 can support. In addition, when there are multiple slave devices 2 that can support different communication periods, the least common multiple of the communication periods that each slave device 2 can support is set as the second period CT2.
[0071] The advantages of the communication device 1 of this embodiment are described below in comparison with the communication device of the comparative example. The communication device of the comparative example does not have the function of performing the split communication process and the setting process, that is, it is different from the communication device 1 of this embodiment in that the time slot S0 is not allocated in each second cycle CT2. Figure 4 As shown in FIG. 1 , when the sub-data different from the main data is transmitted from the communication device 1 or the slave device 2, the communication device of the comparative example transmits the sub-frame F200 including the sub-data area D2 through the free area CT10 in the first cycle CT1 except the main frame F100. However, in the communication device of the comparative example, the second cycle CT2 is not set, and therefore the timing of transmitting the sub-frame F200 is not specified, so the sub-data cannot be transmitted periodically. Therefore, in the communication device of the comparative example, it is difficult to perform periodic communication of the sub-data different from the main data that can withstand the use in the industrial network.
[0072] On the other hand, in the communication device 1 of the present embodiment, the slave device 2 to which the time slot S0 is assigned by the setting process can periodically receive the sub-data using the time slot S0 in each second cycle CT2 separately from the main data sent in the first cycle CT1. In addition, the slave device 2 to which the time slot S0 is assigned by the setting process can periodically send the sub-data using the time slot S0 in each second cycle CT2 separately from the main data. That is, in the present embodiment, there is an advantage that it is easy to periodically send or receive or send and receive sub-data in the slave device 2 connected to the communication device 1. Therefore, in the present embodiment, there is an advantage that it is easy to perform periodic communication that can withstand use in an industrial network not only for the main data but also for the sub-data.
[0073] (4) Modification
[0074] The above-mentioned embodiment is only one of various embodiments of the present disclosure. As long as the purpose of the present disclosure can be achieved, the above-mentioned embodiment can be changed in various ways according to the design, etc. In addition, the same function as the communication device 1 can also be specifically implemented by a communication control method, a (computer) program, or a non-temporary recording medium having a program recorded thereon, etc.
[0075] A communication control method according to one embodiment includes a communication step and a setting step. The communication step is a step of transmitting a master frame F1 including master data to one or more slave devices 2 connected to a communication device 1 in a first cycle CT1. The setting step is a step of setting a second cycle CT2 shorter than the first cycle CT1 and a time slot S0 allocated to at least one of the one or more slave devices 2 in each second cycle CT2. In addition, a program according to one embodiment causes one or more processors to execute the communication control method described above.
[0076] Modifications of the above-described embodiment are listed below. The modifications described below can be combined as appropriate and applied.
[0077] The communication device 1 of the present disclosure, for example, includes a computer system in the processing unit 11. The computer system is mainly composed of a processor and a memory as hardware. The function of the processing unit 11 of the present disclosure is realized by executing the program recorded in the memory of the computer system by the processor. The program can be pre-recorded in the memory of the computer system, or provided through an electrical communication line, or recorded in a non-temporary recording medium such as a memory card, an optical disk, a hard disk drive, etc. that can be read by the computer system. The processor of the computer system is composed of one or more electronic circuits including a semiconductor integrated circuit (IC) or a large-scale integrated circuit (LSI). The integrated circuits such as IC or LSI mentioned here are called differently according to the degree of integration, including integrated circuits called system LSI, VLSI (Very Large Scale Integration) or ULSI (Ultra Large Scale Integration). In addition, an FPGA (Field-Programmable Gate Array) that is programmed after the LSI is manufactured, or a logic device that can reconstruct the bonding relationship inside the LSI or reconstruct the circuit partition inside the LSI, can also be used as a processor. A plurality of electronic circuits may be integrated into one chip or may be dispersedly arranged in a plurality of chips. A plurality of chips may be integrated into one device or may be dispersedly arranged in a plurality of devices. The computer system mentioned herein includes a microcontroller having one or more processors and one or more memories. Thus, the microcontroller may also be composed of one or more electronic circuits including semiconductor integrated circuits or large-scale integrated circuits.
[0078] In addition, it is not necessary for the processing unit 11 to integrate multiple functions in the processing unit 11 into one frame. The structural elements of the processing unit 11 may also be dispersedly provided in multiple frames. In addition, at least a part of the functions of the processing unit 11 may also be implemented by, for example, a server device and a cloud (cloud computing). On the contrary, as in the above-mentioned embodiment, all the functions of the processing unit 11 may also be integrated into one frame.
[0079] In the above-mentioned embodiment, when a slave device 2 that can support a longer communication cycle belongs to the communication system 100 during the setting process, the processing unit 11 of the communication device 1 may also make the communication cycle that the slave device 2 can support consistent with the communication cycle that other slave devices 2 can support. That is, the communication cycle that the slave device 2 can support is, for example, a cycle required for executing a process with a large processing load, such as a process of generating and sending data. Therefore, in the case of executing a process with a small processing load, such as a process of only acquiring data, the communication cycle that the slave device 2 can support can also be set to be short. In this way, by making the communication cycle that the slave device 2 can support consistent with the communication cycle that other slave devices 2 can support, as a result, the minimum communication cycle CT can be set. min In other words, the minimum communication cycle CT min Can be set arbitrarily.
[0080] In the above-mentioned embodiment, the time slot S0 may also have a certain degree of deviation based on the specified time. That is, it is preferred that the deviation of the time slot S0 at least converges to a time shorter than the second cycle CT2. Specifically, in the second cycle CT2 of the main frame F1, as long as the slave device 2 can complete the reception of the time slot S0 before the end of the second cycle CT2, the timing of starting the transmission of the time slot S0 can be any timing. For example, even if the end timing of the main data area D1 is later than Figure 2 In the case of the example shown, as long as the reception of the time slot S0 in each slave device 2 is completed before the end of the second cycle CT2, a deviation in the timing of starting the transmission of the time slot S0 is allowed.
[0081] In the setting process of the above-mentioned embodiment, when there are multiple slave devices 2 that can support different communication cycles, the lowest common multiple of the supportable communication cycles is set as the second cycle CT2, but it is not limited to this. For example, it is also possible that not all of the multiple slave devices 2 are set as the allocation objects of the time slot S0, but some of the slave devices 2 are set as the allocation objects of the time slot S0. For example, if only one slave device 2 among the multiple slave devices 2 is set as the allocation object of the time slot S0, the second cycle CT2 is set as the communication cycle that the slave device 2 can support.
[0082] In the setting process of the above-described embodiment, even if the calculated second cycle CT2 does not coincide with an integral multiple of the communication cycle that each slave device 2 can support, the calculated second cycle CT2 may be directly set as the second cycle CT2.
[0083] In the above embodiment, the slave device 2 is not limited to the motor drive device, but may be other devices such as sensors. In addition, in the above embodiment, the plurality of slave devices 2 may not include the motor drive device. For example, all the slave devices 2 may be sensors.
[0084] In the above-mentioned embodiment, there may be only one slave device 2 belonging to the communication system 100. In this embodiment, the communication device 1 can generate main data in each first cycle CT1 and acquire sub data transmitted from the slave device 2 in the second cycle CT2.
[0085] In the above embodiment, the communication device 1 uses a wired communication module to communicate with each slave device 2 in a wired manner, but the present invention is not limited thereto. For example, the communication device 1 may also use a wireless communication module to communicate with each slave device 2 in a wireless manner.
[0086] In the above-mentioned embodiment, the processing unit 201 of the slave device 2 may use, for example, the free area CT10 (excluding the main frame F1 or the sub-frame F2) in the second cycle CT2. Figure 2 Reference), to send other data other than the sub-data from the communication unit 202. As an example, other data is data with a data size larger than the data size of the control data included in the main data, and may include images for monitoring or managing the manufacturing process in a production line or factory. Different from the main data and the sub-data, other data may not require timing and real-time performance.
[0087] In the above-mentioned embodiment, the processing unit 11 of the communication device 1 does not send the sub-data to each slave device 2 in the main communication process and the split communication process, but it is also possible to send the sub-data to each slave device 2. That is, as long as the processing performance of the processing unit 11 is sufficient, the processing unit 11 can execute the process of generating the sub-data in parallel with the process of generating the main data, and send the generated sub-data to each slave device 2.
[0088] (Summarize)
[0089] As described above, the communication device (1) involved in the first embodiment includes: a processing unit (11); and a communication unit (12), which communicates with one or more slave devices (2). The processing unit (11) has a function of executing communication processing and setting processing. The communication processing is a process in which a main frame (F1) containing main data is sent from the communication unit (12) to one or more slave devices (2) in a first cycle (CT1). The setting processing is a process in which a second cycle (CT2) shorter than the first cycle (CT1) is set, and a time slot (S0) is allocated to at least one of the one or more slave devices (2) in each second cycle (CT2).
[0090] According to this method, the time slot (S0) can be used to periodically send or receive or send and receive sub-data different from the main data. Therefore, according to this method, there is an advantage that it is easy to periodically send or receive or send and receive sub-data in the slave device (2) connected to the communication device (1).
[0091] In a communication device (1) according to a second aspect of the first aspect, a main frame (F1) includes a time slot (S0).
[0092] According to this method, there is an advantage that it is easy to avoid a situation in which the slave device (2) transmits or receives or transmits and receives sub-data at intervals longer than the second cycle (CT2).
[0093] In a communication device (1) according to a third aspect of the first aspect or the second aspect, one or more slave devices (2) are connected to the communication device (1) in a daisy chain manner.
[0094] According to this method, there is an advantage that the communication device (1) only needs to send frames to the slave device (2) directly connected to the communication device (1) among one or more slave devices (2), so it is easy to reduce the processing load of the communication device (1).
[0095] In a communication device (1) according to a fourth mode of any one of the first mode to the third mode, during a setting process, a processing unit (11) calculates a transmission time (maximum transmission time (Mt)) of a main frame (F1) based at least on a first cycle (CT1), the number of one or more slave devices (2), and a data size of main data, and sets a second cycle (CT2) based on the calculated transmission time.
[0096] This method has the advantage that it is easy to set the number of times the second cycle (CT2) is included in the first cycle (CT1) to be large, and as a result, it is easy to increase the number of times the sub-data is sent or received or sent and received in the first cycle (CT1).
[0097] In a communication device (1) according to a fifth aspect of the fourth aspect, in a setting process, a processing unit (11) sets a minimum communication cycle (CT) allowed in communication with one or more slave devices (2). min ) is set as the second cycle (CT2).
[0098] This method has the advantage that it is easy to set the number of times the second cycle (CT2) is included in the first cycle (CT1) to be large, and as a result, it is easy to increase the number of times the sub-data is sent or received or sent and received in the first cycle (CT1).
[0099] In the communication device (1) according to the sixth aspect of the fifth aspect, the minimum communication cycle (CT min ) can be set arbitrarily.
[0100] According to this aspect, there is an advantage that the degree of freedom in setting the second period ( CT2 ) can be increased.
[0101] In a communication device (1) according to a seventh aspect of the fourth aspect, in a setting process, a processing unit (11) sets a cycle that is an integral multiple of a communication cycle that can be supported by one or more slave devices (2) as a second cycle (CT2).
[0102] According to this method, there is an advantage that synchronization can be easily achieved between the communication device (1) and one or more slave devices (2).
[0103] In the communication device (1) according to the eighth aspect of any one of the first to seventh aspects, the deviation of the time slot (S0) is at least converged to within the allowed time shorter than the second cycle (CT2).
[0104] According to this method, there is an advantage that it is easy to avoid a situation in which the slave device (2) transmits or receives or transmits and receives sub-data at intervals longer than the second cycle (CT2).
[0105] In the communication device (1) according to a ninth aspect of any one of the first to eighth aspects, the time slot (S0) is used for communication between one or more slave devices (2).
[0106] According to this method, there is an advantage that it is easy to use sub-data to perform control of more than one slave device (2).
[0107] In the communication device (1) according to a tenth aspect of any one of the first to ninth aspects, at least one of the one or more slave devices (2) is a motor driving device for driving a motor.
[0108] According to this method, there is an advantage that not only the main data but also the sub data are used, thereby making it easy to periodically control the motor driving device.
[0109] A communication system (100) according to an eleventh aspect comprises a communication device (1) according to any one of the first to tenth aspects, and one or more slave devices (2). The one or more slave devices (2) are connected to the communication device (1) to communicate with the communication device (1).
[0110] According to this method, the time slot (S0) can be used to periodically send or receive or send and receive sub-data different from the main data. Therefore, according to this method, there is an advantage that it is easy to periodically send or receive or send and receive sub-data in the slave device (2) connected to the communication device (1).
[0111] The communication control method according to the twelfth aspect comprises a communication step and a setting step. The communication step is a step of transmitting a master frame (F1) including master data to one or more slave devices (2) connected to a communication device (1) in a first cycle (CT1). The setting step is a step of setting a second cycle (CT2) shorter than the first cycle (CT1) and a time slot (S0) allocated to at least one of the one or more slave devices (2) in each second cycle (CT2).
[0112] According to this method, the time slot (S0) can be used to periodically send or receive or send and receive sub-data different from the main data. Therefore, according to this method, there is an advantage that it is easy to periodically send or receive or send and receive sub-data in the slave device (2) connected to the communication device (1).
[0113] The program according to the thirteenth aspect causes one or more processors to execute the communication control method according to the twelfth aspect.
[0114] According to this method, the time slot (S0) can be used to periodically send or receive or send and receive sub-data different from the main data. Therefore, according to this method, there is an advantage that it is easy to periodically send or receive or send and receive sub-data in the slave device (2) connected to the communication device (1).
[0115] The configurations according to the second to tenth aspects are not essential to the communication device (1) and can be omitted as appropriate.
[0116] Description of Reference Numerals
[0117] 1: communication device; 11: processing unit; 12: communication unit; 2: slave device; 21: first slave device; 22: second slave device; 23: third slave device; 2n: nth slave device; 100: communication system; 201: processing unit; 202: communication unit; F1: main frame; F2: sub-frame; S0: time slot.
Claims
1. A communication device comprising: Processing Department; and a communication unit that transmits a master frame containing master data in a first cycle, the communication unit being used to communicate with one or more slave devices, in, The processing unit has the function of executing communication processing and setting processing, In the communication process, the main frame is generated in a time shorter than the first cycle, In the setting process, a second cycle shorter than the first cycle and longer than the transmission time of the master data, and a time slot allocated to at least one of the one or more slave devices in each of the second cycle are set. At least one of the one or more slave devices is a motor driving device for driving a motor.
2. The communication device according to claim 1, wherein: The main frame includes the time slot.
3. The communication device according to claim 1, wherein: The one or more slave devices are connected to the communication device in a daisy chain manner.
4. The communication device according to claim 1, wherein: In the setting process, the processing unit calculates the transmission time of the main frame based on at least the first cycle, the number of the one or more slave devices, and the data size of the main data, and sets the second cycle based on the calculated transmission time.
5. The communication device according to any one of claims 1 to 4, wherein: The time slot is used for communication between the one or more slave devices.
6. A communication device comprising: Processing Department; and a communication unit that transmits a master frame containing master data in a first cycle, the communication unit being used to communicate with one or more slave devices, in, The processing unit has the function of executing communication processing and setting processing, In the communication process, the main frame is generated in a time shorter than the first cycle, In the setting process, a second cycle shorter than the first cycle and longer than the transmission time of the master data, and a time slot allocated to at least one of the one or more slave devices in each of the second cycle are set. wherein, in the setting process, the processing unit calculates the transmission time of the master frame based on at least the first period, the number of the one or more slave devices, and the data size of the master data, and sets the second period based on the calculated transmission time; Here, in the setting process, the processing unit sets a minimum communication cycle allowed in communication with the one or more slave devices as the second cycle.
7. The communication device according to claim 6, wherein: The minimum communication cycle can be set arbitrarily.
8. The communication device according to claim 6 or 7, wherein: The time slot is used for communication between the one or more slave devices.
9. A communication device comprising: Processing Department; and a communication unit that transmits a master frame containing master data in a first cycle, the communication unit being used to communicate with one or more slave devices, in, The processing unit has the function of executing communication processing and setting processing, In the communication process, the main frame is generated in a time shorter than the first cycle, In the setting process, a second cycle shorter than the first cycle and longer than the transmission time of the master data, and a time slot allocated to at least one of the one or more slave devices in each of the second cycle are set. wherein, in the setting process, the processing unit calculates the transmission time of the master frame based on at least the first period, the number of the one or more slave devices, and the data size of the master data, and sets the second period based on the calculated transmission time; Here, in the setting process, the processing unit sets a cycle that is an integral multiple of a communication cycle that can be supported by the one or more slave devices as the second cycle.
10. The communication device according to claim 9, wherein: The time slot is used for communication between the one or more slave devices.
11. A communication device comprising: Processing Department; and a communication unit that transmits a master frame containing master data in a first cycle, the communication unit being used to communicate with one or more slave devices, in, The processing unit has the function of executing communication processing and setting processing, In the communication process, the main frame is generated in a time shorter than the first cycle, In the setting process, a second cycle shorter than the first cycle and longer than the transmission time of the master data, and a time slot allocated to at least one of the one or more slave devices in each of the second cycle are set. The deviation of the time slot at least converges to an allowed time shorter than the second period.
12. The communication device according to claim 11, wherein: The time slot is used for communication between the one or more slave devices.
13. A communication system comprising The communication device according to claim 1; and The one or more slave devices are connected to the communication device to communicate with the communication device.
14. A communication control method, comprising: a communication step of sending a master frame including master data to one or more slave devices connected to the communication device in a first cycle; as well as a setting step of setting a second cycle shorter than the first cycle and a time slot allocated to at least one of the one or more slave devices in each of the second cycles, At least one of the one or more slave devices is a motor driving device for driving a motor.
15. A computer program product, comprising a computer program, wherein when the computer program is executed by one or more processors, the communication control method according to claim 14 is implemented.
