Programming assistance program product, programming assistance method, and programming assistance device
The programming auxiliary device solves the burden and error risks of creating action programs during object-oriented programming transfer by replacing traditional functional blocks with object-oriented functional blocks or instance-oriented descriptions as object-oriented instance-oriented descriptions, and achieves the effect of simplifying program creation and safe actions.
Patent Information
- Application Number
- CN202280086978.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-14
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-01-14
AI Technical Summary
In the process of transferring to object-oriented programming, users need to learn new language specifications and make complex program corrections, resulting in an increased burden on creating programmable controller action programs and a risk of incorrect actions.
Through the programming auxiliary device, the first source code of the action program is obtained by using the acquisition unit, and the second source code is generated by replacing the traditional functional block with an object-oriented functional block or replacing the instance-related description with an object-oriented instance-oriented description to reduce the burden of creating the action program.
Reduces the burden of creating programmable controller action programs, promotes the transfer to object-oriented programming, simplifies the program creation process, and reduces the risk of errors.
Smart Images

Figure CN118661154B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a programming assistance program product, a programming assistance method, and a programming assistance device. Background Art
[0002] In order to cause a programmable logic controller widely used at an FA site to execute specific control processing, it is necessary to create an action program that defines the content of the control processing and cause the programmable logic controller to execute the action program. A technique for introducing object-oriented programming into such an action program has been proposed (for example, refer to Patent Document 1). Patent Document 1 describes a technique for objectifying functions constituting a process control system and encapsulating methods and data in each object.
[0003] In addition, as a specification of a programming language for creating an action program, for example, IEC61131-3 is known. In the third edition of this IEC61131-3, object-oriented programming has been introduced, and object-oriented function blocks extended based on conventional function blocks equivalent to subroutines defined in the second edition have been introduced.
[0004] Patent Document 1: Japanese Patent Application Laid-Open No. 2005-353092 Summary of the Invention
[0005] For a user having software assets including descriptions of conventional function blocks, the transition to object-oriented programming forcibly causes learning of a new language specification and man-hours for program correction based on differences in the language specification, resulting in complex operations. In addition, in the case where an incorrect action program is created as a result of such complex operations, there is a possibility that the programmable logic controller may eventually perform an unexpected action. Therefore, in order to cause the programmable logic controller to perform accurate actions, there is room for reducing the burden of creating an action program for the programmable logic controller.
[0006] The present invention has been made in view of the above circumstances, and an object thereof is to reduce the burden of creating an action program for a programmable logic controller.
[0007] To achieve the above object, a programming assistance program of the present invention causes a computer that assists in creating an action program, which is used to operate a programmable logic controller, to function as an acquisition unit and a generation unit. The acquisition unit acquires a first source code of the action program, and the generation unit generates a second source code of the action program by replacing a first function block in which the function of a function block as a subroutine is described in a form different from one or more methods included in the function block with a second function block in which the function is described as a method, or by replacing a description related to a first instance declared based on the first function block in the first source code with a description related to a second instance declared based on the second function block.
[0008] Effect of the Invention
[0009] According to the present invention, the burden of creating an operation program for a programmable controller can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a diagram showing the functional structure of the programming support device according to Embodiment 1.
[0011] Figure 2 It is a diagram showing the hardware structure of the programming support device according to Embodiment 1.
[0012] Figure 3 It is a diagram showing an example of a screen for selecting a conventional function block according to Embodiment 1.
[0013] Figure 4 It is a diagram showing an example of a screen for setting a common variable according to Embodiment 1.
[0014] Figure 5 It is a diagram showing a comparison between the first source code and the second source code according to Embodiment 1.
[0015] Figure 6 It is a flowchart showing the auxiliary process according to Embodiment 1.
[0016] Figure 7 It is a flowchart showing the generation process according to Embodiment 1.
[0017] Figure 8 It is a diagram showing the functional structure of the programming support device according to Embodiment 2.
[0018] Figure 9 It is a diagram showing an example of the first source code according to Embodiment 2.
[0019] Figure 10 It is a diagram showing an example of a screen for allocating instances according to Embodiment 2.
[0020] Figure 11 It is a diagram showing an example of the second source code according to Embodiment 2.
[0021] Figure 12 It is a flowchart showing the auxiliary process according to Embodiment 2.
[0022] Figure 13 It is a flowchart showing the generation process according to Embodiment 2.
[0023] Figure 14 It is a diagram showing the functional structure of the programming support device according to Embodiment 3.
[0024] Figure 15 It is a flowchart showing the auxiliary process related to Embodiment 3.
[0025] Figure 16 It is a diagram showing a comparison between the first source code and the second source code related to the modification example.
[0026] Figure 17 It is a diagram showing an example of a setting screen for the common variable related to the modification example. Detailed Embodiment
[0027] Hereinafter, with reference to the accompanying drawings, a programming support device according to an embodiment of the present invention will be described in detail. This programming support device is a device that assists in creating an operation program for a programmable logic controller by converting non-object-oriented source code into object-oriented source code.
[0028] Embodiment 1
[0029] The programming support device 10 according to this embodiment is an industrial personal computer (PC) or a server device on a network that can execute software that functions as an engineering design tool for editing source code. The programming support device 10, as Figure 1 shown, reads the first source code 21 in the project data 20 stored in the storage device 200, generates the second source code 22 based on the read first source code 21, and writes the generated second source code 22 into the project data 20.
[0030] The storage device 200 can be a detachable memory card relative to the programming support device 10, or a device connected to the programming support device 10 via a network. In addition, Figure 1 in, the storage device 200 is arranged outside the programming support device 10, but the storage device 200 can also be built into the programming support device 10.
[0031] The project data 20 is a collection of data used by the programmable logic controller and includes an operation program for operating the programmable logic controller. The operation program included in the project data 20 can be one or multiple. In addition to the object file directly executed by the programmable logic controller, the operation program also includes various source codes that are compilation targets to obtain the object file. In addition, in addition to a single program first executed by the programmable logic controller, the operation program also includes externally referenced programs and library data.
[0032] The project data 20 includes the first source code 21, the second source code 22, and the execution program 23 as the operation program. The first source code 21 and the execution program 23 are created by the user using an engineering design tool.
[0033] The first source code 21 is data that describes the definition of a function block equivalent to a non-object-oriented subroutine. A function block is one or more reusable commands for performing a predefined function by being called from another program. The function block defined in the first source code 21 can be a function block specified by IEC61131-3, Edition 2, a function specified by the IEC61131-3 standard, or other programming language elements equivalent to a subroutine. Hereinafter, the function block may be appropriately referred to as an FB, and the IEC61131-3 standard may be briefly referred to as the IEC standard. In addition, the non-object-oriented FB may be appropriately referred to as a traditional FB. The FB included in the first source code 21 is a traditional FB.
[0034] The second source code 22 is data that describes the definition of an object-oriented FB. Specifically, the second source code 22 describes the definition of an object-oriented FB having methods. A method is similar to a traditional FB in that it is one or more reusable commands for performing a predefined function by being called from another program, but is different from a traditional FB in that it is called as a member function of an instance of an object-oriented FB for which a declaration has been made. A traditional FB corresponds to one aggregated function, while an object-oriented FB can include multiple methods equivalent to functions. The object-oriented FB defined in the second source code 22 can be a function block specified in Edition 3 of the IEC standard, a class specified in that Edition 3, or other programming language elements having methods.
[0035] The traditional FB corresponds to an example of a first function block, and the function of the first function block, which is a function block as a subroutine, is described in a form different from one or more methods included in the function block. In addition, the object-oriented FB corresponds to an example of a second function block in which the function is described as a method.
[0036] The execution program 23 is an action program that uses an instance of the traditional FB defined in the first source code 21. As a programming language for describing the first source code 21, the second source code 22, and the execution program 23, any one of the instruction list, structured text, ladder diagram, function block diagram, and sequential function diagram specified by the IEC standard may be used, or other languages may be used.
[0037] The programming assistance device 10 is configured as a computer that is an engineering design tool for executing a process of generating the second source code 22 from the first source code 21. Specifically, as a hardware structure, the programming assistance device 10 is as Figure 2As shown, it has a processor 31, a main storage unit 32, an auxiliary storage unit 33, an input unit 34, an output unit 35, and a communication unit 36. The main storage unit 32, the auxiliary storage unit 33, the input unit 34, the output unit 35, and the communication unit 36 are all connected to the processor 31 via an internal bus 37.
[0038] The processor 31 includes a CPU (Central Processing Unit) as a processing circuit. The processor 31 realizes various functions of the programming assistance device 10 by executing the program P1 stored in the auxiliary storage unit 33 and performs the processing described later.
[0039] The main storage unit 32 includes a RAM (Random Access Memory). The program P1 is loaded from the auxiliary storage unit 33 into the main storage unit 32. Also, the main storage unit 32 is used as the working area of the processor 31. The program P1 is equivalent to an engineering design tool and is an example of a programming assistance program for generating the second source code 22. In addition, Figure 2 In, one program P1 is typically shown, but there may also be multiple programs P1.
[0040] The auxiliary storage unit 33 includes non-volatile memories represented by an EEPROM (Electrically Erasable Programmable Read-Only Memory) and an HDD (Hard Disk Drive). In addition to storing the program P1, the auxiliary storage unit 33 also stores various data used in the processing of the processor 31. The auxiliary storage unit 33 supplies the data used by the processor 31 to the processor 31 according to the instruction of the processor 31 and stores the data supplied from the processor 31.
[0041] The input unit 34 includes input devices represented by a keyboard and a pointing device. The input unit 34 acquires the information input by the user of the programming assistance device 10 and notifies the acquired information to the processor 31.
[0042] The output unit 35 includes output devices represented by an LCD (Liquid Crystal Display) and a speaker. The output unit 35 presents various information to the user according to the instruction of the processor 31.
[0043] The communication unit 36 has a network interface circuit for communicating with external devices. The communication unit 36 receives a signal from the outside and outputs the information represented by the signal to the processor 31. In addition, the communication unit 36 sends a signal representing the information output from the processor 31 to an external device.
[0044] In addition, the input unit 34 and the output unit 35 correspond to the UI (User Interface) of the programming assistance device 10. However, the programming assistance device 10 can also be connected to an external UI device via the communication unit 36, obtain information from the user via the communication unit 36, and provide information to the user. When the communication unit 36 that cooperates with the external UI device is used as the UI of the programming assistance device 10 instead of the input unit 34 and the output unit 35, the input unit 34 and the output unit 35 can also be omitted. In addition, when the programming assistance device 10 is an independent device that does not communicate with external devices, the communication unit 36 can also be omitted.
[0045] Return Figure 1 , the programming assistance device 10 has a functional structure implemented through the cooperation of the above-mentioned hardware structure. Specifically, the programming assistance device 10 has an acquisition unit 11 that acquires the first source code 21, a UI unit 12, and a generation unit 13 that generates the second source code 22 based on an input from the user.
[0046] The acquisition unit 11 is mainly implemented by the processor 31. In addition, when the acquisition unit 11 acquires the first source code 21 through communication with the storage device 200, the acquisition unit 11 is implemented through the cooperation of the processor 31 and the communication unit 36. The acquisition unit 11 reads the item data 20 from the address of the storage device 200 specified by the user, and acquires the first source code 21. In addition, the acquisition unit 11 outputs the read item data 20 to the UI unit 12, and outputs the first source code 21 to the generation unit 13. The acquisition unit 11 is an example of an acquisition unit that acquires the first source code of the acquisition operation program in the programming assistance device 10.
[0047] The UI unit 12 can be mainly implemented through the cooperation of the input unit 34 and the output unit 35, or can be implemented by the communication unit 36 that cooperates with an external UI device as described above. The UI unit 12 displays the structure of the item data 20, and receives from the user the selection of the legacy FB that should be replaced with the method of the object-oriented FB.
[0048] In Figure 3 's example, in the screen 120 of the UI unit 12, a legacy FB 211 of "Set positioning data", a legacy FB 212 of "Start positioning operation", and a legacy FB 213 of "Start temperature adjustment" are displayed as a list of function blocks constituting "Project A". One or more legacy FBs can be selected from this list. In Figure 3 , the selected legacy FBs 211 and 212 are shaded by the user.
[0049] When the UI unit 12 selects the traditional FBs 211 and 212, it displays a sub-menu 121 that includes a list of operations related to the selected traditional FBs 211 and 212. If the operation "object-oriented extension" is selected in the sub-menu 121, the UI unit 12 receives the selection of the traditional FBs 211 and 212 that are to be converted into object-oriented FBs. The UI unit 12 is an example of a receiving unit in the programming assistance device 10 that receives the selection of the first function block from the function blocks included in the first source code.
[0050] In addition, the UI unit 12 receives the selection of variables in the selected traditional FBs that are to be made common as member variables of the object-oriented FB. In Figure 4 the example, an input field 122 for entering the name of the newly created object-oriented FB and a table 123 showing the variables included in the traditional FB are displayed on the screen 120. Here, as shown on the left side of Figure 5 , the traditional FB 211 includes the declarations of the variable 2111 "unit information" and the variable 2112 "data No" respectively, and the traditional FB 212 includes the declarations of the variable 2121 "unit information" and the variable 2122 "start No" respectively.
[0051] Figure 4 The table 123 of Figure 4 displays these variables 2111, 2112, 2121, and 2122 in a list. The table 123 includes a check box column 124 for selecting the variables to be made common. For the variables selected by the user by checking the check boxes, the user sets the names of the variables to be made common in the object-oriented FB in the column 125. In Figure 4 the example, it is shown that the variables 2111 and 2121 of "unit information" in the traditional FBs 211 and 212 respectively are substantially the same variables, so they are integrated into the variable "unit information" in the newly created object-oriented FB named "positioning unit". In addition, the variable 2112 "data No" and the variable 2122 "start No" are different information unique to the traditional FBs 211 and 212 respectively, so no common setting is made. By the user pressing the button 126, the selection of the traditional FB and the setting of the variables to be made common are completed.
[0052] Return Figure 1 The generation unit 13 is mainly implemented by the processor 31. The generation unit 13 generates the second source code 22 based on the content set by the user using the UI unit 12 and according to the first source code 21.
[0053] Specifically, as in Figure 5As shown on the right side, the newly created object-oriented FB 220 has a method 221 corresponding to the conventional FB 211 and a method 222 corresponding to the conventional FB 212. The logical description 2212 that determines the function of the method 221 has the same content as the logical description 2113 of the corresponding conventional FB 211. The logical description 2222 that determines the function of the method 222 has the same content as the logical description 2123 of the corresponding conventional FB 212.
[0054] In addition, the object-oriented FB 220 includes a declaration of a common variable 2201 obtained by integrating the variables 2111 and 2121 of the conventional FBs 211 and 212. The method 221 includes a declaration of a variable 2211 corresponding to the variable 2112 that is not set as the common variable among the variables 2111 and 2112 of the corresponding conventional FB 211. The method 222 includes a declaration of a variable 2221 corresponding to the variable 2122 that is not set as the common variable among the variables 2121 and 2122 of the corresponding conventional FB 212.
[0055] Moreover, the generation unit 13 outputs the generated second source code 22 to the storage device 200. The generation unit 13 is an example of a generation unit that generates a second source code for an action program for operating a programmable controller by replacing a first function block described in the first source code with a second function block in the programming assistance device 10.
[0056] Next, use Figure 6 、 7 to explain the assistance process executed by the programming assistance device 10. This assistance process is started by a specific operation performed by the user. The assistance process is an example of a programming assistance method for assisting in creating an action program.
[0057] In the assistance process, the acquisition unit 11 of the programming assistance device 10 acquires the first source code 21 as Figure 6 shown (step S1). Then, the UI unit 12 receives the selection of the conventional FB in the first source code 21 acquired in step S1 (step S2), and receives the selection of the variable to be made common among the variables of the conventional FB selected in step S2 (step S3).
[0058] Next, the generation unit 13 executes a generation process of generating the second source code 22 based on the selections received in steps S2 and S3 from the first source code 21 acquired in step S1 (step S4). If the generation process is completed, the generation unit 13 outputs the generated second source code 22 (step S5). Then, the assistance process ends.
[0059] In Figure 7Details of the generation process of step S4 are shown. As Figure 7 shown, in the generation process, the generation unit 13 generates an empty object-oriented FB (step S11), and registers the common variable set in step S3 in the generated object-oriented FB (step S12). Thus, in Figure 5 the example of, a description declaring the common variable 2201 is added to the object-oriented FB.
[0060] Next, the generation unit 13 selects one traditional FB that has not been selected in the generation process from the traditional FBs selected in step S2 (step S13). For example, the generation unit 13 selects Figure 5 the traditional FB 211 shown.
[0061] Next, the generation unit 13 generates an empty method (step S14), and inserts the logical description of the traditional FB selected in step S13 as the logical description of the method generated in step S14 (step S15). Thus, in Figure 5 the example of, the logical description 2212 of the method 221 is added.
[0062] Next, the generation unit 13 selects one variable that has not been selected in the generation process from the variables included in the traditional FB selected in step S13 (step S16). For example, the generation unit 13 selects Figure 5 the variable 2111 of the traditional FB 211 shown.
[0063] The generation unit 13 determines whether the variable selected in step S16 corresponds to the common variable set in step S3 (step S17). When it is determined that the selected variable corresponds to the common variable (step S17; Yes), the generation unit 13 determines whether the name of the variable selected in step S16 is the same as the name of the common variable (step S18).
[0064] When it is determined that the names are the same (step S18; Yes), the generation unit 13 transfers the process to step S20. On the other hand, when it is determined that the names are different (step S18; No), the generation unit 13 replaces the name of the variable selected in step S16 that appears in the logical description of the method with the name of the corresponding common variable (step S19). Thus, the description related to the variable inserted in step S15 is corrected to the description related to the common variable. The description related to the variable may be a description for accessing the variable or other descriptions that use the variable.
[0065] Next, the generation unit 13 determines whether all the variables of the traditional FB selected in step S13 have been selected (step S20). If it is determined that not all the variables have been selected (step S20; No), the generation unit 13 repeatedly executes the processes after step S16. Thus, for example, the variable 2112 of the traditional FB 211 shown in Figure 5 is selected, and the processes after step S16 are executed for the variable 2112.
[0066] When it is determined in step S17 that the variable does not correspond to the common variable (step S17; No), the generation unit 13 registers the variable selected in step S16 in the method generated in step S14 (step S21). Thus, for example, a description related to the variable 2211 is added to the Figure 5 method 221 shown.
[0067] When it is determined in step S20 that all the variables have been selected (step S20; Yes), the generation unit 13 adds the methods generated in steps S14 to S20 to the object-oriented FB (step S22). Thus, for example, the Figure 5 method 221 shown is added to the object-oriented FB 220.
[0068] Next, the generation unit 13 determines whether all the traditional FBs selected in step S2 have been selected in the generation process (step S23). If it is determined that not all the traditional FBs have been selected (step S23; No), the generation unit 13 repeatedly executes the processes after step S13. Thus, for example, the Figure 5 method 222 shown is added to the object-oriented FB 220. On the other hand, when it is determined that all the traditional FBs have been selected (step S23; Yes), the second source code 22 that defines the object-oriented FB220 is generated, and the process by the programming assistance device 10 returns from the generation process to the Figure 6 auxiliary process shown.
[0069] As described above, according to the programming assistance device 10 according to the present embodiment, by replacing the non-object-oriented traditional FB described in the first source code 21 with an object-oriented FB, the second source code 22 describing the object-oriented FB can be obtained. Therefore, the burden of creating the operation program of the programmable controller can be reduced, and the transfer to object-oriented programming can be promoted.
[0070] In addition, a programmable controller generally includes multiple units. In the case of using a conventional FB to provide the functions of such units, even when using one unit, it is necessary to describe the declarations of different instances for each function of the unit in the execution program 23, set the same information related to the unit, and the execution program 23 becomes complicated.
[0071] In contrast, if the programming assistance device 10 according to the present embodiment replaces multiple conventional FBs with multiple functions of one object-oriented FB, there is no need to set common data every time a method is called in the execution program 23, and the first source code 21 can be simplified.
[0072] The UI unit 12 is an example of a receiving unit that receives the selection of multiple first function blocks included as selection elements in the first source code, and the generation unit 13 is an example of a generation unit that generates a second source code by replacing the multiple first function blocks selected from the first source code with one second function block including multiple methods corresponding to the first function blocks respectively. In addition, the generation unit 13 is an example of a generation unit that replaces multiple first function blocks with a second function block including a common variable, and the common variable corresponds to different variables respectively included in the first function blocks.
[0073] In addition, as Figure 4 shown, an example of manually setting the name of the object-oriented FB and the name of the common variable by the user is described, but it is not limited thereto. The name of the object-oriented FB and the name of the common variable can also be set by the programming assistance device 10 according to a predetermined naming rule.
[0074] In addition, an example of setting the name of the method of the object-oriented FB by the programming assistance device 10 to be similar to the name of the conventional FB is described, but their names can be the same, or the user can set the name of the method.
[0075] In addition, an example of the user setting the variables of the conventional FB corresponding to the common variable using the UI unit 12 is described, but it is not limited thereto. For example, instead of the UI unit 12, the generation unit 13 can also analyze the execution program 23 and set the input variable or output variable of the conventional FB connected to the same data as the common variable. When the selection of the common variable and the setting of the name of the object-oriented FB are performed by the programming assistance device 10 instead of the user, the display of the dialog box screen shown in Figure 4 is omitted.
[0076] Embodiment 2
[0077] Next, Embodiment 2 will be described centering on the differences from the above-described Embodiment 1. In addition, for structures that are the same as or equivalent to those in the above-described Embodiment 1, the same reference numerals are used, and their descriptions are omitted or simplified. The difference between this embodiment and the above-described Embodiment 1 is that, instead of replacing the description that defines FB, the description related to the instance declared based on FB is replaced.
[0078] As shown in the programming assistance device 10 according to this embodiment Figure 8 reads the non-object-oriented first source code 41 included in the item data 20 stored in the storage device 200, and generates and outputs an object-oriented second source code 42 based on the read first source code 41.
[0079] Both the first source code 41 and the second source code 42 correspond to the execution program 23 according to Embodiment 1. The first source code 41 includes a description related to an instance of a traditional FB. The description related to the instance can be a declaration of the instance or a description for accessing variables or logical descriptions of the instance. The second source code 42 corresponds to the source code after the description related to the instance of the traditional FB in the first source code 41 is replaced with a description related to an instance of an object-oriented FB.
[0080] The item data 20 includes related information 43. The related information 43 is information showing the correspondence between the traditional FB and the object-oriented FB for replacing the description related to the instance. Specifically, the related information 43 represents the correspondence between the methods of the traditional FB and the object-oriented FB and the correspondence between the variables of the traditional FB and the common variables of the object-oriented FB. For example, as shown in the related information 43 Figure 5 the traditional FB 211 is shown associated with the method 221, the traditional FB 212 is shown associated with the method 222, and the variables 2111 and 2121 are shown associated with the common variable 2201.
[0081] The related information 43 may be generated by the generation unit 13 according to Embodiment 1, or may not be generated by the programming assistance device 10 but provided from the outside. In Figure 8 the item data 20 including the related information 43 in advance is exemplified, but the method of providing the related information 43 to the programming assistance device 10 is arbitrary. For example, it may be to import an FB library bound with the related information 43 into the item data 20, or the related information 43 may be bound to the FB provided by the manufacturer of FA devices including programmable controllers. The related information 43 corresponds to an example of information associating the variables included in the traditional FB as the first function block with the variables included in the object-oriented FB as the second function block.
[0082] The acquisition unit 11 of the programming assistance device 10 acquires the first source code 41 and related information 43 and provides them to the UI unit 12. The acquisition unit 11 is an example of an acquisition unit that acquires, in the programming assistance device 10, related information associating the function of the first functional block with the second functional block that includes the function as a method.
[0083] The UI unit 12 has a program editor 141 for editing the first source code 41 and an allocation unit 142 for allocating instances to be replaced.
[0084] The program editor 141 receives the specification of an instance of the object-oriented FB described in the first source code 41 acquired by the acquisition unit 11. For example, as shown in Figure 9 , the program editor 141 displays the content of the first source code 41 on the screen 120. The first source code 41 includes descriptions of variables 411, 414 that are substantially common to the conventional FBs 211, 212, variables 412, 415 corresponding to instances of the conventional FB 211, and variables 413, 416 corresponding to instances of the conventional FB 212. The variables 411 to 413 are variables related to the "A unit", and the variables 414 to 416 are variables related to the "B unit".
[0085] In addition, in the example of Figure 9 , the first source code 41 includes a description declaring an instance 417 of the object-oriented FB 220. The description related to the instance 417 was added by the user operating the program editor 141 after the acquisition unit 11 acquired the first source code 41. However, the first source code 41 stored in the storage device 200 may also pre-include the description of the instance 417. In the case of pre-including the description of the instance 417, the program editor 141 may be omitted and the UI unit 12 may be configured. In the example of Figure 9 , the logical description 418 is described in the form of structured text specified by the IEC standard, but it may also be described in other forms.
[0086] If the user selects the instance 417 in the first source code 41, the program editor 141 displays a sub-menu 127 of a list including operations related to the instance 417. If "Replace with this instance" is specified from the list in the sub-menu 127, the program editor 141 receives the specification of the instance 417 of the object-oriented FB that is the replacement target of the instance of the conventional FB and notifies the specified instance to the allocation unit 142.
[0087] The allocation unit 142 receives the allocation of an instance of the legacy FB for a method of a specified instance of the object-oriented FB. Specifically, the allocation unit 142 receives from the user the selection of an instance of the legacy FB associated with the method of the object-oriented FB for which an instance has been specified in the relevant information 43. For example, as shown in Figure 10 , the allocation unit 142 displays, on the screen 120, a table 128 that associates a method with a selection column for an instance of the legacy FB to be allocated. The user uses this table 128 to allocate the method of the specified instance of the object-oriented FB to an instance of the legacy FB. The selection items for the instances of the legacy FB displayed as allocation candidates are variables that fall within the scope of the first source code 41 and have the legacy FB associated with the method in the relevant information 43 as their data type.
[0088] For example, as shown in Figure 9 , in the case where an instance of the object-oriented FB for which "positioning unit" is specified as the replacement target, the methods included in the table 128 are the methods 221, 222 of the object-oriented FB 220 shown in Figure 5 . In addition, the instances included in the table 128 are the instances described in the first source code 41 as the instances of the legacy FBs 211, 212 corresponding to the methods 221, 222 as shown in Figure 5 . As described above, in the example of Figure 9 , the instances related to the "A unit" and "B unit" of the legacy FB 211 are declared as variables 412, 415 respectively, and the instances related to the "A unit" and "B unit" of the legacy FB 212 are declared as variables 413, 416 respectively. In the example of Figure 10 , as the instances of the legacy FB 212 to be allocated to the "operation start method", the instance "start A unit positioning operation" corresponding to the variable 413 and the instance "start B unit positioning operation" corresponding to the variable 416 are displayed at a glance as allocation candidates in the combo box. The instance "start A unit positioning operation" in this list is shown as being selected by the user as the allocation object by shading. In addition, it is shown that "set A unit positioning data" is allocated to the "data setting method". The user notifies the generation unit 13 of the set content using the table 128 by pressing the button 129.
[0089] The UI unit 12 including the program editor 141 and the allocation unit 142 is an example of a receiving unit in the programming assistance device 10 that receives the specification of the second instance described in the first source code and receives the selection of an instance of the legacy FB having a function associated with the method of the specified second instance in the relevant information.
[0090] The generation unit 13 includes: a static analysis unit 131 that statically analyzes the first source code 41; and a correction unit 132 that corrects the descriptions related to the instances of the legacy FB described in the first source code 41 into descriptions related to the instances of the object-oriented FB.
[0091] The static analysis unit 131 determines whether the instance of the legacy FB allocated by the allocation unit 142 can be replaced with the method of the object-oriented FB. In addition, the static analysis unit 131 determines whether the operation of the programmable controller based on the replacement code obtained by replacing the instance of the legacy FB described in the first source code 41 with the method of the object-oriented FB changes with respect to the operation of the programmable controller based on the first source code 41. When replacement is possible and the operation does not change, the static analysis unit 131 allows the correction of the first source code 41 for the correction unit 132, and causes the correction unit 132 to generate the second source code 42.
[0092] When replacement is not possible, the static analysis unit 131 notifies the user of the situation where replacement is not possible, and when the operation changes, notifies the user of the situation where the operation changes. The notification to the user can be made via the UI unit 12 or by other means. The generation unit 13 having the static analysis unit 131 is an example of a generation unit that notifies the situation where the operation changes due to replacement when the operation of the programmable controller compliant with the replacement code is different from the operation of the programmable controller compliant with the first source code, and the replacement code is the code obtained by replacing the description for calling the function of the first function block in the first source code with the method for calling the second function block. In addition, the generation unit 13 is an example of a generation unit that notifies the situation where the variable is not replaced when the variables of the first function block of the first instance in the first source code are associated with the variables of the method of the second function block in the relevant information.
[0093] The correction unit 132 corrects the descriptions related to the instances of the legacy FB in the first source code 41 into descriptions related to the instances of the object-oriented FB. The instance of the legacy FB is used as a call to the logical description representing the function of the legacy FB or an access to the variables of the legacy FB. The correction unit 132 replaces the description for calling the logical description of the legacy FB with the description for calling the method of the object-oriented FB. In addition, the correction unit 132 replaces the description for accessing the variables of the legacy FB with the description for accessing the variables of the object-oriented FB. The correction unit 132 deletes the description for declaring the instance of the legacy FB after successful replacement from the first source code 41.
[0094] The generation unit 13 with the correction unit 132 is an example of a generation unit that replaces the description for calling the function of the first functional block in the first source code with the description for calling the method of the second functional block. Additionally, the generation unit 13 is an example of a generation unit that replaces the description of the variables included in the first functional block in the first source code with the description of the variables included in the second functional block.
[0095] In Figure 11 an example is illustrated in which the first source code 41 shown in Figure 9 is corrected by the correction unit 132 to generate the second source code 42. As Figure 11 shown, in the second source code 42, the declaration parts of the variables 412 and 413 corresponding to the example of the legacy FB for the "A unit" are deleted. Additionally, the logical description 418 is corrected to the logical description 419.
[0096] Furthermore, when the parameter specified at the time of calling the logical description is a common variable, since this parameter is deleted from one or more parameters specified at the time of calling the corresponding method, the correction unit 132 inserts a description of destructuring assignment. In Figure 11 the example of
[0097] the description 4183 of "Start the positioning operation of the A unit (unit information: = A unit information, start No: = 1)" included in the logical description 418 is corrected to the description 4193 of "A unit.operationStartMethod(start No: = 1);", and the description 4192 of the destructuring assignment of "A unit.unitInformation: = A unit information;" is inserted. As a result of the destructuring assignment, substantially the same descriptions 4191 and 4192 are generated, but the correction unit 132 can also perform optimization processing to simplify such a lengthy description. Figure 12 、 13 Next, the auxiliary processing performed by the programming assistance device 10 according to the present embodiment will be described using Figure 12 As shown, the acquisition unit 11 acquires the first source code 41 (step S31). Then, the program editor 141 of the UI unit 12 receives the specification of the instance of the object-oriented FB to be replaced (step S32), and the allocation unit 142 receives the selection of the instance of the legacy FB to be replaced (step S33).
[0098] Next, the generation unit 13 performs a generation process of generating the second source code 42 based on the content received in steps S32 and S33 from the first source code 41 acquired in step S31 (step S34). Then, the generation unit 13 outputs the generated second source code 42 (step S35), and the auxiliary processing ends.
[0099] InFigure 13 Details of the generation process performed in step S34 are shown. As Figure 13 shown, in the generation process, the generation unit 13 selects one unselected instance of the legacy FB allocated in step S33 (step S41). For example, it selects Figure 10 the "Set A unit positioning data" shown.
[0100] Next, the generation unit 13 retrieves the usage locations of all the instances selected in step S41 from the first source code 41 (step S42). Thus, in Figure 9 the example of, the descriptions 4181 and 4182 that use the "Set A unit positioning data" are hit. In addition, the descriptions that declare the variables 412 corresponding to the instances of the legacy FB are excluded from the retrieval target.
[0101] Next, the static analysis unit 131 of the generation unit 13 selects an unselected usage location from among the usage locations hit by the retrieval (step S43). Then, the static analysis unit 131 determines whether the usage location selected in step S43 is a call-type description (step S44). Specifically, it determines whether this usage location is a call to the logical description of an instance of the legacy FB. When the usage location selected in step S43 is Figure 9 the description 4181, this description 4181 is not a call-type, but a description for accessing an instance variable, so the determination in step S44 is No.
[0102] In the case where it is determined that the selected usage location is not a call-type description (step S44; No), the static analysis unit 131 determines that this usage location is a variable access description, and determines whether the accessed variable is a common variable (step S45). Regarding Figure 9 the description 4181, "unit information" corresponds to the common variable as Figure 5 shown, so the determination in step S45 is Yes.
[0103] In the case where it is determined that the accessed variable is a common variable (step S45; Yes), the correction unit 132 replaces the selected usage location with a variable access to an object-oriented FB instance (step S46). Thus, Figure 9 the description 4181 is replaced with Figure 11 the description 4191.
[0104] Next, the generation unit 13 determines whether all usage locations have been selected (step S47). In the case where it is determined that not all usage locations have been selected (step S47; No), the generation unit 13 returns to step S43 and executes the process related to the next usage location. Thus, for example, it selectsFigure 9 The description 4182 shown
[0105] When it is determined in step S44 that the selected usage part is a call-type description (step S44; Yes), the static analysis unit 131 determines whether the operation of the programmable controller changes when the call-type description is replaced with a method (step S48). For example, when the operation based on the call-type description depends on the previous value, the operation implemented by the replacement code obtained by replacing the description with a method changes with respect to the operation implemented by the first source code 41. Here, the previous value means the execution result of the previous scan executed by the programmable controller. A scan corresponds to one execution of the control process specified in the operation program repeatedly executed by the programmable controller.
[0106] When it is determined that the operation has not changed (step S48; No), the static analysis unit 131 determines whether there is a common variable among the parameters specified in the call-type description (step S50). Specifically, the static analysis unit 131 determines whether a variable corresponding to the common variable is specified as an argument. When it is determined that there is a common variable among the parameters (step S50; Yes), a simple replacement from the variables of the conventional FB to the common variable cannot be achieved, so a destructuring assignment equivalent to parameter assignment is inserted (step S51). Here, for the temporary argument of the destructuring assignment, access to the instance variable of the object-oriented FB is set instead of access to the instance variable of the conventional FB.
[0107] When it is determined that there is no common variable among the parameters (step S50; No), and after step S51, the correction unit 132 replaces the selected description with a method of the object-oriented FB (step S52). Thus, Figure 9 the description 4182 is replaced with Figure 11 the description 4194. Then, the determination in step S47 is executed.
[0108] When it is determined in step S47 that all usage parts have been selected (step S47; Yes), the correction unit 132 deletes the declaration part of the selected instance (step S53). Thus, for example, the variable 412 shown in Figure 9 is deleted, and the programming assistance device 10 completes the processing related to the instance of the currently selected conventional FB and transfers the processing to step S56.
[0109] In addition, when it is determined in step S45 that the accessed variable is not a commonground variable (step S45; No), since this variable is associated with a variable within the method of the instance of the object-oriented FB, the generation unit 13 determines that this variable cannot be accessed from the outside. Then, the generation unit 13 notifies the user of the situation where replacement cannot be described (step S54), does not replace the currently selected instance of the traditional FB, and proceeds to step S56.
[0110] In addition, when it is determined in step S48 that the action has changed (step S48; Yes), the generation unit 13 notifies the user that the action has changed (step S55), does not replace the currently selected instance of the traditional FB, and proceeds to step S56.
[0111] Thus, regarding the instance selected in step S41, when all the usage parts retrieved in step S42 can be corrected, step S53 is executed, and as a result, the replacement of the instance is completed. On the other hand, when a usage part that cannot be corrected is detected, the process related to the selected instance ends.
[0112] In step S56, the generation unit 13 determines whether the selection in the generation process has been completed for all the instances of the traditional FBs selected in step S33 (step S56). When it is determined that the selection has not been completed (step S56; No), the generation unit 13 repeatedly executes the processes from step S41 and later. Thus, as Figure 10 shown, by selecting the traditional FB 212 of "Start A Unit Positioning Operation" and executing steps S50 to S52, the Figure 9 description 4183 is replaced with the Figure 11 descriptions 4192 and 4193.
[0113] On the other hand, when it is determined that the selection has been completed (step S56; Yes), the process executed by the programming assistance device 10 returns from the generation process to the Figure 12 assistance process shown.
[0114] As described above, according to the programming assistance device 10 according to the present embodiment, by replacing the description related to the instance of the non-object-oriented traditional FB described in the first source code 41 with the description related to the instance of the object-oriented FB, the second source code 42 is generated. Therefore, the burden of creating the action program of the programmable controller can be reduced, and the transfer to object-oriented programming can be promoted.
[0115] In addition, in Figure 10In the above, an example in which a user selects multiple instances is described, but it is not limited thereto. For example, it is also possible to use the selection of one instance of the traditional FB by the user as a trigger, and the programming assistance device 10 distributes the instances of the traditional FB to other methods. The programming assistance device 10 only needs to parse the first source code 41 and detect other instances having data connected to the same common variable as the instance initially selected by the user.
[0116] Embodiment 3
[0117] Next, Embodiment 3 will be described centering on the differences from the above-described Embodiments 1 and 2. In addition, for structures that are the same as or equivalent to those in the above-described Embodiments 1 and 2, the same reference numerals are used, and their descriptions are omitted or simplified. The difference between this embodiment and the above-described Embodiment 1 is that, on the basis of combining Embodiments 1 and 2, the user operation for selecting the replacement object is omitted, and the programming assistance device 10 generates the second source code 42 from the first source code 41.
[0118] The programming assistance device 10 according to this embodiment has an acquisition unit 11, a UI unit 12, and a generation unit 13 that function in the same manner as in Embodiment 1, as Figure 14 shown. Regarding the flow of the same information as in Embodiment 1, it is shown by the thick arrows in Figure 14 .
[0119] The generation unit 13 generates the relevant information 43, and the acquisition unit 11 acquires the relevant information 43. Since the relevant information 43 is processed as internal information of the programming assistance device 10, it is not necessary to permanently store the relevant information 43 externally. The acquisition unit 11 and the generation unit 13 function equivalently to those in Embodiment 2. The program editor 141 and the distribution unit 142 related to Embodiment 2 are omitted from the UI unit 12.
[0120] In addition, the generation unit 13 has a distribution unit 142a with an extended function compared to the distribution unit 142 related to Embodiment 2. The relevant information 43 and the item data 20 are provided from the acquisition unit 11 to the distribution unit 142a.
[0121] The distribution unit 142a extracts one or more first source codes 41 using instances of the traditional FB from the item data 20, and for each of the extracted first source codes 41, declares an instance of the object-oriented FB and allocates the instance of the traditional FB to the instance of the object-oriented FB.
[0122] Next, the assistance process executed by the programming assistance device 10 will be described centering on the flow executed by the distribution unit 142a. As Figure 15 shown, in the assistance process, the acquisition unit 11 acquires a plurality of first source codes 41 (step S61).
[0123] Next, the allocating unit 142a selects one of the unselected first source codes 41 (step S62). Then, the allocating unit 142a determines whether the instance of the traditional FB included in the related information 43 is declared in the selected first source code 41 (step S63). That is, the allocating unit 142a determines whether the instance that can realize the replacement based on the related information 43 is declared in the first source code 41. When it is determined that the instance is not declared (step S63; No), the allocating unit 142a ends the processing related to the first source code 41 and transfers the processing to step S66.
[0124] On the other hand, when it is determined that the instance has been declared (step S63; Yes), the allocation unit 142a declares the instance of the object-oriented FB associated with the traditional FB of the instance found in step S63 in the related information 43 in the selected first source code 41 (step S64). This step S64 corresponds to Figure 9 The declaration of instance 417 is shown. However, Figure 9 The declaration of the instance 417 shown is a case where the instance is added externally to the programming assistant 10 . In contrast, in step S64 , the programming assistant 10 declares the instance.
[0125] Specifically, the allocation unit 142a classifies multiple instances of the traditional FB declared in the first source code 41 into groups, and declares instances of the object-oriented FB corresponding to the groups. The classification of the instances of the traditional FB is performed in a manner that multiple instances declared based on the same traditional FB do not belong to one group. That is, each time an instance declared based on the same traditional FB appears, the instance is classified into a new group. In addition, the first source code 41 can also be parsed and classified in a manner that instance variables of multiple traditional FBs belonging to one group do not correspond to common variables of different data types. By minimizing the number of groups, more instances of traditional FBs can be aggregated into one instance of object-oriented FB.
[0126] Then, the assigning unit 142a assigns the instance of the conventional FB classified into the group corresponding to the object-oriented FB to the instance of the object-oriented FB declared in step S64 (step S65). This step S65 corresponds to Figure 10 However, unlike in Figure 10 In the example of , the allocation is performed by the user. In contrast, in step S65 , the allocation is performed by the programming assistance device 10 .
[0127] Next, the generation unit 13 performs the same generation process as in Embodiment 2 (step S34). Then, the generation unit 13 determines whether all of the first source codes 41 have been selected (step S66). If it is determined that not all of the first source codes 41 have been selected (step S66; No), the processes after step S62 are repeatedly executed. On the other hand, if it is determined that all of the first source codes 41 have been selected (step S66; Yes), the auxiliary process ends.
[0128] As described above, the allocation unit 142a analyzes the first source code 41 and allocates an instance of the legacy FB to a method of an instance of the object-oriented FB. Thereby, the burden of creating an action program can be further reduced. The generation unit 13 having the allocation unit 142a is an example of a generation unit that classifies a plurality of first instances described in the first source code into groups and converts the description related to the first instances belonging to each group into a description related to a second instance of a second functional block corresponding to the group and having a method associated with the first functional block of the first instance in the related information.
[0129] The embodiments of the present invention have been described above, but the present invention is not limited to the above embodiments.
[0130] For example, an example in which the second source codes 22 and 42 are output to the item data 20 of the storage device 200 has been described, but it is not limited thereto. For example, the second source codes 22 and 42 may also be output as source codes constituting new item data different from the item data 20.
[0131] In addition, the first source codes 21 and 41 and the second source codes 22 and 42 are not limited to single files and may include a plurality of files. Alternatively, a single file may be divided and processed as a plurality of first source codes 41.
[0132] In addition, in the above embodiment, an example in which only one common variable included in the object-oriented FB is set has been described, but it is not limited thereto. As Figure 16 illustrated, the variable "unit information" included in each of the legacy FBs 211 and 212 is made to correspond to the common variable "unit information" of the object-oriented FB 220, and the variable "error information" included in each of the legacy FBs 211 and 212 is made to correspond to the common variable "error information" of the object-oriented FB 220. Such a correspondence relationship is Figure 17 set by the user using the common variable name.
[0133] In addition, the functions of the programming support device 10 can be implemented by dedicated hardware or by a general computer system.
[0134] For example, a program P1 to be executed by the processor 31 is stored in a computer-readable non-transitory recording medium and distributed. By installing the program P1 on a computer, a device that executes the above-described processing can be configured. As such a recording medium, for example, a floppy disk, a CD-ROM (Compact Disc Read-Only Memory), a DVD (Digital Versatile Disc), or an MO (Magneto-Optical Disc) comes to mind.
[0135] Alternatively, the program P1 may be pre-stored in a disk device included in a server device on a communication network represented by the Internet, and for example, downloaded to a computer by being superimposed on a carrier wave.
[0136] In addition, by starting and executing while transmitting the program P1 via a communication network, the above-described processing can also be realized.
[0137] Moreover, by causing all or a part of the program P1 to be executed on the server device and having a computer execute the program while transmitting and receiving information related to the processing via the communication network, the above-described processing can also be realized.
[0138] Furthermore, in the case where the above functions are implemented by the OS (Operating System) in a shared manner or in the case where the above functions are implemented through cooperation between the OS and an application program, only the part other than the OS may be stored in a medium and distributed, or alternatively, it may be downloaded to a computer.
[0139] In addition, the means for realizing the functions of the programming assistance device 10 is not limited to software, and a part or all of it may be realized by dedicated hardware including a circuit.
[0140] The present invention can be set to various embodiments and modifications without departing from the broad spirit and scope of the present invention. In addition, the above embodiments are used to explain the present invention and do not limit the scope of the present invention. That is, the scope of the present invention is shown not by the embodiments but by the claims. And various modifications implemented within the scope of the claims and within the meaning of the invention equivalent thereto are considered to be included within the scope of the present invention.
[0141] Industrial Applicability
[0142] The present invention is applicable to the development of an action program for operating a programmable controller.
[0143] Explanation of Reference Numerals
[0144] 10 Programming assistance device, 11 Acquisition unit, 12 UI unit, 120 Screen, 121, 127 Sub-menus, 122 Input field, 123, 128 Tables, 124 Check box column, 125 Column, 126, 129 Buttons, 13 Generation unit, 131 Static analysis unit, 132 Correction unit, 141 Program editor, 142, 142a Allocation unit, 200 Storage device, 20 Project data, 21, 41 First source code, 211, 212, 213 Traditional type FB, 2111, 2112, 2121, 2122, 411, 412, 413, 414, 415, 416 Variables, 22, 42 Second source code, 220 Object-oriented FB, 2201 Common variable, 221, 222 Methods, 23 Execution program, 31 Processor, 32 Main storage unit, 33 Auxiliary storage unit, 34 Input unit, 35 Output unit, 36 Communication unit, 37 Internal bus, 43 Related information, 418, 419, 2113, 2212, 2222, 4181 to 4184, 4191 to 4194 Description, 417 Instance, P1 Program.
Claims
1. A programming assistance program product that causes a computer assisting in creating an action program to function as an acquisition unit, a generation unit, and a reception unit, the action program being for operating a programmable logic controller. The acquisition unit acquires a first source code of the action program. The generation unit generates a second source code of the action program by replacing a first function block, in which the function of a function block as a subroutine is described in a form different from one or more methods included in the function block, with a second function block in which the function is described as the method, in the first source code. The reception unit receives a selection of the first function block from among the function blocks constituting the first source code. The generation unit generates the second source code by replacing a plurality of the first function blocks selected from the first source code with one second function block including a plurality of methods corresponding to the respective first function blocks.
2. The programming assistance program product according to claim 1, wherein the generation unit replaces the plurality of the first function blocks with the second function block including a common variable corresponding to different variables included in the respective first function blocks.
3. A programming assistance program product that causes a computer assisting in creating an action program to function as an acquisition unit and a generation unit, the action program being for operating a programmable logic controller. The acquisition unit acquires a first source code of the action program. The generation unit generates a second source code of the action program by replacing a description related to a first instance declared based on a first function block with a description related to a second instance declared based on a second function block in the first source code, the first function block being a function block in which the function of a function block as a subroutine is described in a form different from one or more methods included in the function block, and the second function block being a function block in which the function is described as the method.
4. The programming assistance program product according to claim 3, wherein the computer is further caused to function as a reception unit that receives a selection of the first instance, the acquisition unit acquires correlation information associating the function of the first function block with the second function block including the function as a method, the reception unit receives a specification of the second instance described in the first source code and receives a selection of the first instance of the first function block having a function associated with the method of the specified second instance in the correlation information, and the generation unit replaces the description related to the selected first instance with the description related to the second instance.
5. The programming assistance program product according to claim 4, wherein the generation unit replaces a description for calling the function of the first function block in the first source code with a description for calling the method of the second function block.
6. The programming assistance program product according to claim 5, wherein When the operation of the programmable controller compliant with the replacement code is different from the operation of the programmable controller compliant with the first source code, the generation unit notifies the situation that the operation has changed due to the replacement. The replacement code is the code obtained by replacing the description for calling the function of the first function block in the first source code with the description for calling the method of the second function block.
7. The programming assistance program product according to any one of claims 4 to 6, wherein the generation unit replaces the description of the variables included in the first function block in the first source code with the description of the variables included in the second function block.
8. The programming assistance program product according to any one of claims 4 to 6, wherein the relevant information is information that associates the variables included in the first function block with the variables included in the second function block, when the variables included in the first function block of the first instance are associated with the variables of the method included in the second function block in the relevant information, the generation unit notifies the situation that the variables have not been replaced.
9. The programming assistance program product according to claim 3, wherein the acquisition unit acquires relevant information that associates the function of the first function block with the second function block that includes the function as a method, the generation unit generates the second source code by classifying a plurality of the first instances described in the first source code into groups and replacing the descriptions related to the first instances belonging to each group with the descriptions related to the second instances of the second function block corresponding to the group and having the method associated with the first function block of the first instance in the relevant information.
10. A programming assistance method for assisting in creating an action program for operating a programmable controller, the programming assistance method includes the following steps: an acquisition unit acquires a first source code of the action program; a generation unit generates a second source code of the action program by replacing a first function block in which the function of the function block as a subroutine is described in a form different from one or more methods included in the function block with a second function block in which the function is described as the method; and a reception unit receives a selection of the first function block from the function blocks constituting the first source code, the generation unit generates the second source code by replacing a plurality of the first function blocks selected from the first source code with one second function block including a plurality of methods respectively corresponding to the first function blocks.
11. A programming assistance method for assisting in creating an action program for operating a programmable controller, the programming assistance method includes the following steps: an acquisition unit acquires a first source code of the action program; and The generation unit generates the second source code of the action program by replacing the description related to the first instance declared based on the first function block in the first source code with the description related to the second instance declared based on the second function block. The first function block is a function block whose function as a subroutine is described in the first source code in a form different from one or more methods included in the function block, and the second function block is a function block whose function is described as the method.
12. A programming assistance device that assists in creating an action program for operating a programmable controller. The programming assistance device includes: An acquisition unit that acquires the first source code of the action program; A generation unit that generates the second source code of the action program by replacing the first function block, whose function as a subroutine is described in the first source code in a form different from one or more methods included in the function block, with the second function block whose function is described as the method; And A reception unit that receives the selection of the first function block from the function blocks constituting the first source code. The generation unit generates the second source code by replacing a plurality of the first function blocks selected from the first source code with one second function block including a plurality of methods corresponding to the respective first function blocks.
13. A programming assistance device that assists in creating an action program for operating a programmable controller. The programming assistance device includes: An acquisition unit that acquires the first source code of the action program; and A generation unit that generates the second source code of the action program by replacing the description related to the first instance declared based on the first function block in the first source code with the description related to the second instance declared based on the second function block. The first function block is a function block whose function as a subroutine is described in the first source code in a form different from one or more methods included in the function block, and the second function block is a function block whose function is described as the method.
Citation Information
Patent Citations
Process control system
JP2005353092A
ST language source code compiling method and device, computer equipment and medium
CN111488154A
System and Method for Automated Source Code Generation to Provide Service Layer Functionality for Legacy Computing Systems in a Service-Oriented Architecture
US20210004226A1