Programmable Logic Controller Systems and Engineering Tools
The programmable logic controller system addresses the challenge of correlating log data with user program elements by integrating an engineering tool that displays log and project data in association, enhancing debugging efficiency and reducing manual correlation burdens.
Patent Information
- Application Number
- JP2023218370
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2025-05-21
- Estimated Expiration
- 2038-10-23
AI Technical Summary
In programmable logic controllers (PLCs), users face difficulties in identifying the specific parts of a user program that need modification when issues arise during program execution, as the software for viewing user programs and log data are independent, requiring manual correlation of log data with user program elements.
A programmable logic controller system that includes an engineering tool capable of displaying log data and project data in association with each other, allowing users to designate motion functions, set logging targets, and synchronize the display of motion data and device values in chronological order with time data.
Enables users to efficiently identify and modify specific parts of the user program by visually correlating log data with project data, reducing the burden of manual correlation and improving debugging efficiency.
Smart Images

Figure 0007681091000001 
Figure 0007681091000002 
Figure 0007681091000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an engineering tool for programmable logic controllers. [Background technology]
[0002] A programmable logic controller (PLC) is a controller that controls manufacturing equipment, conveying equipment, and inspection equipment in factory automation. PLC controls various extension units and controlled devices by executing user programs such as ladder programs created by users. When actually executing a user program on a PLC, an event that was not anticipated when the user program was created may be found, making it necessary to modify the user program. In order to identify the part that needs to be modified, the user not only reviews the user program but also refers to the log data generated by the PLC. The log data stores the device values (device values) collected when the user program is executed. In the field of PLC, a device means a storage area that stores information. Examples of devices include relay devices that store one bit of information and word devices that store one word of information. According to Patent Document 1, logging of device values is proposed. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Publication No. 10-011118 Summary of the Invention [Problem to be solved by the invention]
[0004] However, the software for viewing user programs and the software for viewing log data are independent, so the user must look at one of the log data to find the device value when a problem occurred, and then manually find which part of the user program the device value is related to.
[0005] Therefore, an object of the present invention is to display log data and project data in association with each other. [Means for solving the problem]
[0006] The present invention relates to, for example, a programmable logic controller including a ladder execution engine that repeatedly executes a ladder program, a device memory having a device that is a storage area referenced by the ladder execution engine based on a description of the ladder program, a function execution engine that executes a motion function for driving and controlling an externally connected motor based on a command from the ladder program, and a buffer memory that stores a plurality of different motion data that are updated by the execution of the motion function; an engineering tool for the programmable logic controller; 1. A programmable logic controller system comprising: The engineering tool comprises: A display unit; A designation unit that designates a motion function among a plurality of different functions based on a user input via the display unit; a setting unit that creates log setting data including a logging target list in which a plurality of buffer memories corresponding to a plurality of different monitor items for monitoring a motion function specified by the specifying unit, the monitor items including any one of coordinates, speed, and torque of the motor, and a plurality of devices extracted from the ladder program are specified; and having The programmable logic controller includes: a recording unit that records the motion data stored in the plurality of buffer memories specified by the logging target list and the device values stored in the plurality of devices specified by the logging target list in chronological order in association with time data relating to collection time; a storage unit that, when a predetermined storage condition is satisfied, reads out the time-series motion data and device values for a predetermined target period recorded by the recording unit, as well as the associated time data, and stores them as log data; having The engineering tool further comprises: The display target time is determined based on the time data stored as the log data. a unit display module that acquires motion data corresponding to the plurality of different monitor items from the log data, and displays the motion data in a list on the display unit in association with each of the plurality of different monitor items together with a unit; a display module for a device that acquires a device value corresponding to a display target time from the log data based on time data stored as the log data, and displays the device value on the display unit; a playback control module that synchronizes a display target time in the unit display module with a display target time in the device display module; The present invention provides a programmable logic controller system comprising: Effect of the Invention
[0007] According to the present invention, it is possible to display log data and project data in association with each other. [Brief description of the drawings]
[0008] [Figure 1] Diagram showing a programmable logic controller system [Diagram 2] Diagram explaining ladder programs [Diagram 3] FIG. 1 is a diagram illustrating a program creation support device. [Figure 4] Diagram explaining PLC [Diagram 5] Diagram explaining ladder program scanning [Figure 6] FIG. 2 is a diagram illustrating the functions of the program creation support device. [Figure 7] Flowchart explaining how to set up logging [Figure 8]A diagram explaining how to select program parts [Figure 9] Diagram explaining how to select features [Figure 10A] Diagram explaining unit monitor [Figure 10B] Diagram explaining unit monitor settings [Figure 10C] Diagram explaining the extraction list [Figure 11] Diagram explaining the extraction list [Figure 12] Diagram explaining merging of extraction lists [Figure 13] A diagram explaining the estimated results of the impact on scan time [Figure 14] A diagram explaining the device type selection UI. [Figure 15] Flowchart showing how to extract devices [Figure 16] A diagram showing an example of a user program. [Figure 17] Diagram explaining the functions of the basic unit [Figure 18] A diagram explaining the process of creating configuration information [Figure 19] Diagram explaining the functions of the CPU of the basic unit [Figure 20] A diagram explaining the CPU functions of the expansion unit [Figure 21] FIG. 1 is a diagram showing an example of log data. [Figure 22] Flowchart showing logging processing in the basic unit [Diagram 23] Flowchart showing logging processing in the expansion unit [Figure 24] Diagram showing PLC connection configuration [Diagram 25] Diagram showing PLC connection configuration [Figure 26] Diagram explaining the timing of logging [Figure 27] Diagram explaining the display of log data [Figure 28] Diagram explaining the UI for displaying log data [Figure 29] A diagram explaining how to set collection times [Diagram 30] A diagram explaining how to set collection times [Diagram 31] Flowchart showing an overview of the debugging process [Diagram 32] Diagram explaining the output section [Diagram 33] Diagram explaining the project creation section [Diagram 34] Diagram explaining the log display section [Figure 35A] A diagram explaining the program display module [Figure 35B] Diagram explaining the user interface [Figure 35C] Diagram explaining the project data and log data display module [Figure 35D] Diagram explaining the warning screen [Figure 36A] Diagram explaining the waveform display module [Figure 36B] Diagram explaining the user interface [Figure 36C] Diagram explaining the real-time chart monitor [Figure 37] A diagram explaining the playback control module [Figure 38] A diagram explaining the UI that displays user programs and device values. [Figure 39] Diagram explaining HMI emulator [Diagram 40] Flowchart showing a process for displaying a user program and a device value [Diagram 41] Flowchart showing the process of displaying the waveform of a device value [Diagram 42] Flowchart showing playback control [Diagram 43] A diagram explaining multiple interrelated program parts [Diagram 44] A diagram explaining the UI that displays the results of program part and device extraction. [Diagram 45] Flowchart showing the process of extracting program parts and devices [Figure 46] Flowchart explaining the debugging process [Figure 47] Diagram explaining modified program parts DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] An embodiment of the present invention will be described below. The individual embodiments described below will be useful for understanding various concepts, such as higher-level concepts, middle-level concepts, and lower-level concepts, of the present invention. The technical scope of the present invention is determined by the claims, and is not limited by the individual embodiments described below.
[0010] <System configuration> First, in order to allow those skilled in the art to better understand programmable logic controllers (PLCs, which may also be simply called programmable controllers), the configuration and operation of a typical PLC will be described.
[0011] FIG. 1 is a conceptual diagram showing an example of a configuration of a programmable logic controller system according to an embodiment of the present invention. As shown in FIG. 1, this system includes a PC 2 for editing a user program such as a ladder program, and a PLC (Programmable Logic Controller) 1 for comprehensively controlling various control devices installed in a factory or the like. PC is an abbreviation for personal computer. The user program may be created using a graphical programming language such as a motion program in a flow chart format such as a ladder language or an SFC (Sequential Function Chart), or may be created using a high-level programming language such as the C language. In the following, for convenience of explanation, the user program is assumed to be a ladder program. The PLC 1 includes a basic unit 3 with a built-in CPU, and one or more expansion units 4. One or more expansion units 4 are detachable from the basic unit 3. For example, the expansion unit 4a may be a positioning unit that drives a motor (field device 10a) to position a workpiece, and the expansion unit 4b may be a counter unit. The counter unit counts signals from an encoder (field device 10b) such as a manual pulsar. The letters a, b, c... added to the end of the reference numbers may be omitted. The basic unit 3 may be called a CPU unit. A system including PLC 1 and PC 2 may be called a programmable logic controller system.
[0012] The basic unit 3 is equipped with a display unit 5 and an operation unit 6. The display unit 5 can display the operating status of each expansion unit 4 attached to the basic unit 3. The display unit 5 switches the display content according to the operation content of the operation unit 6. The display unit 5 usually displays the current value (device value) of the device in the PLC 1 and error information generated in the PLC 1. The device is a name indicating an area in memory provided to store device values (device data), and may also be called a device memory. The device value is information indicating the input state from the input device, the output state to the output device, and the state of the internal relay (auxiliary relay), timer, counter, data memory, etc. set in the user program. There are two types of device values: bit type and word type. A bit device stores a device value of 1 bit. A word device stores a device value of 1 word.
[0013] The expansion units 4 are provided to expand the functions of the PLC 1. A field device (controlled device) 10 corresponding to the function of the expansion unit 4 is connected to each expansion unit 4, and each field device 10 is connected to the basic unit 3 via the expansion unit 4. The field device 10 may be an input device such as a sensor or a camera, or an output device such as an actuator. In addition, a plurality of field devices may be connected to one expansion unit 4.
[0014] The PC2 may be called a program creation support device. The PC2 is, for example, a portable notebook or tablet type personal computer, and includes a display unit 7 and an operation unit 8. A ladder program, which is an example of a user program for controlling the PLC1, is created using the PC2. The created ladder program is converted into a mnemonic code in the PC2. The PC2 is connected to the basic unit 3 of the PLC1 via a communication cable 9 such as a USB (Universal Serial Bus), and sends the ladder program converted into the mnemonic code to the basic unit 3. The basic unit 3 converts the ladder program into a machine code and stores it in a memory provided in the basic unit 3. Note that, although the mnemonic code is transmitted to the basic unit 3 here, the present invention is not limited to this. For example, the PC2 may convert the mnemonic code into an intermediate code and transmit the intermediate code to the basic unit 3.
[0015] 1, the operation unit 8 of the PC 2 may include a pointing device such as a mouse connected to the PC 2. The PC 2 may be configured to be detachably connected to the base unit 3 of the PLC 1 via a communication cable 9 other than USB. The PC 2 may also be configured to be wirelessly connected to the base unit 3 of the PLC 1 without the communication cable 9.
[0016] <Ladder Program> FIG. 2 is a diagram showing an example of a ladder diagram Ld displayed on the display unit 7 of the PC2 when a ladder program is created. The PC2 displays a number of cells arranged in a matrix on the display unit 7. A virtual device symbol is placed in each cell. The symbols indicate input relays, output relays, etc. A relay circuit is formed by the multiple symbols. The ladder diagram Ld has, for example, 10 columns by N rows (N is any natural number) of cells arranged. Then, virtual device symbols are appropriately placed within the cells of each row.
[0017] The relay circuit shown in Figure 2 is constructed by appropriately combining symbols of three virtual devices (hereinafter referred to as "input devices") that are turned on / off based on input signals from an input device, and symbols of virtual devices (hereinafter referred to as "output devices") that are turned on / off to control the operation of an output device.
[0018] The characters displayed above each input device symbol ("R0001," "R0002," and "R0003") indicate the device name (address name) of that input device. The characters displayed below each input device symbol ("Flag 1," "Flag 2," and "Flag 3") indicate the device comment associated with that input device. The characters displayed above the output device symbol ("Return to origin") are a label consisting of a string of characters that indicate the function of that output device.
[0019] In the example shown in Fig. 2, two input device symbols corresponding to device names "R0001" and "R0002" are connected in series to form an AND circuit. An input device symbol corresponding to device name "R0003" is connected in parallel to the AND circuit consisting of these two input device symbols to form an OR circuit. That is, in this relay circuit, the output device corresponding to the symbol in the first row is turned on only when both input devices corresponding to the two symbols in the first row are turned on, or when the input device corresponding to the symbol in the second row is turned on.
[0020] <Program creation support device> Fig. 3 is a block diagram for explaining the electrical configuration of the PC 2. As shown in Fig. 3, the PC 2 includes a CPU 21, a display unit 7, an operation unit 8, a storage device 22, and a communication unit 23. The display unit 7, the operation unit 8, the storage device 22, and the communication unit 23 are each electrically connected to the CPU 21. The storage device 22 includes a RAM and a ROM, and may further include a removable memory card. CPU is an abbreviation for central processing unit. ROM is an abbreviation for read-only memory. RAM is an abbreviation for random access memory.
[0021] A user edits project data through the operation unit 8 by making the CPU 21 execute a computer program (editing software) stored in the storage device 22. The project data includes one or more user programs (e.g., ladder program) and configuration information of the base unit 3 and the extension unit 4. The configuration information is information indicating the connection positions of the extension units 4 relative to the base unit 3, functions provided in the base unit 3 (e.g., communication function and positioning function), and functions of the extension units 4 (e.g., photography function). Here, editing of project data includes creation and modification of project data. Project data created using the editing software is stored in the storage device 22. In addition, a user can read out project data stored in the storage device 22 as necessary and modify the project data using the editing software. The communication unit 23 is for communicatively connecting the PC 2 to the base unit 3 via the communication cable 9. The CPU 21 transfers the project data to the base unit 3 via the communication unit 23.
[0022] <plc> FIG. 4 is a block diagram for explaining the electrical configuration of the PLC 1. As shown in FIG. 4, the basic unit 3 includes a CPU 31, a display unit 5, an operation unit 6, a storage device 32, and a communication unit 33. The display unit 5, the operation unit 6, the storage device 32, and the communication unit 33 are each electrically connected to the CPU 31. The storage device 32 may include a RAM, a ROM, a memory card, and the like. The storage device 32 has a plurality of storage areas such as a device unit 34, a project storage unit 35, and a removable memory card 36. The device unit 34 has a bit device, a word device, and the like, and each device stores a device value. The project storage unit 35 stores project data input from the PC 2. The storage device 32 also stores a control program for the basic unit 3. As shown in FIG. 4, the basic unit 3 and the expansion unit 4 are connected via a unit internal bus 90, which is a type of expansion bus. The communication function related to the unit internal bus 90 may be implemented as a part of the communication unit 33. The communication unit 33 may have a network communication circuit. The CPU 31 may transmit log data, etc. to the PC 2, the cloud, etc. via the communication unit 33.
[0023] Here, a supplementary explanation will be given regarding the unit internal bus 90. This unit internal bus 90 is a bus on which input / output refresh and the like described below are performed, and communication control on the unit internal bus 90 is realized by a so-called bus master 38 (note that the bus master may be provided as a part of the communication section 33, or the bus master 38 may be provided as a part of the CPU 31). The bus master 38 is a control circuit for controlling communication on the unit internal bus 90, and upon receiving a communication request from the CPU 31, performs communication with the expansion unit 4, such as input / output refresh, which will be described later.
[0024] The expansion unit 4 includes a CPU 41 and a memory 42. The CPU 41 controls the field device 10 according to instructions (device values) from the basic unit 3 stored in the device. The CPU 41 also stores the control results of the field device 10 in a device called a buffer memory. The control results stored in the device are transferred to the basic unit 3 by input / output refresh. The control results stored in the device are also transferred to the basic unit 3 in accordance with a read command from the basic unit 3, even at a timing different from the input / output refresh. The memory 42 includes a RAM, a ROM, and the like. In particular, a storage area used as a buffer memory is secured in the RAM. The memory 42 may have a buffer that temporarily holds data (e.g., still image data or video data) acquired by the field device 10.
[0025] FIG. 5 is a schematic diagram showing the scan time of the basic unit 3. As shown in FIG. 5, one scan time T is composed of inter-unit communication 201, program execution 202, and END processing 204 for refreshing input and output. In inter-unit communication 201, the basic unit 3 transmits output data obtained by executing a ladder program from the storage device 32 in the basic unit 3 to an external device such as the expansion unit 4. Furthermore, the basic unit 3 takes in input data received from an external device such as the expansion unit 4 into the storage device 32 in the basic unit 3. That is, the device value stored in the device of the basic unit 3 is reflected in the device of the expansion unit 4 by output refresh. Similarly, the device value stored in the device of the expansion unit 4 is reflected in the device of the basic unit 3 by input refresh. In this way, the device of the basic unit 3 and the device of the expansion unit 4 are synchronized by input / output refresh. Note that a mechanism for updating device values between units at a timing other than refresh (inter-unit synchronization) may be adopted. However, the device of the basic unit 3 is rewritten by the basic unit 3 at any time, and similarly, the device of the expansion unit 4 is rewritten by the expansion unit 4 at any time. That is, the devices of the basic unit 3 can be accessed at any time by the device inside the basic unit 3. Similarly, the devices of the expansion unit 4 can be accessed at any time by the device inside the expansion unit 4. Basically, the basic unit 3 and the expansion unit 4 update their device values mutually at the timing of refresh and synchronize with each other. In the program execution 202, the basic unit 3 executes (calculates) a program using the updated input data. As shown in FIG. 5, in the program execution 202, multiple program modules or ladder programs may be executed in order according to the project data. The basic unit 3 processes data by executing the program. Note that the END processing refers to the general processing related to peripheral services such as data communication with external devices such as the PC 2 and a display (not shown) connected to the basic unit 3, and system error checks.
[0026] In this way, PC2 creates a ladder program in response to user operations and transfers the created ladder program to PLC1. PLC1 executes input / output refresh, ladder program execution, and END processing as one cycle (one scan) periodically, i.e., cyclically. This allows it to control various output devices (motors, etc.) based on timing signals from various input devices (sensors, etc.). In addition to the scan cycle, the basic unit 3 and expansion unit 4 each have an internal control cycle. The basic unit 3 and expansion unit 4 control functions of the field device 10 and the like based on the internal control cycle.
[0027] <Logging> When a user improves or modifies a user program, the device values acquired while PLC1 is executing the user program can be useful. Therefore, PLC1 acquires pre-specified device values and creates log data. Here, the devices managed by PLC1 include not only those used by user programs but also those not used by user programs. Also, some devices are useful when improving or modifying a user program, but some devices are not useful. Since there are generally several thousand devices, it is a big burden for the user to specify the required device. Therefore, PC2 analyzes the user program and extracts the devices used or described in the user program as logging targets. This reduces the burden on the user.
[0028] If all devices managed by PLC1 are subject to logging, the scan time will be long. This is because logging is executed as part of the user program and during I / O refresh. Sometimes, the delay caused by logging may prevent the user program from running as desired. Therefore, the number of devices subject to logging should be kept appropriate.
[0029] A user program may consist of multiple program parts (e.g., program modules (main ladder program and sub ladder program), function blocks). In some cases, it may be sufficient for the user to log the devices related to the program part that the user wishes to modify. In addition, the user may wish to exclude a specific program part from the targets for extraction, or add a specific program part to the targets for extraction. Therefore, it would be convenient for the user if they could add or delete devices from the targets for logging on a program part basis.
[0030] As described above, the base unit 3 and the expansion unit 4 have one or more functions. Various devices are assigned to each function. Therefore, it would be convenient for the user if it were possible to add or remove devices from the logging targets for each of these functions. For example, if an undesirable event occurs related to the communication function of the base unit 3, the user can easily resolve this event by referring to the device values of the devices related to the communication function of the base unit 3.
[0031] ● Logging settings (automatic extraction and addition / removal) 6 shows functions realized by the CPU 21 of the PC 2 executing the editing software stored in the storage device 22. Some or all of these functions may be realized by hardware circuits such as ASIC and FPGA. ASIC is an abbreviation for Application Specific Integrated Circuit. FPGA is an abbreviation for Field Programmable Gate Array.
[0032] In this embodiment, the functions shown in FIG. 6 are realized on the PC 2, but the present invention is not limited to this, and the functions may be realized on the PLC 1.
[0033] The project creation unit 50 displays a UI for creating the project data 71 on the display unit 7, creates the project data 71 according to a user instruction input from the operation unit 8, and stores the project data 71 in the storage device 22. UI is an abbreviation of user interface. The project data 71 includes a user program and configuration information of the PLC 1. The program creation unit 63 creates a plurality of program parts (each module) that constitute the user program based on a user operation via the UI. The function setting unit 62 executes settings related to the functions of the basic unit 3 and the functions of the expansion unit 4. For example, the function setting unit 62 assigns a device to a function provided in the basic unit 3, or assigns a device to a function provided in the expansion unit 4, and writes assignment information indicating the relationship between the function and the device in the configuration information. The project creation unit 50 also stores, as the project data 71, program configuration information indicating what program parts the user program is composed of. The unit configuration information indicating what units the entire PLC 1 is composed of is also stored as the project data 71.
[0034] The log setting unit 51 extracts devices described in the project data 71 by analyzing the project data 71, and creates log setting data 72 for setting the extracted devices as targets for logging. The log setting unit 51 has various functions. The part designation unit 52 designates program parts to be targets for device extraction in accordance with user instructions input from the operation unit 8. The part designation unit 52 also designates program parts to be excluded from targets for device extraction in accordance with user instructions input from the operation unit 8.
[0035] The device extraction unit 53 analyzes the project data 71 to extract devices described in the project data 71 and creates log setting data 72. The addition unit 54 analyzes the program parts designated by the part designation unit 52 as the extraction target, extracts devices described in the program parts, and adds them to the extraction list. The deletion unit 55 analyzes the program parts designated by the part designation unit 52 as the exclusion target, extracts devices described in the program parts, and deletes the extracted devices from the extraction list. Alternatively, the deletion unit 55 adds the extracted devices to the exclusion list. The merging unit 56 deletes from the extraction list devices that are extracted in duplicate from among devices extracted from a plurality of program parts. The identification unit 57 detects an instruction word for a memory card in the project data 71, identifies the device that is the target of the instruction word, and adds the identified device to the extraction list.
[0036] In this embodiment, after the part designation unit 52 designates a program part, the adding unit 54 analyzes the designated program part to extract and add a device to be logged, but the present invention is not limited to this. For example, the adding unit 54 may first analyze one or more program parts included in the project data 71 to extract a device, add the extracted device to an extraction list, and then extract a device described in the program part designated by the part designation unit 52 and add it to the extraction list.
[0037] Similarly, the deletion unit 55 may first create an extraction list by analyzing one or more program parts included in the project data 71, and then extract the device described in the program part specified by the part specification unit 52 and delete it from the extraction list.
[0038] In this embodiment, for convenience of explanation, the adding unit 54 and the deleting unit 55 are separated, but it goes without saying that they may be one functional block.
[0039] The manual setting unit 58 adds one device or a series of related devices to the extraction list according to a user instruction input through the operation unit 8. The estimation unit 59 estimates the effect of the recording of device values by the PLC 1 on the execution of a user program based on the number of devices extracted as recording targets by the device extraction unit 53. A delay time correlated with the number of device values due to logging is added to the scan time. Therefore, the estimation unit 59 may obtain the delay time by multiplying the number of device values by a predetermined coefficient, and display the delay time as an estimation result on the display unit 7. This delay time may be called an extension of the scan time.
[0040] The function designation unit 60 designates the functions of the basic unit 3 and the expansion unit 4 to be extracted as devices according to user instructions input from the operation unit 8. The function designation unit 60 also designates the functions of the basic unit 3 and the expansion unit 4 to be excluded from device extraction according to user instructions input from the operation unit 8. The addition unit 54 analyzes the configuration information of the function designated as an extraction target by the function designation unit 60, extracts devices assigned to the function by the configuration information, and adds them to the extraction list. The deletion unit 55 analyzes the configuration information of the function designated as an exclusion target by the function designation unit 60, extracts devices assigned to the function by the configuration information, and deletes the extracted devices from the extraction list. The merging unit 56 deletes from the extraction list devices that are extracted in duplicate from among the devices extracted for each of the multiple functions. The identification unit 57 detects an instruction word for a memory card in the project data 71, identifies the device that is the target of the instruction word, and adds the identified device to the extraction list.
[0041] The log display unit 61 reads out the log data 73 generated in the PLC 1 via the memory card 36, and displays the log data 73 on the display unit 7. For example, the log display unit 61 may associate device values recorded in the log data 73 with program parts of the project data 71 and display them on the display unit 7. The log display unit 61 forms the core of an engineering tool for a programmable logic controller.
[0042] 7 is a flow chart showing a method for setting logging. Here, it is assumed that project data 71 including a user program has already been completed.
[0043] In S1, the CPU 21 (part designation unit 52) accepts designation of a program part that is to be subject to device extraction.
[0044] 8 shows a UI 100 for accepting the selection of a program part from which a device is to be extracted. When a logging setting program is started, the log setting unit 51 displays the UI 100 on the display unit 7. In the UI 100, a plurality of program parts are displayed in a tree shape based on their classification (module / function block / macro). Also, a check box 102 is displayed in association with each program part. When the pointer 101 checks the check box 102 in response to the operation of the operation unit 8, the adding unit 54 adds the program part corresponding to the checked check box 102 to the extraction list. On the other hand, when the pointer 101 unchecks the check box 102 in response to the operation of the operation unit 8, the deleting unit 55 deletes (excludes) the program part corresponding to the unchecked check box 102 from the extraction list.
[0045] In FIG. 8, the every scan module is a program component that is executed once each time the user program is scanned. In this example, the every scan module has a main program and a submodule. The fixed cycle module is a program component that is executed at regular intervals. The inter-unit synchronization module is a program component that is executed each time inter-unit synchronization is performed. Although the initialization module is not shown, the initialization module is the first module that is executed when the user program is started. Therefore, since the initialization module is unlikely to cause trouble, it may be excluded from the device extraction targets.
[0046] Function blocks (FBs) are called and used by user programs. Because function blocks are called from multiple modules, they generate separate instances for each. In this case, each of the multiple instances may be selected as the device extraction target, or by selecting the original function block, all instances generated in relation to that function block may be selected as the device extraction target.
[0047] A macro is a type of program, and examples include macros for data formatting.
[0048] In S2, the CPU 21 (function designation unit 60) accepts designation of functions to be extracted from devices.
[0049] FIG. 9 shows a UI 110 for accepting the selection of a function from which a device is to be extracted. When a logging setting program is started, the log setting unit 51 displays the UI 110 on the display unit 7. The UI 100 and the UI 110 may be displayed simultaneously, or may be selectively displayed according to a user operation. In the UI 110, a plurality of functions are displayed in a tree shape based on the units to which they belong. Also, a check box 102 is displayed in association with each function. When the pointer 101 checks the check box 102 in response to an operation of the operation unit 8, the adding unit 54 adds the function corresponding to the checked check box 102 to the extraction list. On the other hand, when the pointer 101 unchecks the check box 102 in response to an operation of the operation unit 8, the deleting unit 55 deletes (excludes) the function corresponding to the unchecked check box 102 from the extraction list.
[0050] In Figure 9, the communication error monitor, which is a function of the basic unit 3, is a function that monitors communication errors in the communication section 33. The sensor I / O monitor is a function that monitors the input and output of the sensor. The motion unit is also called a positioning unit, and controls the position of a control object called an axis. Generally, a drive source such as a motor exists for each axis. The analog input unit is a unit that samples the input analog signal and converts it into a digital signal. The unit monitor is a function that monitors the operation of the expansion units 4, such as the motion unit and analog input unit.
[0051] Here, as an example of a unit monitor, the unit monitor of the motion unit will be described in more detail. Fig. 10A is a schematic diagram of a screen of a unit monitor 440 for axis 1 of the motion unit. Fig. 10B is a schematic diagram of a setting screen 441 for changing the target of monitoring by the unit monitor 440.
[0052] As shown in FIG. 10A, items such as current coordinates, command coordinates, current speed, command speed, feedback torque, load factor, and peak current are set as monitoring targets by the unit monitor 440. A buffer memory (UG) is assigned to each item. For example, UG4 and UG5 are assigned to the current coordinates. In this embodiment, 16 bits are reserved for one UG, and two UGs are reserved to express the current coordinates in 32 bits. The device value of the UG is, for example, a numerical value such as 0PLS (pulse). In addition, UG8 and UG9 are assigned to the command coordinates. The reason for reserving two UGs is the same as above (to ensure 32-bit expression). The unit designer can freely assign UGs, so there are also several unused UGs (UG6 and UG7). Similarly, UG10 and UG11 are assigned to the current speed, and UG12 and UG13 are assigned to the command speed. In addition, in FIG. 10A, UGs are assigned to each item such as feedback torque, load factor, and peak current.
[0053] As shown in FIG. 10B, the user can freely select (set) which items are to be monitored by the unit monitor 440. For example, by selecting one item from the "Hide" column 442 shown in FIG. 10B and clicking the right arrow button 443, the item moves to the "Display" column 444 and becomes a monitoring target by the unit monitor 440. By clicking the OK button 445, the items listed in the "Display" column 444 are confirmed as monitoring targets. Note that, although only axis 1 of the motion unit has been described in FIG. 10A and FIG. 10B, the same applies when there are multiple axes such as axis 2 and axis 3. For each axis, the items selected by the user become monitoring targets.
[0054] In general, when using a motion unit (extension unit 4a) to drive a motor (field device 10a) to position a workpiece, the basic unit 3 sends an operation start command to the extension unit 4a by turning on a relay device indicating a motor positioning start trigger. After sending the operation start command, the basic unit 3 is not involved in the specific processing operation (positioning of the workpiece) in the extension unit 4a. In other words, the basic unit 3 does not recognize the current position and current speed of the motor in real time, and does not need to recognize them one by one. After that, when the processing operation in the extension unit 4a is completed, the basic unit 3 recognizes the completion of motor positioning through the fact that the relay device indicating the motor positioning completion trigger is turned on. For this reason, the device (UG) corresponding to the current coordinates and current speed of the motor is basically not described in the ladder program (however, the user can write a special command word in the ladder program to read out a very small part of the UG).
[0055] However, if a problem occurs during PLC operation, it may be necessary to know the current coordinates and speed of the motor at the time the problem occurred in order to determine the cause.In such cases, as mentioned above, the current coordinates and speed of the motor are not generally written in the ladder program, so they are often not included in the extraction list for logging targets, making it difficult to determine the cause.
[0056] Therefore, in this embodiment, the user can select the unit monitor of the motion unit through the UI 110 shown in Fig. 9. This allows the adding unit 54 to automatically add the UG that is the target of monitoring by the unit monitor 440 of the motion unit to the extraction list, as described with reference to Fig. 10B. The same is true for the communication error monitor / sensor I / O monitor of the basic unit 3 and the unit monitor of the analog input unit. The devices or parameters that are the target of monitoring by each monitor can be automatically added to the extraction list.
[0057] The other monitors are not shown in the figures, but will be briefly described below. The communication error monitor, which is a function of the basic unit 3, monitors, for example, a device assigned to an opening timeout error of cyclic communication. The sensor I / O monitor, which monitors the input and output of a sensor, monitors, for example, a device assigned to the output of one or more sensors and the presence or absence of an error. The unit monitor of the analog input unit monitors, for example, a device (DM or R) assigned to various parameters such as AD conversion data, special data, offset value, zero shift, peak value, bottom value, etc. These devices are assigned in advance as defaults (initial settings) by the unit designer, but the monitoring target may be changed by the user, as in the case of the unit monitor of the motion unit described above. In short, the UI 110 shown in FIG. 9 is a setting screen that can accept the selection input of a function from the user. Then, for each function selected and input, a template (setting information) that defines the monitoring items to be displayed on the display unit (monitor) is associated (the template is stored in the memory). The device specified by the template may be assigned in advance as a default as described above, or may be added or removed (edited) by the user via the setting screen. When one or more functions are selected based on a user operation, the function designation unit 60 adds the devices to be monitored to the extraction list in accordance with the template associated with the selected function.
[0058] In S3, the device extraction unit 53 analyzes the program part specified by the part specification unit 52, and extracts the devices described in the specified program part.
[0059] FIG. 10C shows an example of a device extracted from a specified program part among a plurality of program parts included in the project data 71. FIG. 10C shows the name of the program part from which the device was extracted, the name (device number) of the first device, the number of devices extracted based on the first device, and the name of the device actually extracted as a logging target. In general, a number of devices equivalent to the specified number is extracted based on the first device. However, a number of devices exceeding the specified number may be extracted. R34000 is a relay device and holds 1 bit of information, but a series of 16 devices from R34000 to R34015 are extracted. This is because it is advantageous in terms of data processing speed to log 16 bits of devices together. In FIG. 10C, the number of R34000 is "1", which indicates 1 word (16 bits). Also, the quantity of CR4001 is "1", but this also indicates 1 word (16 bits: CR4001, CR4002,..., CR4015, CR4100). A global is a device that is used in common by multiple program components. Main indicates the main program. first_operation is the name of the function block. Sub indicates the subprogram (submodule).
[0060] In S4, device extraction unit 53 analyzes the configuration information of the function designated by function designation unit 60, and extracts devices associated with the function in the configuration information.
[0061] FIG. 11 shows an example of devices extracted from a specified function (unit) among a plurality of functions (basic unit 3 and expansion unit 4) provided in PLC1. In this example, several buffer memories (UG) are extracted from a motion unit specified by the function specification unit 60. According to FIG. 11, the name of the function from which the device was extracted, the name (device number) of the head device, the number of devices extracted based on the head device, and the device name actually extracted as a logging target are shown. Here, devices that can be monitored by the unit monitor of the motion unit are extracted. That is, as described above with reference to FIG. 10A, UG4-UG5 indicate the current coordinates of the motor, UG8-UG9 indicate the command coordinates of the motor, UG10-UG11 indicate the current speed of the motor, and UG12-UG13 indicate the command speed of the motor. Explanation of the other UGs is omitted.
[0062] In S5, the manual setting unit 58 adds to the extraction list the device manually specified by the user via the operation unit 8. For example, the manual setting unit 58 may display a UI on the display unit 7 that allows the user to directly input a device number or the like, to assist the user in specifying a device.
[0063] In S6, the merging unit 56 creates a logging target list by merging the devices extracted from the program parts, the devices extracted from the functions, and the devices added manually. The logging target list may be called a device list.
[0064] FIG. 12 is a diagram for explaining the concept of the merge process. The device extraction unit 53 creates an extraction list L1 that describes devices extracted from program parts. The device extraction unit 53 creates an extraction list L2 that describes devices extracted from functions. The device extraction unit 53 creates an extraction list L3 that describes devices manually added by a user. The merge unit 56 merges the extraction lists L1 to L3 to create a logging target list L0. The extraction lists L1 to L3 may contain duplicated extracted devices. If the same device is logged multiple times, the log data will become bloated. Therefore, the merge process is executed to avoid duplicate logging of the same device. For example, data memories DM0-DM100, which are a type of device, are registered in the extraction list L1. Also, data memories DM50-DM200 are registered in the extraction list L3. That is, DM50-DM100 are duplicated. The merge unit 56 merges DM0-DM100 and DM50-DM200 to describe DM0-DM200 in the logging target list L0.
[0065] In S7, the estimation unit 59 analyzes the logging target list L0, estimates the effect on the scan time, and displays the estimation result on the display unit 7.
[0066] FIG. 13 shows a UI 140 for displaying the estimation result. The UI 140 displays the device size and the increase in scan time. The device size indicates the total size of the devices described in the logging target list L0. The increase in scan time is the delay time caused by logging. The estimation unit 59 analyzes the logging target list L0 and calculates the device size and the increase in scan time. When the list button 141 is operated via the operation unit 8, the estimation unit 59 may display the logging target list L0 on the display unit 7. The user considers the estimation result and determines whether to confirm or adjust the logging target list L0. When confirming the logging target list L0, the user may operate a button indicating the intention to confirm with the pointer 101.
[0067] In S8, the log setting unit 51 determines whether to confirm the logging target. For example, when a button for confirming the logging target list L0 is operated, the log setting unit 51 determines that the logging target is to be confirmed. On the other hand, when a button for modifying the logging target list L0 is operated, the log setting unit 51 determines that the logging target is to be modified. When modifying the logging target, the log setting unit 51 repeats S3 to S8 to accept addition or deletion of program parts and functions to be extracted as devices, and modify the logging target list L0. For example, when the increase in scan time exceeds an allowable threshold, some devices are deleted. When the increase in scan time is less than an allowable threshold, some devices may be added. When the logging target is confirmed, the CPU 21 proceeds to S9.
[0068] In S9, the log setting unit 51 creates log setting data 72 including the logging target list L0, and stores it in the storage device 22. The CPU 21 controls the communication unit 23 to transmit the log setting data 72 together with the project data 71 to the basic unit 3.
[0069] Here, devices such as data memories and buffer memories are primarily subject to logging, but the operating status and function setting status of each function (e.g. IP address, etc.) may also be added as logging targets.
[0070] FIG. 14 shows a filter setting UI 120 used in the device extraction process. There are multiple types of devices related to the PLC 1. The user may want to focus on a specific type of device and ignore other types of devices. In this case, the log setting unit 51 may display the filter setting UI 120 on the display unit 7 and accept device types to be extracted and device types to be excluded through the check boxes 102. For example, the device extraction unit 53 extracts device types with check marks in the check boxes 102 from program parts and functions. The device extraction unit 53 does not extract device types with check marks in the check boxes 102 from program parts and functions. This makes it possible to easily select devices to be logged according to the user's intention.
[0071] Incidentally, when the project data 71 is changed by the project creation unit 50, the CPU 21 may execute the device extraction process again. This is because the description of the device in the user program may have been changed. The CPU 21 may execute the device extraction process when the project creation unit 50 executes the transfer of the project data 71. Since the project data 71 is ultimately written to the PLC 1, the execution of the device extraction process may be triggered by this writing, thereby reducing the number of times the device extraction process is executed.
[0072] The device extraction unit 53 is implemented in the PC 2, but may be implemented in the basic unit 3. The CPU 31 extracts devices from program parts and functions designated by the PC 2 in the project data 71, and creates log setting data 72. In this case, the estimation unit 59 will also be implemented in the basic unit 3. Device extraction process Fig. 15 is a flowchart showing the process of extracting devices from program parts executed by the device extraction unit 53. Fig. 16 shows an example of a ladder program. This ladder program is for controlling a motion unit that drives four axes as the extension unit 4.
[0073] In S11, the device extraction unit 53 obtains a device number from the description of the i-th step of the program part specified as the extraction target. The initial value of i is 001. As shown in FIG. 16, step numbers are assigned to the left end of the ladder program. In the step 001, it is described that when a relay device called MR000 is turned on, a relay device called R34000 that gives the motion unit permission to operate is turned on, and a relay device called R34305 for operating the servo of the first axis of the motion unit is turned on. Therefore, the device extraction unit 53 extracts MR000, R34000, and R34305 as device numbers. Note that the device number may be described by indirect reference or index reference. In this case, the device extraction unit 53 searches for a program that has been assigned an indirect reference destination or an index value, and identifies the actual device number. Note that, if the device extraction unit 53 fails to extract the actual device number, a message indicating the extraction failure may be displayed on the display unit 7. Furthermore, device extraction unit 53 may display a UI on display unit 7 for allowing the user to input an actual device number and accept the user input. Furthermore, taking into consideration the above-mentioned indirect reference and index reference, device extraction unit 53 not only extracts specific devices directly described in the program, but also extracts specific devices used in the program (such as devices specified by indirect reference or index reference).
[0074] In S12, the device extraction unit 53 acquires the device range from the access range of the instruction word. Some instructions have arguments of the device number of the first device and the number of devices based on the first device. For example, step 003 describes that when the relay device MR000 is turned on, the instruction word FMOV is executed. In this example, FMOV is an instruction word (an instruction word for initializing related devices) for assigning a specified value (0) to a specified number (10) of devices based on the first device (@EM0). In other words, the access range is defined by the first address and the specified number. The device extraction unit 53 determines the range from @EM0 to @EM9 as the device range. The access range may be described by indirect reference or index reference. In this case, the device extraction unit 53 searches for a program that assigns the indirect reference destination or index value, and identifies the actual access range. If the device extraction unit 53 fails to extract the actual access range, it may display a message indicating the extraction failure on the display unit 7. Furthermore, the device extraction unit 53 may display a UI on the display unit 7 for allowing the user to input the actual access range, and may receive the user input.
[0075] In S13, the device extraction unit 53 extracts devices based on the first device number and the device range, and adds the extracted devices to the extraction list. For example, MR000, R34000, and R34005 are extracted from step 001 and added to the extraction list. @EM0 to @EM9 are extracted from step 003 and added to the extraction list.
[0076] In S14, the device extraction unit 53 determines whether the device analysis for the specified program part has been completed up to the end of the program. If the device analysis has not been completed up to the end of the program, the device extraction unit 53 proceeds to S15. In S15, the device extraction unit 53 adds 1 to the variable i and returns to S11. If the device analysis has been completed up to the end of the program, the device extraction unit 53 ends the device extraction process.
[0077] In the ladder program shown in FIG. 16, the devices extracted from step 004 onwards will be briefly explained below.
[0078] Steps 004 and 005 are requests to return the motor to its origin (operation), and R34310 is a relay device that indicates the trigger to start returning the motor to its origin. The following devices are extracted from this step: MR001, R34310, R40905, R40910, and R34310.
[0079] Steps 006 to 008 are processes for reading out a return-to-origin completion code from the motion unit when the return-to-origin of the motor is completed, and judging whether the return-to-origin has been completed correctly. More specifically, R40910 is a relay device that indicates a return-to-origin completion trigger of the motor. The basic unit 3 does not recognize the specific processing operation of the return-to-origin in the motion unit in real time, and judges whether the return-to-origin has been completed by monitoring whether this flag R40910 is ON. When this flag R40910 is ON, a UREAD command that directly reads the buffer memory is executed. The UREAD command shown in FIG. 16 is a command that reads the buffer memory of No. 4060 in the unit with unit number 1, and assigns one word to the device @EM0. Here, the buffer memory of No. 4060 stores a return-to-origin completion code, and when the return-to-origin is completed normally, 0 is stored, and when the return-to-origin is completed abnormally, a value other than 0 (such as 1 or 2) is stored. Then, as shown in step 007, if the device value of @EM0 is other than 0, the basic unit 3 sets the device MR000 and recognizes that the origin return has ended abnormally. On the other hand, as shown in step 008, if the device value of @EM0 is 0, the basic unit 3 sets the device MR001 and recognizes that the origin return has ended normally. From this step, the following devices are extracted: R40910, @EM0, @MR000, and @MR001.
[0080] Step 009 is a process that waits for one second if the origin return is completed normally. Device T0 has a set value of 10 (equivalent to one second in 100 ms units) and a current count value, and turns ON when the count value reaches the set value. From this step, the devices MR001 and T0 are extracted.
[0081] Finally, in steps 010 to 011, when device T0 turns ON, the function block "First_operation" is executed for unit number 1. The execution result is then stored in @MR002, and the completion code is stored in @EM1. From this step, the devices @MR002 and @EM1 are extracted.
[0082] As explained above in detail using Figure 16, a typical ladder program only describes devices that correspond to the start of an operation or the completion of an operation, such as turning on the servo of an axis, requesting a return to origin, starting a function block, and the results. However, when a problem occurs, information on the state during the operation (current coordinates and current position of the motor, etc.) can be useful in identifying the cause, so as mentioned above, UGs that are being monitored by the unit monitor are automatically added to the extraction list.
[0083] This extraction process is performed for each of the specified program parts.
[0084] Executing logging 17 shows the functions of the CPU 31 of the basic unit 3. Some or all of these functions may be realized by hardware circuits such as ASIC and FPGA. ASIC is an abbreviation for Application Specific Integrated Circuit. FPGA is an abbreviation for Field Programmable Gate Array.
[0085] It is assumed that the CPU 31 stores the project data 71 and the log setting data 72 received from the PC 2 in the storage device 32. The execution unit 80 has a ladder execution engine 80a that repeatedly executes a user program, and a unit control unit 80b that controls the ladder execution engine 80a and executes input / output refresh with the expansion unit 4. The ladder execution engine 80a of the execution unit 80 repeatedly executes a user program included in the project data 71, and controls the expansion unit 4 according to the user program. The ladder execution engine 80a of the execution unit 80 writes device values to output-system devices held in the basic unit device unit 34a of the device unit 34 and reads device values from input-system devices held in the basic unit device unit 34a according to the user program.
[0086] On the other hand, the unit control unit 80b of the execution unit 80 reads and writes the device values related to the expansion units acquired by the input / output refresh to the expansion unit device unit 34b. The basic unit and the expansion units are electrically connected by a unit internal bus, and the unit control unit 80b has a function of controlling communication on this unit internal bus, that is, a function as a bus master. When the unit control unit 80b functions as a bus master, it performs refresh communication with each expansion unit based on the unit configuration information described with reference to FIG. 6, that is, information indicating what units the entire PLC 1 is composed of.
[0087] The recording unit 81 obtains device values from the device unit 34 (the base unit device unit 34a or the expansion unit device unit 34b) according to the log setting data 72, or obtains device values from the buffer memory of the expansion unit 4, and writes them to a memory (e.g., a ring buffer) as log data 73. As described above, the recording unit 81 executes logging processing during END processing, etc.
[0088] The logging process in the END process will be described in more detail. As described with reference to Fig. 10C and Fig. 11, the log setting data 72 includes, as logging targets, devices described in the program parts specified by the part specification unit 52 and devices assigned to functions (e.g., targets of monitoring by the unit monitor) specified by the function specification unit 60. For the former devices, the log data 73 is written during the END process, while for the latter devices, the device values of the target devices (UGs) are read from the extension unit 4 and written to the log data 73 during the END process.
[0089] Here, the update period (so-called control period) of the current coordinates and command coordinates of the motor is much shorter than the scan period of the ladder program. Therefore, in this embodiment, the device values of the UG are read out in synchronization with the scan period, so that not all current coordinates and command coordinates are written to the log data 73. However, the present invention is not limited to this, and it is also possible to configure, for example, to store the current coordinates and command coordinates for each control period in the memory of the extension unit 4, and to read out the multiple current coordinates and command coordinates stored up to that point at the timing of the scan period.
[0090] Furthermore, the recording unit 81 assigns time information held by the time management unit 83 to each record of the log data 73. As a result, the device values are arranged in chronological order in the log data 73.
[0091] The devices to be logged are basically specified by the logging target list L0 of the log setting data 72, but additional devices may be specified by the detection unit 82. The detection unit 82 may detect, for example, rewriting of a device value from an external device for any of the devices included in the device unit 34. Generally, device values are rewritten according to a user program or by an external device. Such rewriting cannot be grasped in advance by only analyzing the user program. The recording unit 81 may add a device whose device value has been detected as being rewritten by the detection unit 82 to the logging targets. Generally, rewriting of a device value from an external device is likely to cause an event that is unexpected for the user. Therefore, the recording unit 81 will be useful for the user to improve the program by logging the device value rewritten by the external device.
[0092] Incidentally, in the END process, a UG read command may be issued independently of a user program. UG is a device type indicating a buffer memory. The detection unit 82 may detect a UG read command issued independently of a user program. The recording unit 81 may identify the buffer memory that is the target of the UG read command detected by the detection unit 82, and add the identified buffer memory as a recording target. When the extension unit 4 is a motion unit, such a buffer memory stores torque values, current coordinate positions, and the like.
[0093] The detection unit 82 may be realized by an FPGA or the like. The execution unit 80 may be realized by an ASIC. In this case, the execution unit 80 uses an address line to specify the address of the device to be read / written to the storage device 32. Therefore, the detection unit 82 may dynamically detect a device whose device value has been updated by monitoring this address line. This will be useful when adding a device not described in the user program as a recording target.
[0094] The detection unit 82 may be provided in the execution unit 80. In this case, the execution unit 80 may write a device value to a specific device in the device unit 34, and may write this device value and the device name (device number) to the log data 73. This method will be useful when adding a device that is not described in the user program and that is dynamically allocated as a recording target.
[0095] In this way, the recording unit 81 may record devices regardless of the device list included in the log setting data 72. In an extreme case, the user may obtain the log data 73 without creating the log setting data 72. For example, when the execution unit 80 starts up, the execution unit 80 obtains device values from all devices in the device unit 34. The detection unit 82 monitors the devices, and therefore detects that the execution unit 80 has read the device values, and transmits information (address information) of the devices from which the device values have been read to the recording unit 81. The recording unit 81 reads the device values from all devices included in the device unit 34 based on the address information transmitted by the detection unit 82, and writes them to the log data 73. Thereafter, every time the detection unit 82 detects an access to the device unit 34, the recording unit 81 logs the device values.
[0096] Incidentally, the recording unit 81 may write the device value to the log data 73 for each scan cycle or each predetermined collection cycle. For example, even if the detection unit 82 detects multiple accesses to a device within one cycle, the recording unit 81 may write only the device value at the time when the last access was detected to the log data 73. This makes it possible to reduce the data size of the log data 73.
[0097] The execution unit 80 may have a cache that holds the device. In this case, the detection unit 82 may detect writing to the device by monitoring the cache.
[0098] The log setting data 72 includes a device list indicating devices to be recorded, but may also include a device list indicating devices to be excluded from recording. In this case, when the detection unit 82 detects an access to a device to be excluded, the recording unit 81 skips recording the device value for that device.
[0099] The detection unit 82 may detect an access by the execution unit 80 to the buffer memory of the expansion unit 4. In this case, the execution unit 80 writes the device value read from the buffer memory of the expansion unit 4 to a buffer or the like secured in the storage device 32. The recording unit 81 reads the device value from the buffer and writes it to the log data 73.
[0100] The execution unit 80 repeatedly executes the user program and rewrites the device value in accordance with the user program. If the detection unit 82 is implemented in the execution unit 80, when the execution unit 80 detects an instruction word that rewrites the device value, it outputs the device value together with the instruction word to the recording unit 81. The recording unit 81 may write the instruction word, the device value, and a timestamp (the time when the device value was acquired) into the log data 73.
[0101] Incidentally, the log setting data 72 may include the data format (e.g., binary format or text format) of the log data 73. As the data format, 16-bit decimal, 32-bit decimal, ±16-bit decimal, ±32-bit decimal, 16-bit hexadecimal, 32-bit hexadecimal, character string, Float, DoubleFloat, etc. may be set for each device. Such a data format can be determined by analyzing the command words in the program parts.
[0102] When a predetermined output condition is satisfied, such as when the execution of a user program is completed or when a trigger relay for saving to a memory card is turned on, the output unit 84 writes the project data 71, the log data 73, and the image data to the memory card 36. Until the predetermined output condition is satisfied, the log data 73 is recorded in a memory (for example, a ring buffer), and when the capacity is full, the oldest log data 73 is erased and new log data 73 is additionally recorded (recorded in a so-called FIFO format). This memory card 36 is removed from the basic unit 3 and attached to the mounting portion of the PC 2. As a result, the log data 73 is displayed on the display unit 7 of the PC 2. The output unit 84 may transmit the log data 73 to the PC 2, a cloud, or the like via the communication unit 33.
[0103] In this embodiment, the log data 73 and the like are written to the memory card 36 when a predetermined output condition is satisfied, but the present invention is not limited to this, and may be stored, for example, in the internal memory 37 (non-volatile memory such as a flash memory or a hard disk). At least the log data 73 needs to be stored in the memory card 36 or the internal memory 37 when a predetermined output condition is satisfied, whereas the project data 71 is not limited to being stored when a predetermined output condition is satisfied. For example, the project data 71 may be stored in advance in the memory card 36 or the internal memory 37 when the PLC 1 changes from the setting mode (PROGRAM mode) to the operation mode (RUN mode).
[0104] ● Creating configuration information FIG. 18 is a diagram for explaining the configuration information creation process (unit setting) executed by the function setting unit 62. The function setting unit 62 may be called a unit editor. When the start of the unit editor is requested, the function setting unit 62 displays a unit setting UI 150 on the display unit 7. The name field 151 is a field for displaying the name of each unit (e.g., model number, etc.). A unit number is automatically assigned to each unit. In this example, the basic unit 3 is assigned the unit number "0". The input area field 152 is a field for allocating input system devices. In this example, devices R000 to R015 are allocated to the basic unit 3 as input system devices. The output area field 153 is a field for allocating output system devices. In this example, devices R500 to R507 are allocated to the basic unit 3 as output system devices. The occupied area field 154 is a field for allocating input / output mixed system devices. The end unit is a so-called terminal unit. The user sets the type of the extension unit 4, the connection order, and the device to be allocated through the operation unit 8. The function setting unit 62 stores information indicating the type of expansion unit 4, the connection order (unit number), and the devices assigned to each of the basic unit 3 and the expansion unit 4 in the configuration information. The configuration information may be called unit setting information. Here, a device is assigned to each unit, but a device may also be assigned to each function of each unit. The function setting unit 62 manages the configuration information as part of the project data 71.
[0105] In this way, the configuration information includes information indicating the devices assigned to each unit and information indicating the devices assigned to each function, so the device extraction unit 53 can extract the devices assigned to each unit and each function by referring to the configuration information.
[0106] <Large volume data logging> A camera exists as a field device 10. A user may wish to improve a user program by acquiring the state of a workpiece or a controlled object using the camera and comparing the image and device value. Therefore, how to manage images and device values that are mutually related becomes an issue. This is because images are generally acquired by the expansion unit 4 and device values are generally acquired by the basic unit 3. Furthermore, the acquisition cycle of images and the acquisition cycle of device values are generally different. Under these circumstances, how to link and manage large-capacity data such as images with relatively small-capacity data such as device values becomes an issue.
[0107] FIG. 19 shows the function of the CPU 31 of the basic unit 3. The same reference numerals are given to the parts already described. In this example, the recording unit 81 has a collection unit 92a. When a predetermined collection start condition is satisfied, the collection unit 92a reads out the device value designated by the log setting data 72 from the device unit 34 among the device values held in the device unit 34, and acquires time information from the time management unit 83a. The collection unit 92a associates the device value with the time information and stores it in the ring buffer 91a. The collection unit 92a acquires the device value and the time information for each collection period (e.g., scan period) designated by the log setting data 72 and stores it in the ring buffer 91a. The reason why the ring buffer 91a is adopted is that not all data stored in the ring buffer 91a is saved as the log data 73 in the memory card 36. For example, when a predetermined saving condition is satisfied, the saving unit 93 may read out the device value and the time information from the ring buffer 91a, create the log data 73, and save it in the memory card 36. Similarly, when a predetermined storage condition is satisfied, the storage unit 93 may read the large-capacity data and time information from the extension unit 4, create log data 73, and store the log data 73 in the memory card 36. The storage unit 93 stores the device value and time information as described above in association with the large-capacity data and time information. Here, "associated" storage means that the data is stored in a form that is easy to reproduce on the PC 2, and for example, file management may be performed in which a plurality of files are associated with each other. To be more specific, when a first subfolder in which device values and time information are stored and a second subfolder in which large-capacity data and time information are stored are placed under a specific folder in the memory card 36, the path (directory path) to the specific folder becomes a common flag, and using this common flag, it becomes possible to store the files in the first subfolder and the files in the second subfolder in "association." In addition, when there is another folder placed at the same level (directory) as the specific folder described above, the other folder means a data package stored at another timing. Of course, the other folder also has a subfolder similar to the above under it.In this way, the storage unit 93 may store the above-mentioned device value and time information, and the above-mentioned data (large capacity data) and time information in a plurality of files identified by a common flag (a predetermined directory path), and save the plurality of files. In addition, for example, a file name may be adopted as a common flag, and files with the same or corresponding file names may be generated, so that the data may be "associated" and saved. In addition, for example, the device value and the data (large capacity data) may be associated with each other and listed using time information as a key, and the data may be compiled into one file, so that the data may be "associated" and saved. In this embodiment, large capacity data is considered as an example of data from a monitoring device, but it goes without saying that other types of data, such as continuous data such as motion data, communication data, and voice data, may also be used. The transmission unit 94 may transmit the log data 73 to the PC 2, the cloud, or the like. When the ring buffer 91a becomes full, the collection unit 92a overwrites the oldest information held in the ring buffer 91a with the newest information.
[0108] Although a ring buffer 91a is used as an example of a buffer here, this is merely an example. A FIFO type buffer would be sufficient as the buffer.
[0109] FIG. 20 is a diagram for explaining the function of the CPU 41 of the expansion unit 4 having a camera input function. The clock of the time management unit 83b is synchronized with the clock of the time management unit 83a of the basic unit 3. For example, the time management unit 83a transmits time information to the time management unit 83b during END processing. The time management unit 83b synchronizes the clock of the time management unit 83b with the clock of the time management unit 83a based on the received time information. The clock may be realized by a counter that counts time based on the time information. When a predetermined collection condition (e.g., a predetermined relay device is turned on), the collection unit 92b outputs a trigger signal, for example, periodically. The time management unit 83b acquires time information when the trigger signal is input from the clock and stores it in the time information buffer 95. The memory 42 has a time information buffer 95 and a ring buffer 91a. The connection port 97 is an interface for connecting the camera 98 to the expansion unit 4. The connection port 97 periodically outputs a trigger signal issued by the collection unit 92b to the camera 98, and outputs image data output by the camera 98 to the image receiving unit 96a. Image data is an example of large-capacity data. The connection port 97 is connected to a monitoring device such as the camera 98, and is an example of a second external interface to which data (image data) is input from the monitoring device. The image receiving unit 96a is all or a part of the function executing unit 96 that executes an imaging function involving input of image data from the camera 98 via the connection port 97. In this embodiment, the function executing unit 96 (image receiving unit 96a) executes control of the camera 98 based on imaging parameters (an example of setting information) such as exposure time, gain, white balance, and contrast. Such imaging parameters are set as desired parameter values in the PC 2, and are sent to the function executing unit 96 via the communication unit 33 and CPU 31 of the basic unit 3 shown in FIG. 4. Therefore, the communication unit 33 shown in FIG. 4 is an example of a first external interface that accepts setting information from an external setting device such as the PC 2 or a display device. The communication unit 33 as the first external interface also accepts a user program created by the PC 2 as described above. The camera 98 captures an image in response to a trigger signal and outputs image data. The image receiving unit 96a transfers the image data to the collecting unit 92b.The collection unit 92b associates the time information held in the time information buffer 95 with the image data output from the image receiving unit 96a and stores them in the ring buffer 91a. When the ring buffer 91b becomes full, the collection unit 92b overwrites the oldest information held in the ring buffer 91b with the newest information. Note that, in this embodiment, the collection unit 92b automatically and periodically outputs an imaging trigger signal to the camera 98, but the present invention is not limited to this, and the collection unit 92b may output an imaging trigger signal to the camera 98 based on, for example, a command from a user program.
[0110] Meanwhile, the basic unit 3 communicates with the expansion unit 4 using any of refresh communication executed for each scan, direct communication that can be executed at any time, and message communication executed in response to an event. For example, the storage unit 93 reads image data and time information from the ring buffer 91b of the expansion unit 4 using direct communication, and adds the image data and time information to the log data 73. Note that multiple direct communications with priorities may be implemented as direct communications. In this case, the priority of direct communication executed in relation to a user program may be set relatively high, and the priority of direct communication for logging may be set relatively low. This makes it possible to reduce the impact of logging on the execution of a user program.
[0111] <Logging using ring buffer> 21 shows the device values and time information stored in the ring buffer 91a of the basic unit 3. One record has an acquired device value and time information indicating the time when this device value was acquired.
[0112] 21 further shows image data and time information stored in the ring buffer 91b of the extension unit 4. One record has acquired image data and time information indicating the time when this image data was acquired.
[0113] FIG. 22 shows logging using a ring buffer 91a in the basic unit 3.
[0114] In S21, the CPU 31 (collection unit 92a) determines whether the acquisition condition for the device value is satisfied. The acquisition condition is a condition for starting storage of the device value and time information in the ring buffer 91a. The acquisition condition may be described in the user program (e.g., the start relay is turned on) or may be described in the log setting data 72. If the acquisition condition is satisfied, the CPU 31 proceeds to S22.
[0115] In S22, the CPU 31 (collection unit 92a) turns on the acquisition relay. The acquisition relay is a one-bit device, and is a relay for instructing the extension unit 4 to store data in the ring buffer 91b.
[0116] In S23, the CPU 31 (collection unit 92a) determines whether the time to acquire the device value has arrived. The acquisition timing is, for example, every scan period (for example, acquisition in the END process of every scan), and is defined by the log setting data 72. When the acquisition timing arrives, the CPU 31 proceeds to S24.
[0117] In S24, the CPU 31 (collection unit 92a) acquires the device value specified by the log setting data 72 from the device unit 34, acquires the time information from the time management unit 83a, and writes these to the ring buffer 91a.
[0118] In S25, the CPU 31 (collection unit 92a) determines whether or not the save timing has arrived. The save timing is the timing at which information held in the ring buffer 91a is saved in the log data 73. The save timing may be, for example, the occurrence of a predetermined event (e.g., a save trigger). The save timing is also defined by the log setting data 72. If the save timing has not arrived, the CPU 31 returns to S23. If the save timing has arrived, the CPU 31 proceeds to S26.
[0119] In S26, the CPU 31 (collection unit 92a) saves the information held in the ring buffer 91a in the log data 73. Of the information held in the ring buffer 91a, the information to be saved may be defined by the log setting data 72. For example, the information to be saved may be information acquired from the timing at which a certain event occurs until a predetermined time has elapsed. Also, the information to be saved may be information acquired from a start time, which is a time a certain time before the timing at which a certain event occurs, to an end time, which is a time a certain time after the timing at which the event occurs.
[0120] In S27, the collection unit 92a saves the information held in the ring buffer 91b of the expansion unit 4 in the log data 73. The collection unit 92a may read the information held in the ring buffer 91b of the expansion unit 4 by using direct communication. More specifically, the collection unit 92a may issue a command to read information from the buffer memory. The information held in the ring buffer 91b that is to be saved may also be defined by the log setting data 72. For example, the information to be saved may be information acquired from the timing at which a certain event occurs until a certain time has elapsed. The information to be saved may also be information acquired from a start time, which is a time a certain time before the timing at which a certain event occurs, until an end time, which is a time a certain time after the timing at which the event occurs.
[0121] In S28, the collection unit 92a determines whether or not the end condition is satisfied. The end condition is a logging end condition. The end condition may also be defined by the log setting data 72. If the end condition is not satisfied, the CPU 31 returns to S23. If the end condition is satisfied, the CPU 31 ends the logging process.
[0122] FIG. 23 shows logging using the ring buffer 91b in the extension unit 4.
[0123] In S31, the CPU 41 (collection unit 92b) determines whether the image data acquisition condition (e.g., the acquisition relay is turned ON) is satisfied. When the acquisition relay is turned ON, the CPU 41 proceeds to S32. In this embodiment, it is determined that the image data acquisition condition is satisfied when the acquisition relay is turned ON, but this is only one example. In another example, it may be determined that the image data acquisition condition is satisfied when the mode of the PLC1 is switched to the operation mode. More specifically, the PLC1 may be provided with a mode changeover switch that changes between a setting mode (program mode) for performing various settings and an operation mode (RUN mode) for performing actual operation by repeatedly executing a ladder program. In this case, it may be determined that the image data acquisition condition is satisfied when the user switches this mode changeover switch from the program mode to the RUN mode.
[0124] In S32, the CPU 41 (collection unit 92b) determines whether or not the timing for acquiring image data has arrived. The acquisition timing is, for example, every internal control period (imaging period) of the extension unit 4. When the acquisition timing arrives, the CPU 41 proceeds to S33.
[0125] In S33, the CPU 41 (collection unit 92b) acquires large-capacity data and time information and stores them in the ring buffer 91b. For example, the collection unit 92b issues a trigger signal and outputs it to the camera 98 and the time management unit 83b. When the time management unit 83b receives the trigger signal, it reads out time information from an internal clock and writes it to the time information buffer 95. The camera 98 captures images according to pre-specified imaging conditions and outputs image data. The image receiving unit 96a outputs the image data to the collection unit 92b. The image receiving unit 96a may directly write the image data to the ring buffer 91b. The collection unit 92b associates the time information read out from the time information buffer 95 with the image data acquired by the camera 98 and writes them to the ring buffer 91b.
[0126] In S34, the CPU 41 (collection unit 92b) determines whether or not a read request (read command) to the ring buffer 91b has been issued from the basic unit 3. If a read request has been received, the CPU 41 proceeds to S35. If a read request has not been issued, the CPU 41 returns to S32.
[0127] In S35, the CPU 41 (collection unit 92b) acquires image data, which is a large volume of data, and time information from the ring buffer 91b, and transmits them to the basic unit 3.
[0128] In S36, the CPU 41 (collection unit 92b) determines whether the end condition is satisfied. For example, the collection unit 92b determines whether the acquisition relay is turned off. If the end condition is not satisfied, the CPU 41 returns to S32. If the end condition is satisfied, the CPU 41 ends the logging process.
[0129] <Connection type> FIG. 24 shows the connection form of a building block type PLC 1. An IF 99a is provided on the right side of the basic unit 3 for connecting and communicating with the expansion unit 4. IF is an abbreviation of interface. In this example, the expansion unit 4a is connected to the basic unit 3, and the expansion unit 4b is connected to the expansion unit 4a. The expansion unit 4 has IFs 99 on both the right side and the left side. The right side of the basic unit 3 faces the left side of the expansion unit 4a. Therefore, the IF 99a of the basic unit 3 connects to the IF 99b provided on the left side of the expansion unit 4a. The right side of the expansion unit 4a faces the left side of the expansion unit 4b. Therefore, the IF 99c of the expansion unit 4a connects to the IF 99d provided on the left side of the expansion unit 4b. The IF 99e provided on the right side of the expansion unit 4b may be connected to an end unit. In this way, the IFs 99a to IFs 99e form a unit internal bus 90. For example, image data acquired by a camera 98a connected to the expansion unit 4a can be transferred to the base unit 3 via the unit internal bus 90. Image data acquired by a camera 98b connected to the expansion unit 4b can be transferred to the base unit 3 via the unit internal bus 90.
[0130] In this way, the side surface of each unit becomes the connection surface (joint surface) in the building block type PLC 1. An IF 99 for forming a part of the unit internal bus 90 is also provided on the side surface of each unit. As described above, communication on the unit internal bus 90 is controlled by the bus master 38 shown in FIG.
[0131] FIG. 25 shows the connection form of the PLC 1 having a backplane 200. The backplane 200 is connected to the bottom of the basic unit 3 and the bottom of the expansion unit 4, or is connected to the rear of the basic unit 3 and the rear of the expansion unit 4. The backplane 200 functions as a support plate (base plate) that supports the basic unit 3 and the expansion unit 4. Here, the rear is described as the connection surface as an example. The rear of the basic unit 3 faces the front of the backplane 200. Therefore, IF99f provided on the rear of the basic unit 3 is connected to IF99g provided on the front of the backplane 200. The rear of the expansion unit 4 faces the front of the backplane 200. IF99h provided on the rear of the expansion unit 4a is connected to IF99i provided on the front of the backplane 200. IF99j provided on the rear of the expansion unit 4b is connected to IF99k provided on the front of the backplane 200. IF99f to IF99k form a unit internal bus 90.
[0132] The backplane 200 may have a communication control unit 213 for controlling bus communication via the unit internal bus 90. The backplane 200 may also have a CPU 211 and a memory 212. The memory 212 may have a memory card 36 in addition to a RAM or a ROM. In this case, the CPU 211 may function as a collection unit 92a or a storage unit 93. The memory 212 may also be provided with a ring buffer 91a. Alternatively, the CPU 211 may have a time management unit 83b and a collection unit 92. In this case, the memory 212 has a ring buffer 91b.
[0133] <Log display example> FIG. 26 shows an example of log data 73. In this example, device values d1 to d10, and the acquisition timings of workpiece images i1 to i3 acquired by camera 98a and other images j1 to j3 acquired by camera 98b are shown. The device values d1 to d10 are acquired for each scan cycle. The workpiece images i1 to i3 are acquired at the timing when a trigger signal is generated. The workpiece images j1 to j3 are acquired at the timing when a trigger signal is generated. The position of each data indicates its respective time information. As shown in FIG. 26, the acquisition times and acquisition cycles of each data do not match. Therefore, the log display unit 61 adjusts the display timing of each data based on the time information of each data.
[0134] 27 is a diagram for explaining the display timing and display duration of log data 73. The log display unit 61 displays each device value on the display unit 7 according to the time information of each device value. For example, the log display unit 61 determines the difference time between the time information of device value d1 and the time information of device value d2 as the display duration of device value d1. The log display unit 61 starts displaying device value d2 when the display duration has elapsed since starting to display device value d1. Thereafter, the display duration is calculated in a similar manner, and the displayed device value is switched according to the time information and the display duration.
[0135] As already shown in FIG. 26, the acquisition time of the device value d1 does not match the acquisition time of the workpiece image i1. Therefore, the log display unit 61 compares the acquisition time of the workpiece image i1 with the acquisition times of the device values d1 to d10, and obtains the acquisition time of the device value dx that is closest to the acquisition time of the workpiece image i1. In this example, the acquisition time of the device value d1 is closest to the acquisition time of the workpiece image i1. Therefore, the log display unit 61 starts displaying the device value d1 and also starts displaying the workpiece image i1. Next, the log display unit 61 obtains the acquisition time of the device value dx that is closest to the acquisition time of the workpiece image i2. In this example, the acquisition time of the device value d4 is closest to the acquisition time of the workpiece image i2. Therefore, when the display timing of the device value d4 arrives, the log display unit 61 starts displaying the device value d4 and the workpiece image i2. The log display unit 61 obtains the acquisition time of the device value dx that is closest to the acquisition time of the other image j1. In this example, the acquisition time of the device value d2 is closest to the acquisition time of the other image j1. Therefore, when the display timing of the device value d2 arrives, the log display unit 61 starts displaying the device value d2 and also starts displaying the other image j1.
[0136] In this way, among the multiple data included in the log data 73, the display timing of each data may be adjusted based on the data with the shortest logging cycle.
[0137] FIG. 28 is a diagram for explaining a display method of the log data 73. In this example, the relay device R000 and the data memory DM100 are acquired as the device value dx (x has a value from 1 to 10). In this way, a plurality of device values are associated with one work image ix according to time information. The log display unit 61 may display the device value dx, the work image ix, and the other images jx in one window, or may display them in separate windows. The log display unit 61 may also read out a user program from the project data 71, and map the device value dx to the user program for display. For example, the log display unit 61 may search for a step including an instruction word related to the device value dx to be displayed, and may display the found step, and may display the device value under the instruction word in the step. Note that the device to be displayed may be a relay device. The log display unit 61 may change the display color of the instruction word or the icon image (e.g., an arrow) according to the on / off state of the relay device. The icon image may indicate on or off. The log display unit 61 may also display the device value in a graph. In this case, the log display unit 61 always displays the device values d1 to d10 in one window, and displays the workpiece image in another window. The log display unit 61 switches the workpiece image as time passes. Here, the log display unit 61 may display a bar 103 that is movable in the direction of a time axis. The bar 103 may be called a timeline bar. The log display unit 61 may display the bar 103 so that it moves from left to right as time passes. The bar 103 may be moved by the user. In this case, the log display unit 61 accepts a movement operation of the bar 103 (e.g., a drag operation by the pointer 101) through the operation unit 8, and updates the display time in response to the movement operation. The log display unit 61 may extract the device values, workpiece images, and other images whose acquisition times are closest to the display time specified by the bar 103 from the log data 73, and display them on the display unit 7.
[0138] In this embodiment, the camera 98 is exemplified as an example of a monitoring device, and the imaging function of the camera 98 is exemplified as a function of the function execution unit 96. The present invention is not limited to this, and the function of the function execution unit 96 may be a motion function or a communication function. First, the former motion function will be described in detail. Consider a case where a motion unit is connected to the basic unit 3 as the extension unit 4. In this case, a program (motion flow program) and parameters (setting parameters for axis configuration and axis control, etc.) that define the operation of the motion unit are set in the PC 2, and so-called setting information is created. Then, the setting information is sent to the function execution unit of the motion unit via the first external interface (communication unit 33) and reflected in the motion unit. The function execution unit of the motion unit transmits operation command values such as target coordinates and target speed to the externally connected motor amplifier according to the setting information. Motion data such as current coordinates and current speed are received from the motor amplifier via an encoder. The control period for receiving motion data such as current coordinates and current speed is shorter than the scan period of the ladder program and is asynchronous with the scan period of the ladder program. Therefore, the collection unit of the motion unit collects motion data at a predetermined cycle, associates the motion data with information on the reception time when the motion data was received, and stores the motion data in the ring buffer 91b. Thereafter, similar to the process described with reference to FIG. 22, when the time to save is reached (similar to step S25 in FIG. 22), the motion data (current coordinates, current speed, etc.) and time information are obtained from the ring buffer 91b and added to the log data. This makes it easy to identify which device value is associated with which motion data. On the other hand, to explain the latter communication control in detail, consider a case where a communication unit is connected to the basic unit 3 as the extension unit 4. In this case, in the PC 2, a program (communication flow program) and parameters (communication cycle, transfer rate, etc.) that define the operation of the communication unit are set, and setting information is created. Then, similar to the above-mentioned motion control, the setting information is reflected in the communication unit via the communication unit 33.Then, the function execution unit of the communication unit receives communication data such as multiple sensor values from a sensor group (such as a group of multiple photoelectric sensors connected together) connected externally according to the setting information. The reception cycle (cyclic communication cycle) of such communication data is asynchronous with the scan cycle of the ladder program. When the number of sensors constituting the sensor group is large, the communication data itself may constitute a large volume of data. The collection unit of the communication unit collects the communication data at a predetermined cycle (so-called cyclic communication cycle), associates the communication data with information on the reception time when the communication data was received, and stores the communication data in the ring buffer 91b. After that, similar to the process described using FIG. 22, when it is time to save (similar to step S25 in FIG. 22), the communication data (sensor values, etc.) and time information are obtained from the ring buffer 91b and added to the log data.
[0139] <Collection period settings> The log setting unit 51 may receive a setting for a collection period for the log data 73 .
[0140] FIG. 29 shows a UI 160 for setting a collection period. The UI 160, the UI 110, and the UI 100 may be switched by selecting a tab corresponding to each of them with the pointer 101. The UI 160 has a pull-down menu 161 for specifying a collection method. The collection method is a method for collecting log data 73. In this example, a collection method called before and after a save trigger and a collection method called a start relay are described. Before and after a save trigger is a method for collecting log data 73 at a collection time Ta before the timing when the save trigger is turned on and a collection time Tb after the timing when the save trigger is turned on. A text box 162 accepts input of a collection time T. The collection time T is the sum of the collection time Ta and the collection time Tb. A text box 163 accepts input of a collection time Tb after the trigger. A save trigger setting unit 164 accepts settings of a device name of a relay device used as a save trigger and a condition (e.g., switching from off to on). The up arrow means that the relay device designated as the save trigger has switched from off to on. The guidance section 165 is a UI for explaining the collection period. In this example, it is shown that the log data 73 is collected with the save trigger as the boundary. The log setting section 51 may also display information on the device size and the increase in scan time described above on the UI 160.
[0141] In a collection method called before and after a save trigger, device values and image data are constantly stored in the ring buffer 91. When the relay device R200, which is a save trigger, is turned on, the storage unit 93 creates log data 73 for 20 seconds, which is specified as the collection time. The storage unit 93 creates the log data 73 by reading from the ring buffer 91 data recorded from 18 seconds before the relay device R200 was turned on to data recorded up to 2 seconds after the said timing.
[0142] FIG. 30 shows a UI 160 for setting a collection period. In this example, the pointer 101 selects the start relay from the pull-down menu 161 as the collection method. The log setting unit 51 changes the UI 160 according to the collection method selected by the user. The text box 166 accepts the device name of the relay device used as the start relay. As shown by the guidance unit 165, in a collection method called the start relay, the timing when the start relay is turned on is the starting point (start point) of the collection time. For example, it is assumed that it takes 30 seconds to press a single workpiece that flows through the production line. It is also assumed that the time when a problem can occur is the first 20 seconds of the 30-second processing time. The relay device R000 is a relay that specifies the timing to start the press processing. When the relay device R000 is turned on, the collection unit 92 stores the device values and image data in the ring buffer 91 for 20 seconds. When the relay device R000 is turned on again due to the arrival of the next workpiece, the collection unit 92 stores the device values and image data in the ring buffer 91 for 20 seconds. When the relay device R200, which is a storage trigger, is turned on, the storage unit 93 obtains the device values and image data for the most recent 20 seconds stored in the ring buffer 91 and creates log data 73. The relay device R200, which is a storage trigger, is a relay device that is turned on when a problem occurs.
[0143] The log setting unit 51 stores the information set via the UI 160 in the log setting data 72 and transfers it to the basic unit 3 together with the project data 71 .
[0144] <Debug> FIG. 31 is a flow chart showing an outline of the debugging process of a user program executed by a user.
[0145] In S41, the user operates the PC 2 to create a user program consisting of a plurality of program parts, and creates project data 71 including the user program. The program creation unit 63 creates the user program according to user input, and stores it in the storage device 22. The project creation unit 50 creates project data 71 according to user input, and stores it in the storage device 22. The project data 71 includes identification information for identifying the project data 71 or the user program. The project creation unit 50 may perform an operation on the project data 71 or the user program to obtain a hash value or an error detection code, etc., and add these to the project data 71 as identification information. The identification information may be a GUID (globally unique identifier), etc.
[0146] In S42, the user operates the PC 2 to transfer the project data 71 to the PLC 1. The project creation unit 50 reads the project data 71 from the storage device 22, and transmits it to the PLC 1 via the communication unit 23. Upon receiving the project data 71, the basic unit 3 of the PLC 1 writes it into the storage device 32.
[0147] In S43, the user operates the operation section 6 of the basic unit 3 (for example, by operating a mode change switch to switch from PROGRAM mode to RUN mode) to instruct execution of the project. The execution section 80 executes the user program included in the project data 71. The recording section 81 logs device values and the like, and stores (records) the logged device values in the ring buffer 91a. When a predetermined output condition is satisfied, the saving section 93 of the output section 84 creates log data 73 by saving the device values recorded in the ring buffer 91a and the above-mentioned image data in the memory card 36 or the internal memory 37.
[0148] 19, the storage unit 93 stores the project data 71 in the memory in addition to the log data 73. This allows the PC 2 to reproduce the behavior at the time of the trouble occurrence on the monitor using the project data 71 at the time of the trouble occurrence. Details will be described later.
[0149] Furthermore, the storage unit 93 stores in memory, in addition to the project data 71, identification information (such as a hash value) of the project data 71. This allows the PC2 to use the identification information to verify whether the current project data (to be the subject of replay) matches the project data 71 at the time of the actual occurrence of the problem. Details will be described later.
[0150] In this embodiment, the project data 71 and its identification information are stored in memory in addition to the log data 73 when a predetermined output condition is satisfied, but the present invention is not limited to this. For example, the project data 71 and its identification information may be stored in memory before, when, or during operation of the PLC 1, and only the log data 73 may be stored in memory when a predetermined output condition is satisfied. In short, it is sufficient that the log data 73, the project data 71, and their identification information are stored in memory in a correlated state when the predetermined output condition is satisfied.
[0151] In addition, in this embodiment, the project data 71 is stored in the memory, but the present invention is not limited to this. For example, instead of the project data 71, only the identification information of the project data 71 may be stored in the memory. In this case, it is assumed that the current project data in the PC 2 matches the project data 71 at the time of the actual occurrence of the trouble. In other words, it is assumed that the current project data has not been edited or modified after the project data is transferred to the PLC 1. If it is determined that the two data do not match, the user only needs to perform replay after recognizing that the current project data is different from the project data 71 at the time of the actual occurrence of the trouble, so that replay (inaccurate troubleshooting) can be prevented from being performed without the user being aware of this.
[0152] In S44, the user operates the operation unit 6 of the basic unit 3 to instruct the transfer of the project data 71 and the log data 73 to the PC 2. Alternatively, the user may operate the operation unit 8 of the PC 2 to read out the project data 71, the identification information of the project data 71, and the log data 73 written to the memory card 36. The output unit 84 transmits the project data 71 and the log data 73 to the PC 2. Note that the output unit 84 may adopt a configuration in which, when it is determined that the transfer of the project data 71 is prohibited, the identification information of the project data 71 is added to the log data 73. The identification information of the project data 71 and the log data 73 may be transmitted separately. When a predetermined condition for writing to the memory card 36 is satisfied, the output unit 84 may perform an operation (using a hash function, for example) on the project data 71 or the user program to obtain a hash value or an error detection code, and add these to the log data 73 as identification information. Note that, as long as the rule for creating the identification information executed by the PC 2 and the rule for creating the identification information executed by the basic unit 3 match, any rule may be adopted.
[0153] In S45, the user operates the PC 2 to investigate the cause of the trouble while replaying the log data 73, and debug the user program constituting the project data 71. Replaying the log data 73 includes displaying the time-series device values included in the log data 73 as waveforms on the display unit 7, displaying the device values in association with the user program, and displaying the time-series image data included in the log data 73 on the display unit 7. The log display unit 61 has an internal clock that keeps virtual time, and acquires the device values from the log data 73 in synchronization with the internal clock and displays them on the display unit 7. The project data 71 may not be transmitted from the PLC 1. In this case, the log display unit 61 may use the user program of the project data 71 (master data) held in the storage device 22 and display the device values in association with the user program. Details of investigating the cause of the trouble by replaying the log data 73 will be described later.
[0154] It should be noted here that the version of the project data 71 used to acquire the log data 73 may differ from the version of the project data 71 held in the PC2. In this case, it may be impossible to display the device value in association with the user program, or the user program may be erroneously associated with the device value. In this case, the log display unit 61 may use the identification information of the project data to display a warning indicating that the version of the project data 71 used to acquire the log data 73 is different from the version of the project data 71 held in the PC2 on the display unit 7. The log display unit 61 may inquire of the user as to whether or not to display the log data 73 acquired using the first version of the project data 71 in association with the second version of the project data 71 held in the PC2. If the user desires such a display, the log display unit 61 displays the log data 73 acquired using the first version of the project data 71 on the display unit 7 in association with the second version of the project data 71 held in the PC2. The version is managed by the identification information. If the user confirms that there is no problem with the log data 73, debugging is not necessary, and the subsequent steps S46 and S47 are also unnecessary. The user analyzes the log data 73, finds any bugs in the user program, and corrects the user program. The project creation unit 50 corrects (updates) the project data 71 in accordance with the user input, and stores it in the storage device 22.
[0155] In S46, the user operates the PC 2 to transfer the project data 71 to the PLC 1. When the user program in the project data 71 is changed, the identification information is updated. This makes it possible to distinguish the project data 71 before and after the correction.
[0156] In S47, the user operates the basic unit 3 and instructs execution of a user program included in the project data 71, thereby verifying the project data 71. The execution unit 80 executes the user program included in the project data 71. If the PLC 1 is operating as the user expected, the user determines that debugging of the project data 71 has been successful. If the PLC 1 is not operating as the user expected, the recording unit 81 logs device values and the like again, and the storage unit 93 creates log data 73. The user then executes S44 to S47 again.
[0157] In this way, the user can debug the project data 71 while referring to the log data 73. This is believed to improve the efficiency of debugging.
[0158] The transfer of the project data 71 may be performed via the memory card 36. That is, the PC 2 writes the project data 71 to the memory card 36. The user removes the memory card 36 from the PC 2 and attaches the memory card 36 to the basic unit 3. The basic unit 3 reads the project data 71 from the memory card 36 and writes it to the storage device 32. Similarly, the transfer of the log data 73 may also be performed via the memory card 36.
[0159] <Output section> FIG. 32 shows the output unit 84 implemented in the basic unit 3. The output unit 84 may transfer the project data 71 used when acquiring the log data 73 to the PC 2 in addition to the log data 73. However, in order to prevent information leakage of the project data 71, an access authority (protection) may be set for the project data 71 to prohibit writing to the memory card 36 or transmitting to the PC 2. Therefore, the determination unit 301 refers to the access authority granted to the project data 71 and determines whether output of the project data 71 is prohibited. If output of the project data 71 is prohibited, the output unit 84 outputs the log data 73 but does not output the project data 71. On the other hand, if output of the project data 71 is not prohibited, the output unit 84 outputs the log data 73 and the project data 71. If output of the project data 71 is prohibited, the addition unit 302 may output identification information of the project data 71 held in the storage device 32 together with the log data 73. This identification information may be a part of the project data 71, or the calculation unit 303 may obtain the identification information by executing a predetermined calculation on the project data 71 or a user program. The predetermined calculation may be, for example, a hash calculation or an error detection code calculation. The real-time transmission unit 304 transmits the device value held in the device unit 34 in real time. This is useful when displaying the device value in real time on a display device such as the PC 2 or an HMI (human interface).
[0160] <Project Creation Division 50> FIG. 33 shows the details of the project creation unit 50. The function setting unit 62 sets the configuration information of the expansion unit 4, the functions of the basic unit 3, and the functions of the expansion unit 4 based on the information input from the operation unit 8, and creates configuration information indicating the settings. The settings of the functions of the basic unit 3 include IP address settings, settings related to the FTP client, and settings of access rights to the project data 71. The settings of the functions of the expansion unit 4 include input channel settings and settings related to communication between PLCs. The configuration information is part of the project data 71. The editing unit 311 (which may also serve as the program creation unit 63 shown in FIG. 6) displays an editing UI for the user program on the display unit 7 and edits the user program based on the information input from the operation unit 8. The debugging unit 314 debugs the user program using the project data 71. The adding unit 312 adds identification information to the project data 71. The calculation unit 313 calculates identification information (e.g., hash value or error detection code). The calculation (calculation) function of the identification information by the calculation unit 313 may be performed by the output unit 84.
[0161] <Log display section 61> FIG. 34 shows the details of the log display unit 61. The program display module 321 is a module that displays the user program included in the project data 71 and the device value included in the log data 73 on the display unit 7. The program display module 321 can display not only the user program but also various information for the user to visually confirm the setting contents of the project data 71, such as program configuration information included in the project data 71, a plurality of program parts, unit configuration, and function settings for each unit. The image display module 323 displays time-series image data included in the log data 73 on the display unit 7. The waveform display module 322 is a module that converts time-series device values included in the log data 73 into waveforms and displays them on the display unit 7. The playback control module 324 synchronizes the information displayed by the program display module 321 and the information displayed by the waveform display module 322 in time. These modules may be called engineering software. The image display module 323 may be embodied as one function (image display unit) of the program display module 321, or may be embodied as one function (image display unit) of the waveform display module 322.
[0162] ●Program display module FIG. 35A shows the details of the program display module 321. The time UI 330a provides a UI (e.g., a slide bar, a cursor, etc.) for manipulating the acquisition time (display time) of a device displayed together with a user program. The display time control unit 331a sends the display time specified by the time UI 330a to the playback control module 324, and sets the display time notified from the playback control module 324 to the time UI 330a. The program display unit 332 displays the project data 71 on the display unit 7, and reads out the project data 71 corresponding to the identification information from the storage device 22 and displays it on the display unit 7. The program display unit 332 also displays the device values acquired by the device value acquisition unit 333a in association with the devices used or described in the user program. The device value acquisition unit 333a has a real-time playback mode and a log playback mode. In the real-time playback mode, the device value acquisition unit 333a accesses the real-time transmission unit 304 of the PLC1, acquires the device values, and passes them to the program display unit 332. In the log playback mode, the device value acquisition unit 333 a accesses the playback control module 324 , acquires the display time and device value, and passes them to the program display unit 332 .
[0163] FIG. 35B is a schematic diagram showing an example of a GUI displayed on the display unit 7 by the program display unit 332 or the like.
[0164] In FIG. 35B, the project display area 420 in the left column displays various information constituting the project data 71. From the top, the unit configuration (basic unit, motion unit, analog input unit, camera unit), program configuration (every scan module, fixed cycle module, inter-unit synchronization module, function block, macro) are displayed. For the motion unit, the axis configuration and axis control setting parameters are displayed as function settings. The user can check the setting contents of these setting parameters by double-clicking the axis configuration and axis control on the GUI shown in FIG. 35B. In addition, in the project display area 420, Main and Sub are displayed for each scan module. When the user clicks Main, the Main program is displayed in the program display area 410 of the ladder monitor 450 in the center. In this way, the program display module 321 shown in FIG. 34 reads the project data 71 from the memory card 36, and displays various information in the project display area 420 and displays a desired program in the program display area 410.
[0165] Here, the program display area 410 is a part of the so-called ladder monitor 450, and can be operated independently in the real-time playback mode. It is also possible to hide only the ladder monitor 450 by clicking the cross mark. On the other hand, in the log playback mode, the program display unit 332 is capable of reproducing the ladder program included in the project when the operation record was saved. In addition, in the log playback mode, the program display unit 332 displays the device values included in the log data 73 via the device value acquisition unit 333a in association with the devices described in the Main program. The device values to be displayed are the device values corresponding to the time specified by the time specification cursor 404 (more details will be described later with reference to FIG. 38).
[0166] In FIG. 35B, the device value associated with 18:52:54 on 10 / 01 / 20XX displayed in the time display area 409 is displayed in association with the device described in the Main program. [35000 / 74286] displayed to the right of this date indicates that the current number of scans is 35000 out of the total number of scans of 74286. The user can drag and move the time designation cursor 404 to update the display time and the number of scans, as well as the display of the device value. For example, at the updated display time, the location of the relay device that is ON is displayed as ON (for example, filled in with color, etc.), and the location of the relay device that is OFF is displayed as OFF (for example, colored out, etc.). Details of the function of the play button 406 will be described later with reference to FIG. 38.
[0167] In FIG. 35B, an image display area of the camera monitor 430 is provided in the upper right column. The image display module 323 reads image data from the log data 73 in synchronization with the display time displayed on the ladder monitor 450 by the program display module 321, and displays the image data in the image display area of the camera monitor 430. In FIG. 35B, image data associated with the display time of 18:52:54 on 10 / 1 / 20XX is displayed on the camera monitor 430. In addition, 282 / 601 is displayed to the right of the display time, which indicates the current order of image data (282nd image) with respect to the total number of captured images 601. The user can update the display time and the current order of image data by dragging and moving the time designation cursor 404a on the camera monitor 430.
[0168] At this time, the time designation cursor 404 in the ladder monitor 450 described above moves in conjunction with the movement of the time designation cursor 404a. For example, when the time designation cursor 404a is set to 19:00:00 on the display time 20XX / 10 / 01, the time designation cursor 404 in the ladder monitor 450 also moves to the position of 19:00:00 on the display time 20XX / 10 / 01. Then, the device value in the ladder monitor 450 is updated with the movement of the time designation cursor 404. Here, the time designation cursor 404a is moved, but the reverse is also true. For example, when the time designation cursor 404 in the ladder monitor 450 is moved, the time designation cursor 404a in the camera monitor 430 also moves accordingly. Such processing operation is possible because the program display module 321 and the image display module 323 execute synchronous control regarding the display time via the playback control module 324.
[0169] Also, in Fig. 35B, the unit monitor 440 is displayed in the lower right column. For example, as described with reference to Fig. 10A, the unit monitor 440 displays the device values of the buffer memory (UG) in the motion unit. More specifically, when the unit display module 325 of the log display section 61 receives the display time to be currently played back from the playback control module 324, it reads out the device values associated with that time from the memory card 36 and displays them on the unit monitor 440. Therefore, for example, in Fig. 35B, a list of device values associated with the display time 20XX / 10 / 01 18:52:54 is displayed on the unit monitor 440.
[0170] FIG. 35C is a diagram showing a schematic diagram of a data source for displaying a GUI in a log replay mode. As shown in FIG. 35C, the project display area 420 reads out the unit configuration, function settings, program configuration, and program parts included in the project data 71 from the memory and displays them in a tree format. The ladder monitor 450 reads out the program configuration (what kind of program parts it consists of) and the program parts from the memory and displays the program parts specified by the user, and also reads out and displays the device values corresponding to the display time from the log data 73. The camera monitor 430 reads out and displays image data corresponding to the display time from the log data 73 based on information such as the unit configuration (whether or not there is a camera monitor) and function settings (functions of the camera monitor. For example, port numbers, imaging cycles, gain settings, etc., if there are multiple ports). The unit monitor 440 reads out and displays the device values corresponding to the display time from the log data 73 based on information such as the unit configuration (what kind of units there are) and function settings (axis configuration, axis control, etc., if it is a motion unit).
[0171] 35B and 35C, the program display module 321, the image display module 323, and the unit display module 325 can be synchronously controlled and linked by the function of the playback control module 324. The linkage of the waveform display module 322 will be described in detail later.
[0172] Here, in this embodiment, it is possible to verify whether the current project data matches the project data 71 at the time of the actual occurrence of a problem. More specifically, the collation unit 334 in the program display module 321 shown in Fig. 35 collates the identification information of the project data 71 (user program) output from the PLC 1 with the identification information of the project data 71 (user program) stored in the storage device 22, and outputs the collation result to the warning unit 335. The warning unit 335 displays a warning on the display unit 7 when the identification information of the project data 71 (user program) output from the PLC 1 at the time the operation record was saved does not match the identification information of the project data (user program) stored in the storage device 22.
[0173] For example, the warning unit 335 displays a warning screen 470 as shown in Fig. 35D on the display unit 7. As a specific example, it is assumed that the identification information of the project data 71 when the driving record was saved does not match the identification information of the current project data (to be replayed). For example, this is the case when the user edits the project data (programs, function settings, etc.) after transferring the project data to the PLC 1. In this case, when the real-time playback mode is switched to the log playback mode based on a user operation, the warning screen 470 shown in Fig. 35D is displayed.
[0174] Warning screen 470 shown in Fig. 35D prompts the user to select whether to perform log playback using the current project data as is, or to perform log playback using the driving record project. In the former case, the user performs log playback after recognizing that the current project data is different from project data 71 at the time of the actual occurrence of the trouble. On the other hand, in the latter case, the user can perform log playback using the driving record project, for example, by specifying the path (folder or directory) in storage device 22 where the driving record project is stored.
[0175] In this embodiment, the identification information of two pieces of project data is compared to verify whether they match or not. More specifically, identification information is added to the program configuration, multiple program parts, unit configuration, and function settings for each unit included in the project data, and verification is performed based on whether all of these match or not. However, the present invention is not limited to this, and it is sufficient to compare at least the identification information of a user program composed of multiple program parts to verify whether they match or not.
[0176] Waveform display module FIG. 36A shows the details of the waveform display module 322. The time UI 330b provides a UI (e.g., a slide bar) for operating the acquisition time (display time) of the device displayed together with the user program. As shown in FIG. 28, the time UI 330b basically moves the bar 103 from left to right according to the display time provided from the playback control module 324. However, the time UI 330b accepts the operation of the bar 103 through the operation unit 8, and passes the operation amount of the bar 103 to the playback control module 324 through the display time control unit 331b. The display time control unit 331b sends the display time specified by the time UI 330b to the playback control module 324, and sets the display time notified from the playback control module 324 to the time UI 330b. The device value acquisition unit 333b has a real-time playback mode and a log playback mode. In the real-time playback mode, the device value acquisition unit 333b accesses the real-time transmission unit 304 of the PLC1, acquires the device value, and passes it to the waveform display unit 336. In the log playback mode, the device value acquisition unit 333b accesses the playback control module 324, acquires the display time and device value, and passes them to the waveform display unit 336. As shown in FIG. 28, the waveform display unit 336 converts the device value acquired by the device value acquisition unit 333b into a waveform and displays it on the display unit 7. Converting the device value into a waveform is not essential, and the device value may be displayed as a numeric value. As shown in FIG. 28, the image display module 323 displays image data output from the playback control module 324 on the display unit 7. As described above, the image display module 323 may be realized as one function of the waveform display module 322, but as shown in FIG. 34, it may be a separate function as the image display module 323 (camera monitor).
[0177] 36B is a schematic diagram showing an example of a GUI displayed on the display unit 7 by the waveform display module 322 etc. In particular, the GUI displayed by the waveform display module 322 is a so-called real-time chart monitor 460 displayed in a pop-up window at the lower right.
[0178] In Fig. 36B, the project display area 420 in the left column, the program display area 410 (ladder monitor 450) in the center, and the image display area (camera monitor 430) in the upper right column are the same as those shown in Fig. 35B. That is, these are displayed by the program display module 321 and the image display module 323. Note that, although the display of the unit monitor 440 by the unit display module 325 is omitted in Fig. 36B, it may be displayed.
[0179] The real-time chart monitor 460 shown in Fig. 36B has been outlined with reference to Fig. 28. In Fig. 36B, the waveform data of the relay device R000 and the waveform data of the data memory DM100 are read from the memory and displayed. The user can freely increase or decrease the number of devices to be displayed on the real-time chart monitor 460 via a setting screen (not shown).
[0180] A time designation cursor 404b (corresponding to the bar 103 shown in FIG. 28; may also be called a playback position cursor) is displayed below the real-time chart monitor 460, and the user can click and move the position of this time designation cursor 404b. At this time, when the position of the time designation cursor 404b is moved, the time designation cursor 404 in the ladder monitor 450 and the time designation cursor 404a in the camera monitor 430 are moved in conjunction with each other by the function of the playback control module 324. Specifically, in FIG. 36B, the horizontal axis in the waveform display area of the real-time chart monitor 460 indicates the number of scans (which may be switched to time for display), and when the user clicks and slides the time designation cursor 404b to the position of a predetermined number of scans, the time designation cursor 404 in the ladder monitor 450 and the time designation cursor 404a in the camera monitor 430 each move to the position of the display time corresponding to that number of scans. Then, the device value or image data corresponding to the display position after the movement is displayed. Of course, the reverse is also true. That is, when the time designation cursor 404 on the ladder monitor 450 or the time designation cursor 404a on the camera monitor 430 is clicked and slid to a desired position, the time designation cursor 404b also moves to the position of the scan count corresponding to the desired position. At this time, if the time designation cursor 404 or the time designation cursor 404a is moved by more than a certain amount, the position indicated by the time designation cursor 404b will be outside the current display range of the real-time chart monitor 460, but in this embodiment, the display range follows so that this position is always within the display range.
[0181] Here, as shown in FIG. 36B, in the real-time chart monitor 460, the time designation cursor 404b is composed of a vertical line superimposed on the waveform display area and a triangular figure added to the bottom end of the vertical line, and further, a display area bar 404c is displayed below the time designation cursor 404b. A square indicator indicating the current position is displayed in the center of the display area bar 404c. The user can change the range displayed on the real-time chart monitor 460 by dragging the indicator left and right. The user can perform troubleshooting to investigate the cause of the trouble by making good use of the display area bar 404c. This point will be described in more detail with reference to FIG. 36C.
[0182] FIG. 36C is an explanatory diagram for explaining the relationship between the display range displayed on real-time chart monitor 460 and time designation cursor 404b.
[0183] In FIG. 36C, relay devices R000 and R001, and data memories DM100 and DM101 are displayed on the real-time chart monitor 460. In FIG. 36C, for convenience of explanation, 15 device values (black circles) are displayed on the real-time chart monitor 460 for each device. Among these device values, the device value corresponding to a specific time for each device is the device value specified by the time specification cursor 404b. In FIG. 36C, the device value corresponds to the central time of the range displayed on the real-time chart monitor 460. When the user drags the time specification cursor 404b to move it, for example, to the right, the display range follows so that the time specification cursor 404b fits within the display range, similar to the above-mentioned time specification cursor 404 and time specification cursor 404a. On the other hand, when the user drags the square indicator of the display area bar 404c, for example, to the right, the display range of the real-time chart monitor shifts to the right, and when it shifts by a certain amount (eight device values to the right), the time designation cursor 404b becomes invisible. However, in this embodiment, even if the time designation cursor 404b becomes invisible, in order to facilitate troubleshooting, the time designation cursor 404b jumps to the desired position by double-clicking the desired position in the waveform display area. In other words, the waveform display unit 336 shown in FIG. 36A has a function of accepting a designation of a desired position from the user in the waveform display area and moving the time designation cursor 404b to the accepted designated position.
[0184] The troubleshooting procedure (one example) using the GUI shown in FIG. 36C will be described in more detail.
[0185] (1) First, the user drags and moves the square indicator left and right in the display area bar 404c of the real-time chart monitor 460 to search for a time that may be useful in identifying the cause of the problem while visually checking the device waveform displayed in the waveform display area. At this time, as described above, the time designation cursor 404b may be hidden from the display range of the real-time chart monitor 460.
[0186] (2) When you find a time when an abnormal device value is found in the device waveform, double-click that time in the waveform display area. Then, the time designation cursor 404b jumps to that time, and the time designation cursor 404 on the ladder monitor 450 and the time designation cursor 404a on the camera monitor 430 also jump to that time.
[0187] (3) As a result, the playback control module 324 causes the ladder monitor 450 to display the device values corresponding to that time, and the camera monitor 430 to display the image data corresponding to that time. Therefore, the user can investigate the cause of the trouble while visually checking these device values and image data.
[0188] ● Playback control module 324 FIG. 37 shows the details of the playback control module 324. The device value providing unit 341 provides the device value acquired from the log data 73 by the log data acquiring unit 344 to the program display module 321 and the waveform display module 322. The device value providing unit 341 also provides the device value acquired from the log data 73 to the unit display module 325. The device value acquired from the log data 73 may be temporarily stored in the log device 345. The device value acquiring unit 333 of the program display module 321 and the waveform display module 322 requests the device value from the device value providing unit 341. The device value acquiring unit 333 acquires the device value from the log device 345 and transmits it to the device value acquiring unit 333. The time device 342 is a device that holds the display time set by the playback control unit 343. The device value providing unit 341 may also transmit the device value (time information) held in the time device 342 to the device value acquiring unit 333. Alternatively, the playback control unit 343 may provide time information to the display time control units 331a and 331b. The playback control unit 343 has a virtual internal clock for measuring the display time, and updates the time information held in the time device 342 according to this internal clock. The playback control unit 343 transmits the time information held in the time device 342 to the display time control units 331a and 331b. When the playback control unit 343 receives a display time designation from the display time control units 331a and 331b, it sets the received display time to the internal clock (time adjustment). Therefore, when a display time is designated from the display time control unit 331a, this display time is transmitted to the display time control unit 331b via the playback control unit 343. Similarly, when a display time is designated from the display time control unit 331b, this display time is transmitted to the display time control unit 331a via the playback control unit 343. This synchronizes the display time of the program display module 321 and the display time of the waveform display module 322. To realize slow playback, fast-forward playback, rewind playback, and the like, the playback control unit 343 changes the update speed of the internal clock according to a user input from the operation unit 8. The playback control unit 343 may set the time information of the oldest record included in the log data 73 as the initial value of the internal clock.The log data acquisition unit 344 acquires the device value associated with the display time stored in the time device 342 from the log data 73 , and passes it to the device value provision unit 341 .
[0189] Similarly, the playback control unit 343 may synchronize the display time of the program display module 321 and the display time of the waveform display module 322 as well as the times of the image display module 323 and the unit display module 325 .
[0190] In this embodiment, in the log playback mode, the display times of the program display module 321, the waveform display module 322, the image display module 323, and the unit display module 325 are always synchronized, but the present invention is not limited to this. For example, the user may be able to select whether or not to synchronize. For example, a check box for synchronization may be provided on each monitor screen, and may be checked by default. Then, the user may uncheck a module that he or she does not want to synchronize, thereby preventing synchronization of only that module. In this way, the log display unit 61 may have a selection function for selecting a module to be synchronously controlled (tracking controlled) by the playback control module.
[0191] <Program display UI> FIG. 38 shows a display UI 400 provided by the program display module 321. The display UI 400 described in FIG. 35B and FIG. 36A will be described in more detail from another perspective. The program display area 410 is an area for displaying the user program of the project data 71. In this example, the program display area 410 displays a ladder program (ladder diagram). The program display unit 332 acquires the device values of the devices used or described in the user program by the device value acquisition unit 333a, and displays them together with the user program. For example, if the relay device is ON, the program display unit 332 may display an icon 401a indicating ON superimposed on the user program. If the relay device is OFF, the program display unit 332 may display an icon 401b indicating OFF superimposed on the user program. The program display unit 332 may acquire the device value of the DM100, which is an output device, by the device value acquisition unit 333a, and display it superimposed on the description of the DM100 in the user program. In this example, a device value display area 403 is provided below the description of the DM100. The program display unit 332 displays the device value in the display area 403. Since the playback control module 324 updates the device value together with the display time, the program display unit 332 updates the device value displayed together with the user program. The time UI 330a moves the time specification cursor 404 from right to left according to the display time acquired from the time device 342. The time specification cursor 404 can be dragged by the pointer 101. When the time UI 330a detects that the time specification cursor 404 has been dragged by the pointer 101, the display time control unit 331a causes the playback control unit 343 to stop updating the display time and notifies the playback control unit 343 of the drag amount of the time specification cursor 404. The playback control unit 343 adjusts the count value (display time) of the internal clock according to the drag amount. The time UI 330a may display the update speed of the display time (e.g., ···, 2.0 times, 1.0 times, 0.5 times, 0.1 times, ···) in the speed designation unit 405. The speed designation unit 405 may be realized by a pull-down menu that displays a list of a plurality of update speeds and allows the user to select one of the update speeds.When the time UI 330a detects that the pointer 101 has clicked on the speed designation unit 405, it may display such a pull-down menu and accept the selection of the update speed. The play button 406 is a button for instructing the chronological display of the device values. When the time UI 330a detects that the play button 406 has been clicked on by the pointer 101, it instructs the playback control unit 343 to make the display time control unit 331a start updating the display time. This instruction corresponds to an instruction to start displaying the device values or an instruction to resume displaying. The one-step reverse play button 407 is a button for instructing the device values to be displayed in chronological order while updating (rewinding) the display time one step at a time. When the time UI 330a detects that the one-step reverse play button 407 has been clicked on by the pointer 101, it instructs the display time control unit 331a to move the display time back one step. The one-step play button 408 is a button for instructing the device values to be displayed in chronological order while updating the display time one step at a time. When the time UI 330a detects that the one-step play button 408 has been clicked by the pointer 101, it instructs the display time control unit 331a to advance the display time by one step. When one-step play is being executed, the playback control unit 343 does not update the display time unless the one-step reverse play button 407 or the one-step play button 408 is operated. When the play button 406 is operated while one-step play is being executed, the playback control unit 343 resumes updating the display time at the update speed specified by the speed specification unit 405. The time display area 409 is an area that displays the display time held in the time device 342. The display time control unit 331a displays the display time acquired from the time device 342 in the time display area 409.
[0192] <HMIのエミュレータ> An external display device called an HMI can be connected to the PLC 1. The HMI may have a touch panel type input device. The HMI reads out device values stored in the device unit 34 of the PLC 1 and displays them on the display device. The project creation unit 50 sets the UI to be displayed on the HMI and the device values to be displayed on the UI, and saves them in project data 71. The debug unit 314 has an HMI emulator, and checks the operation of the HMI by operating the emulator according to the project data 71. The log display unit 61 supplies the device values of the log data 73 to the HMI emulator. The HMI emulator displays the device values provided in chronological order on the UI.
[0193] FIG. 39 shows a UI 490 of an HMI emulator. In this example, the HMI emulator is included in the program display module 321. The program display unit 332 reflects the device value provided by the playback control unit 343 in the display area of the UI 490. The UI 490 may have a time control object related to playback control included in the UI 400, such as a time designation cursor 404 and a play button 406. The operation of the time control object in the UI 490 is reflected in the UI 400 and the UI shown in FIG. 28 through the playback control unit 343. For example, when the time designation cursor 404 is operated to the left in the UI 490, the time designation cursor 404 of the UI 400 also moves to the left in conjunction with the display time provided by the playback control unit 343, and the bar 103 shown in FIG. 28 also moves to the left. In addition, when the bar 103 shown in FIG. 28 is operated to the left, the time designation cursor 404 of the UI 400, 450 also moves to the left in conjunction with the display time provided by the playback control unit 343. This is because they are all synchronized with the same display time stored in the time device 342.
[0194] <Flowchart for displaying logs> ●Program display module 40 shows the display process executed by the program display module 321. Note that S50, S51, and S60 may be executed only when the project data 71 cannot be acquired from PLC1. When the project data 71 can be acquired from PLC1, the project data 71 from PLC1 is used. When the project data 71 cannot be acquired from PLC1, the project data 71 held in PC2 is used.
[0195] In S50, the CPU 21 (collation unit 334) acquires the identification information of the project data 71 held in the PLC1 and the identification information of the project data 71 held in the PC2.
[0196] In S51, the CPU 21 (comparison unit 334) determines whether the identification information of the project data 71 held in PLC1 matches the identification information of the project data 71 held in PC2. If they do not match, the CPU 21 proceeds to S60. In S60, the CPU 21 (warning unit 335) displays on the display unit 7 a warning indicating that the identification information of the project data 71 held in PLC1 does not match the identification information of the project data 71 held in PC2. If they match, the CPU 21 proceeds to S52.
[0197] In S 52 , the CPU 21 (program display unit 332 ) acquires the project data 71 from the PLC 1 or the storage device 22 .
[0198] At S53, the CPU 21 (program display unit 332) determines whether log playback mode or real-time playback mode is selected based on information input from the operation unit 8. If real-time playback mode is selected, the CPU 21 proceeds to S58. At S58, the CPU 21 (device value acquisition unit 333a) acquires device values from the real-time transmission unit 304 of PLC1 without going through the playback control module 324. At S59, the CPU 21 (program display unit 332) displays the device values on the display unit 7 together with the user program included in the project data 71. If log playback mode is selected, the CPU 21 proceeds to S54.
[0199] In S54, the CPU 21 (device value acquisition unit 333a) starts the playback control module 324, and acquires the display time and the device value of the log data 73 from the playback control module 324.
[0200] In S55, the CPU 21 (program display unit 332) displays the user program included in the project data 71, as well as the device value and the display time on the display unit 7.
[0201] In S56, the CPU 21 (display time control unit 331a) determines whether or not a time specification has been detected by the time UI 330a. As described above, a time specification is executed by operating the time specification cursor 404. If a time specification has not been detected, the CPU 21 returns to S54. If a time specification has been detected, the CPU 21 proceeds to S57.
[0202] In S57, the CPU 21 (display time control unit 331a) notifies the playback control unit 343 of the playback control module 324 of the designated time input by the time designation cursor 404. The CPU 21 returns to S54.
[0203] Waveform display module FIG. 41 shows the display process performed by the waveform display module 322.
[0204] In S61, the CPU 21 (waveform display unit 336) determines whether log playback mode or real-time playback mode is selected based on information input from the operation unit 8. If real-time playback mode is selected, the CPU 21 proceeds to S66. In S66, the CPU 21 (device value acquisition unit 333b) acquires device values from the real-time transmission unit 304 of PLC1 without going through the playback control module 324. In S67, the CPU 21 (waveform display unit 336) displays the device values on the display unit 7. If log playback mode is selected, the CPU 21 proceeds to S62.
[0205] In S62, the CPU 21 (device value acquisition unit 333b) starts the playback control module 324, and acquires the device value and the display time from the playback control module 324.
[0206] In S63, the CPU 21 (waveform display unit 336) displays the device value and the display time on the display unit 7.
[0207] In S64, the CPU 21 (display time control unit 331b) determines whether or not a time specification has been detected by the time UI 330b. As described above, the time specification is performed by the bar 103. If a time specification has not been detected, the CPU 21 returns to S62. If a time specification has been detected, the CPU 21 proceeds to S65.
[0208] In S65, the CPU 21 (display time control unit 331b) notifies the playback control unit 343 of the playback control module 324 of the designated time inputted by the bar 103. The CPU 21 returns to S62.
[0209] ●Playback control module FIG. 42 illustrates the playback control performed by the playback control module 324.
[0210] In S71, the CPU 21 (log data acquisition unit 344) acquires the log data 73 from the PLC 1 and stores it in the storage device 22.
[0211] In S72, the CPU 21 (playback control unit 343) initializes the time of the internal clock.
[0212] In S 73 , the CPU 21 (playback control unit 343 ) obtains the time of the internal clock, and stores the time in the time device 342 .
[0213] In S74, the CPU 21 (playback control unit 343) acquires a device value corresponding to the display time held in the time device 342 from the log data 73, and stores it in the log device 345. This enables the device value providing unit 341 to provide the program display module 321 and the waveform display module 322 with the device value and the display time.
[0214] In S75, the CPU 21 (playback control unit 343) determines whether or not a time designation has been received from the display time control unit 331. If a time designation has been received, the CPU 21 proceeds to S76. If a time designation has not been received, the CPU 21 proceeds to S77.
[0215] In S76, the CPU 21 (playback control unit 343) changes the time of the internal clock in accordance with the time designation from the display time control unit 331.
[0216] In S77, the CPU 21 (playback control unit 343) determines whether or not an instruction to change the update speed has been received from the display time control unit 331. If an instruction to change has been received, the CPU 21 proceeds to S78. If an instruction to change has not been received, the CPU 21 proceeds to S73.
[0217] In S78, the CPU 21 (playback control unit 343) changes the update rate of the internal clock in accordance with the update rate specified by the display time control unit 331. After that, the CPU 21 proceeds to S73.
[0218] <Refine program parts> PC2 extracts the devices to be logged when setting logs, and extracts other devices related to a specific device when displaying logs. The following example is used to explain this extraction process.
[0219] FIG. 43 shows multiple modules that make up a ladder program. In this example, the following PLC1 is assumed. A workpiece is transported by a transport belt. When the workpiece detection sensor detects the workpiece, the height sensor measures the height of the workpiece, and the depth sensor measures the depth of the workpiece. If the workpiece height is not within a specified range, the measurement is determined to be NG. Similarly, if the workpiece depth is not within a specified range, the measurement is determined to be NG. FIG. 43 shows program modules for realizing this series of processes. Each module includes contact system commands (input system commands) and output system commands. Contact system commands are the conditions for executing output system commands.
[0220] In the workpiece detection module B1, device MR000 is a relay device that turns ON when a workpiece is detected. Device MR0002 is a relay device that turns ON when PLC1 is in automatic operation. Device MR001 is a relay device for instructing the expansion unit 4 to start measurement. Device MR000 turns ON when a workpiece is detected during automatic operation.
[0221] In the measurement module B2, the contact system command describes that when MR001 turns ON, an output system command is executed. In this example, the height measurement value acquired by the extension unit 4 is stored in device EM0, and it is described that this is copied to device TM100. Similarly, the depth measurement value acquired by the extension unit 4 is stored in device EM2, and it is described that this is copied to device TM101. Furthermore, device MR003 for managing the completion of measurement is set ON.
[0222] Judgment module B3 is a module that is executed when device MR003 is turned ON, that is, when measurement is completed. Here, if the measurement result does not satisfy the pass condition, device MR010 is turned ON. This means that the measurement is NG. More specifically, if the height measurement value stored in device TM100 is less than 95, MR010 is turned ON. If the height measurement value stored in device TM100 is greater than 105, MR010 is turned ON. If the depth measurement value stored in device TM101 is less than 35, MR010 is turned ON. If the depth measurement value stored in device TM100 is greater than 45, MR010 is turned ON.
[0223] The error processing module B4 is a module for stopping the conveyance of the conveyor belt when some error occurs. In this example, when MR010 is ON (measurement NG), or MR012 is ON (forced stop), or MR013 is ON (conveyance NG), MR011 is turned on (conveyance stop).
[0224] As can be seen from FIG. 43, a device described in a contact system command of a certain module is described in an output system command of another module. Conversely, a device described in an output system command of a certain module is described in a contact system command of another module. For example, device MR001 described in an output system command of workpiece detection module B1 is described in a contact system command of measurement module B2. Therefore, workpiece detection module B1 and measurement module B2 are extracted as mutually related modules. Next, when focusing on device MR003 described in an output system command of measurement module B2, it can be seen that MR003 is described in a contact system command of judgment module B3. Therefore, measurement module B2 and judgment module B3 are extracted as mutually related modules. Next, when focusing on device MR010 described in an output system command of judgment module B3, it can be seen that MR010 is described in a contact system command of error processing module B4. Therefore, judgment module B3 and error processing module B4 are extracted as mutually related modules. In this way, multiple modules involved in a certain process and multiple devices described inside multiple modules are extracted. These extraction processes are executed by the device extraction unit 53. The device extraction unit 53 may be implemented in the log display unit 61. That is, the log display unit 61 may extract a plurality of modules related to each other, and further extract a plurality of devices described in the extracted plurality of modules, obtain each device value of the extracted plurality of devices from the log data 73, and display them on the display unit 7.
[0225] FIG. 44 shows a UI500 that displays the extraction results. The log display unit 61 and the device extraction unit 53 may create the UI500 that displays the devices and blocks (program parts) extracted from the user program, and display it on the display unit 7. The UI500 can easily display the extraction results of the devices and program parts. Therefore, the user will be able to easily grasp the overall picture of the extraction results. When any block included in the UI500 is clicked by the pointer 101, the log display unit 61 and the device extraction unit 53 may display details of the clicked block on the UI501. This will allow the user to quickly access the details of the extracted block. The log display unit 61 and the device extraction unit 53 may display the extraction results using the UI exemplified in FIG. 43.
[0226] <Block and device extraction process> 45 shows the block and device extraction process executed by the device extraction unit 53. Here, the project data 71 includes a plurality of blocks (program parts). Therefore, the device extraction unit 53 refers to the project data 71 and extracts blocks and devices.
[0227] In S81, the CPU 21 (device extraction unit 53) accepts the selection of a block through the operation unit 8. The device extraction unit 53 may accept the designation of a device through the operation unit 8. In this case, the device extraction unit 53 may extract one or more blocks describing the designated device. When a plurality of blocks are extracted, the device extraction unit 53 may accept a user selection of one block from the plurality of blocks. For example, such a device may be a device that the user focuses on in debugging. The user sets a condition (e.g., a save trigger) for outputting the log data 73 to the output unit 84 of the PLC 1 through the log setting unit 51. More specifically, the condition is set as a specific relay device being turned on. Therefore, the device extraction unit 53 may specify the relay device set as the save trigger.
[0228] In S82, the CPU 21 (device extraction unit 53) extracts the devices described in the contact-related commands of the selected block.
[0229] In S83, the CPU 21 (device extraction unit 53) searches for other blocks in which the extracted device is described in the output system command.
[0230] In S84, the CPU 21 (device extraction unit 53) determines whether or not another block in which the extracted device is described in an output-related command has been found. If another block has not been found, the CPU 21 ends the extraction process. If another block has been found, the CPU 21 proceeds to S85.
[0231] In S85, the CPU 21 (device extraction unit 53) extracts the discovered block as an associated block. For example, the device extraction unit 53 registers identification information (e.g., name, file name, etc.) of the discovered block in a list for managing associated blocks.
[0232] In S86, the CPU 21 (device extraction unit 53) selects an associated block as a block from which a device is to be extracted. Thereafter, the CPU 21 returns to S82 to execute extraction processing for the newly selected block. The associated block selected in S86 is a block that has not yet been selected as a device extraction target. If device extraction processing has been completed for all blocks registered in the list, the device extraction unit 53 ends the extraction processing. The CPU 21 (device extraction unit 53) may create a list indicating the relationship between the extracted device and the block from which the device was extracted. The device extraction unit 53 or the log display unit 61 may refer to these lists and create the UI shown in FIG. 43 or the UIs 500 and 501 shown in FIG. 44.
[0233] <Specific examples of debugging> FIG. 46 shows the debugging process performed by the user.
[0234] In S91, the user sets an NG judgment as a storage condition for the log data 73 through the log setting unit 51. According to Fig. 43, the fact that the device MR010 that manages the NG judgment has been turned ON is determined as the storage condition for the log data 73. The user transfers the project data 71 and the log setting data 72 to the PLC1.
[0235] In S92, the user operates PLC 1. PLC 1 executes project data 71, and when the storage conditions in log setting data 72 are satisfied, it stores log data 73 in memory card 36. In the example shown in Fig. 43, when an NG judgment occurs, the conveyor belt stops, so that the user knows that some kind of error has occurred.
[0236] In S93, the user checks the workpiece and determines whether the NG judgment is a false positive. For example, the user measures the height and depth of the workpiece and determines whether it meets the pass criteria. If the workpiece does not meet the pass criteria, the user determines that the NG judgment is a false positive.
[0237] In S94, the user removes the memory card 36 from the PLC1, connects the memory card 36 to the PC2, and plays back the log data 73 stored in the memory card 36. The program display module 321 displays the device values included in the log data 73 in association with the user program. More specifically, the program display module 321 specifies the device MR010 adopted as the storage condition, causes the device extraction unit 53 to execute the block and device extraction process, and displays the UI shown in FIG. 43 and the UIs 500 and 501 shown in FIG. 44. Furthermore, the waveform display module 322 displays the device values displayed by the program display module 321 in a waveform form. For example, the measurement value of the work height held in EM0 and the depth of the work held in EM2 are waveformed and displayed on the display unit 7. The device value of the device MR000 that manages the work detection is also waveformed and displayed. The user observes these waveforms and determines that chattering of the work detection sensor is the cause of the erroneous detection. To counter chattering, the user operates the editing unit 311 and modifies the workpiece detection module B1 as shown in Fig. 47. According to this modification, when a workpiece is detected continuously for one second or more by the workpiece detection sensor, the device MR001 for starting measurement is turned on. The user transfers the updated project data 71 to the PLC1, operates the PLC1, and judges whether the chattering countermeasure has been successful.
[0238] By displaying the waveforms of the user program and device values in a synchronized manner in this way, the user can efficiently identify the cause of an erroneous detection and debug the user program to eliminate the cause.
[0239] <Summary> As shown in Fig. 17, the execution unit 80 is an example of a program execution unit that repeatedly executes a user program. The device unit 34 is an example of a device storage unit having multiple devices that are storage areas referenced by the program execution unit. The recording unit 81 is an example of a device recording unit that records device values stored in any of the multiple devices in chronological order. The PC2 is an example of a program creation support device that is connected to a programmable logic controller and supports the creation of a user program.
[0240] As shown in FIG. 6, the project creation unit 50 is an example of a program creation unit that creates a plurality of program parts constituting a user program, the program parts including an instruction word related to any of a plurality of devices, based on a user input via the display unit 7. The part designation unit 52 is an example of a program part designation unit that designates a program part from among the plurality of program parts, from which a specific device to be recorded by the device recording unit is extracted. The device extraction unit 53 is an example of a device extraction unit that analyzes the program part designated by the program part designation unit and extracts a device described in the program part. The recording unit 81 of the basic unit 3 is configured to record, in chronological order, device values stored in the specific device extracted as a recording target by the device extraction unit.
[0241] In this way, the user can specify a program part, and devices are extracted from the specified program part. The user can also exclude specific program parts from device extraction targets. This reduces the burden on the user to register devices to be logged in the PLC.
[0242] The extraction unit 53 may analyze the program parts created by the program creation unit 63 and extract the devices described in the program parts. The part designation unit 52 may designate, on a program part basis (for each program part), a program part in which a specific device to be recorded by the recording unit 81 is used or described, among the multiple program parts created by the program creation unit 63. In this case, the recording unit 81 records in chronological order the device values stored in the specific device that is the device extracted by the extraction unit 53 and is used or described in the program part designated by the part designation unit 52.
[0243] The extraction unit 53 may analyze a plurality of program parts created by the program creation unit 63 and extract a device used or described for each program part. The part designation unit 52 may designate at least one program part among the plurality of program parts created by the program creation unit 63. The recording unit 81 records in chronological order the device values stored in the devices used or described in the program parts designated by the part designation unit 52 among the plurality of program parts analyzed by the extraction unit 53. For example, a plurality of program parts may be analyzed in advance and a plurality of devices may be extracted. That is, a list showing the extracted devices may be created for each program part. Furthermore, when the user designates any one of the program parts, a list for the designated program part may be read out and the devices listed in the list may be selected as the recording target.
[0244] The part designation unit 52 may be configured to designate at least one program part among a plurality of program parts created by the program creation unit 63. The extraction unit 53 may analyze the program parts designated by the part designation unit 52 and extract a device used or described for each program part. The recording unit 81 records in chronological order the device values stored in the specific device extracted by the extraction unit 53. In this way, device extraction may be performed after the program parts are designated. This will make the extraction process easier.
[0245] The extraction unit 53 may analyze a plurality of program parts created by the program creation unit 63 and extract devices used or described for each program part. The part designation unit 52 may designate at least one program part to be recorded or excluded from among the plurality of program parts created by the program creation unit 63. The recording unit 81 may be configured to chronologically record device values stored in a specific device used or described in a program part designated by the part designation unit 52 as a recording target among the devices extracted from the plurality of program parts by the extraction unit 53, and record devices used in program parts other than the program parts designated by the part designation unit 52 as a target for exclusion. For example, when module A uses device memories DM0 and DM1 and module B uses device memories DM1 and DM2, device memories DM0, DM1, and DM2 are extracted from modules A and B. Here, when module B is designated as a target for exclusion, DM2 is excluded, but DM1 remains as a target for recording because it is also used by module A. In this way, adding and removing devices may be performed for each program part (i.e., for each program part). Also, after devices are extracted from all program segments, program segments to be recorded or excluded may be designated.
[0246] The part designation unit 52 may be configured to designate, among the multiple program parts, program parts from which a specific device is not extracted as exclusion targets. The device extraction unit 53 may be configured to analyze the program parts designated by the part designation unit 52 as device extraction targets, extract devices used or described in the program parts, and not extract devices from the program parts designated as exclusion targets. In other words, the deletion unit 55 and the addition unit 54 may function as a device addition / removal unit that deletes some specific devices from the specific devices extracted by the device extraction unit for each program part, or that adds devices not extracted by the device extraction unit for each program part.
[0247] A program part may be, for example, a reusable program module. A plurality of program parts may be stored in separate files. Access rights (editing rights) may be set separately for each of the plurality of program parts.
[0248] The user program may be, for example, a ladder program. In this case, the plurality of program parts may be a plurality of function blocks used or written in the ladder program.
[0249] The detection unit 82 is an example of a detection unit that detects rewriting of a device value from an external device for any one of a plurality of devices. The recording unit 81 may add a device for which rewriting of the device value is detected by the detection unit 82 to the recording target.
[0250] PLC 1 may further include a removable memory card 36 and an identification unit 57 that detects a command to the memory card 36 and identifies a device that is the target of the command. In Fig. 6, the identification unit 57 is provided in PC 2, but it may also be implemented in CPU 31 of basic unit 3. Recording unit 81 may add the device identified by the identification unit 57 to the devices to be recorded.
[0251] The extension unit 4 of the PLC 1 may be a motion unit (positioning unit) having a positioning function. The recording unit 81 or the device extraction unit 53 may add a device (e.g., a buffer memory in a motion unit, etc.) that is used for the positioning function and is not described in the user program to the recording target.
[0252] The estimation unit 59 is an example of an estimation unit that estimates the influence that the recording of device values by the recording unit 81 has on the execution of a user program, based on the number of devices extracted as recording targets by the device extraction unit 53. The display unit 7 may be configured to display this influence. This enables the user to add or remove devices while taking into account the influence on the scan time.
[0253] 7 shows extraction of devices from selected program parts, extraction of devices from selected functions, and manual addition of devices by a user. However, all of these are not essential. It would be sufficient to employ two or more of these. Alternatively, only extraction of devices from selected program parts or only extraction of devices from selected functions may be employed.
[0254] The CPU 31 and the execution unit 80 are an example of a program execution engine that repeatedly executes a user program. The CPU 31, the execution unit 80, and the CPU 41 are an example of a plurality of function execution engines that each execute a different function (e.g., a function program) related to the user program based on an instruction from the user program. This suggests that the basic unit 3 may include the function of the expansion unit 4. The function program is, for example, a motion control program. The program execution engine and the plurality of function execution engines may be executed by a single CPU, may be executed by multiple CPUs, or may be realized by an ASIC or an FPGA. Also, a single CPU may be equipped with multiple cores, and each core may be responsible for a different function.
[0255] The device unit 34 is an example of a device storage unit having a plurality of devices which are storage areas referenced by the program execution engine and the plurality of function execution engines. The recording unit 81 is an example of a device recording unit which records device values stored in any of the plurality of devices in chronological order. The function setting unit 62 may function as an allocation unit which allocates a plurality of devices used in each of the plurality of function execution engines. The function designation unit 60 may function as a designation unit which designates one or more functions among a plurality of functions corresponding to the plurality of function execution engines. The device extraction unit 53 may extract devices used for one or more functions designated by the designation unit from the plurality of devices allocated by the allocation unit as targets for recording in the device recording unit.
[0256] The program execution engine may be provided in the main unit. At least one of the plurality of function execution engines may be provided in a function expansion unit electrically connected to the main unit to expand the functions of the main unit. All of the plurality of function execution engines may be provided in the main unit.
[0257] The base unit 3 is an example of a main unit having a program execution unit, a device storage unit, and a device recording unit. The expansion unit 4 is an example of a function expansion unit that is electrically connected to the main unit to expand the functions of the main unit.
[0258] The function setting unit 62 functions as an allocation unit that allocates devices to be used for functions of the main unit and devices to be used for functions of the function extension unit based on a user input via the display unit 7. The function setting unit 62 may display on the display unit 7 a UI for allocating devices to functions.
[0259] The function designation unit 60 is an example of a designation unit that designates one or more functions among a plurality of functions including functions provided in the main unit and functions provided in the function extension unit. The addition unit 54 of the device extraction unit 53 extracts devices used for the functions designated by the designation unit as recording targets in the device recording unit. The deletion unit 55 of the device extraction unit 53 excludes devices used for the functions designated by the designation unit from recording targets in the device recording unit. The communication unit 23 functions as a transmission unit that transmits setting data to the PLC 1 for recording device values stored in a specific device extracted as a recording target in chronological order in the device recording unit. The recording unit 81 is configured to record device values stored in a device extracted as a recording target by the device extraction unit 53 in chronological order.
[0260] The project creation unit 50 functions as a program creation unit that creates a user program including an instruction word related to any one of a plurality of devices based on a user input via the display unit 7. The device extraction unit 53 may analyze the user program, extract devices used or described in the user program, and create a device list (extraction list) including the extracted devices. Furthermore, the device extraction unit 53 may add devices used for functions designated by the function designation unit 60 as targets to be recorded (targets to be extracted) to the device list. The deletion unit 55 may be configured to delete devices used for functions designated by the function designation unit 60 as targets to be excluded from the device list. The device list is included in the log setting data 72. The recording unit 81 is configured to record device values stored in devices registered in the device list in chronological order.
[0261] The function designation unit 60 may be further configured to designate either one of the main unit and the function expansion unit. That is, a function may be selected, or a unit may be selected. When one unit has a plurality of functions, the user selects one function, and all functions included in the unit are selected as device extraction targets. The device extraction unit 53 may extract, as a recording target in the device recording unit, a device used for a unit designated as a recording target (extraction target) by the function designation unit 60. The device extraction unit 53 may also be configured to exclude, from the recording target in the device recording unit, a device used for a unit designated as an exclusion target by the function designation unit 60. In this way, extraction targets and exclusion targets may be designated in units of the main unit and the function expansion unit.
[0262] 14, the function designation unit 60 may be further configured to designate a device type of a device to be recorded or a device type of a device to be excluded. The device extraction unit 53 extracts devices of the device type designated by the function designation unit 60 as devices to be recorded in the device recording unit. The device extraction unit 53 may be configured to exclude devices of the device type designated by the designation unit as devices to be excluded from devices to be recorded in the device recording unit.
[0263] As described with reference to FIG. 19, the collection unit 92a is an example of a first collection unit that collects device values stored in any of a plurality of devices, associates information about the collection time of the device value with the device value, and stores the device value in a first buffer. The device values to be collected may be set in advance by the log setting data 72. The ring buffer 91a is an example of a first buffer. The information about the collection time may be time information supplied from the time management unit 83a, for example. The IFs 99a and 99f are examples of a first interface that communicates with the expansion unit 4. The communication unit 33 is an example of a first external interface that accepts a user program and setting information from an external setting device.
[0264] IF99b, 99d, 99h, 99j, etc. are an example of a second interface that communicates with the main unit. The image receiving unit 96a and the connection port 97 are an example of a third interface (two-dimensional data receiving unit) that is connected to a monitoring device that acquires two-dimensional data and receives the two-dimensional data from the monitoring device. The connection port 97 may function as a second external interface that is connected to a monitoring device and receives data from the monitoring device. The camera 98 is an example of a monitoring device. The monitoring device may be a barcode reader. In this case, the read result of the barcode is an example of two-dimensional data. The monitoring device may be an image processing device that generates a height image or a distance image of a workpiece. The height image or the distance image is an example of two-dimensional data. The two-dimensional data may be video data. Large-capacity data that is larger in size than the device value is also an example of two-dimensional data. For example, numerical data acquired by a high-speed analog input unit is also an example of two-dimensional data. The function executing unit 96 may function as a function executing unit that executes a function involving input of data from a monitoring device via a second external interface based on the received setting information.
[0265] The collection unit 92b is an example of a second collection unit that collects two-dimensional data received via the third interface, associates the two-dimensional data with information about the acquisition time when the two-dimensional data was acquired, and stores the two-dimensional data in the second buffer. The time information provided by the time management unit 83 is an example of information about the acquisition time. The ring buffer 91b is an example of a second buffer.
[0266] The storage unit 93 is an example of a storage unit that, when a specified storage condition is met, stores information regarding the device values and collection time stored in the first buffer, and information regarding the two-dimensional data and acquisition time stored in the second buffer.
[0267] In this way, information regarding the acquisition time is linked to the device values and the two-dimensional data, respectively, making it easier to identify the temporal relationship between a relatively large amount of data, such as two-dimensional data, and the device values.
[0268] The monitoring device may be a camera 98 that acquires image data of still images or video images. The function execution unit 96 executes a function involving input of image data from the camera 98. The collection unit 92b, which is a second collection unit, associates information about the acquisition time when the image data was acquired with the image data and stores the image data in the second buffer. The storage unit 93 may store the device value, information about the acquisition time, the image data stored in the second buffer, and information about the acquisition time in association with each other. The function execution unit 96 may execute a function involving input of data from the monitoring device asynchronously with the execution cycle of the user program. The storage unit 93 may also store the user program and project data including the setting information. The storage unit 93 may store the device value, information about the acquisition time, the data stored in the second buffer, and information about the acquisition time in multiple files identified by a common flag, and store the multiple files.
[0269] The information on the collection time may be information that can identify the collection time for each of the multiple device values collected in chronological order. The collection time may be associated with each of the multiple device values. Alternatively, for example, the collection time may be associated with only the first device value. In the latter case, the collection time for device values other than the first device value may be calculated based on other information (such as the number of scans and the scan time). Since the device values are recorded the same number as the number of scans, the collection time of any device value can be identified by storing the processing time (scan time) in each scan. For example, when attempting to identify the collection time of a device value recorded in the 100th scan, it is assumed that the collection time of the device value recorded in the first scan is 10:10:00, and each of the 2nd to 100th scans took 100 microseconds. In this case, the time 100 microseconds x 99 after 10:10:00 is calculated as the collection time of the device value recorded in the 100th scan. In this way, it is not essential to associate and record the collection time with all device values.
[0270] The information on the acquisition time may be information for identifying the acquisition time of each of the plurality of two-dimensional data acquired in chronological order. The acquisition time may be associated with each of the plurality of two-dimensional data. Alternatively, for example, the acquisition time may be associated with only the first two-dimensional data. In the latter case, the acquisition time of two-dimensional data other than the first two-dimensional data can be calculated based on other information (such as the number of times of imaging and the imaging cycle). Specifically, the acquisition time is associated with only the first two-dimensional data among the plurality of two-dimensional data. The cycle (imaging cycle) for acquiring two-dimensional data is almost constant. Therefore, the acquisition time of any two-dimensional data can be identified. For example, when attempting to identify the acquisition time of image data recorded in the 10th imaging, it is assumed that the acquisition time of the image data recorded in the first imaging is 10:10:00, and each of the 2nd to 10th imaging took 100 milliseconds. In this case, the acquisition time of the image data recorded in the 10th imaging is the time when 100 milliseconds x 9 have elapsed from 10:10:00. In this way, it is not essential to associate the acquisition time with all two-dimensional data and record it.
[0271] The storage unit 93 may include a memory card 36 that is detachable from the main unit. The storage unit 93 may store, in the memory card 36, information relating to the device values and collection time stored in the first buffer, and information relating to the two-dimensional data and acquisition time stored in the second buffer. This makes it easier to transport the log data 73 to the PC 2. As shown in FIG. 19, the first buffer may be provided in the main unit. As shown in FIG. 20, the second buffer may be provided in the expansion unit.
[0272] As shown in Fig. 24, the first interface may be disposed on a side surface of the main unit that faces the side surface of the expansion unit. The second interface may be provided on a side surface of the expansion unit so as to be connected to the first interface.
[0273] 25, the backplane 200 is an example of a support plate that supports the main unit and the expansion unit. In this case, at least one of the first buffer, the second buffer, and the storage unit may be provided on the support plate.
[0274] The transmission unit 94 is an example of a transmission unit that transmits the device value, information on the collection time, the two-dimensional data, and information on the acquisition time stored in the storage device 32 to an external device. The external device may be a cloud or a PC 2. The PC 2 may receive the log data 73 in real time and display the log data 73 on the display unit 7.
[0275] The first buffer or the second buffer may be configured to further store information that occurs in a period shorter than the execution period (eg, scan period) of the user program.
[0276] The storage unit 93 may be configured to read out and store the two-dimensional data and information relating to the acquisition time from the second buffer during a period in which end processing (END processing) related to a user program is being executed in the main unit.
[0277] As described above with respect to the time management units 83a and 83b, the clock of the main unit that measures the collection time and the clock of the expansion unit that measures the acquisition time are synchronized. This synchronization may be achieved, for example, by inter-unit synchronization.
[0278] As shown in FIG. 29, the storage unit 93 may be configured to store in the memory card 36 the device values collected at a specified collection time before and after a pre-set storage trigger, information regarding the collection time, the two-dimensional data, and information regarding the acquisition time.
[0279] As shown in FIG. 30, the storage unit 93 may be configured to store in the memory card 36 the device values collected at a specified collection time starting from the timing when a preset start relay is turned on, information related to the collection time, the two-dimensional data, and information related to the acquisition time.
[0280] As described in relation to FIG. 32, when a predetermined storage condition is satisfied, the storage unit 93 may store the device value recorded in the device recording unit and the user program or the identification information of the user program stored in the program storage unit in a memory (e.g., memory card 36 or internal memory 37) in association with each other. Furthermore, when a predetermined output condition is satisfied, the output unit 84 may output the device value recorded in the device recording unit and the user program or the identification information of the user program stored in the program storage unit to an external memory (e.g., memory card 36). As described above, it is important which project data 71 was used to acquire the log data 73. Therefore, the output unit 84 outputs the project data 71 itself used to acquire the log data 73, or the identification information thereof. In other words, by outputting the log data 73 and the project data 71 or the identification information thereof, it becomes easier to specify the relationship between the log data 73 and the project data 71. This enables the user to efficiently proceed with debugging the project data 71.
[0281] A user program is composed of a plurality of program parts. Moreover, the project data manages a plurality of program parts. The storage device 32 functions as a program storage unit that stores the user program as a part of the project data 71. The output unit 84 outputs the project data 71 including the user program, and may be configured to output identification information of the project data 71 as identification information of the user program. This makes it easier to determine whether the project data 71 (master data) stored in the PC 2 and the project data 71 stored in the PLC 1 match.
[0282] The project data 71 may include setting information of the expansion unit 4. This is because the setting information of the expansion unit 4 may be required when debugging the project data 71. For example, when multiple expansion units 4 are connected to the base unit 3, the connection order of the multiple expansion units 4 is included in the setting information of the expansion units 4. Information regarding this connection order may be required when debugging.
[0283] The determination unit 301 functions as a determination unit that determines whether output of the user program (project data 71) is prohibited. When the determination unit 301 determines that output of the user program is prohibited, the output unit 84 may output the device value recorded in the device recording unit and the identification information of the user program stored in the program storage unit to an external memory. This makes it possible to use the master data of the PC 2 based on the identification information while protecting the user program.
[0284] As described in relation to the adding unit 312, the identification information of the user program is identification information that is updated when the user program is changed. This prevents project data 71 of a different version from the project data 71 held in PLC 1 from being mistakenly used for debugging.
[0285] As described in relation to the calculation unit 313, the identification information of the user program may be an error detection code or a hash value calculated from the user program. In this way, a calculation method of the identification information may be adopted in which the identification information is updated when the project data 71 is updated. The identification information may be a time stamp or the like.
[0286] The storage device 22 of the PC 2 is an example of a program memory that stores a user program and identification information of the user program. The collation unit 334 is an example of a collation unit that collates the identification information of the user program output from the programmable logic controller with the identification information of the user program stored in the program memory and displays the collation result on the display unit. The warning unit 335 outputs a warning when the two do not match, but when the two match, a message or image indicating that they match may be displayed on the display unit 7.
[0287] As shown in Fig. 38, the display unit 7 may display the device values output from the programmable logic controller in association with the part of the user program in which the instruction words related to the device values are written. This makes it easier for the user to understand the relationship between the change in the device values and the user program. This will improve the efficiency of debugging.
[0288] The storage device 22 and memory card 36 are examples of storage means for storing multiple time-series device values collected in the programmable logic controller and time data indicating the collection time of each device value. The program display module 321 is an example of a first engineering software module for displaying device values on a ladder diagram. The waveform display module 322 is an example of a second engineering software module for displaying device values as time-series waveforms. The playback control module 324 is an example of a synchronization software module for synchronizing the display target time in the first engineering software module with the display target time in the second engineering software module. This makes it easier for the user to understand the relationship between changes in a specific device value and the program.
[0289] The first engineering software module may have a first display control means for acquiring device values from the programmable logic controller in the real-time playback mode and displaying the device values on a ladder diagram, and for acquiring device values corresponding to a display target time based on time data from the storage means and displaying the device values on the ladder diagram in the history playback mode. The program display unit 332, the display time control unit 331, and the device value acquisition unit 333 function as the first display control means. The log playback mode is an example of the history playback mode.
[0290] The second engineering software module may have a second display control means for acquiring device values from the programmable logic controller in the real-time playback mode and displaying a time-series waveform, and for acquiring device values corresponding to a display target time based on time data from the storage means and displaying a time-series waveform in the history playback mode. The waveform display unit 336, the display time control unit 331 and the device value acquisition unit 333 are examples of the second display control means.
[0291] The synchronization software module may include a synchronization means for synchronizing the display target time in the first engineering software module with the display target time in the second engineering software module in the history playback mode. The playback control unit 343 is an example of the synchronization means.
[0292] The first engineering software module may further include a first update means for updating the display target time in the history playback mode. The time designation cursor 404, the time UI 330, and the display time control unit 331 are examples of the first update means. The playback control unit 343, which is a synchronization means, reflects the display target time updated by the first update means in the display target time of the second engineering software module.
[0293] The second engineering software module may further include a second update means for updating the display target time in the history playback mode. The bar 103, the time UI 330, and the display time control unit 331 are examples of the second update means. The playback control unit 343, which is a synchronization means, reflects the display target time updated by the second update means in the display target time of the first engineering software module.
[0294] As shown in FIG. 43, the first display control means may search the ladder diagram for an instruction word related to a device that is to be displayed in the second engineering software module among a plurality of devices referenced in the programmable logic controller. For example, a device may be specified by specifying a device (e.g., R000 or DM100) shown in FIG. 28 with a pointer 101. As shown in FIG. 38, the first display control means may be configured to display a device value of the device together with an instruction word found in the ladder diagram. The pointer 101 is an example of a specifying means for specifying an arbitrary device. The first display control means may search the ladder diagram for an instruction word related to a device specified by the specifying means among a plurality of devices referenced in the programmable logic controller, and display a device value of the device together with an instruction word found in the ladder diagram.
[0295] 43, a ladder program in a programmable logic controller may be composed of a plurality of program parts. The first display control means (e.g., the log display unit 61 or the device extraction unit 53) may be configured to search for one or more blocks including an instruction word related to a device from among the plurality of program parts, and display the found blocks as a ladder diagram.
[0296] As shown in FIG. 43, when the first display control means finds a plurality of blocks including an instruction word related to a device, the first display control means may display ladder diagrams corresponding to the plurality of blocks side by side.
[0297] As shown in Figure 43, in a ladder program, when a command word related to a first device (e.g., MR001) in a first block (e.g., measurement module B2) is an input system command word, the first display control means may identify a second device (e.g., MR003) that is the target of an output system command word written in response to the input system command word, and identify a second block (e.g., judgment module B3) in which an input system command word targeting the second device is written.
[0298] In a ladder program, when a command word related to a first device (e.g., MR010) in a first block (e.g., judgment module B3) is an output system command word, the first display control means may identify a second device (e.g., MR001) that is the target of an input system command word written in response to the output system command word, and identify a second block (e.g., measurement module B2) in which an output system command word targeting the second device is written.
[0299] The synchronization means may have a setting means for setting an update speed of the display target time. The speed designation unit 405 is an example of the setting means. This may allow slow playback, fast forward playback, and the like to be realized.
[0300] The first display control means and the second display control means may be configured to further display a device value set based on a user input input from a human interface (HMI) that displays information related to the programmable logic controller. The HMI may be realized by an emulator. As described in relation to FIG. 39, the UI 490 displays a plurality of device values. When any of the device values is clicked by the pointer 101, the log display unit 61 may add the clicked device value as a display target in the program display unit 332 or as a display target in the waveform display unit 336. This makes it possible to display the HMI, the user program, and the waveforms of the device values in a coordinated and synchronized manner.
[0301] The storage means may further store a plurality of image data in a time series acquired by the camera unit and time data indicating the acquisition time of each image data. As shown in FIG. 28, the second engineering software module may acquire device values from the programmable logic controller in the real-time playback mode to display a time-series waveform and display image data acquired from the camera unit. Similarly, the second engineering software module may acquire device values and image data corresponding to a display target time from the storage means and display them in the history playback mode. Image data has more information than numerical values. Therefore, by displaying image data, a user may be able to find a problem early.
[0302] The first engineering software module may acquire device values from the programmable logic controller in the real-time playback mode and display the device values on the ladder diagram and also display image data acquired from the camera unit.The first engineering software module may acquire device values and image data corresponding to a display target time from the storage means in the history playback mode and display them on the ladder diagram.
[0303] The multiple extension units 4 operate according to different internal control cycles. Therefore, the acquisition times of the device values and the image data acquired from the multiple extension units 4 often do not match. Therefore, as described with reference to Figs. 26 to 28, the first display control means and the second display control means may be configured to read out the device values associated with the time data closest to the display target time in the history playback mode.< / plc>
Claims
1. a programmable logic controller including a ladder execution engine that repeatedly executes a ladder program, a device memory having a device that is a storage area referenced by the ladder execution engine based on a description of the ladder program, a function execution engine that executes a motion function for driving and controlling an externally connected motor based on a command from the ladder program, and a buffer memory that stores a plurality of different motion data that are updated by the execution of the motion function; an engineering tool for the programmable logic controller; 1. A programmable logic controller system comprising: The engineering tool comprises: A display unit; A designation unit that designates a motion function among a plurality of different functions based on a user input via the display unit; a setting unit that creates log setting data including a logging target list in which a plurality of buffer memories corresponding to a plurality of different monitor items for monitoring a motion function specified by the specifying unit, the monitor items including any one of coordinates, speed, and torque of the motor, and a plurality of devices extracted from the ladder program are specified; and having The programmable logic controller includes: a recording unit that records the motion data stored in the plurality of buffer memories specified by the logging target list and the device values stored in the plurality of devices specified by the logging target list in chronological order in association with time data relating to collection time; a storage unit that, when a predetermined storage condition is satisfied, reads out the time-series motion data and device values for a predetermined target period recorded by the recording unit, as well as the associated time data, and stores them as log data; having The engineering tool further comprises: a unit display module that acquires motion data corresponding to a display target time from the log data based on time data stored as the log data, and displays a list of the motion data and units on the display unit in association with each of the plurality of different monitor items; a display module for a device that acquires a device value corresponding to a display target time from the log data based on time data stored as the log data, and displays the device value on the display unit; a playback control module that synchronizes a display target time in the unit display module with a display target time in the device display module; 1. A programmable logic controller system comprising:
2. The display module for the device includes a program display module for displaying the device value acquired from the log data on a ladder diagram, The playback control module includes:
2. The programmable logic controller system according to claim 1, wherein the display target time in said unit display module and the display target time in said program display module are synchronized.
3. The display module for the device includes a waveform display module that displays the device value acquired from the log data as a time-series waveform, The playback control module includes:
2. The programmable logic controller system according to claim 1, wherein the display target time in said unit display module is synchronized with the display target time in said waveform display module.
4. 4. The programmable logic controller system according to claim 1, wherein the unit display module displays a list of motion data corresponding to each of the plurality of different monitor items on the display unit when the log playback mode is selected from the real-time playback mode and the log playback mode in response to a user input via the display unit.
5. The engineering tool comprises: The plurality of different monitor items are selectable based on a user input via the display unit, 5. The programmable logic controller system according to claim 1, wherein the setting unit creates log setting data including a logging target list in which a plurality of buffer memories corresponding to the selected plurality of different monitor items are specified.
6. 6. The programmable logic controller system according to claim 5, wherein the engineering tool is further configured to, when there are multiple axes indicating the drive source of the motor, select the multiple different monitor items for each axis based on user input via the display unit.
7. 7. The programmable logic controller system according to claim 1, wherein the plurality of different monitor items include at least the coordinates, speed and torque of the motor.
8. 8. The programmable logic controller system according to claim 1, wherein a plurality of buffer memories are associated with each of said plurality of different monitor items.
9. 9. The programmable logic controller system according to claim 1, wherein the plurality of different functions includes either a communication function or an analog input function.
10. The programmable logic controller system according to any one of claims 1 to 9, characterized in that the function execution engine executes the motion function by executing a motion control program at a control period shorter than the scan period of the ladder program.
11. 11. The programmable logic controller system according to claim 1, wherein the log setting data specifies, as the storage condition, a specific device and timing determined by a change in state of the specific device.
12. an engineering tool for a programmable logic controller, comprising: a ladder execution engine that repeatedly executes a ladder program; a device memory having a device which is a storage area referenced by the ladder execution engine based on a description of the ladder program; a function execution engine that executes a motion function for driving and controlling an externally connected motor based on a command from the ladder program; a buffer memory that stores a plurality of different motion data updated by execution of the motion function; a recording unit that records in chronological order the motion data stored in a plurality of buffer memories specified by a logging target list and the device values stored in a plurality of devices specified by the logging target list in association with time data relating to a collection time; and a storage unit that, when a predetermined storage condition is met, reads out the time-series motion data and device values recorded by the recording unit for a predetermined target period, as well as the associated time data, and stores them as log data; A display unit; A designation unit that designates a motion function among a plurality of different functions based on a user input via the display unit; a setting unit that creates log setting data including a logging target list in which a plurality of buffer memories corresponding to a plurality of different monitor items for monitoring a motion function specified by the specifying unit, the monitor items including any one of coordinates, speed, and torque of the motor, and a plurality of devices extracted from the ladder program are specified; and a communication unit that transfers the log setting data to the programmable logic controller; a storage unit that stores the log data stored by the storage unit; a unit display module that acquires motion data corresponding to a display target time from the log data based on time data stored as the log data, and displays a list of the motion data and units on the display unit in association with each of the plurality of different monitor items; a display module for a device that acquires a device value corresponding to a display target time from the log data based on time data stored as the log data, and displays the device value on the display unit; a playback control module that synchronizes a display target time in the unit display module with a display target time in the device display module; An engineering tool comprising:
Citation Information
Patent Citations
Magnetic head receding mechanism for magnetic recording and reproducing device
JP1989030079A
Event reproducing device
JP1994020180A
Sequence controller, data processor, data recording and reproducing method, and recording medium
JP1998011118A
Trouble analysis supporting device and simulation system
JP2000250775A
Facility logging device
JP2001125612A