Programmable logic controller, support device, and display device
The programmable logic controller system distinguishes between instrument-generated and forcibly set values by collecting and flagging variable settings, facilitating accurate system operation and maintenance.
Patent Information
- Application Number
- JP2024116638
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Conventional systems struggle to distinguish between instrument-generated values and forcibly set values in programmable logic controllers (PLCs) during system failures, making it difficult to identify when predetermined values are being used instead of actual measurements.
The system includes a programmable logic controller with a processing unit that collects variable values, stores them with associated time information, and flags forced settings, along with a support device that provides information on forced settings, and a display device that highlights these settings in logged data.
Enables the identification of forcibly set values in logged data, allowing users to differentiate between instrument-generated and predetermined values, thereby ensuring accurate system operation and maintenance.
Smart Images

Figure 0007601278000001_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 embodiment of the present invention comprises a process execution unit that repeatedly executes a control process cycle including a program execution process that executes a control program to control an external device, an output process that outputs a result of the execution of the control program to control the external device, and a logging process that collects variable values representing values of variables used in the control program in accordance with a logging setting, a first memory that stores the logging setting, and a second memory that stores the variable values collected by the logging process.
[0007] When a forced setting is performed to give forced setting input data to the variable instead of the input data to be given to the variable, the processing execution unit stores in the second memory the variable value and a forced setting flag indicating that the forced setting has been performed on the variable, in correspondence with time information indicating the time when the variable value was collected in the logging processing.
[0008] According to one aspect of the present invention, an assistance device assists a programmable logic controller. 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 an execution result of the control program to control the external device, and a logging process for collecting variable values representing values of variables used in the control program according to a logging setting. When a forced setting is performed to provide a forced setting input data to a variable instead of input data to be provided to the variable, the process execution unit stores the variable value and a forced setting flag representing that the forced setting has been performed on the variable in a memory in association with time information representing the time when the variable value was collected in the logging process.
[0009] The support device includes an output unit that generates and outputs the logging setting, and a forced setting unit that provides the programmable logic controller with information indicating whether or not the forced setting for the variable is to be implemented.
[0010] A display device according to one aspect of the present invention displays data collected by a programmable logic controller. 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 an execution result of the control program to control the external device, and a logging process for collecting variable values representing values of variables used in the control program according to a logging setting. When a forced setting is performed to provide a forced setting input data to a variable instead of input data to be provided to the variable, the process execution unit stores the variable value and a forced setting flag representing that the forced setting has been performed on the variable in a storage device as logging collection data in the logging process, in association with time information representing the time when the variable value was collected.
[0011] The display device comprises a reading unit which reads out the logging collection data from the storage device, a display unit which displays the variable value in correspondence with the time information based on the logging collection data, and a display control unit which, when traces indicating that the forced setting has been implemented are detected in the logging collection data, displays an indication that a forced setting has been implemented for the variable in correspondence with the time represented by the time information corresponding to the forced setting flag. Effect of the Invention
[0012] 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]
[0013] [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] FIG. 2 is a diagram illustrating an example of a functional configuration of a PLC. [Figure 11] FIG. 11 illustrates an example of a logging process executed by a PLC. [Figure 12]11 is a flowchart showing an example of a logging process and a storage process. [Figure 13] FIG. 4 is a diagram illustrating an example of a data structure of logging collection data. [Figure 14] 10A and 10B are diagrams illustrating an example of data structures of sample data and variable data. [Figure 15] FIG. 1 illustrates an example of a forced setting implemented in a PLC system. [Figure 16] 13 is a flowchart illustrating an example of a collection process. [Figure 17] FIG. 13 is a diagram illustrating an example of a functional configuration related to forced setting of a variable. [Figure 18] FIG. 11 illustrates an example of an input data generation process. [Figure 19] FIG. 11 illustrates an example of an output data transfer process. [Figure 20] 11 is a diagram illustrating an example of a method for reflecting information related to forced settings in logging setting data. FIG. [Figure 21] 11 is a flow diagram illustrating an example process for updating logging configuration data in relation to a forced setting. [Figure 22] FIG. 13 is a diagram illustrating an example of updating and logging processing of logging setting data related to forced settings. [Diagram 23] FIG. 13 is a diagram illustrating another example of updating logging setting data related to forced settings and logging processing. [Figure 24] FIG. 2 is a diagram illustrating an example of a hardware configuration of a collected data display device. [Diagram 25] FIG. 2 is a diagram illustrating an example of a functional configuration of a collected data display device. [Figure 26] FIG. 13 illustrates an example of a method for displaying logged collection data. [Figure 27] FIG. 11 illustrates an example of a program display process. [Figure 28] FIG. 13 is a diagram showing an example of a display screen of sample data. [Figure 29] FIG. 13 is a diagram showing an example of a warning screen displayed on the display device. [Diagram 30]FIG. 11 is a diagram illustrating an example of a waveform display process. [Diagram 31] FIG. 13 is a diagram showing an example of a waveform display screen for sample data. [Diagram 32] FIG. 13 is a diagram showing an example of a logging file analysis and conversion process. [Diagram 33] 13 is a flowchart showing an example of a logging file analysis and conversion process. [Diagram 34] FIG. 11 is a diagram illustrating an example of a display control process. [Diagram 35] 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. [Diagram 36] 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
[0014] 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.
[0015] 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."
[0016] 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.
[0017] 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.
[0018] 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.
[0019] 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.
[0020] 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.
[0021] 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.
[0022] 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.
[0023] 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.
[0024] 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.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] <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.
[0033] 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.
[0034] 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. The reception unit 33 receives a designation of a predetermined collection period longer than the control cycle. 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 cycle. The setting information output unit 34 outputs information representing the multiple collection target variables and information representing the collection period as logging settings. In the following description, the variables to be collected in the logging process (i.e., collection target variables) may be simply referred to as "target variables".
[0035] 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.
[0036] 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.
[0037] The support device 30 having the above-mentioned functions makes it possible to update the logging settings without stopping the logging process that collects a desired amount of variable values in the PLC 1. In other words, the PLC 1 can continuously collect the values of variables used in controlling the device.
[0038] The support device 30 includes a forced setting unit 37. The forced setting unit 37 provides the PLC 1 with 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.
[0039] 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.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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 PLC 1) are selected from the variables extracted by the program analysis process S111.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.
[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.
[0059] 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.
[0060] <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.
[0061] Fig. 10 shows an example of the functional configuration of the PLC 1. In the example shown in Fig. 10, 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.
[0062] 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. 10, 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 information related to forced setting provided by the forced setting unit 37 implemented in the PC2.
[0063] The ring buffer 62 is a storage area for saving sample data in which the data collection time by the logging process S250 is associated with 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.
[0064] The logging process S250 collects values of specified target variables in accordance with the logging setting data 42. Here, the logging process S250 includes a process of collecting values of target variables for which a forcible setting has been implemented, which will be described later. Furthermore, the sample data saved in the ring buffer 62 may include information indicating whether or not a forcible setting has been implemented for the collected values of the target variables.
[0065] 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.
[0066] Fig. 11 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. 10.
[0067] 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".
[0068] 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, which includes information on the target variables and operation setting information for the logging process, is assumed to have been created in the support device 30 (PC2) and provided to the PLC1 in advance.
[0069] 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.
[0070] The logging process S250 collects the values of each target variable when the collection timing is detected by 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.
[0071] 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 represented 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 represented by the collection operation setting information 52.
[0072] 12 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.
[0073] In S251, the process execution unit 61 uses the collection timing detection process S270 to determine whether or not the collection timing has arrived. 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, which 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. 12 ends.
[0074] 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. 12 ends.
[0075] 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).
[0076] 13 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.
[0077] 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.
[0078] 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.
[0079] 14A 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 when 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 forced setting flag 76, a variable data size 77, and a variable value 78, as shown in FIG. 14B.
[0080] The forced setting flag 76 indicates whether the forced setting for the variable value 78 is enabled or disabled. If the forced setting for the variable value 78 is enabled, the forced setting flag 76 is set to the ON state. If the forced setting for the variable value 78 is disabled, the forced setting flag 76 is set to the OFF state. The forced setting flag 76 in the ON state indicates that a forced setting has been implemented for the variable value. In this way, by providing the forced setting flag 76, it is possible to record information in the variable data 75 indicating that a predetermined value has been forcibly set for the target variable. Note that the forced setting will be explained later.
[0081] The variable data size 77 indicates the amount of data of the variable value 78. The variable value 78 indicates the value of the collected variable.
[0082] In this manner, in S282, the storage unit 63 creates the logging collection data 70 having the data structure shown in Fig. 13 using the logging setting data 42 and the sample data stored in the ring buffer 62. Then, the logging collection data 70 is stored in the external storage device 17.
[0083] 11 and 12 is completed, the CPU 12 saves 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.
[0084] <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.
[0085] Fig. 15 shows an example of a forced setting performed in the PLC system 10. For example, in the case shown in Fig. 15A, 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.
[0086] Therefore, when an abnormal value of the displacement data is detected at time T1, the PLC system 10 gives the user program a predetermined value obtained from the forced setting unit 37 instead of the displacement data obtained from the sensor, as shown in Fig. 15B. This prevents the external device from operating abnormally.
[0087] In this embodiment, the user of the PLC system 10 can decide whether or not to implement the forced setting. For example, the user uses the PC2 to monitor the values of variables used in the PLC1. Then, when an abnormal value is detected, the user uses the PC2 to request the PLC1 to implement the forced setting for the corresponding variable.
[0088] Fig. 16 is a flowchart showing an example of the collection process. This collection process corresponds to S252 shown in Fig. 12. Furthermore, it is assumed that the PLC system 10 can perform forced setting for each target variable as necessary.
[0089] 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 S257 are executed for each target variable.
[0090] In S254, the process execution unit 61 determines whether or not a forced setting has been implemented for the target variables. Here, whether or not a forced setting has been implemented for each target variable is notified from, for example, the support device 30. Alternatively, the PLC 1 itself may determine whether or not to implement a forced setting for each target variable. In any case, the process execution unit 61 can determine whether or not a forced setting has been implemented for the target variables.
[0091] When a forced setting has been implemented for the target variable, the process execution unit 61 sets the forced setting flag of the target variable to the ON state in S255. On the other hand, when a forced setting has not been implemented for the target variable, the process execution unit 61 sets the forced setting flag of the target variable to the OFF state in S256. The forced setting flag is recorded in the variable data 75 as shown in FIG.
[0092] In S257, the process execution unit 61 acquires the current value of the target variable. Then, the process execution unit 61 writes the acquired variable value and the forced setting flag into the ring buffer 62 in association with time information indicating the time when the value of the target variable was acquired.
[0093] The value of the target variable is held at a predetermined position on the program usage area 14a. This position is specified based on the information on the memory type, data type, memory address, and data size for the target variable included in the collection target setting information 53 of the logging setting data 42. Therefore, in S257, the value of the target variable is obtained by reading the data held at this position and written to the ring buffer 62.
[0094] In S258, the process execution unit 61 determines whether collection of values has been completed for all of the target variables registered in the collection target setting information 53 of the logging setting data 42. When the values of all the target variables have been collected (S258: Yes), the collection process ends. On the other hand, when there are target variables whose values have not been collected (S258: No), the process of the process execution unit 61 returns to S254. That is, the process execution unit 61 acquires the value of the next target variable. Then, when the values of all the target variables have been acquired and saved in the ring buffer 62, the save process S280 is executed.
[0095] In this way, when the process execution unit 61 of the PLC 1 acquires the value of a target variable used in a user program, it sets information (i.e., a forced setting flag) indicating whether or not a forced setting has been implemented for that variable value. Then, the acquired variable value is stored in the ring buffer 62 as variable data together with the forced setting flag. Therefore, by referring to the variable data stored in the ring buffer 62, it is possible to recognize whether or not a forced setting has been implemented for each target variable. In addition, the variable value and the forced setting flag are recorded in association with the time when the variable value was collected. Therefore, by referring to the variable data stored in the ring buffer 62, it is possible to identify the time or period when a forced setting was implemented for each target variable.
[0096] 17 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.
[0097] 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. 10. This control process S200 is executed by the process execution unit 61 shown in Fig. 10. In the hardware configuration example shown in Fig. 3, the control process S200 is executed by the CPU 12.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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 is 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. 10.
[0103] 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.
[0104] 18 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 19 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 20 shows an example of a method for reflecting information related to the forced setting in the logging setting data 42. This process is performed in the forced setting control process S310. It is assumed that the logging settings related to the above-mentioned logging process are preset in the PLC 1 by the user.
[0115] The forced setting control process S310 includes a target variable search process S311. The target variable search process S311 determines whether or not forced setting has been implemented for a logging target variable. The logging setting data update process S320 updates the contents of the logging setting data 42 for a target variable for which forced setting has been implemented. At this time, the logging setting data update process S320 may update the collection target setting information 53 shown in Figs. 8 to 9. As an example, the "memory address" is updated in the collection target setting information 53 shown in Fig. 9.
[0116] 21 is a flowchart showing an example of a process for updating the logging setting data 42 in relation to a forced setting. The process of this flowchart is executed for each variable to be logged. In the following description, the variable for which the procedure shown in FIG. 21 is executed may be referred to as a "variable to be processed." The process of this flowchart may also be executed for each control period shown in FIG. 2.
[0117] In S331, the forced setting control process S310 generates forced setting data. When the target variable is an input value to a user program, the forced setting input data is generated, and when the target variable is an output value from a user program, the forced setting input data is generated. In the example shown in Fig. 18, "00001111" is generated as the first variable. The generated forced setting data is recorded in a predetermined memory address.
[0118] In S332, the target variable search process S311 judges whether the forced setting for the target variable has changed from invalid to valid. Alternatively, the target variable search process S311 judges whether the forced setting for the target variable is valid or invalid. Then, when the forced setting for the target variable is valid, in S333, the logging setting data update process S320 temporarily saves the memory address of the processing target variable recorded as the collection target setting information 53 in the logging setting data 42 shown in Figs. 8 to 9. Next, in S334, the logging setting data update process S320 sets the memory address in the collection target setting information 53 to the memory address where the forced setting data generated in S331 is recorded. Thereafter, the logging process S250 collects the variable value from this memory address. As a result, the forced setting data (forced setting input data or forced setting output data) is collected.
[0119] Thereafter, in S335, the forced setting control process S310 sets the forced setting validity information to the ON state. In the example shown in Fig. 18 or 19, the forced setting validity information is set to "11111111". Note that by updating the forced setting validity information after updating the memory address, consistency between the reflection of the forced setting and the update of the logging setting data is maintained.
[0120] When the forced setting for the target variable changes from enabled to disabled (i.e., when the forced setting is released), in S336, the logging setting data update process S320 restores the memory address saved in S333 in the collection target setting information 53. Thereafter, the logging process S250 collects the variable value from this memory address. As a result, actual data (actual input data or actual output data) is collected.
[0121] Thereafter, in S337, the forced setting control process S310 sets the forced setting validity information to the OFF state. In the example shown in Fig. 18 or 19, the forced setting validity information is set to "00000000".
[0122] Fig. 22 shows an example of a process for updating and logging the logging setting data 42 related to a forced setting. Note that Fig. 22 shows a process for one of a plurality of target variables.
[0123] The process execution unit 61 of the PLC 1 includes a memory for storing data to be given to variables used by a user program. A memory area is also allocated to each target variable. In this embodiment, addresses 001 and 002 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. Forced setting input data for the target variable is stored in address 002.
[0124] When the forced setting is not performed, as shown in FIG. 22A, the actual input data is provided to the program execution process S220. That is, the PLC 1 controls the external device based on the actual input data. At this time, the memory address of the target variable is kept as "001" in the logging setting data 42. Then, the process execution unit 61 executes the logging process S250 according to this logging setting data 42. Therefore, in the logging process, the actual input data is collected from the memory address "001". Also, since the value of the actual input data is within the normal range, the forced setting flag is OFF. Therefore, the actual input data and the forced setting flag OFF are stored in the ring buffer 62 in association with the collection time.
[0125] When the forced setting is performed, as shown in FIG. 22B, the forced setting input data is provided to the program execution process S220. That is, the PLC 1 controls the external device based on the forced setting input data. At this time, the memory address of the target variable is changed from "001" to "002" in the logging setting data 42. The memory address "001" for saving the actual input data is saved in S333 of FIG. 21. Then, the process execution unit 61 executes the logging process S250 according to this logging setting data 42. Therefore, the forced setting input data is collected from the memory address "002". Also, since the value of the actual input data is outside the normal range, the forced setting flag is ON. Therefore, the forced setting input data and the forced setting flag ON are stored in the ring buffer 62 in association with the collection time.
[0126] After that, for example, when the value of the actual input data returns to the normal range, the forced setting is released, and the PLC 1 controls the external device based on the actual input data. At this time, the memory address of the target variable in the logging setting data 42 is restored from "002" to "001." Therefore, from then on, the actual input data is collected from the memory address "001."
[0127] In this way, when a forced setting is performed on a target variable in a user program, the logging setting data 42 is updated so that forced setting data is collected. Therefore, for a target variable for which a forced setting has been performed, forced setting data is collected in the logging process. The variable values collected in the logging process are then stored in the ring buffer 62 together with a forced setting flag. Therefore, it is possible to recognize whether the variable values collected by the logging process are actual values or predetermined values that have been forcibly set.
[0128] Although FIG. 22 shows 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 FIG.
[0129] If the value of the actual output data is within the normal range, the forced setting is not performed. In this case, as shown in FIG. 23A, the PLC 1 controls the external device according to the actual output data. In addition, in the logging setting data 42, the memory address of the target variable is kept as "003". Then, the process execution unit 61 executes the logging process S250 according to this logging setting data 42. Therefore, the actual output data is collected from the memory address "003". In addition, since the value of the actual output data is within the normal range, the forced setting flag is OFF. Therefore, the actual output data and the forced setting flag OFF are stored in the ring buffer 62 in association with the collection time.
[0130] If the value of the actual output data is outside the normal range, forced setting is performed. In this case, as shown in FIG. 23B, the PLC 1 controls the external device according to the forced setting output data. Also, in the logging setting data 42, the memory address of the target variable is changed from "003" to "004". Then, the process execution unit 61 executes the logging process S250 according to this logging setting data 42. Therefore, the forced setting output data is collected from the memory address "004". Also, since the value of the actual output data is outside the normal range, the forced setting flag is ON. Therefore, the forced setting output data and the forced setting flag ON are stored in the ring buffer 62 in association with the collection time.
[0131] <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.
[0132] 24 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.
[0133] 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.
[0134] 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.
[0135] 24 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 operating as the support device 30 in the PLC system 10 of FIG.
[0136] Fig. 25 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. 13 and 14, 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. 14, the sample data 73 includes a time stamp, a variable value, and a forced setting flag.
[0137] 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. 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.
[0138] 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 may find a trace of a forced setting based on, for example, the forced setting flag 76 set as the variable data 75 in the logging collection data 70. For example, a target variable for which the forced setting flag 76 is set to the ON state may be determined to have been forcedly set.
[0139] 26 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.
[0140] The program display process S410 displays a user program included in the above-mentioned project data 41, and also displays values of target variables for the user program, using 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.
[0141] 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 .
[0142] 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.
[0143] 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.
[0144] 27 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.
[0145] 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.
[0146] 28 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.
[0147] 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.
[0148] 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.
[0149] 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.
[0150] 28, 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 elements to be collected in the user program are displayed in black as the ON / OFF display 511, but in reality, for example, when the element is "ON", it is displayed in red, and when the element is "OFF", it is displayed in blue.
[0151] 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.
[0152] In this way, the collection time and the value of the target variable collected at that collection time are displayed on the display device 85 in association with each other by the program display process S410.
[0153] 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.
[0154] Fig. 29 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. 29 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.
[0155] Fig. 30 shows an example of the waveform display process S420. As shown in Fig. 30, the waveform display process S420 includes an operation UI process S421, a variable value display control process S422, and a waveform creation process S423.
[0156] 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.
[0157] 31 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.
[0158] Waveforms 541 displayed on waveform display screen 540 are created by waveform display processing S420. In the example screen shown in Fig. 31, 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, time display area 542 is set for waveform 541 and shows the time when the variable values were collected.
[0159] 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. 28. In addition, the time corresponding to the collection timing identified by the thick line 543 (11:20 p.m. in Fig. 31) 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.
[0160] 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".
[0161] 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.
[0162] 32 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.
[0163] 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.
[0164] The forced setting determination process S433 finds a trace of a forced setting for a target variable in the logging collected data 70. Specifically, the forced setting determination process S433 determines whether or not a forced setting has been implemented for the variable data 75 by referring to the forced setting flag 76 shown in FIG.
[0165] If it is determined in the forced setting determination process S433 that a forced setting has been implemented on the variable data 75, the display data creation process S434 creates highlighted display data indicating that the value of the target variable is the value that has been forcibly set.
[0166] 33 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.
[0167] 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. 13. The sample data 73 corresponding to each target variable includes variable data 75, as shown in Fig. 14A. The variable data 75 corresponding to each target variable includes a forced setting flag 76, as shown in Fig. 14B. The forced setting flag 76 indicates whether or not forced setting has been implemented for the target variable.
[0168] 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 acquires variable data of the target variable.
[0169] In S4304 to S4305, the display control unit 93 checks whether there is any trace indicating that a forced setting has been implemented for the target variable. In this embodiment, the display control unit 93 extracts a forced setting flag from the variable data acquired in S4303. Then, the display control unit 93 determines whether a forced setting has been implemented for the target variable based on the extracted forced setting flag. Specifically, if the forced setting flag is ON, it is determined that a forced setting has been implemented for the target variable.
[0170] When a forced setting has been implemented for the target variable, the display control unit 93 creates highlighting data in S4306 for highlighting the target variable on the user program display screen 510 or the waveform display screen 540. An example of highlighting will be shown later. When a forced setting has not been implemented for the target variable, the process of S4306 is skipped.
[0171] In S4307 to S4308, 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 to S4306 is executed for the next target variable. Then, when the process of S4303 to S4306 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 highlighted display data for target variables for which a forcible setting has been implemented.
[0172] 34 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.
[0173] 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.
[0174] 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. 28 with the time indicated by the thick line 543 on the waveform display screen 540 shown in Fig. 31.
[0175] 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.
[0176] 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.
[0177] 35 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.
[0178] 35, the display of a monochrome program component is included in a 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.
[0179] 35 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.
[0180] As shown in FIG. 14, in the logging collected data 70, a time stamp 74 is added to the variable data 75. 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.
[0181] 36 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.
[0182] In the example screen shown in Fig. 36, 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. 36, waveform highlighting 546 indicates that a forced setting was implemented for variable 3 between 9:10 and 9:20.
[0183] 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. 25. 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. 25. 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.
[0184] 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.
[0185] 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]
[0186] 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 Forced setting flag 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 execution of the control program to control the external device, and a logging process for collecting variable values representing values of variables used in the control program in accordance with a logging setting; a first memory for storing the logging settings; a second memory for storing the variable values collected by the logging process; The processing execution unit is When a forced setting is performed in which forced setting input data is given to the variable instead of the input data to be given to the variable, a forced setting flag indicating that the forced setting has been performed on the variable and the variable is stored in the second memory in association with time information indicating a time when the variable value was collected in the logging process.
1. A programmable logic controller comprising:
2. The input data is stored in a first area designated by a first address; the forced setting input data is stored in a second area designated by a second address; When the forced setting is performed on the variable, the process execution unit collects the forced setting input data from the second address as the variable value.
2. The programmable logic controller of claim 1.
3. When the forced setting for the variable is not implemented, or after the forced setting for the variable is released, the process execution unit collects the input data from the first address as the variable value.
3. The programmable logic controller of claim 2.
4. When a second forced setting is performed to transfer forced setting output data to the external device as a second variable value represented by a second variable used in the control program, the process execution unit stores in the second memory a forced setting flag representing that the second forced setting has been performed on the second variable and the second variable in association with time information representing a time at which the second variable value was collected.
2. The programmable logic controller of claim 1.
5. A programmable logic controller system comprising a programmable logic controller and a support device supporting the programmable logic controller, 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 execution of the control program to control an external device, and a logging process for collecting variable values representing values of variables used in the control program in accordance with a logging setting; the process execution unit, when a forced setting is performed in which forced setting input data is given to the variable instead of the input data to be given to the variable, stores in a memory the variable value and a forced setting flag indicating that the forced setting has been performed on the variable in association with time information indicating a time when the variable value was collected in the logging process; The support device includes: an output unit that generates and outputs the logging setting; a forcing setting unit that provides information to the programmable logic controller indicating whether or not the forcing setting of the variable is to be performed.
1. A programmable logic controller system 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 execution of the control program to control an external device, and a logging process for collecting variable values representing values of variables used in the control program in accordance with a logging setting; the process execution unit, when a forced setting is performed in which forced setting input data is given to the variable instead of the input data to be given to the variable, stores in a storage device, as logging collection data in the logging process, the variable value and a forced setting flag indicating that the forced setting has been performed on the variable, in association with time information indicating a time when the variable value was collected; The display device includes: A reading unit that reads the logging collection data from the storage device; a display unit that displays the variable value in association with the time information based on the logging collection data; a display control unit that, when a trace indicating that the forced setting has been performed is detected in the logging collection data, displays a display indicating that the forced setting has been performed for the variable in association with a time indicated by the time information corresponding to the forced setting flag. A display device comprising:
Citation Information
Patent Citations
Controller system, controller therefor, and support device
JP2017227988A
Program creation support device for programmable logic controller
JP2020134986A
Programmable logic controller, support device, and display device, as well as logging method, support method, and display method
JP7188631B1
Cited By
Programmable Logic Controller and Display
JP7790619B1
