Program development support method, program development device, and control program
The program development support method addresses the challenge of reusing reusable program elements in visual programming by generating call blocks based on interface information, enhancing efficiency and simplifying the development process.
Patent Information
- Application Number
- PCT/JP2023/042505
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2025-06-05
AI Technical Summary
Existing techniques for visual programming struggle with efficiently reusing reusable program elements, such as variables and functions, implemented through visual and text programming, as they require manual incorporation of blocks and text codes.
A program development support method that identifies reusable module elements, extracts necessary interface information, and generates call blocks in visual programming environments, allowing for efficient reuse of these elements.
Enables efficient reuse of reusable program elements across visual and text programming environments, reducing the complexity of implementing and editing these elements, and improving program development efficiency.
Smart Images

Figure JP2023042505_05062025_PF_FP_ABST
Abstract
Description
Program development support method, program development device and control program
[0001] The present invention relates to a program development device having a program development environment using both visual programming and text programming, a program development support method, and a control program.
[0002] In recent years, visual programming, which involves combining visual program components to create programs, has been gaining attention as a programming technique for controlling work robots and other devices installed in factories. Patent Document 1 proposes a technology that enables text programming in a visual programming environment by using blocks that allow text code to be freely entered.
[0003] However, with the technology of Patent Document 1, it is not easy to reuse reusable program elements such as variables and functions implemented by visual programming and text programming in visual programming, which requires the effort of incorporating the above blocks into a program created by visual programming, inputting text code with the same content as the reusable program elements, or combining multiple blocks to show the same content as the reusable program elements.
[0004] International Publication No. 2018 / 187029
[0005] An object of the present invention is to provide a program development support method, a program development device, and a control program that can efficiently reuse reusable program elements implemented in programs created by visual programming and text programming in visual programming.
[0006] A program development support method according to one aspect of the present invention is a program development support method in a program development device equipped with program development environments using both visual programming and text programming, which identifies module elements, which are reusable program elements, implemented in at least one of a program created using the visual programming and a program created using the text programming, extracts interface information required to call the module elements, and generates a call block, which is a program component for calling the module elements in the visual programming, based on the interface information.
[0007] A program development device according to another aspect of the present invention is a program development device equipped with a program development environment using both visual programming and text programming, and includes an identification unit that identifies module elements, which are reusable program elements implemented in at least one of a program created using the visual programming and a program created using the text programming, an extraction unit that extracts interface information required to call the module elements, and a generation unit that generates, based on the interface information, a call block, which is a program component for calling the module elements in the visual programming.
[0008] A control program according to another aspect of the present invention is a control program for controlling a computer of a program development device having a program development environment using both visual programming and text programming, and causes the computer to function as an identification unit that identifies module elements, which are reusable program elements implemented in at least one of a program created by the visual programming and a program created by the text programming, an extraction unit that extracts interface information required to call the module elements, and a generation unit that generates, based on the interface information, a call block, which is a program component for calling the module elements in the visual programming.
[0009] FIG. 1 is a configuration diagram of a program development device according to an embodiment of the present invention. FIG. 2 is a diagram illustrating an example of a visual program. FIG. 3 is a diagram illustrating an example of a text program. FIG. 4 is a flowchart illustrating processing executed in the development device. FIG. 5 is a diagram illustrating an example of generating two call blocks for calling two functions implemented in a visual program. FIG. 6 is a diagram illustrating an example of generating a call block for calling a function with no arguments or return values. FIG. 7 is a diagram illustrating an example of generating a call block for calling a function with arguments and return values. FIG. 8 is a diagram illustrating an example of generating four call blocks for calling two variables and two functions implemented in a text program. FIG. 9 is a diagram illustrating an example of generating a call block for calling variables. FIG. 10 is a diagram illustrating an example of generating a call block for calling a function with no arguments or return values. FIG. 11 is a diagram illustrating an example of generating a call block for calling a function with arguments and return values. FIG. 12 is a diagram illustrating an example of converting a visual program in which call blocks are implemented into text code. FIG. 13 is a diagram illustrating an example of converting a call block for a function with no arguments or return values into text code. FIG. 14 is a diagram showing an example of converting a call block of a function with arguments and a return value into text code.
[0010] [Overall Configuration of Program Development Apparatus] An embodiment of the present invention will now be described in detail with reference to the drawings. Fig. 1 is a configuration diagram of a program development apparatus 1 according to an embodiment of the present invention. As shown in Fig. 1, the program development apparatus 1 is connected to a display device 30 and an operation device 40 so as to be able to communicate with each other.
[0011] The development device 1 is a device that allows a user to develop a program for controlling a controlled device such as a robot that performs work related to the manufacture of, for example, a mounting board and / or food. The development device 1 is configured with an information processing device such as a personal computer. Specifically, the development device 1 includes a control unit 10, a storage unit 11, and a communication unit 12.
[0012] The control unit 10 is configured by a microcomputer (computer) equipped with a CPU (Central Processing Unit) etc. The control unit 10 executes a control program stored in the storage unit 11, thereby functioning as a visual program development environment 101, a text program development environment 102, an identification unit 103, an extraction unit 104, a generation unit 105, an execution unit 106 and an output unit 107. The functions of the control unit 10 will be described in detail later.
[0013] The storage unit 11 is configured by a storage device capable of storing various types of information, such as a RAM (Random Access Memory), a ROM (Read Only Memory), a HDD (Hard Disk Drive), a SSD (Solid State Drive), or a flash memory. The storage unit 11 stores a control program executed by the control unit 10. The storage unit 11 also stores various types of information under the control of the control unit 10.
[0014] The communication unit 12 is configured by a communication interface circuit for communicating with the controlled device. The communication unit 12 transmits program execution data to the controlled device under the control of the control unit 10.
[0015] The display device 30 is configured by a liquid crystal display etc. The display device 30 displays various information under the control of the control unit 10.
[0016] The operation device 40 is composed of a keyboard, a mouse, a touch panel device, etc. The operation device 40 accepts various operation instructions input by a user. The user performs program development work by operating various operation screens displayed on the display device 30 using the operation device 40.
[0017] In the example of FIG. 1, the display device 30 and the operation device 40 are separate from the development device 1, but at least one of the display device 30 and the operation device 40 may be configured integrally with the development device 1.
[0018] [Details of Functions of Control Unit 10] Next, details of functions of the control unit 10 will be described.
[0019] The visual program development environment 101 is a development environment for programs using visual programming. Visual programming is a programming method for creating programs by combining visual program components called, for example, blocks or nodes. In this embodiment, the program components that make up a program created using visual programming (hereinafter referred to as a visual program) are referred to as blocks.
[0020] The visual program development environment 101 is provided with various screens (hereinafter referred to as editing screens) for editing programs using visual programming, and displays the various editing screens on the display device 30 in response to a user's operation of the operation device 40. Editing a program includes creating a program, deleting a program, and changing the contents of a program.
[0021] For example, the editing screen includes a selection screen that allows the user to select blocks to be used in implementing the visual program from a group of one or more blocks. The user uses the operation device 40 to select blocks to be used in implementation from the selection screen, edit the program by arranging the blocks on the editing screen and configuring various settings for each block arranged on the editing screen, and then stores the edited program in the storage unit 11 in association with the name of the program.
[0022] 2 is a diagram showing an example of a visual program VP1. For example, FIG. 2 shows a visual program VP1 created by a user using the editing screen of the visual program development environment 101. A function with no arguments, named "do something," is implemented in the visual program VP1. Hereinafter, a function named "X" may be referred to as function "X." The function "do something" is implemented by combining seven blocks B11 to B17.
[0023] Block B11 is a block showing a declaration statement of a function with no arguments. Blocks showing function declaration statements have an input field for the name of the function. Figure 2 shows an example in which "do something" has been entered in the input field for the name of the function. Blocks showing declaration statements of a function with no arguments do not have a linking part at the right end for connecting to other blocks.
[0024] Block B12 is a block that indicates a conditional branch. A block that indicates a conditional branch has a concave-convex connector for connecting to blocks above and below, a concave-convex connector for connecting blocks that indicate conditions, and a concave-convex connector for connecting blocks that indicate branch processing. Blocks B13, B15, and B17 are blocks that indicate variables. A block that indicates a variable has a convex connector on the left end. Note that variables may be, for example, integers, decimals, arrays, classes, booleans, etc. However, variables are not limited to variables of these data types.
[0025] Blocks B14 and B16 are blocks for calling the function "print" provided by the visual program development environment 101. The function "print" is a function with one argument. The blocks for calling functions with arguments have a concave connector on the right end for connecting to a block that indicates the argument.
[0026] The text program development environment 102 is a development environment for programs using text programming, which is a programming method in which a program is created by writing text code consisting of letters, symbols, and / or numbers.
[0027] The text program development environment 102 has various editing screens for editing programs using text programming, and displays the various editing screens on the display device 30 in response to a user's operation of the operation device 40. The user edits the program by using the operation device 40 to input, delete, change, or otherwise modify the text code displayed on the editing screen, and stores the edited program in the storage unit 11 in association with the name of the program.
[0028] Fig. 3 is a diagram showing an example of a text program TP1. For example, Fig. 3 shows a text program TP1 created on the editing screen of the text program development environment 102. A function "do_something" with no arguments is implemented in the text program TP1.
[0029] The first line is text code indicating a comment. The function "do_something" is implemented by five lines of text code from line 2 to line 6. Specifically, line 2 is text code indicating a declaration statement for the argumentless function "do_something." Lines 3 and 5 are text code indicating a conditional branch, and lines 4 and 6 are text code for calling the function "print" provided by the text program development environment 102. The function "print" is a function with one argument.
[0030] The identification unit 103 identifies reusable program elements (hereinafter, module elements) implemented in at least one of a visual program created in the visual program development environment 101 and a text program created in the text program development environment 102.
[0031] Specifically, the identification unit 103 refers to a visual program stored in the storage unit 11, and if the visual program includes a block indicating a function declaration statement, the identification unit 103 identifies the function indicated by the block as a module element. In the example of Figure 2, the identification unit 103 identifies the function "do something" indicated by block B11 as a module element because the visual program VP1 includes a block B11 indicating a function declaration statement. Furthermore, if the visual program includes a block indicating a variable declaration statement, the identification unit 103 identifies the variable indicated by the block as a module element.
[0032] Furthermore, the identification unit 103 refers to a text program stored in the storage unit 11, and if the text program contains text code indicating a function declaration statement, the identification unit 103 identifies the function indicated by the text code as a module element. In the example of Figure 3, the visual program VP1 contains text code indicating a function declaration statement on the second line, so the identification unit 103 identifies the function "do_something" indicated by the text code as a module element. Furthermore, if the text program contains text code indicating a variable declaration statement, the identification unit 103 identifies the variable indicated by the text code as a module element.
[0033] The extraction unit 104 extracts information (hereinafter, interface information) required to call the module element identified by the identification unit 103 .
[0034] Specifically, it is assumed that the identification unit 103 identifies a function as a module element. In this case, the extraction unit 104 refers to the storage unit 11 and extracts, as interface information, the name of the program in which the function is implemented, the name of the function, the arguments of the function, and whether the function has a return value.
[0035] For example, suppose that the identification unit 103 identifies the function "do something" implemented in the visual program VP1 shown in Fig. 2 as a module element. In this case, the extraction unit 104 extracts, as interface information, the name of the visual program VP1, the name of the function "do something," the argument of the function ("none"), and the presence or absence of a return value of the function ("none").
[0036] On the other hand, suppose that the identification unit 103 identifies the function "do_something" implemented in the text program TP1 shown in Fig. 3 as a module element. In this case, the extraction unit 104 extracts, as interface information, the name of the text program TP1, the name of the function "do_something," the argument of the function ("none"), and the presence or absence of a return value of the function ("none").
[0037] Furthermore, it is assumed that the identification unit 103 identifies a variable as a module element. In this case, the extraction unit 104 refers to the storage unit 11 and extracts, as interface information, the name of the program in which the variable is implemented and the name of the variable.
[0038] The generation unit 105 generates a block (hereinafter, a call block) for calling the module element identified by the identification unit 103 in visual programming based on the interface information required to call the module element extracted by the extraction unit 104.
[0039] The generation unit 105 adds the generated call block to a group of one or more blocks that are candidates for selection by the user as blocks to be used in implementing a visual program, on a selection screen provided in the visual program development environment 101. A specific example of the processing by the generation unit 105 will be described later.
[0040] The execution unit 106 generates execution data for a visual program created in the visual program development environment 101 and a text program created in the text program development environment 102 .
[0041] Specifically, the execution unit 106 retrieves the specified visual program from the storage unit 11 in response to an operation instruction input by the user using the operation device 40. The execution unit 106 converts the retrieved visual program into text code that can be edited in the text program development environment 102, and further converts the text code into executable data. The execution unit 106 also retrieves the specified text program from the storage unit 11 in response to an operation instruction input by the user using the operation device 40, and converts the retrieved text program into executable data.
[0042] The output unit 107 controls the communication unit 12 to transmit the execution data generated by the execution unit 106 to the controlled device.
[0043] [Overall Configuration of Program Development Apparatus] Next, the flow of processing executed in development apparatus 1 will be described. Fig. 4 is a flowchart showing processing executed in development apparatus 1. The processing shown in Fig. 4 is started by control unit 10 at any timing. Examples of such timing include the timing when a visual program created in visual program development environment 101 is stored in storage unit 11, the timing when a text program created in text program development environment 102 is stored in storage unit 11, the timing when an editing screen for a visual program different from the visual program currently being edited is displayed on display device 30, and / or the timing when a user issues an instruction to execute the processing shown in Fig. 4 using operation device 40.
[0044] When the process shown in FIG. 4 starts, the identification unit 103 identifies module elements, which are reusable program elements, implemented in at least one of a visual program created in the visual program development environment 101 and a text program created in the text program development environment 102 (step S1).
[0045] Next, the extraction unit 104 extracts interface information required to call the module element identified in step S1 (step S2).
[0046] Next, the generating unit 105 generates a call block for calling the module element identified in step S1 in visual programming based on the interface information extracted in step S2 (step S3).
[0047] The generation unit 105 adds the call block generated in step S3 to a group of one or more blocks that are candidates for selection by the user as blocks to be used in implementing a visual program on the selection screen provided in the visual program development environment 101 (step S4).Then, the control unit 10 ends the processing shown in FIG.
[0048] 4 do not necessarily have to be performed consecutively. For example, steps S1 and S2 may be performed when the visual program is stored in the storage unit 11, and then steps S3 and S4 may be performed when the editing screen for the visual program is displayed on the display device 30.
[0049] [First Example] Next, a first example of the process shown in Fig. 4 will be described using Fig. 5 to Fig. 7. In the first example, an example of generating a call block for calling a function implemented in a visual program will be described. Fig. 5 is a diagram showing an example of generating two call blocks for calling two functions implemented in visual program VP2.
[0050] As shown in the upper left diagram of FIG. 5, the editing screen W10 provided in the visual program development environment 101 includes a display area A1 and an editing area A2.
[0051] The display area A1 displays selectable program names. The upper left diagram in Fig. 5 shows an example in which the program name "new_program2" is selected from three program names "new_program1," "new_program2," and "new_program3" displayed in the display area A1.
[0052] In the editing area A2, a visual program VP2 having the name of the program selected in the display area A1 is displayed in an editable manner. The upper left diagram in Fig. 5 shows an example in which a visual program VP2 having the name "new_program2" of the program selected in the display area A1 is displayed in an editable manner.
[0053] The visual program VP2 includes blocks B21 and B22 that represent the declaration statements of two functions. Therefore, in step S1 (FIG. 4), the two functions "foo" and "add" represented by the blocks B21 and B22 that represent the declaration statements of the two functions are identified as module elements, and then steps S2 to S4 (FIG. 4) are performed.
[0054] 6 is a diagram showing an example of generating a call block for calling a function with no arguments and no return value. For example, as shown in FIG. 6, block B21, which indicates the declaration statement of function "foo" identified as a module element in step S1 (FIG. 4), does not have a linking portion at the right end for linking to other blocks. Therefore, in step S2 (FIG. 4), extraction unit 104 determines that function "foo" is a function with no arguments. Furthermore, because block B21 does not include a "return" statement, extraction unit 104 determines that function "foo" is a function with no return value.
[0055] In this case, the extraction unit 104 extracts the name of the program in which the function "foo" is implemented, "new_program2," the name of the function, "foo," the argument of the function, "none," and the presence or absence of a return value of the function, "none," as interface information required to call the function "foo" that has no arguments and no return value.
[0056] In step S3 (Figure 4), since the return value of the function extracted as interface information indicates "none," the generation unit 105 generates a block including connecting parts at the upper and lower ends as a call block CB21 for calling the function with the name "foo" of the function extracted as interface information.
[0057] In addition, the generation unit 105 writes in the call block CB21 the character string "foo (from new_program2)" which is a concatenation of the name of the function extracted as interface information "foo" and the character string "(from new_program2)" which indicates that this is a call of a function implemented in a program whose name is "new_program2" extracted as interface information.
[0058] Then, since the argument of the function extracted as interface information indicates "none," the generation unit 105 does not provide an argument input field after the character string "foo (from new_program2)" written in the call block CB21.
[0059] 7 is a diagram showing an example of generating a call block for calling a function with arguments and a return value. Meanwhile, as shown in FIG. 7, block B22, which indicates the declaration statement of function "add" identified as a module element in step S1 (FIG. 4), has a link at its right end, to which block B23, a function that returns the addition result of two input variables "x" and "y," is linked. Therefore, in step S2 (FIG. 4), extraction unit 104 determines that function "add" indicated by block B22 is a function with two arguments "x" and "y." Furthermore, because block B22 includes a "return" statement, extraction unit 104 determines that function "add" is a function with a return value.
[0060] In this case, the extraction unit 104 extracts the interface information required to call the function "add" which has arguments and a return value, including the name of the program in which the function "add" is implemented, "new_program2," the name of the function, "add," the two arguments of the function, "x" and "y," and whether the function has a return value, "y."
[0061] In step S3 (Figure 4), since the return value of the function extracted as interface information indicates "yes," the generation unit 105 generates a block including a linking portion at the left end as a call block CB22 for calling the function with the name "add" extracted as interface information.
[0062] In addition, the generation unit 105 writes in the call block CB22 the character string "add (from new_program2)" which is a concatenation of the name of the function extracted as interface information, "add," and the character string "(from new_program2)" which indicates that this is a call of a function implemented in the program whose name is "new_program2" extracted as interface information.
[0063] Then, since the arguments of the function extracted as interface information indicate two arguments "x" and "y", the generation unit 105 provides input fields for the two arguments "x" and "y" after the character string "add (from new_program2)" written in the call block CB22.
[0064] In step S4 (FIG. 4), the two call blocks CB21 and CB22 generated in step S3 (FIG. 4) are added to a group of one or more blocks that are candidates for selection by the user as blocks to be used in implementing a visual program on a selection screen provided in visual program development environment 101. Note that on the selection screen, the call blocks are displayed in association with the names of the programs in which the module elements called by the call blocks are implemented.
[0065] Specifically, as shown in the lower right diagram of FIG. 5 , the selection screen W20 includes a selection area A21 and a display area A22. The selection area A21 displays a list of selectable program names in which module elements called by call blocks are implemented. Assume that the name of a certain program is selected in the selection area A21. In this case, if the program with the selected name has implemented variables called by call blocks, "Variables" is displayed selectable in the selection area A21. Furthermore, if the program with the selected name has implemented functions called by call blocks, "Functions" is displayed selectable in the selection area A21.
[0066] When "Variables" is selected in selection area A21, call blocks for calling variables implemented in the program with the name selected in selection area A21 are displayed selectably in display area A22 as candidates for the user to select as blocks to be used in implementation. When "Functions" is selected in selection area A21, call blocks for calling functions implemented in the program with the name selected in selection area A21 are displayed selectably in display area A22 as candidates for the user to select as blocks to be used in implementation.
[0067] The lower right diagram in Figure 5 shows an example in which the program name "new_program2" is selected in selection area A21, and then "Functions" is selected, resulting in call blocks CB21 and CB22 for calling two functions implemented in the program named "new_program2" being displayed selectably in display area A22 in association with the program name "new_program2."
[0068] When a user operates the operating device 40 to select a block to be used for implementation (e.g., call block CB21) from a group of one or more blocks (e.g., two call blocks CB21, CB22) selectably displayed in the display area A22 of the selection screen W20 as candidates for the user to select as the block to be used for implementation, the selected block (e.g., call block CB21) is additionally displayed in the editing area A2 of the editing screen W10.
[0069] Note that the selection screen W20 is displayed on the display device 30 together with the editing screen W10, for example, by being superimposed within the editing area A2 of the editing screen W10 or by being arranged next to the editing screen W10, regardless of which program name is selected in the display area A1 of the editing screen W10. Therefore, no matter which visual program the user is editing on the editing screen W10, the user can appropriately select a block to be used for implementation from a group of one or more blocks (for example, two call blocks CB21, CB22) selectably displayed in the display area A22 of the selection screen W20.
[0070] Furthermore, when "Variables" is selected in the selection area A21, a call block for calling a variable implemented in the program having the name selected in the selection area A21 may be automatically added and displayed in the editing area A2 of the editing screen W10. Similarly, when "Functions" is selected in the selection area A21, call blocks for calling a function implemented in the program having the name selected in the selection area A21 (for example, two call blocks CB21 and CB22) may be automatically added and displayed in the editing area A2 of the editing screen W10.
[0071] Furthermore, in this embodiment, an example has been described in which a call block is displayed on the selection screen W20 in correspondence with the name of the program in which the module element called by the call block is implemented, but the method of displaying a call block in a selectable manner on the selection screen W20 is not limited to this.
[0072] For example, the name of the module element called by the call block may be selectably displayed in the selection area A21, and the call block that calls the module element with the name selected in the selection area A21 may be selectably displayed in the display area A22 or automatically added to the editing area A2.
[0073] Alternatively, in the selection area A21, two or more pieces of information for identifying a block, such as the name of a program in which a module element called by a call block is implemented and the name of the module element, may be displayed in a selectable manner in association with each other. In this case, the blocks corresponding to the two or more pieces of information selected in the selection area A21 may be displayed in a selectable manner in the display area A22.
[0074] Alternatively, the selection screen W20 may not have a selection area A21, and all of the one or more blocks that the user can select as blocks to be used in implementation may be displayed selectably in the display area A22.
[0075] Second Example Next, a second example of the process shown in Fig. 4 will be described with reference to Figs. 8 to 11. In the second example, an example of generating call blocks for calling variables and functions implemented in a text program will be described. Fig. 8 shows an example of generating four call blocks for calling two variables and two functions implemented in text program TP2.
[0076] As shown in the upper diagram of FIG. 8, the editing screen W12 provided in the text program development environment 102 includes a display area A3 and an editing area A4.
[0077] The display area A3 displays the names of programs in a selectable manner. The upper diagram of Fig. 8 shows an example in which the program name "new_program2_text" is selected from three program names "new_program1," "new_program2," and "new_program2_text" displayed in the display area A3.
[0078] In the editing area A4, a text program having the name of the program selected in the display area A3 is displayed in an editable manner. The upper diagram of Fig. 8 shows an example in which a text program TP2 having the name "new_program2_text" of the program selected in the display area A3 is displayed in an editable manner.
[0079] In the text program TP2, the text code indicating the declaration of the variable "hoge" is implemented on the first line, and the text code indicating the declaration of the variable "fuga" is implemented on the second line. Furthermore, the text code indicating the declaration of the function "toto" with no arguments is implemented on the fourth line. Furthermore, the text code indicating the declaration of the function "subtract" with two arguments "x" and "y" is implemented on the seventh line.
[0080] Therefore, in step S1 (FIG. 4), the two variables "hoge" and "fuga" indicated by the text code on lines 1 and 2 are identified as module elements, and the two functions "toto" and "subtract" indicated by the text code on lines 4 and 7 are identified as module elements. Then, steps S2 to S4 (FIG. 4) are performed.
[0081] 9 is a diagram showing an example of generating a call block for calling a variable. In this example, as shown in FIG. 9, in step S2 (FIG. 4), the extraction unit 104 extracts, as interface information for calling the variable "fuga" identified as a module element in step S1 (FIG. 4), the name of the program in which the variable "fuga" is implemented, "new_program2_text," and the name of the variable, "fuga."
[0082] In step S3 ( FIG. 4 ), since the variable name “fuga” has been extracted as interface information, generation unit 105 generates a block including a convex link at the left end, indicating the presence of a return value, as call block CB32 for calling the variable named “fuga.” Furthermore, generation unit 105 writes in call block CB32 the character string “fuga (from new_program2_text)” obtained by concatenating the variable name “fuga” extracted as interface information with the character string “(from new_program2_text)” indicating that this is a call of a variable implemented in the program named “new_program2_text” extracted as interface information.
[0083] Similarly, in step S2 (Figure 4), the extraction unit 104 extracts the name of the program in which the variable "hoge" is implemented, "new_program2_text," and the name of the variable, "hoge," as interface information for calling the variable "hoge" identified as a module element in step S1 (Figure 4).
[0084] In step S3 (FIG. 4), the generating unit 105 generates a block including a convex link at the left end, indicating the presence of a return value, as a call block CB31 for calling a variable named "hoge", as shown in the lower left diagram of FIG. 8. The generating unit 105 also writes in the call block CB31 a character string "hoge (from new_program2_text)" obtained by concatenating the name of the variable extracted as interface information, "hoge", and the character string "(from new_program2_text)" indicating that the call is of a variable implemented in a program named "new_program2_text" extracted as interface information.
[0085] 10 is a diagram showing an example of generating a call block for calling a function with no arguments and no return value. Also, as shown in FIG. 10, in step S2 (FIG. 4), the extraction unit 104 determines that no text code indicating a return statement is implemented after the fourth line, where the text code indicating the declaration statement of the argument-free function "toto" identified as the module element in step S1 (FIG. 4), is implemented, but before the seventh line, where the text code indicating the next declaration statement is implemented. Therefore, the extraction unit 104 determines that the function "toto" is a function with no return value.
[0086] In this case, the extraction unit 104 extracts the name of the program in which the function "toto" is implemented, "new_program2_text," the name of the function, "toto," the argument of the function, "none," and the presence or absence of a return value of the function, "none," as interface information required to call the function "toto" that has no arguments and no return value.
[0087] In step S3 (Figure 4), since the return value of the function extracted as interface information indicates "none," the generation unit 105 generates a block including connecting parts at the upper and lower ends as a call block CB33 for calling the function with the name "toto" of the function extracted as interface information.
[0088] In addition, the generation unit 105 writes in the call block CB33 the character string "toto (from new_program2_text)" which is a concatenation of the name of the function extracted as interface information, "toto," and the character string "(from new_program2_text)" which indicates that this is a call of a function implemented in the program having the name of the program extracted as interface information, "new_program2_text."
[0089] Then, since the argument of the function extracted as interface information indicates "none," the generation unit 105 does not provide an argument input field after the character string "toto (from new_program2_text)" written in the call block CB21.
[0090] 11 is a diagram showing an example of generating a call block for calling a function with arguments and a return value. Meanwhile, as shown in FIG. 11, in step S2 (FIG. 4), the extraction unit 104 detects that text code indicating a return statement is implemented on line 8, which is after line 7 where the text code indicating the declaration statement of the function "subtract" having two arguments "x" and "y" identified as the module element in step S1 (FIG. 4) is implemented, but before the text code indicating the next declaration statement. Therefore, the extraction unit 104 determines that the function "subtract" is a function with a return value.
[0091] In this case, the extraction unit 104 extracts the name of the program in which the function "subtract" is implemented, "new_program2_text," the name of the function, "subtract," the two arguments of the function, "x" and "y," and whether the function has a return value, "y," as interface information required to call the function "subtract" which has arguments and a return value.
[0092] In step S3 (Figure 4), since the return value of the function extracted as interface information indicates "yes," the generation unit 105 generates a block including a linking portion at the left end as a call block CB34 for calling the function with the name "subtract" of the function extracted as interface information.
[0093] Furthermore, the generation unit 105 writes in the call block CB34 the character string "subtract (from new_program2_text)" which is a concatenation of the name of the function extracted as interface information, "subtract," and the character string "(from new_program2_text)" which indicates that this is a call of a function implemented in the program whose name is extracted as interface information, "new_program2_text."
[0094] Then, since the arguments of the function extracted as interface information indicate two arguments "x" and "y", the generation unit 105 provides input fields for the two arguments "x" and "y" after the character string "subtract (from new_program2_text)" written in the call block CB22.
[0095] In step S4 (FIG. 4), similarly to the first embodiment, the four call blocks CB31 to CB34 generated in step S3 (FIG. 4) are added to a group of one or more blocks that are candidates for selection by the user as blocks to be used in implementing a visual program on selection screen W20 (FIG. 8) provided in visual program development environment 101. On selection screen W20 (FIG. 8), the call blocks are displayed in association with the names of the programs in which the module elements called by the call blocks are implemented.
[0096] The lower left diagram in Figure 8 shows an example in which the program name "new_program2_text" is selected in the selection area A21 of the selection screen W20, and then "Variables" is selected, resulting in call blocks CB31 and CB32 for calling two variables implemented in the program with the program name "new_program2_text" being displayed selectably in the display area A22 in association with the program name "new_program2_text."
[0097] The lower right diagram in Figure 8 shows an example in which the program name "new_program2_text" is selected in the selection area A21 of the selection screen W20, and then "Functions" is selected, resulting in call blocks CB33 and CB34 for calling two functions implemented in the program named "new_program2_text" being associated with the program name "new_program2_text" and displayed selectably in the display area A22.
[0098] When a user operates the operating device 40 to select a block to be used for implementation (e.g., call block CB31) from a group of one or more blocks (e.g., two call blocks CB31, CB32) selectably displayed in the display area A22 of the selection screen W20 as candidates for the user to select as the block to be used for implementation, the selected block (e.g., call block CB31) is additionally displayed in the editing area A2 of the editing screen W10.
[0099] Note that the selection screen W20 is displayed on the display device 30 together with the editing screen W10, for example, by being superimposed within the editing area A2 of the editing screen W10 or by being arranged next to the editing screen W10, regardless of which program name is selected in the display area A1 of the editing screen W10. Therefore, no matter which visual program the user is editing on the editing screen W10, the user can appropriately select a block to be used for implementation from a group of one or more blocks (for example, two call blocks CB33 and CB34) selectably displayed in the display area A22 of the selection screen W20.
[0100] Furthermore, when "Variables" is selected in selection area A21, call blocks (e.g., two call blocks CB31 and CB32) for calling variables implemented in the program having the name selected in selection area A21 may be automatically added and displayed in editing area A2 of editing screen W10. Similarly, when "Functions" is selected in selection area A21, call blocks (e.g., two call blocks CB33 and CB34) for calling functions implemented in the program having the name selected in selection area A21 may be automatically added and displayed in editing area A2 of editing screen W10.
[0101] Furthermore, in this embodiment, as in the first embodiment, an example has been described in which a call block is displayed on the selection screen W20 in correspondence with the name of the program in which the module element called by the call block is implemented, but the method of displaying a call block in a selectable manner on the selection screen W20 is not limited to this.
[0102] For example, the name of the module element called by the call block may be selectably displayed in the selection area A21, and the call block that calls the module element with the name selected in the selection area A21 may be selectably displayed in the display area A22 or automatically added to the editing area A2.
[0103] Alternatively, in the selection area A21, two or more pieces of information for identifying a block, such as the name of a program in which a module element called by a call block is implemented and the name of the module element, may be displayed in a selectable manner in association with each other. In this case, the blocks corresponding to the two or more pieces of information selected in the selection area A21 may be displayed in a selectable manner in the display area A22.
[0104] Alternatively, the selection screen W20 may not have a selection area A21, and all of the one or more blocks that the user can select as blocks to be used in implementation may be displayed selectably in the display area A22.
[0105] Next, a third embodiment of the process in which the execution unit 106 converts a visual program in which call blocks are implemented into text code will be described with reference to Figures 12 to 14. In the third embodiment, as shown in Figure 12, the execution unit 106 converts a visual program VP3 in which two call blocks CB41 and CB42 are implemented into text code TC3.
[0106] 13 is a diagram showing an example of converting a call block of a function without arguments and a return value into text code. Specifically, as shown in FIG. 13, the execution unit 106 recognizes that a call block CB41 for calling a function "toto" implemented in a program named "new_program2_text" is implemented at the beginning of the visual program VP3.
[0107] In this case, the execution unit 106 acquires the name of the function called by the call block CB41, "toto," and the name of the program in which the function is implemented, "new_program2_text," from the interface information held by the call block CB41. The interface information held by the call block is the interface information extracted by the extraction unit 104 and used by the generation unit 105 to generate the call block, and is reflected as the character string and shape described in the call block.
[0108] Furthermore, since there is no input field for arguments after the character string "toto (from new_program2_text)" written in the call block CB41 and there is no linking portion at the left end of the call block CB41, the execution unit 106 understands that the function "toto" called by the call block CB41 is a function without arguments or return values.
[0109] In this case, the execution unit 106 implements text code indicating that the program with the acquired program name "new_program2_text" is to be referenced in the first line. Then, the execution unit 106 implements text code indicating that the function "toto" with no arguments and no return value is to be called in the program with the program name "new_program2_text" in the fourth line.
[0110] The text code indicating that the execution unit 106 will call the above function "toto" may be implemented not on the fourth line, but on, for example, the second or third line, after the text code on the first line indicating that the program named "new_program2_text" is to be referenced, and before the text code corresponding to block B43 (FIG. 12) linked to the bottom end of the call block CB41.
[0111] 14 is a diagram showing an example of converting a call block CB42 of a function with arguments and a return value into text code. The execution unit 106 recognizes that a block B43 (FIG. 12) for calling the function "print" provided by the visual program development environment 101 is linked to the bottom end of the call block CB41 (FIG. 12) implemented in the visual program VP3. The execution unit 106 then recognizes that a call block CB42 for calling the function "subtract" implemented in the program named "new_program2_text" is linked to the link provided at the right end of the block B43.
[0112] In this case, the execution unit 106 obtains the name of the function called by the calling block CB42, "subtract," and the name of the program in which the function is implemented, "new_program2_text," from the interface information held by the calling block CB42.
[0113] Furthermore, the execution unit 106 understands that input fields for two arguments "x" and "y" are provided after the character string "subtract (from new_program2_text)" written in the call block CB42, and that "3" has been entered in the input field for the argument "x" and "1" has been entered in the input field for the argument "y." From this, the execution unit 106 understands that the call block CB42 implements a call to the function "subtract" with the argument "x" set to "3" and the argument "y" set to "1."
[0114] Furthermore, the calling block CB42 is linked to the right end of the block B43 for calling the function "print." Therefore, the execution unit 106 understands that the calling block CB42 is implemented so that the return value when the calling block CB42 calls a function becomes an argument of the function "print" called by the block B43.
[0115] In this case, the execution unit 106 omits implementing the text code indicating that the program with the acquired program name "new_program2_text" is referenced because the text code is already implemented in the first line. The execution unit 106 implements text code in the fifth line indicating that the function "print" is to be called using, as an argument, the return value obtained when the function "subtract" implemented in the program with the program name "new_program2_text" is called with the argument "x" set to "3" and the argument "y" set to "1."
[0116] The text code indicating that the execution unit 106 will call the above function "print" may be implemented not on the fifth line, but on a line after the fourth line of text code corresponding to the call block CB41 (FIG. 12) linked to the top end of block B43.
[0117] The above-described embodiments each show a specific example of the present invention. The numerical values, shapes, components, steps, order of steps, etc. shown in the above-described embodiments are merely examples and are not intended to limit the present invention.
[0118] For example, in the above embodiment, an example was described in which visual programming is performed by linking and combining multiple blocks in the visual program development environment 101, but instead of the visual program development environment 101, a visual program development environment in which visual programming can be performed by connecting multiple nodes with lines may be adopted.
[0119] Alternatively, the identification unit 103 may identify only variables implemented in at least one of the visual program and the text program as module elements, without identifying functions implemented in the at least one of the visual program and the text program as module elements. Conversely, the identification unit 103 may identify only functions implemented in at least one of the visual program and the text program as module elements. Alternatively, the execution unit 106 may convert a visual program into executable data without converting it into text code.
[0120] [Inventions Included in the Above-Described Embodiments] The above-described embodiments include the following inventions.
[0121] A program development support method according to one aspect of the present invention is a program development support method in a program development device equipped with program development environments using both visual programming and text programming, which identifies module elements, which are reusable program elements, implemented in at least one of a program created using the visual programming and a program created using the text programming, extracts interface information required to call the module elements, and generates a call block, which is a program component for calling the module elements in the visual programming, based on the interface information.
[0122] According to this development support method, in visual programming, calls to module elements can be implemented using call blocks without using program components to implement program elements with the same content as the module elements. Therefore, when the content of a module element is edited, editing of a program in which call blocks are implemented can be avoided. Therefore, this development support method allows reusable program elements implemented in programs created by visual programming and text programming to be efficiently reused in visual programming.
[0123] In the above-mentioned program development support method, the program development environment using visual programming can be provided with a selection screen that allows the user to select program parts to be used in program implementation from a group of one or more program parts, and the call block can be added to the group.
[0124] According to this aspect, the user can select the call block as a program component to be used in implementing the program on a selection screen provided in the program development environment using visual programming.
[0125] In the above program development support method, the call block may be displayed on the selection screen in association with the name of the program in which the module element called by the call block is implemented.
[0126] According to this aspect, when a user selects a call block on the selection screen, the user can refer to the name of the program in which the module element called by the call block is implemented, thereby reducing the possibility that the user will select a call block that calls a module element other than the desired module element.
[0127] The above program development support method can further be configured to convert a program created using the call blocks by the visual programming into text code that can be edited in the program development environment by the text programming.
[0128] According to this aspect, a program created using call blocks by visual programming is converted into text code that can be edited in a program development environment using text programming. This text code can be used to teach users who are not familiar with text programming how to implement calls to module elements using text programming.
[0129] In the above program development support method, the module element may be a variable, and the interface information may include the name of the program in which the module element is implemented and the name of the variable.
[0130] According to this development support method, in visual programming, even if the same variables as module elements are not implemented using program components, it is possible to implement the call of the variables using call blocks.
[0131] In the above-mentioned program development support method, the module element may be a function, and the interface information may include the name of the program in which the module element is implemented, the name of the function, the arguments of the function, and whether or not the function has a return value.
[0132] According to this development support method, in visual programming, even if the same function as the module element is not implemented using a program component, the call of the function can be implemented using a call block.
[0133] A program development device according to another aspect of the present invention is a program development device equipped with a program development environment using both visual programming and text programming, and includes an identification unit that identifies module elements, which are reusable program elements implemented in at least one of a program created using the visual programming and a program created using the text programming, an extraction unit that extracts interface information required to call the module elements, and a generation unit that generates, based on the interface information, a call block, which is a program component for calling the module elements in the visual programming.
[0134] This development device can provide the same effects as the development support method described above.
[0135] A control program according to another aspect of the present invention is a control program for controlling a computer of a program development device having a program development environment using both visual programming and text programming, and causes the computer to function as an identification unit that identifies module elements, which are reusable program elements implemented in at least one of a program created by the visual programming and a program created by the text programming, an extraction unit that extracts interface information required to call the module elements, and a generation unit that generates, based on the interface information, a call block, which is a program component for calling the module elements in the visual programming.
[0136] According to this control program, it is possible to obtain the same effects as the above-mentioned development support method.
[0137] The present invention can also be realized as an information processing system that operates according to such a control program. Needless to say, such a control program can be distributed on a non-transitory computer-readable recording medium such as a CD-ROM or via a communication network such as the Internet.
Claims
1. A program development support method in a program development apparatus having a program development environment for each of visual programming and text programming, the method comprising: identifying a module element, which is a reusable program element implemented in at least one of the programs created by the visual programming and the programs created by the text programming; extracting interface information necessary for calling the module element; and generating a call block, which is a program component for calling the module element in the visual programming, based on the interface information.
2. The program development support method according to claim 1, wherein the program development environment for visual programming includes a selection screen for allowing a user to select program components to be used for program implementation from a group of one or more program components, and adding the call block to the group.
3. The program development support method according to claim 2, wherein on the selection screen, the call block is displayed in association with the name of the program in which the module element called by the call block is implemented.
4. The program development support method according to claim 1, further comprising converting a program created using the call block by the visual programming into editable text code in the program development environment for text programming.
5. The program development support method according to any one of claims 1 to 4, wherein the module element is a variable, and the interface information includes the name of the program in which the module element is implemented and the name of the variable.
6. In the program development support method according to any one of claims 1 to 4, wherein the module element is a function, and the interface information includes the name of the program in which the module element is implemented, the name of the function, the arguments of the function, and the presence or absence of the return value of the function. A program development support method.
7. A program development apparatus having a program development environment for visual programming and text programming, comprising: a specifying unit that specifies a module element, which is a reusable program element, implemented in at least one of the programs created by the visual programming and the programs created by the text programming; an extraction unit that extracts interface information necessary for calling the module element; and a generation unit that generates a call block, which is a program component for calling the module element in the visual programming, based on the interface information. A program development apparatus.
8. A control program for controlling a computer of a program development apparatus having a program development environment for visual programming and text programming, the control program causing the computer to function as a specifying unit that specifies a module element, which is a reusable program element, implemented in at least one of the programs created by the visual programming and the programs created by the text programming; an extraction unit that extracts interface information necessary for calling the module element; and a generation unit that generates a call block, which is a program component for calling the module element in the visual programming, based on the interface information. A control program.
Citation Information
Patent Citations
Software construction support system, its method, and software construction support program
JP2002229783A
Software development support device and program
JP2013097494A