Development support device, development support method, and development support program

JP7631921B2Active Publication Date: 2025-02-19OMRON CORP
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
JP2021039324
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-03-11
Publication Date
2025-02-19
Estimated Expiration
2041-03-11

AI Technical Summary

Benefits of technology

【0024】 本開示によれば、制御対象を制御する制御装置用の制御プログラム内の削除可能な不要な変数を削除することができる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007631921000001
    Figure 0007631921000001
  • Figure 0007631921000002
    Figure 0007631921000002
  • Figure 0007631921000003
    Figure 0007631921000003
Patent Text Reader

Abstract

To provide a development support device, a development support method, and a development support program that can remove unnecessary removable variables in a control program for a controller controlling a controlled object.SOLUTION: When a source code of a control program (210) for a controller (200) controlling a controlled object (300) is edited according to a user operation, a development support device (100) extracts, from a variable declaration defining variables referred to by command elements included in the source code, unused variables not referred to by the command elements included in the edited source code, and notifies a user of the extracted unused variables through an interface. The development support device (100) removes the unused variables from the variable declaration according to user input instructing the removal of the unused variables through the interface to update the variable declaration.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a technique for supporting the development of a control program for a control device that controls a controlled object. [Background technology]

[0002] Control devices such as PLCs (Programmable Logic Controllers) are being introduced in various manufacturing sites. Such control devices are a type of computer, and can control controlled objects such as manufacturing devices and manufacturing facilities by executing control programs designed according to the controlled objects. In general, such control programs are created using a development support device that is prepared separately from the controller.

[0003] Such a control program is generally written using variables that are declared in advance. For example, Japanese Patent Laid-Open Publication No. 2005-352612 (Patent Document 1) discloses a program development support device that can improve the efficiency of developing a control program by improving the searchability of variables. In the program development support device of Patent Document 1, when an operand for a predetermined instruction is input, in response to a keyword (character string) specification, a list of only variables whose variable names include the character string is displayed, thereby improving the searchability of variables. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2005-352612 A Summary of the Invention [Problem to be solved by the invention]

[0005] In the source program of the above control program, a definition list for declaring variables is provided, and variables declared in the definition list are available for use in the source code.

[0006] On the other hand, when the control program is modified or edited, if a variable deleted from the source code remains in the definition list, a memory area corresponding to the variable is reserved when the control program is executed. Therefore, from the viewpoint of appropriately reserving memory area in the control device, it is preferable to delete unnecessary variables from the definition list.

[0007] On the other hand, when a control program is executed, a network is constructed between the control device and the controlled object to control the controlled object, so there is a concern that deleting a necessary variable may cause inconvenience on the controlled object side.

[0008] The present disclosure has been made to solve the above-mentioned problems, and an object of one aspect is to provide a development support device capable of deleting unnecessary deletable variables in a control program.An object of another aspect is to provide a development support method capable of deleting unnecessary deletable variables in a control program.An object of yet another aspect is to provide a development support program capable of deleting unnecessary deletable variables in a control program. [Means for solving the problem]

[0009] According to an example of the present disclosure, a development support device for supporting development of a control program for a control device that controls a control target is provided. The development support device includes an editor, a storage unit, an interface, an extraction unit, and a deletion unit. The editor generates and edits source code of the control program in accordance with a user operation. The storage unit stores the source code and a variable declaration that defines variables referenced by command elements included in the source code. The interface interacts with the user. When the source code is edited by the editor, the extraction unit extracts, from the variable declaration, unused variables that are not referenced by command elements included in the edited source code. The extraction unit notifies the user of the extracted unused variables via the interface. The deletion unit updates the variable declaration by deleting the unused variables from the variable declaration in accordance with a user input instructing the deletion of the unused variables via the interface.

[0010] According to the present disclosure, in the development support device, each time the source code is edited according to a user operation, unused variables are extracted and the extracted unused variables are deleted, so that it is possible to prevent variables that have become unused due to editing of the source program from accumulating in the variable declaration. Furthermore, according to the present disclosure, only unused variables that are instructed to be deleted by the user via the interface are deleted from the variable declaration, so that it is possible to delete deletable variables in the control program by excluding variables that are unused in the source code but affect the controlled object, such as variables used in the controlled object.

[0011] In the above disclosure, the extraction unit extracts unused variables from the variable declarations when the source code is edited by an editor and at least some instruction elements are deleted from the source code.

[0012] According to this disclosure, when source code is edited according to user operation and there is a possibility that unused variables will be generated by deleting instructions from the source code, unused variables are extracted, so that unused variables can be deleted efficiently.

[0013] In the above disclosure, the extraction unit determines the consistency between variables referenced by command elements included in the modified portion of the source code and variable declarations, and extracts unused variables if it is determined that there is no consistency.

[0014] According to this disclosure, extraction of unused variables is limited to modified portions of edited source code that may result in unused variables, thereby enabling efficient deletion of unused variables.

[0015] In the above disclosure, when the extracted unused variable is an internal variable, the extraction unit notifies the user of the extracted unused variable via an interface.

[0016] According to this disclosure, if an unused variable is an internal variable, the unused variable is deleted from the variable declaration, so that unused variables that can be deleted from the control program can be deleted by excluding variables (input variables, output variables, etc.) that will affect the controlled object if deleted.

[0017] According to another example of the present disclosure, there is provided a development support device for supporting development of a control program for a control device that controls a control target. The development support device includes an editor, a storage unit, an extraction unit, and a deletion unit. The editor generates and edits source code of the control program in accordance with a user operation. The storage unit stores the source code and a variable declaration that defines variables referenced by command elements included in the source code. When the source code is edited by the editor, the extraction unit extracts, from the variable declaration, unused variables that are not referenced by command elements included in the edited source code. When the unused variables extracted by the extraction unit are variables that have been changed from a used state to an unused state by editing the source code, the deletion unit updates the variable declaration by deleting the unused variables from the variable declaration.

