Control device, data collection method, and data collection program
Patent Information
- Application Number
- JP2023126840
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
Smart Images

Figure 2025022361000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a control device, a data collection method, and a data collection program. [Background technology]
[0002] 2. Description of the Related Art Technologies relating to control devices (eg, programmable logic controllers (PLCs), industrial personal computers (PCs), etc.) that control devices used in manufacturing sites and the like have been proposed.
[0003] For example, JP 2020-67751 A (Patent Document 1) discloses a programmable logic controller that records device values in chronological order.
[0004] WO 2000 / 033147 (Patent Document 2) discloses a servo system controller having a device memory in which device information is stored.
[0005] Japanese Patent Laid-Open Publication No. 10-27011 (Patent Document 3) discloses a programmable controller including a data format imparting means for imparting a data format including an integer format to data, a unit physical quantity imparting means for imparting a unit physical quantity represented by one digit of the data, and an arithmetic processing means for performing arithmetic processing based on the data format and the unit physical quantity. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2020-67751 A [Patent Document 2] International Publication No. 2000 / 033147 [Patent Document 3] Japanese Patent Application Publication No. 10-27011 Summary of the Invention [Problem to be solved by the invention]
[0007] Generally, such a control device periodically executes a number of processes, including a collection process, in accordance with a control cycle. The collection process is a process for storing candidate variable data in a specified storage area in memory. If the collection process takes a long time, the task is not executed in accordance with the control cycle. This causes problems such as delays in the execution of other processes in the task, longer intervals between commands to the motion control, and missed sensor data.
[0008] An object of the present disclosure is to reduce the time required for variable data collection processing. [Means for solving the problem]
[0009] A control device for controlling an appliance according to an aspect of the present disclosure includes a collection unit that collects variable data of candidates to be stored. The control device manages a plurality of control variables. The plurality of control variables include one or more first variables indicating whether the appliance is controlled by the control device, and one or more second variables other than the one or more first variables. The collection unit performs a first operation of including the variable data of the one or more second variables in the variable data of the candidates to be stored when the one or more first variables indicate that the appliance is controlled by the control device, and not including the variable data of the one or more second variables in the variable data of the candidates to be stored when the one or more first variables indicate that the appliance is not controlled by the control device.
[0010] According to this configuration, the time required for the variable data collection process can be reduced.
[0011] In the above disclosure, preferably, each of the plurality of control variables is a structure, and the one or more second variables include at least one of one or more command value variables indicating a command value from the control device to the device, one or more current value variables indicating a state value of the device, and one or more sets of unit conversion variables for converting units.
[0012] Generally, the number of such second variables is large, and is equal to or greater than 1. Therefore, with this configuration, the time required for the variable data collection process can be reduced.
[0013] In the above disclosure, the plurality of control variables are preferably a plurality of axis variables for controlling a servo motor, a plurality of robot variables for controlling a robot, or a plurality of temperature control variables for controlling a heater.
[0014] Generally, there are a large number of such control variables, so this configuration can reduce the time required for the variable data collection process.
[0015] In the above disclosure, preferably, when the collection unit receives a trigger for forced collection, the collection unit disables the first operation and performs a second operation of including variable data of one or more second variables in the variable data to be saved, regardless of whether the one or more first variables indicate that the device is controlled by the control device.
[0016] According to this configuration, variable data can be collected more flexibly in accordance with the needs of the user.
[0017] In the above disclosure, the control device preferably receives the trigger from a setting device that receives setting information of the control device.
[0018] According to this configuration, the user can easily instruct the control device to perform forced collection.
[0019] In the above disclosure, the control device preferably includes a user program for controlling the device, the user program including a program part for issuing a trigger.
[0020] According to this configuration, the user can easily create a program that instructs the control device to perform forced collection.
[0021] A data collection method by a control device that controls an appliance according to another aspect of the present disclosure includes collecting variable data of candidates to be stored. The control device manages a plurality of control variables. The plurality of control variables include one or more first variables indicating whether the appliance is controlled by the control device, and one or more second variables other than the one or more first variables. Collecting the variable data of the candidates to be stored includes performing a first operation of including the variable data of the one or more second variables in the variable data of the candidates to be stored if the one or more first variables indicate that the appliance is controlled by the control device, and not including the variable data of the one or more second variables in the variable data of the candidates to be stored if the one or more first variables indicate that the appliance is not controlled by the control device.
[0022] According to this configuration, the time required for the variable data collection process can be reduced.
[0023] A data collection program according to another aspect of the present disclosure causes one or more computers to execute the above data collection method.
[0024] According to this configuration, the time required for the variable data collection process can be reduced. Effect of the Invention
[0025] According to the present disclosure, it is possible to reduce the time required for variable data collection processing. [Brief description of the drawings]
[0026] [Figure 1] FIG. 1 is a diagram illustrating a data collection system according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a diagram illustrating an example of a hardware configuration of a control device according to the present embodiment. [Diagram 3] FIG. 4 is a diagram showing an example of a plurality of axis variables for controlling a servo motor in the present embodiment. [Figure 4] FIG. 4 is a diagram showing an example of a plurality of temperature control variables for controlling a heater in the present embodiment. [Diagram 5]FIG. 2 is a diagram showing an example of a plurality of robot variables for controlling a robot in the present embodiment. [Figure 6] FIG. 2 is a diagram illustrating an example of a task executed by the control device in the present embodiment. [Figure 7] 4 is a diagram showing an overview of a process for collecting and storing variable data by a control device in the present embodiment. FIG. [Figure 8] FIG. 2 is a diagram showing a first variable data storage method according to the present embodiment. [Figure 9] FIG. 11 is a diagram showing a second variable data storage method according to the present embodiment. [Figure 10] FIG. 13 is a diagram showing an example of a setting screen for setting storage conditions for variable data in the present embodiment. [Figure 11] 5 is a flowchart showing a procedure of a process related to collection and storage of variable data by a control device in the present embodiment. [Figure 12] 10 is a flowchart showing the procedure of a subroutine for collecting variable data, which is started in step S2 in the present embodiment. [Figure 13] 13 is an example of a screen for receiving an instruction to change a collection method of variable data in the present embodiment. [Figure 14] 10 is a flowchart showing a procedure for changing a variable data collection method when an instruction to change the variable data collection method is received from a touch panel in the present embodiment. [Figure 15] 2 is a diagram showing an example of a function block included in a user program in the present embodiment. FIG. [Figure 16] 16 is a diagram showing definition data of variables used in the function block shown in FIG. 15. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0027] Hereinafter, embodiments and modifications according to the present disclosure will be described with reference to the drawings. In the following description, the same parts and components are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed descriptions thereof will not be repeated. Note that the embodiments and modifications described below may be selectively combined as appropriate.
[0028] [Embodiment] [A. Application Example] First, an example of a scenario to which the present disclosure is applied will be described.
[0029] FIG. 1 is a diagram showing a data collection system according to the present embodiment. The data collection system 1 according to the present embodiment includes a control device 100, a support device 200, a touch panel 300, and one or more field devices 800.
[0030] The control device 100, the support device 200, and the touch panel 300 are connected to each other via a host network 901. The host network 901 is, for example, a general-purpose Ethernet (registered trademark). Note that the control device 100 and the support device 200 may be connected to each other via a USB (Universal Serial Bus).
[0031] The control device 100 is connected to one or more field devices 800 via a field network 902. It is preferable to adopt a bus or network that performs periodic communication with guaranteed data arrival time for the field network 902. As such a bus or network that performs periodic communication, EtherCAT (registered trademark), EtherNet / IP (registered trademark), DeviceNet (registered trademark), CompoNet (registered trademark), etc. are known.
[0032] The control device 100 is, for example, a computer such as a PLC (Programmable Logic Controller) or an industrial PC (Personal Computer). The control device 100 controls one or more field devices 800 in accordance with a user program 118 (see FIG. 2) created in advance. Each of the one or more field devices 800 includes an actuator that exerts some kind of physical action on a production facility or a production line (hereinafter collectively referred to as a "field"), various sensors installed in the field, or an input / output device that exchanges information with the field.
[0033] 1, the one or more field devices 800 include, but are not limited to, a field device 721 including a servo motor driver 701 and a servo motor 711, a field device 722 including a temperature regulator 702 and a heater 712, and a field device 723 including a robot controller 703 and a robot 713. In the following description, when there is no need to distinguish between the one or more field devices 800, they will be referred to as "field device 700." The field device 700 is an example of "device" in this disclosure.
[0034] The control device 100 manages a plurality of control variables for each of one or more field devices 800. Each of the plurality of control variables is a structure. Each of the plurality of control variables indicates a control target of the control device 100. More specifically, the plurality of control variables are a plurality of axis variables for controlling a servo motor, a plurality of robot variables for controlling a robot, or a plurality of temperature control variables for controlling a heater. In this embodiment, the control device 100 manages a plurality of axis variables for controlling a servo motor 711 for the field device 721, a plurality of temperature control variables for controlling a heater 712 for the field device 722, and a plurality of robot variables for controlling a robot 713 for the field device 723.
[0035] The multiple control variables include one or more first variables indicating whether the field device 700 is controlled by the control device 100, and one or more second variables other than the one or more first variables.
[0036] The first variable is, for example, a control state variable. The one or more second variables include at least one of one or more command value variables indicating a command value from the control device 100 to the field device 700, one or more current value variables indicating a state value of the field device 700, and one or more sets of unit conversion variables for converting units. As an example, the unit conversion variable is used to calculate the value of the current value variable from a value acquired by the field device 700. As another example, the unit conversion variable is used to convert the unit of the value of the command value variable.
[0037] The control device 100 periodically executes a plurality of processes including a collection process in accordance with a control cycle. The collection process is a process of storing candidate variable data in a predetermined storage area in the memory 102 (see FIG. 2). The candidate variable data is a candidate for variable data to be stored in the memory card 106A or the like when an abnormality occurs in at least one of the one or more field devices 800. In the following description, storing candidate variable data in a predetermined storage area in the memory 102 is referred to as "collection". In the following description, the variable data to be stored in the memory card 106A or the like when an abnormality occurs in at least one of the one or more field devices 800 is referred to as "variable data to be stored".
[0038] The variable data collection methods include a first collection method in which a first operation is performed for each of the one or more field devices 800, and a second collection method in which the first operation is disabled and a second operation is performed for each of the one or more field devices 800.
[0039] The first operation is an operation of including variable data of one or more second variables corresponding to the field device 700 in the variable data of the candidate to be stored when one or more first variables corresponding to the field device 700 indicate that the field device 700 is controlled by the control device 100, and not including variable data of one or more second variables corresponding to the field device 700 in the variable data of the candidate to be stored when one or more first variables corresponding to the field device 700 indicate that the field device 700 is not controlled by the control device 100.
[0040] In other words, when the collection process is performed using the first collection method, variable data of one or more second variables corresponding to each of one or more first field devices among the one or more field devices 800 that are controlled by the control device 100 is collected, but variable data of one or more second variables corresponding to each of one or more second field devices among the one or more field devices 800 that are not controlled by the control device 100 is not collected.
[0041] On the other hand, the second operation is an operation of including the variable data of one or more second variables corresponding to the field device 700 in the variable data of candidates for storage, regardless of whether the one or more first variables corresponding to the field device 700 indicate that the field device 700 is controlled by the control device 100.
[0042] That is, when the collection process is performed in the second collection method, variable data of one or more second variables is collected for all of the one or more field devices 800. In the following description, performing the collection process in the second collection method is also referred to as “forced collection”.
[0043] The control device 100 performs the collection process in the first collection method in principle, and performs the collection process in the second collection method only when a forced collection is instructed.
[0044] After the collection process, if an abnormality occurs in at least one of the one or more field devices 800, the control device 100 extracts the variable data to be stored from the variable data stored in the memory 102, and stores the variable data to be stored in the memory card 106A.
[0045] The support device 200 is an example of a setting device that receives the setting information of the control device 100. The support device 200 is a device that supports the preparations necessary for the control device 100 to control one or more field devices 800. Specifically, the support device 200 provides a development environment for the program executed by the control device 100 (program creation / editing tools, parser, compiler, etc.), a setting environment for setting parameters (configurations) of the control device 100 and various devices connected to the control device 100, a function of outputting the generated user program to the control device 100, and a function of online correcting the user program executed on the control device 100, etc.
[0046] The touch panel 300 is an example of a setting device that receives the setting information of the control device 100. The touch panel 300 receives an operation from the user and outputs a command corresponding to the user operation to the control device 100. In addition, the touch panel 300 displays the calculation result on the control device 100, etc.
[0047] The control device 100 can perform the collection process in the first collection method. When the collection process is performed in the first collection method, by the first operation, the variable data of one or more second variables corresponding to each of the one or more first field devices controlled by the control device 100 among the one or more field devices 800 is collected, but the variable data of one or more second variables corresponding to each of the one or more second field devices not controlled by the control device 100 among the one or more field devices 800 is not collected. Therefore, the control device 100 can shorten the time required for the collection process of the variable data.
[0048] <B. Hardware Configuration Example> Next, an example of the hardware configuration of the control device 100 in this embodiment will be described.
[0049] 2 is a diagram showing an example of a hardware configuration of a control device according to the present embodiment. The control device 100 includes, for example, a processor 101, a memory 102, a storage 103, a host network controller 104, a field network controller 105, a memory card interface 106, a timer 107, and a clock 108.
[0050] The processor 101 is, for example, a CPU (Central Processing Unit). The processor 101 reads out a control program 113 stored in a storage 103, loads the control program 113 into a memory 102, and executes the program.
[0051] The memory 102 is configured with a volatile storage device such as a dynamic random access memory (DRAM) or a static random access memory (SRAM), etc. The memory 102 temporarily stores variable data of candidates for storage.
[0052] The storage 103 is configured with a non-volatile storage device such as, for example, a hard disk drive (HDD), a solid state drive (SSD), or a flash memory.
[0053] The storage 103 stores a control program 113. The control program 113 includes a plurality of computer-readable instructions for controlling the control device 100. The processor 101 executes the control program 113 to control each unit of the control device 100 and realize various processes according to the present embodiment.
[0054] More specifically, the control program 113 includes a system program 114 , a user program 118 , an anomaly detection program 120 , a data collection program 121 , and a storage program 122 .
[0055] The system programs 114 include an OS (Operating System) 115 for implementing the basic functions of the control device 100, a scheduler program 116, and an input / output program 117.
[0056] The scheduler program 116 provides a function for managing the execution order and execution timing of one or more tasks or one or more processes that constitute the control program 113 .
[0057] The input / output program 117 provides a function to obtain input data (e.g., variable data of a current value variable and variable data of a unit conversion variable, etc.) from one or more field devices 800. The input / output program 117 also provides a function to output a command value (variable data of a command value variable, etc.) calculated by executing the user program 118 and variable data of a unit conversion variable to the field device 700 corresponding to the command value.
[0058] The user program 118 provides a control calculation function and controls each of the one or more field devices 800. The user program 118 can be configured arbitrarily according to each of the one or more field devices 800. The user program 118 can be defined by ladder logic using function blocks or the like. In the example shown in FIG. 2, the user program 118 includes a motion calculation 119. Based on input data (variable data) from the one or more field devices 800 and an instruction included in the user program 118, the motion calculation 119 generates a command value for the field device 700 corresponding to the instruction.
[0059] The abnormality detection program 120 provides a function for determining whether or not an abnormality has occurred in one or more field devices 800 .
[0060] The data collection program 121 provides a function for storing candidate variable data for storage in a predetermined storage area in the memory 102 .
[0061] The save program 122 provides a function of extracting variable data to be saved from the variable data stored in the memory 102 and saving the variable data to be saved in the memory card 106A when a save trigger occurs. The save trigger occurs when the processor 101 determines that an abnormality has occurred in at least one of the one or more field devices 800.
[0062] Each program shown in FIG. 2 may be provided not as a standalone program but as part of an arbitrary program. In this case, the processing according to this embodiment is realized in cooperation with the arbitrary program. Even if the program does not include some of these modules, it does not deviate from the spirit of the control device 100 according to this embodiment. In addition, some or all of the functions provided by each program shown in FIG. 2 may be realized by dedicated hardware.
[0063] The storage 103 stores data type definition data 124. The data type definition data 124 defines the data types of all variables managed by the control device 100.
[0064] The storage 103 stores the setting information 125. The setting information 125 includes a collection condition for variable data, a storage condition for variable data, and other setting information for the control device 100.
[0065] The collection condition of the variable data includes a collection method of the variable data. The storage condition of the variable data includes a storage method of the variable data. The storage method of the variable data includes a first storage method and a second storage method. When the storage method of the variable data is the first storage method, the storage condition of the variable data further includes a pre-trigger collection time and a post-trigger collection time. When the storage method of the variable data is the second storage method, the storage condition of the variable data further includes a collection period. The first storage method, the second storage method, the pre-trigger collection time, the post-trigger collection time, and the collection period will be described later with reference to FIG. 8 and FIG. 9.
[0066] The setting information 125 is downloaded from the support device 200 or the touch panel 300 to the storage 103 before the operation of the control device 100 is started.
[0067] The upper network controller 104 exchanges data with devices (such as the support device 200 and the touch panel 300) connected to the upper network 901 via the upper network 901.
[0068] The field network controller 105 exchanges data with one or more field devices 800 via the field network 902.
[0069] The memory card interface 106 reads and writes data to and from the removable memory card 106A. The memory card 106A is an example of an external storage that is connected without going through the control device 100 and a network (such as the upper network 901 and the field network 902).
[0070] The timer 107 is configured to include a clock circuit or a counter circuit that measures time. Note that the timer 107 is not limited to such a circuit and may be configured by a software module executed by the processor 101. The clock 108 indicates the current time.
[0071] <C. Processing> Next, the processing of the data collection system 1 in the present embodiment will be described.
[0072] (c1: Multiple control variables) With reference to FIGS. 3 to 5, the multiple control variables managed by the control device 100 for each of the one or more field devices 800 will be described.
[0073] FIG. 3 is a diagram showing an example of a plurality of axis variables for controlling a servo motor in this embodiment. The plurality of axis variables shown in FIG. 3 are an example of a plurality of control variables managed by the control device 100 for the field device 721 (see FIG. 1). In the example shown in FIG. 3, the servo motor 711 (see FIG. 1) includes N axes from zero to N-1. In the example shown in FIG. 3, N is an integer equal to or greater than 1. In the example shown in FIG. 3, the plurality of axis variables include four control state variables (variables v1 to v4), one unit conversion variable (a pair of variable v5 and variable v6), four command value variables (variables v7 to v10), and four current value variables (variables v11 to v14).
[0074] The variables v1 to v4 are an example of a first variable that is equal to or greater than 1. When the value of at least one of the variables v1 to v3 is TRUE, the servo motor 711 is not controlled by the control device 100. On the other hand, when the value of the variable v4 is TRUE, the servo motor 711 is controlled by the control device 100. The variables v5 to v14 are an example of a second variable that is equal to or greater than 1.
[0075] The pair of variables v5 and v6 is used to calculate the value of the current value variable from the value acquired by the field device 721. More specifically, the counter value of the encoder is converted into a numerical value in physical units indicating the current position of the shaft of the servo motor 711, using the pair of variables v5 and v6 and the following formula 1.
[0076] (Current position [mm]) = (Counter value) × (Physical amount of one motor revolution [mm]) / (Counter value for one motor revolution) Formula 1
[0077] "Current position" in formula 1 is the value of variable v11, which is a current value variable. "Counter value" in formula 1 is a value acquired by the field device 721. "Physical amount of one motor rotation" in formula 1 is the value of variable v6. "Counter value of one motor rotation" in formula 1 is the value of variable v5.
[0078] Furthermore, the pair of variables v5 and v6 is used to convert the unit of the value of the command value variable. More specifically, the command position expressed in a numerical value of physical units is converted into a command value (motor command value) for the servo motor 711 using the pair of variables v5 and v6 and the following formula 2.
[0079] (Motor command value) = (Command position [deg]) × (Counter value for one motor rotation) / (Physical amount for one motor rotation [deg]) Equation 2
[0080] The "command position" in Equation 2 is the value of variable v7, which is a command value variable. The "counter value per one motor revolution" in Equation 2 is the value of variable v5. The "physical quantity per one motor revolution" in Equation 2 is the value of variable v6.
[0081] FIG. 4 is a diagram showing an example of a plurality of temperature control variables for controlling a heater in this embodiment. The plurality of temperature control variables shown in FIG. 4 are an example of a plurality of control variables managed by the control device 100 for the field device 722 (see FIG. 1). In the example shown in FIG. 4, the heater 712 (see FIG. 1) includes N control objects from zero to N-1. In the example shown in FIG. 4, N is an integer equal to or greater than 1. In the example shown in FIG. 4, the plurality of temperature control variables include two control state variables (variable v15 and variable v16), two sets of unit conversion variables (a pair of variable v17 and variable v18, and a pair of variable v19 and variable v20), one command value variable (variable v21), and one current value variable (variable v22).
[0082] The variables v15 and v16 are examples of a first variable that is equal to or greater than 1. When the value of the variable v15 is TRUE, the heater 712 is controlled by the control device 100. On the other hand, when the value of the variable v16 is TRUE, the heater 712 is not controlled by the control device 100. The variables v17 to v22 are examples of a second variable that is equal to or greater than 1.
[0083] The pair of variables v17 and v18 is used to calculate the value of the current value variable from the value acquired by the field device 722. More specifically, by using the pair of variables v17 and v18, it is possible to convert the value acquired by the field device 722 (e.g., an analog input value) into a numerical value in physical units indicating the current temperature (the value of variable v22, which is the current value variable). On the other hand, the pair of variables v19 and v20 is used to convert the unit of the value of the command value variable. More specifically, by using the pair of variables v19 and v20, it is possible to convert the command temperature expressed in a numerical value in physical units (the value of variable v21, which is the command value variable) into a command value for the heater 712.
[0084] FIG. 5 is a diagram showing an example of a plurality of robot variables for controlling a robot in this embodiment. The plurality of robot variables shown in FIG. 5 are an example of a plurality of control variables managed by the control device 100 for the field device 723 (see FIG. 1). In the example shown in FIG. 5, there are N robots 713 (see FIG. 1). Each of the N robots includes six axes, zero to five. In the example shown in FIG. 5, N is an integer equal to or greater than 1. In the example shown in FIG. 5, the plurality of robot variables include four control state variables (variables v23 to v26), six command value variables (variables v27 to v32), and six current value variables (variables v33 to v38).
[0085] The variables v23 to v26 are an example of a first variable that is equal to or greater than 1. When the value of at least one of the variables v23 to v25 is TRUE, the robot 713 is not controlled by the control device 100. On the other hand, when the value of the variable v26 is TRUE, the robot 713 is controlled by the control device 100. The variables v27 to v38 are an example of a second variable that is equal to or greater than 1.
[0086] 3 to 5, the control state variables are BOOL type variables. Meanwhile, the command value variables and the current value variables are LREAL type variables. The LREAL type variables are floating-point type variables. Also, each pair of unit conversion variables is composed of an LREAL type variable and a UDINT type variable. That is, the one or more second variables include many floating-point type variables.
[0087] (c2: Task executed by the control device 100) Fig. 6 is a diagram showing an example of tasks executed by the control device in this embodiment. The control device 100 executes a control task for performing real-time control of one or more field devices 800, and an associated processing task for performing associated processing related to the real-time control. A primary periodic task 131, an event task 132, a periodic task 133, and a periodic task 134 shown in Fig. 6 are examples of control tasks. A system service 135 shown in Fig. 6 is an example of an associated processing task.
[0088] The primary periodic task 131 includes a process that is executed with the highest priority (top priority) compared to other tasks in the control device 100. The primary periodic task 131 is executed periodically at a primary period 141 that corresponds to a control period.
[0089] "IO" in FIG. 6 indicates I / O refresh processing. "UPG" in FIG. 6 indicates user program execution processing. "MC" in FIG. 6 indicates motion control processing. "SMP" in FIG. 6 indicates collection processing. The primary periodic task 131 includes I / O refresh processing, user program execution processing, motion control processing, and collection processing. The I / O refresh processing is realized by the processor 101 executing the input / output program 117. In the I / O refresh processing, first, a command value is output from the control device 100 to one or more field devices 800. Then, input data (variable data) is input from one or more field devices 800 to the control device 100.
[0090] The user program execution process is a process in which the processor 101 executes a user program 118. The motion control process is realized by the processor 101 executing a motion calculation 119.
[0091] The collection process is one of the processes realized by the processor 101 executing the data collection program 121, in which variable data that is a candidate for storage is associated with collection time information indicating the collection time and stored in the data buffer 161 (see Figure 7) in the memory 102.
[0092] The event task 132 includes a process that is executed with a lower priority than the primary periodic task 131. The event task 132 includes a user program execution process. The event task 132 is executed when a task execution condition is met.
[0093] The periodic task 133 includes a process that is executed with a lower priority than the event task 132. The periodic task 133 includes a user program execution process and a collection process. The periodic task 133 is executed periodically at a task period 143 that corresponds to a control period.
[0094] The periodic task 134 includes a process that is executed with a lower priority than the periodic task 133. The periodic task 134 includes a user program execution process and a collection process. The periodic task 134 is executed periodically at a task period 144 that corresponds to a control period.
[0095] The system service 135 includes a process ("SS" shown in FIG. 6) that has a lower priority than the periodic task 134. In the system service 135, for example, among the processes realized by the processor 101 executing the data collection program 121, a process is executed in which at least a part of the variable data stored in the data buffer 161 is stored in the ring buffer 162 (see FIG. 7) in association with collection time information.
[0096] (c3: Overview of processing related to collection and storage of variable data by the control device 100) FIG. 7 is a diagram showing an overview of a process for collecting and storing variable data by the control device in this embodiment.
[0097] The control device 100 includes a collection unit 151 , a first extraction unit 152 , a storage processing unit 153 , a data buffer 161 , and a ring buffer 162 .
[0098] The collection unit 151 is realized by the processor 101 executing the data collection program 121. The first extraction unit 152 and the storage processing unit 153 are realized by the processor 101 executing the storage program 122. The data buffer 161 and the ring buffer 162 are both storage areas secured in the memory 102.
[0099] The collection unit 151 collects variable data of candidates to be stored. More specifically, when a condition for starting collection of variable data is satisfied, the collection unit 151 performs a collection process according to a control period, and stores the variable data of the candidates to be stored in the data buffer 161 in association with collection time information indicating the collection time.
[0100] More specifically, the collection unit 151 performs collection processing in the first collection method or the second collection method based on the determination result of whether or not forced collection has been instructed. When a trigger for forced collection is received, the collection unit 151 determines that forced collection has been instructed. The collection unit 151 receives the trigger for forced collection from the touch panel 300 or the user program 118.
[0101] When forced collection is not instructed, the collection unit 151 performs collection processing in the first collection method. That is, when forced collection is not instructed, the collection unit 151 performs a first operation for each of one or more field devices 800, and stores the variable data of storage candidates in the data buffer 161 in association with collection time information indicating the collection time.
[0102] On the other hand, when forced collection is instructed, the collection unit 151 performs collection processing in the second collection method. That is, when forced collection is instructed, the collection unit 151 disables the first operation, performs the second operation for each of the one or more field devices 800, and stores the variable data of the candidates for storage in the data buffer 161 in association with collection time information indicating the collection time.
[0103] Here, with reference again to Figs. 3 to 5, a first operation performed when forced collection is not instructed, and a second operation performed when forced collection is instructed will be described.
[0104] First, a first operation performed when forced collection is not instructed will be described with reference to Figures 3 to 5. When forced collection is not instructed, the collection unit 151 checks the values of one or more first variables for each of one or more field devices 800. More specifically, when forced collection is not instructed, the collection unit 151 checks the values of variables v1 to v4, variables v15 to v16, and variables v23 to v26.
[0105] When at least one of the variables v1 to v3 is TRUE, the collection unit 151 determines that the field device 721 is not controlled by the control device 100, and does not include the variable data of the variables v5 to v14 in the variable data to be stored. On the other hand, when the variable v4 is TRUE, the collection unit 151 determines that the field device 721 is controlled by the control device 100, and includes the variable data of the variables v5 to v14 in the variable data to be stored.
[0106] When the variable v15 is TRUE, the collection unit 151 determines that the field device 722 is controlled by the control device 100, and includes the variable data of the variables v17 to v22 in the variable data of the candidates to be stored. On the other hand, when the variable v16 is TRUE, the collection unit 151 determines that the field device 722 is not controlled by the control device 100, and does not include the variable data of the variables v17 to v22 in the variable data of the candidates to be stored.
[0107] When at least one of the variables v23 to v25 is TRUE, the collection unit 151 determines that the field device 723 is not controlled by the control device 100, and does not include the variable data of the variables v27 to v38 in the variable data of the candidates to be stored. On the other hand, when the variable v26 is TRUE, the collection unit 151 determines that the field device 723 is controlled by the control device 100, and includes the variable data of the variables v27 to v38 in the variable data of the candidates to be stored.
[0108] Then, the collection unit 151 stores the variable data of the candidates for storage in the data buffer 161 in association with collection time information indicating the collection time.
[0109] Next, a second operation performed when forced collection is instructed will be described with reference to Fig. 3 to Fig. 5. When forced collection is instructed, the collection unit 151 includes, in the variable data of candidates to be stored, the variable data of one or more second variables corresponding to each of one or more field devices 800, regardless of whether the field device is controlled by the control device 100 or not. That is, the collection unit 151 includes, in the variable data of candidates to be stored, the variable data of variables v5 to v14, the variable data of variables v17 to v22, and the variable data of variables v27 to v38. Then, the collection unit 151 stores the variable data of candidates to be stored in the data buffer 161 in association with collection time information indicating the collection time.
[0110] Referring again to FIG. 7, after the collection process, in the system service 135 (see FIG. 6), the collection unit 151 stores at least a portion of the variable data of candidates for storage stored in the data buffer 161 in the ring buffer 162 in association with collection time information.
[0111] When the first storage method is set in the control device 100 as the variable data storage method, the collection unit 151 stores all of the variable data candidates stored in the data buffer 161 in association with collection time information in the ring buffer 162. On the other hand, when the second storage method is set in the control device 100 as the variable data storage method, the collection unit 151 stores only the variable data corresponding to a predetermined collection period among the variable data candidates stored in the data buffer 161 in association with collection time information in the ring buffer 162.
[0112] When a save trigger occurs, the first extraction unit 152 extracts variable data for a period to be saved that is determined based on the occurrence time of the save trigger from the variable data of candidates to be saved stored in the ring buffer 162. More specifically, when a save trigger occurs, the first extraction unit 152 first determines the period to be saved based on the saving conditions of the variable data in the setting information 125 stored in the storage 103. Next, based on the collection time information stored in the ring buffer 162, the first extraction unit 152 extracts, as variable data to be saved, the variable data of candidates to be saved that is associated with collection time information indicating a time within the period to be saved from the ring buffer 162.
[0113] Here, two variable data saving methods and a method for setting variable data saving conditions will be described with reference to Figs. 8 to 10.
[0114] 8 is a diagram showing a first storage method among the variable data storage methods in this embodiment. In the first storage method, the collection unit 151 stores all of the variable data of storage candidates stored in the data buffer 161 by the collection process in the ring buffer 162 in association with collection time information. In the first storage method, the first extraction unit 152 determines the period before and after the occurrence of a storage trigger as the period to be stored.
[0115] More specifically, in the first storage method, the first extraction unit 152 determines, as the period to be stored, the period from timing t1, which is a first predetermined time before timing T0 when the storage trigger occurs, to timing t2, which is a second predetermined time after timing T0 when the storage trigger occurs. In the following description, the period from timing t1 to timing T0 is also referred to as the "pre-trigger collection time," and the period from timing T0 to timing t2 is also referred to as the "post-trigger collection time."
[0116] In the first storage method, the collection unit 151 executes a collection process in accordance with a control cycle from when a storage trigger occurs until at least a post-trigger collection time has elapsed, and stores the variable data of storage candidates in the data buffer 161 in association with the collection time information. In the first storage method, the collection unit 151 stores all of the variable data of storage candidates stored in the data buffer 161 by the collection process in the ring buffer 162 in association with the collection time information. In the first storage method, the first extraction unit 152 extracts, from the ring buffer 162, the variable data of storage candidates associated with collection time information indicating a time within the period from timing t1 to timing t2 as variable data to be stored.
[0117] 9 is a diagram showing a second storage method among the variable data storage methods in this embodiment. In the second storage method, the collection unit 151 stores only the variable data corresponding to a predetermined collection period among the variable data of storage candidates stored in the data buffer 161 by the collection process in the ring buffer 162 in association with collection time information. In the second storage method, the first extraction unit 152 determines the latest collection period before the occurrence of a storage trigger as the period to be stored. The collection period is the period from timing t3, t5 when the start trigger occurs to timing t4, t6.
[0118] For example, if it takes 30 seconds to press a workpiece coming down a production line, but it is known that the period during which a problem may occur is the first 20 seconds, the start trigger for the collection period can be set to the establishment of a start condition for the press processing of the workpiece, and the collection period can be set to 20 seconds. With such a setting, the variable data candidates for storage stored in the ring buffer 162 are limited to variable data for the period during which a problem may occur, making it easier to refer to the variable data when a problem occurs.
[0119] In the second saving method, the first extracting unit 152 determines the latest collection period before the timing T0 when the saving trigger occurs (the period from timing t5 to timing t6) as the period to be saved. The first extracting unit 152 extracts, from the ring buffer 162, the variable data of the candidates to be saved that are associated with the collection time information indicating the time within the period from timing t5 to timing t6.
[0120] 10 is a diagram showing an example of a setting screen for setting the variable data storage conditions in this embodiment. The setting screen G1 is displayed on the support device 200 or the touch panel 300, and is operated by a user. The setting screen G1 includes buttons 11 and 12 for selecting a variable data storage method, and a button 16 for reflecting the variable data storage conditions specified on the setting screen G1 in the control device 100.
[0121] The setting screen G1 further includes an input box 13 for inputting a pre-trigger collection time of the first storage method, and an input box 14 for inputting a post-trigger collection time of the first storage method. The setting screen G1 further includes an input box 15 for inputting a collection period of the second storage method.
[0122] When button 11 and button 16 are pressed, the control device 100 sets the first storage method as the storage method for variable data, sets the number entered in input box 13 as the pre-trigger collection time, and sets the number entered in input box 14 as the post-trigger collection time.
[0123] When button 12 and button 16 are pressed, the control device 100 sets the second storage method as the variable data storage method, and sets the value input in the input box 15 as the collection period.
[0124] 7 again, first extraction unit 152 outputs the variable data to be saved to saving processing unit 153. When saving processing unit 153 receives the variable data to be saved from first extraction unit 152, it saves the variable data to be saved in memory card 106A.
[0125] (C4: Processing procedures for collection and storage) FIG. 11 is a flowchart showing a procedure of processing related to collection and storage of variable data by the control device in this embodiment.
[0126] In step S1, the processor 101 determines whether or not a condition for starting collection of variable data is satisfied. The condition for starting collection of variable data is defined by the user program 118. If the condition for starting collection of variable data is satisfied (YES in step S1), the processor 101 advances the process to step S2. On the other hand, if the condition for starting collection of variable data is not satisfied (NO in step S1), the processor 101 repeats step S1.
[0127] In step S2, the processor 101 starts collecting variable data. Here, the processing procedure of the subroutine for collecting variable data started in step S2 will be described with reference to FIG.
[0128] FIG. 12 is a flowchart showing the procedure of the subroutine for collecting variable data, which is started in step S2 in this embodiment.
[0129] In step S21, the processor 101 determines whether it is time to collect variable data. When a start condition for the collection process (i.e., "SMP" in the task shown in FIG. 6) is satisfied, the processor 101 determines that it is time to collect variable data. If it is time to collect variable data (YES in step S21), the processor 101 advances the process to step S22. On the other hand, if it is not time to collect variable data (NO in step S21), the processor 101 repeats step S21.
[0130] In step S22, the processor 101 determines whether or not forced collection has been instructed. If forced collection has been instructed (YES in step S22), the processor 101 advances the process to step S23. On the other hand, if forced collection has not been instructed (NO in step S22), the processor 101 advances the process to step S24.
[0131] In step S23, the processor 101 disables the first operation and performs the second operation for each of the one or more field devices 800. More specifically, for each of the one or more field devices 800, the processor 101 includes the variable data of one or more second variables corresponding to the field device in the variable data to be stored, regardless of whether the one or more first variables corresponding to the field device indicate that the field device is controlled by the control device 100.
[0132] In step S24, the processor 101 performs a first operation for each of the one or more field devices 800. More specifically, for each of the one or more field devices 800, when one or more first variables corresponding to the field device indicate that the field device is controlled by the control device 100, the processor 101 includes the variable data of one or more second variables corresponding to the field device in the variable data of the candidate to be stored, and when one or more first variables corresponding to the field device indicate that the field device is not controlled by the control device 100, the processor 101 does not include the variable data of one or more second variables corresponding to the field device in the variable data of the candidate to be stored.
[0133] After step S23 or step S24, the processor 101 advances the process to step S25. In step S25, the processor 101 collects the variable data of candidates to be saved. More specifically, the processor 101 first stores the variable data of candidates to be saved in the data buffer 161 in association with collection time information indicating the collection time. After that, the processor 101 stores at least a part of the variable data of candidates to be saved stored in the data buffer 161 in association with the collection time information based on the saving method of the variable data in the ring buffer 162.
[0134] More specifically, when the variable data storage method is the first storage method, the processor 101 executes a collection process, and stores the variable data of storage candidates in the data buffer 161 in association with the collection time information. After that, the processor 101 stores all of the variable data of storage candidates stored in the data buffer 161 by the collection process in the ring buffer 162 in association with the collection time information.
[0135] On the other hand, if the variable data storage method is the second storage method, the processor 101 executes a collection process, and stores the variable data of storage candidates in the data buffer 161 in association with the collection time information. After that, the processor 101 stores only the variable data corresponding to a predetermined collection period among the variable data of storage candidates stored in the data buffer 161 by the collection process in the ring buffer 162 in association with the collection time information. After step S25, the processor 101 returns the process to step S21.
[0136] 11 again, after step S2, processor 101 advances the process to step S3. In step S3, processor 101 determines whether or not a save trigger has occurred. If a save trigger has occurred (YES in step S3), processor 101 advances the process to step S4. On the other hand, if a save trigger has not occurred (NO in step S3), processor 101 repeats step S3.
[0137] In step S4, the processor 101 ends the collection of variable data (i.e., the subroutine shown in FIG. 12) based on the variable data storage method. More specifically, when the variable data storage method is the first storage method, the processor 101 executes the collection process according to the control cycle from when a storage trigger occurs until a post-trigger collection time has elapsed, and ends the collection of variable data (i.e., the subroutine shown in FIG. 12) after at least the post-trigger collection time has elapsed since the storage trigger occurred. On the other hand, when the variable data storage method is the second storage method, the processor 101 ends the collection of variable data (i.e., the subroutine shown in FIG. 12) after a storage trigger occurs.
[0138] Next, in step S5, the processor 101 determines the period to be saved based on the variable data saving method and the time when the save trigger occurs, and extracts the variable data to be saved during the period to be saved from the variable data candidates to be saved stored in the ring buffer 162.
[0139] More specifically, when the variable data storage method is the first storage method, the processor 101 determines the period from a first predetermined time before the occurrence of the storage trigger to a second predetermined time after the occurrence of the storage trigger as the period to be stored. On the other hand, when the variable data storage method is the second storage method, the processor 101 determines the most recent collection period before the occurrence of the storage trigger as the period to be stored. The processor 101 extracts from the ring buffer 162 the variable data of candidates to be stored that are associated with collection time information indicating a time within the period to be stored.
[0140] Next, in step S6, the processor 101 saves the variable data to be saved in the memory card 106 A. After step S6, the process of collecting and saving the variable data ends.
[0141] (c5: Changing the variable data collection method) 13 to 16, a process for changing the collection method of variable data will be described. The processor 101 can receive an instruction to change the collection method from the touch panel 300 or from the user program 118.
[0142] 13 and 14, a case where processor 101 receives an instruction to change the variable data collection method from touch panel 300 will be described.
[0143] 13 is an example of a screen for receiving an instruction to change the collection method of variable data in this embodiment. Screen 301 is an example of a screen for receiving an instruction to change the collection method. Screen 301 is displayed on touch panel 300 and is operated by a user. Screen 301 includes lamps 311, 312, 313, 314, 315, 316, and button 317.
[0144] The lamps 311, 312, 313, and 314 indicate the control status of the field device 721. Of the lamps 311, 312, 313, and 314, only the lamp that corresponds to the control status of the field device 721 is turned on.
[0145] Lamp 315 and lamp 316 indicate whether or not variable data is being collected. When the condition for starting collection of variable data is met, lamp 315 is lit and lamp 316 is turned off. On the other hand, when the condition for starting collection of variable data is not met, lamp 315 is turned off and lamp 316 is lit.
[0146] The button 317 is a button for receiving an instruction to change the variable data collection method of the control device 100. More specifically, the button 317 is a toggle button for switching between a first collection method and a second collection method, which are the variable data collection methods of the control device 100. When the display of the button 317 is "ON", the current variable data collection method of the control device 100 is the first collection method. On the other hand, when the display of the button 317 is "OFF", the current variable data collection method of the control device 100 is the second collection method.
[0147] When the user presses button 317 while "ON" is displayed on button 317, the display on button 317 changes to "OFF", and control device 100 changes the variable data collection method from the first collection method to the second collection method. In other words, when the user presses button 317 while "ON" is displayed on button 317, a forced collection trigger is transmitted from touch panel 300 to control device 100. Then, control device 100 receives the forced collection trigger from touch panel 300.
[0148] On the other hand, if the user presses button 317 while "OFF" is displayed on button 317, the display on button 317 changes to "ON", and the control device 100 changes the variable data collection method from the second collection method to the first collection method.
[0149] In addition, the screen 301 may further include one or more lamps indicating the control status of each of the other field devices (eg, field device 722, field device 723, etc.).
[0150] Moreover, the screen 301 may be displayed on the support device 200 and operated by the user.
[0151] In addition, for each of one or more field devices 800, a screen including one or more lamps indicating the control status of the field device, one or more lamps (e.g., lamps 315 and 316) indicating whether or not variable data is being collected, and button 317 is prepared in advance, and the screen of a field device 700 specified by the user may be displayed on the touch panel 300 or the support device 200.
[0152] FIG. 14 is a flowchart showing a procedure for changing the variable data collection method when an instruction to change the variable data collection method is received from the touch panel in this embodiment.
[0153] In step S31, touch panel 300 determines whether or not button 317 (see FIG. 13) has been pressed. If button 317 has been pressed (YES in step S31), touch panel 300 advances the process to step S32. On the other hand, if button 317 has not been pressed (NO in step S31), touch panel 300 repeats step S31. In step S32, touch panel 300 transmits an instruction to control device 100 to change the method of collecting variable data.
[0154] Next, in step S33, the processor 101 of the control device 100 receives an instruction to change the collection method of the variable data. Next, in step S34, the processor 101 changes the collection method of the variable data. More specifically, if the current collection method of the variable data is the first collection method, the processor 101 changes the collection method of the variable data to the second collection method. On the other hand, if the current collection method of the variable data is the second collection method, the processor 101 changes the collection method of the variable data to the first collection method. After step S34, the process of changing the collection method of the variable data ends.
[0155] 15 and 16, a case where the processor 101 receives an instruction to change the variable data collection method from the user program 118 will be described.
[0156] Fig. 15 is a diagram showing an example of a function block included in a user program in this embodiment, Fig. 16 is a diagram showing definition data of variables used in the function block shown in Fig. 15.
[0157] 15, a function block 211 is an example of a program part that issues a trigger for forced collection. The function block 211 can be included in the user program 118.
[0158] When the processor 101 performs processing according to the function block 211, when "Execute" becomes "TRUE", the processor 101 switches the variable data collection method according to the value ("TRUE" or "FALSE") input to "Sampling" to perform collection processing. Referring to FIG. 16, when "Sampling" is "TRUE", the processor 101 performs collection processing by forced collection, i.e., the second collection method. On the other hand, when "Sampling" is "FALSE", the processor 101 performs collection processing by the first collection method. The user can change the condition for switching the variable data collection method by appropriately changing the variable assigned to "Sampling".
[0159] Referring to FIG. 15 again, when the process is executed normally, "Done" becomes "TRUE". After that, when "Execute" becomes "FALSE", "Done" becomes "FALSE".
[0160] On the other hand, when the process is not executed normally, "Error" becomes "TRUE", and a WORD-type error code is output to "ErrorID". After that, when "Execute" becomes "FALSE", "Error" becomes "FALSE".
[0161] <D. Effect> As a conventional method for shortening the time required for the collection process, there is a method of not collecting the values of the previous cycle and the variable data that has not changed. When the variable is a BOOL-type variable, such a conventional method can reduce the number of variables to be collected to some extent, so the time required for the collection process can be shortened. However, when the variable is a floating-point type variable (for example, an LREAL-type variable, etc.), it is difficult to shorten the time required for the collection process by such a conventional method. This is because when the variable is a floating-point type variable, the value of the variable data is unlikely to be the same as the value of the previous cycle, and it is highly likely that the variable data is collected every cycle. When the variable is a floating-point type variable, so-called rounding errors occur because the processor performs binary arithmetic. Therefore, when the variable is a floating-point type variable, the value of the variable data is unlikely to be the same as the value of the previous cycle. Also, when the variable indicates the current position obtained from the counter of the encoder of the servo motor, the current position may not become a constant value due to the influence of cogging (micro-vibration) generated in the servo motor. Therefore, the value of the variable data is unlikely to be the same as the value of the previous cycle. As described with reference to FIGS. 3 to 5, the one or more second variables include many floating-point type variables. Therefore, it is difficult to shorten the time required for the collection process by such a conventional method.
[0162] In contrast, the control device 100 in this embodiment can perform collection processing in a first collection method. When collection processing is performed in the first collection method, the first operation collects variable data of one or more second variables corresponding to one or more first field devices controlled by the control device 100 among the one or more field devices 800, but does not collect variable data of one or more second variables corresponding to one or more second field devices not controlled by the control device 100 among the one or more field devices 800. Therefore, the control device 100 can reduce the time required for the collection processing of variable data.
[0163] Furthermore, the first operation reduces the amount of collected variable data, and therefore reduces the amount of variable data stored in memory card 106A when an abnormality occurs in at least one of the one or more field devices 800. Therefore, the control device 100 in this embodiment can reduce the processing time for storing the variable data to be stored in memory card 106A.
[0164] Furthermore, when forced collection is instructed, the control device 100 in this embodiment can perform collection processing in the second collection method. Therefore, the control device 100 in this embodiment can collect variable data more flexibly according to the needs of the user.
[0165] In the above embodiment, the control device 100 stores the variable data to be saved in the memory card 106A, but this is not limited to the above. Instead of saving the variable data to be saved in the memory card 106A, the control device 100 may save the variable data to be saved in the storage 103 or in a network storage (e.g., NAS) connected via the higher-level network 901. Furthermore, the control device 100 may save the variable data to be saved in the memory card 106A, and may also save the variable data to be saved in the storage 103 or in a network storage (e.g., NAS) connected via the higher-level network 901.
[0166] Furthermore, the control device 100 may be configured so that the variable data collection method can be changed for each field device 700 .
[0167] [Note] The above-described embodiment and modified examples include the following technical ideas.
[0168] [Configuration 1] A control device (100) for controlling a device (700), The control device (100) includes a collection unit (151) that collects variable data of candidates for storage, The control device (100) manages a plurality of control variables; The plurality of control variables are: one or more first variables indicative of whether the device (700) is being controlled by the control device (100); and one or more second variables other than the one or more first variables; The collection unit (151) performs a first operation of including variable data of the one or more second variables in the variable data of the candidate to be stored when the one or more first variables indicate that the device (700) is controlled by the control device (100), and not including the variable data of the one or more second variables in the variable data of the candidate to be stored when the one or more first variables indicate that the device (700) is not controlled by the control device (100).
[0169] [Configuration 2] each of the plurality of control variables is a structure; The one or more second variables include at least one of one or more command value variables indicating a command value from the control device (100) to the equipment (700), one or more current value variables indicating a state value of the equipment (700), and one or more sets of unit conversion variables for converting units.
[0170] [Configuration 3] 3. The control device of claim 1 or 2, wherein the plurality of control variables are a plurality of axis variables for controlling a servo motor, a plurality of robot variables for controlling a robot, or a plurality of temperature control variables for controlling a heater.
[0171] [Configuration 4] The control device according to any one of configurations 1 to 3, wherein when the collection unit (151) receives a forced collection trigger, it disables the first operation and performs a second operation of including variable data of the one or more second variables in the variable data of the candidate to be stored, regardless of whether the one or more first variables indicate that the device (700) is controlled by the control device (100).
[0172] [Configuration 5] The control device according to configuration 4, wherein the control device (100) receives the trigger from a setting device that receives setting information for the control device (100).
[0173] [Configuration 6] The control device (100) includes a user program for controlling the device (700), The control device according to configuration 4, wherein the user program includes a program part that issues the trigger.
[0174] [Configuration 7] A data collection method by a control device (100) that controls a device (700), comprising: collecting variable data of candidates for storage; The control device (100) manages a plurality of control variables; The plurality of control variables are: one or more first variables indicative of whether the device (700) is being controlled by the control device (100); and one or more second variables other than the one or more first variables; The data collection method includes performing a first operation of collecting the variable data of the candidate to be stored, when the one or more first variables indicate that the device (700) is controlled by the control device (100), including the variable data of the one or more second variables in the variable data of the candidate to be stored, and not including the variable data of the one or more second variables in the variable data of the candidate to be stored, when the one or more first variables indicate that the device (700) is not controlled by the control device (100).
[0175] [Configuration 8] A data collection program that causes one or more computers to execute the data collection method according to configuration 7.
[0176] The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present disclosure is defined by the claims, not the above description, and is intended to include all modifications within the meaning and scope of the claims. [Explanation of symbols]
[0177] 1 Data collection system, 11, 12, 16, 317 Button, 13, 14, 15 Input box, 100 Control device, 101 Processor, 102 Memory, 103 Storage, 104 Upper network controller, 105 Field network controller, 106 Memory card interface, 106A Memory card, 107 Timer, 108 Clock, 113 Control program, 114 System program, 116 Scheduler program, 117 Input / output program, 118 User program, 119 Motion calculation, 120 Anomaly detection program, 121 Data collection program, 122 Save program, 124 Data type definition data, 125 Setting information, 131 Primary periodic task, 133, 134 Periodic task, 132 Event task, 135 System service, 141 Primary period, 143, 144 Task period, 151 Collection unit, 152 First extraction unit, 153 Storage processing unit, 161 data buffer, 162 ring buffer, 200 support device, 211 function block, 300 touch panel, 301 screen, 311, 312, 313, 314, 315, 316 lamps, 700, 721, 722, 723, 800 field devices, 701 servo motor driver, 702 temperature regulator, 703 robot controller, 711 servo motor, 712 heater, 713 robot, 901 upper network, 902 field network, G1 setting screen, T0, t1, t2, t3, t4, t5, t6 timing.
Claims
1. A control device for controlling a device, The control device includes a collection unit that collects variable data of candidates to be stored, The controller manages a plurality of control variables; The plurality of control variables are: one or more first variables indicative of whether the device is being controlled by the controller; and one or more second variables other than the one or more first variables; The control device, wherein the collection unit performs a first operation of including variable data of the one or more second variables in the variable data of the storage candidate when the one or more first variables indicate that the equipment is controlled by the control device, and not including the variable data of the one or more second variables in the variable data of the storage candidate when the one or more first variables indicate that the equipment is not controlled by the control device.
2. each of the plurality of control variables is a structure; The control device according to claim 1, wherein the one or more second variables include at least one of one or more command value variables indicating a command value from the control device to the device, one or more current value variables indicating a state value of the device, and one or more sets of unit conversion variables for converting units.
3. The control device according to claim 1 or 2, wherein the plurality of control variables are a plurality of axis variables for controlling a servo motor, a plurality of robot variables for controlling a robot, or a plurality of temperature control variables for controlling a heater.
4. 3. The control device according to claim 1 or 2, wherein when the collection unit receives a forced collection trigger, the collection unit disables the first operation and performs a second operation of including variable data of the one or more second variables in the variable data of the candidate for storage, regardless of whether the one or more first variables indicate that the device is controlled by the control device.
5. The control device according to claim 4 , wherein the control device receives the trigger from a setting device that receives setting information for the control device.
6. The control device includes a user program for controlling the device, The control device according to claim 4 , wherein the user program includes a program part that issues the trigger.
7. A data collection method by a control device that controls an apparatus, comprising: collecting variable data of candidates for storage; The controller manages a plurality of control variables; The plurality of control variables are: one or more first variables indicative of whether the device is being controlled by the controller; and one or more second variables other than the one or more first variables; The data collection method includes performing a first operation of collecting the variable data of the candidate to be stored, when the one or more first variables indicate that the device is controlled by the control device, including the variable data of the one or more second variables in the variable data of the candidate to be stored, and not including the variable data of the one or more second variables in the variable data of the candidate to be stored, when the one or more first variables indicate that the device is not controlled by the control device.
8. A data collection program that causes one or more computers to execute the data collection method according to claim 7.
Citation Information
Patent Citations
Programmable controller
JP1998027011A
Programmable logic controller system, program creation assisting device, and computer program
JP2020067751A
Servo system controller
WO2000033147A1