Programmable logic controller system and engineering tool
The programmable logic controller system synchronizes and displays log and project data, addressing the challenge of manual association in existing systems, thereby enhancing the efficiency of identifying modification points in user programs.
Patent Information
- Application Number
- JP2025078167
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2038-10-23
AI Technical Summary
Existing programmable logic controller (PLC) systems require manual effort to associate log data with user programs, making it difficult to identify modification points in user programs due to the separation of software for viewing user programs and log data.
A programmable logic controller system with an engineering tool that synchronizes and displays log data and project data together, using a ladder execution engine, device memory, function execution engine, buffer memory, and a display module to associate device values with time-series motion data, allowing synchronized display of log and project data.
Enables efficient association and display of log and project data, reducing manual effort in identifying modification points within user programs.
Smart Images

Figure 2025109792000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an engineering tool for a programmable logic controller.
Background Art
[0002] A programmable logic controller (PLC) is a controller that controls manufacturing equipment, transfer devices, and inspection devices in factory automation. The PLC controls various expansion units and controlled devices by executing a user program such as a ladder program created by the user. When actually executing the user program on the PLC, an event that was not assumed during the creation of the user program may be found, and it may be necessary to modify the user program. In order to identify the modification points, the user not only reviews the user program but also refers to the log data generated by the PLC. The log data stores the values of devices (device values) collected when the user program is being executed. In the field of PLCs, a device means a storage area for storing information. Examples of devices include a relay device that holds one-bit information and a word device that holds one-word information. According to Patent Document 1, it has been proposed to log device values.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] By the way, the software for viewing user programs is independent of the software for viewing log data. Therefore, the user had to manually discover the device values at the time of trouble while viewing one of the log data, and further manually discover which part of the user program the device value was 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 is, for example, a ladder execution engine that repeatedly executes a ladder program, a device memory having a device that is a storage area referred to by the ladder execution engine based on the description of the ladder program, a function execution engine that executes a motion function for driving and controlling a motor connected to the outside based on a command from the ladder program, and a buffer memory that stores a plurality of different motion data updated by the execution of the motion function, a programmable logic controller comprising an engineering tool for the programmable logic controller, A programmable logic controller system having The engineering tool includes a display unit, a specifying unit that specifies a motion function among a plurality of different functions based on a user input via the display unit, a monitor item for monitoring the motion function specified by the specifying unit, a plurality of buffer memories corresponding to a plurality of different monitor items including any one of the coordinates, speed, and torque of the motor, and a log setting data including a list of a plurality of devices extracted from the ladder program and designated as a logging target list. A setting unit for creating having The programmable logic controller Motion data stored in a plurality of buffer memories specified by the logging target list, and device values stored in a plurality of devices specified by the logging target list are recorded in time series in association with time data regarding the collection time, and a recording unit; When a predetermined storage condition is satisfied, the motion data and device values in time series for a predetermined target period, and the associated time data recorded by the recording unit are read out and stored as log data, and a storage unit; having The engineering tool further A unit display module that acquires motion data corresponding to a display target time from the log data based on the time data stored as the log data, and displays a list on the display unit together with units associated 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 the time data stored as the log data, and displays it on the display unit; A playback control module that synchronizes the display target time in the unit display module and the display target time in the display module for the device. A programmable logic controller system characterized by the above.
Effect of the Invention
[0007] According to the present invention, it becomes possible to display log data and project data in association with each other.
Brief Description of the Drawings
[0008]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10A
Figure 10B
Figure 10C
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Figure 21
Figure 22
Figure 23
Figure 24
Figure 25
Figure 26
Figure 27
Figure 28
Figure 29
Figure 30
Figure 31
Figure 32
Figure 33
Figure 34
Figure 35A
Figure 35B
Figure 35C
Figure 35D
Figure 36A
Figure 36B
Figure 36C
Figure 37
Figure 38
Figure 39
Figure 40
Figure 41
Figure 42
Figure 43
Figure 44
Figure 45
Figure 46
Figure 47
Mode for Carrying Out the Invention
[0009] An embodiment of the present invention is shown below. The individual embodiments described below will be useful for understanding various concepts such as the upper concept, middle concept, and lower concept of the present invention. Also, the technical scope of the present invention is determined by the scope of the claims and is not limited by the following individual embodiments.
[0010] <System Configuration> First, to make the programmable logic controller (PLC, which may simply be called a programmable controller) better understood by those skilled in the art, the configuration and operation of a general PLC will be described.
[0011] FIG. 1 is a conceptual diagram showing a configuration example 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 flowchart format such as a ladder language or SFC (sequential function chart), or may be created using a high-level programming language such as C language. Hereinafter, 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 extension units 4. One or more extension units 4 are detachable from the basic unit 3. For example, the extension unit 4a may be a positioning unit that drives a motor (field device 10a) to position a workpiece, and the extension unit 4b may be a counter unit. The counter unit counts signals from an encoder (field device 10b) such as a manual pulsar. Note that the letters a, b, c,... attached to the end of the reference numerals may be omitted. The basic unit 3 may also be called a CPU unit. Note that the system including the PLC 1 and the PC 2 may be called a programmable logic controller system.
[0012] The basic unit 3 is provided with a display unit 5 and an operation unit 6. The display unit 5 can display the operation 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 devices in the PLC 1, error information generated in the PLC 1, and the like. A device refers to a name for an area on a memory provided for storing a device value (device data), and may be called a device memory. A device value is information indicating the input state from an input device, the output state to an output device, and the states of internal relays (auxiliary relays), timers, counters, data memories, etc. set in a user program. The types of device values are bit type and word type. A bit device stores a 1-bit device value. A word device stores a 1-word device value.
[0013] The expansion unit 4 is prepared 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, whereby 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. Also, a plurality of field devices may be connected to one expansion unit 4.
[0014] PC2 may be referred to as a program creation support device. PC2 is, for example, a portable notebook type 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 PLC1, is created using PC2. The created ladder program is converted into a mnemonic code within PC2. PC2 is connected to the basic unit 3 of PLC1 via a communication cable 9 such as USB (Universal Serial Bus), and sends the ladder program converted into a mnemonic code to the basic unit 3. The basic unit 3 converts the ladder program into a machine code and stores it in the memory provided in the basic unit 3. Here, although the mnemonic code is being sent to the basic unit 3, the present invention is not limited to this. For example, PC2 may convert the mnemonic code into an intermediate code and send the intermediate code to the basic unit 3.
[0015] Although not shown in FIG. 1, the operation unit 8 of PC2 may include a pointing device such as a mouse connected to PC2. Also, PC2 may be configured to be detachably connected to the basic unit 3 of PLC1 via a communication cable 9 other than USB. Further, PC2 may be configured to be wirelessly connected to the basic unit 3 of PLC1 without using 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 PC2 when creating a ladder program. PC2 displays a plurality of cells arranged in a matrix on the display unit 7. Symbols of virtual devices are arranged in each cell. The symbols indicate input relays, output relays, etc. A relay circuit is formed by a plurality of symbols. In the ladder diagram Ld, for example, cells of 10 columns × N rows (N is an arbitrary natural number) are arranged. And symbols of virtual devices are appropriately arranged in the cells of each row.
[0017] The relay circuit shown in FIG. 2 is composed of 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, which are appropriately combined.
[0018] The characters displayed above the symbols of each input device ("R0001", "R0002", and "R0003") represent the device names (address names) of the input devices. The characters displayed below the symbols of each input device ("Flag 1", "Flag 2", and "Flag 3") represent the device comments associated with the input devices. The character displayed above the symbol of the output device ("Home Return") is a label consisting of a character string representing the function of the output device.
[0019] In the example shown in FIG. 2, an AND circuit is formed by serially combining the symbols of two input devices corresponding to the device names "R0001" and "R0002" respectively. Also, an OR circuit is formed by parallely combining the symbol of the input device corresponding to the device name "R0003" with the AND circuit composed of the symbols of these two input devices. That is, in this relay circuit, the output device corresponding to the symbol in the first row turns on only when both of the input devices corresponding to the two symbols in the first row are on, or when the input device corresponding to the symbol in the second row is on.
[0020] <Program Creation Support Device> FIG. 3 is a block diagram for explaining the electrical configuration of PC2. As shown in FIG. 3, PC2 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] The user causes the CPU 21 to execute a computer program (editing software) stored in the storage device 22, and edits project data through the operation unit 8. The project data includes one or more user programs (e.g., ladder programs) and configuration information of the basic unit 3 and the expansion unit 4. The configuration information indicates the connection positions of a plurality of expansion units 4 to the basic unit 3, information indicating functions provided in the basic unit 3 (e.g., communication function and positioning function), and information indicating functions of the expansion unit 4 (e.g., photographing function). Here, editing of the project data includes creation and modification of the project data. The project data created using the editing software is stored in the storage device 22. Further, the user can read out the project data stored in the storage device 22 as needed and modify the project data using the editing software. The communication unit 23 is for communicably connecting the PC2 to the basic unit 3 via the communication cable 9. The CPU 21 transfers the project data to the basic 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 bit devices, word devices, etc., and each device stores a device value. The project storage unit 35 stores the 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 extension unit 4 are connected via a unit internal bus 90, which is a kind of extension bus. Note that 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 and the like to the PC 2, the cloud, etc. via the communication unit 33.
[0023] Here, a supplementary explanation will be given for the unit internal bus 90. This unit internal bus 90 is a bus on which input / output refresh and the like, which will be described later, are performed. The communication control on the unit internal bus 90 is realized by a so-called bus master 38 (note that a bus master may be provided as a part of the communication unit 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. It receives a communication request from the CPU 31 and performs communication such as input / output refresh, which will be described later, with the extension unit 4.
[0024] The expansion unit 4 includes a CPU 41 and a memory 42. The CPU 41 controls the field device 10 according to an instruction (device value) from the basic unit 3 stored in the device. Further, the CPU 41 stores the control result of the field device 10 in a device called a buffer memory. The control result stored in the device is transferred to the basic unit 3 by input / output refresh. Also, the control result stored in the device is transferred to the basic unit 3 according to a read instruction 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 for temporarily holding data (e.g., still image data or moving image 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 for refreshing input and output, program execution 202, and END processing 204. In the inter-unit communication 201, the basic unit 3 transmits the output data obtained by executing the ladder program from the storage device 32 in the basic unit 3 to an external device such as the expansion unit 4. Further, the basic unit 3 takes in the 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 values stored in the devices of the basic unit 3 are reflected in the devices of the expansion unit 4 by output refresh. Similarly, the device values stored in the devices of the expansion unit 4 are reflected in the devices of the basic unit 3 by input refresh. In this way, the devices of the basic unit 3 and the expansion unit 4 are synchronized by input and output refresh. Note that a mechanism (inter-unit synchronization) for updating device values between units at timings other than refresh may be adopted. However, the devices of the basic unit 3 are rewritten by the basic unit 3 at any time, and similarly, the devices of the expansion unit 4 are 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 devices inside the basic unit 3. Similarly, the devices of the expansion unit 4 can be accessed at any time by the devices inside the expansion unit 4. Basically, the device values are updated and synchronized with each other at the timing of refresh between the basic unit 3 and the expansion unit 4. 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, a plurality of program modules or ladder programs may be executed in order according to the project data. The basic unit 3 performs arithmetic processing on data by executing the program. The END processing means all processes related to peripheral services such as data communication with external devices such as the display (not shown) connected to the PC 2 and the basic unit 3, and system error checking.
[0026] In this way, PC2 creates a ladder program according to the user's operation and transfers the created ladder program to PLC1. PLC1 takes input / output refresh, execution of the ladder program, and END processing as one cycle (one scan), and repeats this cycle periodically, that is, cyclically. Thereby, various output devices (such as motors) are controlled based on the timing signals from various input devices (such as sensors). In addition to the scan cycle, the basic unit 3 and the expansion unit 4 each have an internal control cycle. The basic unit 3 and the expansion unit 4 control functions such as the field device 10 based on the internal control cycle.
[0027] <Logging> When the user improves or modifies the user program, the device values obtained when PLC1 is executing the user program may be useful. Therefore, PLC1 acquires the device values specified in advance and creates log data. Here, the devices managed by PLC1 include not only those used by the user program but also those not used by the user program. Also, there are devices that are useful and devices that are not useful when the user program is improved or modified. Generally, the number of devices reaches several thousand, so it has been a heavy burden for the user to specify the necessary devices. Therefore, PC2 analyzes the user program and extracts the devices used or described in the user program as the logging targets. Thereby, the burden on the user is reduced.
[0028] If all the devices managed by PLC1 are targeted for logging, the scan time will become long. This is because logging is executed as one of the user programs or during input / output refresh. Sometimes, due to the delay caused by logging, the user program may not operate as expected by the user. Therefore, the number of devices targeted for logging should be appropriately maintained.
[0029] A user program may be composed of a plurality of program components (e.g., program modules (main ladder program and sub ladder program), function blocks). Among these, it may be sufficient for the user if devices related to the program components that the user wishes to modify are logged. Also, among the plurality of program components, the user may wish to exclude a specific program component from the extraction target or add a specific program component to the extraction target. Therefore, it would be convenient for the user if devices can be added or deleted from the logging target in units of program components.
[0030] As described above, the basic 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 devices can be added or deleted from the logging target in units of these functions. For example, when an undesirable event related to the communication function of the basic unit 3 occurs, the user can easily resolve this event by referring to the device values of the devices related to the communication function of the basic unit 3.
[0031] ●Logging settings (automatic extraction and addition / removal) FIG. 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 a hardware circuit such as an ASIC or an 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 may be realized on the PLC 1.
[0033] The project creation unit 50 displays a UI for creating project data 71 on the display unit 7, creates the project data 71 according to the user instructions input from the operation unit 8, and stores it in the storage device 22. UI is the abbreviation of user interface. The project data 71 includes a user program, configuration information of the PLC 1, etc. The program creation unit 63 creates a plurality of program components (each module) that make up the user program based on user operations via the UI. The function setting unit 62 executes settings related to the functions of the basic unit 3 and the extended unit 4. For example, the function setting unit 62 assigns any device to the function provided in the basic unit 3, or assigns any device to the function provided in the extended unit 4, and writes allocation information indicating the relationship between the function and the device into the configuration information. Note that the project creation unit 50 also stores, as project data 71, program configuration information indicating what program components the user program is composed of. The unit configuration information indicating what units the entire PLC 1 is composed of is also stored as project data 71.
[0034] The log setting unit 51 extracts the 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 logging targets. The log setting unit 51 has various functions. The component specifying unit 52 specifies the program components to be the extraction targets of the devices according to the user instructions input from the operation unit 8. Also, the component specifying unit 52 specifies the program components to be excluded from the extraction targets of the devices according to the user instructions input from the operation unit 8.
[0035] The device extraction unit 53 extracts the devices described in the project data 71 by analyzing the project data 71, and creates log setting data 72. The addition unit 54 analyzes the program parts specified as extraction targets by the part specification unit 52, extracts the devices described in the program parts, and adds them to the extraction list. The deletion unit 55 analyzes the program parts specified as exclusion targets by the part specification unit 52, extracts the 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 merge unit 56 deletes the devices that are extracted repeatedly from among the devices extracted from the plurality of program parts from the extraction list. The specification unit 57 detects an instruction word for the memory card in the project data 71, specifies the device targeted by the instruction word, and adds the specified device to the extraction list.
[0036] In the present embodiment, after the part specification unit 52 specifies a program part, the addition unit 54 analyzes the specified program part to extract and add the devices to be logged. However, the present invention is not limited to this. For example, the addition unit 54 may first analyze one or more program parts included in the project data 71 to extract devices, add the extracted devices to the extraction list, and then extract the devices described in the program parts specified by the part specification unit 52 and add this to the extraction list.
[0037] Similarly, the deletion unit 55 may first analyze one or more program parts included in the project data 71 to create an extraction list, and then extract the devices described in the program parts specified by the part specification unit 52 and delete this from the extraction list.
[0038] In the present embodiment, for convenience of explanation, the addition unit 54 and the deletion unit 55 are separated, but it goes without saying that they may be a single functional block.
[0039] The manual setting unit 58 adds one device or a related series of devices to the extraction list according to a user instruction input through the operation unit 8. The estimation unit 59 estimates the influence of the recording of device values by the PLC 1 on the execution of the 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 is added to the scan time by logging. 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 on the display unit 7 as an estimation result. This delay time may be called an increase in the scan time.
[0040] The function specifying unit 60 specifies the functions of the basic unit 3 and the expansion unit 4 that are extraction targets of devices according to a user instruction input from the operation unit 8. Further, the function specifying unit 60 specifies the functions of the basic unit 3 and the expansion unit 4 that are excluded from the extraction targets of devices according to a user instruction input from the operation unit 8. The addition unit 54 analyzes the configuration information of the functions specified as extraction targets by the function specifying unit 60, extracts the devices assigned to the functions according to the configuration information, and adds them to the extraction list. The deletion unit 55 analyzes the configuration information of the functions specified as exclusion targets by the function specifying unit 60, extracts the devices assigned to the functions according to the configuration information, and deletes the extracted devices from the extraction list. The merge unit 56 deletes the devices that are extracted repeatedly from the extraction list among the devices extracted for each of the plurality of functions. The specifying unit 57 detects an instruction word for the memory card in the project data 71, specifies the device targeted by the instruction word, and adds the specified device to the extraction list.
[0041] The log display unit 61 reads 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 display, on the display unit 7, by associating the device values recorded in the log data 73 with the program components of the project data 71. The log display unit 61 forms the core of an engineering tool for programmable logic controllers.
[0042] Figure 7 is a flowchart showing a logging setting method. Here, it is assumed that the project data 71 including the user program is already complete.
[0043] In S1, the CPU 21 (component specifying unit 52) accepts the specification of the program component to be the extraction target of the device.
[0044] Figure 8 shows the UI 100 for accepting the selection of the program component from which the device is to be extracted. When the 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 components are shown in a tree form based on their respective classifications (module / function block / macro). Also, a check box 102 is associated with each program component and displayed. When the pointer 101 gives a check to the check box 102 according to the operation of the operation unit 8, the addition unit 54 adds the program component corresponding to the checked check box 102 to the extraction list. On the other hand, when the pointer 101 removes the check from the check box 102 according to the operation of the operation unit 8, the deletion unit 55 deletes (excludes) the program component corresponding to the unchecked check box 102 from the extraction list.
[0045] Note that in Fig. 8, the per-scan module is a program component that is executed once every time the user program is scanned once. In this example, the per-scan module has a main program and sub-modules. 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 every time inter-unit synchronization is performed. Although the initialization module is not shown, the initialization module is the module that is first executed when the user program is started. Therefore, since the initialization module is less likely to be the cause of trouble, it may be excluded from the device extraction target.
[0046] The function block (FB) is called and used by the user program. Since the function block is called from multiple modules, individual instances are generated for each. In this case, multiple instances may each 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, such as a macro for data formatting.
[0048] At S2, the CPU 21 (function specifying unit 60) receives the specification of the function to be the device extraction target.
[0049] FIG. 9 shows a UI 110 for receiving selection of functions to be extracted for the device. When the logging setting program is started, the logging setting unit 51 displays the UI 110 on the display unit 7. Note that the UI 100 and the UI 110 may be displayed simultaneously, or may be selectively displayed according to user operations. In the UI 110, a plurality of functions are shown in a tree form 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 addition 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 deletion unit 55 deletes (excludes) the function corresponding to the unchecked check box 102 from the extraction list.
[0050] In FIG. 9, the communication error monitor, which is a function of the basic unit 3, is a function for monitoring communication errors of the communication unit 33. The sensor I / O monitor is a function for monitoring the input / output of sensors. The motion unit is also called a positioning unit and controls the position of a control target called an axis. Generally, there is a drive source such as a motor for each axis. The analog input unit is a unit that samples an input analog signal and converts it into a digital signal. The unit monitor is a function for monitoring the operations of expansion units 4 such as the motion unit and the analog input unit.
[0051] Here, as an example of the unit monitor, the unit monitor for the motion unit will be described in more detail. FIG. 10A is a schematic diagram of a screen of the unit monitor 440 for axis 1 of the motion unit. FIG. 10B is a schematic diagram of a setting screen 441 for changing the monitoring target 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 the monitoring targets by the unit monitor 440. A buffer memory (UG) is allocated to each item. For example, UG4 and UG5 are allocated to the current coordinates. In this embodiment, 16 bits are reserved for one UG, and two UGs are reserved to represent the current coordinates in 32 bits. The device value of the UG is a numerical value such as 0PLS (pulse), for example. Also, UG8 and UG9 are allocated to the command coordinates. The reason for reserving two UGs is the same as described above (to ensure 32-bit representation). Since the allocation of UGs can be freely performed by the unit designer, there are also some unused UGs (UG6 and UG7). Similarly, UG10 and UG11 are allocated to the current speed, and UG12 and UG13 are allocated to the command speed, respectively. In addition, in FIG. 10A, UGs are allocated 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 item is to be monitored by the unit monitor 440. For example, by selecting one item from the "Non-display" column 442 shown in FIG. 10B and clicking the right arrow button 443, that one item moves to the "Display" column 444 and becomes the monitoring target by the unit monitor 440. By clicking the OK button 445, the items listed in the "Display" column 444 are determined as the monitoring targets. Note that in FIGS. 10A and 10B, only the axis 1 of the motion unit is described, but the same applies when there are multiple axes such as axis 2 and axis 3. For each axis, the item selected by the user becomes the monitoring target.
[0054] Generally, when driving a motor (field device 10a) using a motion unit (expansion unit 4a) to position a workpiece, the basic unit 3 sends an operation start command to the expansion unit 4a by turning on a relay device indicating a positioning start trigger for the motor. After sending the operation start command, it does not participate in the specific processing operations (workpiece positioning) in the expansion unit 4a. In other words, the basic unit 3 does not recognize the current position and current speed of the motor in real time one by one, nor is it necessary to recognize them one by one. After that, when the processing operations in the expansion unit 4a are completed, the basic unit 3 recognizes the completion of the motor positioning through the relay device indicating the positioning completion trigger for the motor being turned on. From this, the device (UG) corresponding to the current coordinates and current speed of the motor is basically not described in the ladder program (however, it is possible for the user to describe special instruction words for reading out a very small part of the UG in the ladder program).
[0055] However, when a trouble occurs during the operation of the PLC, in order to investigate the cause, it may be necessary to grasp the current coordinates and current speed of the motor at the time when the trouble occurs. In such a case, as described above, since the current coordinates and current speed of the motor are basically not described in the ladder program, they are often not listed in the extraction list for logging targets, and it has not been easy to investigate the cause.
[0056] Therefore, in this embodiment, the user can select the unit monitor of the motion unit through the UI110 shown in FIG. 9. As a result, the additional unit 54 can 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 applies to the communication error monitor and 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 targets of monitoring by each monitor can be automatically added to the extraction list.
[0057] Although the illustration of other monitors is omitted, they will be briefly described. The communication error monitor, which is a function of the basic unit 3, monitors, for example, devices assigned to cyclic communication opening time-out errors. The sensor I / O monitor that monitors the input / output of sensors monitors, for example, the outputs of one or more sensors and devices assigned to the presence or absence of errors. The unit monitor of the analog input unit monitors, for example, devices (DM or R) assigned to various parameters such as AD conversion data, special data, offset values, zero shift, peak values, and bottom values. These devices are assigned in advance as defaults (initial settings) by the unit designer, but like the unit monitor of the motion unit described above, the monitoring target may be changed by the user. In short, the UI110 shown in FIG. 9 is a setting screen capable of receiving a function selection input from the user. And for each selected function, a template (setting information) that determines the monitoring items to be displayed on the display unit (monitor) is associated (the template is stored in the memory). The devices specified by the template may be those assigned in advance as defaults as described above, or those after the user adds or removes (edits) them via the setting screen. When the function specifying unit 60 selects one or more functions based on a user operation, it adds the devices to be monitored to the extraction list according to the template associated with the function.
[0058] In S3, the device extraction unit 53 analyzes the program component specified by the component specifying unit 52 and extracts the devices described in the specified program component.
[0059] Figure 10C shows an example of a device extracted from a specified program component among a plurality of program components included in the project data 71. According to Figure 10C, the name of the program component from which the device is extracted, the name (device number) of the first device, the number of devices extracted based on the first device, and the device name actually extracted as the logging target are shown. Generally, a number of devices corresponding to the specified number are extracted based on the first device. However, a number of devices exceeding the specified number may also be extracted. R34000 is a relay device and a device that holds 1-bit information, but a series of 16 devices from R34000 to R34015 are extracted. This is because it is more advantageous in terms of data processing speed to log the devices for 16 bits together. In Figure 10C, the number of R34000 is "1", which indicates 1 word (16 bits). Also, the number of CR4001 is also "1", which also indicates 1 word (16 bits of CR4001, CR4002, ···, CR4015, CR4100). Global refers to a device commonly used by a plurality of program components. Main indicates the main program. first_operation is the name of a function block. Sub indicates a subprogram (submodule).
[0060] In S4, the device extraction unit 53 analyzes the configuration information of the function specified by the function specification unit 60 and extracts the devices associated with the function in the configuration information.
[0061] FIG. 11 shows an example of a device extracted from a specified function (unit) among a plurality of functions (basic unit 3 and expansion unit 4) provided in the PLC1. In this example, several buffer memories (UGs) are extracted from the motion unit specified by the function specifying unit 60. According to FIG. 11, the name of the function from which the device is 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 the logging target are shown. Here, the 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. The description of other UGs is omitted.
[0062] In S5, the manual setting unit 58 adds the device manually specified by the user through the operation unit 8 to the extraction list. For example, the manual setting unit 58 may display a UI on the display unit 7 that allows direct input of the device number and the like to assist the user in specifying the device.
[0063] In S6, the merge unit 56 merges the devices extracted from the program components, the devices extracted from the functions, and the devices added manually to create a logging target list. The logging target list may be called a device list.
[0064] Figure 12 is a diagram for explaining the concept of merge processing. The device extraction unit 53 creates an extraction list L1 that describes the devices extracted from the program components. The device extraction unit 53 creates an extraction list L2 that describes the devices extracted from the functions. The device extraction unit 53 creates an extraction list L3 that describes the devices manually added by the user. The merge unit 56 merges the extraction lists L1 to L3 to create a logging target list L0. There may be devices that are extracted repeatedly in the extraction lists L1 to L3. If the same device is logged multiple times, the log data will grow large. Therefore, merge processing is executed to avoid duplicate logging of the same device. For example, in the extraction list L1, data memories DM0 - DM100, which are a type of device, are registered. Also, in the extraction list L3, data memories DM50 - DM200 are registered. That is, DM50 - DM100 are duplicates. The merge unit 56 merges DM0 - DM100 and DM50 - DM200 and describes DM0 - DM200 in the logging target list L0.
[0065] In S7, the estimation unit 59 analyzes the logging target list L0, estimates the impact on the scan time, and displays the estimation result on the display unit 7.
[0066] Figure 13 shows a UI140 for displaying the estimation result. The UI140 displays the device size and the growth of the scan time. The device size indicates the total size of the devices described in the logging target list L0. The growth of the 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 growth of the scan time. When the list button 141 is operated through 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 finalize or adjust the logging target list L0. When finalizing the logging target list L0, the user may operate a button indicating the intention to finalize with the pointer 101.
[0067] In S8, the log setting unit 51 determines whether to determine the logging target. For example, when a button for determining the logging target list L0 is operated, the log setting unit 51 determines that the logging target is to be determined. 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 the addition or deletion of program components and functions to be extracted by the device, and modifies the logging target list L0. For example, when the increase in scan time exceeds the allowable threshold, some devices are deleted. If the increase in scan time is less than the allowable threshold, some devices may be added. When the logging target is determined, 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. Note that the CPU 21 controls the communication unit 23 to transmit the log setting data 72 to the basic unit 3 together with the project data 71.
[0069] Here, mainly devices such as data memories and buffer memories are targeted for logging, but the operating state of each function and the function setting state (e.g., IP address, etc.) may also be added as logging targets.
[0070] FIG. 14 shows a filter setting UI 120 used in the extraction process of the device. As devices related to the PLC 1, there are multiple types of devices. The user may focus on a specific type of device and may want to ignore other types of devices. Therefore, the log setting unit 51 may display the filter setting UI 120 on the display unit 7 and receive, through the check box 102, the device type to be extracted and the device type to be excluded. For example, the device extraction unit 53 extracts the device type checked in the check box 102 from the program components and functions. The device extraction unit 53 does not extract the device type unchecked from the check box 102 from the program components and functions. This makes it possible to selectively choose the 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 finally written to the PLC 1, by executing the device extraction process using this write as a trigger, the number of executions of the device extraction process will be reduced.
[0072] The device extraction unit 53 is implemented in the PC 2, but may also be implemented in the basic unit 3. The CPU 31 extracts devices from the program components and functions specified by the PC 2 in the project data 71 and creates the 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 device extraction process from the program components 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 expansion unit 4.
[0073] In S11, the device extraction unit 53 obtains the device number from the description of the i-th step of the program component 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 001st step, when the relay device MR000 is turned on, the relay device R34000 that gives operation permission to the motion unit is turned on, and the relay device 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 the 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 the program that substitutes the indirect reference destination or index value, and specifies the actual device number. Note that if the device extraction unit 53 fails to extract the actual device number, it may display a message indicating the extraction failure on the display unit 7. Furthermore, the device extraction unit 53 may display a UI for allowing the user to input the actual device number on the display unit 7 and accept the user input. Furthermore, considering the above-described indirect reference and index reference, the device extraction unit 53 not only extracts a specific device directly described in the program, but also extracts a specific device used in the program (such as a device 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. Depending on the instruction word, there are those that take as arguments the device number of the first device and the number of devices based on the first device. For example, it is described that when the relay device MR000 is turned on at step 003, the instruction word FMOV is executed. In this example, FMOV is an instruction word (an instruction word for initializing related devices) for substituting the specified value (0) into the specified number (10) of devices based on the first device (@EM0). That is, 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. Note that the access range may be described by indirect reference or index reference. In this case, the device extraction unit 53 searches for the program that substitutes the indirect reference destination or index value, and specifies the actual access range. Note that 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. Further, the device extraction unit 53 may display a UI for allowing the user to input the actual access range on the display unit 7 and accept 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, from step 001, MR000, R34000, and R34005 are extracted and added to the extraction list. From step 003, @EM0 to @EM9 are extracted and added to the extraction list.
[0076] In S14, the device extraction unit 53 determines whether the analysis of devices for the specified program component has been completed up to the program end. If the analysis of devices has not been completed up to the program end, the device extraction unit 53 proceeds to S15. In S15, the device extraction unit 53 increments the variable i by 1 and returns to S11. If the analysis of devices has been completed up to the program end, 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 and later will be briefly described below.
[0078] Steps 004 and 005 are requests for the motor to return to the origin (operation), and R34310 is a relay device indicating the origin return start trigger of the motor. From this step, devices MR001, R34310, R40905, R40910, and R34310 are extracted.
[0079] Steps 006 to 008 are processes for determining whether the origin return of the motor is completed correctly by reading the origin return completion code from the motion unit when the origin return of the motor is completed. More specifically, R40910 is a relay device indicating the origin return completion trigger of the motor. The basic unit 3 does not recognize the specific processing operations of the origin return in the motion unit in real time one by one, and determines whether the origin return is completed by monitoring whether this flag R40910 is ON. When this flag R40910 is ON, the UREAD instruction for directly reading the buffer memory is executed. The UREAD instruction shown in Fig. 16 is an instruction to read the buffer memory at address 4060 in the unit numbered 1 and assign one word to the device @EM0. Here, the origin return completion code is stored in the buffer memory at address 4060, and when the origin return is normally completed, 0 is stored, and when the origin return is abnormally terminated, a numerical value other than 0 (such as 1 or 2) is stored. Then, as shown in step 007, when the device value of @EM0 is other than 0, the basic unit 3 sets the device MR000 and recognizes that the origin return has terminated abnormally. On the other hand, as shown in step 008, when the device value of @EM0 is 0, the basic unit 3 sets the device MR001 and recognizes that the origin return has been completed normally. From this step, devices R40910, @EM0, @MR000, and @MR001 are extracted.
[0080] Step 009 is a process of waiting for 1 second when the return to the origin is completed normally. Device T0 has a set value of 10 (equivalent to 1 second since it is in 100 ms units) and the current count value, and it turns ON when the count value reaches the set value. From this step, devices MR001 and T0 are extracted.
[0081] Finally, in steps 010 - 011, when device T0 turns ON, the function block "First_operation" is executed for unit number 1. Then, the execution result is stored in @MR002, and the completion code is stored in @EM1. From this step, devices @MR002 and @EM1 are extracted.
[0082] As detailed above using Figure 16, in a general ladder program, only devices corresponding to the start of operation, such as servo ON of the axis, origin return request, activation and results of function blocks, and devices corresponding to the completion of operation are described. However, when a trouble occurs, information on the state during operation (such as the current coordinates and current position of the motor) is useful for investigating the cause. Therefore, UG, which is the object of monitoring by the unit monitor as described above, is also automatically added to the extraction list.
[0083] This extraction process is executed for each of the specified program components.
[0084] ● Execution of logging Figure 17 shows the functions of CPU31 of basic unit 3. Some or all of these functions may be realized by hardware circuits such as ASICs and FPGAs. 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 includes a ladder execution engine 80a that repeatedly executes the user program, and a unit control unit 80b that controls the ladder execution engine 80a and executes input / output refreshing with the expansion unit 4. The ladder execution engine 80a of the execution unit 80 repeatedly executes the user program included in the project data 71 and controls the expansion unit 4 according to the user program. Note that the ladder execution engine 80a of the execution unit 80 writes device values to the output devices held in the basic unit device unit 34a of the device unit 34 or reads device values from the input 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 device values related to the expansion unit acquired by input / output refreshing to and from the expansion unit device unit 34b. The basic unit and the expansion unit are electrically connected by a unit internal bus, and the unit control unit 80b has a function of performing communication control on this unit internal bus, that is, a function as a so-called 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 how the entire PLC 1 is composed of which units.
[0087] The recording unit 81 acquires device values from the device unit 34 (basic unit device unit 34a or expansion unit device unit 34b) according to the log setting data 72 or acquires device values from the buffer memory of the expansion unit 4, and writes them as log data 73 to a memory (for example, a ring buffer). As described above, the recording unit 81 executes logging processing at the time of END processing or the like.
[0088] The logging process in the END process will be described in more detail. As described with reference to FIGS. 10C and 11, the log setting data 72 includes devices described in the program components specified by the component specifying unit 52 and devices assigned to the functions specified by the function specifying unit 60 (for example, the targets to be monitored by the unit monitor) as the logging targets. For the former devices, log data 73 is written during the END process, while for the latter devices, during the END process, the device values of the target devices (UGs) are read from the extended unit 4 and written to the log data 73.
[0089] Here, the update cycle (so-called control cycle) of the current coordinates and command coordinates of the motor is much shorter than the scan cycle of the ladder program. Therefore, in the present embodiment, since the device values of the UGs are read in synchronization with the scan cycle, not all of the current coordinates and command coordinates are written to the log data 73. However, the present invention is not limited to this. For example, it is also possible to configure the memory of the extended unit 4 to store the current coordinates and command coordinates for each control cycle and read out a plurality of the current coordinates and command coordinates stored so far at the timing of the scan cycle.
[0090] In addition, the recording unit 81 assigns the 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 time series 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, the rewriting of the device value from an external device to any of the devices included in the device unit 34. Generally, the device value can be rewritten according to the user program and may also be rewritten by an external device. Such rewriting cannot be grasped in advance only by analyzing the user program. The recording unit 81 may add the device whose device value has been detected by the detection unit 82 as a logging target. Generally, the rewriting of the device value from an external device is likely to cause an unexpected event for the user. Therefore, the recording unit 81 logging the device value rewritten by the external device will be helpful for the user to improve the program.
[0092] By the way, in the END process, a UG read instruction that is issued independently of the user program may be issued. UG is a device type indicating a buffer memory. The detection unit 82 may detect a UG read instruction that is issued independently of the user program. The recording unit 81 may identify the buffer memory targeted by the UG read instruction detected by the detection unit 82 and add the identified buffer memory as a recording target. When this expansion unit 4 is a motion unit, torque values, current coordinate positions, etc. are stored in such a buffer memory.
[0093] The detection unit 82 may be implemented by an FPGA or the like. The execution unit 80 may be implemented by an ASIC. In this case, the execution unit 80 specifies the address of the device to be read / written with respect to the storage device 32 using the address line. Therefore, the detection unit 82 may dynamically detect the 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 of the device unit 34 and write this device value and the device name (device number) to the log data 73. This method will be useful when adding, as a recording target, a device that is not described in the user program and can be dynamically allocated.
[0095] As described above, 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 can obtain the log data 73 without creating the log setting data 72. For example, when the execution unit 80 is activated, the execution unit 80 acquires device values from all the devices in the device unit 34. Since the detection unit 82 is monitoring the devices, the detection unit 82 detects that the execution unit 80 has read a device value and transmits information (address information) of the device from which the device value has been read to the recording unit 81. The recording unit 81 reads device values from all the 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 value.
[0096] Incidentally, the recording unit 81 may write device values to the log data 73 for each scan cycle or for each predetermined collection cycle. For example, even if the detection unit 82 detects accesses to a device multiple times within one cycle, the recording unit 81 may write only the device value at the time when the last access is detected to the log data 73. Thereby, it becomes possible to reduce the data size of the log data 73.
[0097] The execution unit 80 may have a cache for holding devices. In this case, the detection unit 82 may detect a device write 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 according to the user program. When the detection unit 82 is implemented in the execution unit 80, when the execution unit 80 detects an instruction word for rewriting 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 the time stamp (the time when the device value was acquired) to the log data 73.
[0101] Incidentally, the log setting data 72 may include the data format of the log data 73 (e.g., binary format or text format). As the data format, decimal 16 bits, decimal 32 bits, ±decimal 16 bits, ±decimal 32 bits, hexadecimal 16 bits, hexadecimal 32 bits, character string, Float, DoubleFloat, etc. may be set for each device. Such a data format can be determined by analyzing the instruction words in the program components.
[0102] When the execution of the user program is completed, or when a save trigger relay to the memory card is turned ON, etc., when a predetermined output condition is satisfied, the output unit 84 writes the project data 71, log data 73, and 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 deleted 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 mounted on the mounting part of the PC 2. As a result, the log data 73 is displayed on the display unit 7 of the PC 2. Note that the output unit 84 may transmit the log data 73 to the PC 2, the cloud, etc. via the communication unit 33.
[0103] In this embodiment, when a predetermined output condition is satisfied, the log data 73 etc. are written to the memory card 36. However, the present invention is not limited to this. For example, it may be stored in the internal memory 37 (non-volatile memory such as a flash memory or a hard disk). Also, at least for the log data 73, it is necessary to be stored in the memory card 36 or the internal memory 37 when a predetermined output condition is satisfied, while for the project data 71, it is not limited to when a predetermined output condition is satisfied. For example, it may be stored in the memory card 36 or the internal memory 37 in advance at the timing when the PLC 1 changes from the setting mode (PROGRAM mode) to the operation mode (RUN mode).
[0104] ● Creation of configuration information FIG. 18 is a diagram for explaining the creation process (unit setting) of configuration information executed by the function setting unit 62. The function setting unit 62 may be called a unit editor. When the function setting unit 62 is supported to start the unit editor, it displays the unit setting UI 150 on the display unit 7. The name column 151 is a column for displaying the name of each unit (e.g., model number, etc.). Note that each unit is automatically assigned a unit number. In this example, "0" is assigned as the unit number to the basic unit 3. The input area column 152 is a column for allocating input system devices. In this example, devices from R000 to R015 are allocated as input system devices to the basic unit 3. The output area column 153 is a column for allocating output system devices. In this example, devices from R500 to R507 are allocated as output system devices to the basic unit 3. The occupied area column 154 is a column for allocating input / output mixed system devices. The end unit is a so-called terminal unit. The user sets the type, connection order, and allocated devices of the expansion unit 4 through the operation unit 8. The function setting unit 62 stores information indicating the type, connection order (unit number), and devices allocated 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, devices are allocated for each unit, but devices may also be allocated for each function of each unit. The function setting unit 62 manages the configuration information as part of the project data 71.
[0105] Thus, the configuration information includes information indicating the devices allocated to each unit and information indicating the devices allocated to each function. Therefore, the device extraction unit 53 can extract the devices allocated to each unit and the devices allocated to each function by referring to the configuration information.
[0106] <Logging of Large-Capacity Data> There is a camera as the field device 10. The user may wish to improve the user program while acquiring the state of the work or the control target by the camera and comparing the image with the device value. Therefore, the problem becomes how to manage the mutually related image and device value. This is because the image is generally acquired by the extension unit 4 and the device value is generally acquired by the basic unit 3. Furthermore, it is common for the acquisition cycle of the image and the acquisition cycle of the device value to be different. Due to such circumstances, the problem becomes how to link and manage large-capacity data such as images and relatively small-capacity data such as device values.
[0107] FIG. 19 shows the functions 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 values specified by the log setting data 72 from 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 and the time information and stores them in the ring buffer 91a. Note that the collection unit 92a acquires the device value and the time information every collection period (e.g., scan period) specified by the log setting data 72 and stores them in the ring buffer 91a. The reason for adopting the ring buffer 91a is that not all the data stored in the ring buffer 91a is saved as the log data 73 to the memory card 36. For example, when a predetermined save condition is satisfied, the save 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 to the memory card 36. Similarly, when a predetermined save condition is satisfied, the save unit 93 may read out the large-capacity data and the time information from the extension unit 4, create the log data 73, and save it to the memory card 36. The save unit 93 stores the above-described device value and time information and the above-described large-capacity data and time information in association with each other. Here, the “associated” storage means that it is sufficient if it is stored in a form that is easy to reproduce on the PC 2. For example, file management associating a plurality of files may be performed. Specifically, in the memory card 36, if a first subfolder storing the device value and the time information and a second subfolder storing the large-capacity data and the time information are placed under a specific folder, the path (directory path) up to the specific folder becomes a common flag, and using this common flag, it becomes possible to “associate” and save the files in the first subfolder and the files in the second subfolder. Also, if there is another folder placed at the same level (directory) as the above-described specific folder, that other folder means a data package saved at another timing. Of course, subfolders similar to the above are also placed under this other folder.In this way, the storage unit 93 may store the above-described device values and time information, and the above-described data (large-capacity data) and time information, in a plurality of files identified by a common flag (predetermined directory path), and store these plurality of files. Additionally, for example, by adopting a file name as the common flag and generating files with the same or corresponding file names, it is also possible to store them "in association". For another example, by using time information as a key, associating and listing device values and data (large-capacity data), and collecting them into one file, it is also possible to store them "in association". In this embodiment, large-capacity data is considered as an example of data from the monitoring device, but it goes without saying that other 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 a PC 2, the cloud, or the like. When the ring buffer 91a is full, the collection unit 92a overwrites the oldest information held in the ring buffer 91a with the newest information.
[0108] Here, the ring buffer 91a is adopted as an example of the buffer, but this is just an example. A FIFO-formatted buffer would be sufficient as the buffer.
[0109] FIG. 20 is a diagram for explaining the functions of the CPU 41 of the extension 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 at the time of 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 time information. When a predetermined collection condition (e.g., a predetermined relay device is turned on) is satisfied, the collection unit 92b outputs a trigger signal, for example, periodically. The time management unit 83b acquires the time information at the time 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 extension unit 4. The connection port 97 periodically outputs the trigger signal issued by the collection unit 92b to the camera 98, or outputs the image data output by the camera 98 to the image reception unit 96a. The image data is an example of large-capacity data. The connection port 97 is an example of a second external interface connected to a monitoring device such as the camera 98 and receiving data (image data) from the monitoring device. The image reception unit 96a is all or part of the function execution unit 96 that executes an imaging function accompanied by the input of image data from the camera 98 via the connection port 97. In the present embodiment, the function execution unit 96 (image reception unit 96a) controls 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 with desired parameter values on the PC 2 and sent to the function execution unit 96 via the communication unit 33 and the 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 receives setting information from an external setting device such as the PC 2 or a display. Note that the communication unit 33 as the first external interface also receives the user program created on the PC 2 as described above. The camera 98 executes imaging according to the trigger signal and outputs image data. The image reception unit 96a transfers the image data to the collection 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 reception 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. In this embodiment, the collection unit 92b automatically and periodically outputs an imaging trigger signal to the camera 98. However, 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 a command from, for example, a user program.
[0110] Incidentally, the basic unit 3 communicates with the extension unit 4 using any one of a refresh communication executed for each scan, a direct communication that can be executed at any time, and a message communication that is executed event-driven. The storage unit 93 reads out the image data and the time information from the ring buffer 91b of the extension unit 4 using, for example, direct communication and appends them to the log data 73. Note that a plurality of direct communications with priorities may be implemented as the direct communication. In this case, the priority of the direct communication executed in relation to the user program may be set relatively high, and the priority of the direct communication for logging may be set relatively low. Thereby, it is possible to reduce the influence of logging on the execution of the user program.
[0111] <Logging Using Ring Buffer> FIG. 21 shows the device value and the time information held in the ring buffer 91a of the basic unit 3. One record has the acquired device value and the time information indicating the time when this device value was acquired.
[0112] FIG. 21 further shows the image data and the time information held in the ring buffer 91b of the extension unit 4. One record has the acquired image data and the time information indicating the time when this image data was acquired.
[0113] Figure 22 shows the logging using the ring buffer 91a in the basic unit 3.
[0114] In S21, the CPU 31 (collection unit 92a) determines whether the acquisition condition of the device value is satisfied. The acquisition condition is a condition for starting the 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 has turned on), or may be described in the log setting data 72. When 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 extended unit 4 to store data in the ring buffer 91b.
[0116] In S23, the CPU 31 (collection unit 92a) determines whether the acquisition timing of the device value has arrived. The acquisition timing is, for example, every scan cycle (e.g., acquired in the END process for each 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 the save timing has arrived. The save timing is the timing to save the information held in the ring buffer 91a to the log data 73. The save timing may be, for example, when a predetermined event (e.g., save trigger) occurs. 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] At S26, the CPU 31 (collection unit 92a) stores the information held in the ring buffer 91a in the log data 73. Note that, among the information held in the ring buffer 91a, the information to be stored may be defined by the log setting data 72. For example, the information to be stored may be the information acquired until a predetermined time has elapsed since the timing when a certain event occurred. Also, the information to be stored may be the information acquired from the start time, which is a time a predetermined time before the timing when a certain event occurred, to the end time, which is a time when a predetermined time has elapsed since the timing when the event occurred.
[0120] At S27, the (collection unit 92a) stores 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 using direct communication. More specifically, the collection unit 92a may issue an instruction to read information from the buffer memory. Note that, among the information held in the ring buffer 91b, the information to be stored may also be defined by the log setting data 72. For example, the information to be stored may be the information acquired until a predetermined time has elapsed since the timing when a certain event occurred. Also, the information to be stored may be the information acquired from the start time, which is a time a predetermined time before the timing when a certain event occurred, to the end time, which is a time when a predetermined time has elapsed since the timing when the event occurred.
[0121] At S28, the (collection unit 92a) determines whether the end condition is satisfied. The end condition is the end condition for logging. 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 expansion unit 4.
[0123] In S31, the CPU 41 (collection unit 92b) determines whether the acquisition condition of the image data (e.g., the acquisition relay has turned on) is satisfied. When the acquisition relay turns on, the CPU 41 proceeds to S32. In this embodiment, when the acquisition relay turns on, it is determined that the acquisition condition of the image data is satisfied, but this is just an example. For example, when the mode of the PLC 1 is switched to the operation mode, it may be determined that the acquisition condition of the image data is satisfied. More specifically, the PLC 1 may be provided with a mode switch for switching between a setting mode (program mode) for performing various settings and an operation mode (RUN mode) for actually performing operations by repeatedly executing a ladder program. In this case, when the user switches this mode switch from the program mode to the RUN mode, it may be determined that the acquisition condition of the image data is satisfied.
[0124] In S32, the CPU 41 (collection unit 92b) determines whether the acquisition timing of the image data has arrived. The acquisition timing is, for example, every internal control cycle (imaging cycle) of the expansion unit 4. When the acquisition timing arrives, the CPU 41 proceeds to S33.
[0125] In S33, the CPU 41 (collection unit 92b) acquires the large-capacity data and the 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 the time information from the internal clock and writes it into the time information buffer 95. The camera 98 performs imaging according to the previously specified imaging conditions and outputs the image data. The image reception unit 96a outputs the image data to the collection unit 92b. The image reception unit 96a may directly write the image data into the ring buffer 91b. The collection unit 92b associates the time information read from the time information buffer 95 with the image data acquired by the camera 98 and writes them into the ring buffer 91b.
[0126] In S34, the CPU 41 (collection unit 92b) determines whether a read request (read instruction) for 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 no read request has been issued, the CPU 41 returns to S32.
[0127] In S35, the CPU 41 (collection unit 92b) acquires image data, which is large-capacity 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 an end condition is satisfied. For example, the collection unit 92b determines whether the acquisition relay has been 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 form> Figure 24 shows the connection form of the building block type PLC1. On the right side of the basic unit 3, an IF99a is provided for connecting and communicating with the expansion unit 4. IF is an abbreviation for interface. In this example, an expansion unit 4a is connected to the basic unit 3, and an expansion unit 4b is connected to the expansion unit 4a. The expansion unit 4 has IF99s on both its right and left sides. The right side of the basic unit 3 faces the left side of the expansion unit 4a. Therefore, the IF99a of the basic unit 3 is connected to the IF99b 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 IF99c of the expansion unit 4a is connected to the IF99d provided on the left side of the expansion unit 4b. Note that the 99e provided on the right side of the expansion unit 4b may be connected to the end unit. In this way, the IF99a to IF99e form the unit internal bus 90. For example, the image data acquired by the camera 98a connected to the expansion unit 4a can be transferred to the basic unit 3 via the unit internal bus 90. The image data acquired by the camera 98b connected to the expansion unit 4b can be transferred to the basic unit 3 via the unit internal bus 90.
[0130] In this way, in the building block type PLC1, the side surfaces of each unit serve as connection surfaces (coupling surfaces). The IF99s for forming a part of the unit internal bus 90 are also provided on the side surfaces of each unit. Note that, as described above, the communication on the unit internal bus 90 is controlled by the bus master 38 shown in FIG. 4.
[0131] Figure 25 shows the connection form of the PLC 1 having the backplane 200. The backplane 200 is connected to the bottom surface of the basic unit 3 and the bottom surface of the expansion unit 4, or is connected to the back surface of the basic unit 3 and the back surface of the expansion unit 4. The backplane 200 functions as a support plate (base plate) for supporting the basic unit 3 and the expansion unit 4. Here, as an example, the back surface is described as the connection surface. The back surface of the basic unit 3 faces the front surface of the backplane 200. Therefore, the IF 99f provided on the back surface of the basic unit 3 is connected to the IF 99g provided on the front surface of the backplane 200. The back surface of the expansion unit 4 faces the front surface of the backplane 200. The IF 99h provided on the back surface of the expansion unit 4a is connected to the IF 99i provided on the front surface of the backplane 200. The IF 99j provided on the back surface of the expansion unit 4b is connected to the IF 99k provided on the front surface of the backplane 200. The IFs 99f to 99k form the unit internal bus 90.
[0132] Note that the backplane 200 may have a communication control unit 213 for controlling bus communication via the unit internal bus 90. Further, the backplane 200 may have a CPU 211 and a memory 212. In addition to the RAM and the ROM, the memory 212 may have a memory card 36. In this case, the CPU 211 may function as the collection unit 92a and the storage unit 93. Further, a ring buffer 91a may be provided in the memory 212. 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] <Example of log display> FIG. 26 shows an example of the log data 73. In this example, the acquisition timings of the device values d1 to d10, the work images i1 to i3 acquired by the camera 98a, and the other images j1 to j3 acquired by the camera 98b are shown. The device values d1 to d10 are acquired every scan cycle. The work images i1 to i3 are acquired at the timing when the trigger signal is generated. The work images j1 to j3 are acquired at the timing when the trigger signal is generated. The positions of the respective data indicate the respective time information. As shown in FIG. 26, the acquisition times and acquisition periods of the respective 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] FIG. 27 is a diagram for explaining the display timing and display duration of the 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 the device value d1 and the time information of the device value d2 as the display duration of the device value d1. When the display duration has elapsed since the display of the device value d1 was started, the log display unit 61 starts the display of the device value d2. Hereinafter, the display duration is similarly obtained, and the device values to be displayed are 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 work image i1. Therefore, the log display unit 61 compares the acquisition time of the work 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 work image i1. In this example, the acquisition time closest to the acquisition time of the work image i1 is the acquisition time of the device value d1. Therefore, the log display unit 61 starts displaying the device value d1 and also starts displaying the work 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 work image i2. In this example, the acquisition time of the device value d4 is the closest to the acquisition time of the work 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 work image i2. The log display unit 61 obtains the acquisition time of the device value dx that is closest to the acquisition time of another image j1. In this example, the acquisition time closest to the acquisition time of another image j1 is the acquisition time of the device value d2. 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 another image j1.
[0136] As described above, among the plurality of data included in the log data 73, the display timing of each data may be adjusted based on the data with the shortest logging period.
[0137] FIG. 28 is a diagram for explaining a display method of log data 73. In this example, a relay device R000 and a data memory DM100 are acquired as device values dx (x takes values 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 another image jx within one window, or may display them in individual windows. Further, the log display unit 61 may read out a user program from the project data 71, map the device value dx to the user program, and display it. For example, the log display unit 61 may search for steps including instruction words related to the device value dx to be displayed, display the found steps, and display the device value under the instruction words in the steps. Note that the device to be displayed may be a relay device. The log display unit 61 may change the display color or icon image (e.g., arrow) of the instruction word according to the on / off state of the relay device. As icon images, there are those indicating on and those indicating off. Further, the log display unit 61 may display the device value in a graphed manner. In this case, the log display unit 61 always displays the device values d1 to d10 in one window and displays the work image in another window. The log display unit 61 switches the work image as time elapses. Here, the log display unit 61 may display a bar 103 that is movable in the time axis direction. The bar 103 may be called a timeline bar. The log display unit 61 may display the bar 103 so as to move from left to right as time elapses. The bar 103 may be moved by the user. In this case, the log display unit 61 receives 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 according to the movement operation. The log display unit 61 may extract the device value, the work image, and another image whose acquisition time is 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, as an example of the monitoring device, the camera 98 is illustrated, and as the function of the function execution unit 96, the imaging function of the camera 98 is illustrated. The present invention is not limited to this, and as the function of the function execution unit 96, a motion function or a communication function may be used. 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 an extension unit 4. In this case, on the PC 2, a program (motion flow program) and parameters (axis configuration, setting parameters for axis control, etc.) that define the operation of the motion unit are set, and so-called setting information is created. Then, via the first external interface (communication unit 33), the setting information is sent to the function execution unit of the motion unit 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 motor amplifier connected externally according to the setting information. From the motor amplifier, motion data such as current coordinates and current speed is received via the encoder. The control cycle for receiving motion data such as current coordinates and current speed is shorter than the scan cycle of the ladder program and is asynchronous with the scan cycle of the ladder program. Therefore, the collection unit of the motion unit collects motion data at a predetermined cycle, associates information regarding the reception time when the motion data is received with the motion data, and stores it in the ring buffer 91b. Thereafter, in the same manner as the process described with reference to FIG. 22, when the storage timing arrives (similar to step S25 in FIG. 22), motion data (such as current coordinates and current speed) and time information are acquired from the ring buffer 91b and appended to the log data. Thereby, it is possible to easily identify which device value is associated with which motion data. On the other hand, the latter communication control will be described in detail. Consider a case where a communication unit is connected to the basic unit 3 as an extension unit 4. In this case, on the PC 2, a program (communication flow program) and parameters (communication cycle, transfer speed, etc.) that define the operation of the communication unit are set, and setting information is created. Then, in the same manner as the above-described 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 a plurality of sensor values from a group of externally connected sensors (such as a group of connected multiple photoelectric sensors) according to the setting information. The reception period (cyclic communication period) of such communication data is asynchronous with the scan period of the ladder program. Note that when the number of sensors constituting the sensor group is large, the communication data itself may constitute large-capacity data. The collection unit of the communication unit collects the communication data at a predetermined period (so-called cyclic communication period), associates information regarding the reception time when the communication data is received with the communication data, and stores them in the ring buffer 91b. Thereafter, in the same manner as the process described with reference to FIG. 22, when it is the storage timing (similar to step S25 in FIG. 22), the communication data (such as sensor values) and the time information are acquired from the ring buffer 91b and appended to the log data.
[0139] <Setting of Collection Period> The log setting unit 51 may accept the setting of the collection period of the log data 73.
[0140] Figure 29 shows the UI 160 for setting the collection period. Note that the UI 160, UI 110, and UI 100 may be switched by selecting the corresponding tabs with the pointer 101. The UI 160 has a pull-down menu 161 for specifying the collection method. The collection method is the method for collecting the log data 73. In this example, the collection methods called before and after the save trigger and the collection method called start relay are described. Before and after the save trigger means collecting the log data 73 at the collection time Ta before the timing when the save trigger is turned on and the collection time Tb after the timing when the save trigger is turned on. The text box 162 accepts the input of the collection time T. The collection time T is the total value of the collection time Ta and the collection time Tb. The text box 163 accepts the input of the collection time Tb after the trigger. The setting section 164 of the save trigger accepts the setting of the device name of the relay device used as the save trigger and the condition (e.g., switched from off to on). The up arrow means that the relay device specified 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 regarding the above-described device size and the extension of the scan time on the UI 160.
[0141] In the collection method called before and after the save trigger, the device values and image data are constantly stored in the ring buffer 91. The save section 93 creates the log data 73 of 20 seconds specified as the collection time when the relay device R200, which is the save trigger, is turned on. The save section 93 reads out the data recorded from 18 seconds before the timing when the relay device R200 is turned on to 2 seconds after that timing from the ring buffer 91 and creates the log data 73.
[0142] Figure 30 shows the UI 160 for setting the collection period. In this example, the start relay is selected as the collection method from the pull-down menu 161 by the pointer 101. 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 the collection method called the start relay, the timing when the start relay is turned on becomes the starting point (start point) of the collection time. For example, assume that it takes 30 seconds to press one workpiece flowing on the production line. Also assume that the time when a trouble may occur is the first 20 seconds out of the 30-second processing time. The relay device R000 is a relay that defines the timing to start the press process. 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 next workpiece arrives and the relay device R000 is turned on again, 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 the save trigger, is turned on, the save unit 93 acquires the device values and image data for the latest 20 seconds stored in the ring buffer 91 and creates the log data 73. The relay device R200, which is the save trigger, is a relay device that is turned on when a trouble occurs.
[0143] The log setting unit 51 stores the information set through 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> Figure 31 is a flowchart showing an overview of the debug process of the user program executed by the user.
[0145] In S41, the user operates the PC2 to create a user program composed of a plurality of program components, and creates project data 71 including the user program. The program creation unit 63 creates a 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 execute an operation on the project data 71 or the user program to obtain a hash value, an error detection code, etc., and add these as identification information to the project data 71. Note that the identification information may be a GUID (Global Unique Identifier) or the like.
[0146] In S42, the user operates the PC2 to transfer the project data 71 to the PLC1. The project creation unit 50 reads the project data 71 from the storage device 22 and transmits it to the PLC1 via the communication unit 23. When the basic unit 3 of the PLC1 receives the project data 71, it writes it to the storage device 32.
[0147] In S43, the user operates the operation unit 6 of the basic unit 3 (for example, by operating a mode change switch that switches from the PROGRAM mode to the RUN mode) to instruct the execution of the project. The execution unit 80 executes the user program included in the project data 71. The recording unit 81 logs device values and stores (records) the logged device values in the ring buffer 91a. The storage unit 93 of the output unit 84 creates log data 73 by storing the device values recorded in the ring buffer 91a and the above-described image data in the memory card 36 or the internal memory 37 when a predetermined output condition is satisfied.
[0148] Also, as shown in FIG. 19, the storage unit 93 stores the project data 71 in the memory in addition to the log data 73. As a result, on the PC2, the movement at the time of trouble can be reproduced on the monitor using the project data 71 at the time of trouble. Details will be described later.
[0149] In addition, the storage unit 93 stores the identification information (such as a hash value) of the project data 71 in the memory in addition to the project data 71. As a result, the PC2 can verify whether the current project data (the project data to be replayed) matches the project data 71 at the actual time of trouble using the identification information. Details will be described later.
[0150] In the present embodiment, the project data 71 and its identification information are stored in the memory in addition to the log data 73 at the timing when a predetermined output condition is satisfied. However, the present invention is not limited to this. For example, before the start of operation, at the start of operation, or during the operation of the PLC1, the project data 71 and its identification information may be stored in the memory, and only the log data 73 may be stored in the memory at the timing when a predetermined output condition is satisfied. In short, at the time when a predetermined output condition is satisfied, it is sufficient that the log data 73, the project data 71, and its identification information are stored in the memory in an associated state.
[0151] Also, in this embodiment, the project data 71 is stored in the memory. However, 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 PC2 matches the project data 71 at the time of actual trouble occurrence. That is, it is assumed that the current project data has not been edited or modified after the project data is transferred to the PLC1. If it is determined that the two data do not match, the user may perform a replay after recognizing that the current project data is different from the project data 71 at the time of actual trouble occurrence, so that it is possible to prevent a replay (incorrect troubleshooting) from being performed without the user recognizing this.
[0152] In S44, the user operates the operation unit 6 of the basic unit 3 and instructs to transfer the project data 71 and the log data 73 to the PC2. Alternatively, the operation unit 8 of the PC2 may be operated to read out the project data 71 written in the memory card 36, the identification information of the project data 71, and the log data 73. The output unit 84 transmits the project data 71 and the log data 73 to the PC2. Note that the output unit 84 may adopt a configuration in which the identification information of the project data 71 is added to the log data 73 when it is determined that the transfer of the project data 71 is prohibited. The identification information of the project data 71 and the log data 73 may be transmitted separately. The output unit 84 may execute an operation (for example, using a hash function) on the project data 71 or the user program at the timing when a predetermined condition for writing to the memory card 36 is satisfied to obtain a hash value or an error detection code, etc., and add these as identification information to the log data 73. As long as the creation rule of the identification information executed by the PC2 and the creation rule of the identification information executed by the basic unit 3 match, any rule may be adopted.
[0153] At S45, the user operates the PC2, investigates the cause of the trouble while playing back (replaying) the log data 73, and executes the debugging of the user program that constitutes the project data 71. The playback of 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 measures virtual time, and acquires 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 PLC1. In this case, the log display unit 61 may display the device values in association with the user program using the user program of the project data 71 (master data) held in the storage device 22. Details of the investigation of the cause of the trouble by playing back the log data 73 will be described later.
[0154] Here, it should be noted that the version of the project data 71 used to obtain the log data 73 may be different from the version of the project data 71 stored in the PC2. In this case, it may be impossible to associate the device values with the user program for display, or the association between the user program and the device values may be incorrect. In this case, the log display unit 61 may display, on the display unit 7, a warning indicating that the version of the project data 71 used to obtain the log data 73 is different from the version of the project data 71 stored in the PC2, using the identification information of the project data. Note that the log display unit 61 may also inquire the user whether to associate and display the log data 73 obtained using the project data 71 of the first version with the project data 71 of the second version stored in the PC2. If the user desires such a display, the log display unit 61 associates and displays, on the display unit 7, the log data 73 obtained using the project data 71 of the first version with the project data 71 of the second version stored in the PC2. Note that the version is managed by the identification information. When the user confirms that there is no problem with the log data 73, debugging is unnecessary, and subsequent S46 and S47 are also unnecessary. The user analyzes the log data 73, discovers bugs in the user program, etc., and corrects the user program. The project creation unit 50 corrects (updates) the project data 71 according to the user input and stores it in the storage device 22.
[0155] In S46, the user operates the PC2 to transfer the project data 71 to the PLC1. Note that when the user program in the project data 71 is changed, the identification information is updated. Thereby, the project data 71 before correction and the project data 71 after correction can be distinguished.
[0156] In S47, the user operates the basic unit 3 and instructs the execution of the 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 operates as expected by the user, the user determines that the debugging of the project data 71 has been successful. If the PLC 1 does not operate as expected by the user, the recording unit 81 logs the device values again, and the storage unit 93 creates the log data 73. Then, the user executes S44 to S47 again.
[0157] In this way, the user can debug the project data 71 while referring to the log data 73. Therefore, it is considered that the efficiency of debugging is improved.
[0158] Note that the transfer of the project data 71 may be executed via the memory card 36. That is, the PC 2 writes 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 executed via the memory card 36.
[0159] <Output unit> FIG. 32 shows the output unit 84 implemented in the basic unit 3. In addition to the log data 73, the output unit 84 may transfer the project data 71 used when acquiring the log data 73 to the PC 2. However, in order to prevent information leakage of the project data 71, access rights (protection) that prohibit writing to the memory card 36 or transmitting to the PC 2 may be set for the project data 71. Therefore, the determination unit 301 refers to the access rights given to the project data 71 and determines whether the output of the project data 71 is prohibited. When the 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, when the output of the project data 71 is not prohibited, the output unit 84 outputs the log data 73 and the project data 71. When the output of the project data 71 is prohibited, the addition unit 302 may output the 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 performing a predetermined calculation on the project data 71 or the 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 on a display device such as the PC 2 or an HMI (Human Machine Interface) in real time.
[0160] <Project Creation Unit 50> FIG. 33 shows 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 setting contents. Examples of the function settings of the basic unit 3 include IP address setting, settings related to the FTP client, and access authority setting for the project data 71. Examples of the function settings of the expansion unit 4 include input channel setting 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 edit 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 debug unit 314 debugs the user program using the project data 71. The addition unit 312 adds identification information to the project data 71. The calculation unit 313 obtains the identification information (e.g., hash value or error detection code) by calculation. Note that for the function of calculating (computing) the identification information by this calculation unit 313, the output unit 84 may be made to exhibit the same function.
[0161] <Log display unit 61> FIG. 34 shows the details of the log display unit 61. The program display module 321 is a module that displays the device values included in the log data 73 together with the user program included in the project data 71 on the display unit 7. Further, the program display module 321 can display not only the user program but also various types of information for the user to visually recognize the setting contents of the project data 71, such as program configuration information, a plurality of program components, unit configuration, and function settings for each unit, included in the project data 71. The image display module 323 displays the time-series image data included in the log data 73 on the display unit 7. The waveform display module 322 is a module that waveforms the time-series device values included in the log data 73 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. Note that the image display module 323 may be embodied as a function (image display unit) of the program display module 321, or may be embodied as a function (image display unit) of the waveform display module 322.
[0162] ● Program display module FIG. 35A shows details of the program display module 321. The time UI 330a provides a UI (e.g., a slider bar, a cursor, etc.) for operating the acquisition time (display time) of the device displayed together with the user program. The display time control unit 331a sends the display time specified by the time UI 330a to the playback control module 324, or 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, or reads the project data 71 corresponding to the identification information from the storage device 22 and displays it on the display unit 7. Further, the program display unit 332 displays the device value acquired by the device value acquisition unit 333a in association with the device 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 PLC 1, acquires the device value, and passes it to the program display unit 332. In the log playback mode, the device value acquisition unit 333a accesses the playback control module 324, acquires the display time and the device value, and passes them to the program display unit 332.
[0163] FIG. 35B is a schematic diagram showing an example of the GUI displayed on the display unit 7 by the program display unit 332 or the like.
[0164] In FIG. 35B, various information constituting the project data 71 is displayed in the project display area 420 in the left column. In order from the top, unit configuration (basic unit, motion unit, analog input unit, camera unit), program configuration (per scan module, fixed cycle module, inter-unit synchronization module, function block, macro) are displayed. For the motion unit, setting parameters for axis configuration and axis control are displayed as function settings. The user can double-click on the axis configuration and axis control on the GUI shown in FIG. 35B to check the setting contents of these setting parameters. Also, in the project display area 420, where Main and Sub are displayed for the per scan module, when the user clicks on Main, the Main program is displayed in the program display area 410 of the central ladder monitor 450. 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 or displays the 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 operate independently in the real-time playback mode. By clicking on the × mark, it is also possible to hide only the ladder monitor 450. On the other hand, in the log playback mode, the program display unit 332 can reproduce the ladder program included in the project when the operation record was saved. Also, the program display unit 332 displays the device values included in the log data 73 in association with the devices described in the Main program via the device value acquisition unit 333a in the log playback mode. 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 with reference to FIG. 38 to be described later).
[0166] In the case of FIG. 35B, the device value associated with 18:52:54 on October 1st, 20XX displayed in the time display area 409 is displayed in association with the device described in the Main program. [35000 / 74286] displayed on the right side of this date indicates the current scan count 35000 out of the total scan count 74286. By dragging and moving the time-specifying cursor 404, the user can update the display time and scan count, and also update the display of the device value. For example, at the updated display time, the ON relay device locations are marked as ON (e.g., filled with color), and the OFF relay device locations are marked as OFF (e.g., left blank). Details such as the function of the play button 406 will be described later with reference to FIG. 38.
[0167] In FIG. 35B, an image display area for the camera monitor 430 is provided in the upper right column. The image display module 323 reads out image data from the log data 73 and displays it in the image display area of the camera monitor 430 in synchronization with the display time displayed on the ladder monitor 450 by the program display module 321. In FIG. 35B, the image data associated with 18:52:54 on October 1st, 20XX, which is the display time, is displayed on the camera monitor 430. Also, on the right side of this display time, 282 / 601 is displayed, which represents the order (the 282nd) of the current image data out of the total number of captured images 601. By dragging and moving the time-specifying cursor 404a on the camera monitor 430, the user can update the display time and the order of the current image data.
[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 schematically showing a data source for displaying a GUI in the log playback mode. As shown in FIG. 35C, the project display area 420 reads out the unit configuration, function settings, program configuration, and program components 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 (which program components it consists of) and the program components from the memory, displays the program components specified by the user, and 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 the image data corresponding to the display time from the log data 73 based on information such as the unit configuration (whether there is a camera monitor or not) and function settings (the function of the camera monitor. For example, if there are multiple ports, the port number, imaging cycle, gain settings, etc.). 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 units are there) and function settings (axis configuration and axis control if it is a motion unit).
[0171] As can be seen from FIGS. 35B and 35C, the functions of the playback control module 324 can synchronously control and cooperate the program display module 321, the image display module 323, and the unit display module 325. The details of the cooperation of the waveform display module 322 will be described 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 actual trouble occurrence. 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. When the identification information of the project data 71 (user program) when the operation record is saved, which is output from the PLC 1, does not match the identification information of the project data (user program) stored in the storage device 22, the warning unit 335 causes a warning to be displayed on the display unit 7.
[0173] For example, the warning unit 335 causes a warning screen 470 as shown in FIG. 35D to be displayed on the display unit 7. To give a specific example, assume that the identification information of the project data 71 when the operation record is saved does not match the identification information of the current (project data to be replayed) project data. For example, this is the case where, after transferring the project data to the PLC 1, the user edits the project data (programs, function settings, etc.). In this case, when the user switches from the real-time playback mode to the log playback mode based on a user operation, the warning screen 470 shown in FIG. 35D is displayed.
[0174] On the warning screen 470 shown in FIG. 35D, the user is allowed to select whether to perform log playback using the current project data as it is, or to perform log playback using the project of the operation record. In the former case, the user recognizes that the current project data is different from the project data 71 at the time of actual trouble occurrence, and then performs log playback. On the other hand, in the latter case, for example, the user can perform log playback using the project of the operation record by specifying the path (folder or directory) in the storage device 22 where the project of the operation record is stored.
[0175] In this embodiment, the identification information of two project data is compared to verify whether they match or not. More specifically, identification information is added to the program configuration, a plurality of program components, unit configuration, and function settings for each unit included in the project data, and verification is performed based on whether all of them match or not. However, the present invention is not limited to this, and at least the identification information of a user program composed of a plurality of program components may be compared to verify whether they match or not.
[0176] ● Waveform display module FIG. 36A shows details of the waveform display module 322. The time UI 330b provides a UI (e.g., a slide bar, etc.) 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 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 bar 103 through the operation unit 8 and passes the operation amount of 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, or 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 PLC 1, 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 the device value, and passes them to the waveform display unit 336. As shown in FIG. 28, the waveform display unit 336 waveforms the device value acquired by the device value acquisition unit 333b and displays it on the display unit 7. Waveforming the device value is not essential, and the device value may be displayed as a numerical value. As shown in FIG. 28, the image display module 323 displays the image data output from the playback control module 324 on the display unit 7. Note that, as described above, the image display module 323 may be realized as a function of the waveform display module 322, but as shown in FIG. 34, the image display module 323 (camera monitor) may be a separate function.
[0177] FIG. 36B is a schematic diagram showing an example of the GUI displayed on the display unit 7 by the waveform display module 322 or the like. In particular, the GUI displayed by the waveform display module 322 is a so-called real-time chart monitor 460 displayed in the pop-up window in 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 displays are made by the program display module 321 and the image display module 323. In FIG. 36B, the unit monitor 440 by the unit display module 325 is not shown, but it may be shown.
[0179] Regarding the real-time chart monitor 460 shown in FIG. 36B, its outline is as described 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 devices to be displayed on the real-time chart monitor 460 can be freely adjusted by the user through 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-specifying cursor 404b is composed of a vertical line superimposed on the waveform display area and a triangular mark added to the lower end of the vertical line. Further, a display area bar 404c is displayed below the time-specifying cursor 404b. In the center of the display area bar 404c, a square indicator indicating the current position is displayed. The user can change the range displayed on the real-time chart monitor 460 by dragging this indicator and moving it left and right. Then, by making good use of this display area bar 404c, the user can perform troubleshooting to trace the cause of the trouble. 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 the real-time chart monitor 460 and the time-specifying cursor 404b.
[0183] In FIG. 36C, it is assumed that relay devices R000 and R001, and data memories DM100 and DM101 are displayed on the real-time chart monitor 460. In FIG. 36C, for the sake of convenience of explanation, it is assumed that 15 device values (black circles) for each device are displayed on the real-time chart monitor 460. Among these device values, the device value corresponding to a specific moment for each device becomes the device value specified by the time-specifying cursor 404b. In FIG. 36C, it is the device value corresponding to the time at the center of the display range on the real-time chart monitor 460. When the user drags the time-specifying cursor 404b and moves it, for example, to the right, the display range follows so that the time-specifying cursor 404b fits within the display range, similar to the above-described time-specifying cursor 404 and time-specifying cursor 404a. On the other hand, when the user drags the square indicator of the display area bar 404c and moves it, for example, to the right, the display range of the real-time chart monitor moves to the right, and when it moves by a certain amount (when it moves to the right by 8 device values), the time-specifying cursor 404b becomes invisible. However, in this embodiment, even when the time-specifying cursor 404b becomes invisible, by double-clicking on a desired position in the waveform display area, the time-specifying cursor 404b jumps to that desired position so that troubleshooting is easier. 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-specifying cursor 404b to the accepted designated position.
[0184] A troubleshooting procedure (an example) using the GUI shown in FIG. 36C will be described more specifically.
[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 find a time that seems helpful for investigating the cause of the trouble while visually checking the device waveform displayed in the waveform display area. At this time, as described above, the time-specifying cursor 404b may become invisible from the display range of the real-time chart monitor 460.
[0186] (2) If a time when an abnormal device value is taken is found in the device waveform, double-click on that time in the waveform display area. Then, the time-specifying cursor 404b jumps to that time, and the time-specifying cursor 404 in the ladder monitor 450 and the time-specifying cursor 404a in the camera monitor 430 both jump to that time.
[0187] (3) As a result, the reproduction control module 324 causes the device value corresponding to that time to be displayed on the ladder monitor 450 and the image data corresponding to that time to be displayed on the camera monitor 430. Therefore, the user can investigate the cause of the trouble while visually checking these device values and image data.
[0188] ● Reproduction control module 324 Figure 37 shows the details of the playback control module 324. The device value providing unit 341 provides the device values obtained from the log data 73 by the log data acquisition unit 344 to the program display module 321 and the waveform display module 322. Also, the device value providing unit 341 provides the device values obtained from the log data 73 to the unit display module 325 as well. Note that the device values obtained from the log data 73 may be temporarily stored in the log device 345. The device value acquisition units 333 of the program display module 321 and the waveform display module 322 request the device values from the device value providing unit 341. The device value acquisition unit 333 acquires the device values from the log device 345 and transmits them to the device value acquisition unit 333. The time device 342 is a device that holds the display time set by the playback control unit 343. The device values (time information) held in the time device 342 may also be transmitted by the device value providing unit 341 to the device value acquisition unit 333. Alternatively, the playback control unit 343 may provide the 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 designation of the display time from the display time control units 331a and 331b, it sets the received display time in the internal clock (time adjustment). Therefore, when the 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 the 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. Thereby, the display time of the program display module 321 and the display time of the waveform display module 322 are synchronized. In order to realize slow playback, fast forward playback, rewind playback, etc., the playback control unit 343 changes the update speed of the internal clock according to the 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 held in the time device 342 from the log data 73 and passes it to the device value providing unit 341.
[0189] Similarly, the playback control unit 343 may synchronize the times of the image display module 323 and the unit display module 325 in addition to the display times of the program display module 321 and the waveform display module 322.
[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. However, the present invention is not limited to this. For example, the user may be able to select whether to synchronize or not. For example, check boxes for synchronization presence / absence may be provided on each monitor screen, and the default state may be checked. Then, the user can deselect the module for which synchronization is not desired, so that only that module is not synchronized. In this way, the log display unit 61 may have a selection function of selecting the modules to be synchronously controlled (followed) 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 FIGS. 35B and 36A will be further detailed 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 is displaying a ladder program (ladder diagram). The program display unit 332 acquires the device value of the device used or described in the user program by the device value acquisition unit 333a and displays it 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 overlaid on the user program. If the relay device is OFF, the program display unit 332 may display an icon 401b indicating OFF overlaid on the user program. The program display unit 332 acquires the device value of DM100, which is an output system device, by the device value acquisition unit 333a and may display it overlaid with the description of DM100 in the user program. In this example, a device value display area 403 is provided below the description of 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 along with the update of 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,...) to the speed specification unit 405. Note that the speed specification unit 405 may be realized by a pull-down menu that displays a list of multiple update speeds and allows one of the update speeds to be selected.When the time UI 330a detects a click by the pointer 101 on the speed specifying 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 a time-series display of device values. When the time UI 330a detects that the play button 406 has been clicked by the pointer 101, it instructs the playback control unit 343 to start updating the display time in the display time control unit 331a. This instruction corresponds to an instruction to start displaying the device values or an instruction to resume the display. The one-step reverse playback button 407 is a button for instructing to display the device values in time series while updating (rewinding) the display time step by step. When the time UI 330a detects that the one-step reverse playback button 407 has been clicked by the pointer 101, it instructs the display time control unit 331a to step back the display time by one step. The one-step playback button 408 is a button for instructing to display the device values in time series while updating the display time step by step. When the time UI 330a detects that the one-step playback 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. Note that when one-step playback is being executed, the playback control unit 343 does not update the display time unless the one-step reverse playback button 407 or the one-step playback button 408 is operated. When the play button 406 is operated while one-step playback is being executed, the playback control unit 343 resumes updating the display time at the update speed specified by the speed specifying unit 405. The time display area 409 is an area for displaying 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 emulator> PLC1 can be connected to an external display device called an HMI. The HMI may have a touch panel type input device. The HMI reads out the device values held in the device unit 34 of PLC1 and displays them on the display device. The project creation unit 50 sets the UI displayed on the HMI and the device values displayed on the UI, and saves them in the project data 71. The debug unit 314 has an emulator for the HMI, and by operating the emulator according to the project data 71, the operation of the HMI is confirmed. The log display unit 61 supplies the device values of the log data 73 to the emulator of the HMI. The emulator of the HMI displays the device values provided in time series on the UI.
[0193] Figure 39 shows the UI490 of the emulator of the HMI. In this example, the emulator of the HMI is included in the program display module 321. The program display unit 332 reflects the device values provided by the playback control unit 343 in the display area of the UI490. The UI490 may have time control objects related to playback control included in the UI400, such as a time specification cursor 404 and a playback button 406. Operations of the time control objects in the UI490 are reflected in the UI400 and the UI shown in FIG. 28 through the playback control unit 343. For example, when the time specification cursor 404 in the UI490 is operated to the left, in conjunction with the display time provided by the playback control unit 343, the time specification cursor 404 in the UI400 also moves to the left, and the bar 103 shown in FIG. 28 also moves to the left. Also, if the bar 103 shown in FIG. 28 is operated to the left, in conjunction with the display time provided by the playback control unit 343, the time specification cursors 404 in the UIs 400 and 450 also move to the left. This is because they are all synchronized with the same display time held in the time device 342.
[0194] <Flowchart regarding log display> ● Program display module Figure 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 the PLC1. When the project data 71 can be acquired from the PLC1, the project data 71 from the PLC1 is used. When the project data 71 cannot be acquired from the PLC1, the project data 71 held in the PC2 is used.
[0195] In S50, the CPU21 (matching 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 CPU21 (matching unit 334) determines whether the identification information of the project data 71 held in the PLC1 matches the identification information of the project data 71 held in the PC2. If the two do not match, the CPU21 proceeds to S60. In S60, the CPU21 (warning unit 335) displays a warning indicating that the identification information of the project data 71 held in the PLC1 does not match the identification information of the project data 71 held in the PC2 on the display unit 7. When the two match, the CPU21 proceeds to S52.
[0197] In S52, the CPU21 (program display unit 332) acquires the project data 71 from the PLC1 or the storage device 22.
[0198] In S53, the CPU 21 (program display unit 332) determines whether the log playback mode or the real-time playback mode is selected based on the information input from the operation unit 8. If the real-time playback mode is selected, the CPU 21 proceeds to S58. In S58, the CPU 21 (device value acquisition unit 333a) acquires the device value from the real-time transmission unit 304 of the PLC 1 without going through the playback control module 324. In S59, the CPU 21 (program display unit 332) displays the device value on the display unit 7 together with the user program included in the project data 71. If the log playback mode is selected, the CPU 21 proceeds to S54.
[0199] In S54, the CPU 21 (device value acquisition unit 333a) activates 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 device value and the display time on the display unit 7 together with the user program included in the project data 71.
[0201] In S56, the CPU 21 (display time control unit 331a) determines whether a time specification is detected by the time UI 330a. As described above, the time specification is executed by operating the time specification cursor 404. If no time specification is detected, the CPU 21 returns to S54. If a time specification is 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 specified time input by the time specification cursor 404. The CPU 21 returns to S54.
[0203] ● Waveform display module Figure 41 shows the display process executed by the waveform display module 322.
[0204] In S61, the CPU 21 (waveform display unit 336) determines whether the log playback mode or the real-time playback mode is selected based on the information input from the operation unit 8. If the real-time playback mode is selected, the CPU 21 proceeds to S66. In S66, the CPU 21 (device value acquisition unit 333b) acquires the device value from the real-time transmission unit 304 of the PLC 1 without going through the playback control module 324. In S67, the CPU 21 (waveform display unit 336) displays the device value on the display unit 7. If the log playback mode is selected, the CPU 21 proceeds to S62.
[0205] In S62, the CPU 21 (device value acquisition unit 333b) activates 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 a time specification is detected by the time UI 330b. As described above, the time specification is executed by the bar 103. If no time specification is detected, the CPU 21 returns to S62. If a time specification is 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 specified time input by the bar 103. The CPU 21 returns to S62.
[0209] ● Playback Control Module Figure 42 shows the playback control executed 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] At S72, the CPU 21 (reproduction control unit 343) initializes the time of the internal clock.
[0212] At S73, the CPU 21 (reproduction control unit 343) acquires the time of the internal clock and stores the time in the time device 342.
[0213] At S74, the CPU 21 (reproduction control unit 343) acquires the 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. As a result, the device value providing unit 341 can provide the device value and the display time to the program display module 321 and the waveform display module 322.
[0214] At S75, the CPU 21 (reproduction control unit 343) determines whether it has received a time specification from the display time control unit 331. If it has received the time specification, the CPU 21 proceeds to S76. If it has not received the time specification, the CPU 21 proceeds to S77.
[0215] At S76, the CPU 21 (reproduction control unit 343) changes the time of the internal clock according to the time specification from the display time control unit 331.
[0216] At S77, the CPU 21 (reproduction control unit 343) determines whether it has received an update speed change instruction from the display time control unit 331. If it has received the change instruction, the CPU 21 proceeds to S78. If it has not received the change instruction, the CPU 21 proceeds to S73.
[0217] At S78, the CPU 21 (reproduction control unit 343) changes the update speed of the internal clock according to the update speed specified by the display time control unit 331. Then, the CPU 21 proceeds to S73.
[0218] <Narrowing down of program components> The PC 2 extracts the devices to be logged when setting the log, or extracts other devices related to a specific device when displaying the log. The following example is adopted to explain this extraction process.
[0219] Figure 43 shows a plurality of modules that make up a ladder program. In this example, the following PLC1 is assumed. The workpiece is conveyed by a conveyor belt. When a workpiece detection sensor detects the workpiece, a height sensor measures the height of the workpiece, and a depth sensor measures the depth of the workpiece. If the height of the workpiece is not within a predetermined range, it is determined that the measurement is NG. Similarly, if the depth of the workpiece is not within a predetermined range, it is determined that the measurement is NG. Figure 43 describes program modules for realizing these series of processes. Each module includes contact system instructions (input system instructions) and output system instructions. The contact system instructions are the conditions for executing the output system instructions.
[0220] In the workpiece detection module B1, the device MR000 is a relay device that turns ON when it detects the workpiece. The device MR0002 is a relay device that turns ON when PLC1 is in automatic operation. The device MR001 is a relay device for instructing the start of measurement to the expansion unit 4. The device MR000 turns ON when a workpiece is detected during automatic operation.
[0221] In the measurement module B2, it is described that when the contact system instruction MR001 turns ON, the output system instruction is executed. In this example, the measured height value obtained by the expansion unit 4 is stored in the device EM0, and it is described that this is copied to the device TM100. Similarly, the measured depth value obtained by the expansion unit 4 is stored in the device EM2, and it is described that this is copied to the device TM101. Further, the device MR003 for managing the completion of measurement is set to ON.
[0222] The determination module B3 is a module that is executed when the device MR003 turns ON, that is, when the measurement is completed. Here, if the measurement result does not meet the pass condition, the device MR010 turns ON. This means a measurement NG. More specifically, if the measured value of the height stored in the device TM100 is less than 95, MR010 turns ON. If the measured value of the height stored in the device TM100 exceeds 105, MR010 turns ON. If the measured value of the depth stored in the device TM101 is less than 35, MR010 turns ON. If the measured value of the depth stored in the device TM100 exceeds 45, MR010 turns ON.
[0223] The error handling module B4 is a module for stopping the conveyance of the conveyor belt when any error occurs. In this example, when MR010 turns ON (measurement NG), or when MR012 turns ON (forced stop), or when MR013 turns ON (conveyance NG), MR011 turns ON (conveyance stop).
[0224] As can be seen from FIG. 43, the devices described in the contact system instructions of a certain module are described in the output system instructions of other modules. Conversely, the devices described in the output system instructions of a certain module are described in the contact system instructions of other modules. For example, the device MR001 described in the output system instructions of the work detection module B1 is described in the contact system instructions of the measurement module B2. Therefore, the work detection module B1 and the measurement module B2 are extracted as mutually related modules. Next, focusing on the device MR003 described in the output system instructions of the measurement module B2, it can be seen that MR003 is described in the contact system instructions of the determination module B3. Therefore, the measurement module B2 and the determination module B3 are extracted as mutually related modules. Next, focusing on the device MR010 described in the output system instructions of the determination module B3, it can be seen that MR010 is described in the contact system instructions of the error processing module B4. Therefore, the determination module B3 and the error processing module B4 are extracted as mutually related modules. In this way, a plurality of modules involved in a specific process and a plurality of devices described inside the plurality of 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 mutually related modules, 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 UI 500 that displays the extraction results. The log display section 61 and the device extraction section 53 may create a UI 500 that displays the devices and blocks (program components) extracted from the user program and display it on the display section 7. The UI 500 can easily display the extraction results of the devices and program components. Therefore, the user will be able to easily grasp the overall picture of the extraction results. When any block included in the UI 500 is clicked by the pointer 101, the log display section 61 and the device extraction section 53 may display the details of the clicked block on the UI 501. As a result, the user will be able to quickly access the details of the extracted block. The log display section 61 and the device extraction section 53 may display the extraction results using the UI illustrated in FIG. 43.
[0226] <Extraction Process of Blocks and Devices> FIG. 45 shows the extraction process of blocks and devices executed by the device extraction section 53. Here, the project data 71 includes a plurality of blocks (program components). Therefore, the device extraction section 53 refers to the project data 71 and extracts blocks and devices.
[0227] In S81, the CPU 21 (device extraction section 53) receives the selection of a block through the operation section 8. Note that the device extraction section 53 may receive the specification of a device through the operation section 8. In this case, the device extraction section 53 may extract one or more blocks that describe the specified device. When a plurality of blocks are extracted, the device extraction section 53 may receive a user selection for one block from the plurality of blocks. Such a device may be, for example, a device that the user focuses on during debugging. The user sets conditions (e.g., save trigger) for outputting the log data 73 to the output section 84 of the PLC 1 through the log setting section 51. More specifically, it is set with a condition such as a specific relay device being turned on. Therefore, the device extraction section 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 system instructions of the selected block.
[0229] In S83, the CPU 21 (device extraction unit 53) searches for other blocks described in the output system instructions for the extracted devices.
[0230] In S84, the CPU 21 (device extraction unit 53) determines whether other blocks described in the output system instructions for the extracted devices are found. If no other blocks are found, the CPU 21 ends the extraction process. If other blocks are found, the CPU 21 proceeds to S85.
[0231] In S85, the CPU 21 (device extraction unit 53) extracts the discovered block as a related block. For example, the device extraction unit 53 registers the identification information (e.g., name, file name, etc.) of the discovered block in a list for managing related blocks.
[0232] In S86, the CPU 21 (device extraction unit 53) selects a related block as a block from which devices are to be extracted. Then, in order to execute the extraction process for the newly selected block, the CPU 21 returns to S82. In S86, the related block to be selected is a block that has not yet been selected as a device extraction target. If the device extraction process is completed for all blocks registered in the list, the device extraction unit 53 ends the extraction process. The CPU 21 (device extraction unit 53) may create a list showing the relationship between the extracted devices and the blocks from which the devices were extracted. The device extraction unit 53 or the log display unit 61 may refer to these lists and create the UIs shown in FIG. 43 and the UIs 500, 501 shown in FIG. 44.
[0233] <Specific Examples of Debugging> FIG. 46 shows the debugging process executed by the user.
[0234] In S91, the user sets NG determination as the storage condition of the log data 73 through the log setting unit 51. According to FIG. 43, it is determined that the device MR010 for managing the NG determination has turned ON as the storage condition of 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 the PLC1. The PLC1 executes the project data 71 and stores the log data 73 in the memory card 36 when the storage condition in the log setting data 72 is satisfied. In the example shown in FIG. 43, when an NG determination occurs, the conveyor belt stops, so the user knows that some error has occurred.
[0236] In S93, the user checks the workpiece and determines whether the NG determination is a false detection. For example, the user measures the height and depth of the workpiece and determines whether the pass condition is satisfied. If the workpiece does not satisfy the pass condition, the user determines that the NG determination is a false detection.
[0237] At S94, the user removes the memory card 36 from the PLC1, connects the memory card 36 to the PC2, and reproduces the log data 73 stored in the memory card 36. The program display module 321 associates and displays the device values included in the log data 73 with the user program. More specifically, the program display module 321 designates the device MR010 adopted as the storage condition, causes the device extraction unit 53 to execute the extraction process of the block and the device, and displays the UI shown in FIG. 43 and the UIs 500 and 501 shown in FIG. 44. Further, the waveform display module 322 waveforms and displays the device values displayed by the program display module 321. For example, the measured value of the height of the workpiece held in EM0 and the depth of the workpiece held in EM2 are waveformed and displayed on the display unit 7. Also, the device value of the device MR000 that manages the workpiece detection is waveformed and displayed. The user observes these waveforms and determines that the chattering of the workpiece detection sensor is the cause of the false detection. The user operates the editing unit 311 to correct the workpiece detection module B1 as shown in FIG. 47. According to this correction, when the workpiece is continuously detected by the workpiece detection sensor for 1 second or more, the device MR001 for starting the measurement is turned on. The user transfers the updated project data 71 to the PLC1, operates the PLC1, and determines whether the countermeasure against chattering has succeeded.
[0238] By synchronously displaying the user program and the waveform of the device value in this way, the user can efficiently execute the identification of the cause of the false detection and the debugging of the user program for eliminating 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 a plurality of devices that are storage areas referred to 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 plurality of devices in time series. The PC2 is connected to a programmable logic controller and is an example of a program creation support device that 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 program components that make up a user program, including instruction words related to any of a plurality of devices, based on user input via the display unit 7. The component designation unit 52 is an example of a program component designation unit that designates a program component from which a specific device to be recorded by the device recording unit is extracted among the plurality of program components. The device extraction unit 53 is an example of a device extraction unit that analyzes the program component designated by the program component designation unit and extracts the devices described in the program component. The recording unit 81 of the basic unit 3 is configured to record the device values stored in the specific device extracted as the recording target by the device extraction unit in time series.
[0241] In this way, by designating a program component, the user extracts a device from the designated program component. Also, the user can exclude a specific program component from the extraction target of the device. Therefore, the registration burden on the user of the device to be logged in the PLC is reduced.
[0242] Note that the extraction unit 53 may analyze the program components created by the program creation unit 63 and extract the devices described in the program components. The component designation unit 52 may designate, on a program component basis (for each program component), the program components in which a specific device to be recorded by the recording unit 81 is used or described among the plurality of program components 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 devices that are the devices extracted by the extraction unit 53 and that are used or described in the program components designated by the component designation unit 52.
[0243] The extraction unit 53 may analyze a plurality of program components created by the program creation unit 63 and extract the devices used or described for each program component. The component designation unit 52 may designate at least one of the plurality of program components 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 component designated by the component designation unit 52 among the plurality of program components analyzed by the extraction unit 53. For example, a plurality of program components may be analyzed in advance and a plurality of devices may be extracted. That is, a list indicating the extracted devices may be created for each program component. Further, when the user designates any one of the program components, the list for the designated program component may be read out, and the devices listed in the list may be selected as the recording targets.
[0244] The component specifying unit 52 may be configured to specify at least one program component among a plurality of program components created by the program creation unit 63. The extraction unit 53 may analyze the program component specified by the component specifying unit 52 and extract devices used or described for each such program component. The recording unit 81 records, in chronological order, device values stored in a specific device extracted by the extraction unit 53. In this way, device extraction may be performed after a program component is specified. This may lighten the extraction process.
[0245] The extraction unit 53 may analyze a plurality of program components created by the program creation unit 63 and extract devices used or described for each program component. The component specifying unit 52 may specify at least one program component to be recorded or excluded among a plurality of program components created by the program creation unit 63. The recording unit 81 may be configured to record, in chronological order, device values stored in a specific device used or described in the program component specified as the recording target by the component specifying unit 52 among the devices extracted from the plurality of program components by the extraction unit 53, and to record devices used in program components other than the program component specified as the exclusion target by the component specifying unit 52. 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, if module B is specified as the exclusion target, although DM2 is excluded, DM1 remains as a recording target because it is also used in module A. In this way, addition and exclusion of devices may be performed in units of program components (i.e., for each program component). Also, program components to be recorded or excluded may be specified after devices are extracted from all program components.
[0246] The component specifying unit 52 may be configured to specify, as an exclusion target, a program component among a plurality of program components from which a specific device is not extracted. The device extraction unit 53 may be configured to analyze a program component specified as an extraction target of a device by the component specifying unit 52, extract a device used or described in the program component, and not extract a device from the program component specified as an exclusion target. That is, the deletion unit 55 and the addition unit 54 may function as a device addition / removal unit that deletes some specific devices among the specific devices extracted by the device extraction unit for each program component, or adds a device not extracted by the device extraction unit for each program component.
[0247] The program component may be, for example, a reusable program module. The plurality of program components may be stored in individual files respectively. The access rights (editing rights) may be set individually for the plurality of program components.
[0248] The user program may be, for example, a ladder program. In this case, the plurality of program components may be a plurality of function blocks used or described in the ladder program.
[0249] The detection unit 82 is an example of a detection unit that detects the rewriting of a device value from an external device to any one of a plurality of devices. The recording unit 81 may add the device whose device value rewriting is detected by the detection unit 82 to the recording target.
[0250] The PLC 1 may further include a detachable memory card 36 and a specifying unit 57 that detects an instruction for the memory card 36 and specifies a device targeted by the instruction. In FIG. 6, the specifying unit 57 is provided in the PC 2, but it may be implemented in the CPU 31 of the basic unit 3. The recording unit 81 may add the device specified by the specifying unit 57 to the recording target.
[0251] The expansion unit 4 of the PLC1 may be a motion unit (positioning unit) having a positioning function. The recording unit 81 or the device extraction unit 53 may add, as a recording target, a device that is used for the positioning function and is not described in the user program (e.g., a buffer memory in the motion unit).
[0252] The estimation unit 59 is an example of an estimation unit that estimates the influence of the recording of the device value by the recording unit 81 on the execution of the 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. As a result, the user can add or remove devices while taking into account the influence on the scan time.
[0253] In FIG. 7, the extraction of devices from the selected program parts, the extraction of devices from the selected functions, and the manual addition of devices by the user are described. However, not all of these are essential. It would be sufficient if two or more of these were adopted. Alternatively, only the extraction of devices from the selected program parts may be adopted, or only the extraction of devices from the selected functions may be adopted.
[0254] The CPU 31 and the execution unit 80 are an example of a program execution engine that repeatedly executes the user program. The CPU 31, the execution unit 80, and the CPU 41 are an example of a plurality of function execution engines that execute different functions (e.g., function programs) related to the user program based on instructions from the user program. This suggests that the basic unit 3 may include the functions 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 a plurality of CPUs, or may be realized by an ASIC or an FPGA. Also, a single CPU may be equipped with a multi-core, and each core may be responsible for different functions.
[0255] The device unit 34 is an example of a device storage unit having a plurality of devices which are storage areas referred to by a program execution engine and a plurality of function execution engines. The recording unit 81 is an example of a device recording unit that records device values stored in any of the plurality of devices in time series. The function setting unit 62 may function as an allocation unit that allocates a plurality of devices used in each of the plurality of function execution engines. The function specifying unit 60 may function as a specifying unit that specifies one or more functions among the plurality of functions corresponding to the plurality of function execution engines. The device extraction unit 53 may extract, from the plurality of devices allocated by the allocation unit, the devices used for one or more functions specified by the specifying unit as recording targets of 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 basic 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 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 used for the functions of the main unit and devices used for the functions of the function expansion unit based on user input via the display unit 7. The function setting unit 62 may display a UI for allocating devices to functions on the display unit 7.
[0259] The function specifying unit 60 is an example of a specifying unit that specifies one or more functions among a plurality of functions including the functions provided in the main unit and the functions provided in the function expansion unit. The addition unit 54 of the device extraction unit 53 extracts, as a recording target of the device recording unit, the devices used for the functions specified by the specifying unit. The deletion unit 55 of the device extraction unit 53 excludes, from the recording target of the device recording unit, the devices used for the functions specified by the specifying unit. The communication unit 23 functions as a transmission unit that transmits, to the PLC 1, setting data for causing the device recording unit to record, in time series, the device values stored in a specific device extracted as the recording target. The recording unit 81 is configured to record, in time series, the device values stored in the devices extracted as the recording target by the device extraction unit 53.
[0260] The project creation unit 50 functions as a program creation unit that creates a user program including command words related to any of a plurality of devices based on user input via the display unit 7. The device extraction unit 53 may analyze the user program, extract the devices used or described in the user program, and create a device list (extraction list) including the extracted devices. Further, the device extraction unit 53 may add, to the device list, the devices used for the functions specified as the recording target (extraction target) by the function specifying unit 60. Also, the deletion unit 55 may be configured to delete, from the device list, the devices used for the functions specified as the exclusion target by the function specifying unit 60. The device list is included in the log setting data 72. The recording unit 81 is configured to record, in time series, the device values stored in the devices registered in the device list.
[0261] The function specifying unit 60 may be further configured to specify either the main unit or 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, by selecting one function, the user selects all the functions included in that unit as the extraction target of the device. The device extraction unit 53 may extract, as the recording target of the device recording unit, the device used for the unit specified as the recording target (extraction target) by the function specifying unit 60. Further, the device extraction unit 53 may be configured to exclude, from the recording target of the device recording unit, the device used for the unit specified as the exclusion target by the function specifying unit 60. In this way, the extraction target and the exclusion target may be specified in units of the main unit and the function expansion unit.
[0262] As shown in FIG. 14, the function specifying unit 60 may be further configured to specify the device type of the device to be recorded or the device type of the device to be excluded. The device extraction unit 53 extracts, as the recording target of the device recording unit, the device of the device type specified as the recording target by the function specifying unit 60. The device extraction unit 53 may be configured to exclude, from the recording target of the device recording unit, the device of the device type specified as the exclusion target by the specifying 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, and associates information regarding the collection time of the device values with the device values and stores them in the first buffer. Note that the device values to be collected may be preset by the log setting data 72. The ring buffer 91a is an example of the first buffer. The information regarding the collection time may be, for example, time information supplied from the time management unit 83a. 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 receives a user program and setting information from an external setting device.
[0264] IF99b, 99d, 99h, 99j, etc. are examples of a second interface that communicates with the main unit. The image receiving unit 96a and the connection port 97 are examples 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 barcode reading result 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 and the distance image are examples of two-dimensional data. The two-dimensional data may be video data. Also, large-capacity data that is large in size compared to 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 execution unit 96 may function as a function execution 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 a third interface and associates information regarding the acquisition time at which the two-dimensional data was acquired with the two-dimensional data and stores them in a second buffer. The time information provided by the time management unit 83 is an example of information regarding 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 stores the device value and information regarding the collection time stored in the first buffer, and the two-dimensional data and information regarding the acquisition time stored in the second buffer when a predetermined storage condition is satisfied.
[0267] In this way, information regarding the acquisition time is associated with the device value and the two-dimensional data, respectively. Therefore, it becomes easier to specify the temporal relationship between relatively large-capacity data such as two-dimensional data and the device value.
[0268] The monitoring device may be a camera that acquires still image or moving image data. The function execution unit 96 executes functions that involve input of image data from the camera 98. The collection unit 92b, which is the second collection unit, stores in the second buffer by associating information regarding the acquisition time when the image data is acquired with the image data. The storage unit 93 may store in association with each other the device value, information regarding the collection time, the image data stored in the second buffer, and information regarding the acquisition time. The function execution unit 96 may execute functions that involve input of data from the monitoring device asynchronously with the execution period of the user program. The storage unit 93 may also store project data including the user program and setting information. The storage unit 93 may store the device value, information regarding the collection time, the data stored in the second buffer, and information regarding the acquisition time in a plurality of files identified by a common flag, and store the plurality of files.
[0269] The information regarding the collection time may be information that can specify the collection time for each of a plurality of device values collected in time series. The collection time may be associated with each of the plurality of device values. Alternatively, for example, the collection time may be associated only with 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 scan time). Since the device values are recorded the same number of times as the number of scans, by storing the processing time (scan time) for each scan, the collection time for any device value can be specified. For example, when trying to specify the collection time of the device value recorded in the 100th scan, assume 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 after 100 microseconds × 99 has elapsed from 10:10:00 is calculated as the collection time of the device value recorded in the 100th scan. Thus, it is not essential to associate and record the collection time with all device values.
[0270] The information regarding the acquisition time may be information for specifying the acquisition time for each of a plurality of two-dimensional data acquired in time series. The acquisition time may be associated with each of the plurality of two-dimensional data. Alternatively, for example, the acquisition time may be associated only with the first two-dimensional data. In the latter case, based on other information (such as the number of imaging times and imaging period), the acquisition time for two-dimensional data other than the first two-dimensional data can be calculated. Specifically, among the plurality of two-dimensional data, the acquisition time is associated only with the first two-dimensional data. The period (imaging period) for acquiring the two-dimensional data is substantially constant. Therefore, the acquisition time of any two-dimensional data can be specified. For example, when trying to specify the acquisition time of the image data recorded in the 10th imaging, assuming that the acquisition time of the image data recorded in the 1st imaging is 10:10:00 and each of the 2nd to 10th imagings took 100 milliseconds. In this case, the acquisition time of the image data recorded in the 10th imaging is the time after 100 milliseconds × 9 has elapsed from 10:10:00. Thus, it is not essential to associate and record the acquisition time with all the two-dimensional data.
[0271] The storage unit 93 may include a memory card 36 that is detachable from the main unit. The storage unit 93 may store the device value and the information regarding the collection time stored in the first buffer, and the two-dimensional data and the information regarding the acquisition time stored in the second buffer, on the memory card 36. Thereby, it becomes easier to transfer 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 extension unit.
[0272] As shown in FIG. 24, the first interface may be disposed on a side surface of the main unit and facing the side surface of the extension unit. The second interface may be provided on the side surface of the extension unit so as to be connected to the first interface.
[0273] As shown in Fig. 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 stored in the storage device 32, information regarding the collection time, two-dimensional data, and information regarding the acquisition time to an external device. The external device may be a cloud or a PC2. The PC2 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 at a cycle shorter than the execution cycle (e.g., scan cycle) of the user program.
[0276] The storage unit 93 may be configured to read and store the two-dimensional data and the information regarding the acquisition time from the second buffer during the period in which the end process (END process) regarding the user program is being executed in the main unit.
[0277] As described 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 realized, for example, by inter-unit synchronization.
[0278] As shown in Fig. 29, the storage unit 93 may be configured to store the device value, the information regarding the collection time, the two-dimensional data, and the information regarding the acquisition time collected during a predetermined collection time before and after a preset storage trigger in the memory card 36.
[0279] As shown in FIG. 30, the storage unit 93 may be configured to store, in the memory card 36, the device value collected at a predetermined collection time starting from the timing when the preset start relay is turned on, information regarding the collection time, two-dimensional data, and information regarding the acquisition time.
[0280] As described in relation to FIG. 32, when a predetermined storage condition is satisfied, the storage unit 93 may store, in a memory (e.g., the memory card 36 or the internal memory 37), the device value recorded in the device recording unit in association with the user program stored in the program storage unit or the identification information of the user program. Further, when a predetermined output condition is satisfied, the output unit 84 may output, to an external memory (e.g., the memory card 36), the device value recorded in the device recording unit and the user program stored in the program storage unit or the identification information of the user program. As described above, it is important which project data 71 the log data 73 is obtained by using. Therefore, the output unit 84 outputs the project data 71 itself used to obtain the log data 73 or its identification information. That is, by outputting the log data 73 and the project data 71 or its identification information, it becomes easier to specify the relationship between the log data 73 and the project data 71. Thereby, the user can efficiently proceed with the debugging of the project data 71.
[0281] The user program is composed of a plurality of program components. Also, the project data manages a plurality of program components. The storage device 32 functions as a program storage unit that stores the user program as part of the project data 71. The output unit 84 may be configured to output the project data 71 including the user program and to output the identification information of the project data 71 as the identification information of the user program. Thereby, it becomes easier to determine whether the project data 71 (master data) stored in the PC 2 matches the project data 71 stored in the PLC 1.
[0282] The project data 71 may include the 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 a plurality of expansion units 4 are connected to the basic unit 3, the connection order of the plurality of expansion units 4 is included in the setting information of the expansion unit 4. Information regarding this connection order may be required during debugging.
[0283] The determination unit 301 functions as a determination unit that determines whether the output of the user program (project data 71) is prohibited. When the determination unit 301 determines that the 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. Thereby, while protecting the user program, the master data of the PC2 can be made available based on the identification information.
[0284] As described in relation to the addition unit 312, the identification information of the user program is identification information that is updated when the user program is changed. Thus, other versions of the project data 71 different from the project data 71 held in the PLC1 will not be erroneously used for debugging.
[0285] As described in relation to the arithmetic 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, when the project data 71 is updated, an arithmetic method for the identification information may be adopted such that the identification information is also updated. The identification information may be a time stamp or the like.
[0286] The storage device 22 of PC2 is an example of a program memory that stores a user program and identification information of the user program. The verification unit 334 is an example of a verification unit that verifies the identification information of the user program output from the programmable logic controller and the identification information of the user program stored in the program memory, and causes the display unit to display the verification result. The warning unit 335 outputs a warning when the two do not match, but may display a message or image indicating that they match on the display unit 7 when the two match.
[0287] As shown in FIG. 38, the display unit 7 may display the device value output from the programmable logic controller in association with a portion of the user program in which an instruction word related to the device value is described. Thereby, the user can easily understand the relationship between the change in the device value and the user program. This will improve the efficiency of debugging.
[0288] The storage device 22 and the memory card 36 are examples of storage means for storing a plurality of 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 that displays a device value on a ladder diagram. The waveform display module 322 is an example of a second engineering software module that displays a device value as a time-series waveform. The playback control module 324 is an example of a synchronization software module that synchronizes the display target time in the first engineering software module and the display target time in the second engineering software module. Thereby, the user will be able to easily understand the relationship between the change in a specific device value and the program.
[0289] The first engineering software module may have first display control means for obtaining device values from a programmable logic controller in real-time playback mode and displaying the device values on a ladder diagram, and for obtaining device values corresponding to a display target time from storage means based on time data in history playback mode and displaying them on the ladder diagram. 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 second display control means for obtaining device values from a programmable logic controller in real-time playback mode and displaying a time-series waveform, and for obtaining device values corresponding to a display target time from storage means based on time data in history playback mode and displaying the time-series waveform. The waveform display unit 336, the display time control unit 331, and the device value acquisition unit 333 are an example of the second display control means.
[0291] The synchronization software module may have synchronization means for synchronizing the display target time in the first engineering software module and the display target time in the second engineering software module in history playback mode. The playback control unit 343 is an example of the synchronization means.
[0292] The first engineering software module may further have first update means for updating the display target time in history playback mode. The time specification cursor 404, the time UI 330, and the display time control unit 331 are an example of the first update means. The playback control unit 343, which is the synchronization means, reflects the display target time updated by the first update means to the display target time of the second engineering software module.
[0293] The second engineering software module may further include second updating means for updating the display target time in the history playback mode. Bar 103, time UI 330, and display time control unit 331 are examples of the second updating means. The playback control unit 343, which is the synchronization means, reflects the display target time updated by the second updating means to the display target time of the first engineering software module.
[0294] As shown in FIG. 43, the first display control means may search for instruction words related to the device to be displayed in the second engineering software module among a plurality of devices referred to in the programmable logic controller in the ladder diagram. For example, the device may be specified by specifying the device shown in FIG. 28 (e.g., R000, DM100, etc.) with the pointer 101. As shown in FIG. 38, the first display control means may be configured to display the device value of the device together with the instruction word found in the ladder diagram. Further, the pointer 101 is an example of specifying means for specifying an arbitrary device. The first display control means may search for instruction words related to the device specified by the specifying means among a plurality of devices referred to in the programmable logic controller in the ladder diagram, and display the device value of the device together with the instruction word found in the ladder diagram.
[0295] As shown in FIG. 43, in the programmable logic controller, the ladder program may be composed of a plurality of program components. The first display control means (e.g., the log display unit 61 and the device extraction unit 53) may be configured to search for one or more blocks including instruction words related to the device from among the plurality of program components, 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 instruction words related to the device, the first display control means may display the ladder diagrams corresponding to the plurality of blocks side by side.
[0297] As shown in FIG. 43, when the instruction word related to the first device (e.g., MR001) in the first block (e.g., measurement module B2) is an input instruction word in the ladder program, the first display control means may specify the second device (e.g., MR003) targeted by the output instruction word described corresponding to the input instruction word, and may specify the second block (e.g., determination module B3) in which the input instruction word targeted at the second device is described.
[0298] When the instruction word related to the first device (e.g., MR010) in the first block (e.g., determination module B3) is an output instruction word in the ladder program, the first display control means may specify the second device (e.g., MR001) targeted by the input instruction word described corresponding to the output instruction word, and may specify the second block (e.g., measurement module B2) in which the output instruction word targeted at the second device is described.
[0299] The synchronization means may have setting means for setting the update speed of the display target time. The speed specifying unit 405 is an example of the setting means. Thereby, slow playback, fast forward playback, etc. may be realized.
[0300] The first display control means and the second display control means may be further configured to display the device value set based on the user input input from the human machine interface (HMI) that displays information regarding the programmable logic controller. The HMI may be realized by an emulator. As described in relation to FIG. 39, the UI490 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 to the program display unit 332 or add it as a display target to the waveform display unit 336. Thereby, it becomes possible to display the HMI, the user program, and the waveforms of the device values in cooperation and synchronization.
[0301] The storage means may further store a plurality of time-series image data acquired from 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, display a time-series waveform, and display the image data acquired from the camera unit. Similarly, the second engineering software module may acquire and display the device value and the image data corresponding to the display target time from the storage means in the history playback mode. Image data has more information than numerical values. Therefore, by displaying the image data, the user will be able to find problems early.
[0302] Also, the first engineering software module may acquire device values from the programmable logic controller in the real-time playback mode, display the device values on the ladder diagram, and display the image data acquired from the camera unit. The first engineering software module may acquire and display the device value and the image data corresponding to the display target time from the storage means on the ladder diagram in the history playback mode.
[0303] The plurality of expansion units 4 operate according to different internal control cycles. Therefore, the acquisition times of the device values and the acquisition times of the image data acquired from the plurality of expansion units 4 often do not match. Therefore, as described in connection with FIGS. 26 to 28, the first display control means and the second display control means may be configured to read out the device value associated with the time data closest to the display target time in the history playback mode.< / plc>
Claims
1. A programmable logic controller comprising: 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 the description of the ladder program; a function execution engine that executes a motion function for driving and controlling a motor connected externally based on a command from the ladder program; and a buffer memory that stores a plurality of different motion data updated by the execution of the motion function, an engineering tool for the programmable logic controller, A programmable logic controller system having, wherein the engineering tool, has a display unit, a specifying unit that specifies a motion function among a plurality of different functions based on user input via the display unit, a setting unit that creates log setting data including a plurality of buffer memories corresponding to a plurality of different monitor items that are monitor items for monitoring the motion function specified by the specifying unit and include any one of the coordinates, speed, and torque of the motor, and a list of logging target devices extracted from the ladder program, and has, wherein the programmable logic controller, has a recording unit that records, in time series, 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 association with time data regarding the collection time, a storage unit that, when a predetermined storage condition is satisfied, reads out the time-series motion data, device values, and associated time data for a predetermined target period recorded by the recording unit and stores them as log data, and has, wherein the engineering tool further, has a unit display module that acquires, from the log data, motion data corresponding to a display target time based on the time data stored as the log data and displays it in a list on the display unit together with a unit for each of the plurality of different monitor items, and a display module for a device that acquires, from the log data, a device value corresponding to a display target time based on the time data stored as the log data and displays it on the display unit, A playback control module that synchronizes the display target time in the unit display module with the display target time in the display module for the device. A programmable logic controller system characterized by this.
2. The display module for the device consists of a program display module that displays the device values obtained from the log data on a ladder diagram. The playback control module The programmable logic controller system according to claim 1, characterized in that the display target time in the unit display module is synchronized with the display target time in the program display module.
3. The display module for the device consists of a waveform display module that displays the device values obtained from the log data as a time-series waveform. The playback control module The programmable logic controller system according to claim 1, characterized in that the display target time in the unit display module is synchronized with the display target time in the waveform display module.
4. When the log playback mode is selected according to user input via the display unit among the real-time playback mode and the log playback mode, the unit display module displays a list of motion data corresponding to each of the plurality of different monitor items on the display unit. The programmable logic controller system according to any one of claims 1 to 3, characterized by this.
5. The engineering tool Is configured to be able to select the plurality of different monitor items based on user input via the display unit. The programmable logic controller system according to any one of claims 1 to 4, characterized in that 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. The engineering tool is further configured to be able to select the plurality of different monitor items for each axis based on user input via the display unit when there are a plurality of axes indicating the drive source of the motor. The programmable logic controller system according to claim 5, characterized by this.
7. The programmable logic controller system according to any one of claims 1 to 6, wherein the plurality of different monitor items include at least the coordinates, speed, and torque of the motor.
8. The programmable logic controller system according to any one of claims 1 to 7, wherein a plurality of buffer memories are associated with each of the plurality of different monitor items.
9. The programmable logic controller system according to any one of claims 1 to 8, wherein one of a communication function and an analog input function is included in the plurality of different functions.
10. The programmable logic controller system according to any one of claims 1 to 9, wherein the function execution engine executes a motion control program at a control period shorter than the scan period of the ladder program to execute the motion function.
11. The programmable logic controller system according to any one of claims 1 to 10, wherein the log setting data designates a specific device and a timing determined by a state change of the specific device as the storage condition.
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 that is a storage area referred to by the ladder execution engine based on the description of the ladder program; a function execution engine that executes a motion function for driving and controlling a motor connected externally based on a command from the ladder program; a buffer memory that stores a plurality of different motion data updated by the execution of the motion function; a recording unit that records in time series by associating the motion data stored in a plurality of buffer memories designated by a logging target list and device values stored in a plurality of devices designated by the logging target list with time data regarding the collection time; and a storage unit that, when a predetermined storage condition is satisfied, reads out the time-series motion data, device values, and associated time data for a predetermined target period recorded by the recording unit and stores them as log data. A display unit, A specifying unit that specifies a motion function among a plurality of different functions based on user input via the display unit; A setting unit that creates log setting data including a plurality of buffer memories corresponding to a plurality of different monitor items including any one of the coordinates, speed, and torque of the motor, and a list of logging target devices extracted from the ladder program; 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 the time data stored as the log data, and displays it in a list on the display unit together with a unit for 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 the time data stored as the log data, and displays it on the display unit; And a playback control module that synchronizes the display target time in the unit display module and the display target time in the display module for the device. An engineering tool characterized by the above.
Citation Information
Patent Citations
Event reproducing device
JP1994020180A
Sequence controller, data processor, data recording and reproducing method, and recording medium
JP1998011118A
Logging device
JP2000235412A
Trouble analysis supporting device and simulation system
JP2000250775A
Logging device
JP2000276222A