[0018] According to this disclosure, in the development support device, each time the source code is edited according to a user operation, unused variables are extracted and the extracted unused variables are deleted, so that it is possible to prevent variables that have become unused due to editing of the source program from accumulating in the variable declaration. Furthermore, according to this disclosure, variables that are unused in the source code but affect the controlled object side, such as variables used in the controlled object, can be excluded from the deletion target because they are originally unused variables and are not changed from a used state to an unused state by editing the source code. Therefore, even if the configuration is such that unused variables are automatically deleted without a deletion instruction from the user, it is possible to delete deletable variables in the control program by excluding variables that affect the controlled object side.

[0019] In the above disclosure, the development support device further includes a builder, which generates an execution code of the control program from the source code and the variable declarations.

[0020] According to this disclosure, execution code is generated from edited source code and variable declarations from which unused variables that can be deleted have been deleted, thereby preventing the control device from having to secure memory space for storing unused variables.

[0021] According to yet another example of the present disclosure, there is provided a development support method for supporting development of a control program for a control device that controls a controlled object, the development support method includes the steps of generating and editing a source code of the control program in accordance with a user operation, storing the source code and a variable declaration that defines variables referenced by command elements included in the source code, extracting unused variables that are not referenced by command elements included in the edited source code from the variable declaration when the source code is edited, notifying a user of the extracted unused variables via an interface, and updating the variable declaration by deleting the unused variables from the variable declaration in accordance with a user input via the interface instructing the deletion of the unused variables.

[0022] According to yet another example of the present disclosure, there is provided a development support program for supporting development of a control program for a control device that controls a controlled object. The development support program causes a computer to execute the steps of generating and editing source code of the control program in accordance with a user operation, storing the source code and a variable declaration that defines variables referenced by command elements included in the source code, extracting unused variables from the variable declaration when the source code is edited, which are not referenced by command elements included in the edited source code, notifying a user of the extracted unused variables via an interface, and updating the variable declaration by deleting the unused variables from the variable declaration in accordance with a user input via the interface instructing the deletion of the unused variables.

[0023] According to this disclosure, the development support method and the development support program extract unused variables each time the source code is edited according to a user operation, and delete the extracted unused variables, so that it is possible to prevent variables that have become unused due to editing of the source program from accumulating in the variable declaration.Furthermore, according to this disclosure, only unused variables that are instructed to be deleted by the user via the interface are deleted from the variable declaration, so that it is possible to delete deletable variables in the control program by excluding variables that are unused in the source code but affect the controlled object, such as variables used in the controlled object. Effect of the Invention

[0024] According to the present disclosure, it is possible to delete unnecessary variables that can be deleted from a control program for a control device that controls a controlled object. [Brief description of the drawings]

[0025] [Figure 1] 1 is a schematic diagram showing an example of a configuration of an FA system to which a development support device according to an embodiment is applied; [Diagram 2]It is a schematic diagram showing an example of the hardware configuration of the development support device. [Diagram 3] It is a diagram showing an example of the functional configuration of the development support device. [Figure 4] It is a diagram schematically showing an example of the development environment of the control program in the development support device. [Diagram 5] It is a flowchart showing an example of the schematic processing of control program development in the development support device. [Figure 6] It is a conceptual diagram for explaining the determination process shown in FIG. 5. [Figure 7] It is a flowchart showing a first embodiment of the determination process. [Figure 8] It is a diagram showing an example of the display of the variable definition list on the display unit. [Figure 9] It is a flowchart showing a second embodiment of the determination process. [Figure 10] It is a flowchart showing a third embodiment of the determination process. [Figure 11] It is a flowchart showing a fourth embodiment of the determination process. [Figure 12] It is a diagram showing an example of the variable definition list applied to the fourth embodiment. [Figure 13] It is a flowchart showing a fifth embodiment of the determination process.

Embodiments for Carrying Out the Invention

[0026] Hereinafter, each embodiment according to the present invention will be described with reference to the drawings. In the following description, the same parts and components are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed descriptions thereof will not be repeated in principle.

[0027] <A. Application Example> FIG. 1 is a schematic diagram showing an example of the configuration of an FA (Factory Automation) system 10 to which the development support device according to the present embodiment is applied. First, with reference to FIG. 1, the system configuration of the FA system 10 will be described.

[0028] The FA system 10 includes one or more development support devices 100, one or more control devices (controllers) 200, and an external device 300 controlled by the control devices 200.

[0029] The development support device 100 is, for example, a notebook or desktop PC (Personal Computer), a tablet terminal, a smartphone, or any other information processing device.

[0030] A development support program 50 is installed in the development support device 100. The development support program 50 is an application for supporting the development of a control program 210 for the control device 200. The development support program 50 is, for example, "Sysmac Studio" manufactured by Omron Corporation. A user can design a control program for the control device 200 on the development support program 50 and download the designed control program 210 to the controller. Alternatively, the development support device 100 can upload data and the like from the control device 200.

[0031] The control device 200 and the external device 300 are connected to a network NW1 to which the development support device 100 can be connected. Ethernet (registered trademark) or the like is adopted for the network NW1. The control device 200 is configured by, for example, a PLC.

[0032] The control device 200 and the external device 300 are connected to a network NW2. It is preferable to use a field network that performs periodic communication and guarantees the arrival time of data for the network NW2. As a field network that performs such periodic communication, OPC UA (registered trademark) and the like are known.

[0033] The external device 300 is composed of various industrial devices for automating the production process, various sensors, and an HMI (Human Machine Interface) device, etc. The external device 300 includes devices 300A to 300C connected to the network NW1 or NMW2, and devices 301A to 301C. The devices 301A to 301C are communicatively connected to the control device 200 via the networks NW1 and NW2 by the devices 300A to 300C. Thereby, the devices 301A to 301C can be controlled by the control program executed by the control device 200. That is, the external device 300 corresponds to the "controlled object" controlled by the control program.

