Development support device
Patent Information
- Authority / Receiving Office
- AU · AU
- Patent Type
- Applications
- Current Assignee / Owner
- KK TOSHIBA
- Filing Date
- 2024-11-11
- Publication Date
- 2026-08-06
AI Technical Summary
Conventional development support devices are unable to accurately determine the total number of execution steps required to predict the load and time for program execution, especially when function blocks are used by other function blocks, leading to inaccurate load and time prediction.
A development support device equipped with a step counter to count the number of execution steps of function blocks, a count counter to track the number of times a function block is used, and a calculation unit to compute the product of these values, enabling accurate determination of the total number of execution steps.
Enables precise calculation of the total number of execution steps for programs, even when function blocks are nested, thereby improving the accuracy of load and time prediction during program execution.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Development Support Equipment
[0001] An embodiment of the present invention relates to a program development support device.
[0002] When developing programs for embedded systems, etc., it is sometimes necessary to predict the load and time required for program execution. When developing functional programs (POU: Program Organizing Unit) using development support devices such as engineering tools, information called POU entries can be obtained, including the POU number, program name, type, whether it has been generated (progress), generation date and time, number of steps, etc.
[0003] However, the number of steps included in the POU entry is output for the purpose of checking the memory usage of the controller, and does not represent the number of execution steps, which indicates the number of processes when the program is executed. Conventionally, the total number of steps used to predict the load and required time when a program is executed has been calculated manually.
[0004] In addition, when a program includes a function block (FBK), it is difficult to count the total number of steps because the function block is used by another function block, etc.
[0005] JP 2012-59078 A
[0006] As described above, conventional development support devices have been unable to obtain the total number of steps required to predict the load and required time during program execution. An object of an embodiment of the present invention is to provide a development support device that can obtain the total number of steps required to predict the load and required time during program execution.
[0007] A development support device according to an embodiment supports the development of a program including a function block. The development support device includes a step counter that counts the number of execution steps of the function block, which indicates the number of processes executed in the function block, a count counter that counts the number of times the function block is used in the program, and a calculation unit that calculates the product of the number of times the function block is used and the number of execution steps of the function block, and outputs the number of execution steps of the function block in the program.
[0008] 1 is a diagram showing an example of a program configuration to be processed by the development support device according to an embodiment. FIG. 1 is a diagram showing an example of the execution content, binary, and steps of program MS000. FIG. 2 is a diagram showing an example of the execution content, binary, and steps of program USR_FBK2. FIG. 3 is a block diagram showing the functional configuration of the development support device according to an embodiment. FIG. 4 is a flowchart showing the operation of the development support device according to an embodiment. FIG. 5 is a diagram showing an example of a POU entry display in the development support device according to an embodiment. FIG. 6 is a flowchart showing the operation of function block processing in the development support device according to an embodiment. FIG. 7 is a diagram showing an example of a table showing count values of the number of times a function block is used in the development support device according to an embodiment. FIG. 8 is a diagram showing an example of a table showing count values of the number of times a function block is used for each task type in the development support device according to an embodiment. FIG. 9 is a diagram showing an example of a table recording the product of the number of times a function block is used and the number of execution steps in the development support device according to an embodiment. FIG. 10 is a diagram showing an example of a table recording the number of times a function block is used and the total number of steps for each task type in the development support device according to an embodiment. FIG. 11 is a diagram showing an example of output information of the development support device according to an embodiment.
[0009] (Method of calculating the total number of steps) Hereinafter, a development support device according to an embodiment will be described in detail with reference to the drawings. In the development support device according to an embodiment, the number of times each function block is used and the number of execution steps are calculated for each task type. Specifically, the usage information of all function blocks is listed, and the number of times each function block is used is calculated. The total number of steps can be calculated from the calculation results.
[0010] 1 shows an example of a program configuration to be processed by a development support device according to an embodiment. In the example described below, it is assumed that there are three task types: main (MS), high speed (HS), and super high speed (SS).
[0011] As shown in Figure 1, the programs to be processed include program MS000 of task type MS, program HS000 of task type HS, and program SS000 of task type SS. The programs to be processed also include function blocks USR_FBK1, USR_FBK2, and USR_FBK3. Function blocks are program elements that output one or more results in response to a certain input value, and are modularized as reusable circuit blocks. These programs and function blocks can be managed as POUs.
[0012] 1, the program MS000 includes two function blocks USR_FBK2, the program HS000 includes two function blocks USR_FBK2 and one function block USR_FBK3, and the program SS000 includes one function block USR_FBK1.
[0013] A function block may contain other function blocks. In the example shown in Figure 1, the function block USR_FBK2 contains one function block USR_FBK1. In other words, the function block USR_FBK2 uses the function block USR_FBK1.
[0014] The relationship between programs, function blocks, and steps will be explained with reference to Figures 2 and 3. Figure 2 shows an example of the execution content, binary, and steps of program MS000. Figure 3 shows an example of the execution content, binary, and steps of function block USR_FBK2.
[0015] FIG. 2 shows a graphic display 11, execution contents 12, and binary display 13 of program MS000. As shown in graphic display 11 in FIG. 2, program MS000 has two function blocks USR_FBK2 (15a, 15b). The execution contents of program MS000 shown in graphic display 11 are shown in execution contents 12. Binary display 13 represents program MS000 shown in graphic display 11 and execution contents 12 converted into binary format (downloadable format). Binary display 13 shows steps 14 of program MS000 in addition to the binary format of program MS000. The number of steps shown in steps 14 corresponds to the number of lines (number of processed lines) in the binary of program MS000.
[0016] The execution contents of the function block USR_FBK2 (15a, 15b) shown in the graphic display 11 correspond to processes 16a and 16b, respectively. In Figure 2, processes 16a and 16b indicate the execution of the function block USR_FBK2. Therefore, step 14 of the program MS000 does not include any steps related to the execution contents of the function block USR_FBK2.
[0017] As shown in binary display 13, program MS000 is a program with a total of 22 steps, using two function blocks USR_FBK2. Function block USR_FBK2 has four execution steps each, as shown in processes 16a and 16b. However, because this only calls function block USR_FBK2, the number of execution steps executed by function block USR_FBK2 is not included. Therefore, the total number of execution steps in program MS000 cannot be determined from the binary number of execution steps in program MS000.
[0018] 3 shows a graphic display 21, an execution content 22, and a binary display 23 of the function block USR_FBK2. As shown in the graphic display 21 in FIG. 3, the function block USR_FBK2 has one function block USR_FBK1 (25). The execution content of the function block USR_FBK2 shown in the graphic display 21 is shown in the execution content 22. The binary display 23 shows the function block USR_FBK2 shown in the graphic display 21 and the execution content 22 converted into binary format. In addition to the binary format of the function block USR_FBK2, the binary display 23 also shows steps 24 of the function block USR_FBK2. The number of steps shown in the step 24 corresponds to the number of binary lines (number of processing lines) of the function block USR_FBK2.
[0019] The function block USR_FBK1 (25) shown in the graphic display 21 corresponds to the process 26. In Fig. 3, the process 26 indicates that the function block USR_FBK1 is being called. Therefore, the step 24 of the function block USR_FBK2 does not include the number of steps related to the execution of the function block USR_FBK1.
[0020] As shown in the binary representation 23, function block USR_FBK2 is a program with a total of 16 steps, using one function block USR_FBK1. Function block USR_FBK1 has four execution steps, as shown in process 26. However, because this only calls function block USR_FBK1, the number of execution steps executed by function block USR_FBK1 is not included. Therefore, the total number of execution steps of function block USR_FBK2 cannot be determined from the binary step count of function block USR_FBK2.
[0021] Here, if the number of execution steps of function block USR_FBK1 is 12, the number of execution steps when program MS000 is executed can be calculated as follows: Number of execution steps of MS000: 22 Number of execution steps of USR_FBK2 × number of uses: 16 × 2 Number of execution steps of USR_FBK1 × number of uses: 12 × 2 22 + 16 × 2 + 12 × 2 = 78 (1) In other words, this number is different from the number of execution steps of program MS000 (22 steps). In the development support device of the embodiment, the number of execution steps for each task type is obtained by calculating the product of the number of uses and the execution steps for each function block in this way.
[0022] (Configuration of the embodiment) Next, the configuration of the development support device according to the embodiment will be described in detail. Fig. 4 is a block diagram showing the functional configuration of the development support device 100 according to the embodiment.
[0023] As shown in Fig. 4, the development support device 100 of the embodiment includes a display unit 105, a display control unit 110, an input unit 115, an output unit 120, and a storage unit 125. The development support device 100 of the embodiment also includes an editor 130, a compiler 135, a step counter 140, a number counter 140, and a calculation unit 150. The development support device 100 can be realized by, for example, a computer device. The computer device is a device that includes a CPU, a main storage device, an auxiliary storage device, etc., and can realize the functional configuration shown in Fig. 4 through cooperation of software and hardware.
[0024] The display unit 105 is a functional element that presents information to a user. The display unit 105 can be realized by, for example, a display device, a printer device, etc. The display unit 105 displays display information generated by the display control unit 110.
[0025] The display control unit 110 is a functional element that generates information (display information) to be displayed by the display unit 105. For example, the display control unit 110 stores templates to be displayed by the display unit 105 in the storage unit 125 (described later) and adds data to the templates to generate display information.
[0026] The input unit 115 is a functional element through which a user inputs information. The input unit 115 can be realized by, for example, a keyboard, a mouse, etc. The input unit 115 may also be realized by a touch panel or the like in combination with the display unit 105.
[0027] The output unit 120 is a functional element that outputs programs created by a user and data generated by the development support device 100 in a format such as a file. The output unit 120 can output, for example, a program in text format or data in CSV (Comma Separated Values) format. The output unit 120 may store the data to be output in the storage unit 125.
[0028] The storage unit 125 is an auxiliary storage device of the development support device 100. The storage unit 125 can store software that realizes the development support device 100, programs created by the user, display information templates saved by the display control unit 110, various tables, etc. The storage unit 125 can be realized by, for example, a hard disk drive (HDD) or a solid state drive (SDD).
[0029] The editor 130 is a functional element that provides an editing function when a user creates a program. The editor 130 can take various forms depending on the programming language.
[0030] The compiler 135 is a functional element that converts a program created by a user into a format that can be executed and interpreted by a computer. A compiler compatible with a programming language can be adopted as the compiler 135. In the development support device 100 according to the embodiment, the compiler 135 converts the programs shown in the graphic displays 11 and 21 and the execution contents of the programs shown in the execution contents 12 and 22 into the binary format shown in the binary displays 13 and 23.
[0031] The step counter 140 is a functional element that counts the execution content of a program or the number of execution steps of a binary.
[0032] The number counter 145 is a functional element that counts the number of times a function block is used.
[0033] The calculation unit 150 is a functional element that executes numerical calculations and searches for destinations where function blocks are used.
[0034] (Operation of the embodiment) Next, the operation of the development support device 100 according to the embodiment will be described in detail with reference to Fig. 5 and Fig. 6. Fig. 5 is a flowchart showing the operation of the development support device according to the embodiment. Fig. 6 is a diagram showing an example of a POU entry display in the development support device according to the embodiment.
[0035] The display control unit 110 generates a POU entry screen (S200). The display control unit 110 reads out a template for the POU entry screen from the storage unit 125. The display control unit 110 adds information such as the number, program name, type, and creation date of each program (POU) stored in the storage unit 125 to the read-out template.
[0036] The step counter 140 counts the number of execution steps for each POU stored in the storage unit 125 and passes the count to the display control unit 110. The display control unit 110 adds the received count value of the number of execution steps to the template of the POU entry screen, completing the POU entry screen (S210). In the following description, information such as the number, program name, type, creation date, and number of execution steps for each POU will be referred to as a POU entry.
[0037] The display control unit 110 displays the completed POU entry screen on the display unit 105 (S220). Fig. 6 shows an example of a POU entry screen. As shown in Fig. 6, the POU entry screen 30 includes a title 31, a module name 32, a display order 33, a display line 34, a value selection 35, and a file save button 36. These can be selected using a mouse or the like as the input unit 115, and the selection result is sent to the display control unit 110.
[0038] 6, the POU entry screen 30 has an entry list 37. The entry list 37 includes information such as the POU number, program name, type, whether it has been created, the creation date, and the number of steps, listed for each POU such as a program or function block. The number of steps included in the entry list 37 is the number of execution steps for a single program or function block.
[0039] When the user selects the file save button 36 on the POU entry screen 30 using the input unit 115, such as a mouse (Yes in S230), the count counter 145 counts the number of times each type of function block used in the program is used for each task type (S240).
[0040] 1, the number of times the function block USR_FBK1 is used in the task type SS is 1, and the number of times the function block USR_FBK2 is used in the task type MS is 2. The number counter 145 stores the count result in the storage unit 125.
[0041] The calculation unit 150 calculates the product of the number of times the function block is used in the program (the number of times counted in S240) and the number of execution steps of the function block (S250). The number of times the function block is used is obtained in S240. The number of execution steps of the function block is obtained in S210. The calculation unit 150 calculates this product.
[0042] For example, the number of times the function block USR_FBK1 is used in program SS000 is 1. The number of execution steps of function block USR_FBK1 is 12. Therefore, the calculation unit 150 calculates 1 x 12. The calculation result, 12, is the number of execution steps of function block USR_FBK1 used in program SS000.
[0043] The calculation unit 150 adds the number of uses and the number of execution steps for each task type of the function block to the POU entry (S260). The number of uses of the function block USR_FBK1 in task type SS is 1, and the number of execution steps of the function block USR_FBK1 is 12. If the number of execution steps of program SS000 of task type SS is 16 as shown in Figure 6, the total number of execution steps of program SS000 is the sum of 16 and 12, or 28.
[0044] The output unit 120 stores the POU entry with the added number of uses and number of execution steps in the storage unit 125 as a CSV file or the like (S270).
[0045] If the file save button 36 is not selected or if the output unit 120 outputs a file (No in S230, S270), the input unit 115 waits for input from the user (S280). If the input unit 115 does not receive an instruction to close the screen from the user (No in S280), the input unit 115 waits for the file save button to be pressed (S230). If the input unit 115 receives an instruction to close the screen from the user (Yes in S280), the processing ends.
[0046] In the example described above, the count of the number of times the function block is used and the calculation of the product with the number of steps are performed after the POU entry screen is displayed, but this is not limiting. The count of the number of times the function block is used and the calculation of the number of steps may be performed without displaying the POU entry screen.
[0047] (Function Block Counting Operation) Next, a method for counting the number of times a function block is used in a development support device according to an embodiment will be described in detail with reference to FIGS. 7 to 12. FIG. 7 is a flowchart showing the operation of function block processing in the development support device according to an embodiment. FIG. 8 is a diagram showing an example of a table showing count values of the number of times a function block is used in a development support device according to an embodiment. FIG. 9 is a diagram showing an example of a table showing count values of the number of times a function block is used for each task type in a development support device according to an embodiment. FIG. 10 is a diagram showing an example of a table recording the product of the number of times a function block is used and the number of execution steps in a development support device according to an embodiment. FIG. 11 is a diagram showing an example of a table recording the number of times a function block is used for each task type and the total number of steps in a development support device according to an embodiment. FIG. 12 is a diagram showing an example of an output from the development support device according to an embodiment.
[0048] The calculation unit 150 first searches for users of the function block USR_FBK1 (S300). The calculation unit 150 references the programs and binaries stored in the storage unit 125 to search for users of the function block USR_FBK1 (such as programs that use the function block USR_FBK1). As shown in Figure 1, the program SS000 and the function block USR_FBK2 use the function block USR_FBK1. This reveals that the function block USR_FBK1 is a function block used in the task SS.
[0049] The calculation unit 150 determines whether the function block USR_FBK1 is used by another function block (S310). In the example shown in Fig. 1, the function block USR_FBK1 is used by the function block USR_FBK2 (Yes in S310).
[0050] The count counter 145 counts the number of times the function block USR_FBK2 is used. The calculation unit 150 saves a table in the memory unit 125 that holds the names of the function blocks that use it and the number of times they are used (S320). As shown in FIG. 1, the function block that uses the function block USR_FBK1 is the function block USR_FBK2. The function block USR_FBK2 is used twice in the program MS000 and twice in the program HS000. The calculation unit 150 records in the memory unit 125 that the function block USR_FBK2 has been used a total of four times. FIG. 8 shows an example of the contents saved in the memory unit 125 by the calculation unit 150.
[0051] Next, the calculation unit 150 searches for users of the function block USR_FBK2 (S330). In the example shown in Fig. 1, the users of the function block USR_FBK2 are the program MS000 and the program HS000.
[0052] The calculation unit 150 determines whether the user of the searched function block USR_FBK2 is a function block (S340). If the result of the determination is that it is a function block (Yes in S340), the count counter 145 counts the number of times that the function block has been used, and the calculation unit 150 stores the name and number of times that the function block has been used (S320), and then searches for its user (S330). If there is another function block that is a user of the function block, this process is repeated.
[0053] If the result of the determination is that the function block is not a function block (No in S340), the count counter 145 counts the number of times each function block is used for each task type (S350). In the example shown in Fig. 1, the function block USR_FBK1 is used once for task type SS. Furthermore, the function block USR_FBK2 is used twice for task type MS.
[0054] At this stage, the function block (USR_FBK2) that uses function block USR_FBK1 and the number of times that function block USR_FBK2 has been used are known. That is, the following information is obtained: Function block USR_FBK1 is used in task SS (S300) Function block USR_FBK2 has been used four times (S320) Function block USR_FBK2 is used twice each in tasks MS and HS (S350) The calculation unit 150 records this information in the memory unit 125.
[0055] 9 shows an example of the contents stored in the storage unit 125 by the calculation unit 150. That is, task SS uses function block USR_FBK1 once. Task HS uses function block USR_FBK2 twice. Task MS uses function block USR_FBK2 twice.
[0056] Next, the calculation unit 150 calculates the product of the number of uses of function block USR_FBK1 used in the function block USR_FBK2 where it is used and the number of uses of FBK2 for each task type (S360). In the example shown in FIG. 1, function block USR_FBK2 is not used in task SS, and function block USR_FBK1 is used directly only once. In task HS, function block USR_FBK2 is used twice, and function block USR_FBK1 is used once in function block USR_FBK2, so the product is 2. Similarly, in task MS, function block USR_FBK2 is used twice, and function block USR_FBK1 is used once in function block USR_FBK2, so the product is 2. The calculation unit 150 stores this result in the storage unit 125.
[0057] 10 shows an example of the contents stored in the storage unit 125 by the calculation unit 150. That is, the product of task SS is 1, the product of task HS is 2, and the product of task MS is 2. These show the number of times the function block USR_FBK1 is used for each task type.
[0058] The calculation unit 150 calculates the product of the number of times the function block is used for each task type and the number of execution steps of the function block (S370). The number of execution steps of function block USR_FBK1 is 12, and the number of times it is used in task SS is 1, so the product is 12. Similarly, the number of times it is used in task HS is 2, so the product is 24. The number of times it is used in task MS is 2, so the product is 24. The calculation unit 150 stores the calculation results in the storage unit 125. The output unit 120 provides the stored content to the user. FIG. 11 shows an example of the content stored in the storage unit 125 by the calculation unit 150.
[0059] The calculation unit 150 executes the processes from S300 to S370 for all function blocks, and stores the results in the form of output information in the storage unit 125. Fig. 12 shows an example of the contents stored in the storage unit 125 by the calculation unit 150.
[0060] 12 includes an entry list 41 including the POU number, program name, type, whether it has been generated or not, generation date, number of steps, etc., the number of uses in task type SS 42, the number of uses in task type HS 43, the number of uses in task type MS 44, the total number of steps in task type SS 45, the total number of steps in task type HS 46, and the total number of steps in task type MS 47. Of these, the total number of steps in task type SS 45, the total number of steps in task type HS 46, and the total number of steps in task type MS 47 indicate the total number of executed steps in the respective tasks.
[0061] For example, the number of uses 42 for task type SS indicates the number of times a POU is used in task type SS. That is, in task type SS, program SS000 is used once and function block USR_FBK1 is used once. The total number of steps 45 for task type SS indicates the number of execution steps executed in task type SS. That is, program SS000 has 16 execution steps, and function block USR_FBK1 has 12 execution steps. The sum of these represents the total number of execution steps when task type SS, in other words, program SS000, is executed.
[0062] Similarly, the number of uses 44 in task type MS indicates the number of times a POU is used in task type MS. That is, in task type MS, program MS000 is used once, function block USR_FBK2 is used twice, and function block USR_FBK1 is used twice. The total number of steps 47 in task type MS indicates the number of execution steps performed in task type MS. That is, program MS000 has 22 execution steps, function block USR_FBK2 has 32 execution steps (16 x 2), and function block USR_FBK1 has 24 execution steps (12 x 2). The sum of these represents the total number of execution steps when task type MS, or in other words, program MS000, is executed.
[0063] The calculation unit 150 may calculate the total number of execution steps when each task type is executed, and the output information 40 may include this total number of execution steps.
[0064] In this way, according to the development support device of the embodiment, the number of uses of the original function block is calculated for each task type using the number of uses of the destination function block that uses the function block, so the number of execution steps can be accurately calculated even when a function block uses another function block. In other words, the number of execution steps of the program taking into account the number of execution steps of the function block can be obtained.
[0065] Although several embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be embodied in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included within the scope and spirit of the invention, and are also included in the scope of the invention and its equivalents as defined in the claims.
[0066] 11, 21...Graphical display 12, 22...Execution content 13, 23...Binary display 14, 24...Step 15a, 15b...Function block USR_FBK2 16a, 16b, 26...Processing 25...Function block USR_FBK1 30...POU entry screen 31...Title 32...Module name 33...Display order 34...Display line 35...Value selection 36, 41...File save button 37...Entry list 40...Output information 42...Number of uses in task SS 43...Number of uses in task HS 44...Number of uses in task MS 45...Total number of steps in task SS 46...Total number of steps in task HS 47...Total number of steps in task MS 100...Development support device 105...Display unit 110...Display control unit 115...Input unit 120...Output unit 125...Storage unit 130...Editor 135... Compiler 140... Linker 145... Step counter 150... Calculation unit
Claims
1. A development support device that supports the development of a program that includes a function block, comprising: a step counter that counts the number of execution steps of the function block, which indicates the number of processes executed in the function block; a number counter that counts the number of times the function block is used in the program; and a calculation unit that calculates the product of the number of times the function block is used and the number of execution steps of the function block, and outputs the number of execution steps of the function block in the program.
2. The development support device according to claim 1, wherein the step counter further counts the number of execution steps of the program, which indicates the number of processes executed in the program, and the calculation unit calculates the sum of the number of execution steps of the program and the number of execution steps of the function blocks in the program, and outputs the total number of execution steps when the program is executed.
3. The development support device according to claim 1, wherein the programs are classified by task type, the number counter counts the number of times the function blocks used in the programs are used for each task type, and the calculation unit calculates the product of the number of times the function blocks are used for each task type and the number of execution steps of the function blocks, and outputs the number of execution steps of the function blocks in the programs for each task type.
4. The development support device according to claim 1, wherein the function blocks have a first function block and a second function block that uses the first function block, the number counter counts a first number of uses of the first function block used in the second function block and a second number of uses of the second function block used in the program, and the calculation unit calculates the product of the first number of uses and the second number of uses and outputs the number of execution steps of the first function block used in the program.
5. The development support device according to claim 4, wherein the programs are classified by task type, the number counter counts a first number of uses of the first function block used in the second function block and a second number of uses of the second function block used for each task type, and the calculation unit calculates the product of the first number of uses and the second number of uses and outputs the number of execution steps of the first function block used for each task type.