Translation program, translation device, and translation method
Patent Information
- Application Number
- JP2023564117
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2043-07-20
AI Technical Summary
【0009】 本開示によれば、シーケンス制御用のプログラムを翻訳して、その挙動を観察したいという要望を満たす新たなプログラムを得るための作業負担を軽減することができる。
Smart Images

Figure 00000016_0000 
Figure 00000016_0001 
Figure 00000017_0000
Abstract
Claims
1. A translation device that translates first source code written in a first language of a program executed by a programmable controller to control a controlled device into second source code written in a second language different from the first language, receiving means for receiving a designation of a monitoring variable to which a value that is a monitoring target when the program is executed is assigned among variables included in the first source code, translation means for translating the first source code into the second source code by converting a variable code related to a shared memory variable in which a value is stored in a shared memory of the programmable controller and shared with the controlled device, into a first conversion code related to a variable in which a value is stored in a variable when the shared memory variable is the monitoring variable, and into a second conversion code related to a variable in which a value is stored in a non-shared memory different from the shared memory of the programmable controller when the shared memory variable is different from the monitoring variable, A translation program for functioning as.
2. The first source code is the source code of the program executed by the programmable controller without storing the value of the variable in the non-shared memory, The translation program according to claim 1.
3. The first language is an instruction list, a ladder diagram, a function block diagram, a structured text, or a sequence function chart, The translation program according to claim 1.
4. When the variable code is converted to the second conversion code, the program of the second source code has a shorter execution time when executed by the programmable controller than the program of the second source code when the variable code is converted to the first conversion code, The translation program according to claim 1.
5. The translation device, index value calculation means for calculating an index value corresponding to the length of the execution time when the program of the second source code is executed, further functioning as index value presentation means for presenting the calculated index value, The receiving means receives the designation of the monitoring variable again after the index value is presented by the index value presentation means, The translation means translates the first source code into the second source code according to the specified content received again. The translation program according to any one of claims 1 to 4.
6. The index value calculation means calculates the index value based on the number of times the shared memory is referenced when the program of the second source code is executed. The translation program according to claim 5.
7. The index value calculation means calculates the index value based on a comparison between the number of times and a reference number of times the shared memory is referenced when the program is executed in a case where a variable satisfying a predetermined condition included in the second source code is the monitoring variable. The translation program according to claim 6.
8. The translation device Usage calculation means for calculating the usage amount of the non-shared memory when the program of the second source code is executed, is further caused to function as information presentation means for presenting information regarding the calculated usage amount, The reception means receives the designation of the monitoring variable again after the information is presented by the information presentation means, The translation means translates the first source code into the second source code according to the specified content received again. The translation program according to any one of claims 1 to 4.
9. The usage calculation means calculates, as the usage amount, the total size of variables among the variables included in the second source code whose values are stored in the non-shared memory, The information presentation means presents the information for assisting in reducing the usage amount. The translation program according to claim 8.
10. The reception means receives a list of names of variables individually designated as the monitoring variable. The translation program according to any one of claims 1 to 4.
11. The reception means receives the designation of an attribute that the variable to be the monitoring variable should have, The attribute is an input / output of the programmable controller, a type of variable that is a global variable, a program organization unit or a function block, being used in a conditional expression of a specific control statement in the first language, being used in an arithmetic expression different from the conditional expression, or having a name including a specific character string. The translation program according to any one of claims 1 to 4.
12. A translation device that translates first source code written in a first language of a program executed by a programmable controller to control a controlled device into second source code written in a second language different from the first language, a reception means that receives a designation of a monitoring variable to which a value that is a monitoring target when the program is executed is assigned among the variables included in the first source code, a translation means that translates the first source code into the second source code by converting a variable code related to a shared memory variable in which a value is stored in a shared memory that the programmable controller has and that is shared with the controlled device, into a first conversion code related to a variable in which a value is stored in the shared memory when the shared memory variable is the monitoring variable, and into a second conversion code related to a variable in which a value is stored in a non-shared memory different from the shared memory that the programmable controller has when the shared memory variable is different from the monitoring variable, a translation device comprising the above.
13. A translation method executed by a translation device that translates first source code written in a first language of a program executed by a programmable controller to control a controlled device into second source code written in a second language different from the first language, a reception step in which the reception means receives a designation of a monitoring variable to which a value that is a monitoring target when the program is executed is assigned among the variables included in the first source code, a translation step in which the translation means translates the first source code into the second source code by converting a variable code related to a shared memory variable in which a value is stored in a shared memory that the programmable controller has and that is shared with the controlled device, into a first conversion code related to a variable in which a value is stored in the shared memory when the shared memory variable is the monitoring variable, and into a second conversion code related to a variable in which a value is stored in a non-shared memory different from the shared memory that the programmable controller has when the shared memory variable is different from the monitoring variable, a translation method including the above.