Engineering tool
The engineering tool automates the import order determination for control programs based on reference relationships, improving efficiency and reducing manual effort in plant control systems.
Patent Information
- Application Number
- JP2023082104
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2024-11-28
- Estimated Expiration
- 2043-05-18
AI Technical Summary
The process of importing control programs in plant control systems is inefficient due to the need for system programmers to manually investigate and adhere to complex reference relationships between components, leading to increased time and effort.
An engineering tool that includes an import unit capable of determining the import order based on reference relationships between structures, functions, and function blocks, ensuring they are imported in a logical sequence to avoid failures and reduce manual investigation.
Automatically calculating the import order streamlines the process, reducing the burden on system programmers and enhancing the efficiency of control program development by minimizing errors and time spent on manual ordering.
Smart Images

Figure 2024165699000001_ABST
Abstract
Description
[Technical field]
[0001] The present embodiment relates to an engineering tool. [Background technology]
[0002] In general, in a plant control system, a system programmer creates a control program for a control device, tests and adjusts it, and then provides it to a plant operator. When a similar plant control system is newly constructed, the system programmer may reuse some or all of the components of the control program. Specifically, the system programmer exports some or all of the components of the control program from the original plant control system, and imports a control program created by reusing some or all of the exported components into a newly constructed similar plant control system. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] International Publication No. 2018 / 011959 [Patent Document 2] Special Publication No. 2005-537538 [Patent Document 3] International Publication No. 2015 / 190007 Summary of the Invention [Problem to be solved by the invention]
[0004] The components of a control program include programs, function blocks, functions, and user data types. These have a reference relationship. For example, a function block may refer to another function block. When importing a control program, the system programmer must strictly follow the import order based on this reference relationship.
[0005] Furthermore, when exporting the components of a control program, the system programmer must select the necessary programs, function blocks, functions, and user data types. Therefore, when exporting the components of a control program, the system programmer must investigate in advance the programs, function blocks, functions, and user data types required as part of the control program configuration. Furthermore, if a function block references another function block, the investigation takes time.
[0006] When exporting a large number of control programs or importing a large number of control programs, there is a problem in that work efficiency deteriorates because it takes time to check the order of import and the components that need to be exported.
[0007] Therefore, this embodiment provides an engineering tool that can improve the efficiency of importing a control program. [Means for solving the problem]
[0008] The engineering tool according to the present embodiment includes an import unit that imports a plurality of structures, each of which has at least one variable or array, The import unit determines an import order such that a structure that references another structure among the plurality of structures is imported after the other structures, and imports the plurality of structures in the determined import order. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a system configuration diagram illustrating an example of an engineering tool and its peripheral parts according to an embodiment of the present disclosure. [Diagram 2] FIG. 2 is a diagram illustrating a configuration of a database. [Diagram 3] 4 is a block diagram showing a detailed configuration of an operation screen and a database. FIG. [Figure 4]2 is a diagram showing an example of a configuration of a library database. [Diagram 5] 1 is a diagram showing an example of a configuration of a data type database. [Figure 6] 13 is a diagram showing an example of a configuration of a user data type member database. [Figure 7] 1 is a diagram showing an example of a configuration of a variable database. [Figure 8] 1 is a diagram illustrating an example of a configuration of a program code database. [Figure 9] FIG. 1 is a ladder diagram showing functions. [Figure 10] FIG. 2 is a ladder diagram showing function blocks. [Figure 11] FIG. 4 is a ladder diagram showing a program. [Figure 12] FIG. 13 is a diagram showing an image of starting up an import unit. [Figure 13] FIG. 13 is a diagram illustrating an example of a screen of an import unit. [Figure 14A] FIG. 13 is a diagram showing the initial import order of files to be imported. [Figure 14B] FIG. 13 is a diagram showing an import order according to the reference relationships of files to be imported. [Figure 15] 13 is a flowchart of import order calculation according to an embodiment of the present disclosure. [Figure 16] 13 is an example of a message window output by an import unit, indicating that import is not possible. [Figure 17] 1 is a flowchart illustrating an overall import process according to an embodiment of the present disclosure. [Figure 18] 13 is a flowchart of calculation of the import order of structures. [Figure 19] 13 is a flowchart of calculation of the import order of functions and function blocks. [Figure 20] 13 is a flowchart of calculation of the import order of programs. [Figure 21] 13 is a flowchart of an import process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0011] (Embodiments of the present disclosure) 1 is a system configuration diagram showing an example of an engineering tool 1 and its peripherals according to an embodiment of the present disclosure. The engineering tool 1 shown in FIG.
[0012] The engineering tool 1 is used, for example, to develop a control program. The control program developed by the engineering tool 1 is applied to a plant control device or the like. The engineering tool 1 has an operation screen 3 and a database (storage unit) 4. The operation screen 3 provides an operation function of the engineering tool 1 to a system programmer (also called a user). This specification describes an example in which the operation screen 3 is configured by a GUI (Graphical User Interface), but is not limited to this. The operation screen 3 may be configured by a CUI (Character User Interface) or the like. The database 4 stores the control program created via the operation screen 3.
[0013] Furthermore, the engineering tool 1 has a function of importing and exporting a control program. The engineering tool 1 can export a control program as a file 5 in the computer 2. Exporting a control program means exporting some or all of the components that make up the control program. Furthermore, the engineering tool 1 can import some or all of the components that make up the control program from any file 5 in the computer 2.
[0014] The computer 2 has, as peripheral devices, for example, a keyboard 21, a mouse 22, and a display device 23. The system programmer can operate the operation screen 3 using the keyboard 21 and the mouse 22. In addition, the system programmer can check the operation screen 3 on the display device 23.
[0015] Fig. 2 is a diagram showing a schematic configuration of the database 4. The system 6 shown in Fig. 2 has a library 61, a network 62, and a station 63. The library 61 stores one or more control programs. The library 61 has a plurality of user libraries W1 to WX created for each user, and a plurality of standard libraries B1 to BX that can be shared among users.
[0016] Each of the multiple user libraries (and multiple standard libraries) has a control program that is composed of user data types, functions, function blocks, and programs. For example, user library W1 has a control program G1 that is composed of user data type D1, function D2, function block D3, and program D4. Note that a control program may have multiple user data types, functions, function blocks, or programs. Each of the multiple user libraries also has user information.
[0017] A user data type has one or more variables (variable members) and is also called a structure. User data types are used in programs, function blocks, and functions. User data types may also contain other user data types as variable members.
[0018] A function has no history. A function can be called from a program or a function block. A function can also call other functions.
[0019] A function block is a function with history. A function block is called from a program. A function block can also call other function blocks.
[0020] The program specifies an operation procedure for causing the control device or the like to perform a predetermined operation.
[0021] As described above, programs, function blocks, and functions may call other function blocks or functions. Also, programs, function blocks, functions, and user data types may contain other user data types internally. A relationship in which a component calls or contains another component internally is also called a reference relationship. For example, when a program calls a function block, it is also said that the program references the function block.
[0022] The network 62 has connection information between a plurality of control devices to which the control program is applied, or connection information between the control devices and other devices.
[0023] The station 63 has hardware information of the control device to which the control program is applied, such as the model name of the control device or the execution period of the control program.
[0024] 3 is a block diagram showing detailed configurations of the operation screen 3 and the database 4. The operation screen 3 has an export section 31 and an import section 32.
[0025] The export unit 31 acquires some or all of the components of one or more control programs from the database 4, and outputs one or more export target files 51 (files 5) each including the acquired components.
[0026] The import unit 32 reads one or more import target files 52 (files 5) as one or more control programs to be imported. Each import target file 52 includes one or more components of a control program. The import unit 32 writes (imports) the components included in the read import target file 52 (file 5) into the database 4. As a result, the import unit 32 writes one or more control programs into the database 4.
[0027] Note that a part or all of the import target file 52 to be imported by the import unit 32 may be the export target file 51 output by the export unit 31. In this case, the user can select the export target file 51 output by the export unit 31 as a part or all of the import target file 52.
[0028] 2. The product manager 33 acquires information about the system 6 from the database 4, and writes changes to the system 6 to the database 4. The operation screen 3 may also have a program editor 34 that edits the control program. The program editor 34 acquires the control program from the database 4, and writes changes to the control program to the database 4.
[0029] The database 4 manages the information of the library 61 in the system 6 by dividing it into library data, data type data, data type member data, variable data, and program code data. Details of each data and its correspondence with the control program etc. in Fig. 2 will be described later. The library data, data type data, data type member data, variable data, and program code data are stored in the library database 41, data type database 42, user data type member database 43, variable database 44, and program code database 45, respectively.
[0030] In addition to the above, the database 4 may have a database for storing information on the network 62 and information on the station 63, respectively.
[0031] 4 shows an example of the configuration of the library database 41. The library database 41 stores a collection of library data. The library data in the library database 41 each has a relation, a library name, a library type, security manager information, and member information.
[0032] A relation is a number that is uniquely assigned to each library data in order to link the library data with other databases.
[0033] The library name is a name indicating each library. The library name is set by, for example, a user. The library type indicates the type of library. The library type includes, for example, a user library and a standard library.
[0034] The library data includes the user name and password of the security administrator as information about the security administrator. The security administrator is a user in charge of managing the security of the library. The security administrator can designate other users as members and allow them to access the library. The security administrator can also set an access level for each member. The access levels include, for example, a level where access is denied, a level where the library can only be used, a level where the library can be viewed and used, and a level where the library can be edited, viewed, and used. The library data also includes the user name, password, and access level of the member as information about the member. Note that the security administrator information and the member information are omitted in FIG. 4.
[0035] In the library database 41 in Fig. 4, the user library (work 1) W1 and standard library (standard 1) B1 in Fig. 2 are registered as library data. Fig. 4 also shows an example in which a user library (work 2) W2 and a standard library (standard 2) B2 are registered in addition to these. The relations of the user libraries W1 and W2 and the standard libraries B1 and B2 are assigned the numbers 1, 2, 3, and 4, respectively.
[0036] 5 shows an example of the configuration of the data type database 42. The data type database 42 stores a collection of data related to data types (data type data). Each data type data in the data type database 42 has a relation, a data type name, a data type, a comment, and a relation with a library.
[0037] The data type name is a name indicating each data type. The data type name is set by, for example, the user. The data type indicates the type of data type. Data types include STRUCT, which indicates a user data type, FUNCTION_BLOCK, which indicates a function block, FUNCTION, which indicates a function, and PROGRAM, which indicates a program. The comment is an explanatory text for each data type, and is set by, for example, the user. The relationship with the library links the library data in Figure 4 with the data type data in Figure 5.
[0038] In Figure 5, a user data type (STR_HZZ) D1, a function (USER_FUN) D2, a function block (USER_FBK) D3, and a program (MS000) D4 are registered, with relations assigned 1, 2, 3, and 4. The relations between the user data type D1, function D2, function block D3, and program D4 and the library are all specified as 1. In other words, the user data type D1, function D2, function block D3, and program D4 are linked to the user library W1 in Figure 4.
[0039] 6 shows an example of the configuration of the user data type member database 43. The user data type member database 43 stores a collection of user data type member data. Each user data type member data in the user data type member database 43 has a relation, a member name, a data type, a comment, and a relation with a user data type. The member name is a name indicating each member, and is set by the user, for example.
[0040] In Fig. 6, a member (INT_ARY) M1 and a member (BOOL_ARY) M2 are registered, with 1 and 2 assigned as relations. The relation between the user data type of both members M1 and M2 is specified as 1, so members M1 and M2 are linked to the user data type D1 in Fig. 5. In other words, user data type D1 references members M1 and M2. Note that, as mentioned above, a user data type may contain other user data types as members.
[0041] 7 shows an example of the configuration of the variable database 44. The variable database 44 stores a collection of variable data. Each variable data in the variable database 44 has a relation, a variable name, a data type, and a relation with the data type in the data type database 42. The variable name is a name indicating each variable, and is set, for example, by a user. For the data type in FIG. 7, a data type (for example, BOOL) that the engineering tool 1 has as standard, or data type data stored in the data type database 42 is specified.
[0042] 7, variables (INPUT) V1, (USER_FUN) V2, (INPUT) V3, (OUTPUT) V4, (ABC) V5, and (USER_FBK_1) V6 are registered, with relations of 1, 2, 3, 4, 5, and 6 assigned. As relations with data types in the data type database 42, variables V1 and V2 are assigned a value of 2, variables V3 and V4 are assigned a value of 3, and variables V5 and V6 are assigned a value of 4. That is, variables V1 and V22 are linked to function D2, variables V3 and V4 are linked to function block D3, and variables V5 and V6 are linked to program D4.
[0043] Also, since the data type of variable V5 is specified as STR_HZZ, variable V5 references user data type D1. Similarly, the data type of variable V6 is specified as USER_FBK, and it references function block D3. In other words, program D4 linked to variables V5 and V6 references user data type D1 and function block D3.
[0044] FIG. 8 shows an example of the configuration of the program code database 45. The program code database 45 stores a collection of program codes. This collection of program codes corresponds to a control program. Each program code data stores the location of each variable, function, and function block within a program, function block, or function. Each program code data has a relationship with the row, column, function / function block name, variable name, and data type.
[0045] The rows and columns indicate the location of each variable and function. In addition, the function / function block name links the data type data in the data type database 42 to the program code data. In addition, the relationship between the variable name and the data type in the data type database 42 links the variable data in the variable database 44 to the program code data.
[0046] 8, program code data C1 to C10 are registered with relations assigned numbers 1 to 10. Program codes C1 and C2 respectively indicate that in function block D2, variable V1 is placed at row 0, column 0, and variable V2 is placed at row 0, column 1. Program codes C3 and C4 respectively indicate that in function block D3, variable V3 is placed at row 0, column 0, and variable V4 is placed at row 0, column 1.
[0047] Program codes C5, C7, C8, and C10 all indicate the placement position of member M1 of variable V5 (user data type D1). Program codes C5, C7, C8, and C10 respectively indicate that member M1 is placed at row 0 column 0, row 0 column 2, row 1 column 0, and row 1 column 2 in program D4. Program code C6 indicates that variable V6 (function block D3) is placed at row 0 column 1 in program D4.
[0048] Program code C9 indicates that function D2 is placed in row 1, column 1 of program D4. That is, program D4 references function D2.
[0049] Fig. 9 is a ladder diagram showing the function D2. The ladder diagram in Fig. 9 is generated by, for example, the program editor 34 based on the program code database 45, etc. Also, changes made by the program editor 34 are reflected in the program code database 45, etc.
[0050] Column data (column 0, column 1) is arranged horizontally in Fig. 9, and row data (row 0) is arranged vertically. In function D2 in Fig. 9, variable V1 is arranged in row 0, column 0, and variable V2 is arranged in row 0, column 1, as shown in Fig. 8.
[0051] Fig. 10 is a ladder diagram showing a function block D3. In the function block D3 in Fig. 10, a variable V3 is placed in row 0, column 0, and a variable V4 is placed in row 0, column 1, as shown in Fig. 8.
[0052] Fig. 11 is a ladder diagram showing program D4. In program D4 in Fig. 11, as shown in Fig. 8, member M1 of variable V5 is placed in row 0 column 0, row 0 column 2, row 1 column 0, and row 1 column 2. Variable V6 (function block D3) is placed in row 0 column 1. Variable V3 is assigned to the input section of variable V6, and variable V4 is assigned to the output section. Function D2 is placed in row 1 column 1. Variable V1 is assigned to the input section of function D2.
[0053] As described above, the user data types, function blocks, functions, and programs that constitute the control program are registered in the database 4. The import unit 32 can store the control program acquired from the import target file 52 in the database 4 in the formats shown in Figs.
[0054] Moreover, the export unit 31 can obtain a control program from the database 4 and output it as a file to be exported 51. In the case of the database example shown in Figs. 5 to 8, a file of a user data type D1 (a file including data indicated by D1 in the database of Fig. 6), a file of a function D2 (a file including data indicated by D2 in the database of Figs. 7 and 8), a file of a function block D3 (a file including data indicated by D3 in the database of Figs. 7 and 8), and a file of a program D4 (a file including data indicated by D4 in the database of Figs. 7 and 8) can be output as a file to be exported 51. The above shows an example in which one file is exported for each data type, but if multiple user data types are defined in the data type database of Fig. 5, multiple files of the user data type may be exported. Similarly, if multiple functions, function blocks, and programs are defined, multiple files can be exported.
[0055] Fig. 12 is a diagram showing an image of starting the import unit 32. The system programmer can call up the import unit 32, for example, from the product manager 33. For example, the system programmer can call up the import unit 32 by clicking Import from the menu in Fig. 12.
[0056] FIG. 13 is a diagram showing an example of a screen of the import unit 32. The system programmer can search for the file 5 using, for example, Explorer. The system programmer selects one or more files 5 from the search results and designates them as the import target file 52. The import unit 32 imports data (structure, function, function block, program, etc.) from the designated import target file 52. The file designated as the import target file 52 may be a file exported from an arbitrary control program, or a file created separately by a user (for example, a system programmer) and stored in the database 4 or another storage unit, or both of these. Note that the import destination library is designated in advance. One or more data may be imported in advance into the import destination library. In other words, when the import work is performed in multiple parts, the data (structure, function, function block, program, etc.) imported up to the previous work may be stored in the designated library.
[0057] Fig. 14A is a diagram showing the initial import order of the import target files 52 designated as import targets. In the initial import order, the import order of the import target files 52 is, for example, the order designated by a system programmer. Fig. 14A shows the import target files 52a, 52b, 52c, 52d, 52e, 52f, 52g, and 52h in the initial import order.
[0058] In order to successfully import each import target file 52, the order of importing each import target file 52 needs to be in accordance with the reference relationship between each import target file 52, more specifically, the reference relationship between the data (structure, function, function block, program, etc.) included in each import target file 52. For example, the program stored in the import target file (MS000.PRG) 52a refers to the structure stored in the import target file (STR1.TYP) 52c and the function stored in the import target file (USR_FUN.FUN) 52g. For this reason, the import unit 32 needs to import the import target files 52c and 52g before the import target file 52a. Note that importing the import target file 52 means importing the data (structure, function, function block, program, etc.) stored in the import target file 52.
[0059] However, the import order in Fig. 14A is not an order according to the reference relationships of the import target files 52. In the import order in Fig. 14A, the import target files 52c and 52g are imported after the import target file 52a. For this reason, if import is performed in the import order in Fig. 14A, the import of the import target file 52a will fail.
[0060] Similarly, in Fig. 14A, the structure stored in the import target file 52c refers to the structure stored in the import target file (STR2.TYP) 52d. Also, the function stored in the import target file 52g refers to the structure stored in the import target file 52d. Also, the function block stored in the import target file (USR_FBK.FBK) 52f refers to the function stored in the import target file 52g. That is, in the import order of Fig. 14A, the import of the import target files 52c and 52f also fails. Note that the import target file (MS001.PRG) 52b, the import target file (STR3.TYP) 52e, and the import target file (USR_FUN1.FUN) 52h do not have a reference relationship with other files.
[0061] As described above, if the import order of the files 52 to be imported is not in accordance with the reference relationships of the files 52 to be imported, the import unit 32 will fail to import some of the files to be imported 52 .
[0062] Conventionally, in order for a system programmer to correctly specify the import order, it was necessary to investigate the structures stored in each import target file 52 and correctly understand all of the reference relationships. In a large-scale control program, investigating and calculating the import order takes time, which increases the burden on the system programmer and reduces the development efficiency of the control program.
[0063] Fig. 14B is a diagram showing an example in which the import order of each import target file 52 is determined according to the reference relationship of each import target file 52. Even when the import order of Fig. 14A is specified, the import unit 32 according to the embodiment of the present disclosure makes it possible to automatically calculate the correct import order as shown in Fig. 14B based on the reference relationship of each import target file 52. In Fig. 14B, the import target files 52d, 52c, 52g, 52f, 52a, 52e, 52h, and 52b are imported in this order.
[0064] In the following description, the structures and the like stored in the import target files 52d, 52c, 52g, 52f, and 52a are referred to as the first structure, the second structure, the first function, the second function, and the program, respectively. In Fig. 14B, the second structure that references the first structure is imported after the first structure. The first function that references the first structure is imported after the first structure. The second function that references the first function is imported after the first function. The program that references the first function is imported after the first function.
[0065] In the example of FIG. 14B, the first function is a function and the second function is a function block that references the first function, but this embodiment is not limited to this example. For example, the first function may be a function and the second function may be a function that references the first function. Also, the first function may be a function block and the second function may be a function block that references the first function. In either case, the first function and the second function are imported in this order.
[0066] As described above, the first function that references the first structure is imported after the first structure, and the program that references the first function is imported after the first function. As described above, the first function is a function in this example, but it may be a function block.
[0067] As described above, in FIG. 14B, the import order is set so that the referencing structure etc. comes after the referenced structure etc., so if import is performed in the import order of FIG. 14B, the import of any of the files to be imported 52a to 52h will not fail.
[0068] As described above, the engineering tool 1 automatically calculates the import order based on the reference relationships of the files to be imported. This eliminates the need for the system programmer to specify the import order, reducing the burden on the system programmer and improving the development efficiency of the control program.
[0069] Fig. 15 is a flowchart of import order calculation according to an embodiment of the present disclosure. The import unit 32 calculates the import order shown in Fig. 14B according to the flowchart in Fig. 15.
[0070] The import unit 32 processes the multiple import target files 52 one by one, for example in the order specified by a system programmer. First, the import unit 32 determines whether or not there is a structure or the like (hereinafter referred to as data) referenced by one of the import target files 52 to be processed (step S1).
[0071] If there is no data referenced by the target import file 52, the import unit 32 stores the import order as is (step S2). For example, the import unit 32 determines the import order to be the next value after the last import order of the file group for which the import order has been determined at the present time, and stores the determined import order value. The import unit 32 determines whether all import target files have been processed (step S3), and if all have been processed, ends the import order calculation process. If not, the import unit 32 performs processing from step S1 on the next import target file 52 to be processed.
[0072] In step S1, if there is data referenced by the target import file 52, the import unit 32 determines whether there is data to be referenced in another import file 52 (step S4).
[0073] If there is data to be referenced in another import target file 52, the import unit 32 organizes and stores the import order (step S5). Specifically, the import unit 32 organizes (rearranges) the import order so that the import target file 52 having the data to be referenced is imported before the target import target file 52.
[0074] The import unit 32 determines whether there is any data referenced by the target import target file 52 or the import target file 52 having the data to be referenced (step S6). If there is any data referenced by either the target import target file 52 or the import target file 52 having the data to be referenced, the determination in step S4 is performed again. If there is no data referenced by either the target import target file 52 or the import target file 52 having the data to be referenced, the determination in step S3 is performed.
[0075] In step S4, if there is no data to be referenced in the other import target file 52, the import unit 32 judges whether there is data to be referenced in a control program in the import destination library (hereinafter, an existing control program) (step S7). The existing control program includes, for example, one or more pieces of data that have been imported into the import destination library before the current import operation, and is stored in the database 4.
[0076] If there is data to be referenced in an existing control program, this data to be referenced does not need to be newly imported. Also, since the target import target file 52 can be imported, the import unit 32 stores the import order of the target import target file 52 in step S5. Thereafter, the same process is performed as when there is data to be referenced in another import target file 52 as determined in step S4.
[0077] If there is no data to be referenced in the existing control program, the import unit 32 determines that the target import target file 52 cannot be imported, and stores information indicating that the import is not possible (step S8). In this case, the import unit 32 notifies a system engineer of this fact, for example, in a message window or the like. Fig. 16 is an example of a message window output by the import unit 32 indicating that the import is not possible. Fig. 16 displays, for example, the data type name (Datatype) of the data to be referenced that could not be found in other import target files 52 and existing control programs.
[0078] After it is stored in step S8 that the import target file 52 cannot be imported, the determination in step S3 is performed.
[0079] As described above, the import unit 32 executes the process of the flowchart in FIG. 15, thereby being able to calculate the import order in FIG. 14B.
[0080] In addition, in the flowchart of Fig. 15, data to be referenced is searched for from an existing control program. That is, the import unit 32 calculates the import order based on the data in the existing control program. Conventionally, if there is no file storing the data to be referenced in the import target file 52, it was necessary to investigate in advance whether the data to be referenced exists in the existing control program (whether it has already been imported). In the embodiment of the present disclosure, as described above, data to be referenced is automatically searched for from the existing control program, so there is no need to investigate the existing control program.
[0081] Moreover, the import unit 32 according to the embodiment of the present disclosure can also improve the efficiency of export work. When developing a new control program by reusing a control program, the system programmer may use the export unit 31 to export data required for the import destination control program from the control program to be reused as a file from the engineering tool 1. The system programmer imports the exported file into the new control program by the import unit 32. Even in such a situation, the import unit 32 calculates the import order based on the data in the existing control program, so that it is possible to omit or reduce the investigation of the reference relationship of the data to be exported and the investigation of the data to be referenced in the existing control program, which were previously required. That is, the import unit 32 can improve the efficiency of the export work.
[0082] Hereinafter, a more specific method for calculating the import order will be described for each structure, function, function block, and program that constitute the control program. Note that the flowchart in Fig. 15 may be applied to data other than structures, functions, function blocks, and programs.
[0083] Fig. 17 is a flowchart of the overall import process according to an embodiment of the present disclosure. The import unit 32 starts the import process in Fig. 17 when a system programmer designates multiple files 52 to be imported and presses the import button on the screen in Fig. 13, for example.
[0084] The import unit 32 first calculates the import order of structure files (import order of structures) among the multiple import target files 52 (step S11). Next, the import unit 32 calculates the import order of function and function block files (import order of functions and function blocks) among the multiple import target files 52 (step S12). Next, the import unit 32 calculates the import order of program files (import order of programs) among the multiple import target files 52 (step S13). Finally, the import unit 32 imports the multiple import target files 52 based on the import order calculated in steps S11 to S13. That is, the import unit 32 imports data (structures, functions, function blocks, programs) included in the multiple import target files 52.
[0085] 18 is a flowchart showing calculation of the import order of structures. The import unit 32 executes the process of the flowchart in FIG.
[0086] The import unit 32 determines whether or not there is a file that stores a structure among the files 52 to be imported (step S21). The import unit 32 can determine whether or not the file 52 to be imported stores a structure by, for example, the file extension. For example, if the file 52 to be imported has an extension of *.TYP, the file stores a structure.
[0087] If there is no file that stores a structure among the files 52 to be imported, the import unit 32 ends the process of FIG.
[0088] If there is a file that stores a structure among the files to be imported 52, the import unit 32 processes the files to be imported 52 that store the structure one by one. As described above, a structure may refer to another structure. Therefore, the import unit 32 determines whether or not a structure in the file to be imported 52 to be processed (hereinafter, the structure to be processed) refers to another structure (step S22).
[0089] In step S22, similarly to step S1 in Fig. 15, if the structure to be processed does not refer to other structures, the import unit 32 stores the import order of the files of the structures to be processed (step S23). Next, the import unit 32 determines whether all files including structures among the multiple files to be imported 52 have been processed (step S24). If all files including structures have been processed, the import unit 32 ends the process in Fig. 18, and if there is a file that has not been processed, the import unit 32 performs the determination in step S22 for the next structure.
[0090] 15, the import unit 32 determines whether or not a file including the other referencing structure is included in the files to be imported 52 (step S25), and if so, organizes and stores the import order (step S26).The import unit 32 determines whether or not the structure to be processed and the referencing structure further refer to other structures (step S27), and if so, performs the determination of step S25 again, and if not, proceeds to the determination of step S24.
[0091] If the file containing the referenced structure is not included in the import target file 52, the import unit 32 determines whether the referenced structure is in an existing control program (import destination library) (step S28), and if so, proceeds to processing in step S26, and if not, stores a message indicating that the import is not possible (step S29) and proceeds to the determination in step S24.
[0092] Fig. 19 is a flowchart of calculation of the import order of functions (hereinafter referred to as FUN) and function blocks (hereinafter referred to as FBK). After the process of Fig. 18 is completed, the import unit 32 executes the process of the flowchart of Fig. 19 in step S12 of Fig. 17.
[0093] The import unit 32 determines whether or not there is a file that stores FUN and FBK among the files 52 to be imported (step S31), and if there is not, ends the processing in Fig. 19. For example, if the file to be imported 52 has an extension of *.FUN, the file stores FUN. If the file to be imported 52 has an extension of *.FBK, the file stores FBK.
[0094] As described above, FUN and FBK may refer to a structure, other FUN, or other FBK. Therefore, the import unit 32 determines whether the FUN or FBK to be processed refers to a structure (step S32). If the FUN or FBK to be processed refers to a structure, the import unit 32 calculates the import order of the structure files (step S33).
[0095] Specifically, in step S33, the import unit 32 performs the processes of steps S25 to S29 in Fig. 18. If there is no further structure referenced by the FUN or FBK to be processed and the referencing structure in step S27 in Fig. 18, or if information indicating that import is not possible is stored in step S29, the import unit 32 ends the process of step S33 in Fig. 19.
[0096] In the process of step S33, the import unit 32 determines whether or not the necessary structure file can be imported (step S34). Specifically, if information indicating that import is not possible is stored in step S29 of Fig. 18, it is not possible to import some or all of the necessary structure files. If it is not possible to import the structure files, it is also not possible to import the FUN or FBK file to be processed. At this time, information indicating that import is not possible may be stored for the FUN or FBK file to be processed.
[0097] If it is determined in step S27 of FIG. 18 that there is no further structure being referenced, all files of structures that need to be imported can be imported.
[0098] If the FUN or FBK to be processed does not reference a structure in step S32, or if it is determined in step S34 that the structure can be imported, the import unit 32 determines whether the FUN or FBK to be processed references another FUN or FBK (step S35).
[0099] If the FUN or FBK to be processed does not refer to other FUNs or FBKs, the import unit 32 stores the import order of the FUN or FBK to be processed (step S36). This process may be the same as step S23 in FIG.
[0100] After the process of step S36, or if it is not possible to import the structure in step S34, the import unit 32 judges whether all the FUN or FBK files have been processed (step S37). If all the FUN or FBK files have been processed, the import unit 32 ends the process of Fig. 19, and if not, the import unit 32 proceeds to the judgment of step S32 for the next FUN or FBK file.
[0101] In step S35, if the FUN or FBK being processed references another FUN or FBK, the import unit 32 determines whether the file of the referenced FUN or FBK is included in the files 52 to be imported (step S38).
[0102] If the referencing FUN or FBK file is among the files 52 to be imported, the import unit 32 determines whether or not the FUN or FBK further references a structure (step S39). If the referencing FUN or FBK further references a structure, the import unit 32 calculates the import order of the structure files as in step S33 (step S40). In the process of step S40, the import unit 32 determines whether or not the required structure file can be imported (step S41). If the structure file cannot be imported, the import unit 32 stores information that the target FUN or FBK file cannot be imported, and proceeds to the determination of step S37.
[0103] If the FUN or FBK referenced in step S39 does not further reference a structure, or if it is determined in step S40 that the structure file can be imported, the import unit 32 organizes and stores the import order (step S42) and determines whether there is a further referenced FUN or FBK (step S43). If there is a further referenced FUN or FBK in step S43, the import unit 32 proceeds to the determination in step S38, or if there is no further referenced FUN or FBK, the import unit 32 proceeds to the determination in step S37.
[0104] In step S38, if the referenced FUN or FBK file is not in the import target file 52, the import unit 32 determines whether the referenced FUN or FBK is in an existing control program (step S44), and if so, proceeds to processing in step S39, and if not, stores information indicating that import is not possible (step S45) and proceeds to the determination in step S37.
[0105] Fig. 20 is a flowchart of calculation of the import order of programs. After the process of Fig. 19 is completed, the import unit 32 executes the process of the flowchart of Fig. 20 in step S13 of Fig. 17.
[0106] The import unit 32 determines whether or not there is a file that stores a program among the files 52 to be imported (step S51), and if there is no file, ends the processing in Fig. 20. For example, if the file 52 to be imported has an extension of *.PRG, the file stores a program.
[0107] As described above, a program may refer to a structure, FUN, or FBK. Therefore, the import unit 32 determines whether the program to be processed refers to a structure (step S52). If the program to be processed refers to a structure, the import unit 32 calculates the import order of the structures (step S53), similar to step S33 in FIG. 19. The import unit 32 determines whether or not the file of the required structure can be imported in the process of step S53 (step S54).
[0108] If the program to be processed does not refer to a structure in step S52, or if it is determined in step S54 that the file of the structure can be imported, the import unit 32 determines whether the program to be processed refers to FUN or FBK (step S55). If it is determined in step S54 that the file of the structure cannot be imported, the file of the program to be processed cannot be imported.
[0109] If the program to be processed references a FUN or FBK in step S55, the import unit 32 calculates the import order of the FUN or FBK files (step S56). Specifically, the import unit 32 performs the processes of steps S35 to S43 in Fig. 19. If the program to be processed and the referenced FUN or FBK do not reference any other FUN or FBK in step S43 in Fig. 19, or if information indicating that the file of the program to be processed cannot be imported is stored in step S45, or if it is determined in step S41 that the structure referenced by the FUN or FBK cannot be imported, the import unit 32 ends the process of step S56 in Fig. 20.
[0110] After step S56, the import unit 32 judges whether or not the FUN or FBK file can be imported (step S57). Specifically, if it is stored in step S45 that the file of the program to be processed cannot be imported, or if it is judged in step S41 that the file of the structure referenced by FUN or FBK cannot be imported, the import of the FUN or FBK file is not possible. In other words, if it is judged that the import of the FUN or FBK file is not possible, the file of the program to be processed cannot be imported.
[0111] If it is determined in step S43 of FIG. 19 that there is no further referenced FUN or FBK, all FUN or FBK files that need to be imported can be imported.
[0112] If the program to be processed does not reference FUN or FBK in step S55, or if it is determined in step S57 that FUN or FBK can be imported, the import unit 32 stores the import order of the program files (step S58).
[0113] If the import order of the program files is stored in step S58, if it is determined in step S54 that import of the structure file is impossible, or if it is determined in step S57 that import of the FUN or FBK file is impossible, the import unit 32 determines whether all the program files have been processed (step S59). If all the program files have been processed, the import unit 32 ends the process in Fig. 20, and if not, proceeds to the determination in step S52 for the next program file.
[0114] Fig. 21 is a flowchart of the import process. After the process of Fig. 20 ends, the import unit 32 executes the process of the flowchart of Fig. 21 in step S14 of Fig. 17.
[0115] The import unit 32 processes the import target files 52 one by one in the import order of the import target files arranged in steps S11 to S13 of Fig. 17. First, the import unit 32 determines whether the import target file 52 to be processed can be imported (step S61).
[0116] Import is not possible for the import target file 52 for which import-unavailable information is stored in step S29 of Fig. 18, step S45 of Fig. 19, etc. If it is determined in step S61 that the file is not importable, an error dialog (for example, the dialog in Fig. 16) is displayed (step S62), and the processing in Fig. 21 is interrupted.
[0117] If it is not determined in step S61 that the import is impossible, that is, if it is determined that the import is possible, the import target file 52 to be processed is imported (step S63). Then, it is determined whether all the import target files have been processed (step S64). If all the import target files 52 have not been processed, the import unit 32 performs the determination in step S61 for the next import target file 52 to be processed. If all the import target files 52 have been processed in step S64, or if the process in FIG. 21 is interrupted in step S62, the process in FIG. 21 ends and the process in FIG. 17 also ends.
[0118] In this way, the engineering tool 1 according to the embodiment of the present disclosure automatically calculates the import order based on the reference relationships between the data (structures, functions, function blocks, programs, etc.) of the control program, and imports the import target files in the optimal order. This allows the system programmer to import the import target files without correctly specifying the import order of the import target files. In addition, the need for the system programmer to check the reference relationships between the import target files can be omitted or reduced. Furthermore, when a file of data to be imported does not exist in the import target file group, the engineering tool 1 according to the embodiment of the present disclosure searches for the data to be imported from an existing control program, thereby reducing the effort required for the system programmer to check whether or not there is data to be imported in the existing control program. In other words, the engineering tool 1 can improve the efficiency of importing and exporting the control program.
[0119] The present invention is not limited to the above-described embodiments, and may vary depending on the embodiment. The components may be modified without departing from the spirit and scope of the present invention. By appropriately combining the multiple components described above, various inventions can be formed. For example, a configuration in which some components are deleted from all the components shown in each embodiment may be considered. Furthermore, the components described in different embodiments may be combined as appropriate.
[0120] [Note] [Item 1] An import unit that imports a plurality of structures, each of which has at least one variable or array, the import unit determines an import order such that a structure that references another structure among the plurality of structures is imported after the other structure, and imports the plurality of structures in the determined import order. Engineering tools. [Item 2] The import unit imports a plurality of functions, each of which is composed of a function or a function block; The import unit determines an import order of the plurality of functions such that a function that references another function among the plurality of functions is imported after the other function, and imports the plurality of functions in the determined import order. Item 1. An engineering tool according to item 1. [Item 3] The import unit imports a program that references at least one of the functions, The import unit determines an import order of the program and the function such that the program is imported after a function referenced by the program, and imports the program and the function in the determined import order. Item 2. An engineering tool according to item 2. [Item 4] the import unit imports the program from an import target file that defines the program among a plurality of import target files that respectively define the function and the program; When a file defining a function referenced by the program is not included in the plurality of files to be imported, it is determined whether the function has already been imported into the import destination library, and if so, the order in which the program and the function are to be imported is determined, and if not, it is determined that the program cannot be imported. Item 3. An engineering tool according to item 3. [Item 5] the import unit imports the functions from a plurality of import target files each defining the functions; When an import target file defining a function referenced from any of the plurality of functions is not included in the plurality of import target files, it is determined whether the referenced function has already been imported into the import destination library, and if the referenced function has already been imported, an import order of the plurality of functions is determined, and if the referenced function has not already been imported, it is determined that the function that references the referenced function cannot be imported. 5. An engineering tool according to any one of items 2 to 4. [Item 6] The import unit imports the plurality of structures from a plurality of import target files each defining the plurality of structures, When an import target file that defines a structure referenced from any of the plurality of structures is not included in the plurality of import target files, it is determined whether the referenced structure has already been imported into the import destination library, and if it has already been imported, the import order of the plurality of structures is determined, and if it has not been imported, it is determined that it is not possible to import a structure that references the referenced structure. 5. An engineering tool according to any one of items 1 to 4. [Item 7] The program, the functions, and the structures imported by the import unit constitute a control program for controlling a control device. 5. The engineering tool according to item 3 or 4. [Explanation of symbols]
[0121] 1 Engineering tool, 2 Computer, 3 Operation screen, 4 Database, 5 File, 6 System, 21 Keyboard, 22 Mouse, 23 Display device, 31 Export section, 32 Import section, 33 Product manager, 34 Program editor, 41 Library database, 42 Data type database, 43 User data type member database, 44 Variable database, 45 Program code database, 51 Export target file 52, 52a, 52b, 52c, 52d, 52e, 52f, 52g, 52h Import target file, 61 Library, 62 Network, 63 Station
Claims
1. An import unit that imports a plurality of structures, each of which has at least one variable or array, the import unit determines an import order such that a structure that references another structure among the plurality of structures is imported after the other structure, and imports the plurality of structures in the determined import order. Engineering tools.
2. The import unit imports a plurality of functions, each of which is composed of a function or a function block; The import unit determines an import order of the plurality of functions such that a function that references another function among the plurality of functions is imported after the other function, and imports the plurality of functions in the determined import order.
2. The engineering tool of claim 1.
3. the import unit imports a program that references at least one of the functions; The import unit determines an import order of the program and the function such that the program is imported after a function referenced by the program, and imports the program and the function in the determined import order.
3. An engineering tool according to claim 2.
4. the import unit imports the program from an import target file that defines the program among a plurality of import target files that respectively define the function and the program; When a file defining a function referenced by the program is not included in the plurality of files to be imported, it is determined whether the function has already been imported into the import destination library, and if so, the order in which the program and the function are to be imported is determined, and if not, it is determined that the program cannot be imported.
4. An engineering tool according to claim 3.
5. the import unit imports the functions from a plurality of import target files each defining the functions; When an import target file defining a function referenced from any of the plurality of functions is not included in the plurality of import target files, it is determined whether the referenced function has already been imported into the import destination library, and if the referenced function has already been imported, an import order of the plurality of functions is determined, and if the referenced function has not already been imported, it is determined that the function that references the referenced function cannot be imported.
3. An engineering tool according to claim 2.
6. The import unit imports the plurality of structures from a plurality of import target files each defining the plurality of structures, When an import target file that defines a structure referenced from any of the plurality of structures is not included in the plurality of import target files, it is determined whether the referenced structure has already been imported into the import destination library, and if it has already been imported, the import order of the plurality of structures is determined, and if it has not been imported, it is determined that it is not possible to import a structure that references the referenced structure.
2. The engineering tool of claim 1.
7. The program, the functions, and the structures imported by the import unit constitute a control program for controlling a control device.
4. An engineering tool according to claim 3.
Citation Information
Patent Citations
Program structure management device and program structure management program
JP2007115155A
Tool for converting PLC program
JP2010176377A
Data preparation apparatus, management apparatus, data processing system, control method of data preparation apparatus, control method of management apparatus, and program
JP2017040965A
Program development device, project creation method and program for achieving program development device
JP2021039570A
Engineering tool
JP2022054949A
