Control systems and control devices

By designing a control system for measuring and selecting a forwarding method in the control device, and selecting a PIO or DMA method according to the data volume, the problem of longer forwarding time in the prior art is solved, and the processing efficiency and stability of the system are improved.

CN112673362BActive Publication Date: 2025-01-10OMRON CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201980057878.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-11-19
Filing Date
2019-10-24
Publication Date
2025-01-10
Estimated Expiration
2039-10-24

AI Technical Summary

Technical Problem

When selecting the forwarding method of communication data in the control device, it is difficult to dynamically adjust according to the amount of data, resulting in a longer forwarding time and affecting the system's fixed-cycle processing efficiency.

Method used

Design a control system, including an operation processing unit, a communication circuit and a DMA controller, by measuring the time and deviation of multiple forwarding methods, selecting the optimal forwarding method according to user instructions or preset conditions, including PIO method and DMA method. Ensure that data forwarding time is short and has small deviations.

Benefits of technology

The optimal forwarding method is achieved based on the data volume, shortening the time for forwarding communication data to the storage unit, and ensuring the stability and efficiency of fixed-period processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112673362B_ABST
    Figure CN112673362B_ABST
Patent Text Reader

Abstract

The present invention relates to a control system and a control device, which can select an optimal forwarding method according to the amount of data. The control system includes: one or more functional units; and a control device, which receives and sends communication data that is transmitted and circulated between the functional units. The control device selects one of a first forwarding method for forwarding communication data by a computing processing unit and a second forwarding method for forwarding communication data by a DMA controller according to instructions from a user or according to predefined conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a selection of a forwarding method for forwarding communication data to a storage unit, and in particular to a control system and a control device. Background Art

[0002] Industrial control devices such as programmable logic controllers (PLC) (programmable controllers) or robot controllers are introduced in production sites where factory automation (FA) is used. The control device and the functional unit are electrically connected via a communication line. The functional unit and the control device receive and transmit communication data that is transmitted on the communication line. The communication data is temporarily stored in a buffer of a communication circuit included in the control device. The communication data is forwarded from the buffer to a storage unit included in the control device. The communication data is forwarded, for example, by a direct memory access (DMA) forwarding method (hereinafter also referred to as a "DMA method"). The DMA method is a method in which a DMA controller connected to a communication circuit forwards communication data to a storage unit.

[0003] Regarding the forwarding of communication data by a control device, Japanese Patent Gazette No. 2018-129614 (Patent Document 1) discloses a technology: in a central processing unit (CPU) unit constituting a PLC, a DMA controller is configured between an arithmetic processing unit including a processor that executes tasks and a main memory, and a communication circuit responsible for communication via a local bus. The DMA controller has multiple DMA cores, and each DMA core executes specified processing in sequence according to a descriptor table. As a result, various communication processing such as IO refresh processing between a control device (processor) and a functional unit, including data transmission between the arithmetic processing unit and the communication circuit, can be realized at high speed (see [Paragraph 0143]).

[0004] Prior art literature

[0005] Patent Literature

[0006] Patent Document 1: Japanese Patent Application Publication No. 2018-129614 Summary of the invention

[0007] Problems to be solved by the invention

[0008] However, depending on the size (data volume) of the communication data, when the control device uses a certain forwarding method (e.g., DMA method) to forward the communication data, the time required for forwarding may sometimes be longer than when the communication data is forwarded using other forwarding methods. Therefore, it is necessary to disclose a technology that can select the best forwarding method corresponding to the data volume.

[0009] The present invention is made in view of this actual situation and provides a technology capable of selecting the best forwarding method according to the data amount.

[0010] Technical means of solving problems

[0011] A control system according to one aspect of the present invention includes: one or more functional units; a control device that receives and sends communication data that is circulated and transmitted between the one or more functional units. The control device includes: a communication circuit having a first storage unit that temporarily stores communication data; a second storage unit that stores communication data that is forwarded from the first storage unit through any one of a plurality of forwarding methods; an operation processing unit that uses the communication data stored in the second storage unit to perform operation processing; and a DMA controller that is connected to the operation processing unit and the communication circuit. The plurality of forwarding methods include: a first forwarding method in which the operation processing unit forwards communication data, and a second forwarding method in which the DMA controller forwards communication data. The operation processing unit selects any one of the first forwarding method and the second forwarding method based on instructions from a user or based on predefined conditions.

[0012] According to this structure, the control system can select the best forwarding method according to the amount of data during the operation of the system.

[0013] The operation processing unit can also measure a first forwarding time and a second forwarding time, wherein the first forwarding time is the time for forwarding communication data to the second storage unit through the first forwarding method, the forwarding time and the time for executing the operation processing, and the second forwarding time is the time for forwarding communication data to the second storage unit through the second forwarding method, the forwarding time and the time for executing the operation processing, and outputs measurement data including the first forwarding time and the second forwarding time.

[0014] According to this configuration, the control system can measure the time of the communication data transfer process in each transfer mode, or the time including the communication data transfer process and the calculation process.

[0015] The arithmetic processing unit may measure the first transfer time and the second transfer time when power supply to the control device is started or when the configuration of one or more functional units connected to the control device is changed.

[0016] According to this configuration, the control system can measure the transfer time at a timing when a transfer method different from the currently set transfer method may be selected during system operation.

[0017] The measurement data may include: an average first forwarding time among first forwarding times when forwarding of communication data is performed multiple times by the first forwarding method, and an average second forwarding time among second forwarding times when forwarding of communication data is performed multiple times by the second forwarding method. The processing unit may also be capable of selecting a forwarding method that performs forwarding in a shorter time, from the first forwarding method that performs forwarding with the average first forwarding time and the second forwarding method that performs forwarding with the average second forwarding time.

[0018] According to this configuration, the control system can select a transfer method that shortens the time required to transfer communication data to the storage unit during operation of the system, thereby shortening the time required for fixed-cycle processing.

[0019] The measurement data may also include: a degree of deviation in a first forwarding time when forwarding of communication data is performed multiple times using the first forwarding method, and a degree of deviation in a second forwarding time when forwarding of communication data is performed multiple times using the second forwarding method. The processing unit may also be capable of selecting a forwarding method that performs forwarding with a smaller degree of deviation, from the first forwarding method that performs forwarding with the degree of deviation in the first forwarding time and the second forwarding method that performs forwarding with the degree of deviation in the second forwarding time.

[0020] According to this configuration, the control system can select a transfer method that reduces the variation in the time when the communication data is transferred to the storage unit, thereby reliably completing the processing of the fixed cycle.

[0021] The control system may also include a support device for receiving the measurement data. The support device may also include a display unit, which displays an image based on the received measurement data, and the image can compare the maximum time allowed in forwarding the communication data with the time actually measured when forwarding the communication data by any one of the first forwarding method and the second forwarding method.

[0022] According to this structure, the control system can display an image that allows the user to intuitively determine which transfer method among a plurality of transfer methods is suitable for the system.

[0023] A control device according to another aspect of the present invention receives and transmits communication data that is transmitted and circulated between one or more functional units, and the control device includes: a communication circuit having a first storage unit that temporarily stores communication data; a second storage unit that stores communication data that is forwarded from the first storage unit through any one of a plurality of forwarding methods; an operation processing unit that uses the communication data stored in the second storage unit to perform operation processing; and a DMA controller that is connected to the operation processing unit and the communication circuit. The plurality of forwarding methods include: a first forwarding method in which the operation processing unit forwards the communication data, and a second forwarding method in which the DMA controller forwards the communication data. The operation processing unit selects any one of the first forwarding method and the second forwarding method based on instructions from a user or based on a predetermined condition.

[0024] According to this configuration, the control device can select the optimal transfer method according to the amount of data during system operation.

[0025] Effects of the Invention

[0026] According to the present invention, it is possible to select an optimal forwarding method according to the amount of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a schematic diagram showing the main structure of the PLC according to the first embodiment.

[0028] Figure 2 This is a schematic diagram for explaining the execution of periodic tasks in a PLC.

[0029] Figure 3 This is a diagram showing the transfer time corresponding to the amount of data for each transfer method.

[0030] Figure 4 This is a diagram for explaining the process of forwarding input data by programmed input / output (PIO) method.

[0031] Figure 5 This is a diagram for explaining the process of transferring input data by the DMA method.

[0032] Figure 6 This is a diagram showing an example of a primary periodic task.

[0033] Figure 7 This is a functional block diagram for explaining a function of selecting a forwarding method of input data based on predetermined conditions.

[0034] Figure 8 This is a flowchart showing a process of selecting a forwarding method that satisfies a predetermined condition.

[0035] Fig. 9This is a diagram showing an example of a user program for selecting a forwarding method.

[0036] Fig.10 It is a schematic diagram showing the main structure of the PLC according to the second embodiment.

[0037] Fig.11 This is a functional block diagram for explaining a function of selecting a transfer method of input data in response to an instruction from a user.

