Programmable logic controller, computer, method, and program

文档序号:440872 发布日期:2021-12-24 浏览:13次 中文

阅读说明:本技术 可编程逻辑控制器、计算机、方法以及程序 (Programmable logic controller, computer, method, and program ) 是由 长友美泰 小川芽生 于 2019-05-23 设计创作,主要内容包括:可编程逻辑控制器(100)所具有的程序执行部(120)反复执行使用作为可编程逻辑控制器(100)用的编程语言的顺序功能图而创建的程序。索引信息存储部(140)对程序步信息进行存储,程序步信息对包含于程序、记述有可编程逻辑控制器(100)所执行的处理的程序步唯一地进行确定。每当程序执行部(120)执行程序步时,追踪执行部(150)对包含程序步信息和确定程序被反复执行的次数即执行循环数的信息的日志进行记录。(A program execution unit (120) included in a programmable logic controller (100) repeatedly executes a program created using a sequence function diagram that is a programming language for the programmable logic controller (100). An index information storage unit (140) stores program step information that uniquely identifies a program step that is included in a program and in which processing to be executed by a programmable logic controller (100) is described. Every time the program execution unit (120) executes a program step, the trace execution unit (150) records a log containing program step information and information for specifying the number of execution cycles, which is the number of times the program is repeatedly executed.)

1. A programmable logic controller having:

an execution unit that repeatedly executes a program created using a sequential function chart of a programming language for a programmable logic controller;

a program step information storage unit that stores program step information that uniquely specifies a program step included in the program and describing a process executed by the programmable logic controller; and

and a log recording unit that records, in a storage unit, a log including the program step information and information that specifies the number of execution cycles that is the number of times the program is repeatedly executed, each time the execution unit executes the program step.

2. The programmable logic controller of claim 1,

said program comprising a plurality of program blocks having at least 1 of said program steps,

the programmable logic controller includes an assigning unit that assigns a unique value that uniquely identifies the program step within the program to each of the program steps, generates program step information including the unique value, identification information that identifies the program block, and identification information that identifies the program step within the program block, and stores the generated program step information in the program step information storage unit.

3. The programmable logic controller of claim 2,

the distribution unit generates the program step information before the execution unit executes the program, and stores the generated program step information in the program step information storage unit.

4. The programmable logic controller of claim 2 or 3,

and when the programmable logic controller is powered on and executes initialization processing, the distribution unit generates the program step information.

5. A computer, having:

a reading unit that reads the log from the storage section of the programmable logic controller according to any one of claims 1 to 4, and reads the program step information from the program step information storage unit; and

a display unit that displays the program steps determined from the program step information included in the log in association with the number of execution cycles included in the log.

6. The computer of claim 5,

the display means displays an image in which the number of execution cycles in which the program step is executed is displayed in association with a program step number indicating the program step.

7. A method comprising the following stages:

a programmable logic controller repeatedly executing a program created using a sequence function diagram of a programming language for the programmable logic controller assigns program step information uniquely determining a program step to each of the program steps within the program; and

each time the program steps are executed, the programmable logic controller records a log including the program step information assigned to the program steps and information that determines the number of execution cycles, which is the number of times the program is repeatedly executed.

8. A program for causing a programmable logic controller that repeatedly executes a program created using a sequence function diagram of a programming language for the programmable logic controller to perform the following operations:

program step information uniquely identifying the program step is assigned to each of the program steps within the program,

each time the program steps are executed, a log including the program step information and information that specifies the number of execution cycles, which is the number of times the program is repeatedly executed, is recorded.

Technical Field

The invention relates to a programmable logic controller, a computer, a method and a program.

Background

The programmable logic controller controls a device to be controlled by executing each command of the control program every execution cycle. One of the programming languages describing the control program executed by the programmable logic controller is sfc (sequential Function chart). In the control program described in the SFC, a program step describing a process executed by the programmable logic controller and a transition condition for transitioning to the program step are described. For example, in the example shown in fig. 11, after the execution of the program step 0, the program step 1 is executed when the transition condition 1 is satisfied, and the program step 2 is executed when the transition condition 2 is satisfied. After the execution of the program step 1, if the transition condition 3 is established, the program step 3 is executed. After the execution of the program step 2, if the transition condition 4 is established, the program step 3 is executed.

