The present invention relates to a program-creation supporting device that supports creation of a program for operating a programmable logic controller (PLC), a program-creation supporting method, and a recording medium having the program recorded therein.
As one of programs for operating a PLC, there is a ladder program in which a control sequence of the PLC is defined in a ladder diagram format. The ladder diagram for showing a ladder program has two buses (a plus bus and a minus bus) that represent electric power symbolically. The two buses are arranged with a gap therebetween. A logic circuit configured by combining electric elements is arranged in a ladder shape between the two buses so as to connect the buses. The electric elements constituting the logic circuit are, for example, a relay, a coil, and the like. Each of electric elements respectively corresponds to a command. For creating such a ladder program, a program-creation supporting device is generally used. When a user sequentially inputs commands to the program-creation supporting device, the program-creation supporting device sequentially arranges the commands input from the user sequentially in the format of electric elements between the buses.
Patent Literature 1 discloses a technique that causes, when a user inputs a part of character strings, the candidates to be input corresponding to a part of the input character strings to be displayed to the user. When the user selects one character string from the displayed candidates to be input (hereinafter referred to just as “input candidates”), the character string that the user is about to input is complemented. According to this technique, the input candidates are calculated based on a part of the character strings currently input and a past input-history.
Patent Literature 2 discloses a technique that displays input candidates to a user, when the user inputs character strings in an input form. According to this technique, priority is set for each character string, and character strings are arranged and displayed as the input candidates in the order of the priority. The order of priority is automatically set according to the number of inputs of the character strings.
Patent Literature 1: Japanese Patent Application Laid-open No. 2007-299205
Patent Literature 2: Japanese Patent Application Laid-open No. 2011-187011
However, according to the technique disclosed in Patent Literature 1, there is a problem in that command candidates cannot be displayed if no character has been input. Therefore, the user has to consider a first character and input that character after conducting a research.
Furthermore, if the technique disclosed in Patent Literature 2 is applied to a program-creation supporting device, when the user inputs one command, one or more input candidates arranged in the order determined according to the number of inputs are displayed. That is, the display contents of the input candidates are created regardless of a recent input history. Therefore, it cannot be said that the technique disclosed in Patent Literature 2 is efficient as a function of supporting input of commands.
The present invention has been achieved in view of the above problems, and an object of the present invention is to provide a program-creation supporting device that can support input of commands efficiently, a program-creation supporting method, and a recording medium.
In order to solve the aforementioned problems, a program-creation supporting device that creates a program for operating a programmable logic controller (PLC) based on commands sequentially input to the PLC from a user, the program-creation supporting device is constructed to include: a command database unit that is a database for storing a first command and a second command that follows the first command in association with each other; a command storage unit that stores therein a last command input from the user; a processing unit that searches for the first command in the command database unit by using a command stored in the command storage unit as a search key, in a waiting state for waiting an input of a new command from the user, and extracts a second command corresponding to the command stored in the command storage unit; and an output unit that displays the second commands extracted by the processing unit in a list format on a display screen.
The program-creation supporting device according to the present invention estimates commands to be input next based on the last command, the input of which is completed by a user, and displays the commands to the user. Accordingly, command input can be efficiently supported.
Exemplary embodiments of a program-creation supporting device, a program-creation supporting method, and a recording medium according to the present invention will be explained below in detail with reference to the accompanying drawings. The present invention is not limited to the embodiments.
The set-value storage unit 1 stores therein identification information that specifies an execution target device of a ladder program currently being edited. In the set-value storage unit 1, the identification information is set by a user, for example, when starting creation of the ladder program. As the type of device to be programmed, for example, a conveyance/transportation device, a machining device, and a data collecting/monitoring device can be mentioned. The set-value storage unit 1 transmits a stored value to the processing unit 3 in response to a request from the processing unit 3.
The previous-command storage unit 2 stores therein one or more commands lastly input by the user, during the time in which a ladder program is created by the user through operating the program-creation supporting device 100.
The database 7 is a database that stores therein a plurality of commands that can be continuously input as one set. Each set is registered in the command database unit 7 in a format in which the input order of commands configuring the set can be specified. That is, the command database unit 7 stores therein a first command and a second command that follows the first command in association with each other. The second command can be more than 1. For example, when two commands LDI and OUT are input as commands following the first command LD, the two commands LDI and OUT can be stored as the second command. Detailed configurations of the command database unit 7 are described later.
The processing unit 3 instructs the display unit 6 to display an edit screen, on which the ladder program currently being edited by the user is displayed, on an output device 104 described later. The user can sequentially input commands while watching the edit screen. The processing unit 3 sequentially writes the commands sequentially input from the user in the ladder program being edited, and outputs the completed ladder program to a storage device 102 described later (a ladder program 106).
After the completion of input of a new command by the user, the processing unit 3 calculates candidates for the next command (command candidates) of the new command. Specifically, the processing unit 3 receives the identification information from the set-value storage unit 1, and receives one or more commands lastly input from the previous-command storage unit 2. Further, the processing unit 3 searches the command database unit 7 by using the received information as a search key, and extracts the second command corresponding to one or more commands lastly input. The processing unit 3 designates the extracted second command as a command candidate.
The number of command candidates to be calculated can be plural. The processing unit 3 can set an upper limit to the number of command candidates to be calculated. As an example, it is assumed here that the set-value storage unit 1 stores therein a set value for specifying the number of command candidates beforehand, and the processing unit 3 calculates the command candidates by using the number set by the set value as an upper limit. Note that the method for selecting the command candidates is arbitrary, in a case in which the commands exceeding the upper limit are extracted from the command database unit 7. It is assumed here that the processing unit 3 records the number of commands used for each association of commands in the database unit 7, and the command which is used more frequently is preferentially set as the command candidate. The set value is set by the user in the set-value storage unit 1.
Furthermore, at the time of completion of input of a new command, the processing unit 3 associates the new command, the input of which is completed, with one or more commands stored in the previous-command storage unit 2, and registers the commands in the command database unit 7 (to be exact, in a personal database 9 described later). The processing unit 3 updates the command stored in the previous-command storage unit 2 in accordance with the completion of input of the new command.
The command-help database unit 5 stores therein a link to a storing position of a help related to the command beforehand for each command.
The command-candidate output unit 4 and the display unit 6 function as an output unit that displays the command candidates extracted by the processing unit 3 in a list format on a display screen in cooperation with each other.
The command-candidate output unit 4 searches the command-help database unit 5 by using the respective command candidates received from the processing unit 3 as a search key, and associates the obtained link with the command candidate that has been used as a search key. The command-candidate output unit 4 transmits the command candidate associated with the link to the display unit 6.
The display unit 6 generates an image frame of the edit screen on the basis of the command from the processing unit 3. The display unit 6 also generates a list display screen to display the command candidates received from the command-candidate output unit 4 in a list format. In the list display screen, pairs of the command candidate and the link associated with the command candidate are arranged.
The command database unit 7 is constituted by a plurality of types of database (an expert database 8, a personal database 9, and a pattern database 10) according to the method by which they are created.
The expert database 8 is a database in which a history of commands input by a specific expert is accumulated. Specifically, the expert database 8 stores therein a command input by an expert and one or more commands input by the expert immediately before the command in association with each other. The expert database 8 is created beforehand and is provided in the command database unit 7.
The personal database 9 is for accumulating an input history of commands by the user. The personal database 9 is configured by registering a first command and a second command in association with each other, designating a command input by the user as the second command and one or more commands input by the user immediately before the command as the first command. A specific realizing method of the association includes a method of preparing a table having columns such as “first command”, “second command”, and “frequency” and accumulating the input history therein by using a DB (database). As for an image of the database table, refer to the lower left table in
The pattern database 10 is a database that accumulates input orders in which a grammatical pattern of ladder programming is determined beforehand. Specifically, the pattern database 10 stores therein information of a command definitely described after a certain command. The pattern database 10 is created beforehand, and is provided in the command database unit 7.
The expert database 8, the personal database 9, and the pattern database 10 are provided in the command database unit 7 for each type of device to be programmed. For example, in
The storage device 102 is constituted by a non-volatile memory, a volatile memory, an external storage device, or a combination thereof. The storage device 102 is a recording medium having a program-creation supporting program 105 recorded therein. The storage device 102 functions as an output destination of the ladder program 106 created by the program-creation supporting device 100.
The computing device 101 is, for example, a CPU (Central Processing Unit). The computing device 101 functions as the processing unit 3, the command-candidate output unit 4, and the display unit 6 by executing the program-creation supporting program 105 stored in the storage device 102. The set-value storage unit 1, the previous-command storage unit 2, the command-help database unit 5, and the command database unit 7 are realized by securing the corresponding areas respectively in the storage device 102.
The input device 103 is an input unit for receiving operations with respect to the program-creation supporting device 100 or inputs for creating the ladder program 106 stored in the storage device 102, and is constituted by, for example, a keyboard. The output device 104 is a display unit that displays output information with respect to a user based on an image frame generated by the display unit 6, and for example, is a liquid crystal display. The input device 103 and the output device 104 can be constituted by a touch panel device.
As a recording medium storing therein the program-creation supporting program 105 beforehand, an arbitrary medium can be adopted as long as it is a tangible medium, which is not temporary. For example, as the recording medium storing therein the program-creation supporting program 105 beforehand, a non-volatile memory, an external storage device, a detachable non-volatile memory, a CD-ROM, or a DVD-ROM can be adopted.
Operations of the program-creation supporting device 100 are explained next. To simplify explanations of the operations, it is assumed that the previous-command storage unit 2 stores therein only one command, and one first command is associated with each of the second commands and registered in the various databases (the expert database 8, the personal database 9, and the pattern database 10).
If there is a command input (YES at Step S101), the processing unit 3 receives identification information from the set-value storage unit 1 (Step S102), and receives a lastly input command from the previous-command storage unit 2 (Step S103). The processing unit 3 registers a newly input command in association with the command received in Step S103 in the personal database 9 (Step S104). When an entry same as an entry to be registered in the process at Step S104 has been already registered, the processing unit 3 increments the count value related to the already registered entry by 1, and does not execute registration of a new entry. When an entry same as an entry to be registered has not been registered, the processing unit 3 registers a new entry, and sets the count value related to the new entry to 1. The database to which the new entry is to be registered in the process in Step S104 is a personal database 9 that is included in the database related to the device type specified by the identification information received in Step S102 among the databases for respective device types constituting the database unit 7.
Subsequent to the process in Step S104, the processing unit 3 overwrites the storage content of the previous-command storage unit 2 by the newly input command (Step S105), to finish the operation.
As shown in
Then, the processing unit 3 searches the databases 8 to 10 by using the command obtained by performing the process in Step S202 as a search key to calculate the command candidates (Step S203). Specifically, the processing unit 3 searches for an entry in which the command obtained by performing the process in Step S202 has been registered in the databases 8 to 10 as the first command. The processing unit 3 sets the command registered as the second command in the entry obtained by the search as a command candidate.
If the commands exceeding the set value have been obtained from the expert database 8, the processing unit 3 selects command candidates from the obtained commands by using an arbitrary method. The processing unit 3 performs the same process when the commands exceeding the set value have been obtained from the pattern database 10. When the commands exceeding the set value have been obtained from the personal database 9, the processing unit 3 selects command candidates by giving priority to a value having a larger count value.
The processing unit 3 sets, as a search target, the database related to the device type specified by the identification information obtained by performing the process in Step S102 among the databases for respective device types constituting the database unit 7.
Subsequently, the command-candidate output unit 4 receives the command candidates calculated by the processing unit 3 (Step S204). The command-candidate output unit 4 searches the command-help database unit 5 by using the received command candidates as a search key to obtain a link for each command candidate (Step S205). The command-candidate output unit 4 transmits a list of the obtained command candidates in association with the link and each command candidate to the display unit 6, and causes the output device 104 to display the list on the list display screen (Step S206) to finish the operation.
A link button with which a link is associated inside is displayed in the field 303. When a user presses the corresponding link button by a mouse, a link corresponding to the pressed link button is read out. Then, help is read from the address indicated by the read-out link, and the read-out help is displayed on the display screen. When the user selects one from the five command candidates displayed on the list display screen 300, the processing unit 3 can receive the selected command as a new input.
The list display screen 300 can be displayed on the edit screen 200 so as to overlap on the edit screen 200, or can be displayed as a window different from the edit screen 200.
According to the embodiment of the present invention, the program-creation supporting device 100 is configured to store the first command and the second command following the first command in association with the each other in the command database unit 7, store a lastly input command from a user in the previous-command storage unit 2, search for the first command in the command database unit 7 by using the command stored in the previous-command storage unit 2 as a search key, in a state for waiting for an input of a new command from the user, to extract a second command corresponding to the command stored in the previous-command storage unit 2, and to display the extracted second commands in a list format on the display screen. Accordingly, the program-creation supporting device 100 can present the command candidates to the user without requiring an input of a part of character strings constituting the command. Furthermore, the command to be input next is estimated based on the last command, the input of which has been finished by the user, and is displayed to the user. Accordingly, an accurate command candidate can be presented to the user as compared with a method of presenting the candidates simply based on the number of inputs without taking into consideration whether it is the latest input. That is, according to the embodiment of the present invention, command input can be efficiently supported.
The program-creation supporting device 100 further includes the personal database 9 in which the entries are added sequentially based on an input history of the user. Therefore, a command already used by the user is presented automatically, thereby enabling to reduce time and effort for searching and shorten the time for programming.
Because the program-creation supporting device 100 further includes an expert database 8 created beforehand based on an input history of a predetermined user (an expert), even a beginner for programming can easily use a command used by the expert as a reference, to create a program having higher quality.
The program-creation supporting device 100 further includes a pattern database 10 created beforehand based on a grammatical pattern, thereby enabling to prevent a user from forgetting to describe the command, the grammatical pattern of which is determined beforehand.
The program-creation supporting device 100 can cause the user to select a command candidate from various options by presenting the command candidates to the user from each of the three databases of the expert database 8, the personal database 9, and the pattern database 10, respectively, and thus a program having high quality can be created depending on a situation.
The program-creation supporting device 100 is configured such that the user can set the number of command candidates to be calculated and displayed, respectively, regarding the expert database 8, the personal database 9, and the pattern database 10 in the set-value storage unit 1. Therefore, for a beginner, many command candidates can be presented from the expert database 8 such that the beginner can check what kind of commands the expert uses. The expert feels troublesome if a command described by others is presented, and thus it can be set such that no command candidate is presented from the expert database 8 to the expert. That is, the command candidates according to each user can be presented.
The program-creation supporting device 100 records the number of use in the personal database 9 for each entry. If the number of extracted second commands exceeds the number of a set upper limit, the program-creation supporting device 100 sets a command related to the entry having a higher use frequency as a command candidate preferentially. Because the program-creation supporting device 100 automatically presents commands described by the user frequently, the user can perform programming efficiently.
The program-creation supporting device 100 further includes database for each type of device to be programmed. Accordingly, even if a device to be programmed is changed, the command candidate corresponding to the control of the device can be selected with less trouble, thereby enabling to reduce the man-hours for programming.
The program-creation supporting device 100 displays the command candidates in a list format in association with a help for each command candidate. Accordingly, the user can refer to the help for each command candidate.
As described above, the program-creation supporting device, the program-creation supporting method, and the recording medium according to the present invention are preferably applicable to a program-creation supporting device that supports creation of a program for operating a PLC, a program-creation supporting method, and a recording medium having a program recorded therein.
1 set-value storage unit, 2 previous-command storage unit, 3 processing unit, 4 command-candidate output unit, 5 command-help database unit, 6 display unit, command database unit, 7A to 7D database, 8 expert database, 9 personal database, 10 pattern database, 100 program-creation supporting device, 101 computing device, 102 storage device, 103 input device, 104 output device, 105 program-creation supporting program, 106 ladder program, 200 edit screen, 300 list display screen, 301, 302, 303 field.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2012/080301 | 11/22/2012 | WO | 00 |