The present invention relates to a development support device that supports a user to write a program executed by a controller.
Conventionally, there is known a development support device for supporting development of a control system using an industrial controller such as a programmable controller (programmable logic controller, abbreviated to “PLC” hereinafter). For example, Patent Literature 1 described below discloses a development support device including a variable table showing a variable name, an internal memory address, and an I/O comment.
However, the development support device of the related art described above has a problem of low convenience, since the user needs to perform a plurality of user operations to check a comment on a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node”. For example, a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node” is an “array element of an array type variable” which can be denoted as a child node in a tree data structure having the array type variable as a parent node. In addition, a “member of a structure type variable” which can be denoted as a child node in a tree data structure having the structure type variable as a parent node is also an example of a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node”. Hereinafter, with reference to
However, no comment on each array element [0], [1], or [2] of the array type variable named “startCondition” is displayed on the “variable table screen”. Similarly, no comment on each array element [0], [1], or [2] of the array type variable named “errorStatus” is displayed on the “variable table screen”.
As illustrated in
Similarly, when the user tries to check comments on the respective array elements of the “errorStatus” variable, the user has to press a soft button of a comment column of the “errorStatus” variable to display a “comment setting” dialog for the respective array elements of the “errorStatus” variable.
As described above, the development support device in the related art is not capable of displaying a comment on a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node”, such as an array 0 element of an array type variable and a member of a structure type variable, to a user in a table form. For example, the development support device in the related art is not capable of displaying comments on respective array elements of “startCondition” which is an array type variable and comments on respective array elements of “errorStatus” which is an array type variable, to a user in a table form. Hence, when the user tries to check or edit a comment on a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node”, the development support device in the related art has problems of low user convenience and low operability.
According to an aspect of the present invention, the present invention is made with consideration for the problems, and an object thereof is to realize a development support device or the like that enables a user to easily check and easily edit a comment on a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node”, such as an array element of an array type variable and a member of a structure type variable.
In order to solve the above-described problems, a development support device according to an aspect of the present invention supports a user to write a program executed by a controller and includes: an operation receiving unit that receives a user operation indicating an instruction to perform an external output of comments on variables used in the program, the comments being optionally attachable together with definitions of the variables by the user; and an output unit that outputs a comment on each of a plurality of second variables of the variables as a data format file which is editable in at least one of a text editor and spreadsheet software, the second variables being denotable as a descendant node in a tree data structure having a first variable as an ancestor node, by associating the comment with a name of the first variable and discrimination information for individually discriminating between the plurality of second variables with respect to the first variable, when the operation receiving unit receives the user operation.
In order to solve the above-described problems, there is provided a control method according to one aspect of the present invention controls a development support device that supports a user to write a program executed by a controller, the control method including: an operation receiving step of receiving a user operation indicating an instruction to perform an external output of comments on variables used in the program, the comments being optionally attachable together with definitions of the variables by a user; and an outputting step of outputting a comment on each of a plurality of second variables of the variables as a data format file which is editable in at least one of a text editor and spreadsheet software, the second variables being denotable as a descendant node in a tree data structure having a first variable as an ancestor node, by associating the comment with a name of the first variable and discrimination information for individually discriminating between the plurality of second variables with respect to the first variable, when the user operation is received in the operation receiving step.
According to an aspect of the present invention, a development support device achieves effects of enabling a user to easily check and easily edit a comment on a “variable which can be denoted as a descendant node in a tree data structure having a certain variable as an ancestor node”, such as an array element of an array type variable and a member of a structure type variable.
Hereinafter, an embodiment (hereinafter, referred to as “the embodiment”) according to an aspect of the present invention will be described based on
When a plurality of PLCs 20 are connected to each other via the field network 60, any one of the PLCs 20 functions as the master device, and the rest of the PLCs 20 function as slave devices, in some cases. In addition, another controller different from both the PLC 20 and the slave device 40 may function as the master device. That is, the “master device” and the “slave device” are defined focusing on a control function of data transfer via the field network 60, and thus there is no particular limitation to a type of information which is transmitted and received between the devices.
The PLC 20 entirely controls the control system 1. Specifically, the PLC 20 acquires information as input data from a device 50 which is an input instrument such as a sensor, via the slave device 40. The PLC 20 executes arithmetic processing by using acquired input data, in accordance with a user program installed in advance. The PLC 20 executes the arithmetic processing to determine control details which are to be transmitted to the device 50 which is an output device such as an actuator and output control data corresponding to the control details via the slave device 40 to the device 50.
Examples of the field network 60 include EtherCAT (registered trademark), PROFINET (registered trademark), MECHATROLINK (registered trademark)-III, Powerlink, SERCOS (registered trademark)-III, and CIP Motion via which various types of data that are received by the PLC 20 or transmitted by the PLC 20 are transferred. In addition, examples of the field network 60 may include EtherNet/IP (registered trademark), DeviceNet, CompoNet (registered trademark), and the like. Note that, the control system 1 will be described, hereinafter, in which data is transmitted and received between the PLC 20 and the slave device 40 or between a plurality of slave devices 40, by causing sequential transfer of data frames via the field network 60.
The slave device 40 is a slave device in a network (field network 60) where the PLC 20 is the master device, and the slave device is a device communication managing unit such as a communication coupler which manages communication with the device 50, for example. The slave device 40 may be a servo driver which is directly connected to the field network 60. For example, the device 50 is an input instrument such as a sensor or is an output instrument such as an actuator. One or more devices 50 are connected to the slave device 40 via communication cables.
The development support device 10 is connected to the PLC 20 via a communication cable which is a universal serial bus (USB) cable, for example. The development support device 10 is an information processing device for generating a user program which is executed by the PLC 20, various types of setting information with respect to the control system 1, or the like.
For example, the development support device 10 provides a development environment of the PLC 20 and provides an environment for a user to write (write⋅edit) a program such as a user program depending on a control purpose (for example, target line and process). The user writes program codes of a control program (user program) which is executed by the PLC 20, by using a development environment (programming tool) provided by the development support device 10. The development support device 10 may have a debug function and a simulation function in order to support a user to write⋅edit a control program executed by the PLC 20.
In addition, the development support device 10 may calculate and set a timing of acquiring (input refresh) a status value by the PLC 20 and a timing of updating (output refresh) an output value by the PLC 20, for example. The development support device 10 may monitor an operation status of the PLC 20, values of various types of data, or the like.
In other words, the development support device 10 may be a device that provides an integrated development environment supporting a 3D motion simulation, as well as programming of the PLC 20, configuration (configuration setting), debug, maintenance, and monitoring functions. In addition, the development support device 10 may set and adjust various types of parameters for the slave device 40.
The development support device 10 is configured of a general-purpose computer, typically. For example, an information processing program executed by the development support device 10 may be stored in a compact disk-read only memory (CD-ROM) (not illustrated) to be distributed. The program stored in the CD-ROM is read by a CD-ROM driving device (not illustrated)) and is stored in a hard disk or the like of the development support device 10. Otherwise, the development support device 10 may be configured to download the same program as the program stored in the DVD-ROM, from a higher host computer or the like via a network.
As illustrated in
The HMI 30 includes a display unit, an operation unit, a communication unit which communicates with the PLC 20, and a control unit that controls the units. The HMI 30 can change various types of settings of the control system 1 (for example, PLC 20) in response to a user operation through the operation unit. In addition, the display unit of the HMI 30 displays predetermined information on the control system 1.
Examples of a program that a user writes and edits using a development environment provided by the development support device 10 include a user program, a motion computing program, a sequence instruction computing program, and the like. The “user program” is written depending on a control target (for example, target line and process) of a user. The development support device 10 generates a user program by compiling a ladder program (source program) written in ladder logic (ladder language) or the like. The ladder logic is an approach to describing a logic circuit and is a programming language widely employed in most PLCs. For example, the user program is generated in an object program format which is executable by a microprocessor installed in the PLC 20. The “motion computing program” is a program that is executed in response to an instruction issued by a user program and calculates a command value that is output for a motor driver such as a servo motor driver and a pulse motor driver whenever execution thereof is performed. The “sequence instruction computing program” is called when a predetermined sequence instruction used in the user program is executed, and the sequence instruction computing program is executed to realize contents of the instruction.
The development support device 10 outputs comments set by a user on respective elements (element variables or second variables) of a certain variable (first variable), as a data format file (output list L1 described later) which is editable in at least one of a text editor and spreadsheet software. For example, the respective elements of the variable are respective array elements (respective array members) of an array type variable or respective structure members of a structure type variable.
For example, when a user designates a variable, the development support device 10 outputs comments on respective elements of the variable, as a data format file which is editable in spreadsheet software, such as a Microsoft (registered trademark) Excel (registered trademark) file.
Consequently, the user can easily check contents of the output list L1 or easily edit (update) the contents of the output list L1, using the spreadsheet software such as Excel (registered trademark). The user can enjoy high browsability and operability of the spreadsheet software such as Excel (registered trademark) and can browse and edit the comments attached to the respective elements of the variable.
In addition, the user can copy and paste the output list L1 output by the development support device 10 to generate one or more lists L1(1), L1(2), L1(3), to L1(n) (“n” is a “natural number of 1 or larger”). The user can write and manage comments on respective elements of a variable in each of a plurality of languages for each of a plurality of lists L1(1), L1(2), L1(3), to L1(n), by writing the comments on the respective elements of the variable in each of the plurality of languages.
For example, regarding an array type variable v1 designated by the user, the development support device 10 outputs comments on respective array elements of the array type variable v1, in a data format output list L1(v1) which is editable in at least one of a text editor and spreadsheet software. the user copies and pastes the output list L1 (v1) to generate lists L1(v1)(1), L1(v1)(2), L1(v1)(3), to L1(v1)(n). For example, the user writes the comments on the respective array elements of the array type variable v1 in the list L1(v1)(1) in English. For example, the user writes the comments on the respective array elements of the array type variable v1 in the list L1(v1)(2) in Japanese. For example, the user writes the comments on the respective array elements of the array type variable v1 in the list L1(v1)(3) in Chinese. For example, the user writes the comments on the respective array elements of the array type variable v1 in the list L1(v1)(n) in Spanish.
Consequently, the development support device 10 allows “a user to prepare comments on respective elements (element variables or second variables) of a certain variable (first variable) in each of a plurality of languages”. In addition, a user can easily manage a plurality of comments (for example, the above-described lists L1(v1)(1), L1(v1)(2), L1(v1)(3), to L1(v1)(n)) which are each written in a plurality of languages.
In addition, the development support device 10 can import a file (input lists L2 described later) edited by a user using the spreadsheet software such as Excel (registered trademark). For example, the development support device 10 imports the output lists L1 updated by a user as the input lists L2. The development support device 10 updates comments on respective elements which are stored in a storage unit of the device, with comments attached to the respective elements (for example, respective array elements or respective structure members) of a variable (for example, array type variable or structure type variable) in the input lists L2. Besides, the development support device 10 displays the comments (comments updated according to the updated output lists L1) attached to the respective array elements such that the user can find meanings of the respective array elements of the array type variable, at a location where the array type variable is used in a program, for example.
Consequently, regarding the comments displayed by the development support device 10, the user can easily switch between languages in which the comments are written, for example, by switching between the input lists L2 which are imported into the development support device 10. The user causes the development support device 10 to import the list L1(2) in which the comments are written in Japanese, instead of the list L1(1) in which the comments are written in English, and thereby the comments written in English can be switched to the comments written in Japanese.
When a plurality of lists L1(1) to L1(n) in which comments are written in a plurality of languages are prepared in advance, a user can switch between written languages of comments which are displayed by the development support device 10, only by switching between lists which are imported into the development support device 10.
The output list L1 output by the development support device 10 does not need to be a file which is editable by Excel (registered trademark), and the development support device 10 outputs the data format output list L1 suitable for being edited and used by an external device or software.
In the following description, a “variable which can be denoted as a descendant node in a tree data structure (tree) having a certain variable as an ancestor node”, such as a variable which is an array element or a structure member, may be referred to as an “element variable (second variable)”.
Similarly, a comment on a “variable which can be denoted as a descendant node in a tree having a certain variable as an ancestor node” may be referred to as an “element comment”. That is, the comment on the “element variable” may be referred to as the “element comment” and is distinguished from a “comment” which is a comment on a “variable other than the element variable”. For example, the “element comment” is a comment which can be set on an array element or a structure member, when a type of certain variable is at least one of an array type and a structure type in variable declaration that is used in a program development environment provided by the development support device 10. That is, the “element comment” is a comment on a variable (element variable or second variable) which can be denoted as a descendant node of a tree having a certain variable (first variable) as an ancestor node.
The “variable table screen” is an editing screen on which a variable used in a program is described in a table form, and a variable name, a data type of variable, a comment, or the like of the variable can be checked and edited (updated) thereon.
As described above, the outline of the control system 1 is described with reference to
That is, the development support device 10 is a development support device that supports a user to write a program executed by the PLC 20 (controller). The development support device 10 includes an operation receiving unit 110 (particularly, output instruction receiving section 111) that receives a user operation indicating an instruction to perform an external output of comments on variables used in the program, the comments being optionally attachable by a user together with definitions of the variables, and an output unit 120 that outputs an element comment (comment) on each of a plurality of element variables (second variables) of the variables as a data format file (output list L1) which is editable in at least one of a text editor and spreadsheet software, the element variables being denotable as a descendant node in a tree data structure (tree) having a first variable as an ancestor node, by associating the comment with a name of the first variable and discrimination information for individually discriminating between the plurality of second variables with respect to the first variable, when the operation receiving unit 110 receives the user operation.
According to this configuration, the development support device 10 outputs an element comment on each of the plurality of second variables as a data format file which is editable in at least one of the text editor and the spreadsheet software, by associating the element comment with the name of the first variable and the discrimination information.
Consequently, the development support device 10 achieves an effect of enabling a list of element comments on the plurality of respective second variables to be output in a form which is easily checked and easily edited by a user. In other words, the development support device 10 achieves an effect of enabling a user to easily check and easily edit the element comments on the plurality of respective second variables.
In addition, the development support device 10 outputs the element comments as a data format file which is editable by a user in spreadsheet software or the like, thus, achieving an effect of enabling the user to write and manage the element comments in each of a plurality of languages using the file. For example, the user can copy and paste the output list L1 output by the development support device 10 to generate a plurality of lists L1(1) to L1(n) and can write and manage the element comments in each of the plurality of languages for each of the plurality of lists L1(1) to L1(n). That is, the development support device 10 achieves an effect of enabling a user to easily generate and easily manage the element comments written in each of the plurality of languages on the plurality of respective second variables.
In the development support device 10, the first variable may be an array type variable or a structure type variable, and each of the plurality of second variables may be an array element of the array type variable or a member of the structure type variable.
According to this configuration, the development support device 10 outputs the element comment on each of the plurality of second variables which are array elements of the array type variable or members of the structure type variable, by associating the element comment with the discrimination information and the name of the first variable which is the array type variable or the structure type variable.
Consequently, the development support device 10 achieves an effect of enabling a list of element comments on the plurality of respective second variables which are the array elements of the array type variable or the members of the structure type variable to be output in a form which is easily checked and easily edited by a user.
In the development support device 10, the output unit 120 may output the element comment on each of the plurality of second variables by associating the element comment with one character string containing the name of the first variable and the discrimination information.
According to this configuration, the development support device 10 outputs the element comment on each of the plurality of second variables as a data format file which is editable in the spreadsheet software or the like, by associating the element comment with one character string containing the name of the first variable and the discrimination information. For example, the development support device 10 outputs a list showing (A) the one character string containing the name of the first variable and the discrimination information and (B) the element comment, in a data format which is editable in the spreadsheet software or the like.
Specifically, the development support device 10 outputs the element comment on each of the plurality of second variables as a data format file which is editable in the spreadsheet software for example, by associating the element comment with one character string containing the name of the first variable and the discrimination information. In this case, the one character string containing the name of the first variable and the discrimination information is stored in one cell, and the element comment on each of the plurality of second variables is also stored in one cell. Hence, a user can check, at a glance, a relationship between the element comment on each of the plurality of second variables, the second variable to which the element comment is attached, and the first variable which is an ancestor node of the second variable. For example, the user is able to check, at a glance, the list formed by associating the one character string containing the name of the first variable and the discrimination information with one character string indicating the element comment in contiguous columns.
Consequently, the development support device 10 has an effect of enabling a list of element comments on the plurality of respective second variables to be output in a form which is very highly recognizable and easily edited by a user.
In the development support device 10, the discrimination information contains path information indicating a path from the first variable to each of the plurality of second variables in the tree data structure. The path information provides each of one or more parent-child relationships from the first variable to each of the plurality of second variables in the tree data structure, in accordance with the following rules. That is, the path information indicates (1) a parent-child relationship using brackets ([ ]), when a variable corresponding to a parent node is an array type variable and a variable corresponding to a child node is an array element of the array type variable, in the parent-child relationship. In addition, the path information indicates (2) a parent-child relationship using a period (.), when a variable corresponding to a parent node is a structure type variable and a variable corresponding to a child node is a member of the structure type variable, in the parent-child relationship. Path information of a certain element variable is “information for identifying a descendant node corresponding to the certain element variable in a tree having the certain element variable as the descendant node” and contains “information indicating a hierarchy of the descendant node corresponding to the certain element variable in the tree”.
According to this configuration, the development support device 10 outputs the element comment on each of the plurality of second variables by associating the element comment with the discrimination information containing the path information and the name of the first variable. Besides, regarding each of one or more parent-child relationships from the first variable to each of the plurality of second variables, the path information distinguishes whether a parent and a child are an array type variable and an array element of the array type variable, respectively, or whether the parent and the child are a structure type variable and a member of the structure type variable, respectively.
Consequently, the development support device 10 achieves an effect of enabling the file to be output in a state where a user can check a relationship between the first variable and the plurality of second variables. For example, the development support device 10 achieves an effect of enabling the file to be output in a state where a user can distinguish between whether the second variables are array elements of the first variable which is the array type variable, whether the second variables are structure members of the first variable which is the structure type variable, whether the second variables are structure members of a predetermined structure type variable of the first variable which is an array type variable (structure type array) in which each of a plurality of structure type variables is an array element, and the like.
As described above, the outline of the development support device 10 is provided. Next, a configuration thereof will be described in detail with reference to
(Major Difference from Development Support Device in the Related Art)
As described with reference to
Specifically, a user who tries to perform checking or the like of a comment on a “variable which can be denoted as a descendant node in a tree having a certain variable as an ancestor node” needs to select a variable corresponding to the ancestor node (for example, parent node) and then open a dialog of an element comment.
On the other hand, the development support device 10 outputs element comments on a plurality of respective element variables in a table-form list, particularly, in a data format table-form list (output list L1) which is editable in spreadsheet software or the like.
For example, regarding the respective array elements of the array type variable, the user can easily check element comments indicating meaning or the like attached to the respective array elements, by using the output list L1 output by the development support device 10. In addition, the user can write element comments in each of a plurality of languages for each of a plurality of lists L1(1) to L1(n) generated by copying and pasting the output list L1 output by the development support device 10, for example. The user can prepare a plurality of lists L1(1) to L1(n) in which element comments are written in each of a plurality of languages in advance, thereby, easily switching written languages of element comments which are displayed by the development support device 10, only by switching between lists which are imported into the development support device 10.
(Detailed Configuration of Development Support Device)
The development support device 10 may further include a programming support unit or the like (not illustrated) which provides an environment for programming a user program as a control program that is executed in the PLC 20 by a user depending on a control purpose, in addition to the above-described functional block. However, in order to secure conciseness of description, a configuration which is not directly related to the embodiment is omitted from the following description and the block diagram. However, the development support device 10 may include the omitted configuration according to an actual circumstance.
The operation receiving unit 110, the output unit 120, the input unit 140, and the comment updating unit 150 can be realized when a central processing unit (CPU) or the like reads and executes a program in a random-access memory (RAM) (not illustrated) or the like, the program being stored in a storage device (storage unit 130) realized by a read only memory (ROM), a non-volatile random-access memory (NVRAM), or the like. Hereinafter, the operation receiving unit 110, the output unit 120, the input unit 140, and the comment updating unit 150 will be each described.
The operation receiving unit 110 receives a user operation indicating an instruction to execute an outputting process (exporting process) of the output list L1 or a user operation indicating an instruction to execute an inputting process (importing process) of the input list L2. The operation receiving unit 110 includes the output instruction receiving section 111 and an input instruction receiving section 112.
The output instruction receiving section 111 receives the user operation indicating the instruction to execute the exporting process and informs the output unit 120 of the received user operation. The input instruction receiving section 112 receives the user operation indicating the instruction to execute the importing process and informs the input unit 140 of the received user operation.
The output unit 120 outputs a table-form list (output list L1) of comments (element comments) on “variables (element variables) which can be denoted as a descendant node of a tree having the first variable as an ancestor node”, in response to the user operation received by the output instruction receiving section 111.
For example, regarding the first variable designated by the user operation, the output unit 120 identifies a plurality of element variables (second variables) “which can be denoted as a descendant node in a tree having the first variable as an ancestor node”, with reference to a second variable definition table 131B. In addition, the output unit 120 acquires element comments on the plurality of respective identified element variables, with reference to the second variable definition table 131B. The output unit 120 outputs the element comments on the plurality of respective identified element variables in the data format output list L1 which is editable in spreadsheet software or the like, by associating the element comments with discrimination information for “individually discriminating between the plurality of identified element variables with respect to the first variable”. In particular, the output unit 120 outputs the element comments on the plurality of respective element variables in the output list L1, by associating the element comments with the “name of the first variable” and the “discrimination information of the plurality of respective element variables”. The output unit 120 includes a first acquisition section 121, a second acquisition section 122, a third acquisition section 123, and a character string generating section 124.
The first acquisition section 121 identifies the name of the first variable selected by a user in the “user operation received by the output instruction receiving section 111”. The first acquisition section 121 may identify the name of the first variable selected by a user, with reference to a first variable definition table 131A or the second variable definition table 131B.
For example, the second acquisition section 122 individually identifies the plurality of element variables corresponding to the descendant nodes of the tree having the first variable as the ancestor node, by following the tree having the first variable as the ancestor node with reference to the second variable definition table 131B.
The second acquisition section 122 generates discrimination information for individually discriminating between the plurality of identified element variables with respect to the first variable, particularly, generates discrimination information containing path information for each of the plurality of identified element variables, with reference to the second variable definition table 131B. The second acquisition section 122 generates “discrimination information for individually discriminating between a plurality of descendant nodes (that is, a plurality of descendant nodes corresponding to the plurality of respective element variables) in the tree having the first variable as an ancestor node”, as the discrimination information of the plurality of respective element variables.
The path information is “information indicating paths (one or more parent-child relationships) from the first variable to the plurality of individual element variables in the tree having the first variable as the ancestor node”. In other words, the path information is information indicating one or more parent-child relationships which are present from “the first variable which is the ancestor node” to “the plurality of individual element variables which are the descendant nodes” in “the tree having the first variable as the ancestor node”. The path information corresponds to “information indicating instances of descendant nodes corresponding to the respective element variables in the tree having the first variable as the ancestor node”.
The second acquisition section 122 shows a parent-child relationship (relationship between a variable corresponding to a parent node and a variable corresponding to a child node) in discrimination information (particularly, path information), in accordance with the following rules, for example. That is, when a variable corresponding to a parent node is an array type variable, and a variable corresponding to a child node is an array element of the array type variable, the second acquisition section 122 provides the parent-child relationship using brackets ([ ]). In addition, when a variable corresponding to a parent node is a structure type variable, and a variable corresponding to a child node is a member of the structure type variable, the second acquisition section 122 provides the parent-child relationship using a period (.).
In addition, the third acquisition section 123 acquires element comments on the plurality of respective element variables identified by the second acquisition section 122 with reference to the second variable definition table 131B.
The character string generating section 124 generates the following character string for each of the plurality of element variables identified by the second acquisition section 122. That is, the character string generating section 124 generates one character string containing the name of the first variable identified by the first acquisition section 121 and “the discrimination information (containing path information for each of the plurality of element variables) for each of the plurality of element variables” generated by the second acquisition section 122. The one character string generated by the character string generating section 124 for each of the plurality of element variables is referred to as a “comment name”.
The output unit 120 outputs “the element comments for the plurality of respective element variables” acquired by the third acquisition section 123, in the output list L1 which is editable in at least one of a text editor and spreadsheet software, by associating the element comments with the comment names of the plurality of respective element variables.
The input unit 140 takes in the input list L2 in response to the user operation (instruction to execute an importing process) received by the operation receiving unit 110. The input list L2 is a table-form list of element comments on “element variables which can be denoted as descendant nodes of a tree having a certain first variable as an ancestor node” and is the output list L1 having contents updated by a user.
The comment updating unit 150 updates element comments in the second variable definition table 131B of the storage unit 130, according to contents of the input list L2 taken in by the input unit 140. The comment updating unit 150 includes a character string analyzing section 151, a first identification section 152, a second identification section 153, and a third identification section 154.
The character string analyzing section 151 extracts a name of a first variable from the comment name of the input list L2 taken in by the input unit 140 and informs the first identification section 152 of the extracted name of the first variable. The first identification section 152 identifies the first variable from “the name of the first variable” extracted from the comment name of the input list L2. The first identification section 152 informs the second identification section 153 of the identified first variable.
The second identification section 153 acquires a “node instance” corresponding to “the comment name” of the input list L2, with reference to map information 132. Besides, the second identification section 153 identifies an element variable having an element comment stored in the input list L2, from the first variable identified by the first identification section 152 and “the node instance” acquired with reference to the map information 132.
Here, a naming rule of “the respective comment names” in the input list L2 is the same as the naming rule of “the comment names” in the output list L1. Consequently, the second identification section 153 may directly acquire discrimination information for discriminating between element variables having element comments stored in the input list L2, in the tree having the first variable as the ancestor node, from “the comment name” of the input list L2 without referring to the map information 132. In other words, the second identification section 153 may extract “discrimination information of an element variable having an element comment stored in the input list L2” from “the comment name” of the input list L2, the discrimination information containing “path information of the element variable having an element comment stored in the input list L2”.
The third identification section 154 acquires an “element comment associated with the comment name in the input list L2”, from the input list L2 taken in by the input unit 140. In other words, from the input list L2, the third identification section 154 acquires an “element comment in the input list L2” on an “element variable which is uniquely identified by the comment name of the input list L2”.
The comment updating unit 150 updates the element comment on the element variable identified by the second identification section 153 in the second variable definition table 131B with the element comment acquired by the third identification section 154 from the input list L2.
The storage unit 130 is a storage device that stores various types of data which are used by the development support device 10. Moreover, the storage unit 130 may non-transitorily store (1) a control program, (2) an OS program, and (3) an application program for executing various types of functions of the development support device 10, which are executed by the development support device 10, and (4) various types of data which are read out when the corresponding application program is executed. The data of (1) to (4) is stored in, for example, a non-volatile storage device such as a read-only memory (ROM), a flash memory, an erasable programmable ROM (EPROM), an electrically EPROM (EEPROM (registered trademark)), or a hard disk drive (HDD). The development support device 10 may include a temporary storage unit (not illustrated). The temporary storage unit is a so-called working memory that temporarily stores data which is used in computation, a computation result, or the like during various types of processes which are executed by the development support device 10, and the temporary storage unit is configured of a volatile storage device such as a random-access memory (RAM). A storage device which stores a certain type of data is appropriately determined regarding an intended use of the PLC 20, convenience, costs, a physical constraint, or the like. The storage unit 130 further stores the variable definition tables 131 and the map information 132.
The variable definition table 131 includes the first variable definition table 131A in which a comment or the like of a variable other than the element variables is stored and the second variable definition table 131B in which an element comment or the like of an element variable is stored.
A set of “a variable name, a data type, a comment”, and the like of the variable (for example, first variable) other than the element variables is stored in the first variable definition table 131A. In the first variable definition table 131A, a set of “a variable name, a data type, a comment”, or the like of each of “variables other than the plurality of element variables” is stored in a table form as attributes of each of the “variables other than the plurality of element variables”. The first variable definition table 131A will be described in detail with reference to
A name of a variable (first variable) corresponding to an ancestor node of a tree having a plurality of respective element variables as descendant nodes, a hierarchical structure of the tree, element comments, or the like for each of the plurality of element variables are stored in the second variable definition table 131B. In the second variable definition table 131B, relationships between a first variable and a plurality of respective element variables, discrimination information for individually discriminating between the plurality of element variables with respect to the first variable, instances of descendant nodes corresponding to the plurality of respective element variables in the tree, or the like may be stored. The second variable definition table 131B will be described in detail with reference to (A) of
The map information 132 is information associated with contents of the respective “comment names” in the input list L2 and “information indicating instances (node instances) of the plurality of respective element variables”, and the map information 132 will be described in detail with reference to
The respective “comment names” in the input list L2, that is, “the comment names in the input list L2” of the respective element variables indicate a name of a first variable of the respective element variables and discrimination information (containing path information) of the respective element variables.
“The information indicating instances of descendant nodes of element variables” is information indicating “respective instances of a plurality of descendant nodes corresponding to the plurality of respective element variables in the tree having the first variable as the ancestor node”. The second identification section 153 can find a relationship of a certain element variable with the first variable, by using the information indicating an instance of the certain element variable, thus, identifying the certain element variable in the second variable definition table 131B.
(Contents of Exporting Process)
The first acquisition section 121 acquires a name of a variable (that is, the first variable selected by a user) corresponding to an ancestor node of the target variables (parent-node name acquiring process S120). The second acquisition section 122 acquires (generates) discrimination information for discriminating between the target variables from variables corresponding to other descendant nodes of which an ancestor node is the first variable, with reference to the second variable definition table 131B (discrimination information acquiring process S130).
For example, an array element [0] of an array type variable named “startCondition” is discriminated by “0” from other array elements (for example, [1] and [2]) of an array type variable named “startCondition”. Consequently, the second acquisition section 122 acquires “0” as the discrimination information for discriminating the array element [0] of the array type variable: startCondition from the other array elements of the array type variable: startCondition, with reference to the second variable definition table 131B.
The third acquisition section 123 acquires element comments on the target variables with reference to the second variable definition table 131B (comment acquiring process S140). Besides, the character string generating section 124 generates one character string combined with the name of the first variable acquired by the first acquisition section 121 and the discrimination information acquired by the second acquisition section 122 (path character string generating process S150).
The output unit 120 externally outputs the list (output list L1) formed by associating the comments on target variables acquired by the third acquisition section 123 with the character string generated in path character string generating process by the character string generating section 124 (exporting process S160). The output unit 120 outputs the output list L1 as a data format file which is editable in at least one of the text editor and the spreadsheet software.
The process (particularly, exporting process) which is executed by the development support device 10 described above with reference to
According to this configuration, in the control method, the element comments on the plurality of respective second variables are associated with the name of the first variable and the discrimination information and are output as a data format file which is editable in at least one of the text editor and the spreadsheet software.
Consequently, the control method achieves an effect of enabling a list of element comments on the plurality of respective second variables to be output in a form which is easily checked and easily edited by a user. In other words, the control method achieves an effect of enabling a user to easily check and easily edit element comments on the plurality of respective second variables.
In addition, the element comments are output as a data format file which is editable by a user using the spreadsheet software or the like, and thus the control method achieves an effect of enabling the user to write and manage the element comments in each of a plurality of languages using the file. That is, the control method achieves an effect of enabling a user to easily generate⋅manage the element comments written in each of the plurality of languages on the plurality of respective second variables.
(Data Format)
(Data Format Example of Variable Other than Element Variables)
In the development support device 10, the variables other than the element variables, that is, the variables other than “variables which can be denoted as descendant nodes of a tree having a certain variable as an ancestor node”, is stored in the following data format in the first variable definition table 131A, for example. That is, regarding the variables other than the element variables, sets of “a variable name, a data type, a comment”, and the like of the respective variables are stored in a table form as attributes of the respective variables in the first variable definition table 131A.
As illustrated in
Regarding the variables other than “variables which can be denoted as descendant nodes of a tree having a certain variable as an ancestor node”, the development support device 10 displays (visualizes) contents of the variables stored in the first variable definition table 131A, on the “variable table screen”, for example.
On the other hand, in the development support device 10, “variables which can be denoted as descendant nodes of a tree having a certain variable as an ancestor node”, that is, the element variables, are stored in the following data format in the second variable definition table 131B, for example. That is, in the second variable definition table 131B, each of the plurality of element variables is managed as a variable corresponding to each of a plurality of descendant nodes of a tree having a certain variable as an ancestor node. Information indicating a structure of the tree, particularly, information for identifying each of the plurality of descendant nodes corresponding to each of the plurality of element variables in the tree, is stored in the second variable definition table 131B. In addition, in the second variable definition table 131B, an element comment on each of the plurality of element variables is associated with each of the plurality of descendant nodes corresponding to each of the plurality of element variables.
The development support device 10 configures a tree in which array elements or structure members (element variables, that is, second variables) as the descendant nodes are arranged in a hierarchy with respect to the first variable (for example, first variable which is the array type variable or the structure type variable) corresponding to the ancestor node. For example, the development support device 10 manages the array elements [0], [1], and [2] of the array type variable: startCondition as child nodes of a tree having the array type variable: startCondition as a parent node.
The development support device 10 individually discriminates between the plurality of second variables (for example, array elements [0], [1], and [2]) corresponding to sibling nodes of a tree having the first variable (for example, array type variable: startCondition) as an ancestor node, in the following manner. That is, the development support device 10 individually discriminates between the plurality of second variables corresponding to the sibling nodes by giving the discrimination information (“0”, “1”, and “2” in the example illustrated in (A) of
Besides, the development support device 10 stores element comments on the respective element variables in association with “the respective descendant nodes in the tree which correspond to the respective element variables”, in the second variable definition table 131B.
That is, in the second variable definition table 131B in (A) of
In addition, contents in a column of “explanation of node” in the second variable definition table 131B can be considered as “information indicating instances of the respective descendant nodes corresponding to the element variables in the tree”. In particular, the column of “explanation of node” shows information indicating instances of child nodes corresponding to respective element variables in the tree having the respective element variables as the child nodes. The column of “explanation of node” of the array element: [0] of the array type variable: startCondition provides that “the array element: [0] corresponds to a child node 0 in the tree having the array type variable: startCondition as the parent node”.
In addition, in the second variable definition table 131B in (A) of
As described above, the development support device 10 executes the following process when receiving a user operation indicating an instruction to execute the exporting process. That is, regarding a certain variable (first variable) selected in the above-described user operation, the development support device 10 individually identifies a plurality of second variables corresponding to descendant nodes in a tree having the certain variable as an ancestor node, with reference to the second variable definition table 131B. The development support device 10 acquires element comments on the plurality of respective identified second variables, with reference to the second variable definition table 131B. In addition, the development support device 10 acquires discrimination information for individually discriminating between the plurality of second variables, particularly, acquires path information from the first variable to each of the plurality of second variables in the tree having the first variable as an ancestor node, with reference to the second variable definition table 131B. The development support device 10 outputs the output list L1 obtained by associating element comments on the plurality of respective second variables with one character string containing the name of the first variable and the discrimination information (containing the path information from the first variable to each of the plurality of second variables) for individually discriminating between the plurality of second variables.
(B) of
That is, the output unit 120 (particularly, first acquisition section 121) first identifies the name of the first variable selected by the user, that is, “startCondition” which is the name of the array type variable: startCondition.
For example, the output unit 120 (particularly, second acquisition section 122) identifies the plurality of second variables corresponding to the descendant nodes of the tree, by following the tree having the array type variable: startCondition as the ancestor node, with reference to the second variable definition table 131B. That is, the second acquisition section 122 identifies the array elements [0], [1], and [2] of the array type variable: startCondition. Besides, the output unit 120 acquires the discrimination information (that is, “0”, “1”, and “2”) for individually discriminating between the plurality of second variables (for example, array elements [0], [1], or [2]), with respect to the first variable.
The output unit 120 (particularly, second acquisition section 122) generates path information for each of the array elements [0], [1], and [2] of the array type variable: startCondition, with reference to the second variable definition table 131B. The second acquisition section 122 identifies paths from the array type variable: startCondition which is the ancestor node to the respective array elements [0], [1], and [2] which are the descendant nodes in the tree having the array type variable: startCondition as the ancestor node. In other words, the second acquisition section 122 identifies one or more parent-child relationships from the array type variable: startCondition which is the ancestor node to the respective array elements [0], [1], and [2] which are the descendant nodes in the tree. The second acquisition section 122 generates path information indicating identified paths (one or more parent-child relationships). “The discrimination information for individually discriminating between the plurality of second variables with respect to the first variable” contains “the path information indicating paths from the first variable to the plurality of respective second variables in the tree having the first variable as the ancestor node”.
In the example illustrated in
The second acquisition section 122 identifies that there is one parent-child relationship between the array type variable: startCondition and the array element [0], and the parent-child relationship is a parent-child relationship between an array type variable and an array element, with reference to the second variable definition table 131B. In addition, the second acquisition section 122 identifies “1” as information for discriminating the array element [0] from the other array elements ([1] and [2]) corresponding to the sibling nodes in the tree having the array type variable: startCondition as the parent node. Consequently, the second acquisition section 122 generates “[0]” as the discrimination information containing the path information for the array element [0]. Similarly, the second acquisition section 122 generates “[1]” as the discrimination information containing the path information for the array element [1] and generates “[2]” as the discrimination information containing the path information for the array element [2].
The path information represented by “[0]” indicates that an element variable associated with the path information is the array element of the first variable which is the array type variable and is discriminated by “0” from the other array elements of the first variable. Similarly, the path information represented by “[1]” indicates that an element variable associated with the path information is the array element of the first variable which is the array type variable and is discriminated by “1” from the other array elements of the first variable. In addition, the path information represented by “[2]” indicates that an element variable associated with the path information is the array element of the first variable which is the array type variable and is discriminated by “2” from the other array elements of the first variable.
The output unit 120 (particularly, character string generating section 124) generates one character string containing the name (startCondition) of the first variable and the discrimination information of the plurality of respective second variables. The character string generating section 124 generates one character string (that is, “startCondition[0]”) containing “startCondition” and the discrimination information ([0]) of the array element [0], regarding the array element [0]. Similarly, the character string generating section 124 generates “startCondition[1]” regarding the array element [1] and generates “startCondition[2]” regarding the array element [2].
The output unit 120 (particularly, third acquisition section 123) acquires an element comment for each of the plurality of second variables (for example, array elements [0], [1], and [2]) corresponding to the descendant nodes of the tree having the first variable as the ancestor node, with reference to the second variable definition table 131B. Specifically, the third acquisition section 123 acquires an element comment: container start condition on the array element [0], with reference to the second variable definition table 131B. Similarly, the third acquisition section 123 acquires an element comment: robot start condition for the array element [1] and acquires an element comment: XXX start condition for the array element [2], with reference to the second variable definition table 131B.
Besides, the output unit 120 outputs the element comments on the plurality of respective second variables in the output list L1, by associating the element comments with “one character string containing the name of the first variable corresponding to the ancestor node and the discrimination information” of the plurality of respective second variables. As illustrated in (B) of
Similarly to
The development support device 10 manages the structure members Member1 and Member2 of the structure type variable: startCondition as child nodes of a tree having the structure type variable: startCondition as a parent node. The structure members Member1 and Member2 corresponding to the sibling nodes of the tree are individually discriminated from other array elements corresponding to sibling nodes, by “Member1” or “Member2” in a hierarchy showing child nodes.
That is, in the second variable definition table 131B in (A) of
Similarly, in the second variable definition table 131B in (A) of
(B) of
That is, the first acquisition section 121 identifies “startCondition” which is a name of the structure type variable: startCondition. The second acquisition section 122 individually identifies the plurality of second variables (for example, structure members Member1 and Member2) corresponding to descendant nodes of a tree having the first variable as an ancestor node, by following the tree having the first variable as the ancestor node with reference to the second variable definition table 131B. Besides, the output unit 120 acquires discrimination information (that is, Member1 or Member2) for individually discriminating between the plurality of second variables (for example, structure members Member1 and Member2) with respect to the first variable. The discrimination information contains path information.
In the example illustrated in
The second acquisition section 122 identifies that there is one parent-child relationship between the structure type variable: startCondition and the structure member Member1, and the parent-child relationship is a parent-child relationship between a structure type variable and a structure member, with reference to the second variable definition table 131B. In addition, the second acquisition section 122 identifies “Member1” as information for discriminating the structure member Member1 from the other structure member (Member2) corresponding to the sibling node in the tree having the structure type variable: startCondition as the parent node. Consequently, the second acquisition section 122 generates “.Member1” as the discrimination information containing the path information for the structure member Member1. Similarly, the second acquisition section 122 generates “.Member2” as the discrimination information containing the path information for the structure member Member2.
The path information represented by “.Member1” indicates that an element variable associated with the path information is the structure member of the first variable which is the structure type variable and is discriminated by “Member1” from the other structure member of the first variable. Similarly, the path information represented by “.Member2” indicates that an element variable associated with the path information is the structure member of the first variable which is the structure type variable and is discriminated by “Member2” from the other structure member of the first variable.
Regarding the structure member Member1, the character string generating section 124 generates the following one character string containing the name (startCondition) of the first variable and the discrimination information (.Member1) of the structure member Member1. That is, the character string generating section 124 generates one character string reading “startCondition.Member1” regarding the structure member Member1. Similarly, the character string generating section 124 generates one character string reading “startCondition.Member2” regarding the structure member Member2.
The output unit 120 (particularly, third acquisition section 123) acquires an element comment: container start condition for the structure member Member1 and acquires an element comment: robot start condition for the structure member Member2, with reference to the second variable definition table 131B.
Besides, as illustrated in (B) of
Similarly to
The development support device 10 configures a tree in which the structure type variables [0] and [1] are hierarchized as child nodes, and the structure members Member1 and Member2 are hierarchized as grandchild nodes, with respect to the array type variable: startCondition corresponding to an ancestor node.
In addition, the development support device 10 individually discriminates between a plurality of element variables from other element variables corresponding to sibling nodes of the same hierarchy in the tree, using at least one of “0, 1, Member1, and Member2” as the discrimination information. For example, the development support device 10 distinguishes between the respective array elements [0] and [1] of the array type variable: startCondition, using “0” or “1” as the discrimination information. In addition, the development support device 10 distinguishes between the respective structure members Member1 and Member2 of the structure type variable [0], using “Member1” or “Member2” as the discrimination information. Further, the development support device 10 distinguishes between the element variables corresponding to four grandchild nodes of the tree, respectively, using discrimination information obtained by combining “0” or “1” and “Member1” or “Member2”.
That is, as illustrated in
The structure members (that is, Member1 and Member2) of the structure type variable [0] are stored as child nodes of a tree having the structure type variable [0] as a parent node, in the second variable definition table 131B. In other words, the structure members of the structure type variable [0] are stored as grandchild nodes of a tree having the array type variable: startCondition as an ancestor node, in the second variable definition table 131B. In the second variable definition table 131B, the structure members of the structure type variable [0] are discriminated from each other using information (“Member1” or “Member2” in the example illustrated in
Similarly, the structure members (that is, Member1 and Member2) of the structure type variable [1] are stored as child nodes of a tree having the structure type variable [1] as a parent node, in the second variable definition table 131B. In other words, the structure members of the structure type variable [1] are stored as grandchild nodes of the tree having the array type variable: startCondition as an ancestor node, in the second variable definition table 131B. In the second variable definition table 131B, the structure members of the structure type variable [1] are discriminated from each other using information (“Member1” or “Member2” in the example illustrated in
The element comment: “start condition of stage A” on the array element: [0] of the array type variable: startCondition is associated with the child node denoting the array element: [0] in the tree. In addition, the column of “explanation of node” provides that the array element: [0] corresponds to a child node 0 in the tree having the array type variable: startCondition as the parent node.
Similarly, in the second variable definition table 131B in
That is, the first acquisition section 121 identifies “startCondition” as the name of the first variable. The second acquisition section 122 individually identifies a plurality of second variables corresponding to descendant nodes of a tree having the first variable as the ancestor node, by following the tree having the first variable as the ancestor node with reference to the second variable definition table 131B. For example, the second acquisition section 122 identifies each of the array elements [0] and [1], the structure members Member1 and Member2 of the structure type variable [0], and further the structure members Member1 and Member2 of the structure type variable [1]. The second acquisition section 122 acquires discrimination information (containing path information of the plurality of respective second variables) for discriminating between the plurality of respective second variables.
For example, the second acquisition section 122 identifies that there is one parent-child relationship between the array type variable: startCondition and the array element [0], and the parent-child relationship is a parent-child relationship between an array type variable and an array element, with reference to the second variable definition table 131B. In addition, the second acquisition section 122 identifies “1” as information for discriminating the array element [0] from the other array element ([1]) corresponding to the sibling node in the tree having the array type variable: startCondition as the parent node. Consequently, the second acquisition section 122 generates “[0]” as the discrimination information containing the path information for the array element [0]. Similarly, the second acquisition section 122 generates “[1]” as the discrimination information containing the path information for the array element [1]. In addition, the second acquisition section 122 identifies “1” as information for discriminating the array element [0] from the other array element ([1]) corresponding to the sibling node in the tree having the array type variable: startCondition as the parent node. Consequently, the second acquisition section 122 generates “[0]” as the discrimination information containing the path information for the array element [0]. The path information represented by “[0]” indicates that an element variable associated with the path information is the array element of the first variable which is the array type variable and is discriminated by “0” from the other array element of the first variable.
Similarly, the second acquisition section 122 identifies that there are two parent-child relationships between the array type variable: startCondition and the structure member: Member1 of the structure type variable [0], with reference to the second variable definition table 131B.
That is, the second acquisition section 122 identifies that there is a first parent-child relationship in which the array type variable: startCondition is the parent node and the structure type variable [0] is the child node, and the first parent-child relationship is a parent-child relationship between an array type variable and an array element. Besides, the second acquisition section 122 identifies “1” as information for discriminating the array element [0] from the other array element ([1]) corresponding to the sibling node in the tree having the array type variable: startCondition as the parent node. Consequently, the second acquisition section 122 generates “[0]” as the discrimination information containing the path information for the array element [0].
In addition, the second acquisition section 122 identifies that there is a second parent-child relationship in which the structure type variable [0] is the parent node and the structure member: Member1 of the structure type variable [0] is the child node, and the second parent-child relationship is a parent-child relationship between a structure type variable and a structure member. Besides, the second acquisition section 122 identifies “Member1” as information for discriminating Member1 from the other structure member (Member2) corresponding to the sibling node in the tree having the structure type variable [0] as the parent node. Consequently, the second acquisition section 122 generates “.Member1” as the discrimination information containing the path information for the array element [0].
Consequently, the second acquisition section 122 generates the following character string as the discrimination information for discriminating the structure member: Member1 of the structure type variable [0] from the other sibling node, with respect to the array type variable: startCondition as the ancestor node. That is, the second acquisition section 122 generates “[0].Member1” as the discrimination information of the structure member: Member1 of the structure type variable [0].
The path information represented by “[0].Member1” indicates that an element variable associated with the path information is the structure member of the array element [0] which is the array element of “the first variable having the structure type variable as the array element, that is, the array element [0] which is the structure type variable. In addition, the path information represented by “[0].Member1” indicates that the element variable associated with the path information is discriminated from the other sibling node of the tree having the first variable as the ancestor node, by using discrimination information containing “0” and “Member1” which are arranged in this order.
The character string generating section 124 generates one character string (that is, “startCondition[0]”) containing “startCondition” which is the name of the first variable and the discrimination information ([0]) of the array element [0], regarding the array element [0]. In addition, the character string generating section 124 generates the following one character string containing “startCondition” and the discrimination information ([0].Member1) of the structure member: Member1 of the structure type variable [0], regarding the structure member: Member1 of the structure type variable [0]. That is, the character string generating section 124 generates “startCondition[0].Member1”, regarding the structure member: Member1 of the structure type variable [0].
The third acquisition section 123 acquires the element comment: start condition of stage A on the array element [0], with reference to the second variable definition table 131B. Similarly, the third acquisition section 123 acquires the element comment: container start condition (stage A) on the structure member: Member1 of the structure type variable [0], with reference to the second variable definition table 131B.
As illustrated in
Similarly, the output unit 120 outputs the element comment: container start condition (stage A) on the structure member: Member1 of the structure type variable [0] in the output list L1, by associating the element comment with a comment name represented by “startCondition[0].Member1”.
(Limitation on the Number of Element Comments Stored in One Output List)
The development support device 10 (particularly, output unit 120) avoids increasing a data size of the output list L1 too much by constraining the number of element comments (that is, the number of element variables on which element comments are output) which are output in one output list L1.
For example, the output unit 120 sets the maximum number (predetermined value) in advance, regarding the number of element comments which are output in one output list L1. The output unit 120 outputs element comments to be output by dividing the element comments into a plurality of output lists L1 (for example, output lists L1(1), L1(2), L1(3), to L1(n)), when the number of element comments to be output is determined to exceed a maximum number.
That is, in the development support device 10, the output unit 120 may output the file (output list L1) by dividing the file into two or more files, when the total number of the second variables is larger than the predetermined value (maximum value).
According to this configuration, the development support device 10 outputs the file by dividing the file into two or more files, when the total number of the second variables is larger than the predetermined value. In other words, the development support device 10 outputs the file by dividing the file into two or more files, when determining that the total number of the second variables is larger than the predetermined value, and the file has too large a data size.
For example, the development support device 10 outputs the element comments attached to the plurality of respective second variables by dividing the element comments into the two or more files, when the total number of the plurality of second variables which belong to the common first variable is larger than the predetermined value. In addition, the development support device 10 outputs the element comments attached to the plurality of respective second variables by dividing the element comments into the two or more files, when the total number of the plurality of second variables of which a plurality of respective first variables are ancestor nodes is larger than the predetermined value, for example.
Here, when the total number of the second variables increases, it is needless to say that the data size of the file also increases. In addition, when the data size increases too much, it is difficult to open the file and check contents thereof or to edit the file.
Consequently, the development support device 10 achieves an effect of enabling the file to avoid having too large a data size to lower user convenience of the file, by dividing the file into two or more files.
Further, the output unit 120 may output, in one of the file, all of the element comments on the plurality of respective second variables which belong to the common first variable.
According to this configuration, the development support device 10 outputs, in one of the file, all of the element comments on the plurality of respective second variables which belong to the common first variable. Consequently, the element comments on the plurality of respective second variables which belong to the common first variable are divided into a plurality of files, and thus the development support device 10 achieves an effect of avoiding low recognizability and convenience for a user.
When the number of element comments on the plurality of respective element variables which belong to the common variable (first variable) corresponding to the ancestor node is equal to or smaller than the maximum number of lines, the output unit 120 outputs those “element comments on the plurality of respective element variables which belong to the common first variable” in one output list L1. In other words, the output unit 120 causes all of the element comments on the plurality of respective element variables which belong to the common variable corresponding to the ancestor node to be contained in one output list L1 and avoids dividing the element comments into a plurality of output lists L1. However, when the number of element comments on the plurality of respective element variables which belong to the common variable corresponding to the ancestor node exceeds the maximum number, the output unit 120 outputs those “element comments on the plurality of respective element variables which belong to the common first variable” in a plurality of output lists L1.
For example, when the element comments on the plurality of respective element variables are output in L1(m), the output unit 120 calculates “the number of remaining element comments” by subtracting “the number of element comments output in the output list L1(m)” from the maximum number, regarding the output list L1(m). Here, “m” is a natural number of “1” or larger. The output unit 120 compares “the number of element comments to be output in the output list L1(m)” with “the number of remaining element comments” calculated regarding the output list L1(m). When the output unit 120 determines that “the number of element comments to be output in the output list L1(m)” is smaller than “the number of remaining element comments”, the output unit 120 switches an output destination file of the element comments to be output from the output list L1(m) to an output list L1(m+1).
(Outline of Exporting Process)
The development support device 10 stores the map information 132 associated with contents of the respective “comment names” in the input list L2 and information indicating instances (node instances) of the plurality of respective element variables, in the storage unit 130 in advance. Similarly to “the comment names” in the output list L1, in “the comment names” in the input list L2, path information (containing the name of the first variable corresponding to the ancestor node) of the plurality of respective element variables corresponding to the descendant nodes is described.
Here, a naming rule of “the respective comment names” in the input list L2 is the same as the naming rule of “the comment names” in the output list L1. That is, “the comment name” contains a name of the variable (first variable) corresponding to the ancestor node and the discrimination information for discriminating between the plurality of respective second variables with respect to the first variable. The discrimination information contains “path information indicating paths from the first variable to the plurality of individual second variables in the tree having the first variable as the ancestor node”. The path information is information for individually identifying one or more parent-child relationships which are found from the first variable to the plurality of individual second variables in the tree having the first variable as the ancestor node. When a variable corresponding to a parent node is an array type variable, and a variable corresponding to a child node is an element of the array type variable, the parent-child relationship is provided using brackets ([ ]) in the path information. In addition, when a variable corresponding to a parent node is a structure type variable, and a variable corresponding to a child node is a member of the structure type variable, the parent-child relationship is provided using a period (.).
“The information indicating instances of the plurality of respective element variables” in the input list L2 is information indicating “instances of a plurality of respective descendant nodes in the tree having the plurality of respective element variables as the descendant nodes”. “The information indicating the instances of the plurality of respective element variables” can also be “information indicating relationships between the plurality of element variables (second variables) corresponding to the descendant nodes and the variable (first variable) corresponding to the ancestor node”.
As described above, the development support device 10 may further include the input unit 140 and the comment updating unit 150. The input unit 140 imports a file instructed to be imported, when the operation receiving unit 110 (particularly, input instruction receiving section 112) receives the user operation indicating an instruction to import the data format file (input list L2) which is editable in at least one of a text editor and spreadsheet software, the file containing element comments on the respective second variables provided in association with the name of the first variable and the discrimination information. The comment updating unit 150 updates an element comment on each of the second variables stored in the storage unit 130, depending on the file imported by the input unit 140.
According to this configuration, the development support device 10 imports the input list L2 containing the element comments on the plurality of respective second variables provided in association with the name of the first variable and the discrimination information, in response to the user operation. Besides, the development support device 10 updates the element comment on each of the second variables stored in the storage unit 130, depending on the imported input list L2. In particular, the development support device 10 imports the element comment on each of the plurality of second variables so as to update the element comment on each of the second variables stored in the storage unit 130, the element comment being provided in the input list L2 in a form which enables a user to easily check contents thereof and easily edit the contents thereof.
Hence, the development support device 10 achieves an effect of enabling a user to easily manage and easily edit the element comment on each of the second variables which are used by the device, by using the input list L2.
In addition, a plurality of input lists L2 written in a plurality of languages, respectively, are prepared, and thereby, the development support device 10 can easily switch between languages of the element comment on each of the second variables which are used by the device, by updating the input list L2 to be imported.
For example, the user prepares in advance an input list L2(1) containing an element comment on a certain second variable written in English, an input list L2(2) written in Japanese, an input list L2(3) written in Chinese, and an input list L2(4) written in Spanish. The development support device 10 can use the element comment in English on the second variable by importing the input list L2(1) written in English or can use the element comment in Japanese on the second variable by importing the input list L2(2) written in Japanese. Similarly, the development support device 10 can use the element comment in Chinese on the second variable by importing the input list L2(3) written in Chinese or can use the element comment in Spanish on the second variable by importing the input list L2(4) written in Spanish.
That is, the development support device 10 achieves an effect of enabling a user to easily switch between languages of an element comment on the second variable (in an example described above, any languages of English, Japanese, Chinese, and Spanish of the element comment) in the device.
(Details of Importing Process)
When the input unit 140 imports the input list L2 (importing process S220), the comment updating unit 150 (particularly, character string analyzing section 151) extracts a name of the first variable from the comment name of the input list L2 and informs the first identification section 152 of the extracted name of the first variable. The first identification section 152 identifies the first variable from “the name of the first variable” extracted from the comment name of the input list L2 (first variable identifying process S230). The second identification section 153 identifies a variable which is a target variable, of variables corresponding to descendant nodes of the first variable, based on “the discrimination information” extracted from the comment name of the input list L2 (second variable identifying process S240). For example, the second identification section 153 acquires a “node instance” which is associated with “the comment name” of the input list L2 with reference to map information 132 and identifies the target variable in the second variable definition table 131B by using the acquired “node instance”. In addition, the third identification section 154 identifies a comment (element comment) which is associated with the comment name of the input list L2, that is, acquires the element comment associated with the comment name from the input list L2.
The comment updating unit 150 updates the comment on the target variable identified in the second variable identifying process, in the second variable definition table 131B, with a comment on the target variable in the input list L2 (comment updating process S250). That is, the comment updating unit 150 updates the element comment on the target variable identified in the second variable identifying process, in the second variable definition table 131B, with the element comment acquired by the third identification section 154 from the input list L2.
For example, a comment name of “startCondition[0]” contains “startCondition” which is the name of the variable (first variable) corresponding to the ancestor node and “[0]” which is the discrimination information for discriminating between the plurality of respective second variables with respect to the first variable. “[0]” immediately behind “startCondition” represents the following information. First, “[0]” indicates that the element variable associated with the comment name corresponds to a child node of a tree in which a variable (first variable) named “startCondition” is the ancestor node. Second, “[0]” indicates that the element variable associated with the comment name is an array element of the first variable (that is, the first variable is an array type variable). Third, “[0]” indicates that discrimination information for discriminating the element variable associated with the comment name from variables (other array elements) corresponding to other child nodes of the tree having the first variable as the parent node is “0”.
The items of information indicated by the comment name of “startCondition[0]” is the same as the information represented by a node instance named “node of [0]” which is associated with the comment name in the map information 132. That is, the node instance named “node of [0]” indicates that a certain element variable corresponds to a child node of a certain first variable, particularly, is an array element of the certain first variable, and is discriminated from other array elements of the certain first variable by the discrimination information of “0”.
(Regarding Variable Corresponding to Grandchild Node of Tree Having First Variable as Ancestor Node)
Similarly, a comment name of “startCondition[1].Member2” contains “startCondition” which is a name of the variable (first variable) corresponding to the ancestor node. In addition, the comment name of “startCondition[1].Member2” contains “[1].Member2” as the discrimination information for discriminating the element variable associated with the comment name from variables corresponding to other descendant nodes in a tree having the first variable as the ancestor node.
“[1].Member2” immediately behind “startCondition” represents the following information. First, “[1].Member2” indicates that the element variable associated with the comment name corresponds to a grandchild node of the tree in which the variable (first variable) named “startCondition” is an ancestor node. Second, “[1].Member2” indicates that the element variable associated with the comment name is a structure member of a structure type variable which is an array element [1] of the first variable (that is, the first variable is an array type variable having the structure type variable as the array element).
Third, “[1].Member2” indicates that discrimination information for discriminating the element variable associated with the comment name from “variables corresponding to other grandchild nodes of the tree having the first variable as the ancestor node” is “1” and “Member2”.
Specifically, the element variable associated with the comment name is discriminated from “the structure members of the structure type variable which is an array element [0] of the first variable” in that the element variable is “the structure member of the structure type variable which is the array element [1] of the first variable”. That is, the element variable associated with the comment name is discriminated from “the variables corresponding to child nodes of a tree having the array element [0] of the first variable as a parent node” in that the array element [1] of the first variable is a parent node.
In addition, the element variable associated with the comment name is discriminated from “the other structure member (for example, Member1) of the structure type variable which is the array element [1] of the first variable” in that the element variable is “Member2 of the structure type variable which is the array element [1] of the first variable”.
The items of information indicated by the comment name of “startCondition[1].Member2” is the same as the information represented by a node instance named “node of [1]-Member2” which is associated with the comment name in the map information 132. The node instance named “node of [1]-Member2” represents the following information. That is, the node instance named “node of [1]-Member2” indicates that a certain element variable corresponds to a grandchild node of a certain first variable and, particularly, is a structure member of a structure type variable which is an array element [1] of the certain first variable. In addition, the node instance named “node of [1]-Member2” indicates that the certain element variable is discriminated from variables corresponding to other grandchild nodes of the tree having the first variable as the ancestor node, by using the discrimination information of “1” and “Member2”.
As described above, when the second identification section 153 does not have to necessarily refer to the map information 132, in identifying each of the element variables in the input list L2. The second identification section 153 may directly acquire discrimination information for discriminating between element variables having element comments stored in the input list L2, in the tree having the first variable as the ancestor node, from “the comment name” of the input list L2 without referring to the map information 132.
The “node instance” in the map information 132 may be associated with the “explanation of node” in the second variable definition table 131B.
As described above, an example is described, in which the first variable is the array type variable or the structure type variable, and the second variable is the array element or the structure member. However, the first variable does not have to be necessarily the array type variable or the structure type variable, and the second variable does not have to be necessarily the array element or the structure member. The second variable may be a variable which can be denoted as a descendant node in a tree having a first variable as an ancestor node.
The functional blocks (specifically, the output unit 120, the input unit 140, and the comment updating unit 150) of the development support device 10 may be implemented by a logic circuit (hardware) formed into an integrated circuit (IC chip) or the like or may be implemented by software using a central processing unit (CPU).
In the latter case, the development support device 10 includes the CPU that executes an instruction of a program serving as software which realizes the functions, a read only memory (ROM) or a storage device (both are called a “recording medium”) in which the program and various types of data are stored to be readable by a computer (or CPU), a random access memory (RAM) that expands the program, or the like. Besides, the computer (or CPU) reads the program from the recording medium and executes the program, thereby achieving the object of the present invention. A “non-transitory tangible medium” such as a tape, a disk, a card, a semiconductor memory, or a programmable logic circuit can be used as the recording medium. In addition, the program may be supplied to the computer via any transmission medium (communication network, broadcast wave, or the like) which can transfer the program. Moreover, the present invention can also be implemented in a form of a data signal embodied by electronic transmission of the program, the data signal being embedded in a carrier wave.
(Appendix)
The development support device according to an aspect of the present invention supports a user to write a program executed by a controller, the development support device including: an operation receiving unit that receives a user operation indicating an instruction to perform an external output of comments on variables used in the program, the comments being optionally attachable together with definitions of the variables by the user; and an output unit that outputs a comment on each of a plurality of second variables of the variables as a data format file which is editable in at least one of a text editor and spreadsheet software, the second variables being denotable as a descendant node in a tree data structure having a first variable as an ancestor node, by associating the comment with a name of the first variable and discrimination information for individually discriminating between the plurality of second variables with respect to the first variable, when the operation receiving unit receives the user operation.
According to this configuration, the development support device outputs the comment on each of the plurality of second variables as a data format file which is editable in at least one of the text editor and the spreadsheet software, by associating the comment with the name of the first variable and the discrimination information.
Consequently, the development support device achieves an effect of enabling a list of comments on the plurality of respective second variables to be output in a form which is easily checked and easily edited by a user. In other words, the development support device achieves an effect of enabling the user to easily check and easily edit the comments on the plurality of respective second variables.
In addition, the development support device outputs the comments as a data format file which is editable by the user in spreadsheet software or the like, thus, achieving an effect of enabling the user to write and manage the comments in each of a plurality of languages using the file. That is, the development support device achieves an effect of enabling the user to easily generate and easily manage the comments written in each of the plurality of languages on the plurality of respective second variables.
In the development support device according to the aspect of the present invention, the first variable may be an array type variable or a structure type variable, and each of the plurality of second variables may be an array element of the array type variable or a member of the structure type variable.
According to this configuration, the development support device outputs the comment on each of the plurality of second variables which are array elements of the array type variable or members of the structure type variable, by associating the comment with the discrimination information and the name of the first variable which is the array type variable or the structure type variable.
Consequently, the development support device achieves an effect of enabling a list of comments on the plurality of respective second variables which are the array elements of the array type variable or the members of the structure type variable to be output in a form which is easily checked and easily edited by a user.
In the development support device according to the aspect of the present invention, the output unit may output the comment on each of the plurality of second variables by associating the comment with one character string containing the name of the first variable and the discrimination information.
According to this configuration, the development support device outputs the comment on each of the plurality of second variables as a data format file which is editable in the spreadsheet software or the like, by associating the comment with one character string containing the name of the first variable and the discrimination information. For example, the development support device outputs a list showing (A) the one character string containing the name of the first variable and the discrimination information and (B) the comment, in a data format which is editable in the spreadsheet software or the like.
Specifically, the development support device outputs the comment on each of the plurality of second variables as a data format file which is editable in the spreadsheet software, for example, by associating the comment with one character string containing the name of the first variable and the discrimination information. In this case, the one character string containing the name of the first variable and the discrimination information is stored in one cell, and the comment on each of the plurality of second variables is also stored in one cell. Hence, a user can check, at a glance, a relationship between the comment on each of the plurality of second variables, the second variable to which the comment is attached, and the first variable which is an ancestor node of the second variable. For example, the user is able to check, at a glance, the list formed by associating the one character string containing the name of the first variable and the discrimination information with one character string indicating the comment.
Consequently, the development support device achieves an effect of enabling a list of comments on the plurality of respective second variables to be output in a form which is very highly recognizable and easily edited by a user.
In the development support device according to the aspect of the present invention, the discrimination information contains path information indicating a path from the first variable to each of the plurality of second variables in the tree data structure.
The path information provides each of one or more parent-child relationships from the first variable to each of the plurality of second variables in the tree data structure, using (1) brackets ([ ]), when a variable corresponding to a parent node is an array type variable and a variable corresponding to a child node is an array element of the array type variable, and using (2) a period (.), when a variable corresponding to a parent node is a structure type variable and a variable corresponding to a child node is a member of the structure type variable.
According to this configuration, the development support device outputs the comment on each of the plurality of second variables in association with the discrimination information containing the path information and the name of the first variable. Besides, regarding each of one or more parent-child relationships from the first variable to the plurality of respective second variables, the path information distinguishes whether a parent and a child are an array type variable and an array element of the array type variable, respectively, or the parent and the child are a structure type variable and a member of the structure type variable, respectively.
Consequently, the development support device achieves an effect of enabling the file to be output in a state where a user can check a relationship between the first variable and the plurality of second variables. For example, the development support device achieves an effect of enabling the file to be output in a state where a user can distinguish whether the second variables are array elements of the first variable which is the array type variable, the second variables are members of the first variable which is the structure type variable, the second variables are members of a predetermined structure type variable of the first variable which is an array type variable (structure type array) in which each of a plurality of structure type variables is an array element, or the like.
In the development support device according to the aspect of the present invention, the output unit may output the file by dividing the file into two or more files, when the total number of the second variables is larger than a predetermined value.
According to this configuration, the development support device outputs the file by dividing the file into two or more files, when the total number of the second variables is larger than the predetermined value. In other words, the development support device outputs the file by dividing the file into two or more files, when determining that the total number of the second variables is larger than the predetermined value, and the file has too large a data size.
For example, the development support device outputs the comments attached to the plurality of respective second variables by dividing the comments into the two or more files, when the total number of the plurality of second variables which belong to the common first variable is larger than the predetermined value. In addition, the development support device outputs the comments attached to the plurality of respective second variables by dividing the comments into the two or more files, when the total number of the plurality of second variables of which a plurality of respective first variables are ancestor nodes, respectively is larger than the predetermined value, for example.
Here, when the total number of the second variables increases, it is needless to say that the data size of the file also increases. In addition, when the data size increases too much, it is difficult to open the file and check contents thereof or to edit the file.
Consequently, the development support device achieves an effect of enabling the file to avoid having too large a data size to lower user convenience of the file, by dividing the file into two or more files.
In the development support device according to the aspect of the present invention, the output unit may output, in one of the file, all of the comments on the plurality of respective second variables which belong to the common first variable.
According to this configuration, the development support device outputs, in one of the file, all of the comments on the plurality of respective second variables which belong to the common first variable. Consequently, the comments on the plurality of respective second variables which belong to the common first variable are divided into a plurality of files, and thus the development support device achieves an effect of avoiding low recognizability and convenience for a user.
The development support device according to the aspect of the present invention may further include an input unit that imports a file instructed to be imported, when the operation receiving unit receives a user operation indicating an instruction to import the data format file which is editable in at least one of a text editor and spreadsheet software, the file containing comments on the respective second variables provided in association with the name of the first variable and the discrimination information; and a comment updating unit that updates a comment on each of the second variables stored in a storage unit, depending on the file imported by the input unit.
According to this configuration, the development support device imports the file containing the comment on each of the plurality of second variables provided in association with the name of the first variable and the discrimination information, in response to the user operation. Besides, the development support device updates the comment on each of the second variables stored in the storage unit, depending on the imported file. In particular, the development support device imports the comment on each of the plurality of second variables so as to update the comment on each of the second variables stored in the storage unit, the comment being provided as a data format file which enables a user to easily check contents thereof and easily edit the contents thereof.
Hence, the development support device achieves an effect of enabling a user to easily manage and easily edit the comment on each of the second variables which are used by the device, using the file.
In addition, the plurality of files written in a plurality of languages are prepared respectively, and thereby, the development support device can easily switch between languages of the comment on each of the second variables which are used by the device, by updating the files to be imported.
For example, the user prepares in advance a file containing a comment on a certain second variable written in English, another file written in Japanese, still another file written in Chinese, and still another file written in Spanish. The development support device can use the comment in English on the second variable by importing the file written in English, or can use the comment in Japanese on the second variable by importing the file written in Japanese. Similarly, the development support device can use the comment in Chinese on the second variable by importing the file written in Chinese, or can use the comment in Spanish on the second variable by importing the file written in Spanish.
That is, the development support device achieves an effect of enabling easy switching between languages of a comment on the second variable (in the example described above, any languages of English, Japanese, Chinese, and Spanish of the comment) in the device.
A control method according to another aspect of the present invention is a method for controlling a development support device that supports a user to write a program executed by a controller, the control method including an operation receiving step of receiving a user operation indicating an instruction to perform an external output of comments on variables used in the program, the comments being optionally attachable together with definitions of the variables by a user; and an outputting step of outputting a comment on each of a plurality of second variables of the variables as a data format file which is editable in at least one of a text editor and spreadsheet software, the second variables being denotable as a descendant node in a tree data structure having a first variable as an ancestor node, by associating the comment with a name of the first variable and discrimination information for individually discriminating between the plurality of second variables with respect to the first variable, when the user operation is received in the operation receiving step.
According to this configuration, in the control method, the comments on the plurality of respective second variables are associated with the name of the first variable and the discrimination information and are output as a data format file which is editable in at least one of the text editor and the spreadsheet software.
Consequently, the control method achieves an effect of enabling a list of comments on the plurality of respective second variables to be output in a form which is easily checked and easily edited by a user. In other words, the control method achieves an effect of enabling a user to easily check and easily edit the comments on the plurality of respective second variables.
In addition, the comments are output as a data format file which is editable by a user in the spreadsheet software or the like, and thus the control method achieves an effect of enabling the user to write and manage the comments in each of a plurality of languages using the file. That is, the control method achieves an effect of enabling a user to easily generate⋅manage the comments written in each of the plurality of languages on the plurality of respective second variables.
The present invention is not limited to the embodiments described above, it is possible to perform various modifications within a scope of claims, and an embodiment obtained by appropriately combining technical means disclosed in different embodiments, respectively, is also included in the technical scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2019-064684 | Mar 2019 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/004316 | 2/5/2020 | WO | 00 |