In order to debug the control program described in the SFC, it is necessary to trace (trace) the execution sequence of the program steps, the number of times each program step is executed, and the like.

Patent document 1 describes that, in order to track a control program described in SFC, each time a program step in the program is executed, a programmable logic controller stores data including the number of the program step in a track data storage unit, a peripheral device reads the data from the track data storage unit, and a time chart of an execution route and an execution sequence of a jump program step is displayed on a display.

Patent document 1: japanese laid-open patent publication No. 2001-5504

Disclosure of Invention

In the configuration described in patent document 1, data including the number of the program step is sequentially stored, and the sequence chart of the execution route and the execution sequence of the jump program step is displayed on the display based on the stored data, so that the execution sequence of the program step can be traced from the stored data, for example, during a period from the start of tracing to the end of tracing. However, in the configuration described in patent document 1, the number of times the control program is executed and the number of program steps are not stored in association with each other, and only the executed program steps are displayed as a time chart. However, the control program actually used in the factory is a complicated control program including a large number of jumps and program steps, and in the technique described in patent document 1, it is very difficult for a user who debugs the control program to grasp the execution order and the number of execution times of the program steps executed in the execution cycle of the control program in units of the execution cycle of the control program.

The present invention has been made in view of the above circumstances, and an object thereof is to track an execution path and the number of execution times of a program step of a program described in SFC in units of execution cycles.

In order to achieve the above object, an execution unit included in a programmable logic controller according to the present invention repeatedly executes a program created using a sequence functional diagram in a programming language for the programmable logic controller. The program step information storage means stores program step information that uniquely specifies a program step, which is included in a program and in which processing executed by the programmable logic controller is described. The log recording means records, in the storage unit, a log including program step information and information for specifying the number of execution cycles, which is the number of times the program is repeatedly executed, each time the execution means executes the program step.

ADVANTAGEOUS EFFECTS OF INVENTION

The programmable logic controller of the present invention records a log including program step information for uniquely specifying a program step and information for specifying the number of execution cycles, which is the number of times the program is repeatedly executed, every time the program step is executed. With such a configuration, the execution path and the number of execution times of the program step of the program described in the SFC can be tracked in units of execution cycles.

Drawings

Fig. 1 is a block diagram showing a functional configuration of a programmable logic controller and a development tool according to an embodiment of the present invention.

Fig. 2 is a block diagram showing a hardware configuration of a programmable logic controller and a development tool according to an embodiment.

Fig. 3 is a diagram showing an example of a control program according to the embodiment.

Fig. 4 is a diagram showing an example of data stored in an index table according to the embodiment.

Fig. 5 is a diagram showing an example of the trace log according to the embodiment.

Fig. 6 is a flowchart of index assignment processing according to the embodiment.

Fig. 7 is a flowchart of the tracking process according to the embodiment.

Fig. 8A is a diagram (1) showing an example of a display screen of the trace log according to the embodiment.

Fig. 8B is a diagram (2) showing an example of a display screen of the trace log according to the embodiment.

Fig. 8C is a diagram (fig. 3) showing an example of a display screen of the trace log according to the embodiment.

Fig. 8D is a diagram (4) showing an example of a display screen of the trace log according to the embodiment.

Fig. 8E is a diagram (fig. 5) showing an example of a display screen of the trace log according to the embodiment.

Fig. 9A is a diagram showing another example of the display screen of the trace log according to the embodiment.

Fig. 9B is a diagram showing an example of a screen for displaying a sequence chart of the trace log according to the embodiment.

Fig. 10 is a diagram showing another example of data stored in the index table.

Fig. 11 is a diagram showing an example of a program described by the SFC.

Detailed Description

Hereinafter, the programmable logic controller 100 according to the embodiment of the present invention will be described in detail with reference to the drawings.

(embodiment mode)