[0034] In the example of FIG. 1, it is assumed that the device 300A connected to the device 301A is connected to the network NW2 to which OPC UA is applied. Also, it is assumed that the device 300B connected to the device 301B and the device 300C connected to the device 301C are connected to the network NW1 to which EtherNET is applied.

[0035] <B. Hardware Configuration of Development Support Device> Referring to FIG. 2, the hardware configuration of the development support device 100 will be described. FIG. 2 is a schematic diagram showing an example of the hardware configuration of the development support device 100.

[0036] The development support device 100 is, for example, a computer configured according to a general-purpose computer architecture. The development support device 100 includes a processor 102 such as a CPU (Central Processing Unit) or an MPU (Micro-Processing Unit), a main memory 104, a communication interface 111, an I / O (Input / Output) interface 114, a display interface 117, and a non-volatile storage device 120. These components are communicatively connected to each other via an internal bus 125.

[0037] The processor 102 launches a development tool for a control program 210 (see FIG. 1) by expanding the development support program 50 stored in the storage device 120 into the main memory 104 and executing it. In addition to the development support program 50, the storage device 120 stores various data and programs 60. The source program of the control program 210 is stored in the main memory 104 or the storage device 120.

[0038] The communication interface 111 exchanges data with other communication devices via a network. The other communication devices include, for example, the control device 200 and the external device 300 shown in Fig. 1, and a server (not shown). The development support device 100 may be configured to be able to download various programs, such as the development support program 50, from the other communication devices via the communication interface 111.

[0039] The I / O interface 114 is connected to an operation unit 115, and receives a signal indicating a user operation from the operation unit 115. The operation unit 115 typically includes a keyboard, a mouse, a touch panel, a touch pad, etc., and accepts operations from a user. The operation unit 115 may be configured integrally with the development support device 100, or may be configured separately from the development support device 100.

[0040] The display interface 117 is connected to the display unit 118, and sends an image signal for displaying an image to the display unit 118 in accordance with a command from the processor 102 or the like. The display unit 118 is configured with an LCD (Liquid Crystal Display), an organic EL (Electro Luminescence) display, or the like, and presents various information to the user. The display unit 118 may be configured integrally with the development support device 100, or may be configured separately from the development support device 100.

[0041] Note that, in FIG. 2, a configuration example is shown in which functions necessary for a processor 102 such as a CPU execute a program. However, some or all of these provided functions may be implemented using a dedicated hardware circuit (for example, an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array), etc.). In this case, virtualization technology may be used to concurrently execute a plurality of OSs with different uses and to execute necessary applications on each OS. Also, in the above description, a form in which the development support device 100 executes all processes is exemplified, but the present invention is not limited to this, and a plurality of devices may cooperate to provide the functions as described above. Furthermore, some or all of the functions may be realized using computing resources called a so-called cloud on a server.

[0042] <C. Functional Configuration of Development Support Device> Next, with reference to FIG. 3, the functional configuration of the development support device 100 will be described. FIG. 3 is a diagram showing an example of the functional configuration of the development support device 100.

[0043] An OS 240, a programming application 250, and a network setting application 280 are installed in the development support device 100. In the development support device 100, the OS 240 is executed, and an environment in which the programming application 250 and the network setting application 280 can be executed is provided. The development support program for realizing the development support device 100 according to the present embodiment includes at least the programming application 250.

[0044] The programming application 250 includes an editor 252, a builder 254, a debugger 256, a GUI (Graphical User Interface) module 258, a simulator 260, and a data storage unit 270. The modules included in the programming application 250 are typically distributed in a state stored on a CD-ROM, and are installed in the development support device 100. The data storage unit 270 is configured to include the storage device 120.

[0045] The editor 252 provides functions such as input and editing for generating a source program according to the specifications of a predetermined programming language. The source program includes source code and variable declarations that define variables referenced by command elements included in the source code.

[0046] The source program can typically be written in any language specified in IEC 61131-3, such as LD (Ladder Diagram), IL (Instruction List), ST (Structured Text), FBD (Function Block Diagram), SFC (Sequential Function Chart), etc.

[0047] A source program is written using "variables" in any language. A "variable" is an identifier given to data handled in the control program 210. Typically, a "variable" is data that represents the state of the control device 200 or an object controlled by the control device 200. In other words, a "variable" is data whose value changes in conjunction with the state of the control device 200 or the object controlled. The concept of a "variable" can include data that represents a single value, data represented as an array, data represented as a structure, and various types of data that can be defined in the control program 210.

[0048] Editor 252 provides a function of receiving the operation contents of operation unit 115 by the user and generating a source program according to the received operation contents, and a function of saving the generated source program. Editor 252 also provides a function of editing the source program according to the user operation. When the source program is generated or edited by editor 252, editor 252 displays information for supporting the editing work on display unit 118 via GUI module 258.

[0049] The builder 254 provides a function of building a source program according to the specifications of a predetermined programming language, and generating an executable code (the control program 210) in a format that can be executed by the control device 200.

[0050] The debugger 256 provides a function for debugging a source program. The contents of this debugging include partially executing a range of the source code specified by the user, and tracking temporal changes in variable values ​​during the execution of the source code. The debugger 256 displays information for supporting debugging on the display unit 118 via the GUI module 258.

[0051] The simulator 260 creates an environment within the development support device 100 for simulating the execution of a program in the control device 200 (PLC).

[0052] The data storage unit 270 stores various information used (read and written) by each unit of the programming application 250. The contents stored in the data storage unit 270 will be described later.

[0053] The network setting application 280 includes a configurator 257 and a data storage unit 299. The modules included in the network setting application 280 are typically distributed in a state stored on a CD-ROM, and are installed in the development support device 100.