[0038] Fig.12 This is an image generated based on measurement data including the forwarding time in the first forwarding method.

[0039] Fig.13 This is an image generated based on measurement data including the forwarding time in the second forwarding method.

[0040] Fig.14 This is a block diagram showing a hardware configuration example of a support device constituting the control system according to the present embodiment.

[0041] Fig.15 This is a flowchart showing a process in which the calculation processing unit selects a forwarding method in response to an instruction from a user.

[0042] [Explanation of Symbols]

[0043] 2: Local bus

[0044] 20: Communication data

[0045] 80: First Image

[0046] 81, 91: First display area

[0047] 82, 92: Second display area

[0048] 90: Second Image

[0049] 100: Control device

[0050] 110: Calculation processing unit

[0051] 112, 311: Processor

[0052] 114: Storage

[0053] 116: Measurement Department

[0054] 117: Judgment Department

[0055] 118: Selection Department

[0056] 120: Storage

[0057] 122: System Program

[0058] 124: User program

[0059] 126: Configuration

[0060] 130: Communication circuit

[0061] 132: Buffer

[0062] 134: Input Data

[0063] 135: Output data

[0064] 140, 312: Controller

[0065] 160: High-precision timer

[0066] 200: Functional unit

[0067] 210: Communication Processing Department

[0068] 300: Support device

[0069] 301: First push line

[0070] 302: Second moving line

[0071] 303: The third moving line

[0072] 304: The fourth moving line

[0073] 305: Recording medium

[0074] 306: Primary storage device

[0075] 308: Secondary storage device

[0076] 310: Display unit

[0077] 314: LAN controller

[0078] 315: Optical Drive

[0079] 316: Input

[0080] 320: Bus

[0081] 322: Development Program

[0082] 324: Parameter Setting Tool

[0083] 1001, 1002, 1101, 1102: Measured values

[0084] 1003, 1103: moving average

[0085] FB0, FB1, FB2: Function blocks

[0086] IN0, IN1: Input elements

[0087] OUT0, OUT1, OUT2: Output elements

[0088] Ta, Tb: period

[0089] T1, T2: control cycle

[0090] T11: First forwarding time

[0091] T12: Second forwarding time DETAILED DESCRIPTION

[0092] Hereinafter, the embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, the same symbols are used for the same parts. Their names and functions are also the same. Therefore, their detailed description will not be repeated.

[0093] In the following description, a PLC (programmable controller) is used as a specific example as a typical example of a "control system", but the name is not limited to PLC, and the technical ideas disclosed in this specification are applicable to any control device.

[0094] <First embodiment>

[0095] [1. Device structure of PLC1]

[0096] First, the device configuration of the PLC according to the first embodiment will be described. Figure 1 Schematic diagram showing the main structure of the PLC according to the first embodiment. Figure 1 The PLC1 of the first embodiment typically includes a control device 100 and one or more functional units 200. The control device 100 is an element constituting the PLC1, and is equivalent to a computing unit that controls the overall processing of the PLC1. The functional unit 200 provides various functions for realizing the control of various machines or equipment by the PLC1. The control device 100 and the one or more functional units 200 are connected via a local bus 2 as an example of a communication line. As an example, as the local bus 2, a daisy chain structure is adopted.

[0097] Figure 1 In the structure shown, the control device 100 also functions as a communication unit or a communication device. More specifically, the control device 100 can function as a communication unit of a master that manages the entire communication in the local bus 2, or each functional unit 200 can function as a communication unit of a slave that communicates under the management of the control device 100. By adopting such a master / slave structure, it is easy to perform timing control of the communication data (communication frame) 20 circulating on the local bus 2.

[0098] The control device 100 includes a processing unit 110, a communication circuit 130, a DMA controller 140, and a high-precision timer 160. Alternatively, a communication unit providing the function of the communication circuit 130 may be combined with the control device 100 including the processing unit 110.

[0099] The processing unit 110 includes a processor 112, a storage unit 114, and a memory 120. For ease of description, Figure 1 Although only one processor 112 is depicted in the figure, multiple processors may be installed. In addition, each processor may have multiple cores. In the operation processing unit 110, the processor 112 periodically executes one or more tasks. When the operation processing unit 110 executes multiple tasks, different priorities may be set for the multiple tasks.

[0100] Furthermore, the processor 112 forwards the communication data 20 (e.g., input data 134) stored in the buffer 132 of the communication circuit 130 described later to the storage unit 114. The processor 112 forwards the communication data 20 to the storage unit 114 by a data forwarding method (hereinafter also referred to as "PIO method") such as a programmed input / output (PIO) forwarding method described later among a plurality of forwarding methods for data forwarding.

[0101] The storage unit 114 includes a dynamic random access memory (DRAM) or a static random access memory (SRAM), etc., and provides a working area required for program execution in the processor 112 .

[0102] The storage 120 includes a flash memory or a hard disk, etc., and stores a system program 122 , a user program 124 , a configuration 126 , etc.

[0103] The system program 122 includes an operating system (OS) and a library for executing the user program 124 in the processor 112. The system program 122 includes a task for sending the field value (input data) contained in the communication data 20 circulating between the functional units 200 to the control device 100. Hereinafter, the field value is referred to as input data 134. In addition, the system program 122 includes a task for sending the control instruction value calculated in the control device 100 to the functional unit 200. Hereinafter, the control instruction value is referred to as output data 135. In this way, the system program 122 includes a task for periodically performing a process (IO refresh process described later) of sending at least one of the input data 134 and the output data 135. The user program 124 is arbitrarily made according to the machine or device that is the control object. In addition, the system program 122 includes a task for performing a measurement process of the data forwarding time under each of a plurality of data forwarding methods.

[0104] The configuration 126 includes various setting values ​​that define various setting values ​​or network configurations required for executing a program in the control device 100. The configuration 126 includes, for example, the data volume of the input data 134 and the data volume of the output data 135 that are transmitted and received in the IO refresh process.

[0105] The communication circuit 130 receives and sends communication data 20 to and from one or more functional units 200 via the local bus 2 as a communication line. That is, the communication circuit 130 is responsible for sending and receiving the communication data 20 via the local bus 2 as a communication line. The communication circuit 130 includes a buffer 132. The buffer 132 temporarily stores the communication data 20 sent and received via the local bus 2. The communication data 20 temporarily stored in the buffer 132 is, for example, input data 134 and output data 135.

[0106] The communication circuit 130 performs transmission and reception of the communication data 20, for example, in the following manner. The communication circuit 130 is physically connected to the local bus 2, and generates an electrical signal according to an instruction from the DMA controller 140. The communication circuit 130 sends the communication data 20 to the local bus 2, and demodulates the electrical signal generated on the local bus 2 to output the communication data 20 to the operation processing unit 110.

[0107] In this specification, "IO refresh processing" includes at least one of sending the input data 134 to the control device 100 and the like and sending the output data 135 to the functional unit 200. The input data 134 is data collected by the functional unit 200. The output data 135 is data stored in the storage unit 114 of the control device 100. That is, the name "IO refresh processing" is for convenience, and may include updating processing of only one of the input data 134 and the output data 135 (for example, only the input data 134).

[0108] The DMA controller 140 is connected to the operation processing unit 110 and the communication circuit 130, and has a function of mediating requests between the operation processing unit 110 and the communication circuit 130 to speed up data access. The DMA controller 140 transfers the communication data 20 (for example, input data 134) stored in the buffer 132 of the communication circuit 130 to the storage unit 114. The DMA controller 140 transfers the communication data 20 to the storage unit 114 by a data transfer method (hereinafter also referred to as "DMA method") of DMA transfer described later, among a plurality of data transfer methods for data transfer.

[0109] For example, the DMA controller 140 responds to a communication request from the processor 112, gives an instruction to the communication circuit 130, and sends the input data 134 stored in the buffer 132 of the communication circuit 130 to the storage unit 114. In addition, the DMA controller 140 responds to the communication request from the processor 112 and sends the output data 135 stored in the storage unit 114 to the communication circuit 130. At least a major part of the DMA controller 140 has a hard-wired structure, so that it can achieve higher-speed processing than the processor 112. Typically, the DMA controller 140 is implemented using hardware logic. For example, the DMA controller 140 can also be implemented using a field-programmable gate array (FPGA) as an example of a programmable logic device (PLD) or an application-specific integrated circuit (ASIC) as an example of an integrated circuit (IC).

[0110] The high-precision timer 160 is a clock for determining timing between the control device 100 and other units connected to the control device 100 , and is implemented using a counter that counts up at a predetermined cycle or the like.

[0111] The communication data 20 is used for IO refresh processing. The communication data 20 is transmitted among the plurality of functional units 200 via the local bus 2. During the period when the communication data 20 is not transmitted, the communication data 20 may be transmitted as a message between the control device 100 and any functional unit 200 or between the plurality of functional units 200.