The programmable logic controller 100 shown in fig. 1 executes a command of a control program in accordance with an input signal supplied from a detector in a control system, a production system, or the like, and supplies an output signal to a controlled device to control the controlled device. The detector is, for example, a sensor or a switch. The controlled devices are, for example, actuators, solenoid valves, display lamps.

The programmable logic controller 100 (hereinafter, PLC 100) executes commands in order from the first command to the last command of the control program, and if the last command is executed, the programmable logic controller executes commands in order from the first command again. The PLC100 is sometimes called a scan from the first command execution to the last command execution of the control program. The time at which the PLC100 completes execution of a command of a round of control program is sometimes referred to as a scan time.

In the embodiment, the PLC100 executes a control program described in a sequence function chart (hereinafter, SFC). The PLC100 has a function of tracking an execution path of a program step during execution of a control program.

The development tool 500 is a personal computer in which a dedicated application having a program creation function is installed. The development tool 500 has a function of displaying information indicating an execution path of a program step based on a trace log recorded by the PLC100, in addition to a program creation function.

As shown in fig. 2, the PLC100 has, as a hardware configuration, a nonvolatile memory 11 that stores various programs and data, a volatile memory 12 that stores a trace log, an input/output interface 13 that transmits and receives data to and from the detector 801 and the controlled device 802, a connection interface 14 that communicates with the development tool 500, and an mpu (micro Processing unit)15 that controls the entire PLC 100. The nonvolatile memory 11, the volatile memory 12, the input/output interface 13, and the connection interface 14 are connected to the MPU15 via a bus 19, and communicate with the MPU 15.

The nonvolatile memory 11 stores programs for realizing various functions of the PLC100 and data used when executing the programs. For example, the nonvolatile memory 11 stores firmware that controls the MPU 15. In the embodiment, the functions of the firmware of the PLC100 include a function of executing a preceding process necessary for executing the trace and a function of tracing the execution of the program step of the user program 111. The nonvolatile memory 11 stores an application program. In the embodiment, the user program 111 is stored in the nonvolatile memory 11. The nonvolatile Memory 11 includes, for example, an EEPROM (Electrically Erasable Programmable Read-Only Memory), a flash Memory, and a hard disk drive.

The user program 111 is a program developed by a user using the SFC, and is a control program for causing the MPU15 to realize a function of controlling the controlled device. The user is, for example, an administrator of the PLC 100.

The volatile memory 12 is used as a memory for storing the trace log. The volatile memory 12 is used as a work memory of the MPU 15. The volatile memory 12 includes, for example, a ram (random Access memory).

The input/output interface 13 is a connection interface for the PLC100 to communicate with the detector 801 and the controlled device 802. The input/output interface 13 converts data supplied from the MPU15 into an electric signal, and transmits the converted signal to the controlled device 802 via the connection cable 701. The input/output interface 13 restores the electric signal received from the detector 801 via the connection cable 701 to data and outputs the data to the MPU 15.

The connection interface 14 includes, for example, a USB controller, converts data supplied from the MPU15 into an electric signal, and transmits the converted signal to the development tool 500 via the connection cable 702. The connection interface 14 receives the electrical signal output from the development tool 500 via the connection cable 702, restores the received electrical signal to data, and outputs the data to the MPU 15. The connection cable 702 is, for example, a USB cable.

The MPU15 executes various programs stored in the nonvolatile memory 11 to realize various functions of the PLC 100. For example, the MPU15 performs an operation using a value indicated by the input signal supplied from the detector 801 by executing the user program 111 stored in the nonvolatile memory 11, and supplies an output signal based on a value indicating the operation result to the controlled device 802.

The development tool 500 has a memory 51 for storing various programs and data, an input device 52 for detecting an input operation by a user, a display device 53 for displaying an image, a connection interface 54 for communicating with the PLC100, and a cpu (central Processing unit)55 for controlling the entire development tool 500 as a hardware configuration. The memory 51, the input device 52, the display device 53, and the connection interface 54 are connected to the CPU55 via the bus 59, and communicate with the CPU 55.