[0054] The configurator 257 acquires network information 293 indicating the network configuration of the FA system 10, and stores the acquired network information 293 in the data storage unit 299. The network information 293 includes configuration information received (downloaded) from each control device 200 (PLC) connected to the network. Note that the configuration information included in the network information 293 includes information received from the actual control device 200 or logical (virtual) information that is not the information of the actual machine. The logical information may include information input by the user via the editor 252 by operating the operation unit 115.

[0055] <D. Development Environment of Control Program> Next, with reference to FIG. 4, the development environment of the control program in the development support device 100 will be described. FIG. 4 is a diagram schematically showing an example of the development environment of the control program in the development support device 100.

[0056] In FIG. 4, for the sake of explanation, among the programming applications 250, the editor 252 and the builder 254 are shown, and the illustration of other parts is omitted. Also, in FIG. 4, the data storage unit 270, the GUI module 258, and the transfer module 212 are shown in association with the editor 252 and the builder 254.

[0057] In FIG. 4, among the data in the data storage unit 270, the source code 271, the variable definition list 272, and the execution code 273 related to the editor 252 and the builder 254 are shown.

[0058] The editor 252 has a variable declaration generation unit 253 and a source code generation unit 255. The variable declaration generation unit 253 generates a variable definition list 272 according to a user operation received via the operation unit 115. The source code generation unit 255 converts the source program described according to the user operation into the source code 271 in a predetermined programming language by editing the source program.

[0059] The source code 271 includes a command section in which the process to be executed by the control device 200 is described using variables. The command section includes command elements described using variables. "Command elements" is a general term for elements that describe the command section of the source code 271, and includes, for example, operators, function blocks, functions, and operands. The source code 271 can be written in a programming language that can be displayed in the form of a circuit in which multiple command elements are connected to each other. The following describes source code written in LD as a typical example.

[0060] The variable definition list 272 is a variable declaration that defines variables referenced by command elements included in the source code 271. The variable definition list 272 is created by declaring at least the variable name and the data type of each variable.

[0061] The editor 252 stores the generated source code 271 and variable definition list 272 in a data storage unit 270. The data storage unit 270 corresponds to one embodiment of the "storage unit".

[0062] 4, the source code 271 and the variable definition list 272 are shown separately, but in a source program, the source code 271 and the variable definition list 272 can be integrated into a file. If a source program has multiple source codes, the variable definition list 272 can be created for each source code, or the variable definition list 272 can be created by integrating multiple source codes.

[0063] The editor 252 further includes an extraction unit 262 and a deletion unit 264. The extraction unit 262 provides a function of extracting variables (hereinafter also referred to as "unused variables") that are not referenced by command elements included in the source code 271 from the variable definition list 272. The deletion unit 264 provides a function of updating the variable definition list 272 by deleting the unused variables extracted by the extraction unit 262 from the variable definition list 272. The extraction unit 262 and the deletion unit 264 will be described later.

[0064] Builder 254 includes a compiler and a linker for a predetermined programming language. The compiler creates a plurality of object files by splitting the source code 271 into a plurality of files and compiling them file by file. The linker generates the executable code 273 by combining the plurality of created object files. The executable code 273 consists of code executable by the processor of the control device 200 and is generated using the source code 271 and the variable definition list 272 stored in the data storage unit 270.

[0065] The transfer module 212 controls the communication interface 111 to transfer (download or upload) the executable code 273 to the control device 200 (PLC).

[0066] The GUI module 258 controls the display interface 117 and the I / O interface 114 to realize the interaction between the editor 252 and the user. The GUI module 258 corresponds to an example of an "interface" for interacting with the user.

[0067] The development support device 100 transfers the executable code 273 to the control device 200 (PLC) by the transfer module 212. In the control device 200, a memory area for storing the variables declared in the variable definition list 272 is secured for the control program 210. At this time, for each variable, a memory area having a capacity according to its data type is secured.

[0068] The external devices 300 (devices 300A to 300C) can access the variables in the memory area through data communication via the network NW1 or NW2. By executing the executable code 273 by the processor inside the control device 200, the exchange of data between the plurality of control devices 200 and the control of the external devices 300 to be controlled are carried out.

[0069] <E. Processing of Control Program Development> FIG. 5 is a flowchart showing an example of the outline process of control program development in the development support apparatus 100.

[0070] Referring to FIG. 5, in the development support apparatus 100, when generating or editing a source program, first, the editor 252 is activated. The editor 252 executes edit processing of the source program (step S1). Specifically, the editor 252 edits the source program according to a user operation received via the operation unit 115, displays it on the display unit 118, and generates a source code 271 and a variable definition list 272.

[0071] When the edit processing is executed, the editor 252 executes determination processing (step S2). In the determination processing (S2), the editor 252 determines the consistency between the variables referred to by the instruction elements included in the edited source code 271 and the variable definition list 272.

[0072] <F. Determination Processing> Next, the determination processing (S2) shown in FIG. 5 will be described. FIG. 6 is a conceptual diagram for explaining the determination processing (S2) shown in FIG. 5.

[0073] FIG. 6(A) shows an example of a ladder circuit described by a ladder program which is an example of a control program, and an example of the variable definition list 272.

[0074] The ladder program is represented by a ladder circuit 420 in which a logic circuit using circuit elements and connection lines is drawn in a ladder shape between an input-side bus 421 and an output-side bus 422. The circuit element corresponds to one embodiment of the "instruction element".

[0075] In the example of FIG. 6(A), the ladder circuit 420 includes a contact 425 that is turned on / off depending on the value of the variable a, a contact 426 that is turned on / off depending on the value of the variable c, and a coil 427 that outputs the on / off result as a variable b. The ladder circuit 420 is described by connecting circuit elements such as the contacts 425, 426, and the coil 427 with each other by a connection line 423. For example, the variable b is further used as a variable for opening and closing the contact of another ladder circuit (not shown). Alternatively, the variables a and c are output values ​​of the coil of another ladder circuit (not shown). By such a hierarchical combination of ladder circuits, it is possible to describe a process for the control device 200 to control the external device 300.