[0112] As a protocol for sending and receiving data on the local bus 2, any protocol can be adopted. Furthermore, as an example of a communication line, the local bus 2 is exemplified, but it is not limited to this, and any fixed-cycle network can be adopted. As such a fixed-cycle network, a well-known network such as EtherCAT (registered trademark), EtherNet / IP (registered trademark), DeviceNet (registered trademark), and CompoNet (registered trademark) can also be adopted.

[0113] Figure 1 In the illustrated structure, for the sake of convenience, a structure divided into the operation processing unit 110, the communication circuit 130, and the DMA controller 140 is depicted, but it is not limited to this, and any installation form can be adopted. For example, it can also include a chip-level system (System on Chip, SoC) in which all or part of the operation processing unit 110 and all or part of the communication circuit 130 are installed on the same chip. Alternatively, it is also possible to use an SoC in which the processor 112 of the operation processing unit 110 and the main functions of the DMA controller 140 are installed on the same chip. For these installation forms, appropriate selection is made in consideration of the required performance or cost, etc.

[0114] Typically, the functional unit 200 may include an I / O unit, a communication unit, a temperature adjustment unit, an identifier (ID) sensor unit, etc. Examples of the I / O unit include a digital input (DI) unit, a digital output (DO) unit, an analog input (AI) unit, an analog output (AO) unit, a pulse capture input unit, and a composite unit in which a plurality of types are mixed.

[0115] The control device 100 exchanges data with other PLCs, remote I / O devices, functional units, etc. The control device 100 may include, for example, a communication device related to protocols such as EtherCAT (registered trademark), EtherNet / IP (registered trademark), DeviceNet (registered trademark), and CompoNet (registered trademark).

[0116] The temperature adjustment unit is a control device that includes an analog input function for obtaining temperature measurement values, an analog output function for outputting control instructions, and a proportional integral differential (PID) control function. The ID sensor unit is a device that reads data from a radio frequency IDentifier (RFID) or the like in a non-contact manner.

[0117] The functional unit 200 processes the communication data 20 that is transmitted and circulated on the local bus 2. More specifically, when the communication processing unit 210 receives some communication data 20 via the local bus 2, it writes and / or reads the received communication data 20 as needed, and then sends the communication frame to the functional unit 200 at the next position on the local bus 2. The functional unit 200 provides such a frame relay function. In addition, the functional unit 200 may simply forward the communication frame that is not sent to the unit itself to the functional unit 200 at the next position.

[0118] [2. Periodic Tasks in Control Device 100]

[0119] In the PLC1 of the first embodiment, one or more periodic tasks with respective priorities are executed. As one of the highest priority tasks (hereinafter also referred to as "primary periodic tasks") among such periodic tasks, there is the IO refresh processing described above. As tasks with lower priorities than the IO refresh processing, there are various tasks (hereinafter also referred to as "normal periodic tasks"). These tasks are repeatedly executed at respective fixed cycles set in advance.

[0120] Figure 2 This is a schematic diagram for explaining the execution of periodic tasks in PLC1. Figure 2 In the control device 100, a primary periodic task 1221 for executing IO refresh processing and the like is repeatedly executed with a control period T1. Moreover, while the primary periodic task 1221 is repeatedly executed, one or more normal periodic tasks 1222 having a lower priority than the primary periodic task 1221 are repeatedly executed with a control period T2. The control period T2 of the normal periodic task 1222 may also be set to a different value corresponding to each normal periodic task 1222. The control period T1 and the control period T2 are fixed periods. Moreover, for example, the control period T2 is set to a value longer than the control period T1.

[0121] As the normal periodic task 1222, the following processing may be executed, that is, in response to the establishment of certain events or conditions, various message frames are sent to specific functional units 200. That is, regarding the normal periodic task 1222, the communication circuit 130 ( Figure 1 ) and sends the message frame to the local bus 2 eventfully or periodically.

[0122] In contrast, when executing the IO refresh processing in the tasks included in the primary periodic task 1221, the IO refresh frame is repeatedly sent to the local bus 2 at fixed intervals. The period is fixed because the structure of the functional unit 200 connected to the control device 100 is a predetermined structure. For example, Figure 1 In the embodiment, three functional units 200 are connected to the control device 100. The amount of data received by the three functional units 200 is substantially the same in each cycle. In addition, the amount of data is predetermined by the configuration 126. Therefore, the communication circuit 130 repeatedly sends out the IO refresh frame at a fixed cycle, so that the amount of communication data 20 (for example, input data 134) stored in the buffer 132 is substantially the same in each cycle.

[0123] Furthermore, when a "structural change" such as changing the structure of the functional unit 200 connected to the control device 100 is performed, the data volume of the communication data 20 will also be changed. For example, there is a situation where the number of functional units 200 connected to the control device 100 increases and the data volume also increases, and thus, the time for forwarding the input data 134 becomes longer than before the data volume increases. In this case, the time for performing the IO refresh processing must be completed within a fixed period so as not to exceed a predetermined upper limit time. This is because it is possible that the primary periodic tasks other than the IO refresh processing cannot be performed due to the increase in the IO refresh processing time. Therefore, for example, in the case where the data volume of the input data 134 increases, the input data 134 must be forwarded in a forwarding manner in which the IO refresh processing time is within a predetermined range.

[0124] Here, the time required to transfer the input data 134 stored in the buffer 132 of the communication circuit 130 to the storage unit 114 varies depending on the transfer method set when transferring the input data 134. The relationship between the transfer method and the transfer time will be described below.

[0125] [3. Relationship between forwarding method and forwarding time]

[0126] Reference Figure 3 To illustrate the relationship between forwarding method and forwarding time. Figure 3 This is a diagram showing the transfer time corresponding to the amount of data for each transfer method. Figure 3The transfer time shown is data calculated by experiments, for example. For example, there are PIO method and DMA method as the transfer method. The specific transfer methods in the PIO method and DMA method will be described later.

[0127] Figure 3 The first transition line 301 to the fourth transition line 304 represent the transition of the forwarding time in each forwarding method. More specifically, the first transition line 301 and the second transition line 302 represent the average forwarding time (hereinafter also referred to as "average forwarding time") when the forwarding of the input data 134 is performed multiple times. The average forwarding time varies according to the amount of data. The first transition line 301 represents the transition of the average forwarding time in the PIO method. The second transition line 302 represents the transition of the average forwarding time in the DMA method.

[0128] The third transition line 303 and the fourth transition line 304 represent the maximum transfer time (hereinafter also referred to as "maximum transfer time") when the input data 134 is transferred multiple times. The maximum transfer time changes according to the amount of data. The third transition line 303 represents the change of the transfer time in the PIO mode. The fourth transition line 304 represents the change of the transfer time in the DMA mode.

[0129] First, the first push line 301 and the second push line 302 are described. For example, when the amount of input data 134 forwarded from the buffer 132 to the storage unit 114 is 50 KB, the average forwarding time in the first push line 301 is 12.5 μsec, and the average forwarding time in the second push line 302 is 14.0 μsec. When the amount of input data 134 is 50 KB, the forwarding time in the PIO mode is shorter than the forwarding time in the DMA mode. On the other hand, when the amount of data is 300 KB, the average forwarding time in the first push line 301 is 20.0 μsec, and the average forwarding time in the second push line 302 is 18.5 μsec. When the amount of input data 134 is 300 KB, the forwarding time in the DMA mode is shorter than the forwarding time in the PIO mode.

[0130] Which of the PIO method and the DMA method has a shorter forwarding time varies, for example, depending on whether the data volume is less than 190KB. More specifically, when the data volume is less than 190KB, the forwarding time of the PIO method is shorter than the forwarding time of the DMA method. When the data volume is greater than 190KB, the forwarding time of the DMA method is shorter than the forwarding time of the PIO method. As described above, the forwarding speed of the DMA method is faster than the forwarding speed under the PIO method, but when forwarding based on the DMA method is performed, setting processing is performed between the processor 112 and the DMA controller 140 before the forwarding starts. In this way, when the DMA controller 140 performs data forwarding based on the DMA method, prior processing is required before the data forwarding starts. Therefore, when the data volume is small, data forwarding based on the PIO method without setting processing will end in a shorter time than data forwarding based on the DMA method.

[0131] Next, the third shift line 303 and the fourth shift line 304 are described. For example, when the data amount of the input data 134 forwarded from the buffer 132 to the storage unit 114 is 50KB, the maximum forwarding time in the third shift line 303 is 32.0μsec, and the maximum forwarding time in the fourth shift line 304 is 32.5μsec. When the data amount of the input data 134 is 50KB, the forwarding time in the PIO mode is shorter than the forwarding time in the DMA mode. On the other hand, when the data amount is 300KB, the maximum forwarding time in the third shift line 303 is 40.0μsec, and the maximum forwarding time in the fourth shift line 304 is 42.5μsec. When the data amount of the input data 134 is 300KB, the forwarding time in the DMA mode is shorter than the forwarding time in the PIO mode.