The memory 51 includes volatile memory and nonvolatile memory. The memory 51 stores programs for realizing various functions of the development tool 500 and data used when executing the programs. In the embodiment, the memory 51 stores the log display program 511. The log display program 511 is a program for causing the CPU55 to realize a function of displaying the trace log. Also, the memory 51 is used as a work memory of the CPU 55.

The input device 52 includes an input device such as a keyboard or a mouse, detects an input operation by a user, and supplies a signal indicating the detected input operation by the user to the CPU 55. The display device 53 includes a display, and displays an image based on a signal supplied from the CPU55 on the display.

The connection interface 54 includes, for example, a USB controller, converts data supplied from the CPU55 into an electric signal, and transmits the converted signal to the PLC100 via the connection cable 702. The connection interface 54 receives the electric signal output from the PLC100 via the connection cable 702, restores the received electric signal to data, and outputs the data to the CPU 55.

The CPU55 executes various programs stored in the nonvolatile memory 11 to realize various functions of the development tool 500. In the embodiment, the CPU55 executes the log display program 511 to display the trace log recorded by the PLC100 on the display device 53.

Next, a functional configuration of the PLC100 will be described with reference to fig. 1. The PLC100 functionally includes a program storage unit 110 that stores a control program, a program execution unit 120 that executes the control program, a trace prior processing unit 130 that assigns an index to each program step of the control program, an index information storage unit 140 that stores data related to the index, a trace execution unit 150 that traces the execution of the program step, and a trace log storage unit 160 that stores a trace log.

The program storage unit 110 stores a control program executed by the PLC100 to control a controlled device. The control program corresponds to the user program 111 shown in fig. 2. The function of the program storage unit 110 is realized by the nonvolatile memory 11 shown in fig. 2.

An example of the user program 111 is shown in fig. 3. In the example shown in fig. 3, the user program 111 includes a plurality of program blocks. The program block is obtained by dividing the process executed by the PLC100 in units of functions, for example.

The user program 111 described by the SFC is executed as follows. Since the user program 111 includes a plurality of blocks, the processing is performed in the order from a block with a small block number to a block with a large block number. Furthermore, in this scan, the program steps of the inactive program block are not processed. The activated program steps of the activated program blocks are processed in sequence.

An example of the processing of the program step will be described with reference to fig. 3. For example, it is assumed that block 0 is active at the nth (N is a positive integer) scan, and step 0 of block 0 is active. In this case, step 0 of block 0 is executed. When the step 0 of the block 0 is executed, if the transition condition T02 between the step 0 of the block 0 and the step 2 of the block 0 is satisfied, the step 0 of the block 0 becomes inactive and the step 2 of the block 0 becomes active. On the other hand, when the transition condition T02 is not satisfied, step 2 of block 0 remains inactive, and step 0 of block 0 remains active. For example, it is assumed that the transition condition T02 between block 0 and block 0, step 2 is satisfied. In this case, step 0 of block 0 becomes inactive and step 2 of block 0 becomes active.

Then, if the block 1 is in the activated state, the activated program step of the block 1 is executed, and if the block 1 is in the inactivated state, all the program steps of the block 1 are not executed. For example, block 1 is set to the active state, and step 1 of block 1 is activated. In this case, step 1 of block 1 is executed. When the program step 1 of the block 1 is executed, if the transition condition T12 between the program step 1 of the block 1 and the program step 3 of the block 1 is satisfied, the program step 1 of the block 1 becomes inactive and the program step 3 of the block 1 becomes active. On the other hand, when the transition condition T12 is not satisfied, step 1 of block 1 remains activated.

Then, if the block 2 is in the activated state, the activated program step of the block 2 is executed, and if the block 2 is in the inactivated state, all the program steps of the block 2 are not executed.

In the N +1 th scan, if the block 0 is in the active state, the active state of the block 0 is executed. For example, block 0 is set to the active state and step 2 of block 0 is activated. In this case, step 2 of block 0 is executed. When step 2 of block 0 is executed, for example, when the transition condition T04 between step 2 of block 0 and step 0 of block 0 is satisfied, step 2 of block 0 becomes inactive and step 0 of block 0 becomes active.