[0076] The variable definition list 272 is generated by declaring at least the variable name and the data type of the variable for each variable. The data type is selectively set from predefined types such as "BOOL", "REAL" and "INT". When the source program is built by the builder 254 (FIG. 4) in the build process (S3) described later, a memory area having a capacity according to the selected data type is secured for each of the variables declared in the variable definition list 272.

[0077] Here, assume that the ladder circuit 420 shown in Fig. 6(A) has been edited by an editor (Fig. 4). Fig. 6(B) illustrates a case in which a contact 426 has been deleted from the ladder circuit 420 in accordance with a user operation. In this case, the deletion of the contact 426 causes the variable c input to the contact 426 to become an "unused variable" that is not referenced by any of the circuit elements included in the ladder circuit 420. Although not illustrated, the variable c also becomes an unused variable in a case in which the variable c input to the contact 426 is changed to another variable.

[0078] On the other hand, in the variable definition list 272 shown in Fig. 6(A), the variable c is also declared in addition to the variables a and b. Therefore, when a source program composed of the ladder circuit 420 in Fig. 6(B) and the variable definition list 272 in Fig. 6(A) is built, an area for storing the variable c (unused variable) is secured in the memory area of ​​the control device 200. Therefore, by deleting the variable c (unused variable) from the variable definition list 272 as shown in Fig. 6(C), the memory area of ​​the control device 200 can be released.

[0079] Therefore, in the judgment process (S2), the variables referenced by the circuit elements included in the edited source code 271 (FIG. 6(B)) are compared with the variables declared in the variable definition list 272 to judge the consistency between the two. If it is judged that there is no consistency between the two, unused variables that are not used in the source code 271 are extracted from the variable definition list 272, and the extracted unused variables are deleted from the variable definition list 272.

[0080] The determination process (S2) is executed when the source code 271 is edited by the edit process (S1). Therefore, every time the source code 271 is edited according to a user operation, the consistency between the edited source code 271 and the variable definition list 272 is determined, and unused variables are extracted. Then, the extracted unused variables are deleted from the variable definition list 272. By configuring in this way to execute the determination process (S2) in response to the execution of the edit process (S1), it is possible to prevent variables that have become unused due to editing of the source program from accumulating in the variable definition list 272.

[0081] 5, when building source code 271, development support device 100 starts builder 254. Builder 254 builds source code 271 and generates execution code 273 (step S3).

[0082] When transferring the execution code 273 to the control device 200, the transfer module 212 controls the communication interface 111 to transfer the execution code 273 to the control device 200 (step S4).

[0083] <G. Embodiment of the determination process> Next, a plurality of embodiments of the processing procedure of the determination process (S2 in FIG. 5) will be described with examples. Hereinafter, the plurality of embodiments will be described as independent embodiments, but the present invention is not limited thereto, and at least two of the plurality of embodiments can be combined.

[0084] <g1. First embodiment of the determination process> FIG. 7 is a flowchart showing a first embodiment of the determination process.

[0085] Referring to FIG. 7, the extraction unit 262 determines whether or not the source code 271 has been edited in step S21. If the source code 271 has not been edited (when the determination in S21 is NO), the extraction unit 262 ends the determination process and returns to the process of FIG. 5.

[0086] On the other hand, when the source code 271 has been edited (when the determination in S21 is YES), the extraction unit 262 determines the consistency between the variables referred to by the instruction elements included in the edited source code 271 and the variable definition list 272.

[0087] Specifically, the extraction unit 262 first extracts, in step S22, the variables referred to by the instruction elements included in the edited source code 271 from the edited source code 271. Next, the extraction unit 262 compares, in step S23, the variables extracted from the source code 271 with the variable definition list 272. At this time, the extraction unit 262 determines whether or not there is consistency between the extracted variables and the variables declared in the variable definition list 272.

[0088] If it is determined that there is no consistency between the extracted variables and the variable definition list 272, the extraction unit 262 proceeds to step S24, and determines whether or not there is a variable (unused variable) among the variables declared in the variable definition list 272 that is not referenced by any command element included in the edited source code 271.

[0089] On the other hand, if it is determined that there are no unused variables (NO in S24), the extraction unit 262 ends the determination process (S2) and returns to the process in Fig. 5. For example, when a command element is added to the source code 271 by the edit process (S1 in Fig. 5) and the command element refers to a variable that is not declared in the variable definition list 272, although there is no consistency between the variables extracted from the source code 271 and the variable definition list 272, there is no unused variable, and therefore the determination in S24 is NO.

[0090] If it is determined in step S24 that there are unused variables (YES in S24), the extraction unit 262 notifies the user of the unused variables via the GUI module 258. The deletion unit 264 deletes the unused variables in accordance with the user input via the GUI module 258.

[0091] Specifically, the GUI module 258 presents the variable definition list 272 to the user via the display unit 118. Fig. 8 is a diagram showing an example of the display of the variable definition list 272 on the display unit 118. In the example of Fig. 8, the variable definition list 272 is displayed in a table format that shows at least the variable name and data type for each variable. Note that the variable definition list 272 may be displayed in another format.

[0092] In step S25, the GUI module 258 uses the display unit 118 to notify the user that there is an unused variable, and asks the user to confirm whether or not to delete the unused variable. In the case shown in Fig. 6, the GUI module 258 displays a message 500 on the display unit 118 saying, for example, "Unused variable c will be deleted. Are you sure?". In the message 500, characters and figures 502, 504 for clicking "YES" or "NO" can be displayed.

[0093] When the user clicks "YES" on the message 500 to input a deletion instruction (YES in S26), the GUI module 258 generates a deletion instruction for the deletion unit 264.

