Program development device and program development system
The program development device addresses the complexity of debugging by creating a virtual environment for controllers, allowing for efficient debugging without repeated installations, thereby enhancing productivity and quality.
Patent Information
- Application Number
- JP2021080862
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-05-12
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-05-12
AI Technical Summary
Existing program development methods require frequent installation and re-checking of programs on controllers, leading to complex debugging processes and low productivity.
A program development device that creates a virtual environment connected to a controller, allowing for debugging without installing the program on the controller each time it is modified. This device includes a program reference unit, a data acquisition unit, and a program execution unit that use actual data to execute the program.
Enables debugging in the same environment as actual operation without repeated installations, improving productivity and quality of program development.
Smart Images

Figure 0007675555000001 
Figure 0007675555000002 
Figure 0007675555000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a program development device and a program development system. [Background technology]
[0002] Generally, programs created to realize various functions are installed in the controller. The controller executes the installed programs to realize functions according to the contents of the programs.
[0003] Such programs are created by engineers using equipment with program development functions. To check the operation of the created program, the engineer actually installs the program into a controller and checks whether the program works properly on the controller. If a bug (defect) is found in the program, the engineer corrects (debugs) the program to remove the bug, then installs the corrected program back into the controller and checks its operation.
[0004] Engineers must repeatedly check the operation of a program, correct any bugs, install the corrected program into the controller, and check the operation again (hereinafter, checking the operation of a program and debugging it together are referred to as "debug") until the program is complete. This type of debugging is extremely cumbersome, and has been a factor in lowering productivity in program development.
[0005] One technique that may be able to solve such problems is, for example, Patent Document 1. Patent Document 1 discloses a method for preparing a pseudo environment similar to the environment of an actual device (corresponding to the above-mentioned controller) in which an embedded program to be debugged is to be embedded.
[0006] Specifically, the program development kit in Patent Document 1 is provided with a pseudo device driver instead of the device driver of the actual machine, and an emulator instead of the engine control program of the actual machine. An embedded program normally sends and receives commands to and from an engine control program installed in the actual machine, but in the program development kit in Patent Document 1, the embedded program sends and receives commands to and from the emulator via the pseudo device driver. This allows the embedded program to be debugged in an environment similar to that of the actual machine, without having to install it on the actual machine. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Patent Publication No. 2008-217574 Summary of the Invention [Problem to be solved by the invention]
[0008] However, in Patent Document 1, although it is possible to prepare a pseudo environment similar to the environment of a real machine using a pseudo device driver and an emulator, it is difficult to debug the program to be debugged in an environment equivalent to that during actual operation.
[0009] The present invention has been made to solve the above-mentioned problems, and has an object to provide a program development device that enables debugging in an environment equivalent to that during actual operation, without the need to install the program to be debugged into a controller every time it is modified. [Means for solving the problem]
[0010] The program development device according to the present invention includes a virtual environment communicably connected to a controller in which a program to be debugged is installed. and a platform that acquires configuration information of a controller-side virtual environment that is constructed in the controller and constructs a virtual environment based on the acquired configuration information.The virtual environment is characterized by having a program reference unit that references the program to be debugged before it is installed in the controller, a data acquisition unit that acquires from the controller actual data used when the controller executes the program to be debugged, and a program execution unit that executes the program to be debugged referenced by the program reference unit using the actual data acquired by the data acquisition unit. Effect of the Invention
[0011] According to the present invention, since it is configured as described above, it is possible to debug the program to be debugged in an environment equivalent to that during actual operation, without having to install the program in the controller every time it is modified. [Brief description of the drawings]
[0012] [Figure 1] 1 is a diagram illustrating an example of a configuration of a program development system including a program development device according to a first embodiment. [Diagram 2] 4 is a flowchart showing a procedure for developing a control program by the program development device according to the first embodiment. [Diagram 3] FIG. 4 is a diagram showing an example of a program management screen in the first embodiment. [Figure 4] FIG. 4 is a diagram showing an example of displaying the progress of execution of a control program in the first embodiment. [Diagram 5] 3 is a diagram for explaining a procedure for constructing a virtual environment in the program development device according to the first embodiment. FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. Embodiment 1 FIG. 1 is a diagram showing an example of the configuration of a program development system including a program development device according to the first embodiment.
[0014] 1, the program development system includes a controller 2 and a program development device 3. The program development device 3 is connected to the controller 2 via a communication line.
[0015] The program development device 3 is a device for developing a control program (reference numeral 233 in FIG. 1), which is one of the programs installed in the controller 2. In the following, for ease of understanding, a configuration example of the controller 2 including an overview of the control program 233 will be described first, and then a configuration example of the program development device 3 will be described. In the following, an example will be described in which the controller 2 is a controller that constitutes a monitoring system.
[0016] (Controller 2) The controller 2 monitors devices that are targets of monitoring in the monitoring system (hereinafter referred to as monitoring points). The monitoring points are composed of various sensors such as temperature and humidity sensors, air conditioning equipment, lighting equipment, etc. The monitoring points are connected to the controller 2 via communication lines, but are not shown in FIG. 1.
[0017] An operating system (OS), such as Linux (registered trademark), is installed on the controller 2. As shown in Fig. 1, two environments (an execution environment 21 and a virtual environment 23) are built on the operating system in the controller 2.
[0018] The execution environment 21 includes a main framework 211 of the controller 2 and a standard function program 213 .
[0019] The main framework 211 of the controller 2 (hereinafter simply referred to as the main framework 211) is software that runs on the operating system and functions as a foundation for operating (executing) the standard function program 213.
[0020] The standard function program 213 is a program for realizing functions (hereinafter referred to as standard functions) that are used in many buildings in which a monitoring system is installed. Examples of the standard functions include a schedule control function, an optimal start / stop control function, and a power demand control function. Note that each of these functions is well known, so a detailed description will be omitted.
[0021] The virtual environment 23 is a virtual execution environment for executing the control program 233, which is constructed in the controller 2 by using Docker, which is one of the virtualization technologies. In Docker, virtualization is realized by a mechanism called container-based virtualization. In the example of FIG. 1, the virtual environment 23 corresponds to a container, and the control program 233 is executed in this virtual environment 23.
[0022] The control program 233 is a program describing functions that are required in a particular building among buildings in which a monitoring system is installed, and that are difficult to realize by the controller 2 only executing the standard function program 213. Such a control program 233 is created separately from the standard function program 213, and is additionally installed in the controller 2. The program language of the control program 233 is, for example, Python.
[0023] The control program 233 is executed, for example, according to a preset schedule. The control program 233 can also operate in cooperation with the standard function program 213, and may be executed in response to the operation result of the standard function program 213. Although the example in Fig. 1 shows a case where there is one control program 233, there may be multiple control programs 233.
[0024] In addition, in Docker, the resources (e.g., CPU and memory) available for each virtual environment can be limited. Also in the first embodiment, the resources (e.g., CPU and memory) available in the virtual environment 23 are limited to a part of the resources of the controller 2. For example, the usage rate of the CPU (virtual CPU) available in the virtual environment 23 and the usage amount of the memory (virtual memory) available in the virtual environment 23 are limited to a predetermined usage rate and a predetermined usage amount, respectively. As a result, even if the control program 233 in the virtual environment 23 becomes abnormal or the load of the control program 233 becomes high, the controller 2 can continue the processing of the standard function program 213 without affecting the standard function program 213.
[0025] (Program Development Device 3) The program development device 3 is a device for developing a control program 233 to be installed in the controller 2. In this embodiment, the program to be debugged by the program development device 3 is the control program 233.
[0026] 1, an operating system (OS) 30 such as Windows (registered trademark) is installed in the program development device 3. In the program development device 3, an integrated development environment 31 for developing a control program 233 is built on the OS 30.
[0027] In the program development device 3, a virtual environment platform 32 runs on the OS 30. The virtual environment platform 32 is software for providing a virtual environment 33, and the virtual environment 33 is built on this virtual environment platform 32.
[0028] (Integrated Development Environment 31) As shown in FIG. 1, the integrated development environment 31 includes a program creation unit 311 and a display control unit 312.
[0029] The program creation unit 311 creates (edits) the control program 233 in response to an input operation by an engineer via an input device (not shown) such as a keyboard. Here, the control program 233 created by the program creation unit 311 becomes a program to be debugged and executed by a program execution unit 333 described later.
[0030] The display control unit 312 acquires the execution progress of the control program 233 executed by the program execution unit 333 described later, and displays the acquired execution progress on a display unit (not shown) such as a monitor. The display unit may be provided in the program development device 3 or may be provided outside the program development device 3.
[0031] The functions of the integrated development environment 31 and each part of the integrated development environment 31, that is, the program creation unit 311 and the display control unit 312, are realized, for example, by a CPU (Central Processing Unit) (not shown) provided in the program development device 3 executing integrated development environment software expanded in a memory (not shown).
[0032] (Virtual Environment 33) The virtual environment 33 is an environment equivalent to the virtual environment 23 of the controller 2, and is constructed on a virtual environment platform 32. The virtual environment platform 32 is software that provides a virtual execution environment (virtual environment 33) for executing the control program 233. Specifically, the virtual environment platform 32 reads configuration information (Docker image) of the virtual environment 23 (controller-side virtual environment) constructed in the controller 2, and constructs the virtual environment 33 based on the read configuration information. The virtual environment 33 constructed here is an environment equivalent to the virtual environment 23 of the controller 2, except for a program reference unit 331 and a data acquisition unit 332, which will be described later. In addition, the virtual environment 33 is communicably connected to the controller 2 in which the control program 233, which is a program to be debugged, is installed. Details of the construction process of the virtual environment 33 by the virtual environment platform 32 will be described later.
[0033] As shown in FIG. 1, the virtual environment 33 includes a program reference unit 331, a data acquisition unit 332, and a program execution unit 333.
[0034] The program reference unit 331 references the control program 233 which is a program to be debugged. The control program 233 referenced here is the control program before it is installed in the controller 2, and is the control program stored in the program development device 3. For example, information regarding the storage location of the control program 233 is provided in advance by an engineer to the program reference unit 331, and the program reference unit 331 references the control program 233 based on the information regarding the storage location.
[0035] The data acquiring unit 332 acquires actual data used by the controller 2 during actual operation from the controller 2. Specifically, the data acquiring unit 332 acquires actual data used when the controller 2 actually executes the control program 233 from the controller 2.
[0036] The program execution unit 333 executes the control program 233 referenced by the program reference unit 331, using the actual data acquired by the data acquisition unit 332. The progress of execution of the control program 233 by the program execution unit 333 is displayed on the display unit by the display control unit 312. An example of the display of the execution progress will be described later.
[0037] Next, a development procedure of the control program 233 by the program development device 3 will be described with reference to Fig. 2. Fig. 2 is a flowchart showing the development procedure of the control program 233 by the program development device 3. Note that it is assumed that the execution environment 21 and the virtual environment 23 have been constructed in advance in the controller 2 before starting the process shown in the flowchart of Fig. 2.
[0038] First, the program development device 3 creates a control program 233 in the integrated development environment 31 in response to an input operation by an engineer (step ST201). Specifically, in the program development device 3, the display control unit 312 displays a program management screen on the display unit in response to an instruction from the engineer, and an operation reception unit (not shown) receives operation of an input device such as a keyboard from the engineer via this program management screen. The program creation unit 311 creates (edits) the control program 233 in response to the input operation from the engineer received by the operation reception unit.
[0039] 3 is a diagram showing an example of a program management screen displayed on the display unit. The program management screen is mainly composed of three areas (a program creation area 350, a program selection area 360, and an input / output area 370).
[0040] The program creation area 350 is an area for creating (editing) the control program 233 and checking its operation, and the actual code of the control program 233 is displayed in this program creation area 350. The program creation unit 311 displays the code of the control program 233 in the program creation area 350 in response to an input operation by an engineer. The control program 233 created in the program creation area 350 can be stored in a storage device (not shown) such as a hard disk drive (HDD) as a file having a predetermined file format. Information regarding the storage location of the control program 233 is provided to the program reference unit 331 by the engineer.
[0041] The program creation unit 311 can set breakpoints 351 in the program creation area 350 in response to an instruction from an engineer. The breakpoints 351 are set at positions (lines) where operation should be temporarily stopped during debugging of the control program 233, and are set arbitrarily by the engineer. For example, in FIG. 3, the breakpoints 351 are set at the 6th and 26th lines of the control program 233.
[0042] The program selection area 360 is an area for selecting a file of the saved control program 233. The display control unit 312 hierarchically displays the folder structure of the program development device 3 in the program selection area 360. The engineer selects a file of the control program 233 to be debugged from the folder structure displayed in the program selection area 360. When the operation reception unit receives a selection operation by the engineer, the display control unit 312 reads out the control program 233 saved in the file received by the operation reception unit, and displays it in the program creation area 350.
[0043] The input / output area 370 is an area used for accepting input of argument values used in the control program 233 during debugging of the control program 233 and for outputting the execution result of the control program 233. The operation reception unit accepts input of argument values used in the control program 233 from an engineer via the input / output area 370. In addition, the display control unit 312 outputs the execution result of the control program 233 to the input / output area 370.
[0044] Next, the engineer constructs a virtual environment 33 for executing the control program 233 in the integrated development environment 31 (step ST202). The procedure for constructing this virtual environment 33 will be described later.
[0045] Next, the program development device 3 registers an identifier (e.g., a program ID) for identifying the control program 233 in the controller 2 in response to an input operation by the engineer (step ST203). This registration of the identifier needs to be performed only once before the process transitions to the next step ST204, and this operation of registering the identifier corresponds to the installation of the control program 233.
[0046] Next, in response to an instruction from the engineer, the program development device 3 causes the controller 2 to output a signal instructing the start of execution of the control program 233 (step ST204). The controller 2 can identify which control program 233 to instruct to start execution based on the identifier of the control program 233 registered in step ST203.
[0047] When the program development device 3 receives a signal from the controller 2 instructing the start of execution of the control program 233, the program reference unit 331 references the control program 233, which is a program to be debugged (step ST205). Furthermore, the data acquisition unit 332 acquires actual data used by the controller 2 during actual operation from the controller 2 (step ST206). Then, the program execution unit 333 executes the control program 233 referenced by the program reference unit 331 using the actual data acquired by the data acquisition unit 332 (step ST207). At this time, the progress of execution of the control program 233 is displayed on the display unit by the display control unit 312.
[0048] Next, the engineer checks the operation of the control program 233 by checking the execution progress displayed on the display unit by the display control unit 312 (step ST208). Specifically, the engineer checks the operation of the control program 233 by checking the execution progress displayed in the program creation area 350 and the input / output area 370 of the above-mentioned program management screen. An example of the display of the execution progress in this case is shown in FIG.
[0049] The display control unit 312 displays the code of the control program 233 in the program creation area 350 as shown in FIG. 4. At this time, the display control unit 312 highlights the line of the control program 233 currently being executed as shown by the reference numeral 352. As the program is executed, the highlighted line changes, but if a breakpoint 351 is set, the program execution unit 333 temporarily stops the execution of the control program 233 at that line. Accordingly, the display control unit 312 also temporarily stops the transition of the highlighted display. In addition, the operation reception unit receives the value of the argument used in the control program 233 via the input / output area 370 in response to the input operation of the engineer, and the program execution unit 333 executes the control program 233 using the received value of the argument. In addition, the display control unit 312 outputs the final execution result of the control program 233 to the input / output area 370, and the engineer checks this execution result. In FIG. 4, the argument "Count" (total number of cranes and turtles) is set to 10, and the argument "Legs" (total number of legs of the cranes and turtles) is set to 30, and the execution result of the control program 233 is displayed as "Crane:5 Turtle:5" (number of cranes and number of turtles).
[0050] Next, the program development device 3 checks whether an instruction has been received from the engineer that the control program 233 needs to be modified (step ST209). If no instruction has been received (step ST209; No), the program development device 3 completes the creation of the control program 233 and ends the process. The control program 233 that has been created is actually installed in the controller 2 and executed in the virtual environment 23 of the controller 2.
[0051] If a correction instruction has been received (step ST209; Yes), the program development device 3 stops the operation of the control program 233 in response to the engineer's instruction, and disconnects the connection between the virtual environment 33 and the controller 2 (step ST210). Then, the program creation unit 311 corrects the control program 233 in the integrated development environment 31 in response to the engineer's input operation (step ST211). Thereafter, the process returns to step ST204, and steps ST204 to ST211 are repeated until the creation of the control program 233 is completed.
[0052] In this way, the engineer can check the execution progress of the control program 233 line by line (step by step). Also, the engineer can temporarily stop the control program 233 in operation at a desired point (line) by setting a breakpoint 351. This can improve the productivity and quality of the control program 233.
[0053] Finally, a procedure for constructing the virtual environment 33 in the program development device 3 will be described. FIG. 5 is a diagram for explaining the procedure for constructing the virtual environment 33. First, as indicated by the reference symbol (1), an engineer creates a Docker image (configuration information) of the virtual environment 23 constructed in the controller 2. A Docker image is a file in which the configuration information of the virtual environment 23 (container) is written out. This Docker image can be created, for example, by an engineer connecting to the controller 2 from the program development device 3 and executing a Docker save command on the controller 2.
[0054] Next, the engineer copies the created Docker image to the program development device 3 as shown by the reference symbol (2). Next, the engineer instructs the program development device 3 to read the copied Docker image. For example, the engineer instructs the program development device 3 to read the Docker image by executing a Docker load command in a command prompt displayed in the input / output area 370 of the program management screen. In response to the execution of this command, the virtual environment platform 32 reads the copied Docker image. Next, the engineer connects the integrated development environment 31 to the virtual environment platform 32, and instructs the integrated development environment 31 to construct a virtual environment 33. In response to this instruction, the virtual environment platform 32 constructs the virtual environment 33 based on the loaded Docker image. In this way, in the program development device 3, the virtual environment 33, which is an environment equivalent to the virtual environment 23 constructed in the controller 2, is constructed on the virtual environment platform 32. Therefore, the engineer can operate the control program 233 as if it were executed in the virtual environment 23 of the controller 2 without having to install the control program 233 in the controller 2 every time the control program 233 is modified. In addition, in the virtual environment 33, the control program 233 can be debugged using actual data that the controller 2 uses during actual operation, allowing engineers to debug the control program 233 in an environment that is closer to actual operation.
[0055] As described above, according to the first embodiment, the program development device 3 includes a virtual environment 33 communicably connected to the controller 2 in which the program to be debugged is installed, and the virtual environment 33 includes a program reference unit 331 that references the program to be debugged before it is installed in the controller 2, a data acquisition unit 332 that acquires from the controller 2 actual data used when the controller 2 executes the program to be debugged, and a program execution unit 333 that executes the program to be debugged referenced by the program reference unit 331 using the actual data acquired by the data acquisition unit 332. This allows the program development device 3 to debug in an environment equivalent to that during actual operation, without having to install the program to be debugged in the controller 2 every time it is modified.
[0056] Moreover, the program to be debugged is the control program 233 in which a specific function other than the standard function normally provided by the monitoring system is described. This allows the program development device 3 to treat the control program 233 as the program to be debugged, thereby improving the productivity and quality of the control program 233.
[0057] Furthermore, the program development device 3 has a program creation unit 311 that creates a program to be debugged, and a program reference unit 331 refers to the program created by the program creation unit 311 before being installed in the controller 2. This allows the program development device 3 to create and debug the program to be debugged by itself.
[0058] Furthermore, the program development device 3 has a virtual environment platform 32 that acquires configuration information of the virtual environment 23 (controller-side virtual environment) constructed in the controller 2 and constructs a virtual environment 33 based on the acquired configuration information. This allows the program development device 3 to construct an environment equivalent to the virtual environment 23 (controller-side virtual environment) constructed in the controller 2 as the virtual environment 33.
[0059] In addition, the program development device 3 has a display control unit 312 that acquires the execution progress of the program being executed by the program execution unit 333 and displays it on the display unit. This allows an engineer to easily check the execution progress of the program via the display unit.
[0060] According to the first embodiment, the program development system includes the controller 2 and the program development device 3, and the program development device 3 has a virtual environment 33 communicably connected to the controller 2 in which the program to be debugged is installed. The virtual environment 33 has a program reference unit 331 that references the program to be debugged before it is installed in the controller 2, a data acquisition unit 332 that acquires from the controller 2 real data used when the controller 2 executes the program to be debugged, and a program execution unit 333 that executes the program to be debugged referenced by the program reference unit 331 using the real data acquired by the data acquisition unit 332. This makes it possible to debug the program to be debugged in an environment equivalent to that during actual operation in the program development system, without having to install the program to be debugged in the controller 2 every time it is modified.
[0061] In addition, any of the components of the embodiment may be modified or any of the components of the embodiment may be omitted within the scope of the present invention. For example, in the above description, the controller 2 is equipped with Linux (registered trademark) as its operating system (OS), the control program 233 is written in Python programming language, and Docker (container-based virtualization) is used as the virtualization technology for constructing the virtual environment 23. However, these are merely examples and are not limited to the configurations exemplified here. [Explanation of symbols]
[0062] 2. Controller 3 Program Development Equipment 21 Execution environment 23 Virtual environment (controller side virtual environment) 30 OS 31 Integrated Development Environment 32 Virtual Environment Platform 33 Virtual Environment 211 Main Framework 213 Standard Feature Program 233 Control program (program to be debugged) 311 Program Creation Department 312 Display control unit 331 Program Reference Section 332 Data Acquisition Department 333 Program Execution Department 350 Programming area 351 Breakpoints 352 Highlighted 360 Program Selection Area 370 Input / output area
Claims
1. A virtual environment communicably connected to a controller in which a program to be debugged is installed; a platform that acquires configuration information of a controller-side virtual environment constructed in the controller and constructs the virtual environment based on the acquired configuration information; The virtual environment includes: a program reference unit that references a program to be debugged before being installed in the controller; a data acquisition unit that acquires from the controller actual data used when the controller executes a program to be debugged; a program execution unit that executes a program to be debugged that is referenced by the program reference unit, using the actual data acquired by the data acquisition unit; A program development device comprising:
2. 2. The program development device according to claim 1, wherein the program to be debugged is a program in which specific functions other than standard functions normally provided by a monitoring system are described.
3. a program creation unit that creates a program to be debugged, 3. The program development device according to claim 1, wherein the program reference section refers to the program created by the program creation section before being installed in the controller.
4. 4. The program development device according to claim 1, further comprising a display control unit that acquires the progress of the program being executed by the program execution unit and displays the progress on a display unit.
5. A program development system including a controller and a program development device, the program development device includes a virtual environment communicably connected to the controller in which a program to be debugged is installed, and a platform that acquires configuration information of a controller-side virtual environment constructed in the controller and constructs the virtual environment based on the acquired configuration information; The virtual environment includes: a program reference unit that references a program to be debugged before being installed in the controller; a data acquisition unit that acquires from the controller actual data used when the controller executes a program to be debugged; a program execution unit that executes a program to be debugged that is referenced by the program reference unit, using the actual data acquired by the data acquisition unit; A program development system comprising:
Citation Information
Patent Citations
Debug method for equipment incorporating program
JP2003150405A
Development program, recording medium, development device and development method
JP2008217574A
Software operation monitoring system, client computer, server computer thereof, and program thereof
JP2010033543A
Program development support device and system
JP2011053729A
Engineering system and engineering method
JP2020052812A