Then, if the block 1 is in the activated state, the activated program step of the block 1 is executed, and if the block 1 is in the inactivated state, all the program steps of the block 1 are not executed. And if the block 2 is in the activated state, the activated program step of the block 1 is executed, and if the block 2 is in the inactivated state, all the program steps of the block 1 are not executed.

In the N +2 th scan, if the block 0 is in the active state, the active state of the block 0 is executed. For example, block 0 is set to the active state and step 0 of block 0 is activated. In this case, step 0 of block 0 is executed. When step 0 of block 0 is executed, for example, when the transition condition T02 between step 0 of block 0 and step 2 of block 0 is satisfied, step 0 of block 0 becomes inactive and step 2 of block 0 becomes active.

The program execution unit 120 shown in fig. 1 executes the control program every execution cycle. The function of the program execution unit 120 is realized by the MPU15 shown in fig. 2. The program execution unit 120 is an example of the execution unit of the present invention.

The trace prior processing unit 130 shown in fig. 1 assigns a unique number to a program step in the control program stored in the program storage unit 110, and stores data indicating the correspondence relationship between the program step and the number in the index information storage unit 140. Specifically, the trace prior processing unit 130 assigns a sequence number unique within the user program 111 to each program step of the user program 111 shown in fig. 3. This sequence number is referred to as an index. The process of assigning an index to a program step is sometimes referred to as index assignment process. The tracking prior processing unit 130 executes the index assignment process as a part of the initialization process after the power is turned on, for example. The function of the trace prior processing unit 130 is realized by the MPU15 shown in fig. 2. The tracking prior processing unit 130 is an example of the assigning unit of the present invention.

The reason why the tracking prior processing unit 130 assigns the index to the program step is as follows. As described above, the program steps of the plurality of program blocks of the user program 111 are executed in parallel in the same scan. Since the program steps are executed across program blocks, if only the program step numbers created at the time of creating the user program 111 are recorded, the execution path of the program steps and the number of times of execution of each program step cannot be determined.

Further, for example, a plurality of blocks for grouping processes for each function may exist in the user program 111. Since the program step numbers indicating the program steps are coded in the program blocks, the program steps having the same program step number may exist in different program blocks. In this case, at the time of tracing, if only the program step number created at the time of creating the user program 111 is recorded, it is not possible to determine to which block the program step belongs.

The index information storage unit 140 stores data for tracking the index assigned by the previous processing unit 130. Specifically, the index information storage unit 140 has an index table 1401 as shown in fig. 4. An index assigned to a program step determined by a block number and a program step number is stored in the index table 1401. The function of the index information storage unit 140 is realized by the nonvolatile memory 11 shown in fig. 2. The program steps in the control program are an example of the program steps of the present invention. The index information storage unit 140 is an example of the program step information storage means of the present invention. The data stored in the index table 1401 is an example of the program step information of the present invention. The block number is an example of identification information for identifying the block of the present invention. The program step number is an example of identification information for identifying a program step in the program block of the present invention.

The trace execution unit 150 shown in fig. 1 traces the execution of the program steps executed by the program execution unit 120, and stores the trace log in the trace log storage unit 160. The function of the trace execution unit 150 is realized by the MPU15 shown in fig. 2. The trace execution unit 150 is an example of the logging unit of the present invention.

Specifically, the trace execution unit 150 starts the trace if it receives a start instruction to execute the trace from the development tool 500. The trace execution unit 150 includes a counter (hereinafter, scan counter) for counting the number of times of scanning by the program execution unit 120 to execute the control program. Hereinafter, the number of times of scanning by the program execution unit 120 to execute the control program may be referred to as the number of scans. The initial value of the sweep counter is, for example, "1". If the traced procedure step is the last procedure step, the trace execution unit 150 adds, for example, 1 to the value of the scan counter.