[0094] When a deletion instruction is input, in step S27, the deletion unit 264 deletes the unused variables from the variables included in the variable definition list 272. As a result, the variable definition list 272 is updated to include the unused variables deleted.

[0095] On the other hand, if "NO" is clicked for message 500, a NO judgment is made in step S26, so step S27 is skipped and the judgment process ends. In this case, the unused variables are not deleted, and variable definition list 272 is maintained with the contents before the judgment process was started.

[0096] When the unused variables are deleted in step S27, the GUI module 258 may further output a message prompting the user to rebuild the source program in order to reflect the updated variable definition list 272.

[0097] As described above, the determination process according to the first embodiment is configured to notify the user of unused variables via a user interface and delete the unused variables in accordance with a deletion instruction from the user. This makes it possible to prevent variables from being deleted against the user's will.

[0098] Specifically, among the variables included in the variable definition list 272, there may be variables that are not used within the source code 271 but can be accessed from an external device 300 via the networks NW1 and NW2. If such a variable is deleted from the variable definition list 272 as an unused variable within the source program 271, it may affect the external device 300 side. According to the determination process according to the first embodiment, only the unused variables instructed to be deleted by the user are deleted from the variable definition list 272, so it is possible to prevent the deletion of such variables as described above.

[0099] <g2. Second Embodiment of the Determination Process> FIG. 9 is a flowchart showing a second embodiment of the determination process. The flowchart of FIG. 9 is obtained by adding the process of step S210 to the flowchart of the first embodiment shown in FIG. 7. In FIG. 9, the description of the steps common to FIG. 7 will not be repeated.

[0100] Referring to FIG. 9, in the second embodiment, when the source code 271 is edited (when the determination in S21 is YES), the extraction unit 262 proceeds to step S210 and determines whether at least one instruction element has been deleted from the source code 271 by the above editing. The determination in step S210 can be made by comparing the source code 271 before the start of the edit process (S1 in FIG. 5) with the source code 271 after the execution of the edit process.

[0101] If it is determined that at least one instruction element has been deleted from the source code 271 by the edit process (when the determination in S210 is YES), the extraction unit 262 proceeds to the process in step S22. On the other hand, if it is determined that no instruction element has been deleted from the source code 271 (when the determination in S210 is NO), the steps after S22 are skipped and the determination process ends.

[0102] Also in the determination process according to the second embodiment, since the unused variables instructed to be deleted by the user are deleted from the variable definition list 272, the same effects as the determination process according to the first embodiment can be obtained.

[0103] Furthermore, the determination process according to the second embodiment is executed when the source code 271 is edited by the edit process and an instruction element is deleted from the source code 271. According to this, in a case where a variable referred to by the instruction element becomes unused as the instruction element is deleted, the determination process is executed, so that the unused variable can be deleted. On the other hand, in a case where an instruction element is added to the source code 271 by the edit process, since S210 is determined to be NO, the determination process is not executed. In the second embodiment, by executing the determination process in a case where an unused variable may occur, the unused variable can be efficiently deleted.

[0104] <g3. Third Embodiment of Determination Process> FIG. 10 is a flowchart showing a third embodiment of the determination process. The flowchart of FIG. 10 replaces the process of step S22 in the flowchart of the first embodiment shown in FIG. 7 with the process of step S220. In FIG. 10, the description of the steps common to FIG. 7 will not be repeated.

[0105] Referring to FIG. 10, in the third embodiment, when the source code 271 is edited (when the determination in S21 is YES), the extraction unit 262 extracts, by step S220, variables referred to by the instruction elements included in the modified portion of the source code 271, that is, the portion modified from the source code 271 before editing. The modified portion includes instruction elements added, changed, or deleted with respect to the source code 271 before editing.

[0106] The extraction unit 262 compares, by step S23, the variables extracted from the modified portion of the source code 271 with the variable definition list 272. When it is determined that there is no consistency between the extracted variables and the variables declared in the variable definition list 272 and it is determined that there is an unused variable in the variable definition list 272 (when the determination in S24 is YES), the unused variable is deleted by the processes of steps S25 to S27.

[0107] As described above, also in the determination process according to the third embodiment, since unused variables instructed to be deleted by the user are deleted from the variable definition list 272, the same effect as the determination process according to the first embodiment can be obtained.

[0108] Furthermore, the determination process according to the third embodiment is executed for the portions of the source code 271 modified by the edit process. Therefore, for the portions of the source code 271 before editing that have not been modified, variables are not extracted, and the comparison between the variables and the variable definition list 272 is not performed. By executing the determination process only for the portions where there is a possibility of unused variables in this way, the deletion of unused variables can be performed efficiently.

[0109] <g4. Fourth Embodiment of the Determination Process> FIG. 11 is a flowchart showing a fourth embodiment of the determination process. The flowchart of FIG. 11 is obtained by adding the process of step S240 to the flowchart of the first embodiment shown in FIG. 7. In FIG. 11, the description of the steps common to FIG. 7 will not be repeated.

[0110] Referring to FIG. 11, in the fourth embodiment, when it is determined in step S24 that there are unused variables in the variable definition list 272 (when the determination in S24 is YES), the extraction unit 262 proceeds to step S240 and determines whether the unused variables are internal variables.

[0111] Here, the variables used in the source code 271 include internal variables, input variables, and output variables. An "internal variable" is a variable used only within the program executed by the control device 200. An "input variable" and an "output variable" are variables indicating values ​​held by the external device 300 that is the control target. An "input variable" is a variable of input data input from the external device 300 to the control device 200, and an "output variable" is a variable of output data output from the control device 200 to the external device 300. Therefore, if an unused variable is an input variable or an output variable, deleting the unused variable may affect the external device 300.

