Programmable logic controller, support device, and display device
The system differentiates between instrument-generated and forcibly set values in a PLC through a processing unit, memory, and display device, addressing the challenge of identifying instrument malfunctions and ensuring reliable operation and maintenance.
Patent Information
- Application Number
- JP2024121821
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Conventional systems struggle to distinguish between instrument-generated values and forcibly set values in a Programmable Logic Controller (PLC) during system operation, making it difficult to identify and address instrument malfunctions.
The system includes a programmable logic controller with a processing unit, memory, and storage section to differentiate between actual input data and forcibly set data, along with a support device and display device to analyze and display logging data, enabling identification of forced settings.
Enables accurate identification of forcibly set values in the PLC, allowing for proper system operation and maintenance by highlighting such settings in the display, thereby ensuring reliable control and troubleshooting.
Smart Images

Figure 0007563647000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a programmable logic controller, a support device that supports the programmable logic controller, and a display device that displays information obtained from the programmable logic controller. [Background technology]
[0002] In factory automation, a programmable logic controller (PLC) controls manufacturing equipment, conveying equipment, inspection equipment, and the like by executing application programs such as ladder programs. Here, there is a demand for recording logs related to the control of various equipment or devices and for referencing them as necessary. Therefore, a technology has been proposed that enables logging without affecting the control of various equipment or devices (for example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent No. 7188631 Summary of the Invention [Problem to be solved by the invention]
[0004] When an instrument failure or the like occurs during operation of a system to which a PLC is applied, it may become impossible to set a normal value. In order to continue operation of the system in such a situation, a procedure for forcibly setting a predetermined value in the PLC instead of the value obtained from the failed instrument is considered to be effective. However, with conventional technology (for example, the technology described in Patent Document 1), it may not be possible to distinguish whether a value collected by logging from the PLC is a value output from the instrument or a forcibly set predetermined value. For this reason, with conventional technology, there is a risk that a user of the PLC will not be able to recognize a situation in which a predetermined value has been forcibly set in the PLC due to an instrument failure or the like.
[0005] An object of one aspect of the present invention is to make it possible, in a system in which a specific value can be forcibly set in a PLC, to identify whether a value collected by logging from the PLC is a value output from an instrument or a specific value that has been forcibly set. [Means for solving the problem]
[0006] A programmable logic controller according to one aspect of the present invention includes a process execution unit, a memory, and a storage unit. The process execution unit repeatedly executes a control process cycle including a program execution process for executing a control program, an output process for outputting the execution result of the control program to control an external device, and a logging process for collecting variable data related to variables used in the control program according to a logging setting. The memory includes a first memory area for storing actual input data to be given to the variables, and a second memory area for storing control information related to a forced setting for giving predetermined forced setting input data to the variables instead of the actual input data. The storage unit stores the data collected by the logging process.
[0007] The processing execution unit generates input data to be given to the variable based on the actual input data and the control information, and in the logging processing, stores the actual input data and the control information in the storage unit in correspondence with time information representing the time when the variable data was collected.
[0008] In one embodiment of the present invention, in order to support the above-mentioned programmable logic controller, the support device includes a setting information output unit that generates and outputs the logging setting including information indicating that the actual input data stored in the first memory area and the control information stored in the second memory area are collected in the logging process.
[0009] A display device according to one aspect of the present invention includes a readout unit, an analysis unit, and a display unit for displaying data collected in the programmable logic controller described above. The readout unit reads out the logging collected data from the storage device. The analysis unit determines whether the forced setting has been implemented for the variable based on the control information. The display unit displays a value represented by the actual input data when the forced setting has not been implemented for the variable, and displays a value represented by the forced setting input data when the forced setting has been implemented for the variable. Effect of the Invention
[0010] According to the above-described aspect, in a system in which a predetermined value can be forcibly set in a PLC, it is possible to identify whether a value collected by logging from the PLC is a value output from an instrument or a predetermined value that has been forcibly set. [Brief description of the drawings]
[0011] [Figure 1] FIG. 1 is a diagram illustrating an example of the configuration of a PLC system. [Diagram 2] FIG. 2 illustrates an example of a control process executed by a PLC. [Diagram 3] FIG. 2 is a diagram illustrating an example of a hardware configuration of a PLC. [Figure 4]FIG. 2 is a diagram illustrating an example of a hardware configuration of a PC. [Diagram 5] FIG. 2 illustrates an example of a functional configuration of the support device. [Figure 6] FIG. 13 illustrates an example of a method for creating a logging setting. [Figure 7] FIG. 13 illustrates an example of a UI screen used in the collection target setting process. [Figure 8] FIG. 11 is a diagram illustrating an example of logging setting data. [Figure 9] FIG. 11 is a diagram illustrating an example of collection target setting information. [Figure 10] 1 is a diagram illustrating an example of a correspondence relationship between memory addresses of variables used in project data and memory areas in a PLC memory; [Figure 11] FIG. 2 is a diagram illustrating an example of a functional configuration of a PLC. [Figure 12] FIG. 11 illustrates an example of a logging process executed by a PLC. [Figure 13] 11 is a flowchart showing an example of a logging process and a storage process. [Figure 14] FIG. 4 is a diagram illustrating an example of a data structure of logging collection data. [Figure 15] 10A and 10B are diagrams illustrating an example of data structures of sample data and variable data. [Figure 16] FIG. 1 illustrates an example of a forced setting implemented in a PLC system. [Figure 17] 13 is a flowchart illustrating an example of a collection process. [Figure 18] FIG. 13 is a diagram illustrating an example of a functional configuration related to forced setting of a variable. [Figure 19] FIG. 11 illustrates an example of an input data generation process. [Figure 20] FIG. 11 illustrates an example of an output data transfer process. [Figure 21] FIG. 13 is a diagram (part 1) showing an example of forced setting and logging processing related to input data. [Figure 22] FIG. 2 is a diagram (part 2) showing an example of forced setting and logging processing related to input data. [Diagram 23] FIG. 11 is a diagram (part 1) showing an example of forced setting and logging processing related to output data. [Figure 24] FIG. 2 is a diagram (part 2) showing an example of forced setting and logging processing related to output data. [Diagram 25] FIG. 2 is a diagram illustrating an example of a hardware configuration of a collected data display device. [Figure 26] FIG. 2 is a diagram illustrating an example of a functional configuration of a collected data display device. [Figure 27] FIG. 13 illustrates an example of a method for displaying logged collection data. [Figure 28] FIG. 11 illustrates an example of a program display process. [Figure 29] FIG. 13 is a diagram showing an example of a display screen of sample data. [Diagram 30] FIG. 13 is a diagram showing an example of a warning screen displayed on the display device. [Diagram 31] FIG. 11 is a diagram illustrating an example of a waveform display process. [Diagram 32] FIG. 13 is a diagram showing an example of a waveform display screen for sample data. [Diagram 33] FIG. 13 is a diagram showing an example of a logging file analysis and conversion process. [Diagram 34] 13 is a flowchart showing an example of a logging file analysis and conversion process. [Diagram 35] 13 is a flowchart illustrating an example of a process for creating display data for each target variable. [Diagram 36] FIG. 11 is a diagram illustrating an example of a display control process. [Figure 37] 13 is a diagram showing an example of highlighting target variables for which forced setting has been implemented on a user program display screen. FIG. [Figure 38] FIG. 13 is a diagram showing an example of highlighting a target variable for which a forced setting is implemented on a waveform display screen. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] Fig. 1 shows an example of the configuration of a PLC system 10. The PLC system 10 shown in Fig. 1 includes a PLC 1, a personal computer (PC) 2, an input / output module 3, and a communication module 4. The PLC 1 and the PC 2 are connected via a communication cable 6. The PLC 1 controls various devices or equipment installed in a factory in factory automation, for example.
[0013] PC2 provides a function as a support device that supports PLC1. PC2 also provides a function to set conditions for executing logging processing in PLC1. PC2 can edit user application programs used by PLC1. A user application program is an example of a control program that controls an external device. In the following description, a user application program may be referred to as a "user program" or a "control program."
[0014] The user program is created, for example, using a ladder language that complies with IEC (International Electrotechnical Commission) 61131-3. The user program may also be created using a graphical programming language such as a motion program in a flow chart format, such as a sequential function chart (SFC). Alternatively, the user program may be created using a high-level programming language, such as the C language.
[0015] As described later, the PC 2 has a function of setting execution conditions for the logging process. Also, the PC 2 may have a function of starting / cancelling a forced setting that forcibly sets the values of variables used by the PLC 1.
[0016] The PLC 1 is connected to the input / output module 3 and the communication module 4 via a communication bus 7. A plurality of input / output modules 3 and / or a plurality of communication modules 4 may be connected to the communication bus 7. The input / output module 3 and the communication module 4 are preferably detachable from the PLC system 10. The input / output module 3 and the communication module 4 correspond to external devices.
[0017] The input / output module 3 inputs / outputs digital or analog signals. The input / output module 3 may also have a function of converting signals from a servo amplifier, an encoder, or a sensor into electrical signals. The communication module 4 provides a communication interface with other devices.
[0018] Fig. 2 shows an example of control processing executed by the PLC 1. As shown in Fig. 2, the PLC 1 repeatedly executes a control processing cycle including input processing, program execution processing, output processing, logging processing, and system processing for each control period.
[0019] The input process takes in input data received from the input / output module 3. The program execution process executes a user program created by a user. The input data taken in by the input process is used in the execution of the user program. The output process controls the input / output module 3 by outputting the execution results of the user program. In other words, the execution results of the user program are reflected in the output of the input / output module 3.
[0020] The logging process collects data representing the values of variables used in the user program to generate logging collection data. The logging process also records data representing the operating status of each component of the PLC system 10, including the PLC 1, and saves it as history.
[0021] The system processing maintains proper operation of the PLC 1 by managing the operation of the PLC 1. The system processing also includes a process for writing a user program and logging setting data to a memory in the PLC 1. Furthermore, the system processing may include a forced setting control process, which will be described later.
[0022] The PLC 1 executes the logging process after the output process in each control cycle so as not to interfere with the execution of the user program. The control cycle is the sum of the execution periods of the input process, the program execution process, the output process, the logging process, and the system process. Therefore, when the control cycle is specified, the execution period of the logging process is limited by the bandwidth allocated to the control cycle. The control cycle is specified, for example, by the user. Note that the bandwidth of the logging process may be adjustable by changing the ratio of the execution periods allocated to the program execution process, the logging process, and the system process.
[0023] Here, if a target device controlled by PLC1 breaks down, there is a risk that an abnormal value will be stored in the memory area of the variable corresponding to the broken instrument. In this case, using the value in this memory area may adversely affect the control operation. Therefore, PLC1 has a function to forcibly rewrite the value of the variable (i.e., the data stored in the corresponding memory area) to a specified value while continuing the operation of the system. This function is provided, for example, in the system processing shown in Figure 2.
[0024] Fig. 3 shows an example of the hardware configuration of the PLC 1. As shown in Fig. 3, the PLC 1 includes a communication I / F 11, a CPU (Central Processing Unit) 12, a bus controller 13, a memory 14, and a storage device I / F 15. All of these components are hardware, connected to an internal bus 16, and can transmit data to each other. "I / F" is an abbreviation for interface. The CPU is sometimes called a processor.
[0025] The communication I / F 11 is connected to the communication cable 6 and communicates with the PC 2. The CPU 12 executes various programs such as a user program, a system program for managing the operation of the PLC 1, a logging execution program, etc. The bus controller 13 is connected to the communication bus 7 and communicates with the input / output module 3 and the communication module 4.
[0026] The memory 14 is, for example, a semiconductor memory, and includes a RAM (Random Access Memory) area and a ROM (Read Only Memory) area. The RAM area is used as a storage area for temporarily storing various data when the CPU 12 executes various programs. The ROM area is an area in which various programs and / or data are saved, and is realized by, for example, a non-volatile memory. The storage device I / F 15 manages the writing and reading of various data to and from an external storage device 17, such as a memory card.
[0027] Fig. 4 shows an example of the hardware configuration of the PC 2. As shown in Fig. 4, the PC 2 includes a CPU 21, a memory 22, an input device 23, a display device 24, an auxiliary storage device 25, and a communication I / F 26. All of these components are hardware, connected to an internal bus 27, and can transmit data between each other.
[0028] The CPU 21 provides, for example, a function for editing a user program, a function for creating logging settings that indicate conditions for executing logging processing, and the like, by executing a program using the memory 22. The input device 23 is, for example, a keyboard and / or a pointing device, and is used for inputting instructions or information from the user. The display device 24, for example, queries the user, gives instructions to the user, and displays processing results.
[0029] The auxiliary storage device 25 is realized by, for example, a magnetic disk device, an optical disk device, a magneto-optical disk device, a hard disk drive, or a flash memory. The PC 2 can store programs and data in the auxiliary storage device 25 and use them by loading them into the memory 22. The communication I / F 26 is connected to the communication cable 6 and communicates with the PLC 1.
[0030] <Logging settings> Information related to the logging process in the PLC 1 is set by a support device. This support device is realized by the PC 2 shown in Fig. 1 or 4 executing a predetermined setting tool program. In other words, the function of this support device is provided by the PC 2.
[0031] 5 shows an example of a functional configuration of the support device 30. The support device 30 sets conditions for the execution of logging processing in the PLC 1. That is, the support device 30 creates logging settings to be referenced by the PLC 1 and provides the same to the PLC 1. As shown in FIG. 5, the support device 30 includes a program analysis unit 31, a selection unit 32, a reception unit 33, a setting information output unit 34, a calculation unit 35, and a data amount information output unit 36. The support device 30 may further include other functions not shown in FIG. 5. It is also assumed that a control period for causing the PLC 1 to perform the control processing shown in FIG. 2 is set in advance in the support device 30 by a user.
[0032] The program analysis unit 31 analyzes a user program to be executed by the PLC 1, and extracts variables used in the user program. The selection unit 32 selects variables to be collected in the logging process by the PLC 1 (i.e., collection target variables) from among the variables extracted by the program analysis unit 31. When a forced setting, which will be described later, is possible for the selected variables, the selection unit 32 may select the forced setting reflected data, the forced setting data, and the forced setting validity information as the targets to be collected in the logging process in the PLC 1. The forced setting data and the forced setting validity information are examples of control information related to the forced setting. The forced setting reflected data, the forced setting data, and the forced setting validity information will be described later.
[0033] The reception unit 33 receives a designation of a predetermined collection period that is longer than the control period. The length of the collection period is, for example, N (N is an integer equal to or greater than 2) times the length of the control period. The setting information output unit 34 outputs information representing a plurality of collection target variables and information representing the collection period as logging settings. In the following description, variables to be collected in the logging process (i.e., collection target variables) may be simply referred to as "target variables".
[0034] The PLC 1 executes the logging process based on the logging settings output from the support device 30. At this time, the PLC 1 may distribute the multiple target variables to multiple control cycles and collect values of some of the multiple collection target variables in each of the multiple control cycles. Alternatively, the PLC 1 may collect values of the target variables in each control cycle constituting the collection cycle.
[0035] The calculation unit 35 determines the number of control periods for collecting the values of each of the multiple target variables based on the collection period and the control period.The calculation unit 35 then determines the amount of data of the variable values collected in each of the multiple control periods based on the total amount of data of the values of the multiple target variables and the determined number of control periods.The data amount information output unit 36 outputs data amount information indicating the data amount calculated by the calculation unit 35.
[0036] According to the support device 30 having the above-mentioned functions, it is possible to cause the PLC 1 to execute a logging process for collecting a desired amount of variable values without affecting the control of an external device by the PLC 1. In other words, the PLC 1 can appropriately collect the values of variables used in controlling the device. Furthermore, the support device 30 can cause the PLC 1 to collect control information related to the forced setting together with the variable values.
[0037] The support device 30 further includes a forced setting unit 37. The forced setting unit 37 provides the PLC 1 with control information related to forced setting for each variable in a user program executed in the PLC 1. For example, the forced setting unit 37 instructs the implementation of forced setting for each variable used in the PLC 1. In addition, the forced setting unit 37 can transmit the memory address and forced setting value of each variable used in the PLC 1 to the PLC 1 via the communication I / F 26 based on a user instruction received using the UI.
[0038] 6 shows an example of a method for creating a logging setting, which corresponds to the support method used by the support device 30 shown in FIG.
[0039] The support device 30 includes a setting tool 40. In the PC 2, the function of the setting tool 40 is provided by causing the CPU 21 to execute a predetermined setting tool program.
[0040] Project data 41 is input to the setting tool 40. The project data 41 includes information related to the system configuration of the PLC system 10, a user program executed by the PLC 1, and information related to function settings of the input / output module 3 and the communication module 4 included in the PLC system 10. Here, it is assumed that the project data 41 is created by a user, for example, by executing a predetermined project data editing program in the PC 2, and is stored in the auxiliary storage device 25.
[0041] The setting tool 40 executes a collection target setting process S110 for the project data 41. At this time, the setting tool 40 determines variables to be logged from variables used in the user program. The setting tool 40 provides the functions of the program analysis unit 31 and the selection unit 32 in the support device 30 shown in FIG.
[0042] The collection target setting process S110 includes a program analysis process S111. The program analysis process S111 analyzes a user program included in the project data 41 and extracts variables used in the user program. In addition, in the collection target setting process S110, target variables (i.e., variables to be collected by the logging process executed by the PLC1) are selected from the variables extracted by the program analysis process S111. Furthermore, the collection target setting process S110 creates instructions or information indicating that control information related to the forced setting is to be collected in the logging process for target variables for which forced setting can be implemented.
[0043] Here, the UI screen 100 used in the collection target setting process S110 will be described with reference to Fig. 7. "UI" is an abbreviation for user interface.
[0044] 7, the UI screen 100 includes a program selection section 101, an extracted variable display section 102, and a target variable display section 103. When the function of the support device 30 is provided by the PC 2 shown in FIG.
[0045] The program selection section 101 displays information indicating the user programs included in the project data 41. In this embodiment, a task is configured as a collection of multiple programs, and a user program is configured as a collection of multiple tasks. In the example screen shown in FIG. 7, "Application Name" is the name of the user program, "Task 1", "Task 2", and "Task 3" are the names of each task, and "Program" to "Program N" are the names of each program belonging to each task. In this example screen, the relationship between the user program, each task, and each program is displayed in a tree format.
[0046] When the user selects one of the program names displayed in the program selection section 101, a program analysis process S111 is executed for the selected program, and variables used in the program are extracted. If a task name is selected instead of a program name, variables are extracted from each of the programs belonging to the selected task. At this time, the names of the extracted variables are displayed in the extracted variable display section 102.
[0047] When the user selects one or more names from among the names of the variables displayed in the extracted variable display section 102 and then presses the register button 104, the variables corresponding to the selected names are selected as target variables. At this time, the names of the selected target variables are displayed in the target variable display section 103. When the user selects one or more names from among the names of the target variables displayed in the target variable display section 103 and presses the release button 105, the selected variables are excluded from the selection results of the target variables.
[0048] When the user presses the Bulk Registration button 106, all the variables displayed in the Extracted Variable Display section 102 are selected as target variables, and their names are displayed in the Target Variable Display section 103. When the user presses the Bulk Cancel button 107, all the variables displayed in the Target Variable Display section 103 are excluded from the selection results of the target variables.
[0049] In the collection target setting process S110, the total amount of data to be collected when the logging process is executed for all of the target variables selected as described above is calculated based on the project data 41. The calculated total amount of data is displayed in the collected data size display section 108 on the UI screen 100.
[0050] When the selected collection target is a variable for which forced setting can be implemented, control information related to the forced setting is also collected in the logging process. Therefore, in this case, the total data amount may include the data amount of the control information related to the forced setting. In addition, since the input / output modules 3 that the PLC 1 can control are generally determined, the total data amount does not need to include the data amount of the control information related to the forced setting so as not to make the user aware of it.
[0051] The execution times of the input process, program execution process, output process, and system process within one cycle of the control process executed by PLC1 can be calculated from the project data 41. In addition, in the collection target setting process S110, the execution time of the logging process when the logging process is executed for the selected target variable is estimated. Then, the sum of these execution times is calculated. This total execution time is the time estimated to be required to execute one cycle of the control process executed by PLC1. This sum is displayed in the estimated control period display section 109 in the UI screen 100.
[0052] Returning to the explanation of Fig. 6, the setting tool 40 creates information for setting the operation of the logging process in the collection operation setting process S120. With this information, for example, the timing for collecting the values of the target variables that are the data to be collected, the period for collecting the data, the timing for the PLC 1 to store the collected data in the external storage device 17, etc. are set in the PLC 1.
[0053] In the setting content confirmation process S130, it is determined whether the execution time of one cycle of the control process when PLC1 executes the logging process for all of the target variables selected in the collection target setting process S110 falls within a preset control period.
[0054] The setting file creation process S140 corresponds to the function of the reception unit 33 in the support device 30 shown in Fig. 5. In the setting file creation process S140, information for identifying the target variables selected in the collection target setting process S110 and operation setting information for the logging process set in the collection operation setting process S120 are output as logging setting data 42. The logging setting data 42 is transmitted to PLC1. PLC1 executes the logging process based on the contents of the logging setting data 42.
[0055] 8 shows an example of the logging setting data 42. The logging setting data 42 includes project data information 51, collection operation setting information 52, and collection target setting information 53, as shown in FIG.
[0056] The project data information 51 is information for identifying a user program to be executed by the PLC 1, and includes, for example, information such as a name given to an object code obtained by compiling the user program, the date and time of the compilation, etc. The project data information 51 may be a part of the project data 41.
[0057] The collection operation setting information 52 is created by the collection operation setting process S120. The collection operation setting information 52 includes, for example, information indicating the timing of collecting data, information indicating the period for collecting data, information indicating the timing at which the PLC 1 stores the collected data in the external storage device 17, and information specifying the external storage device 17 in which the collected data is to be stored.
[0058] The collection target setting information 53 includes information related to the target variables selected by the collection target setting process S110. As shown in FIG. 9, the collection target setting information 53 includes information indicating the total size of collected data at the timing of data collection. The collection target setting information 53 includes information indicating the number of target variables that are the targets of data collection. The collection target setting information 53 includes information indicating the memory type, data type, memory address, and data size for each target variable. This information specifies the location and size in memory 14 of the storage area used to hold the values of the target variables when PLC 1 executes a user program (i.e., the storage area where the values to be collected in the logging process are held).
[0059] The collection target setting information 53 further includes a forced setting availability identifier for each target variable. The forced setting availability identifier indicates whether or not forced setting is available for the variable. Whether or not forced setting is available is determined by, for example, a user of the PLC system 10.
[0060] When the target variable is a variable for which forced setting can be implemented, the collection target setting process S110 specifies control information related to the forced setting in addition to the variable value as a target for collection by the logging process. That is, for the target variable for which forced setting can be implemented, an instruction or information is created indicating that control information related to the forced setting is to be collected by the logging process in PLC1. The collection target setting process S110 recognizes the correspondence between the memory addresses of variables used in the project data 41 and the memory areas in the memory 14 of PLC1.
[0061] 10 shows an example of the correspondence between memory addresses of variables used in project data 41 and memory areas in memory 14 of PLC 1. I / O memory 1001 represents an area to which addresses corresponding to variables related to I / O module 3 used in a user program are assigned. Non-retention memory 1002 represents an area to which addresses corresponding to variables that operate non-retention memory used in a user program. Retention memory 1003 represents an area to which addresses corresponding to variables that operate retention memory used in a user program are assigned.
[0062] An input / output memory area 1011 represents an area in the memory 14 of PLC 1 that corresponds to the input / output memory 1001. PLC 1 may control data via the input / output module 3 and the input / output memory area 1011. A user program non-retaining memory area 1012 represents an area that is actually used in the memory 14 of PLC 1 and corresponds to the non-retaining memory 1002. A user program retaining memory area 1013 represents an area that is actually used in the memory 14 of PLC 1 and corresponds to the retaining memory 1003.
[0063] The forced setting input / output area 1021 is an area for writing forced setting data to a corresponding address location when forced setting can be performed on a variable related to the input / output module 3. The forced setting valid information area 1022 is an area for writing information (forced setting valid information) indicating whether the forced setting is valid or invalid to a corresponding address location when forced setting can be performed on a variable related to the input / output module 3.
[0064] In this way, by using the setting tool 40, the support device 30 can set conditions related to the execution of the logging process in the PLC 1. Furthermore, when the variables in the input / output memory 1001 are variables for which forced setting can be implemented, the collection target setting process S110 specifies the input / output memory area 1011, the forced setting input / output area 1021, and the forced setting valid information area 1022 as addresses from which data should be collected in the logging process. These pieces of information are set as "memory addresses" in the collection target setting information 53 shown in Fig. 9. That is, for variables for which forced setting can be implemented, the input / output memory area 1011, the forced setting input / output area 1021, and the forced setting valid information area 1022 are set in the collection target setting information 53 as collection targets in the logging process.
[0065] Then, the logging setting data 42 including the collection target setting information 53 is transmitted from the PC 2 to the PLC 1. Then, the PLC 1 executes the logging process in accordance with the logging setting data 42. Therefore, the PLC 1 can execute the logging process without being aware of the memory type of each variable used in the project data 41.
[0066] <Logging execution> A description will be given of the logging process executed by the PLC 1 in the PLC system 10 shown in Fig. 1. The PLC 1 executes the logging process in accordance with the logging setting data 42 created by the PC 2 operating as the support device 30. Although not shown in the figure, the logging setting data 42 is stored in a predetermined area in the memory 14 provided in the PLC 1.
[0067] Fig. 11 shows an example of the functional configuration of the PLC 1. In the example shown in Fig. 11, the PLC 1 includes a processing execution unit 61, a ring buffer 62, and a storage unit 63. It is assumed that a control cycle for performing the above-mentioned control processing is set in advance by a user in the PLC 1.
[0068] The PLC1 repeatedly executes a control process S200 including an input process S210, a program execution process S220, an output process S230, a system process S240, and a logging process S250. In the functional configuration example shown in FIG. 11, the process execution unit 61 repeatedly executes the control process S200. In the hardware configuration example shown in FIG. 3, this control process is executed by the CPU 12. The system process S240 provides a forced setting control unit 37A. The forced setting control unit 37A sets forced setting data and forced setting validity information in the PLC1 based on an instruction or information related to forced setting provided from a forced setting unit 37 implemented in the PC2.
[0069] The ring buffer 62 is a storage area for saving sample data including the data collection time by the logging process S250 and the value of the target variable collected at the data collection time every time the value of the target variable is collected. In the hardware configuration example shown in FIG. 3, the ring buffer 62 is configured by a part of the storage area of the memory 14.
[0070] The logging process S250 collects the values of the specified target variables according to the logging setting data 42. Here, for variables for which a forced setting, which will be described later, may be implemented, the logging process S250 also collects control information related to the forced setting. In this case, the sample data saved in the ring buffer 62 includes the variable values and the control information related to the forced setting. The control information includes information indicating whether or not the forced setting is implemented.
[0071] The storage unit 63 sequentially reads out the sample data stored in the ring buffer 62 without being discarded, and stores the sample data in the external storage device 17. In the hardware configuration example shown in Fig. 3, the storage device I / F 15 may provide the function of the storage unit 63 under the control of the CPU 12. At this time, the process execution unit 61 provided by the CPU 12 may control the storage device I / F 15 as a part of the logging process S250.
[0072] Fig. 12 shows an example of the logging process executed by the PLC 1. The functional configuration of the PLC 1 is as described with reference to Fig. 11.
[0073] The program execution process S220 executes a user program using input data received in the input process S210 and sent from the input / output module 3 or the communication module 4. The execution result is output by the output process S230 to control an external device. In the hardware configuration example shown in Fig. 3, the CPU 12 that executes the program execution process S220 uses a storage area of the memory 14 to execute the user program. The storage area used at this time is referred to as the "program use area 14a".
[0074] The logging process S250 collects the values of each target variable from among the variables used in the user program executed by the program execution process S220. Note that the logging setting data 42 including the collection operation setting information 52 and the collection target setting information 53 shown in Figs. 8 and 9 is assumed to have been created in the support device 30 (PC2) and provided to the PLC 1 in advance.
[0075] The CPU 12 of the PLC 1 executes a time management process S260 and a collection timing detection process S270 in parallel with the control process S200. The time management process S260 measures the current time. The collection timing detection process S270 detects the arrival of the data collection timing indicated by the collection operation setting information 52 included in the logging setting data 42.
[0076] The logging process S250 collects the values of each target variable when the collection timing is detected in the collection timing detection process S270. The logging process S250 also obtains the collection time of each value from the time measurement result by the time management process S260, and stores sample data in which the value and the collection time are associated with each other in the ring buffer 62.
[0077] The CPU 12 of the PLC 1 executes a save process S280. The save process S280 includes a process of detecting the arrival of a save timing indicated by the collection operation setting information 52 included in the logging setting data 42. Furthermore, in response to the detection of the arrival of the save timing, the save process S280 controls the storage device I / F 15 to read out the sample data stored in the ring buffer 62. Then, the save process S280 saves the read sample data in the external storage device 17. The save destination is indicated by the collection operation setting information 52.
[0078] 13 is a flowchart showing an example of the logging process S250 and the storage process S280. The process of this flowchart is executed when the timing to start the logging process arrives in each cycle of the control process S200.
[0079] In S251, the process execution unit 61 determines whether or not the collection timing has arrived in the collection timing detection process S270. Then, when the arrival of the collection timing is detected (S251: Yes), the collection process is performed in S252. The collection process includes a process of collecting the values of each target variable, and a process of saving the collected values in the ring buffer 62 as sample data 73 described later. The details of this collection process will be described later. On the other hand, when the arrival of the collection timing is not detected (S251: No), the process shown in FIG. 13 ends.
[0080] In S281, the storage unit 63 determines whether or not the save timing has arrived. The save timing is represented by the collection operation setting information 52 included in the logging setting data 42. If the save timing has arrived (S281: Yes), the processing of the storage unit 63 proceeds to S282. On the other hand, if the save timing has not arrived (S281: No), the processing of S282 is not performed and the processing shown in FIG. 13 ends.
[0081] In S282, the storage unit 63 reads out the sample data stored in the ring buffer 62 in the logging process. Then, the storage unit 63 stores the read out sample data as logging collected data 70 in the storage destination indicated by the collection operation setting information 52 (here, the external storage device 17).
[0082] 14 shows an example of the data structure of the logging collected data 70. The logging collected data 70 includes project data information 51, the number of sample data 71, a sample data size 72, and one or more sample data 73.
[0083] The project data information 51 is information for identifying a user program executed by the PLC 1, and includes, for example, a name given to an object code obtained by compiling the user program, and information on the date and time of the compilation. That is, the project data information 51 included in the logging collection data 70 is the same as the project data information 51 included in the logging setting data 42. Note that the CPU 12 may obtain the project data information 51 from the logging setting data 42 and write it into the logging collection data 70 in the collection process S252.
[0084] The number of sample data 71 indicates the number of sample data 73 included in the logging collection data 70. The sample data size 72 indicates the total amount of sample data 73 included in the logging collection data 70. Each sample data 73 is data representing the value of a target variable collected in the logging process, and is written into the logging collection data 70 in the order in which it was collected.
[0085] 15A shows an example of the data structure of sample data 73. In this example, sample data 73 includes a timestamp 74. The timestamp 74 represents the time at which the value of a target variable was collected. Each variable data 75 includes information related to the target variable collected at the time represented by the timestamp 74. Specifically, each variable data 75 includes a data / information identifier 76, a data size 77, and a sample value 78, as shown in FIG. 15B.
[0086] The data / information identifier 76 indicates the type of data or information saved as the sample value 78. As an example, the data / information identifier 76 indicates whether the value saved as the sample value 78 is forcibly set data, forcibly set valid information, forcibly set reflected data, or data not subject to forcible setting. The data size 77 indicates the amount of data in the sample value 78. The sample value 78 indicates the value of the data or information acquired in the logging process.
[0087] Here, the PLC 1 recognizes whether or not the forced setting can be implemented for each variable by referring to the collection target setting information 53 shown in FIG. 9. Then, for variables for which the forced setting cannot be implemented, the PLC 1 acquires and stores data that is not subject to the forced setting as a sample value 78. At this time, the data that is not subject to the forced setting is collected, for example, from the input / output memory area 1011 shown in FIG. 10. Also, for variables for which the forced setting can be implemented, the PLC 1 acquires and stores the forced setting data, the forced setting validity information, and the forced setting reflected data as the sample value 78. At this time, the forced setting data, the forced setting validity information, and the forced setting reflected data are collected, for example, from the input / output memory area 1011, the forced setting input / output area 1021, and the forced setting validity information area 1022 shown in FIG. 10, respectively. Note that, in a case where the position or order in which the forced setting data, the forced setting validity information, and the forced setting reflected data are stored is predetermined, the variable data 75 does not need to include the data / information identifier 76. The data / information identifier 76 may also include addresses for storing the forced setting data, the forced setting validity information, and the forced setting reflected data.
[0088] 12 and 13 is completed, the CPU 12 stores the logging setting data 42 in the external storage device 17. The logging setting data 42 is also used when the sample data 73 is displayed.
[0089] <Forced setting> In the PLC system 10, the PLC 1 collects the values of the target variables used in the user program according to the logging setting data 42 as described above. Then, the PLC 1 generates control data for controlling an external device based on the collected variable values. For example, the PLC 1 acquires displacement data output from a specified sensor and generates control data by substituting the displacement data for variables used in the user program. Then, the external device operates according to this control data. That is, the external device operates according to the displacement data. Therefore, if the displacement data indicates an abnormal value, the external device cannot operate normally. Therefore, when the PLC system 10 detects an abnormal value among the collected values, it performs a forced setting to forcibly replace the value with a specified value.
[0090] Fig. 16 shows an example of a forced setting performed in the PLC system 10. For example, in the case shown in Fig. 16A, a sensor breaks down at time T1, and an abnormal value of the displacement data is detected. In this case, when this displacement data is provided to the user program, normal control data is not generated, and the external device cannot perform normal operation.
[0091] Therefore, when an abnormal value of the displacement data is detected at time T1, the PLC system 10 provides a predetermined value to the user program instead of the displacement data acquired from the sensor, as shown in Fig. 16B, thereby preventing abnormal operation of external devices.
[0092] In this embodiment, the user of the PLC system 10 can decide whether or not to implement forced setting. For example, the user uses PC2 to monitor the values of variables used in PLC1. If an abnormal value is detected, the user uses PC2 to request PLC1 to implement forced setting for the corresponding variable. At this time, information indicating the variables for which forced setting can be implemented is notified from PC2 to PLC1 as, for example, a forced setting availability identifier. Then, PLC1 stores the information indicating the variables for which forced setting can be implemented in a specified memory area.
[0093] Fig. 17 is a flowchart showing an example of the collection process. This collection process corresponds to S252 shown in Fig. 13. It is assumed that in the PLC system 10, whether or not forced setting is executable is specified in advance for each variable in a user program executed by the PLC 1. Then, information indicating whether or not forced setting is executable for each variable (forced setting availability identifier) is notified from the PC 2 to the PLC 1.
[0094] In S253, the process execution unit 61 acquires the current time measured by the time management process S260 as a timestamp. Then, the process execution unit 61 writes the acquired timestamp into the ring buffer 62 as the data at the beginning of the sample data 73. Thereafter, the processes of S254 to S256 are executed for each target variable.
[0095] In S254, the process execution unit 61 judges whether the target variable is a variable for which the forced setting can be implemented. Here, whether the forced setting can be implemented is determined by the user as described above, and is notified from the PC 2 to the PLC 1. Then, the process execution unit 61 executes the corresponding logging process depending on whether the target variable is a variable for which the forced setting can be implemented.
[0096] Here, the targets to be collected in the logging process are notified from the PC 2 to the PLC 1 using the logging setting data 42. Specifically, for variables for which forced setting is not implemented, the memory address where the value of the variable is stored is specified in the collection target setting information 53 shown in FIG. 9. In the example shown in FIG. 10, the address of the "input / output memory area 1011" is specified. Also, for variables for which forced setting may be implemented, the memory address where the value of the variable is stored and the memory address where control information related to the forced setting is stored are specified in the collection target setting information 53 shown in FIG. 9. In the example shown in FIG. 10, the addresses of the "input / output memory area 1011", the "forced setting input / output area 1021", and the "forced setting valid information area 1022" are specified.
[0097] When the target variable is not a variable for which forced setting can be implemented, the process execution unit 61 acquires the current value of the target variable in S255. At this time, the process execution unit 61 acquires the variable value written in the "input / output memory area 1011". Then, the process execution unit 61 writes the acquired variable value in the ring buffer 62 in association with time information indicating the time when the value of the target variable was acquired. In Fig. 15B, the acquired variable value is saved as a sample value. Also, a value indicating data not subject to forced setting is set as a data / information identifier.
[0098] When the target variable is a variable for which forced setting can be implemented, the process execution unit 61 acquires the current value of the target variable and control information related to the forced setting in S256. That is, the process execution unit 61 acquires the values written in the "input / output memory area 1011", the "forced setting input / output area 1021", and the "forced setting validity information area 1022". Then, the process execution unit 61 writes the acquired variable value and control information related to the forced setting into the ring buffer 62 in association with time information indicating the time when the value of the target variable was acquired. The control information related to the forced setting is forced setting data and forced setting validity information, which will be described later. In this case, in FIG. 15B, the acquired variable value, forced setting data, and forced setting validity information are saved as sample values. At this time, a value representing the forced setting reflected data, a value representing the forced setting data, and a value representing the forced setting validity information are set as data / information identifiers corresponding to each sample value.
[0099] The location where the values to be collected (variable values, forced setting data, forced setting validity information) are stored is specified based on the memory type, data type, memory address, and data size information included in collection target setting information 53 of logging setting data 42. Therefore, by reading the data stored at this location, the value to be collected is obtained and written to ring buffer 62.
[0100] In S257, the process execution unit 61 determines whether collection of values has been completed for all target variables registered in the collection target setting information 53 of the logging setting data 42. When the values of all target variables have been collected (S257: Yes), the collection process ends. On the other hand, when there are target variables whose values have not been collected (S257: No), the process of the process execution unit 61 returns to S254. That is, the process execution unit 61 acquires a value related to the next target variable. Then, when the values related to all target variables have been acquired and the storage in the ring buffer 62 has been completed, the storage process S280 is executed.
[0101] In this way, for variables for which forced setting can be implemented, the process execution unit 61 of the PLC 1 also acquires control information related to the forced setting when acquiring the values of the target variables used in the user program. The acquired variable values and control information related to the forced setting are then stored in the ring buffer 62 as variable data. Therefore, by referring to the variable data stored in the ring buffer 62, it is possible to recognize whether or not the forced setting has been implemented for each target variable. In addition, the variable values and control information are recorded in association with the time at which the variable values were collected. Therefore, by referring to the variable data stored in the ring buffer 62, it is possible to identify the time or period at which the forced setting was implemented for each target variable.
[0102] 18 shows an example of a functional configuration related to forced setting of variables. It is assumed that the cycle of the control process shown in FIG.
[0103] As described above, the PLC 1 repeatedly executes the control process S200 including the input process S210, the program execution process S220, the output process S230, the system process S240, and the logging process S250 shown in Fig. 2 or Fig. 11. This control process S200 is executed by the process execution unit 61 shown in Fig. 11. In the hardware configuration example shown in Fig. 3, the control process S200 is executed by the CPU 12.
[0104] The actual input data represents data provided to the PLC 1 via the input / output module 3 shown in Fig. 1. For example, the actual input data is sensor data detected by a sensor in an external device to be controlled. The forced setting input data is a fixed value generated by the forced setting control process S310 for each variable used in the user program.
[0105] The input data generation process S211 generates input data to be given to the corresponding variables in the user program. At this time, the input data generation process S211 may generate the input data to be given to the user program by selecting either the actual input data or the forcibly set input data. The input data generated by the input data generation process S211 is written to the program use area 14a. The input data written to the program use area 14a is used in the program execution process S220.
[0106] The actual output data is generated by executing a user program in the program execution process S220. The actual output data is obtained by extracting data for controlling an external device from the calculation results of the program execution process S220. The forced setting output data is a fixed value generated by the forced setting control process S310 for each variable representing control data for controlling an external device.
[0107] The output data transfer process S231 transfers control data to an external device that is the control target of the PLC 1. At this time, the output data transfer process S231 may generate control data obtained by selecting either the actual output data or the forcibly set output data, and transfer the control data to the external device. The external device operates according to the control data transferred by the output data transfer process S231.
[0108] The forced setting control process S310 is executed, for example, in the PC2 operating as the support device 30. In this case, the forced setting control process S310 corresponds to a process of reflecting the forced setting from the PC2 to the PLC1 via the communication cable 6. However, a part of the forced setting control process S310 is executed in the PLC1. That is, the forced setting control process S310 may be realized by the cooperative operation of the PC2 and the PLC1. In this case, the forced setting control process S310 corresponds to the forced setting unit 37 shown in FIG. 5 and the forced setting control unit 37A shown in FIG. 11.
[0109] The forced setting control process S310 controls the process related to the forced setting depending on whether or not the forced setting is performed for each variable used by the user program. The forced setting control process S310 may also generate the forced setting input data corresponding to each variable and the forced setting output data corresponding to each variable, and control the input data generation process S211 and the output data transfer process S231.
[0110] 19 shows an example of the input data generation process S211. In this embodiment, input data is provided for each of four variables used by the program execution process S220 of the PLC 1. Each input data is represented by 8 bits.
[0111] The forced setting validity information for the input data is generated by the forced setting control process S310, and indicates whether or not forced setting is valid for each input data (or each variable). The forced setting validity information may be 1-bit information, or may be information indicating an address location. In this embodiment, the forced setting validity information has the same number of bits as the input data. Specifically, the forced setting validity information corresponding to the input data for which forced setting should be implemented is "11111111", and the forced setting validity information corresponding to the input data for which forced setting is not implemented is "00000000". In this embodiment, forced setting is implemented for the first and second input data, and forced setting is not implemented for the third and fourth input data.
[0112] As described above, whether or not to enforce forcible setting for each variable is determined by the forcible setting control process S310. Then, the forcible setting control process S310 generates forcible setting validity information corresponding to each variable in response to the determination.
[0113] The input data generation process S211 executes an AND operation between the forced setting input data and the forced setting validity information for each variable. As a result, valid forced setting input data is obtained. Furthermore, the input data generation process S211 executes an AND operation between the actual input data and inverted data of the forced setting validity information for each variable. As a result, valid actual input data is obtained. Furthermore, the input data generation process S211 executes an OR operation between the valid forced setting input data and the valid actual input data for each variable. As a result, input data to be provided to the user program is generated.
[0114] The input data generation process S211 may generate input data to be provided to the user program by other methods. For example, the input data generation process S211 may select either the actual input data or the forced setting input data for each variable depending on whether or not forced setting is to be performed.
[0115] 20 shows an example of the output data transfer process S231. In this embodiment, control data is output from each of four variables used by the program execution process S220 of the PLC 1. Each output data is represented by 8 bits.
[0116] The forced setting validity information for the output data is generated by the forced setting control process S310, and indicates whether or not forced setting is valid for each output data (or each variable). The forced setting validity information may be 1-bit information, or may be information indicating an address location. In this embodiment, the forced setting validity information has the same number of bits as the output data. Specifically, the forced setting validity information corresponding to the output data for which forced setting should be implemented is "11111111", and the forced setting validity information corresponding to the output data for which forced setting is not implemented is "00000000". In this embodiment, forced setting is implemented for the first and second output data, and forced setting is not implemented for the third and fourth output data.
[0117] As described above, whether or not to enforce forcible setting for each variable is determined by the forcible setting control process S310. Then, the forcible setting control process S310 generates forcible setting validity information corresponding to each variable in response to the determination.
[0118] The output data transfer process S231 executes an AND operation between the forced setting output data and the forced setting validity information for each variable. As a result, valid forced setting output data is obtained. The output data transfer process S231 also executes an AND operation between the actual output data and inverted data of the forced setting validity information for each variable. As a result, valid actual output data is obtained. Furthermore, the output data transfer process S231 executes an OR operation between the valid forced setting output data and the valid actual output data for each variable. As a result, control data to be provided to the device to be controlled is generated.
[0119] The output data transfer process S231 may generate the control data to be provided to the device by other methods. For example, the output data transfer process S231 may select either the actual output data or the forced setting output data for each variable depending on whether or not the forced setting is performed.
[0120] 21 and 22 show an example of forced setting and logging processing related to input data. Note that, Fig. 21 and Fig. 22 show processing for one of a plurality of target variables.
[0121] The process execution unit 61 of the PLC 1 includes a memory that stores data / information related to variables used by a user program. A predetermined memory area is allocated to each target variable. In this embodiment, addresses 001 to 003 are allocated to the target variables. Actual input data received via the input / output module 3 or the communication module 4 is written to address 001. Note that the actual input data is an example of forced setting reflected data, since it may be replaced with forced setting data. Forced setting input data for the target variable is stored in address 002. Forced setting validity information indicating whether or not forced setting is implemented for the target variable is stored in address 003.
[0122] The data / information identifiers, in this embodiment, are as follows: 00: Actual input data (data reflected by forced settings) 01: Forced input data 10: Forced setting validity information 11: Data not subject to forced settings
[0123] In the case shown in FIG. 21, the target variable is a variable for which forced setting can be implemented. Whether or not the target variable is forcibly set is assumed to be notified from PC2 to PLC1 by the forced setting availability identifier in the collection target setting information 53 shown in FIG. 9. When the target variable is a variable for which forced setting can be implemented, the address of the input / output memory area, the address of the forced setting input / output area, and the address of the forced setting valid information area shown in FIG. 10 are notified from PC2 to PLC1 as memory addresses in the collection target setting information 53 shown in FIG. 9. In this embodiment, "address 001", "address 002", and "address 003" are notified as the address of the input / output memory area, the address of the forced setting input / output area, and the address of the forced setting valid information area. Then, "00001111" is stored in address 002 as the forced setting data of this target variable.
[0124] In the case shown in Fig. 21A, the value of the actual input data is within the predetermined range, and the forced setting is not performed. In this case, the forced setting validity information stored in address 003 is "00000000 (invalid)".
[0125] The logging process S250 collects data / information from the memory address notified by PC2. That is, the logging process S250 collects actual input data, forced setting data, and forced setting validity information from addresses 001, 002, and 003, respectively. Then, the logging process S250 stores the collected data / information in the ring buffer 62 in association with the collection time. At this time, a data / information identifier is assigned to each data / information. Specifically, "00" is assigned to actual input data, "01" is assigned to forced setting data, and "10" is assigned to forced setting validity information.
[0126] In this case, the actual input data is provided to the corresponding variables in the program execution process S220. The program execution process S220 then executes an operation using the actual input data and outputs the processing result.
[0127] In the case shown in Fig. 21B, the value of the actual input data is outside the predetermined range, and a forced setting is performed. In this case, the forced setting validity information stored in address 003 is "11111111 (valid)".
[0128] 21A, the logging process S250 collects actual input data, forced setting data, and forced setting validity information from addresses 001, 002, and 003, respectively, and stores them in the ring buffer 62. Also, like the case shown in Fig. 21A, a data / information identifier is assigned to each piece of data / information.
[0129] In this case, the forced setting data is provided to the corresponding variable in the program execution process S220. The program execution process S220 then executes an operation using the forced setting data and outputs the processing result.
[0130] In the case shown in Fig. 22, the target variable is a variable for which forced setting cannot be implemented. Also, when the target variable is a variable for which forced setting cannot be implemented, only the address of the input / output memory area shown in Fig. 10 is notified from PC2 to PLC1 as the memory address in the collection target setting information 53 shown in Fig. 9. In this embodiment, "address 011" is notified as the address of the input / output memory area.
[0131] The logging process S250 collects data / information from a memory address notified by PC2. That is, the logging process S250 collects actual input data from address 011. Then, the logging process S250 stores the collected data in the ring buffer 62 in association with the collection time. At this time, a data / information identifier is assigned to the collected actual input data. However, in the case shown in FIG. 22, no forced setting is performed on this variable. That is, this actual input data is not subject to forced setting. Therefore, the value of the data / information identifier is "11".
[0132] Although Figures 21 and 22 show a case where forced setting is performed on variables to which input data is given, the embodiment of the present invention is also applied to variables for generating control data, as shown in Figures 23 and 24.
[0133] Fig. 23A shows a case where the target variable is a variable for which forcible setting can be implemented, and the value of the actual output data output from the program execution process S220 is within the normal range. Fig. 23B shows a case where the target variable is a variable for which forcible setting can be implemented, and the value of the actual output data output from the program execution process S220 is outside the normal range. Fig. 24 shows a case where the target variable is not forcibly set.
[0134] In this way, for variables for which forced setting can be implemented, the forced setting reflected data (actual input data or actual output data), forced setting data (forced setting input data or forced setting output data), and forced setting validity information are collected in the logging process and stored in association with the collection time. At this time, a data / information identifier is assigned to each data / information.
[0135] <Displaying data collected by logging> As described above, the logging process is performed by the PLC 1 in the PLC system 10 shown in Fig. 1. As a result, sample data 73 including the collected variable values is stored in the external storage device 17. A method for displaying this sample data 73 will be described below.
[0136] 25 shows an example of the hardware configuration of a collected data display device. A collected data display device 80 includes a CPU 81, a memory 82, an input device 83, an auxiliary storage device 84, a display device 85, and a storage device I / F 86. All of these components are hardware, and can transmit data to each other using an internal bus 87.
[0137] The CPU 81 executes programs using the memory 82 to provide functions such as displaying the sample data 73 and processing the sample data 73 to display a graph or waveform. The input device 83 is, for example, a keyboard and / or a pointing device, and is used to input instructions or information from the user. The auxiliary storage device 84 is, for example, a magnetic disk device, an optical disk device, a magneto-optical disk device, a hard disk drive, or a flash memory. The collected data display device 80 can store programs and data in the auxiliary storage device 84 and load them into the memory 82 for use.
[0138] The display device 85, for example, makes inquiries to the user, gives instructions to the user, and displays processing results. The storage device I / F 86 manages the reading of various data from the external storage device 17 such as a memory card.
[0139] 25 is a standard configuration that a general computer has, the collected data display device 80 may be realized using a general computer. Also, the collected data display device 80 may be realized using the PC 2 that operates as the support device 30 in the PLC system 10 of FIG.
[0140] Fig. 26 shows an example of the functional configuration of a collected data display device 80. It is assumed that the above-mentioned logging collected data 70 is stored in the external storage device 17 by the PLC 1. As described with reference to Figs. 14 and 15, in the logging collected data 70, sample data 73 including values collected by the logging process for each target variable is arranged in order of collection time. As shown in Fig. 15, the sample data 73 includes a time stamp and variable data (data / information identifier, data size, sample value).
[0141] The collected data display device 80 includes a readout unit 91, a display unit 92, and a display control unit 93. The readout unit 91 reads out the logging collected data 70 from the external storage device 17. The display unit 92 displays the collection time in association with the value of the target variable collected at the collection time based on the logging collected data 70. The display control unit 93 generates display data for the target variable based on the logging collected data 70. Furthermore, when the display control unit 93 finds a trace of a forced setting in the logging collected data 70, it generates highlighting data for highlighting the value of the target variable for which the forced setting was implemented. The display unit 92 can highlight the value of the target variable for which the forced setting was implemented according to the highlighting data.
[0142] Such highlighting allows the user to recognize that a forced setting has been implemented on the variable to be logged. The display control unit 93 can find traces of a forced setting based on the value of the forced setting validity information in the logging collection data 70, for example. For example, in the case shown in FIG. 21A, the forced setting validity information is "00000000", so it is determined that a forced setting has not been implemented. On the other hand, in the case shown in FIG. 21B, the forced setting validity information is "11111111", so it is determined that a forced setting has been implemented. At this time, the display control unit 93 can obtain the forced setting validity information by extracting data / information whose data / information identifier value is "10".
[0143] 27 shows an example of a method for displaying the logging collected data 70. The collected data display device 80 executes a program display process S410, a waveform display process S420, a logging file analysis and conversion process S430, and a display control process S440. The program that causes the CPU 81 to perform these processes is sometimes called engineering software.
[0144] The program display process S410 displays the user program included in the above-mentioned project data 41, and also displays the values of target variables in the user program by using the sample data 73 included in the logging collection data 70. The project data 41 has already been created by the user using a predetermined editing program in the PC 2, and is stored in, for example, the auxiliary storage device 84.
[0145] The waveform display process S420 displays the relationship between the collection time and the value of the target variable using a waveform or a graph, based on the sample data 73 included in the logging collection data .
[0146] The logging file analysis / conversion process S430 analyzes the logging setting data 42 and the logging collection data 70, and converts the sample data 73 into the input data format of the program display process S410 and the waveform display process S420. In this embodiment, the logging setting data 42 and the logging collection data 70 are provided from the external storage device 17. That is, the logging file analysis / conversion process S430 reads out these data from the external storage device 17 and uses them.
[0147] The display control process S440 includes a process of providing the values of the target variables associated with the collection times obtained by the logging file analysis / conversion process S430 to the program display process S410 and the waveform display process S420. In addition, the display control process S440 includes a process of linking the display by the program display process S410 and the display by the waveform display process S420.
[0148] 28 shows an example of the program display processing S410. The program display processing S410 includes an operation UI processing S411, a variable value display control processing S412, a user program display processing S413, a comparison processing S414, and a warning processing S415.
[0149] The operation UI processing S411 accepts information corresponding to an operation on the input device 83 by the user of the collected data display device 80. The variable value display control processing S412 controls the display of the value of the target variable according to the information accepted by the operation UI processing S411 and the linkage information from the display control processing S440. The user program display processing S413 displays the user program included in the project data 41, and also displays the value of the target variable under the control of the variable value display control processing S412.
[0150] 29 shows an example of a display screen of sample data by the collected data display device 80. This display screen is displayed on the display device 85 by the CPU 81 executing the program display process S410. In this screen example, a UI screen 520 generated by the operation UI process S411 is displayed superimposed on a user program display screen 510 generated by the program display process S410. In addition, a diagram (e.g., a ladder program) showing the contents of the user program included in the project data 41 is created by the program display process S410 and displayed as the user program display screen 510.
[0151] The UI screen 520 includes a frame-by-frame button 521, a seek bar 522, and a time input field 523. The frame-by-frame button 521 and the seek bar 522 provide instructions to sequentially update the display of the values of the target variables collected at each collection timing. The time input field 523 accepts the time of collection of the values of the target variables to be displayed. The time input field 523 also has a function of displaying the time of collection specified using the frame-by-frame button 521 or the seek bar 522.
[0152] When the operation UI processing S411 detects a collection timing specified using the frame advance button 521 or the seek bar 522, the time representing this timing is displayed in the time input field 523. Also, when the user specifies a time using the time input field 523, the operation UI processing S411 specifies the collection timing at which the value of the target variable should be displayed.
[0153] The variable value display control processing S412 acquires information indicating the value of the target variable associated with the collection timing in the logging collection data 70 and the designated collection timing (i.e., the collection timing at which the value of the target variable should be displayed). Here, the logging collection data 70 is acquired by the logging file analysis / conversion processing S430 and passed to the display control processing S440. Then, the variable value display control processing S412 acquires the logging collection data 70 from the display control processing S440. Also, the variable value display control processing S412 sends the value of the target variable at the designated collection timing to the program display processing S410. Then, the program display processing S410 displays the value of the target variable at the designated collection timing on the user program display screen 510.
[0154] 29, the user program display screen 510 includes an ON / OFF display 511 and a variable display 512. When a state of a program component representing an ON or OFF state is selected as a target variable, the ON / OFF display 511 displays the variable value by filling the element with a color corresponding to the state represented by the value of the variable. In this example screen, the ON / OFF display 511 displays the element in the user program to be collected in black, but in reality, for example, when it is "ON", it is displayed in red, and when it is "OFF", it is displayed in blue.
[0155] When a numerical value relating to a program component is selected as a target variable, variable display 512 displays the numerical value as the variable value.
[0156] In this way, the program display process S410 causes the collection time and the value of the target variable collected at that collection time to be associated with each other and displayed on the display device 85.
[0157] A verification process S414 verifies the consistency between the project data 41, the project data information 51 in the logging setting data 42, and the project data information 51 in the logging collection data 70. A warning process S415 outputs a predetermined warning when the project data 41 and the project data information 51 do not match each other in the verification process S414.
[0158] Fig. 30 shows an example of a warning screen displayed on the display device 85. The warning by the warning process S415 is realized, for example, by displaying a warning screen as shown in Fig. 30 on the display device 85. This warning screen includes a warning dialog 530 for notifying the user that the project data 41 and the project data information 51 do not match each other. Note that, since this is useful when debugging a user program, the collected data display device 80 displays the values of the target variables even when a warning is output.
[0159] Fig. 31 shows an example of the waveform display process S420. As shown in Fig. 31, the waveform display process S420 includes an operation UI process S421, a variable value display control process S422, and a waveform creation process S423.
[0160] The operation UI processing S421 is substantially the same as the operation UI processing S411, and receives information corresponding to an operation on the input device 83 by the user of the collected data display device 80. The variable value display control processing S422 is substantially the same as the variable value display control processing S412, and controls the display of the value of the target variable according to the information received by the operation UI processing S421 and the linkage information from the display control processing S440. The waveform creation processing S423 creates and displays a waveform or graph showing the relationship between the collection timing and the target variable, based on the value of the target variable associated with the collection timing, which is provided by the display control processing S440.
[0161] 32 shows an example of a waveform display screen for sample data. A waveform display screen 540 is displayed on the display device 85 by the CPU 81 executing the waveform display process S420.
[0162] Waveforms 541 displayed on the waveform display screen 540 are created by the waveform display process S420. In the example screen shown in Fig. 32, waveforms 541 corresponding to "variable 1", "variable 2", and "variable 3" are shown by a solid line, a dashed line, and a dashed dotted line, respectively. Also, a time display area 542 is set for the waveforms 541, and shows the time when the variable values were collected.
[0163] When the operation UI processing S421 accepts an instruction to change the collection time range, the waveform display processing S420 displays a waveform 541 in the specified collection time range on the waveform display screen 540. The collection time range is specified by the user, for example, using the UI screen 520 shown in Fig. 29. In addition, the time corresponding to the collection timing identified by the thick line 543 (11:20 p.m. in Fig. 32) is displayed in the time display field 544 by the waveform display processing S420. The thick line 543 is set, for example, by the user specifying the time.
[0164] The variable value display control process S422 acquires the value of a target variable associated with a collection timing in the logging collected data 70. The variable value display control process S422 also recognizes the time corresponding to the collection timing displayed in the time display field 544. The variable value display control process S422 then displays the value corresponding to the intersection of the waveform 541 and the thick line 543 in the variable value display field 545 as the value of the target variable at the time specified by the user. For example, it is displayed that the value of variable 3 at 23:20 is "200".
[0165] In this way, the collected data display device 80 can display the change in the value of each target variable over time using a waveform or graph by executing the waveform display process S420.
[0166] 33 shows an example of the logging file analysis / conversion process S430. The logging file analysis / conversion process S430 includes a logging setting data acquisition process S431, a logging collected data acquisition process S432, a forced setting determination process S433, and a display data creation process S434.
[0167] The logging setting data acquisition process S431 acquires the logging setting data 42 from the external storage device 17. The logging collection data acquisition process S432 acquires the logging collection data 70 from the external storage device 17. The logging collection data acquisition process S432 provides the function of the reading unit 91 shown in FIG.
[0168] The forced setting determination process S433 searches for a trace of a forced setting for the target variable in the logging collected data 70. The trace of a forced setting is represented by, for example, forced setting validity information. In this case, the forced setting determination process S433 acquires the forced setting validity information by searching for a data / information identifier in the logging collected data 70. Then, the forced setting determination process S433 determines whether or not a forced setting has been implemented for the target variable based on the value of the forced setting validity information. For example, in the case shown in FIG. 21 to FIG. 24, if the forced setting validity information is "00000000", it is determined that a forced setting has not been implemented for the variable data, and if the forced setting validity information is "11111111", it is determined that a forced setting has been implemented for the variable data.
[0169] If it is determined in the forced setting determination process S433 that a forced setting has been implemented for the target variable, the display data creation process S434 creates highlighted display data indicating that the value of the target variable is a forcibly set value.
[0170] 34 is a flowchart showing an example of the logging file analysis and conversion process S430. The process of this flowchart is executed by the readout unit 91 and the display control unit 93 of the collected data display device 80 shown in FIG.
[0171] In S4301, the reading unit 91 acquires the logging setting data 42 and the logging collection data 70 from the external storage device 17. The logging collection data 70 includes sample data 73 corresponding to a plurality of target variables, as shown in FIG. 14. The sample data 73 corresponding to each target variable includes variable data 75, as shown in FIG. 15A. The variable data 75 corresponding to each target variable includes a sample value related to the target variable and a data / information identifier for the sample value, as shown in FIG. 15B. When the target variable is a variable for which forced setting can be implemented, the sample value is the actual data, forced setting data, and forced setting validity information collected by the logging process.
[0172] In S4302, the display control unit 93 initializes a counter. The count value of this counter identifies multiple target variables. In S4303, the display control unit 93 selects a target variable corresponding to the count value of the counter from the logging collection data 70, and creates display data for the target variable.
[0173] In S4304 to S4305, the display control unit 93 increments the counter. Here, if the count value of the counter has not reached the number of sample data (i.e., the number of target variables), the process of the display control unit 93 returns to S4303. That is, the process of S4303 is executed for the next target variable. Then, when the process of S4303 has been executed for all target variables, the process of the display control unit 93 ends. In this way, the display control unit 93 creates display data for each target variable.
[0174] 35 is a flowchart showing an example of a process for creating display data for each target variable. This process corresponds to S4303 shown in FIG.
[0175] In S4311, the display control unit 93 judges whether the target variable is a variable for which forced setting can be implemented. If the data / information identifier given to the collected data corresponding to the target variable indicates "data not subject to forced setting," the target variable is judged to be a variable for which forced setting cannot be implemented. In this case, the display control unit 93 creates normal display data from the actual data (actual input data or actual output data) in S4312.
[0176] When the target variable is a variable for which forced setting can be implemented, the display control unit 93 acquires in S4313 the actual data, the forced setting data, and the forced setting validity information from the input / output memory area, the forced setting input / output area, and the forced setting validity information area shown in Fig. 10. Next, in S4314, the display control unit 93 determines whether or not forced setting has been implemented for the target variable based on the acquired forced setting validity information.
[0177] When no forced setting has been implemented for the target variable, the display control unit 93 calculates the variable value from the actual data, the forced setting data, and the forced setting validity information in the manner shown in Fig. 19 to Fig. 20, and creates display data for displaying the variable value. Note that the display control unit 93 may obtain the variable value by selecting the actual data, instead of calculating the variable value from the actual data, the forced setting data, and the forced setting validity information.
[0178] When a forced setting has been implemented for the target variable, the display control unit 93 calculates the variable value from the actual data, the forced setting data, and the forced setting validity information in the manner shown in Fig. 19 to Fig. 20, and creates highlighting data for highlighting the variable value. Note that the display control unit 93 may obtain the variable value by selecting the forced setting data, instead of calculating the variable value from the actual data, the forced setting data, and the forced setting validity information.
[0179] 36 shows an example of the display control process S440. The display control process S440 includes a variable value providing process S441, a playback control process S442, and a sample data obtaining process S443.
[0180] The variable value providing process S441 provides the logging collection data 70 obtained by the logging file analysis / conversion process S430 as the value of a target variable associated with a collection timing to the program display process S410 and the waveform display process S420. The provided logging collection data 70 may include highlighting data created by the logging file analysis / conversion process S430.
[0181] When the playback control process S442 receives an instruction to link the display screens, it controls the program display process S410 and the waveform display process S420 to link the contents of the user program display screen 510 and the waveform display screen 540. The playback control process S442 also includes a process for matching the collection timing designated using the UI screen 520 shown in Fig. 29 with the time indicated by the thick line 543 on the waveform display screen 540 shown in Fig. 32.
[0182] The sample data acquisition process S443 acquires the logging collected data 70 from the logging file analysis / conversion process S430 and provides it to the variable value provision process S441.
[0183] In this way, the logging collection data 70 obtained by the logging file analysis / conversion process S430 is provided to the program display process S410 and the waveform display process S420. At this time, highlighting data is created for target variables for which a forcible setting has been implemented in the logging collection data 70. Therefore, the target variables for which a forcible setting has been implemented are displayed in a highlighted manner on the user program display screen 510 and / or the waveform display screen 540.
[0184] 37 shows an example in which variables for which forced settings have been implemented are highlighted on the user program display screen 510. In this embodiment, it is assumed that forced settings have been implemented for variable 3.
[0185] 37, the display of a monochrome program component is included in the user program display screen 510 as an ON / OFF highlight 513. The ON / OFF highlight 513 indicates that a program component having either an ON or OFF state has been selected as a target variable, and the value of the target variable has been forcibly set.
[0186] 37 includes a variable highlighting 514 that highlights variable 3. The variable highlighting 514 may display the numerical value for "variable 3" in a color different from that of the other variables. Alternatively, the variable highlighting 514 may display the numerical value for "variable 3" in a font different from that of the other variables (e.g., bold). The variable highlighting 514 indicates that the numerical value for the program component has been selected as a target variable, and that the value of the target variable has been forcibly set.
[0187] As shown in FIG. 15, a time stamp 74 is added to the variable data 75 in the logging collected data 70. Therefore, by analyzing the logging collected data 70, it is possible to detect the time or period during which the forced setting was implemented for each target variable. In addition, the user can specify the collection time by using the UI screen 520. Then, the collected data display device 80 may highlight a target variable (here, variable 3) when the forced setting was implemented for the target variable at the collection time specified by the user.
[0188] 38 shows an example in which a target variable for which a forced setting has been implemented is highlighted on the waveform display screen 540. In this embodiment, it is assumed that a forced setting has been implemented for variable 3.
[0189] In the example screen shown in Fig. 38, waveform 541 for variable 3 is highlighted. Waveform highlighting 546 indicates that a forced setting has been implemented for variable 3. Waveform highlighting 546 may also indicate the period during which the forced setting was implemented. In the example screen shown in Fig. 38, waveform highlighting 546 indicates that a forced setting was implemented for variable 3 between 9:10 and 9:20.
[0190] In this way, the program display process S410 and the waveform display process S420 provide the function of the display unit 92 shown in Fig. 26. Furthermore, the logging file analysis / conversion process S430 and the display control process S440 provide the function of the display control unit 93 shown in Fig. 26. As a result, when displaying the values of the target variables collected by the logging process, the collected data display device 80 highlights the target variables for which a forcible setting has been implemented (or the variable values of the target variables). Therefore, the user can easily distinguish whether the value acquired from the user program of PLC1 is a value output from an instrument or a predetermined value that has been forcibly set.
[0191] When a user of the PLC system 10 decides whether or not to perform forced setting, the user knows which variables have been forced to be set. On the other hand, the log data collected by the logging process is referred to, for example, when some kind of failure occurs in the PLC system 10. At this time, the user who refers to the log data may be different from the user who decided to perform forced setting. In addition, in the maintenance or troubleshooting of the PLC system 10, log data that is several days or weeks old may be referred to. In these cases, the user who refers to the log data may not know when and for which variables the forced setting was performed. Therefore, highlighting the variables for which the forced setting was performed based on the embodiment of the present invention is useful even when the user of the PLC system 10 performs forced setting.
[0192] Although the disclosed embodiments and their advantages have been described in detail above, it will be appreciated that those skilled in the art may make various modifications, additions, and omissions therein without departing from the scope of the present invention as clearly set forth in the claims. [Explanation of symbols]
[0193] 1 PLC 2 PC 3 Input / Output Module 4. Communication Module 10 PLC System 11, 26 Communication I / F 12, 21 CPU 13 Bus Controller 14, 22 Memory 14a Program Use Area 15 Storage device I / F 17 External storage device 23 Input Devices 24 Display device 25 Auxiliary storage 30 Support equipment 31 Program Analysis Section 32 Selection section 33 Reception 34 Setting information output section 37 Forced setting section 37A Forced setting control section 40 Configuration Tool 41 Project Data 42 Logging configuration data 51 Project Data Information 52 Collection operation setting information 53 Collection target setting information 61 Processing Execution Unit 62 Ring Buffer 63 Preservation Department 70 Logging collected data 75 Variable Data 76 Data / Information Identifier 80 Collected data display device 91 Readout section 92 Display section 93 Display control section
Claims
1. A programmable logic controller for controlling an external device, a process execution unit that repeatedly executes a control process cycle including a program execution process for executing a control program, an output process for outputting a result of the execution of the control program to control the external device, and a logging process for collecting variable data related to variables used in the control program in accordance with a logging setting; a memory including a first memory area for storing actual input data to be applied to said variables, and a second memory area for storing control information relating to forcing the application of predetermined forcing input data to said variables in place of said actual input data; A storage unit for storing data collected by the logging process, The processing execution unit is generating input data to be provided to the variables based on the actual input data and the control information; In the logging process, the actual input data and the control information are stored in the storage unit in association with time information indicating a time when the variable data was collected.
1. A programmable logic controller comprising:
2. the control information includes the forced setting input data and forced setting validity information indicating whether the forced setting is being performed or not; In the logging process, the process execution unit stores the actual input data, the forced setting input data, and the forced setting validity information in the storage unit in association with the time information.
2. The programmable logic controller of claim 1.
3. When the forced setting is not implemented, the process execution unit provides the actual input data to the variables as the input data, When the forced setting is implemented, the process execution unit provides the forced setting input data to the variable as the input data.
3. The programmable logic controller of claim 2.
4. The memory includes: a third memory area for storing actual output data calculated using a second variable used in the control program; a fourth memory area for storing second control information related to a second forcing setting for outputting a predetermined forcing setting output data instead of the actual output data; The processing execution unit is generating output data to be provided to the external device based on the actual output data and the second control information; In the logging process, the actual output data and the second control information are stored in the storage unit in association with time information indicating a time when the variable data was collected.
2. The programmable logic controller of claim 1.
5. 1. A support device for supporting a programmable logic controller, comprising: The programmable logic controller includes: a process execution unit that repeatedly executes a control process cycle including a program execution process for executing a control program, an output process for outputting a result of the execution of the control program to control an external device, and a logging process for collecting variable data related to variables used in the control program in accordance with a logging setting; a memory including a first memory area for storing actual input data to be applied to said variables, and a second memory area for storing control information relating to forcing to apply predetermined forcing input data to said variables instead of said actual input data, the processing execution unit stores the actual input data and the control information in a storage unit in association with time information indicating a time when the variable data was collected in the logging process; The support device includes: a setting information output unit that generates and outputs the logging setting including information representing that the actual input data stored in the first memory area and the control information stored in the second memory area are to be collected in the logging process.
16. An assistance device comprising:
6. A display device for displaying data collected in a programmable logic controller, comprising: The programmable logic controller includes: a process execution unit that repeatedly executes a control process cycle including a program execution process for executing a control program, an output process for outputting a result of the execution of the control program to control an external device, and a logging process for collecting variable data related to variables used in the control program in accordance with a logging setting; a memory including a first memory area for storing actual input data to be applied to said variables, and a second memory area for storing control information relating to forcing to apply predetermined forcing input data to said variables instead of said actual input data, the processing execution unit stores, in a storage device, the actual input data and the control information as logging collected data in association with time information indicating a time when the variable data was collected in the logging processing; The display device includes: A reading unit that reads the logging collection data from the storage device; an analysis unit that determines whether the forced setting has been performed on the variable based on the control information; a display unit that displays a value represented by the actual input data when the forced setting is not implemented for the variable, and displays a value represented by the forced setting input data when the forced setting is implemented for the variable. A display device comprising:
Citation Information
Patent Citations
Controller and data recording method
JP2019200744A
Control program management device
JP2021101317A
Programmable logic controller, support device, and display device, as well as logging method, support method, and display method
JP7168114B1
Control program management device
WO2021132508A1
Programmable logic controller, support device, and display device, as well as logging method, support method, and display method
JP7188631B1