When the program execution unit 120 executes a program step, the trace execution unit 150 reads an index assigned to the program step from the index table 1401 shown in fig. 4, and stores a log indicating the content of the program step indicated by the value of the executed index in the trace log storage unit 160 in the scan indicated by the value of the scan counter. The trace executing unit 150 stores the log in the trace log storing unit 160 each time the program executing unit 120 executes a program step. In addition, if the program execution unit 120 executes the last program step of the control program, the trace execution unit 150 increments the scan counter value. This is because the program executing section 120 completes 1 scan of the control program.

The trace log storage unit 160 stores data indicating the trace log recorded by the trace execution unit 150. Fig. 5 shows an example of the trace log stored in the trace log storage unit 160. In the illustrated example, indexes of executed program steps are sequentially recorded for each number of scans. The index described on the leftmost side indicates the program step executed first in the scan, and the index described on the rightmost side indicates the program step executed last in the scan. The function of the trace log storage unit 160 is realized by the volatile memory 12 shown in fig. 2. The number of scans included in the trace log is an example of information for determining the number of execution cycles of the present invention.

As shown in fig. 1, the development tool 500 functionally includes a trace execution instructing unit 510 that instructs the PLC100 to execute trace, a trace log reading unit 520 that reads data including a trace log from the PLC100, and a display unit 530 that displays a result of the trace based on the trace log.

The trace execution instructing unit 510, upon receiving an instruction to start execution of the trace from the user, outputs an instruction to start the trace of the execution program to the PLC 100. The trace execution instruction unit 510 receives an instruction from the user, and instructs the PLC100 to stop the execution of the trace. The function of the trace execution instructing unit 510 is realized by the input device 52, the connection interface 54, and the CPU55 shown in fig. 2.

Upon receiving an instruction to read the trace log from the user, the trace log reading unit 520 reads the trace log and data necessary for displaying the log from the PLC 100. Specifically, the trace log reading unit 520 reads the trace log stored in the trace log storage unit 160 of the PLC100, the data of the index table 1401 stored in the index information storage unit 140, and the control program stored in the program storage unit 110, and outputs the read control program to the display unit 530. The functions of the trace log reading unit 520 are realized by the input device 52, the connection interface 54, and the CPU55 shown in fig. 2. The trace log reading unit 520 is an example of a reading unit of the present invention.

When the trace log, the data of the index table 1401, and the control program are supplied from the trace log reading unit 520, the display unit 530 generates an image indicating the result of tracing, and displays the generated image on the display device 53. The function of the display section 530 is realized by the display device 53 and the CPU55 shown in fig. 2. The display portion 530 is an example of a display unit of the present invention.

Next, a process in which the tracking prior processing unit 130 assigns an index to each program step of the control program before tracking will be described. The tracking prior processing unit 130 executes the index assignment process described below as a part of the initialization process of the PLC 100.

As shown in fig. 6, the trace prior processing unit 130 assigns an index to the next program step before assigning indices to all program steps in the control program (step S11; No), and stores the indices, the block numbers to which the program steps belong, and the program step numbers of the program steps in an index table 1401 shown in fig. 4 (step S12). If the tracking prior processing unit 130 has assigned indexes to all the program steps in the control program (step S11; Yes), the index assignment processing is terminated. The above is the index assignment process.

Next, a process of tracking the execution of the program steps of the control program by the tracking execution unit 150 will be described.

The trace execution unit 150 starts the trace processing if the trace execution instruction unit 510 of the development tool 500 outputs the trace execution instruction in accordance with the instruction of the user. For example, after the start of tracking is instructed from the development tool 500, the user switches the operation mode of the PLC100 to the execution mode of the control program. Thereby, the program execution unit 120 starts execution of the control program.

As shown in FIG. 7, if the trace execution unit 150 determines that the program execution unit 120 has executed the program step (step S21; Yes), the trace execution unit 150 reads the index of the executed program step from the index table 1401 (step S22). Next, the tracking execution unit 150 reads the current value of the scan counter and acquires the current scan count (step S23). The trace execution unit 150 records the value of the index read in step S22 in the trace log storage unit 160 as the program step executed in the scan indicated by the current scan number (step S24).

