Programmable logic controller, support device, and display device
The programmable logic controller with enhanced logging capabilities distinguishes between instrument and forcibly set values, ensuring accurate system status recognition and operation by using memory areas and a support device to log and timestamp data.
Patent Information
- Application Number
- JP2024121821
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Conventional techniques fail to distinguish between instrument-generated values and forcibly set values in a programmable logic controller (PLC) during system operation, leading to uncertainty in system status recognition.
A programmable logic controller equipped with a process execution unit, memory areas for actual and forced setting data, and a storage unit to log and associate data with time stamps, along with a support device to generate and output logging settings that indicate the origin of collected values.
Enables identification of instrument-generated or forcibly set values, ensuring accurate system status recognition and operation.
Smart Images

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