The present disclosure relates to a technology for supporting development of a control program for a control device that controls a control target.
A control device such as a programmable logic controller (PLC) has been introduced in various manufacturing sites as represented by a factory automation (FA) system. The control device as above is one type of computer, and can control a control target such as a manufacturing device or a manufacturing facility when a control program designed in accordance with the control target is executed. In general, the control program is created by using a development support device that is provided separately from the controller.
The control program as above is generally written with use of variables declared in advance. For example, Japanese Patent Laying-Open No. 2005-352612 (Patent Literature 1) discloses a program development support device that can enhance the development efficiency of a control program by enhancing the searchability of variables. In the program development support device of Patent Literature 1, the searchability of the variables is enhanced by performing narrowing-down that list-displays only variables with variable names including a keyword (character string) in accordance with a specification of the character string when an operand for a predetermined instruction is input.
In the source program of the control program, a definition list for declaring variables is provided, and the variables declared on the definition list is usable in the source code.
Meanwhile, the following occurs when the control program is changed or edited. A memory region corresponding to variables deleted in the source code is also secured at the time of execution of the control program when those variables are remaining on the definition list. Therefore, it is preferred that unnecessary variables be deleted from the definition list in terms of efficiently using the memory region of the control device.
Meanwhile, at the time of execution of the control program, the control target is controlled by constructing a network between the control device and the control target, and hence there is a fear that the control target may be affected when necessary variables are deleted.
The present disclosure has been made to solve the problem as described above, and an objective in a certain aspect is to provide a development support device capable of reducing an influence on the control target side due to the deletion of an unused variable in a control program for a control device that controls a control target. An objective in another aspect is to provide a development support method capable of reducing an influence on the control target side due to the deletion of an unused variable in a control program. An objective in still another aspect is to provide a development support program capable of reducing an influence on the control target side due to the deletion of an unused variable in a control program.
According to one example of the present disclosure, a development support device for supporting development of a control program for a control device that controls a control target is provided. The development support device includes a storage unit, an extraction unit, an acquisition unit, and a determination unit. The storage unit is configured to store a source code of the control program and a first list that declares a plurality of variables used in the source code. The extraction unit is configured to extract a first variable that is unused in the source code from the plurality of variables on the first list. The acquisition unit is configured to acquire information for specifying a second variable having a possibility of being exchanged between the control target and the control device out of the plurality of variables in a state before execution of the control program. The determination unit is configured to determine that a variable corresponding to the second variable out of the first variable is indelible from the first list on the basis of a result of extraction by the extraction onit and the information acquired by the acquisition unit in the state before execution of the control program.
According to this disclosure, the development support device can set the second variables having a possibility of being used in the control target at the time of execution of the control program to be indelible from the first list even when the second variables are the unused variables in the source code of the control program. As a result, it becomes possible to reduce the influence on the control target side due to the deletion of the unused variables in the control program.
In the disclosure described above, each of the plurality of variables may have attribute information that defines whether the variable is public to a network including the control target and the control device. The acquisition onit may be configured to acquire the attribute information as information for specifying the second variable. The determination unit may be configured to determine that a variable specified to be public to the network by the attribute information out of the plurality of variables is indelible from the first list as the second variable.
According to this disclosure, information for specifying the second variables having a possibility of being used in the control target at the time of execution of the control program can be easily acquired on the basis of the attribute information defined for each variable.
In the disclosure described above, the acquisition unit may be configured to acquire a second list indicating a variable specified to be a target of exchange between the control target and the control target when the control program is executed, as information for specifying the second variable, in the state before execution of the control program.
According to this disclosure, the information for specifying the second variables used by the control target can be easily acquired with use of the list (second list) created in the state before execution of the control program.
In the disclosure described above, the acquisition unit may be configured to acquire the second list of one or more projects specified by a user as the information. The determination on it may be configured to execute the determination by regarding a variable included in the second list in at least one of the projects out of the plurality of variables to be the second variable.
According to this disclosure, when a plurality of projects are applied to the network including the control device and the control target, the user can select the range of the projects to which the unnecessary-variable deletion processing is applied.
In the disclosure described above, the determination unit may be configured to determine that a third variable that does not correspond to the second variable out of the first variable is delible from the first list on the basis of a result of extraction by the extraction unit and the information acquired by the acquisition unit in the state before execution of the control program.
According to this disclosure, the variables delible from the first list can be determined by excluding the second variables having a possibility of being used in the control target at the time of execution of the control program from the unused variables in the source code of the control program.
In the disclosure described above, the development support device may be configured to further include a variable deletion on it configured to delete the third variable from the first list.
According to this disclosure, the first list can be automatically updated to a content in which the third variables determined to be delible by the determination unit is deleted.
In the disclosure described above, the development support device may be configured to further include an interface unit for inputting an operation of a user. The extraction unit, the acquisition unit, and the determination unit may be configured to operate in accordance with an input of a first operation that activates deletion processing of an unnecessary variable on the interface unit. The interface unit may be configured to output a message asking the user whether to delete the third variable extracted by the determination unit from the first list. The variable deletion unit may be configured to operate in accordance with an input of a second operation that gives a command for deleting the third variable in accordance with the message on the interface unit.
According to this disclosure, in the deletion processing of the unnecessary variables activated in accordance with the user operation, the third variables determined to be delible by the determination unit can be deleted from the first list after confirmation by the user.
In another example of the present disclosure, a development support method of a control program for a control device that controls a control target to be executed by a computer is provided. The development support method includes, extracting a first variable that is unused in a source code of the control program from a list that declares a plurality of variables used in the source code; acquiring information for specifying a second variable having a possibility of being exchanged between the control target and the control device out of the plurality of variables in a state before execution of the control program; and determining that a variable corresponding to the second variable out of the first variable is indelible from the list on the basis of a result of extraction by the extracting and the information acquired by the acquiring in the state before execution of the control program.
In still another example of the present disclosure, a development support program of a control program for a control device that controls a control target is provided. The development support program causes a computer to execute; extracting a first variable that is unused in a source code of the control program from a list that declares a plurality of variables used in the source code, acquiring information for specifying a second variable having a possibility of being exchanged between the control target and the control device out of the plurality of variables in a state before execution of the control program; and determining that a variable corresponding to the second variable out of the first variable is indelible from the list on the basis of a result of extraction by the extracting and the information acquired by the acquiring in the state before execution of the control program.
According to this disclosure, the development support method and the development support program can set the second variables having a possibility of being used in the control target at the time of execution of the control program to be indelible from the list even when the second variables are the unused variables in the source code of the control program. As a result, it becomes possible to reduce the influence on the control target side due to the deletion of the unused variables in the control program.
According to the present disclosure, it becomes possible to reduce the influence on the control target side due to the deletion of the unused variable in the control program for the control device that controls the control target.
Hereinafter, with reference to the drawings, each embodiment of the present invention will be described. In the following description, the same components and constituents are given the same reference characters. The same applies to names and functions thereof. Therefore, a detailed description thereof will not be repeated in principle.
FA system 10 includes one or more development support devices 100, one or more control devices (controllers) 200, and external apparatuses 300 controlled by control device 200.
Development support device 100 is a notebook or desktop personal computer (PC), a tablet terminal, a smartphone, or other information processing devices, for example.
A development support program 50 is installed in development support device 100. Development support program 50 is an application for supporting development of a control program 210 for control device 200. Development support program 50 is “Sysmac Studio” manufactured by OMRON Corporation, for example. A user can design a control program for control device 200 on development support program 50 and download designed control program 210 to the controller. Alternatively, development support device 100 can upload data and the like from control device 200.
Control device 200 and external apparatuses 300 are connected to a network NW1 to which development support device 100 can be connected. Ethernet (R) and the like are employed as network NW1. Control device 200 is configured by a PLC, for example.
Control device 200 and external apparatuses 300 are connected to a network NW2. A field network that ensures data arrival time and performs fixed period communication is preferably employed as network NW2 As a field network performing the fixed period communication as above, OPC UA (R) and the like are known.
External apparatuses 300 are configured by various industrial apparatuses, various sensors, a human machine interface (HMI) apparatus, and the like used to automate a production process. External apparatuses 300 include apparatuses 301A to 301C and devices 300A to 300C connected to network NW1 or NMW2. Apparatuses 301A to 301C are communicably connected to control device 200 by devices 300A to 300C via networks NW1, NW2. As a result, apparatuses 301A to 3010 can be controlled by a control program executed by control device 200. In other words, external apparatus 300 corresponds to a “control target” controlled by the control program.
In the example of
Development support device 100 is formed by a computer configured according to a general-purpose computer architecture, for example. Development support device 100 includes a processor 102 such as a central processing unit (CPU) or a micro-processing unit (MPU), a main memory 104, a communication interface 111, an input/output (I/O)) interface 114, a display interface 117, and a nonvolatile storage device 120. These components are communicably connected to each other via an internal bus 125.
Processor 102 activates a development tool of control program 210 (see
Communication interface 111 exchanges data with other communication apparatuses via a network. Those other communication apparatuses include control device 200 and external apparatuses 300 illustrated in
I/O interface 114 is connected to an operation unit 115 and fetches a signal indicating a user operation from operation unit 115. Operation unit 115 is typically formed by a keyboard, a mouse, a touch screen, a touch pad, and the like, and receives an operation from the user. Operation unit 115 may be configured integrally with development support device 100 or may be configured separately from development support device 100.
Display interface 117 is connected to a display unit 118 and transmits an image signal for displaying an image to display unit 118 in response to a command from processor 102 or the like. Display unit 118 is configured by a liquid crystal display (LCD), an organic electro luminescence (EL) display, or the like and presents various pieces of information to the user. Display unit 118 may be configured integrally with development support device 100 or may be configured separately from development support device 100.
Next, the control program is described.
In development support device 100, a source program 210s including a source code 51 and a variable definition list 52 is created by an operation of the user using operation units 115 and 118. Source program 210s including source code 51 and variable definition list 52 is edited, as appropriate, by an operation of the user on development support device 100. In
In development support device 100, source program 210x is built. As a result, an execution code 211 of control program 210 is created and downloaded to control device 200. At this time, in control device 200, a memory region 212 for storing therein variables declared on variable definition list 52 is secured for control program 210.
Devices 300A to 300C can access the variables in memory region 212 by performing data communication by network NW1 or NW2 via a network interface 250. For example, in the example in
As illustrated in
In the example in
As illustrated in
In the development support device according to the present embodiment, each variable has network attribute information 53. Network attribute information 53 is information that defines whether there is input/output of a variable value from control device 200 to networks NW1, NW2 Network attribute information 53 is declared as “output” in variables read out from control device 200 by devices 300A and 300B via networks NW1, NW2. Conversely, network attribute information 53 is declared as “input” in variables input to control device 200 from devices 300A and 300B via networks NW1, NW2. Meanwhile, network attribute information 53 is declared as “private” in variables that are neither “input” nor “output” with respect to networks NW1, NW2 from control device 200. As above, one of “output”, “input”, and “private” is declared for network attribute information 53 of each variable on variable definition list 52.
If a case where the source program is configured by ladder circuit 220 in
Meanwhile, there may be variables accessed from external apparatuses 300 to control device 200 even when the variables are unused in the ladder circuit, in other words, the source program. Therefore, when variables unused in the source program are extracted and are deleted from automatically variable definition list 52, there is a fear that the side of external apparatuses 300 may be affected by deleting the variables as described above.
Development support device 100 includes an extraction unit 55, an acquisition unit 56, a determination unit 57, a user interface unit 58, and a variable deletion unit 59. For example, when processor 102 of development support device 100 executes development support program 50, each of acquisition unit 56, determination unit 57, user interface unit 58, and variable deletion unit 59 is realized as some of functions of the program. User interface unit 58 covers I/O interface 114 and display interface 117 illustrated in
User interface unit 58 starts the unnecessary-variable deletion processing when an activation command for the unnecessary-variable deletion processing is input to operation unit 115. For example, the user can input the activation command for the unnecessary-variable deletion processing by performing selecting and inputting on a menu screen displayed on display unit 118. The operation for the activation command corresponds to a “first operation”.
When the unnecessary-variable deletion processing is started, extraction unit 55 collates source code 51 and variable definition list 52 and extracts unused variables V1 that are unused in source code 51. For example, in the example in
Acquisition unit 56 acquires network attribute information 53 described in
Determination unit 57 determines that variables corresponding to device usage variable V2 out of unused variables V1 are indelible from variable definition list 52 on the basis of unused variables V1 extracted by extraction unit 55 and device usage variables V2 specified from the information acquired by acquisition unit 56. Determination unit 57 determines that variables not corresponding to device usage variables V2 out of unused variables V1 are delible variables V3 delible from control program 210.
Therefore, out of unused variables V1, only variables of which network attribute information 53 is defined to be “private” are determined to be delible variables V3, and variables of which network attribute information 53 is defined to be “input” or “output” are determined to be indelible from variable definition list 52.
User interface unit 58 notifies the user of delible variables V3 and requests the user to confirm whether the deletion of delible variables V3 may be executed with use of display unit 118. For example, characters and figures for clicking “YES” or “NO” for a display indicating “Would you like to delete these variables?” can be output to display unit 118.
User interface unit 58 generates an automatic deletion command to variable deletion unit 59 when the deletion command of the user is input when “YES” is clicked on the display. The operation for the deletion command corresponds to a “second operation”.
When the automatic deletion command is input, variable deletion unit 59 deletes delible variables V3 from the variables included in variable definition list 52. From the above, variable definition list 52 is updated to a content in which delible variables V3 are deleted.
As a result, according to development support device 100 according to the present embodiment, in a stage before the execution of control program 210, delible variables V3 delible from variable definition list 52 can be automatically determined by excluding variables having a possibility of being used in external apparatuses 300 (control target) at the time of the execution of control program 210. Variable definition list 52 can be updated to a content in which automatically determined delible variables V3 are deleted.
When the update of variable definition list 52 is completed, user interface unit 58 can output a message indicating that the unnecessary-variable deletion processing has ended to the user with use of display unit 118 and the like In addition, a message prompting rebuilding of the source program (source code) may also be output to the user.
In Step S110, development support device 100 determines whether the activation command of the unnecessary-variable deletion processing is input from the user. When the user command is not input (when it is determined that S110 is NO), processing of Step S120 and thereafter is placed on standby.
The processing proceeds to Step S120 when the user gives a command for activating the unnecessary-variable deletion processing (when it is determined that S110 is YES). In Step S120, development support device 100 extracts unused variables V1 that are unused in source code 51 by processing similar to that of extraction unit 55 in
Alternatively, in Step S130, network attribute information 53 of all the variables included in variable definition list 52 can be acquired. In this case, Steps S120 and S130 may be parallelly processed or Step S130 may be executed before Step S120 in a manner opposite from
Development support device 100 determines whether network attribute information 53 is “private” for each of unused variables V1 (S120) by Step S140 after Steps S120 and S130. As a result, out of unused variables V1, variables of which network attribute information 53 is “private” are determined to be delible by Step S150, and variables of which network attribute information 53 is not “private” are determined to be indelible by Step S160.
Development support device 100 sets the variables determined to be delible in Step S150 to be delible variables V3 delible from variable definition list 52 by Step S170 on the basis of the determination in Steps S140 to S160. Delible variables V3 can be extracted by the processing in Steps S140 to S170 as with determination unit 57 in
In Step S180, development support device 100 deletes delible variables V3 from the variables included in variable definition list 52 as with variable deletion unit 59 illustrated in
According to the control processing illustrated in
Alternatively, as illustrated in
When the extraction of delible variables V3 by Step S170 is completed, development support device 100 notifies the user of delible variables V3 and requests the user to confirm whether the deletion of delible variables V3 may be executed with use of display unit 118 by S172.
Development support device 100 determines a user command with respect to the confirmation in Step S172 by Step S175. When a deletion command is input from the user, for example, when “YES” is clicked for a display indicating “Would you like to delete these variables?” by Step S170, it is determined that Step S175 is YES, and the processing proceeds to Step S180 for deleting delible variables V3.
Meanwhile, when “NO” is clicked for the display, it is determined that Step S175 is NO. Therefore, Step S180 is skipped, and the unnecessary-variable deletion processing is ended. In this case, delible variables V3 are not deleted, and variable definition list 52 is maintained to be the content before the activation of the unnecessary-variable deletion processing.
When variable definition list 52 is updated by Step S180, development support device 100 outputs a message indicating that the unnecessary-variable deletion processing has ended to the user by Step S185. When the variable deletion by Step S180 is executed, a message prompting the rebuilding of the source program for reflecting variable definition list 52 after the update may be further output in Step S185.
Next, unnecessary-variable deletion processing of determining whether the unused variables are delible or indelible on the basis of information on a link setting of external apparatuses 300 and control device 200 defined in the source program is described as a second example.
First, an aspect of accessing control device 200 from external apparatuses 300 is described with reference to
A variable list 203 corresponding to variable definition list 52 is also created for control device 200 by building a source program created or edited by development support device 100. In other words, variables declared on variable definition list 52 are included in variable list 203. In the example in
In device 300A connected to control device 200 by network NW2, variables regularly read out by fixed period communication of the network are defined by a subscription setting 305A at the time of execution of the control program. In the example in
In device 300B connected to control device 200 by network NW1, a tag data link setting 305B that defines the correspondence relationship (link) between the variables to be read out from control device 200 and the variables in device 300B is created.
In the example in
It is assumed that device 300C has a protocol in common with development support device 100. Therefore, device 300C can exchange data with development support device 100 directly or via control device 200 by network NW1. For example, device 300C acquires the values of variables OPT1, OPT3 from control device 200 by accessing those variables defined in a variable mapping 305C in advance. For example, device 300C is an HMI apparatus such as a display. The values of variables OPT1, OPT3 are used for displaying on the display.
In the example in
In
On link setting list 54, the exchange of variables between control device 200 and external apparatuses 300 (devices 300A to 300C) on which subscription setting 305A, tag data link setting 305B, and variable mapping 305C described in
When source program 210s is built, a device-side link setting code 214 is generated in control program 210 in accordance with link setting list 54. Variables defined in subscription setting 305A, tag data link setting 305B, and a variable mapping 305 are set by device-side link setting code 214. As a result, at the time of execution of control program 210, the variables to be defined in subscription setting 305A, tag data link setting 305B, and variable mapping 305 are accessed from external apparatuses 300 in accordance with the content written on link setting list 54.
Therefore, in the stage of the source program, link setting list 54 can be used as one example of information for specifying variables (device usage variables V2) having a possibility of being exchanged between control device 200 and external apparatuses 300 at the time of execution of control program 210. In other words, link setting list 54 corresponds to one example of a “second list”.
The configuration in
In the second example of the unnecessary-variable deletion processing illustrated in
Here, an example in which variables OPT1 to OPT4 illustrated in
The flowchart illustrated in
In Step S131, development support device 100 acquires link setting list 54 by processing similar to that of acquisition unit 56 in
In Step S141, development support device 100 determines whether each of unused variables V1 (S120) is a variable that is not included in link setting list 54 acquired in Step S131 by Step S140. It is determined that the variables that are not included in link setting list 54 (when it is determined that S141 is YES) are delible by Step S150. Meanwhile, it is determined that the variables included in link setting list 54 (when it is determined that S141 is NO) are delible by Step S160 similar to that in
Processing of other Steps S110, S120, S170, and S180 is similar to that in
As a result, as with the first example described above, delible variables V3 delible from variable definition list 52 can also be automatically determined by excluding variables having a possibility of being used in external apparatuses 300 (control target) at the time of the execution of control program 210 by the second example of the unnecessary-variable deletion processing according to the development support device according to the present embodiment. Variable definition list 52 can be updated to a content in which automatically determined delible variables V3 are deleted.
As described above, according to the present disclosure, the influence of the deletion of the unused variables (V1) in the control program on the control target side can be reduced by extracting the unused variables (V1) in the source program and specifying the variables (V2) accessed from external apparatuses 300 (control target) at the time of execution of the control program.
The present embodiment and the modified example as described above include technical ideas as below.
A development support device (100) for supporting development of a control program (210) for a control device (200) that controls a control target (300), the development support device including:
The development support device according to configuration 1, in which each of the plurality of variables has attribute information (53) that defines whether the variable is public to a network (NW1, NW2) including the control target (300) and the control device (200),
The development support device according to configuration 1, in which the acquisition unit (56) is configured to acquire a second list (54) indicating a variable specified to be a target of exchange between the control target (300) and the control target (200) when the control program (210) is executed, as information for specifying the second variable (V2), in the state before execution of the control program.
The development support device according to configuration 3, in which
The development support device according to any one of configurations 1 to 4, in which the determination unit (57) is configured to determine that a third (V3) that does not correspond to the second variable (V2) out of the first variable (V1) is delible from the first list (52) on the basis of a result of extraction by the extraction unit (55) and the information acquired by the acquisition unit (56) in the state before execution of the control program (210).
The development support device according to configuration S, further including a variable deletion unit (59) configured to delete the third variable (V3) from the first list (52).
The development support device according to configuration 6, further including an interface unit (58) for inputting an operation of a user, in which
A development support method of a control program (210) for a control device (200) that controls a control target (300), the development support method being executed by a computer, the development support method including:
A development support program of a control program (210) for a control device (200) that controls a control target (300), the development support program causing a computer to execute
It is to be understood that the embodiment disclosed above is merely an example in all aspects and in no way intended to limit the invention. The scope of invention is not limited to the description above, and is defined by the scope of claims. All modifications made within the scope and spirit equivalent to those of the claims are intended to be included in the invention.
Number | Date | Country | Kind |
---|---|---|---|
2021-039323 | Mar 2021 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2021/034612 | 9/21/2021 | WO |