The trace execution unit 150 determines whether or not the target program step is the last program step of the control program (step S25). If the program step is the last program step of the control program (step S25; Yes), the tracking execution unit 150 increments the value of the scan counter (step S26), and if the program step is not the last program step (step S25; No), the step S27 is executed.

In step S27, the trace execution unit 150 determines whether or not a stop instruction for the trace has been received from the development tool 500 (step S27). When the instruction to stop tracking is not received (step S27; No), the tracking execution unit 150 executes the process of step S21 again. On the other hand, when the instruction to stop tracking is received (step S27; Yes), the tracking execution unit 150 ends the tracking process. The above is the tracking process. As described above, the trace execution unit 150 executes the trace processing, and the log as shown in fig. 5 is stored in the trace log storage unit 160 of the PLC 100.

It is assumed that the user instructs the display of the trace log after the instruction to stop the trace is made. In response to this, the trace log reading unit 520 reads the trace log, the data of the index table 1401, and the control program from the PLC 100. The trace log reading unit 520 outputs the read data to the display unit 530.

For example, the display unit 530 is supplied with a trace log as shown in fig. 5. In the example shown in the figure, step 0 of block 0 and step 0 of block 1 are executed at the 1 st scan, and step 2 of block 0 and step 2 of block 1 are executed at the 2 nd scan. At the 3 rd scan, program step 0 of block 0 and program step 2 of block 1 are executed. The display unit 530 displays a screen as shown in fig. 8A based on the trace log of scan 1.

Here, the display unit 530 displays the user program 111 as shown in fig. 8A, and displays the program step 0 of the block 0 with hatching so that the user can visually recognize from the log of the 1 st scan that the program step 0 of the block 0 indicated by the index 1 is executed first. The display unit 530 displays the number of times the program step 0 of the block 0 has been executed up to this point. In the illustrated example, since step 0 of block 0 is not executed until the 1 st scan, step 0 of block 0 is displayed with "1" as the number of executions. In this way, the display section 530 displays the number of execution times of the program step beside the program step number. Thereby, the user can visually recognize that the program step is executed several times. Then, the display unit 530 displays the scan number.

Here, it is assumed that the user presses the button of "next program step". In response to this, the display section 530 displays a screen as shown in fig. 8B. In the illustrated example, the display unit 530 displays the program steps to be executed next, i.e., the program step 0 of the block 1, with hatching. Then, the user presses the button for "next program step". In response to this, the display section 530 displays a screen as shown in fig. 8C. In the illustrated example, the display unit 530 displays the block 0 in which the program step 2 is shaded.

Here, it is assumed that the user presses the button of "next program step". In response to this, the display section 530 displays a screen as shown in fig. 8D. In the illustrated example, the display unit 530 displays the program steps to be executed next, i.e., the program step 2 of the block 1, with hatching. Here, it is assumed that the user presses the button of "next program step". In response to this, the display section 530 displays a screen as shown in fig. 8E. In the illustrated example, the display unit 530 displays the program steps to be executed next, i.e., the program step 0 of the block 0, with hatching. Since step 0 of block 0 is executed 2 times at the time point of the 2 nd scan, "2" is displayed as the execution count for step 0 of block 0.

For example, when the user presses the button "previous program step" in the state in which fig. 8E is displayed, the display unit 530 displays a screen indicating the program step executed before as shown in fig. 8D.

The development tool 500 displays the trace log in such a manner that the user can confirm the execution path of the program step by step. Also, the development tool 500 displays the number of execution times of the program step in association with the program step number. Thereby, the user can visually recognize that the program step is executed several times.

As shown in fig. 9A, the display unit 530 may display the program executed in each scan step on 1 screen. The display unit 530 displays the program steps 0 and 1 of the blocks 0 and 1 by hatching so that the program steps 0 and 1 of the blocks 0 and 1 can be visually recognized in 1 scan. Then, the display unit 530 displays numbers indicating the order of executing the program steps. In the illustrated example, a screen indicating a trace log of 1 scan is displayed, but if the user performs a pull-down operation, for example, the display unit 530 displays a screen indicating a trace log of a designated scan.