[0112] In the determination process according to the fourth embodiment, if it is determined that an unused variable is an internal variable (YES in S240), the extraction unit 262 notifies the user of the unused variable via the GUI module 258. The deletion unit 264 deletes the unused variable in accordance with a deletion instruction from the user via the GUI module 258. On the other hand, if it is determined that an unused variable is an input variable or an output variable (NO in S240), steps S25 and onwards are skipped, and the determination process ends without deleting the unused variable.

[0113] In the fourth embodiment, the variable definition list 272 can be configured to have a part that defines internal variables and a part that defines input variables and output variables, as shown in Fig. 12. In this way, in the process of step S23, by comparing the part of the variable definition list 272 that defines internal variables with the variables extracted from the source code 271, it is possible to extract unused internal variables.

[0114] As described above, in the judgment process according to the fourth embodiment, unused variables instructed to be deleted by the user are deleted from the variable definition list 272, so that the same effect as in the judgment process according to the first embodiment can be obtained.

[0115] Furthermore, in the determination process according to the fourth embodiment, when the unused variable is an internal variable, since the unused variable is deleted from the variable definition list 272, variables that would affect the external device 300 when deleted are excluded, and unused variables that can be deleted from the control program can be deleted.

[0116] <g5. Fifth Embodiment of the Determination Process> FIG. 13 is a flowchart showing a fifth embodiment of the determination process. The flowchart of FIG. 13 is obtained by adding the process of step S242 instead of steps S25 and S26 to the flowchart of the first embodiment shown in FIG. 7. In FIG. 13, the description of the steps common to FIG. 7 will not be repeated.

[0117] Referring to FIG. 13, in the fifth embodiment, when it is determined in step S24 that there is an unused variable in the variable definition list 272 (when the determination in S24 is YES), the extraction unit 262 proceeds to step S242 and determines whether the extracted unused variable is a variable whose usage status has been changed from the used state to the unused state due to the editing of the source code 271. For example, in the immediately preceding edit process, when an instruction element is deleted from the source code 271, the variable referred to by the instruction element may be changed from the used state to the unused state. When the unused variable extracted in the process of step S23 is newly extracted after the editing of the source code 271, the extraction unit 262 determines that the variable has been changed from the used state to the unused state and makes a YES determination in step S242. On the other hand, when the unused variable extracted in the process of step S23 is not newly extracted after the editing, it is determined that the variable is originally in the unused state, and the extraction unit 262 makes a NO determination in step S242.

[0118] When the unused variable is a variable whose usage status has been changed from the used state to the unused state (when the determination in S242 is YES), the deletion unit 264 deletes the unused variable from the variables included in the variable definition list 272 in step S27. As a result, the variable definition list 272 is updated with the content in which the unused variable has been deleted.

[0119] On the other hand, if the unused variable is not a variable that has been changed from a used state to an unused state (NO in S242), step S27 is skipped and the determination process ends. In this case, the unused variable is not deleted, and the variable definition list 272 is maintained in the content before the determination process was started.

[0120] As described above, the determination process according to the fifth embodiment is configured to automatically delete variables that have been changed from a used state to an unused state by editing the source code 271, without a deletion instruction from the user. In this way, variables that are unused in the source code 271 but accessed from the external device 300 can be excluded from deletion targets because they are originally unused variables and are not changed from a used state to an unused state by editing the source code 271. Therefore, even in a configuration in which unused variables are automatically deleted without a deletion instruction from the user, it is possible to prevent such variables from being deleted from the variable definition list 272.

[0121] <Additional Notes> The above-described embodiment and the modified examples include the following technical ideas.

[0122] [Configuration 1] A development support device (100) for supporting development of a control program (210) for a control device (200) that controls a control target (300), comprising: an editor (252) for generating and editing a source code of the control program in accordance with a user operation; a storage unit (270) for storing the source code (271) and a variable declaration (272) defining a variable referenced by an instruction element included in the source code; an interface (258) for interacting with the user; an extraction unit (262) that, when the source code is edited by the editor, extracts from the variable declarations unused variables that are not referenced by the command elements included in the edited source code, and notifies the user of the extracted unused variables via the interface; a deletion unit (264) that updates the variable declaration by deleting the unused variable from the variable declaration in accordance with a user input instructing deletion of the unused variable via the interface.

[0123] [Configuration 2] The development support device according to configuration 1, wherein the extraction unit (262) extracts the unused variables from the variable declaration (272) when the source code (271) is edited by the editor (252) and at least a part of the instruction elements is deleted from the source code.

[0124] [Configuration 3] The development support device according to configuration 1 or 2, wherein the extraction unit (262) determines consistency between a variable referenced by the command element included in the modified portion of the source code (271) and the variable declaration (272), and extracts the unused variable if it is determined that there is no consistency.

[0125] [Configuration 4] 4. The development support device according to any one of configurations 1 to 3, wherein the extraction unit (262) notifies the user of the extracted unused variable via the interface (258) when the extracted unused variable is an internal variable.

[0126] [Configuration 5] A development support device (100) for supporting development of a control program (210) for a control device (200) that controls a control target (300), comprising: an editor (262) for generating and editing a source code (271) of the control program in accordance with a user operation; a storage unit (270) for storing the source code and a variable declaration (272) defining variables referenced by command elements included in the source code; an extraction unit (262) that extracts, when the source code is edited by the editor, unused variables that are not referenced by the command elements included in the edited source code from the variable declarations; a deletion unit (264) that updates the variable declaration by deleting the unused variable from the variable declaration when the unused variable extracted by the extraction unit is a variable that has been changed from a used state to an unused state by editing the source code.

[0127] [Configuration 6] 6. The development support device according to any one of configurations 1 to 5, further comprising a builder that generates an execution code of the control program (210) from the source code (271) and the variable declaration (272).