[0132] Which of the PIO mode and the DMA mode has a shorter forwarding time varies, for example, depending on whether the data volume is less than 125KB. More specifically, when the data volume is less than 125KB, the forwarding time of the PIO mode is shorter than the forwarding time of the DMA mode. When the data volume is greater than 125KB, the forwarding time of the DMA mode is shorter than the forwarding time of the PIO mode. In this way, the forwarding time under each forwarding mode is different depending on the data volume of the input data 134. Therefore, when the data volume of the communication data 20 changes due to structural changes, etc., the control device 100 measures the forwarding time under each forwarding mode after the data volume changes.

[0133] What has been explained so far Figure 3 The transition line of is a value measured by experiment. In contrast, in the system operation of PLC1, the control device 100 uses a function of the calculation processing unit 110, that is, a measuring unit (for example, Figure 7The control device 100 measures the average forwarding time in each forwarding method by using the measuring unit 116 shown in the figure. And the control device 100 selects the forwarding method with the short average forwarding time. And the control device 100 measures the degree of deviation of the forwarding time in each forwarding method by using the measuring unit 116 during the operation of the PLC1 system. The degree of deviation of the forwarding time will be described later. The measuring unit 116 outputs the measurement data including at least one of the average forwarding time and the degree of deviation of the forwarding time to the determination unit (e.g. Figure 7 The determination unit 117 shown in FIG. 11 is a block diagram of a control device 100. The determination unit 117 determines which of the multiple forwarding methods is suitable for the system operation of PLC 1. In this way, the control device 100 measures at least one of the average forwarding time and the degree of deviation of the forwarding time to determine which of the multiple forwarding methods is suitable for the system operation of PLC 1.

[0134] [4. Description of forwarding method]

[0135] Reference Figure 4 as well as Figure 5 Hereinafter, the forwarding method of the PIO method and the DMA method will be described. The forwarding of the input data 134 will be described, but even the forwarding of the output data 135 can be applied to any of these forwarding methods according to the change in the data amount. When the IO refresh process is performed, the input data 134 is forwarded from the buffer 132 of the communication circuit 130 to the storage unit 114 by any of the PIO method and the DMA method. The processor 112 performs arithmetic processing using the input data 134 stored in the storage unit 114.

[0136] Figure 4 This is a diagram for explaining the process of transferring the input data 134 by the PIO method. Figure 5 This is a diagram for explaining the process of transferring input data 134 by DMA. Figure 4 , the processor 112 reads the input data 134 stored in the buffer 132 of the communication circuit 130. The processor 112 forwards the read input data 134 to the storage unit 114. In this way, in the PIO method, the input data 134 is forwarded to the storage unit 114 via the processor 112. In other words, in the PIO method, the processor 112 forwards the input data 134 from the buffer 132 to the storage unit 114 without passing through the DMA controller 140. In addition, the method of forwarding the input data 134 via the processor 112 can also be called a firmware (Firmware, FW) method. Hereinafter, the method of forwarding the input data 134 via the processor 112 will be referred to as the PIO method for further description.

[0137] Reference Figure 5, the DMA controller 140 reads the input data 134 stored in the buffer 132 of the communication circuit 130. The DMA controller 140 forwards the read input data 134 to the storage unit 114. In this way, in the DMA method, the input data 134 is forwarded to the storage unit 114 via the DMA controller 140. In other words, in the DMA method, the DMA controller 140 forwards the input data 134 from the buffer 132 to the storage unit 114 without passing through the processor 112. In addition, before executing the processing based on the DMA method, a setting instruction is output from the processor 112 to the DMA controller 140. The DMA controller 140 that receives the setting instruction from the processor 112 starts reading the input data 134 stored in the buffer 132 after performing the settings required to start the processing.

[0138] The control device 100 transfers the input data 134 temporarily stored in the buffer 132 to the storage unit 114 by using either the PIO method or the DMA method. The PIO method is a method in which the processor 112 included in the operation processing unit 110 transfers the input data 134 to the storage unit 114. The DMA method is a method in which the DMA controller 140 transfers the input data 134 to the storage unit 114. In addition, when performing an IO refresh process for transferring the input data 134, the process must be completed within a fixed cycle. The operation processing unit 110 measures the time (hereinafter also referred to as the "first transfer time") for transferring the input data 134 stored in the buffer 132 to the storage unit 114 by using the PIO method (hereinafter also referred to as the "first transfer method") . In addition, the operation processing unit 110 measures the time (hereinafter also referred to as the "second transfer time") for transferring the input data 134 stored in the buffer 132 to the storage unit 114 by using the DMA method (hereinafter also referred to as the "second transfer method") . The calculation processing unit 110 selects a forwarding method of, for example, a shorter time between the first forwarding time and the second forwarding time as a forwarding method for forwarding the input data 134 .

[0139] [5. First forwarding time and second forwarding time]

[0140] Reference Figure 6 To illustrate the corresponding relationship between the first forwarding time and the second forwarding time and the primary periodic task 1221. Figure 61 is a diagram showing an example of a primary periodic task 1221. The primary periodic task 1221 includes an IO refresh process. Furthermore, the primary periodic task 1221 includes a calculation process and a user program that are performed with the highest priority after the IO refresh process. For example, in the control cycle T1 for executing the IO refresh process, the calculation process, and the user program, the first forwarding time in the first forwarding mode or the second forwarding time in the second forwarding mode is a time included in the cycle Ta for performing the IO refresh process. On the other hand, the first forwarding time or the second forwarding time may be a time included in the cycle Tb for performing the IO refresh process and the calculation process. The calculation process is a process that the processor 112 performs using the input data 134 forwarded from the buffer 132 to the storage unit 114.

[0141] Thus, the time for forwarding the input data 134 from the buffer 132 to the storage unit 114 is either a time within a period Ta including a time for performing IO refresh processing, or a time within a period Tb including a time for performing IO refresh processing and a calculation processing. More specifically, the first forwarding time is, for example, either a forwarding time (a time included in the period Ta) for forwarding the input data 134 from the buffer 132 to the storage unit 114 by the PIO method, or a processing execution time (a time included in the period Tb) including the forwarding time and a time for performing calculation processing. Furthermore, the second forwarding time is, for example, either a forwarding time (a time included in the period Ta) for forwarding the input data 134 from the buffer 132 to the storage unit 114 by the DMA method, or a processing execution time (a time included in the period Tb) including the forwarding time and a time for performing calculation processing. Thus, the PLC1 can measure, in the primary periodic task 1221, the time for performing only IO refresh processing or the time including IO refresh processing and calculation processing as the forwarding time in each forwarding method. Therefore, hereinafter, the first forwarding time and the second forwarding time may be any of the time during which only the IO refresh process is performed (the time included in the cycle Ta) and the time during which both the IO refresh process and the calculation process are performed (the time included in the cycle Tb).

[0142] In addition, the period Tc is the time including the user program 124. Since the control period T1 is a predetermined time (for example, 2,000 μsec), when the number of user programs 124 included in the period Tc is small, the upper limit time of at least one of the period Ta and the period Tb can be extended. For example, when the number of user programs is 0 (zero), the control period T1 can also be set to be period Tb. In contrast, when the number of user programs 124 increases, since the control period T1 is a predetermined time, the time of at least one of the period Ta and the period Tb must be shortened. Therefore, the selection unit 118 of the operation processing unit 110 can shorten the forwarding time by selecting a forwarding method with a short forwarding time of the input data 134 in the IO refresh processing. As a result, the PLC1 can ensure more time to execute the user program 124.

[0143] The following describes the conditions and functions for selecting a forwarding method. Figure 7 This is a functional block diagram for explaining a function of selecting a transfer method of input data 134 based on a predetermined condition. The operation processing unit 110 includes a measuring unit 116, a determining unit 117, a selecting unit 118, and a user program 124. The measuring unit 116, the determining unit 117, and the selecting unit 118 are functions realized by, for example, a system program 122.

[0144] The user program 124 outputs a measurement instruction to the measuring unit 116. The process is executed in a predetermined order in a scheduler (not shown), and the program is executed when it is time to execute the process of the user program 124. The measuring unit 116 that receives the measurement instruction calculates the transfer time of the input data 134 in each transfer mode of the PIO mode and the DMA mode by executing the process of the user program 124. The measuring unit 116 measures the time from reading the input data 134 from the buffer 132 to transferring it to the storage unit 114 in each mode based on the value counted by the high-precision timer 160.

[0145] The measuring unit 116 performs forwarding of the input data 134 in each mode a plurality of times to calculate the forwarding time. The measuring unit 116 calculates an average forwarding time indicating the average forwarding time of each mode based on the plurality of forwarding times. The measuring unit 116 sends the measurement data including the average forwarding time of each forwarding mode to the determining unit 117.

[0146] The determination unit 117 determines whether a predetermined determination condition is satisfied based on the measurement data. The determination condition is, for example, a condition for selecting a forwarding method with a short average forwarding time. The determination unit 117 compares the average forwarding time in the PIO method with the average forwarding time in the DMA method to determine which method has a short average forwarding time. For example, when the determination unit 117 determines that the average forwarding time in the PIO method is shorter than the average forwarding time in the DMA method, the determination unit 117 outputs the determination result to the selection unit 118.

[0147] When the currently set forwarding mode is the DMA mode, the selection unit 118 that has received the judgment result selects the PIO mode as a new forwarding mode for the input data 134. When the currently set forwarding mode is the PIO mode, the selection unit 118 that has received the judgment result continues to forward the data using the currently selected PIO forwarding mode. In this way, PLC1 can select any forwarding mode based on the average forwarding time in each mode. PLC1 can select the best forwarding mode corresponding to the amount of data in system operation. Moreover, PLC1 can select a forwarding mode that shortens the time it takes to forward the input data 134 from the buffer 132 to the storage unit 114 in system operation, thereby shortening the time required for IO refresh processing. Furthermore, by shortening the processing time in the IO refresh processing, PLC1 can increase the number of processes (such as processes based on user programs) executed in the primary periodic task in processes other than the IO refresh processing.

[0148] Furthermore, the determination condition in the determination unit 117 may be set to, for example, the degree of deviation of the forwarding time. More specifically, the determination unit 117 determines whether the condition is satisfied based on, for example, a determination condition that allows the forwarding method to be selected so as to have a small degree of deviation of the forwarding time. The so-called degree of deviation refers to, for example, the standard deviation of a plurality of forwarding times. When the degree of deviation is large, since the processing time of the IO refresh processing is uncertain, the processing may not be completed within a fixed period.

[0149] The measuring unit 116 calculates the degree of variation of the forwarding time of each method based on the plurality of forwarding times. The measuring unit 116 calculates the degree of variation based on the standard deviation of the plurality of forwarding times, for example. The measuring unit 116 sends measurement data including the degree of variation of each forwarding method to the determining unit 117.

[0150] The determination unit 117 compares the deviation degree in the PIO mode with the deviation degree in the DMA mode to determine which mode has a smaller deviation degree. For example, when the determination unit 117 determines that the deviation degree in the PIO mode is smaller than the deviation degree in the DMA mode, the determination unit 117 outputs the determination result to the selection unit 118. The selection unit 118, which receives the determination result, selects the PIO mode as a new forwarding mode of the input data 134 when the currently set forwarding mode is the DMA mode.

[0151] When the currently set forwarding mode is the PIO mode, the selection unit 118 that receives the determination result continues forwarding through the currently selected PIO forwarding mode. In this way, PLC1 can select any forwarding mode according to the degree of deviation of the forwarding time in each mode. Moreover, PLC1 can select a forwarding mode with a small deviation in the time for forwarding the input data 134 from the buffer 132 to the storage unit 114, so that the IO refresh processing can be effectively terminated within a fixed cycle. Furthermore, by effectively terminating the IO refresh processing within a fixed cycle, PLC1 can prevent other processing contained in the primary periodic task from being unexecuted.

[0152] [6. Forwarding method selection process in the first embodiment]

[0153] Reference Figure 8 The control structure of the control device 100 will be described. Figure 8 This is a flowchart showing the process of selecting a forwarding method that satisfies a predetermined condition by the operation processing unit 110. In step S1001, the operation processing unit 110 receives a measurement instruction based on the user program 124. The measurement instruction is output, for example, when power is supplied to the control device 100 (power is turned on) or when the structure of the functional unit 200 is changed ("structure modification" is performed).

[0154] In step S1002, the calculation processing unit 110 starts measuring the transfer time in the first transfer method (eg, the PIO method). The calculation processing unit 110 uses the high-precision timer 160 to detect the start timing of transfer of the input data 134 for one cycle.

[0155] In step S1003, the operation processing unit 110 determines whether the measurement has ended. The operation processing unit 110 measures the forwarding time in the PIO mode a predetermined number of times (for example, 2,000 times). After the operation processing unit 110 detects the end timing of the forwarding of the input data 134 of one cycle, when it is determined that the measurement of the predetermined number of times has ended (yes in step S1003), the control is switched to step S1004. If not (no in step S1003), the operation processing unit 110 switches the control to step S1003 to continue the measurement until the predetermined number of times is reached.

[0156] In addition, as described above, the calculation processing unit 110 uses the high-precision timer 160 to obtain the count value of the start timing in the forwarding of the input data 134 for one cycle and the count value of the end timing from the start of counting until the end of the forwarding of the same input data 134 for one cycle. The calculation processing unit 110 detects the difference between the count value of the start timing and the count value of the end timing in the measurement of the forwarding time for one cycle as the first forwarding time in the first forwarding mode.

[0157] In step S1004 , the calculation processing unit 110 starts measurement in the second transfer method (eg, DMA method) The calculation processing unit 110 uses the high-precision timer 160 to detect the start timing of transfer of the input data 134 for one cycle.

[0158] In step S1005, the calculation processing unit 110 determines whether the measurement has been completed. The calculation processing unit 110 measures the transfer time in the DMA method a predetermined number of times (for example, 2,000 times). When the calculation processing unit 110 determines that the measurement has been completed (Yes in step S1005), the control is switched to step S1006. Otherwise (No in step S1005), the calculation processing unit 110 switches the control to step S1005 and continues the measurement until the predetermined number of times is reached.

[0159] In addition, as described above, the calculation processing unit 110 uses the high-precision timer 160 to obtain the count value of the start timing in the forwarding of the input data 134 for one cycle and the count value of the end timing from the start of counting until the end of the forwarding of the same input data 134 for one cycle. The calculation processing unit 110 detects the difference between the count value of the start timing and the count value of the end timing in the measurement of one cycle as the second forwarding time in the second forwarding mode.

[0160] In step S1006 , the calculation processing unit 110 outputs measurement data including the first forwarding time, the second forwarding time, the degree of deviation from the first forwarding time, and the degree of deviation from the second forwarding time. The calculation processing unit 110 outputs the measurement data to the determination unit 117 .

[0161] In step S1007, the calculation processing unit 110 selects a forwarding method in response to the situation where a predetermined condition is satisfied. For example, the calculation processing unit 110 selects a forwarding method that satisfies the condition of a short average forwarding time. More specifically, when the calculation processing unit 110 determines that the average forwarding time under the first forwarding method is shorter than the average forwarding time under the second forwarding method, if the currently set forwarding method is the second forwarding method, the calculation processing unit 110 selects the first forwarding method as the subsequent forwarding method. When the currently set forwarding method is the first forwarding method, the calculation processing unit 110 does not select a new forwarding method, but continues to set the current method.

[0162] Thus, PLC1 can shorten the time to transfer input data 134 from buffer 132 to storage unit 114. Moreover, PLC1 can select a transfer method with a small degree of deviation, for example. Thus, PLC1 can reliably complete the process of transferring input data 134 from buffer 132 to storage unit 114 within a fixed period.

[0163] Alternatively, the processor 110 may select a forwarding method based on the degree of deviation of the forwarding time in the first forwarding method and the degree of deviation of the forwarding time in the second forwarding method instead of the average forwarding time. Furthermore, the processor 110 may select a forwarding method based on both the average forwarding time and the degree of deviation.

[0164] <Second embodiment>

[0165] The PLC 1 of the second embodiment is implemented using the same hardware configuration as the PLC 1 of the above-mentioned embodiment. Therefore, the description of the same hardware configuration will not be repeated.

[0166] In the first embodiment, the case where the measuring unit 116, the determining unit 117, and the selecting unit 118 included in the arithmetic processing unit 110 are realized by the system program 122 is described. In contrast, the functions of the measuring unit 116, the determining unit 117, and the selecting unit 118 may be realized by the user program 124. The user may also use the support device 300 described later to create a function block in advance, and send the created user program 124 to the control device 100, thereby realizing the functions in the control device 100. Hereinafter, a specific example of the user program 124 having the functions of the measuring unit 116, the determining unit 117, and the selecting unit 118 will be described.

[0167] [Specific example of user program 124]

[0168] Reference Fig. 9A specific example of the user program 124 that realizes the function of the selection unit 118 and the like will be described. Fig. 9 1 is a diagram showing an example of the user program 124 for selecting the forwarding method. Figure 8 In the example, the user program 124 is defined as a ladder program. The user program 124, for example, starts measuring the first forwarding time and the second forwarding time when power supply is started from a state where power is not supplied to the control device 100, or when the structure of the functional unit 200 is changed (structural changes are made). If a forwarding method is selected after the measurement of the first forwarding time and the second forwarding time is completed, data forwarding is performed by the selected new forwarding method. In this way, PLC1 can measure the forwarding time when a forwarding method different from the currently set forwarding method may be selected during system operation.

[0169] The user program 124 is defined by input elements IN0 and IN1 , function blocks FB0 to FB2 , and output elements OUT0 to OUT2 .

[0170] The values ​​of input elements IN0 and IN1 change according to the variables assigned. More specifically, the variable "ChangeTrigger" is assigned to input element IN0. The variable "ChangeTrigger" is a Boolean (BOOL) type, and its initial value is "False" (=OFF). The value of the variable "ChangeTrigger" changes to "True" (=ON) based on, for example, the fact that the control device 100 is activated. In other cases, the value of the variable "ChangeTrigger" is "False" (=OFF).

[0171] The variable "SettingTrigger" is assigned to the input element IN1. The variable "SettingTrigger" is of Boolean type, and its initial value is "False" (=off). Moreover, the variable "SettingTrigger" is associated with the output of the function block FB0. When the output of the function block FB0 is "True" (=enabled), the value of the input element IN1 is "True" (=enabled). On the other hand, when the output of the function block FB0 is "False" (=off), the value of the input element IN1 is "False" (=off).

[0172] Next, the function blocks FB0, FB1, and FB2 are described in detail. The function block FB0 is a program for measuring the transfer time of the input data 134, and is equivalent to the command included in the user program 124. When the variable "ChangeTrigger" becomes "True" (= enabled), a signal "True" (= enabled) indicating validity is input to the input part of the function block FB1. Based on this, the function block FB0 starts measuring the first transfer time T11 in the PIO mode and the second transfer time T12 in the DMA mode.

[0173] The function block FB1 is a program for selecting a forwarding mode, and is equivalent to a command included in the user program 124. Based on the fact that the first forwarding time T11 measured by the function block FB0 is longer than the second forwarding time T12, a valid signal "True" (= enabled) is input to the input section of the function block FB1. Based on this, when the current forwarding mode is the PIO mode M1, the function block FB1 selects the DMA mode M2. In addition, when the current forwarding mode is the DMA mode M2, the function block FB1 does not select another mode, but maintains the current forwarding mode setting.

[0174] The function block FB2 is a program for selecting a forwarding mode, and is equivalent to a command included in the user program 124. Based on the fact that the first forwarding time T11 measured by the function block FB0 is shorter than the second forwarding time T12, a signal "True" (= enabled) indicating validity is input to the input section of the function block FB2. Based on this, the function block FB2 selects the PIO mode M1 when the current forwarding mode is the DMA mode M2. In addition, the function block FB1 does not select another mode when the current forwarding mode is the PIO mode M1, but maintains the current forwarding mode setting.

[0175] The values ​​of output elements OUT0 to OUT2 change according to the output values ​​of the associated function blocks. The variable "SettingTrigger" is assigned to output element OUT0. Output element OUT0 is associated with the output of function block FB0. As a result, the value of output element OUT0 changes according to the output value.

[0176] The variable "Done0" is allocated to the output element OUT1. The output element OUT1 is associated with the output of the function block FB1. As a result, the value of the output element OUT1 changes according to the value of the output of the function block FB1.

[0177] The variable "Done1" is assigned to the output element OUT2. The output element OUT2 is associated with the output of the function block FB2. As a result, the value of the output element OUT2 changes according to the value of the output of the function block FB2.

[0178] As described above, based on the measurement data (eg, measurement time), the DMA mode is selected by the function block FB1 and the PIO mode is selected by the function block FB2.

[0179] <Third Embodiment>

[0180] The PLC1a of the third embodiment is partially different from the PLC1 of the above-mentioned embodiment, and the remaining parts are implemented using the same structure. Therefore, the description of the same structure will not be repeated. The different structures and processes will be described below.

[0181] In the first embodiment, the control device 100 selects the forwarding method in response to the satisfaction of a predetermined condition. In contrast, in the third embodiment, the control device 100 selects the forwarding method in response to an instruction from the user.

[0182] [Device Structure of PLC1a]

[0183] Fig.10 1 is a schematic diagram showing the main structure of the PLC1a of the second embodiment. Typically, the PLC1a includes a control device 100, one or more functional units 200, and a support device 300. The support device 300 is electrically connected to the control device 100 and receives measurement data measured by the control device 100. The support device 300 includes a display unit 310 that displays an image based on the measurement data. The image displayed on the display unit 310 will be described later.

[0184] Reference Fig.11 The function of selecting a forwarding method in response to an instruction from a user is described below. Fig.11 1 is a functional block diagram for explaining a function of selecting a forwarding method of input data 134 in response to an instruction from a user. The operation processing unit 110 includes a measuring unit 116, a selecting unit 118, and a user program 124. The functions of the measuring unit 116 and the selecting unit 118 are implemented, for example, by a system program 122. The measuring unit 116 of the operation processing unit 110 transmits the measurement data to the support device 300. The support device 300 that receives the measurement data displays an image based on the measurement data on the display unit 310.

[0185] The selection unit 118 of the operation processing unit 110 can select the forwarding method based on the instruction from the user who operates the support device 300. More specifically, the selection unit 118 displays an image based on the measurement data on the display unit 310 in the support device 300. The support device 300 sends the selection instruction about the forwarding method selected by the user who observes the image displayed on the display unit 310 to the selection unit 118. The selection unit 118 selects the forwarding method based on the selection instruction. As a result, the PLC1 can select the best forwarding method corresponding to the amount of data in the system operation. More specifically, the PLC1 can select the forwarding method in response to the instruction from the user who instructs the selection of the forwarding method that shortens the time for forwarding the input data 134 from the buffer 132 to the storage unit 114 in the system operation. In addition, the PLC1 can shorten the time required for the IO refresh processing. In addition, the PLC1 can increase the processing (for example, processing based on the user program) executed in the primary periodic task other than the IO refresh processing by shortening the processing time in the IO refresh processing.

[0186] [Image based on measurement data]

[0187] Reference Fig.12 as well as Fig.13 The following describes an image displayed on the display unit 310 of the support device 300. More specifically, an image based on measurement data including transfer time in a first transfer method (e.g., PIO method) and an image based on measurement data including transfer time in a second transfer method (e.g., DMA method) are described. Fig.12 This is an image generated based on measurement data including the forwarding time in the first forwarding method. Fig.13 This is an image generated based on measurement data including the forwarding time in the second forwarding method.

[0188] Reference Fig.12 The first image 80 is an image showing the result of the calculation processing unit 110 measuring the forwarding in the first forwarding mode for about 2,000 times, for example. The first image 80 includes a first display area 81 and a second display area 82. The first display area 81 includes an image showing the task execution time.

[0189] The overall time of task execution time is the same as using Figure 2 or Figure 7The time corresponding to the control period T1 of the primary periodic task 1221 described above. That is, the task execution time indicates the time that at least includes the IO refresh processing. More specifically, when a certain amount of data (for example, 50KB) is stored in the buffer 132, when the forwarding time of the input data 134 is measured multiple times, the minimum forwarding time (minimum (Min)) with the shortest forwarding time in the measured data is displayed. The minimum forwarding time is, for example, 400μsec. Moreover, the average forwarding time (average (Average)) of the measured data during multiple measurements is displayed. The average forwarding time is, for example, 450μsec. Furthermore, the maximum forwarding time (maximum (Max)) with the longest forwarding time in the measured data is displayed. The maximum forwarding time is, for example, 550μsec. The set time (Set period) is the time corresponding to the control period T1, indicating the maximum time allowed in the forwarding of the communication data 20 (for example, 2,000μsec).

[0190] In this way, the display unit 310 of the support device 300 displays the maximum time allowed in forwarding the communication data 20 (for example, the input data 134) and the time actually measured when the input data 134 is forwarded by the PIO method. The measured time is, for example, at least one of the minimum forwarding time, the average forwarding time, and the maximum forwarding time. Based on the measurement data, the support device 300 displays the first image 80 on the display unit 310, and the first image 80 can compare the maximum time allowed in forwarding the communication data 20 with the forwarding time actually measured when the communication data is forwarded by the PIO method.

[0191] The vertical axis of the second display area 82 represents time (μsec), and the horizontal axis represents the number of times measured (times). The second display area 82 contains measurement data when the forwarding time is measured multiple times. The measured value 1001 represents the minimum forwarding time (for example, 400μsec). The measured value 1002 represents the maximum forwarding time (for example, 550μsec). The average line 1003 represents the average forwarding time (for example, 450μsec). The measured value 1001 representing the minimum forwarding time, the measured value 1002 representing the maximum forwarding time, and the average line 1003 representing the average forwarding time in the second display area 82 are values ​​corresponding to the minimum forwarding time, the maximum forwarding time, and the average forwarding time in the first display area 81.

[0192] The PLC 1 displays the first image 80 including the average forwarding time of the forwarding time in the first forwarding method on the display unit 310 of the support device 300, thereby providing the user with an image that allows the user to understand at a glance the average time when the input data 134 is forwarded in the PIO method. In addition, the PLC 1 displays the first image 80 including the minimum forwarding time and the maximum forwarding time in the first forwarding method and a plurality of measured values ​​on the display unit 310 of the support device 300, thereby providing the user with an image that allows the user to understand at a glance the degree of deviation in the forwarding time when the input data 134 is forwarded in the first forwarding method.

[0193] In addition, the measured values ​​1001, 1002, and average line 1003 in the second display area 82 may be displayed in a form that can be distinguished from other measured values. More specifically, the measured values ​​1001, 1002, and average line 1003 may be displayed in a manner that is distinguishable from other measured values, such as by changing at least one of color, shape, and size compared to other measured values. Furthermore, the measured values ​​1001, 1002, and average line 1003 may be displayed in a flashing manner.

[0194] Reference Fig.13 The second image 90 is an image showing the result of the calculation processing unit 110 measuring the transfer time in the DMA mode for about 2,000 times. The second image 90 includes a first display area 91 and a second display area 92. The first display area 91 includes an image showing the task execution time.

[0195] The overall time of task execution time is, for example, the same as using Figure 2 or Figure 7 The time corresponding to the control period T1 of the primary periodic task 1221 described above. That is, the task execution time at least represents the time including the IO refresh processing. More specifically, when a certain amount of data (for example, 50KB) is stored in the buffer 132, when the forwarding time of the input data 134 is measured multiple times, the minimum forwarding time (minimum (Min)) with the shortest forwarding time in the measured data is displayed. The minimum forwarding time is, for example, 880μsec. In addition, the average forwarding time (average (Average)) of the measured data during multiple measurements is displayed. The average forwarding time is, for example, 900μsec. Furthermore, the maximum forwarding time (maximum (Max)) with the longest forwarding time in the measured data is displayed. The maximum forwarding time is, for example, 920μsec. The set time (Set period) is the time corresponding to the control period T1, indicating the maximum time allowed in the forwarding of the communication data 20 (for example, 2,000μsec).

[0196] In this way, the display unit 310 of the support device 300 displays the maximum time allowed in forwarding the communication data 20 (for example, the input data 134) and the time actually measured when the input data 134 is forwarded by the second forwarding method. The measured time is, for example, at least one of the minimum forwarding time, the average forwarding time, and the maximum forwarding time. In this way, the support device 300 displays an image on the display unit 310 based on the measurement data, and the image can compare the maximum time allowed in forwarding the communication data 20 with the forwarding time actually measured when the communication data is forwarded by the second forwarding method.

[0197] The vertical axis of the second display area 92 represents time (μsec), and the horizontal axis represents the number of times measured (times). The second display area 92 contains measurement data when the forwarding time is measured multiple times. The measured value 1101 represents the minimum forwarding time (e.g., 880μsec). The measured value 1102 represents the maximum forwarding time (e.g., 920μsec). The average line 1103 represents the average forwarding time (e.g., 900μsec). The measured value 1101 representing the minimum forwarding time, the measured value 1102 representing the maximum forwarding time, and the average line 1103 representing the average forwarding time in the second display area 92 are values ​​corresponding to the minimum forwarding time, the maximum forwarding time, and the average forwarding time in the first display area 91.

[0198] The PLC 1 can provide the user with an image that allows the user to understand at a glance the average time when the input data 134 is forwarded by the second forwarding method by displaying the second image 90 including the average forwarding time of the forwarding time in the second forwarding method on the display unit 310 of the support device 300. In addition, the PLC 1 can provide the user with an image that allows the user to understand at a glance the degree of variation in the forwarding time when the input data 134 is forwarded by the second forwarding method by displaying the second image 90 including the minimum forwarding time and the maximum forwarding time in the second forwarding method and a plurality of measured values ​​on the display unit 310 of the support device 300.

[0199] In addition, the measured values ​​1101, 1102, and average line 1103 in the second display area 92 may be displayed in a form that can be distinguished from other measured values. More specifically, the measured values ​​1101, 1102, and average line 1103 may be displayed in a manner that is distinguishable from other measured values. More specifically, the measured values ​​1101, 1102, and average line 1103 may be displayed in a manner that is different from other measured values, such as by changing at least one of color, shape, and size. Furthermore, the measured values ​​1101, 1102, and average line 1103 may be displayed in a flashing manner.

[0200] [Device Structure of Support Device 300]

[0201] Fig.142 is a block diagram showing a hardware configuration example of the support device 300 constituting the control system of the present embodiment. Fig.14 The support device 300 includes a processor 311 such as a CPU or a microprocessing unit (MPU), an optical drive 315, a primary storage device 306, a secondary storage device 308, a display unit 310, a universal serial bus (USB) controller 312, a local area network controller 314, an input unit 316, and a display unit 310. These components are connected via a bus 320.

[0202] The processor 311 reads various programs stored in the secondary storage device 308 , expands and executes them in the main storage device 306 , thereby realizing various processes described below. The processor 311 generates an image displayed on the display unit 310 based on the measurement data 326 acquired from the control device 100 .

[0203] The secondary storage device 308 includes, for example, a hard disk drive (HDD) or a solid state drive (SSD). Typically, the secondary storage device 308 includes: a development program 322 for making a user program 124, defining a system structure, setting various parameters, etc.; a parameter setting tool 324 for specifying various variables; and measurement data 326 obtained from the control device 100. In addition, the OS and other necessary programs may also be stored in the secondary storage device 308. The support device 300 may also have an optical drive 315, which reads the program stored in the recording medium 305 (such as an optical recording medium such as a digital versatile disc (DVD)) that stores a computer-readable program non-disposably and installs it in the secondary storage device 308.

[0204] Various programs executed by the support device 300 may be installed via the computer-readable recording medium 305, or may be downloaded from a server device on the network, etc. In addition, the functions provided by the support device 300 of this embodiment may be implemented in the form of a part of a module provided by the OS.

[0205] The display unit 310 displays at least one of the first image 80 and the second image 90 generated by the processor 311 based on the measurement data 326 stored in the secondary storage device 308 .

[0206] The USB controller 312 controls the transmission of data with the control device 100 via the USB connection. The LAN controller 314 controls the transmission of data with other devices via an arbitrary network.

[0207] The input unit 316 includes a keyboard, a mouse, etc., and receives user operations. The display unit 310 includes a display, various indicators, a printer, etc., and outputs processing results from the processor 311, etc.

[0208] Figure 3 The figure shows a structural example in which the required functions are provided by executing a program by the processor 311, but part or all of these functions can also be implemented using dedicated hardware circuits (such as application specific integrated circuits (ASIC) or field programmable gate arrays (FPGA), etc.).

[0209] [Forwarding Method Selection Process in Second Embodiment]

[0210] Fig.15 The flowchart shows the process of selecting the forwarding method in response to the instruction from the user by the operation processing unit 110. In step S1006, the operation processing unit 110 outputs the measurement data including the first forwarding time and the second forwarding time, the degree of deviation from the first forwarding time, and the degree of deviation from the second forwarding time. The operation processing unit 110 outputs the measurement data to the support device 300.

[0211] In step S2001, the processing unit 110 determines whether an instruction from the user is received from the support device 300. If it is determined that an instruction from the user is received (Yes in step S2001), the processing unit 110 switches control to step S2002. If not (No in step S2001), the processing unit 110 switches control to step S1003 and continues processing until an instruction from the user is received. In addition, if an instruction from the user is not received even after a predetermined time has passed, the processing unit 110 ends. Fig.15 The forwarding method selection process shown.

[0212] In step S2002, the processing unit 110 selects any one of the multiple forwarding modes in response to the instruction from the user. More specifically, when the instruction from the user is to select the first forwarding mode, the processing unit 110 selects the first forwarding mode when the currently set forwarding mode is the second forwarding mode. When the currently set forwarding mode is the first forwarding mode, the processing unit 110 does not select a new forwarding mode, but continues to set the current mode.

[0213] <Modification>

[0214] In the first and second embodiments, a configuration example is shown in which the processor 112 of the operation processing unit 110 executes a program to provide the required functions, but part or all of these provided functions may be implemented using a dedicated hardware circuit (such as an ASIC or FPGA, etc.). Alternatively, the main part of the control device 100 may be implemented using hardware that complies with a general-purpose architecture (such as an industrial personal computer based on a general-purpose personal computer). In this case, virtualization technology may be used to execute multiple operating systems (OS) with different purposes in parallel, and the required applications may be executed on each OS.

[0215] In the second embodiment, in the PLC 1 , the control device 100 , the functional unit 200 , and the support device 300 are respectively configured as independent bodies, but a configuration may be adopted in which all or part of these functions are integrated into a single device.

[0216] In the second embodiment, the first image 80 and the second image 90 are described as being displayed independently on the display unit 310 . However, the first image 80 and the second image 90 may be displayed side by side on the display unit 310 .

[0217] In the second embodiment, various values ​​such as the minimum transfer time, the maximum transfer time, the average transfer time, and the set time described in the first image 80 and the second image 90 are examples, and other values ​​may be used.

[0218] <Notes>

[0219] The present embodiment described above includes the following technical ideas.

[0220] [Structure 1]

[0221] A control system, comprising:

[0222] One or more functional units 200;

[0223] The control device 100 receives and sends the communication data 20 that is transmitted among the one or more functional units 200.

[0224] The control device 100 comprises:

[0225] The communication circuit 130 includes a first storage unit 132 for temporarily storing the communication data 20;

[0226] The second storage unit 114 stores the communication data 20 forwarded from the first storage unit 132 by any one of a plurality of forwarding methods;

[0227] The processing unit 110 performs processing using the communication data 20 stored in the second storage unit 114; and

[0228] The DMA controller 140 is connected to the arithmetic processing unit 110 and the communication circuit 130.

[0229] The plurality of forwarding methods include: a first forwarding method in which the arithmetic processing unit 110 forwards the communication data 20 , and a second forwarding method in which the DMA controller 140 forwards the communication data 20 .

[0230] The processing unit 110 selects one of the first forwarding method and the second forwarding method according to an instruction from a user or a predetermined condition.

[0231] [Structure 2]

[0232] The control system according to structure 1, wherein

[0233] The processing unit 110 measures a first forwarding time and a second forwarding time, wherein the first forwarding time is any one of the time when the communication data 20 is forwarded to the second storage unit 114 by the first forwarding method, the forwarding time, and the time when the processing is performed, and the second forwarding time is any one of the time when the communication data 20 is forwarded to the second storage unit 114 by the second forwarding method, the forwarding time, and the time when the processing is performed,

[0234] The output includes measurement data of the first forwarding time and the second forwarding time.

[0235] [Structure 3]

[0236] According to the control system described in Structure 2, the processing unit 110 measures the first forwarding time and the second forwarding time when the power supply to the control device 100 is started or the structure of the one or more functional units 200 connected to the control device 100 is changed.

[0237] [Structure 4]

[0238] A control system according to structure 2 or 3, wherein the measurement data includes: an average first forwarding time among the first forwarding times when forwarding the communication data 20 by the first forwarding method is performed multiple times, and an average second forwarding time among the second forwarding times when forwarding the communication data 20 by the second forwarding method is performed multiple times,

[0239] The arithmetic processing unit 110 can select a forwarding method that performs forwarding in a shorter time, out of the first forwarding method that performs forwarding in the first average forwarding time and the second forwarding method that performs forwarding in the second average forwarding time.

[0240] [Structure 5]

[0241] A control system according to structure 2 or 3, wherein the measurement data includes: a degree of deviation in the first forwarding time when the forwarding of the communication data 20 is performed multiple times by the first forwarding method, and a degree of deviation in the second forwarding time when the forwarding of the communication data 20 is performed multiple times by the second forwarding method,

[0242] The arithmetic processing unit 110 can select a forwarding method that performs forwarding with a smaller degree of deviation, from between a first forwarding method that performs forwarding with a degree of deviation in the first forwarding time and a second forwarding method that performs forwarding with a degree of deviation in the second forwarding time.

[0243] [Structure 6]

[0244] The control system according to any one of Structures 2 to 5 further includes:

[0245] The support device 300 receives the measurement data.

[0246] The support device 300 includes a display unit 310, which displays an image based on the received measurement data, and the image can compare the maximum time allowed in forwarding the communication data 20 with the time actually measured when forwarding the communication data 20 through any one of the first forwarding method and the second forwarding method.

[0247] [Structure 7]

[0248] A control device 100 receives and sends communication data 20 that is transmitted between one or more functional units 200, and the control device 100 includes:

[0249] The communication circuit 130 includes a first storage unit 132 for temporarily storing the communication data 20;

[0250] The second storage unit 114 stores the communication data 20 forwarded from the first storage unit 132 by any one of a plurality of forwarding methods;

[0251] The processing unit 110 performs processing using the communication data 20 stored in the second storage unit 114; and

[0252] The DMA controller 140 is connected to the arithmetic processing unit 110 and the communication circuit 130.

[0253] The plurality of forwarding methods include: a first forwarding method in which the arithmetic processing unit 110 forwards the communication data 20 , and a second forwarding method in which the DMA controller 140 forwards the communication data 20 .

[0254] The processing unit 110 selects one of the first forwarding method and the second forwarding method according to an instruction from a user or a predetermined condition.

[0255] The embodiments disclosed this time should be considered as illustrative in all aspects and not restrictive. The scope of the present invention is indicated by the claims rather than the above description, and is intended to include all modifications within the meaning and scope equivalent to the claims.

Claims

1. A control system, comprising: one or more functional units; The control device receives and sends communication data that is transmitted between the one or more functional units. The control device comprises: The communication circuit has a first storage unit that temporarily stores the communication data; a second storage unit for storing the communication data forwarded from the first storage unit by any one of a plurality of forwarding methods; an operation processing unit that performs operation processing using the communication data stored in the second storage unit; and A direct memory access controller is connected to the arithmetic processing unit and the communication circuit. The plurality of forwarding modes include: a first forwarding mode in which the arithmetic processing unit forwards the communication data, and a second forwarding mode in which the direct memory access controller forwards the communication data. The processing unit selects one of the first forwarding method and the second forwarding method according to an instruction from a user or a predetermined condition, wherein The operation processing unit measures a first forwarding time and a second forwarding time, wherein the first forwarding time is any one of a time for forwarding the communication data to the second storage unit by the first forwarding method and a processing execution time including a forwarding time and a time for executing the operation processing, and the second forwarding time is any one of a time for forwarding the communication data to the second storage unit by the second forwarding method and a processing execution time including a forwarding time and a time for executing the operation processing, and outputting measurement data including the first forwarding time and the second forwarding time, The measurement data includes: a degree of deviation in the first forwarding time when the communication data is forwarded multiple times using the first forwarding method, and a degree of deviation in the second forwarding time when the communication data is forwarded multiple times using the second forwarding method. The arithmetic processing unit can select a forwarding method that performs forwarding with a smaller degree of deviation, of a first forwarding method that performs forwarding with a degree of deviation in the first forwarding time and a second forwarding method that performs forwarding with a degree of deviation in the second forwarding time.

2. The control system according to claim 1, wherein the processing unit measures the first forwarding time and the second forwarding time when power supply to the control device is started or when the structure of the one or more functional units connected to the control device is changed.

3. The control system according to claim 1 or 2, wherein the measurement data includes: an average first forwarding time among the first forwarding times when forwarding of the communication data by the first forwarding method is performed multiple times, and an average second forwarding time among the second forwarding times when forwarding of the communication data by the second forwarding method is performed multiple times, The arithmetic processing unit can select a forwarding method that performs forwarding in a shorter time, out of the first forwarding method that performs forwarding in the first average forwarding time and the second forwarding method that performs forwarding in the second average forwarding time.

4. The control system according to claim 1 or 2, further comprising: a support device for receiving the measurement data, The support device includes a display unit that displays an image based on the received measurement data, wherein the image can compare a maximum time allowed in forwarding the communication data with a time actually measured when the communication data is forwarded by either the first forwarding method or the second forwarding method.

5. A control device for receiving and transmitting communication data transmitted between one or more functional units, the control device comprising: The communication circuit has a first storage unit that temporarily stores the communication data; a second storage unit for storing the communication data forwarded from the first storage unit by any one of a plurality of forwarding methods; an operation processing unit that performs operation processing using the communication data stored in the second storage unit; and A direct memory access controller is connected to the arithmetic processing unit and the communication circuit. The plurality of forwarding modes include: a first forwarding mode in which the arithmetic processing unit forwards the communication data, and a second forwarding mode in which the direct memory access controller forwards the communication data. The processing unit selects one of the first forwarding method and the second forwarding method according to an instruction from a user or a predetermined condition, wherein The operation processing unit measures a first forwarding time and a second forwarding time, wherein the first forwarding time is any one of a time for forwarding the communication data to the second storage unit by the first forwarding method and a processing execution time including a forwarding time and a time for executing the operation processing, and the second forwarding time is any one of a time for forwarding the communication data to the second storage unit by the second forwarding method and a processing execution time including a forwarding time and a time for executing the operation processing, and outputting measurement data including the first forwarding time and the second forwarding time, The measurement data includes: a degree of deviation in the first forwarding time when the communication data is forwarded multiple times using the first forwarding method, and a degree of deviation in the second forwarding time when the communication data is forwarded multiple times using the second forwarding method. The arithmetic processing unit can select a forwarding method that performs forwarding with a smaller degree of deviation, of a first forwarding method that performs forwarding with a degree of deviation in the first forwarding time and a second forwarding method that performs forwarding with a degree of deviation in the second forwarding time.

Citation Information

Patent Citations

  • Control device and communication device

    JP2018129614A

  • Cpu of plc, system program for plc, and recording medium storing system program for plc

    CN103403633A

  • Data transfer discrimination device / Method

    JP1999353269A