In addition, the display unit 530 can also display a time chart as shown in fig. 9B. In the illustrated example, the 1 st to 4 th scans are displayed, but the user can display the time chart at the time of the 5 th and subsequent scans by sliding the scroll bar B1. In the illustrated example, the program steps from block 0 to block 2 are displayed from step 0, but the user can display the sequence chart of the subsequent program step by sliding the scroll bar B2.

The development tool 500 displays the trace log in such a manner that the user can confirm the passage of the execution of the program step.

As described above, the PLC100 according to the embodiment records the scan number and the index for specifying the program step as the trace log in association with each other. Thus, the user can confirm the execution path and the execution count of the program step of the program in units of the execution cycle.

Since the PLC100 assigns a unique number to each program step in the control program, even if the program is divided into a plurality of blocks in units of function, and program steps assigned the same number exist in different blocks, it is possible to track the execution path and the execution count of the program steps.

In addition, by using the index as the program step information for specifying the program step recorded in the trace log, it is possible to suppress the memory capacity required for storing the trace log, as compared with, for example, recording the block number and the program step number in the trace log.

In the above embodiment, an example in which a numerical value is used as an index has been described, but the present invention is not limited thereto. For example, as shown in fig. 10, the index may include a numerical value and a text. In the illustrated example, the index contains a block number and a step number, and for example "B02S 00" indicates step 0 of block 2.

In the embodiment, the example in which the PLC100 assigns an index to each command has been described, but the development tool 500 may assign an index to each command, create data in an index table 1401 shown in fig. 4, for example, and transmit the created data to the PLC 100.

In the embodiment, the function of the trace log storage unit 160 is realized by the volatile memory 12, but the present invention is not limited thereto. The function of the trace log storage unit 160 may be realized by a nonvolatile memory. As the nonvolatile memory, for example, a flash memory such as a usb (universal Serial bus) memory or an sd (secure digital) memory card can be used.

In the embodiment, the example in which the firmware has the function of performing the preceding processing necessary for the execution of the trace and the function of tracing the execution of the program step of the control program has been described, but the present invention is not limited to this. For example, the os (operating system) may have these functions. Alternatively, the nonvolatile memory 11 of the PLC100 may store a program for causing the MPU15 to realize a function of performing a preceding process necessary for executing the execution trace, and a program for causing the MPU15 to realize a function of tracing the execution of the program of the control program. In this case, the MPU15 realizes a function of performing a preceding process necessary for execution of trace and a function of tracing execution of program steps of the control program by executing these programs. Alternatively, the MPU15 may realize these functions by executing a program stored in another computer connected via a network.

As a recording medium for recording the program for realizing the functions of the PLC100, a computer-readable recording medium including a magnetic disk, an optical disk, a magneto-optical disk, a flash memory, a semiconductor memory, and a magnetic tape can be used.

The means for realizing the functions of the PLC100 is not limited to software, and a part or all of them may be realized by dedicated hardware. For example, as the dedicated hardware, a circuit typified by an fpga (field Programmable Gate array) or an asic (application Specific Integrated circuit) can be used.

The present invention is capable of various embodiments and modifications without departing from the spirit and scope in its broadest form. The above embodiments are illustrative of the present invention, and do not limit the scope of the present invention. That is, the scope of the present invention is shown not by the embodiments but by the claims. Further, various modifications made within the scope of the claims and within the meaning of the equivalent invention are considered to be within the scope of the present invention.

Description of the reference numerals

B1, B2 scroll bar, 11 nonvolatile memory, 12 volatile memory, 13 input/output interface, 14, 54 connection interface, 15, 140MPU, 19, 59 bus, 51 memory, 52 input device, 53 display device, 55CPU, 100 Programmable Logic Controller (PLC), 110 program storage unit, 111 user program, 120 program execution unit, 130 trace previous processing unit, 140 index information storage unit, 150 trace execution unit, 160 trace log storage unit, 500 development tool, 510 trace execution instruction unit, 511 log display program, 520 trace log reading unit, 530 display unit, 701, 702 connection cable, 801 detector, 802 controlled device, 1401, 1402 index table.

25页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:作业辅助装置及作业辅助系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类