[0128] [Configuration 7] A development support method for supporting development of a control program (210) for a control device (200) that controls a controlled object (300), comprising: A step (S1) of generating and editing a source code (271) of the control program in accordance with a user operation; A step (S1) of storing the source code and a variable declaration (272) that defines variables referenced by command elements included in the source code; a step of extracting unused variables that are not referenced by the command elements included in the edited source code from the variable declarations when the source code is edited (S2, S21 to S24); a step (S25) of notifying the user of the extracted unused variables via an interface (258); and updating the variable declaration by deleting the unused variables from the variable declaration in accordance with a user input via the interface instructing the deletion of the unused variables (S2, S26, S27).

[0129] [Configuration 8] A development support program for supporting development of a control program (210) for a control device (200) that controls a controlled object (300), comprising: The development support program is installed on a computer. A step (S1) of generating and editing a source code (271) of the control program in accordance with a user operation; A step (S1) of storing the source code and a variable declaration (272) that defines variables referenced by command elements included in the source code; a step of extracting unused variables that are not referenced by the command elements included in the edited source code from the variable declarations when the source code is edited (S2, S21 to S24); a step (S25) of notifying the user of the extracted unused variables via an interface (258); and updating the variable declaration by deleting the unused variables from the variable declaration in accordance with a user input instructing the deletion of the unused variables via the interface (S2, S26, S27).

[0130] The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present invention is defined by the claims, not the above description, and is intended to include all modifications within the meaning and scope of the claims. [Explanation of symbols]

[0131] 10 FA system, 50 development support program, 60 various data programs, 100 development support device, 102 processor, 104 main memory, 111 communication interface, 114 I / O interface, 115 operation unit, 117 display interface, 118 display unit, 120 storage device, 200 control device, 210 control program, 212 transfer module, 250 programming application, 252 editor, 253 variable declaration generation unit, 254 builder, 255 source code generation unit, 256 debugger, 257 configurator, 258 GUI module, 260 simulator, 262 extraction unit, 264 deletion unit, 270, 299 data storage unit, 271 source code, 272 variable definition list, 273 execution code, 293 configuration information, 280 network setting application, 300 external device, 300A to 300C Devices, 301A-301C equipment, 420 ladder circuit, 421 input busbar, 422 output busbar, 423 connecting wire, 425, 426 contacts, 427 coil, a-i variables, NW1, NW2 networks.

Claims

1. A development support device for supporting development of a control program for a control device that controls a control target, an editor for generating and editing a source code of the control program in accordance with a user operation; a storage unit that stores the source code and a variable declaration that defines a variable to be referenced by an instruction element included in the source code; an interface for interacting with a user; an extraction unit that, when the source code is edited by the editor, extracts, from the variable declaration, unused variables that are not referenced by the command elements included in the edited source code, and notifies the user of the extracted unused variables via the interface; a deletion unit that updates the variable declaration by deleting the unused variable from the variable declaration in accordance with a user input instructing the deletion of the unused variable via the interface; the extraction unit extracts the unused variables from the variable declarations when the source code is edited by the editor and at least a part of the instruction elements is deleted from the source code; The development support device further comprises a builder that generates an execution code of the control program from the source code and the variable declarations.

2. 2. The development support device according to claim 1, wherein the extraction unit determines consistency between the variable declaration and a variable referenced by the command element included in the modified portion of the source code, and extracts the unused variable if it is determined that there is no consistency.

3. 3. The development support device according to claim 1, wherein said extraction section notifies said user of said extracted unused variable via said interface when said extracted unused variable is an internal variable.

4. A development support device for supporting development of a control program for a control device that controls a control target, an editor for generating and editing a source code of the control program in accordance with a user operation; a storage unit that stores the source code and a variable declaration that defines a variable to be referenced by an instruction element included in the source code; an extraction unit that extracts, when the source code is edited by the editor, unused variables that are not referenced by the command elements included in the edited source code from the variable declarations; a deletion unit that updates the variable declaration by deleting the unused variable from the variable declaration when the unused variable extracted by the extraction unit is a variable that has been changed from a used state to an unused state by editing the source code; and a builder that generates an execution code of the control program from the source code and the variable declarations.

5. A development support method for supporting development of a control program for a control device that controls a control target, comprising: generating and editing a source code of the control program according to a user operation; storing the source code and a variable declaration that defines variables referenced by instruction elements included in the source code; When the source code is edited, extracting from the variable declarations unused variables that are not referenced by the instruction elements included in the edited source code; notifying a user of the extracted unused variables via an interface; updating the variable declaration by deleting the unused variables from the variable declaration in accordance with user input via the interface indicating deletion of the unused variables; the extracting step includes a step of extracting the unused variables from the variable declarations when the source code is edited by the generating and editing steps and at least a part of the instruction elements is deleted from the source code; The development support method further comprises the step of generating an execution code of the control program from the source code and the variable declarations.

6. A development support program for supporting development of a control program for a control device that controls a control target, The development support program is installed on a computer. generating and editing a source code of the control program according to a user operation; storing the source code and a variable declaration that defines variables referenced by instruction elements included in the source code; When the source code is edited, extracting from the variable declarations unused variables that are not referenced by the instruction elements included in the edited source code; notifying a user of the extracted unused variables via an interface; updating the variable declaration by deleting the unused variables from the variable declaration in accordance with user input via the interface indicating deletion of the unused variables; the extracting step includes a step of extracting the unused variables from the variable declarations when the source code is edited by the generating and editing steps and at least a part of the instruction elements is deleted from the source code; the development support program further executing a step of generating an execution code of the control program from the source code and the variable declarations.

Citation Information

Patent Citations

  • Multi-program editing device

    JP1993313871A

  • Program controller and program controlling method

    JP2000181696A

  • System for editing retest procedure, system applying retest procedure editing system, and computer-readable recording medium recording retest procedure editing program

    JP2000305812A

  • Editor device and storage medium recording editor program

    JP2002062910A

  • Device for supporting program development, and method for displaying variable name list

    JP2005352612A