Program design support system
The program design support system addresses the challenge of converting programs between different PLCs by using an imaging and conversion system to automatically translate text-based control programs into a new programming language, ensuring efficient system updates.
Patent Information
- Application Number
- JP2023021706
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing control systems face challenges in updating programmable logic controllers (PLCs) due to differences in programming languages, making it difficult to transfer and convert programs from obsolete systems to new ones, especially when the source code is not readily available in electronic format.
A program design support system that includes an imaging device to capture monitor displays, a recognition unit to convert image data into text data, and a conversion unit to interpret and convert the text data into a new programming language, using predefined grammar rules and a database to associate function blocks with instruction words.
Automatically converts programs from old to new programming languages, facilitating seamless migration and streamlining the process of updating control systems.
Smart Images

Figure 0007770086000001 
Figure 0007770086000002 
Figure 0007770086000003
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 logic controllers (PLCs) used in steel plants, etc., when the devices and equipment that make up the control system become obsolete, they may need to be updated to a new control system.
[0003] When updating an existing PLC, etc., it is necessary to transfer the programs implemented in the existing PLC to the new PLC, etc. 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 that is compatible with the new control system.
[0004] Some plants have old control systems, and depending on the existing PLCs and engineering tools, it can be difficult to read the source of the implemented programs and save them to 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 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 for streamlining the above-mentioned tasks. [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 as its 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 sequentially 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. [Effects of the Invention]
[0010] According to the embodiment, a program design support system is provided that automatically converts a program that is not available as electronic data. [Brief explanation of the drawings]
[0011] [Figure 1] FIG. 1 is a schematic block diagram illustrating a program design support system according to an embodiment. [Figure 2] 2(a) to 2(c) are schematic diagrams for explaining the operation of the recognition unit of the program design support system according to the embodiment. [Figure 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] 3 is a schematic diagram for explaining the operation of a connection processing unit of the program design support system according to the embodiment; FIG. [Figure 5] 1 is an example of a flowchart for explaining the overall operation of a program design support system according to an embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0012] Hereinafter, embodiments 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 those in reality. Furthermore, even when the same part is shown, the dimensions and ratios may be different depending on the drawing. In the present specification and the drawings, elements similar to those described above with reference to the previous drawings are designated by 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 an 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 represent connection information for a ladder diagram in accordance with predetermined grammatical rules. The converted programming language employs 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. Hereinafter, the program and programming language before conversion may be referred to as the "old program" or "old programming language," and the program and programming language after conversion 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 a monitor and generates image data D1 including information about 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 all the time; it only needs to be connected to the program design support device 20 when outputting the image data D1. The imaging device 10 may also have 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 as input. The recognition unit 22 processes the image data D1 to recognize and extract text data D2. For example, software using well-known OCR technology 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 receives text data D2, converts it into the 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 in accordance with 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 texts as either variable information or instruction words under 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 under the grammar rules of the old programming language. One or more pieces of variable information are connected (associated) with one instruction word to form one instruction, and one program statement can contain one or more instructions. In both the old and new programming languages, a program is formed by placing an instruction indicating the end of the program (END instruction) after the last program statement.
[0020] The connection processing unit 26 connects the program statements D3 of the new programming language that have been input sequentially. When all program statements D3 have been connected, the connection processing unit 26 outputs the new program as output data. Connecting program statements means placing 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 top to bottom of the monitor screen) on the monitor screen is considered to be one program.
[0021] The database 30 includes text data corresponding to variable information and command words in the old programming language. The database 30 also includes 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 for function block data is information that indicates the connection with variable information. For example, in function block data that represents a two-input AND, two inputs and one output are set as connection information. The position information for function block data is the relative position (coordinates) to the absolute position (coordinates) when placed on the monitor screen. For example, after placing a function block corresponding to one instruction word on the monitor, the coordinates for placing other function blocks subordinate to that function block are set based on the coordinates of the previously placed function block.
[0023] In the database 30, the conversion unit 24 selects a command word in the old programming language, and extracts the 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 the recognition unit of the program design support system according to the embodiment. 2(a) shows an example of source code of an old program displayed on a monitor of an existing control system. The imaging device 10 captures an image of the display shown in FIG. 2(a) and generates image data D1. The imaging device 10 outputs the generated image data D1 including text information 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 on the first to third lines are examples that follow bit logic operation instructions that are executed bit by bit. The program statement on the fourth line is an example that follows word operation instructions that are executed word by 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. The recognition unit 22 also has the same grammar rules of the old program as the conversion unit 24, which 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 in 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 used to distinguish between command words and variable information. Each command word and variable information consists of one or more characters of text, and quotation marks " " are not included in the actual definition of a program statement. An underscore (_) represents a space (blank) for one character of text. A ";" is a command word that reads the variable written in the "text" portion immediately following the ";". In the program design support system according to this embodiment, one program statement is defined for each command word ";". To separate a group of one or more program statements, the command words "NOP_P**" or "NOP_SN**" (where ** is a number representing the program number or page number) are used. These commands themselves are abbreviations for "No-Operation" and do not affect the content of the program. However, by using "NOP_P**" at the beginning of each program, a group of program statements representing a series of processes is defined as a single 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 the one or more pieces of variable information set in that command word form a single processing unit, which 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 instruction word and which variable information each "text" contains. 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 on the first line, which begins with the instruction word ";," as "I180," "M193," and "M2B" as bit address information (variable information), and "AND" and "→" as instruction words. The conversion unit 24 similarly determines the program statements on the second and third lines.
[0034] The conversion unit 24 interprets the program statements "CW0", "MW2612", "MW2618", and "MW1270" beginning with ";" on the fourth line as word address information (variable information), and ">", ",", "<", "*", " / ", and "→" as instruction words.
[0035] The conversion unit 24 converts each program statement into a program statement in the new programming language. Figure 3(a) shows a program statement in the new programming language corresponding to the text data on the first line of the example in Figure 2(b). The conversion unit 24 converts the program statement into a program statement in the new programming language in accordance with the grammar rules of the new programming language that have been 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 it 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 that includes a word operation command, a specific example of one program statement in FIG. 2(b) can be explained as follows, corresponding to each function block in FIG. 3(b).
[0038] When the conversion unit 24 reads ";CW0", it interprets the leading instruction word ";" as the start of a program statement. In other words, the instruction word ";" causes the conversion unit 24 to start placing an instruction statement F1 that reads a variable in the converted program. In the program before conversion, ";CW0" is an instruction 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 control devices that use the language illustrated in Figure 2, such temporary storage devices are sometimes called accumulators.
[0039] The conversion unit 24 interprets the command statement ";" and "CW0" and places the command statement F1, which reads the value of "CW0" from ROM, at the beginning. The data output from memory is stored in a register in the PLC hardware. Like an accumulator, a register is a storage device that temporarily stores data during calculations.
[0040] When the conversion unit 24 reads in ">MW2612", it compares the value of variable information "CW0" stored in the word accumulator with the value of 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 0 (FALSE) otherwise. When the conversion unit 24 recognizes ">MW2612", it places a function block F2 for comparing the magnitude, connects its lower input to MW2612, and connects its upper input to the output of function block F1. Function block F2 outputs 1 (TRUE) if the value of the variable at its upper input is greater than the value of MW2612, and outputs 0 (FALSE) otherwise.
[0041] The conversion unit 24 reads ",_MW2612". "," is a command word that reads a variable conditionally. 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 by the previous operation, and input G is connected to the output of function block F2. Next, when "MW2612" is recognized, "MW2612" is connected to input IN1 of function block F3, and the value of "CW0" is connected to input IN0. When the input to function block F3 is 1 (TRUE), it outputs "MW2612", and when it is 0 (FALSE), it outputs the value of "CW0".
[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 the 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 its lower input to "MW2618", and connects its 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) otherwise.
[0043] The conversion unit 24 reads ",MW2618". This command statement is the same as the above-mentioned ",MW2612", and sets the output value 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 by 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 an input to function block F4, is connected to input IN0. If the input to function block F5 is 1 (TRUE), it outputs "MW2618", and if it is 0 (FALSE), it outputs the value output by function block F3.
[0044] The conversion unit 24 reads "*_K_15000". "*" is an instruction word that represents 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", it connects the value 15000 to the lower input of function block F7. Here, "K" is a prefix that represents 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 function block F5. Next, the conversion unit 24 places a function block F7 that multiplies the output value of function block F5, which has been changed to a double integer type, by 15,000 and connects it to the output of function block F6.
[0046] The conversion unit 24 reads " / _K_1000". When the conversion unit 24 reads " / ", it first places function block F6, which converts from integer type to double integer type, in order to maintain the accuracy of the division. However, if the output of the previous operation is double integer type, as shown in Figure 2(b), it places function block F8, which divides the value output from function block F7 by 1000, and connects it to the output of function block F7. The conversion unit 24 performs the operation in function block F8 and outputs it. Next, when the conversion unit 24 recognizes "->", it places function block F9, which converts from double integer type to 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 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 connection processing on the input program statements D3. In the connection processing, the core program statements are placed, 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 placed, the program statement on the second line is placed 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 instruction, and ends all processing when it finds an END instruction.
[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, for example, as processing by a processing unit of a computer device. 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 processing unit obtains character information from the image data D1 and generates text data.
[0052] In step S2, the 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 converted programming in the new programming language.
[0055] In step S5, the processing unit determines whether or not the read program statement in the new programming language contains an END command. If an END command is found, the processing unit ends the process. If an END command is not found, the processing unit returns to step S2 and repeats the above process.
[0056] The operations of the steps in FIG. 5 may correspond to the blocks 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 acquire program source data from a control system that runs on a program written in an older programming language using the imaging device 10. The acquired image data can then be converted to generate text data. The program design support system 100 has in advance in the database 30 command words and variable information that conform to the grammatical rules of the older program, so that text data can be reliably generated even for images that are difficult to convert to text data.
[0058] The database 30 of the program design support system 100 according to the embodiment stores function blocks that comply with the grammar rules of the new programming language in association with each instruction word in the old programming language. Therefore, the program design support system 100 can extract function blocks in 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 of the new programming language in 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 in the program design support system 100 according to the embodiment. Therefore, it is possible to arrange the program statements in the new programming language that are extracted and output one after another, 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 several embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be embodied in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included within the scope and spirit of the invention, and are also included in the scope of the invention and its equivalents as defined in the claims. [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 monitor display and generating image data including text information displayed on the monitor; 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 in accordance with a preset definition of a first programming language before conversion, and for converting each of the one or more first program statements sequentially into one or more program statements in a second programming language in accordance with 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 in 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 the second programming language; the converting 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 processing 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 device
JP1995168707A
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