Program design support system
The program design support system addresses the challenges of upgrading plant control devices by automatically converting program statements from old to new languages using imaging and OCR, enabling efficient migration to new control systems.
Patent Information
- Application Number
- JP2023021706
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing control systems face challenges in upgrading plant control devices due to obsolete equipment, language differences between old and new PLCs, and difficulties in reading and converting program sources, leading to inefficient and manual program migration processes.
A program design support system that utilizes an imaging device to capture monitor displays, convert image data into text data using OCR, and apply grammar rules to translate program statements from an old programming language to a new one, utilizing a database to associate command words and variable information with function blocks.
Automatically converts programs without electronic data, streamlining the process of upgrading control systems by generating compatible new programming language statements and constructing new programs efficiently.
Smart Images

Figure 2024115839000001_ABST
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to a program design support system that supports updating of a program implemented in a plant control device used for plant control. [Background technology]
[0002] In existing control systems that include plant control devices such as programmable controllers (PLCs) used in steel plants, etc., when the devices and equipment that make up the control system become worn out, they may need to be updated to a new control system.
[0003] When updating an existing PLC, etc., it is necessary to port the programs implemented in the existing PLC to the new PLC. In this case, the programming languages that can be used by the existing PLC and the new PLC may differ. In such cases, it is necessary to convert the programming language and then design a program compatible with the new control system.
[0004] Some plants often have older control systems in place, and depending on the existing PLCs and engineering tools, it can be difficult to read the source of the implemented programs and save them on storage media.
[0005] In such cases, the program source is displayed on a monitor, the displayed image is photographed with a camera or transcribed by the programmer, and then they are manually converted into the new programming language.
[0006] Migrating to a new control system can sometimes result in larger programs, and there is a strong demand to make the above-mentioned work more efficient. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Japanese Patent Application Publication No. 7-168707 Summary of the Invention [Problem to be solved by the invention]
[0008] The present invention has been made to solve the above-mentioned problems, and has an object to provide a program design support system that automatically converts programs that are not available as electronic data. [Means for solving the problem]
[0009] An embodiment of the present invention includes an imaging means for capturing an image of a monitor display and generating image data including character information displayed on the monitor, a recognition means for acquiring the image data from the imaging means and recognizing text data from the character information, and a conversion means for interpreting the text data as one or more first program statements according to a preset definition of a first programming language before conversion, and converting each of the one or more first program statements into one or more program statements of a second programming language according to a definition of a second programming language after conversion. The definition of the first programming language includes an instruction word consisting of one or more characters and variable information consisting of one or more characters. The instruction word consisting of one or more characters is associated with a function block of the second programming language. Effect of the Invention
[0010] According to an embodiment, a program design support system is provided that automatically converts a program that is not available as electronic data. [Brief description of the drawings]
[0011] [Figure 1] 1 is a schematic block diagram illustrating a program design support system according to an embodiment. [Diagram 2] 2(a) to 2(c) are schematic diagrams for explaining the operation of a recognition unit of the program design support system according to the embodiment. [Diagram 3] 3(a) and 3(b) are schematic diagrams for explaining the operation of the program design support system according to the embodiment. [Figure 4] 4 is a schematic diagram for explaining the operation of a connection processing unit of the program design support system according to the embodiment; FIG. [Diagram 5] 1 is an example of a flowchart for explaining an overall operation of a program design support system according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] Hereinafter, an embodiment will be described with reference to the drawings. The drawings are schematic or conceptual, and the relationship between the thickness and width of each part, the size ratio between parts, etc. are not necessarily the same as in reality. Even when the same part is shown, the dimensions and ratios of each part may be different depending on the drawing. In this specification and each drawing, elements similar to those described above with reference to the previous drawings are given the same reference numerals and detailed descriptions thereof will be omitted as appropriate.
[0013] FIG. 1 is a schematic block diagram illustrating a program design support system according to the embodiment. As shown in FIG. 1, the program design support system 100 includes an imaging device 10 and a program design support device 20.
[0014] In the program design support system 100 according to the embodiment, a text-based control program is implemented in an existing PLC, and this program is configured to express connection information of a ladder diagram according to a predetermined grammar rule. The converted programming language adopts a function block format, and the program is configured, for example, by arranging and connecting function blocks corresponding to elements that make up a ladder diagram. The converted programming language is, for example, a language that complies with IEC 61131-3. In the following, the program or programming language before conversion may be referred to as the "old program" or "old programming language", and the converted program or programming language may be referred to as the "new program" or "new programming language".
[0015] The imaging device 10 is connected to the program design support device 20. The imaging device 10 captures the source of the old program displayed on the monitor and generates image data D1 including information on the source of the old program. The imaging device 10 outputs the generated image data D1 to the program design support device 20. As long as the imaging device 10 can capture the source of the old program displayed on the monitor, it does not need to be connected to the program design support device 20 at all times, and it is sufficient for the imaging device 10 to be connected to the program design support device 20 when outputting the image data D1. In addition, the imaging device 10 has a removable storage medium, and the storage medium storing the image data D1 may be connected to the program design support device 20.
[0016] The program design support device 20 includes a recognition unit 22 , a conversion unit 24 , a connection processing unit 26 , and a database 30 .
[0017] The recognition unit 22 is connected to the imaging device 10 and receives image data D1. The recognition unit 22 processes the image data D1 to recognize and extract text data D2. For example, software using a well-known OCR technique can be used to convert the image data D1 into text data D2. The recognition unit 22 outputs the recognized text data D2 to the conversion unit 24.
[0018] The conversion unit 24 inputs text data D2, converts it into a new programming language, and generates program statements D3. The conversion unit 24 applies preset grammar rules of the old programming language to the input text data D2 to interpret the program statements of the old program. The conversion unit 24 generates program statements D3 of the new program for each program statement according to the interpretation of the program statements of the old program, and sequentially outputs the generated program statements D3 to the connection processing unit 26.
[0019] The conversion unit 24 recognizes a set of one or more pieces of text as either variable information or instruction words in the grammar rules of the old programming language. The conversion unit 24 also recognizes a set of variable information and instruction words as one program statement in the grammar rules of the old programming language. It is also assumed that one instruction word is connected (associated) with one or more pieces of variable information to constitute one instruction, and that one program statement can include one or more instructions. In both the old and new programming languages, a program is constituted by placing an instruction indicating the end of the program (END instruction) following the last program statement.
[0020] The connection processing unit 26 connects the program statements D3 of the new programming language that have been input in sequence. When all program statements D3 have been connected, the connection processing unit 26 outputs the new program as output data. Connecting program statements means arranging the converted program statements one by one on the monitor screen and connecting them to each other. According to the grammar rules of the new programming language, a group of function blocks arranged in the row direction (from the top to the bottom of the monitor screen) on the monitor screen is considered to be one program.
[0021] The database 30 has text data corresponding to variable information and command words in the old programming language. The database 30 has function block data. The function block data is associated with the command words in the old programming language.
[0022] Function block data has connection information and position information for each piece of data, that is, for each instruction word. The connection information of function block data is information that indicates the connection with variable information. For example, in function block data that indicates a two-input AND, two inputs and one output are set as the connection information. The position information of function block data is the relative position (coordinates) to the absolute position (coordinates) when it is placed on the monitor screen. For example, after a function block corresponding to one instruction word is placed on the monitor, the coordinates of another function block subordinate to that function block are set based on the previously placed coordinates.
[0023] In the database 30, the conversion unit 24 selects a command word in the old programming language, and extracts a corresponding function block.
[0024] The recognition unit 22 and the conversion unit 24 access the database 30 to recognize command words in the old programming language and convert them into function blocks compatible with the new programming language.
[0025] The operation of the program design support system 100 according to the embodiment will be described in detail using a specific example. 2(a) to 2(c) are schematic diagrams for explaining the operation of a recognition unit of the program design support system according to the embodiment. Fig. 2(a) shows an example of the source of an old program displayed on a monitor of an existing control system. The imaging device 10 captures a display such as that shown in Fig. 2(a) and generates image data D1. The imaging device 10 outputs the generated image data D1 including text information such as that shown in Fig. 2(a) to the recognition unit 22.
[0026] As shown in Fig. 2(b), the recognition unit 22 recognizes text data D2 from image data D1. In this example, four lines of program statements are shown. The program statements in the first to third lines are an example according to a bit logic operation instruction executed for each bit. The program statement in the fourth line is an example according to a word operation instruction executed for each word.
[0027] When converting image data D1 into text data D2, if there is an image that is difficult to recognize, the recognition unit 22 refers to the database 30. Also, the recognition unit 22 is set with the same grammar rules of the old program as the conversion unit 24, and these are used to recognize the text data D2.
[0028] 2(c) shows an example of data stored in the database 30. In this example, the database 30 includes a database DB1 related to instruction words and a database DB2 related to variable information. When the recognition unit 22 detects an image that is difficult to judge, it refers to the database 30 and recognizes the text.
[0029] 3(a) and 3(b) are schematic diagrams for explaining the operation of the conversion unit of the program design support system according to the embodiment. The conversion unit 24 reads the text data D2 of Fig. 2(b) and converts it into the program statement D3 shown in Fig. 3(a). More specifically, the conversion unit 24 extracts the program statement D3 from the read text data D2. The extraction of the program statement D3 is performed according to the grammar rules of the old programming language that are set in advance. In this example, one program statement is defined according to the following grammar rules:
[0030] Program statement: = ";" "variable information" _ "command word" "variable information" _ ...
[0031] Here, " " is written to distinguish between command words and variable information, and each command word and variable information consists of one or more characters of text, and quotation marks " " are not included in the definition of the actual program statement. _ (underscore) represents a space (blank) for one character of text. ";" is a command word that reads the variable written in the "text" part immediately after ";". In the program design support system according to this embodiment, one program statement is defined for each command word ";". When adding a separator to a group of one or more program statements, the command word "NOP_P**" or "NOP_SN**" (** is a number that represents the program number or page number) is used. This command word itself is an abbreviation of "No-Operation" and does not affect the contents of the program. However, by using "NOP_P**" at the beginning of each program, a group of program statements that represent a series of processes is defined as one program. For the last program, "NOP_E" is used immediately after the program to indicate the end of the entire program.
[0032] One or more pieces of variable information are set in one command word, which act as connection information. One command word and one or more pieces of variable information set in that command word constitute one processing unit, and is called a command statement. One program statement can contain one or more command statements.
[0033] After extracting program statement D3, the conversion unit 24 determines which command word and which variable information each "text" is. When determining the "text", the conversion unit 24 refers to the database 30. In the example of FIG. 2(b), the conversion unit 24 interprets the program statement starting with the command word ";" on the first line as "I180", "M193", and "M2B" as bit address information (variable information) and "AND" and "→" as command words. The conversion unit 24 makes a similar determination for the program statements on the second and third lines.
[0034] Conversion unit 24 interprets that "CW0", "MW2612", "MW2618", and "MW1270" in the program statement beginning with ";" on the fourth line are word address information (variable information), and that ">", ",", "<", "*", " / ", and "→" are instruction words.
[0035] The conversion unit 24 converts each program statement into a program statement in the new programming language. Fig. 3(a) shows a program statement in the new programming language corresponding to the text data in the first line of the example in Fig. 2(b). The conversion unit 24 converts into a program statement in the new programming language according to the grammar rules of the new programming language that are set in advance.
[0036] In the case of a program statement that includes a bit logic operation instruction, "AND" is a logical product, and "→" represents the destination address of the result. In the case of a logical product, the bit addresses before and after are connected in series. In the case of a logical sum (OR), the bit addresses before and after the logical sum symbol are connected in parallel. In the case of a negation (NOT), the grammar rules of the conversion unit 24 accompany the instruction words with connection information, so that function blocks are arranged by performing conversion according to the grammar rules.
[0037] In the case of a program statement including a word operation command, a specific example of one program statement in FIG. 2(b) can be explained as follows in correspondence with each function block in FIG. 3(b).
[0038] When the conversion unit 24 reads ";CW0", it interprets the command word ";" at the beginning as the start of a program statement. In other words, the command word ";" causes the conversion unit 24 to start placing a command statement F1 that reads a variable in the converted program. In the program before conversion, ";CW0" is a command statement that reads a variable from memory and stores it in a word accumulator. An accumulator is a storage device that temporarily stores data during calculation. Word data is stored in a word accumulator, and bit data is stored in a bit accumulator. In a control device that uses the language illustrated in FIG. 2, such a temporary storage device may be called an accumulator.
[0039] The conversion unit 24 interprets the command statement ";" and "CW0", and places command statement F1, which reads the value of "CW0" from ROM, at the beginning. The data output from the memory is stored in a register in the PLC hardware. A register, like an accumulator, is a storage device that temporarily stores data during calculation.
[0040] When the conversion unit 24 reads in ">MW2612", it compares the value of the variable information "CW0" stored in the word accumulator with the value of the preset variable information "MW2612", and stores 1 (TRUE) in the bit accumulator if the value of "CW0" is greater than the value of "MW2612", and stores 0 (FALSE) in any other case. When the conversion unit 24 recognizes ">MW2612", it places a function block F2 for comparing the magnitude, connects the lower input to "MW2612", and connects the upper input to the output of the function block F1. The function block F2 outputs 1 (TRUE) if the value of the variable of the upper input is greater than the value of "MW2612", and outputs 0 (FALSE) in any other case.
[0041] The conversion unit 24 reads ",_MW2612". "," is a command word for conditionally reading out a variable. The command word "," stores the value of the set variable information "MW2612" in the word accumulator when the input logical value (value of the bit accumulator) is 1. The command word "," does not perform any operation when the input logical value is 0, since it retains the value of the variable information already stored in the word accumulator. When the conversion unit 24 recognizes ",", it places a function block F3 that outputs the value of the set variable information according to the value output in the previous calculation, and the input G is connected to the output of the function block F2. Next, when "MW2612" is recognized, "MW2612" is connected to the input IN1 of the function block F3, and the value of "CW0" is connected to the input IN0. The function block F3 outputs "MW2612" when the input is 1 (TRUE), and outputs the value of "CW0" when the input is 0 (FALSE).
[0042] The conversion unit 24 reads "<_MW2618". "<_MW2618" is a command statement that compares the value of the variable information stored in the word accumulator with a value preset in "MW2618" and stores 1 (TRUE) in the bit accumulator if the value stored in the word accumulator is smaller than "MW2618", and stores 0 (FALSE) in any other case. When the conversion unit 24 recognizes "<_MW2618", it places a function block F4 for comparing the magnitude, connects the lower input to "MW2618", and connects the upper input to the output of the function block F3. The function block F4 outputs 1 (TRUE) if the value of the variable in the upper input is smaller than the value of "MW2618", and outputs 0 (FALSE) in any other case.
[0043] The conversion unit 24 reads ",MW2618". This command statement is the same as the above-mentioned ",MW2612", and sets the value to be output according to the value of the bit accumulator. When the conversion unit 24 recognizes ",", it places a function block F5 that outputs the value of the set variable information according to the value output in the previous operation, and its own input is connected to the output of the previous operation. Next, when it recognizes "MW2618", it connects "MW2618" to input IN1 of function block F5. Therefore, the output of function block F4 is connected to input G, and the output of function block F3, which is the input of function block F4, is connected to input IN0. When the input of function block F5 is 1 (TRUE), it outputs "MW2618", and when the input is 0 (FALSE), it outputs the value output by function block F3.
[0044] The conversion unit 24 reads "*_K_15000". "*" is a command word representing multiplication. When the conversion unit 24 recognizes "*", it places function blocks F6 and F7 and connects them to the output of function block F5. When it recognizes "K 15000", the value 15000 is connected to the lower input of function block F7. Here, "K" is a prefix representing a decimal number.
[0045] When the conversion unit 24 reads "*", in order to maintain the precision of the multiplication, it first places a function block F6 that converts the integer type to a double integer type and connects it to the output of the function block F5. Next, the conversion unit 24 places a function block F7 that multiplies the output value of the function block F5, which has been changed to a double integer type, by 15,000 and connects it to the output of the function block F6.
[0046] The conversion unit 24 reads " / _K_1000". When the conversion unit 24 reads " / ", it first places a function block F6 that converts from an integer type to a double integer type in order to maintain the accuracy of the division. However, if the output of the previous calculation is a double integer type as shown in FIG. 2(b), it places a function block F8 that divides the value output from function block F7 by 1000 and connects it to the output of function block F7. The conversion unit 24 executes a calculation in function block F8 and outputs it. Next, when the conversion unit 24 recognizes "->", it places a function block F9 that converts from a double integer type to an integer type and connects it to the output of function block F8. Finally, when it recognizes "MW1270", it connects it to the output of function block F9.
[0047] In this way, the conversion unit 24 converts the program statements in the old programming language into program statements in the new programming language and outputs them.
[0048] FIG. 4 is a schematic diagram for explaining the operation of the connection processing unit of the program design support system according to the embodiment. As described above, the conversion unit 24 converts each program statement in the old programming language into a program statement in the new programming language and outputs them sequentially to the connection processing unit 26. The connection processing unit 26 sequentially executes a connection process for the input program statements D3. In the connection process, the core program statements are arranged, for example, based on the position information (coordinate information) of the function block at the beginning of each program statement. When the program statement on the first line is arranged, the program statement on the second line is arranged adjacent to the program statement on the first line, with its beginning aligned with the program statement on the first line.
[0049] The connection processing unit 26 performs connection processing of program statements until it finds an END command, and ends all processing when it finds the END command.
[0050] FIG. 5 is an example of a flowchart for explaining the overall operation of the program design support system according to the embodiment. As shown in Fig. 5, the program design support system 100 according to the embodiment can be realized as processing of a processing unit of a computer device, for example. The operation of the program design support system 100 is realized by the processing unit sequentially executing each step of Fig. 5.
[0051] In step S1, the calculation processing unit obtains character information from image data D1 and generates text data.
[0052] In step S2, the arithmetic processing unit recognizes variable information and instruction words from the text data.
[0053] In step S3, the processing unit converts the program statements in the old programming language into program statements in the new programming language.
[0054] In step S4, the processing unit connects and arranges the programming in the converted new programming language.
[0055] In step S5, the arithmetic processing unit judges whether or not the program statement of the new programming language that has been read in has an END command. If an END command is found, the arithmetic processing unit ends the process. If an END command is not found, the process returns to step S2 and the above-mentioned process is repeated.
[0056] The operations of each step in FIG. 5 may correspond to each block shown in FIG. 1, or may be executed by one or more arithmetic processing devices.
[0057] The effects of the program design support system 100 according to the embodiment will be described. The program design support system 100 according to the embodiment can obtain the source of a program from a control system that runs on a program written in an old programming language using the imaging device 10. Then, the obtained image data can be converted to generate text data. In the program design support system 100, since the database 30 already contains command words and variable information that conform to the grammar rules of the old program, text data can be reliably generated even for images that are difficult to convert into text data.
[0058] In the database 30 of the program design support system 100 according to the embodiment, function blocks that comply with the grammar rules of the new programming language are stored in association with each instruction word of the old programming language. Therefore, the program design support system 100 can extract function blocks of the new programming language that correspond to text data.
[0059] Connection information corresponding to the connection information of the program statements in the old programming language is set in the function blocks in the new programming language of the program design support system 100 according to the embodiment. Therefore, by extracting the function blocks each time a program of the old program is read, the program statements in the new programming language can be constructed.
[0060] Position information (coordinate information) corresponding to connection information is set in the function blocks of the new programming language of the program design support system 100 according to the embodiment. Therefore, it is possible to arrange program statements in the new programming language that are sequentially extracted and output, and it is possible to easily configure a program in the new programming language.
[0061] In this way, a program design support system can be realized that automatically converts programs that are not available as electronic data.
[0062] Although some 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 implemented 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 in the scope and spirit of the invention, and are included in the scope of the invention and its equivalents described in the claims. [Explanation of symbols]
[0063] 10: Imaging device, 20: Program design support device, 22: Recognition unit, 24: Conversion unit, 26: Connection processing unit, 30: Database, 100: Program design support system
Claims
1. an imaging means for capturing an image of a display on a monitor and generating image data including character information displayed on the monitor; a recognition means for acquiring the image data from the imaging means and recognizing text data from the character information; a conversion means for interpreting the text data as one or more first program statements according to a preset definition of a first programming language before conversion, and for converting each of the one or more first program statements into one or more program statements of a second programming language according to a definition of a second programming language after conversion; Equipped with The definition of the first programming language includes a command word consisting of one or more characters and variable information consisting of one or more characters, A program design support system in which the instruction word consisting of one or more characters is associated with a function block of the second programming language.
2. the one or more first program statements are two or more and further include an END instruction; The conversion means converts an END command into a command corresponding to the second programming language, the conversion means converts the two or more first program statements into two or more second program statements in sequence; further comprising a connection processing means for sequentially connecting two or more second program statements; 2. The program design support system according to claim 1, wherein said connection processing means terminates the process by detecting an instruction corresponding to an END instruction in said second programming language.
Citation Information
Patent Citations
Computer system where multiple languages coexist
JP1991123939A
Programming language conversion apparatus, conversion method and conversion program
JP2010020635A
Exchange support device for protective relay, and exchange support method for the same
JP2016077062A
Program converter, program inspection device, method and program
JP2023154348A
Programming device
JP1995168707A
