Translation program, translation device, and translation method
Patent Information
- Application Number
- JP2023564117
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2025-01-23
- Estimated Expiration
- 2043-07-20
AI Technical Summary
【0009】 本開示によれば、シーケンス制御用のプログラムを翻訳して、その挙動を観察したいという要望を満たす新たなプログラムを得るための作業負担を軽減することができる。
Abstract
Claims
1. a translation device that translates a first source code written in a first language of a program executed by a programmable controller to control a controlled device into a second source code written in a second language different from the first language; a receiving means for receiving a designation of a monitoring variable to be assigned a value to be monitored when the program is executed, among variables included in the first source code; a translation means for translating the first source code into the second source code by converting a variable code of the first source code relating to a shared memory variable whose value is stored in the shared memory owned by the programmable controller and shared with the controlled device, into a first conversion code relating to a variable whose value is stored in the shared memory if the shared memory variable is the monitored variable, and into a second conversion code relating to a variable whose value is stored in a non-shared memory owned by the programmable controller and different from the shared memory if the shared memory variable is different from the monitored variable; A translation program to function as a
2. the first source code is source code of the program executed by the programmable controller without storing variable values 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. the program of the second source code when the variable code is converted into the second conversion 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 into the first conversion code; The translation program according to claim 1.
5. The translation device, an index value calculation means for calculating an index value corresponding to the length of execution time when the program of the second source code is executed; and further functioning as an index value presentation means for presenting the calculated index value; the accepting means accepts again the designation of the monitoring variable after the index value presenting means presents the index value; the translation means translates the first source code into the second source code in accordance with the received specification 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.
6. 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 that satisfies a predetermined condition included in the second source code is the monitored variable.
7. The translation program according to claim 6.
8. The translation device, a usage calculation means for calculating the usage of the unshared memory when the program of the second source code is executed; and further functioning as an information presentation means for presenting information about the calculated usage amount; the accepting means accepts again the designation of the monitoring variable after the information presenting means presents the information; the translation means translates the first source code into the second source code in accordance with the received specification again; The translation program according to any one of claims 1 to 4.
9. the usage calculation means calculates, as the usage, a total size of variables included in the second source code whose values are stored in the unshared memory; the information presentation means presents the information that supports reduction of the usage amount.
9. The translation program according to claim 8.
10. the receiving means receives a list of names of variables individually designated as the monitored variables; The translation program according to any one of claims 1 to 4.
11. the receiving means receives a specification of an attribute that the variable to be the monitored variable should have; The attribute is a type of variable that is an input / output of the programmable controller, a global variable, a program organization unit, or a function block, that is used in a conditional expression of a specific control syntax in the first language, that is used in an arithmetic expression different from the conditional expression, or that has a name that includes 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 receiving means for receiving a designation of a monitoring variable to be assigned a value to be monitored when the program is executed, among variables included in the first source code; a translation means for translating the first source code into the second source code by converting a variable code of the first source code relating to a shared memory variable whose value is stored in the shared memory owned by the programmable controller and shared with the controlled device into a first conversion code relating to a variable whose value is stored in the shared memory if the shared memory variable is the monitored variable, and into a second conversion code relating to a variable whose value is stored in a non-shared memory owned by the programmable controller and different from the shared memory if the shared memory variable is different from the monitored variable; A translation device comprising:
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, comprising: a receiving means for receiving a designation of a monitoring variable to be assigned a value to be monitored when the program is executed, among variables included in the first source code; a translation means for translating the first source code into the second source code by converting a variable code of the first source code relating to a shared memory variable whose value is stored in the shared memory owned by the programmable controller and shared with the controlled device into a first conversion code relating to a variable whose value is stored in the shared memory if the shared memory variable is the monitored variable, and converting the variable code of the first source code into a second conversion code relating to a variable whose value is stored in a non-shared memory owned by the programmable controller and different from the shared memory if the shared memory variable is different from the monitored variable; A translation method that includes: