The present disclosure relates to a control system having a development support device for developing a plurality of different programming languages executed in a control device, and the control device, a method of controlling a control system, and a computer program for a control system.
In a system for controlling a robot, a computer program used for robot control is written in a V+ language, for example, while a computer program used for sequence control is written in one or plurality of languages (hereinafter called “IEC language(s)”) described in accordance with the international standard IEC31131-3 specified by International Electrotechnical Commission(IEC).
In order to build an application for a robot by using these programs, it is necessary to execute an interlocking process for synchronizing the both programs by exchanging data each other, or to share data, which is not able to obtain only in one of the languages, with the other language.
In the prior art as the patent document No. 1, a processor executing a program used for robot control is connected with a processor used for sequence control by busses using a common memory, so that data is exchanged between the both programs.
This kind of data exchanging is performed by defining shared variables each having the same name in the both programs.
However, there are restrictions on the name of the shared variables, such as the limitation of the number of the characters, character types usable for the shared variables, etc., depending on a program language. Furthermore, the programs using the both languages are created in separate displays, usually, by separate programmers. Therefore, if the same names are used for the shared variables defined as interfaces between the both programs, only the names of the shared variables, which satisfy restrictions for the names in all of the program languages, can be used. As a result, that imposes constraint on users.
Moreover, it is impossible to reuse program resources created in the past with the way of using the same names for the shared variables.
The objects of the present invention is to provide a control system, a method for the control system, and a program for the control system, in which the names of shared variables can be given freely, and the program resources created in the past can be reused, without giving the same names to the shared variables defined between different programs.
To solve the above-described problem, a control system according to this disclosure including a control device; and a development supporting device for developing a plurality of different programming languages executed in the control device, wherein the development supporting device includes: an input unit configured to input source codes of the plurality of different programming languages; a mapping information producing unit configured to perform mapping of shared variables selected in the source codes, respectively, to produce shared variable mapping information; and a transmit unit configured to transmit the source codes and the shared variable mapping information to the control device, wherein the control device includes: a program executing unit configured to execute programs described by the source codes; and a shared variable processing unit configured to process each of mapped shared variables as common shared variables on the basis of the shared variable mapping information.
In the above-described control system, the source codes in the plurality of different programming languages are input to the development supporting device by the input unit. In each of the programming languages, a shared variable sharing a memory is defined separately. These shared variables can be selected by a user, for example. The selected shared variables are subjected to a mapping process by the mapping information producing unit, so that the shared variable mapping information is produced. The produced shared variable mapping information is transmitted with the source codes to the control device by the transmit unit.
In the control device, the programs described in received source codes are executed by the program executing unit. The received shared variable mapping information is referred to by the shared variable processing unit. The mapped shared variables are processed as common shared variables.
According to the above-described control system, even if shared variables having different names are defined between different programs, these shared variables are subjected to the mapping process in the shared variable mapping information. Therefore, the shared variables are used as common shared variables in each of the programs. According to the control system, it is possible to give names to shared variables freely in each of the programs without giving the same name to shared variables, so that it is possible to eliminate restriction when giving names to shared variables. Furthermore, by performing the mapping process using the shared variable mapping information, it is possible to process variables described in program resources in the past as shared variables, so that it is possible to reuse the program resources in the past effectively.
In the control system of an embodiment, the shared variable processing unit may copy data between the mapped shared variables, or use the same reference address for the mapped shared variables.
In this control system of the embodiment, even if the mapped shared variables have different names respectively, data is copied between the shared variables, or the same reference address for the mapped shared variables is used. Therefore, data sharing is performed by the shared variables between the different programs.
According to the control system of the embodiment, it is possible to give names to shared variables freely in each of the programs without giving the same name to shared variables, so that it is possible to eliminate restriction when giving names to shared variables. Furthermore, by performing the mapping process using the shared variable mapping information, it is possible to process variables described in program resources in the past as shared variables, so that it is possible to reuse the program resources in the past effectively.
In the control system for another embodiment, the source codes input by the input unit may include at least a source code described in a compiled language and a source code described in an interpreter language.
In this control system of the embodiment, not only the source code described in the compiled language, but also the source code described in the interpreter language is input. in the interpreter language, it is impossible to determine whether or not an error about variables will occur without interpreting the source code. However, in the control system of the embodiment, since the mapping for the selected shared variables is performed on the basis of the shared variable mapping information in the stage of the source code, it can prevent the occurrence of the error relating to the shared variables.
According to the control system, it is possible to give names to shared variables freely in the source code described in the compiled language and the source code described in the interpreter language without giving the same name to shared variables, so that it is possible to eliminate restriction when giving names to shared variables. Furthermore, by performing the mapping process using the shared variable mapping information, it is possible to process variables described in program resources in the past including the complied language and the interpreter language as shared variables, so that it is possible to reuse the program resources in the past effectively.
In the control system of the other embodiment, the development supporting device may include a shared variable reference producing unit that indicates sections in which the shared variables are referred to in the source codes described in the plurality of different programming languages on the shared variable mapping information.
In the control system of the embodiment, the shared variable mapping information is referred to even when the shared variable reference indicating the sections in which the shared variable variables are referred to is produced by the shared variable reference producing unit.
In the control system, even in the names of the shared variables are different, the sections in which the shared variables are referred to it confirmed on the basis of the shared variable reference.
According to the control system, it is possible to find the leakage of the implementation of a shared variable defined between the different programs and the mistake in the name of the shared variable, appropriately, before executing the programs.
To solve the above-described problem, a control method for a control system according to this disclosure includes a control device; and a development supporting device for developing a plurality of different programming languages executed in the control device, wherein the controlling method including, in the development supporting device, inputting source codes of the plurality of different programming languages; performing mapping of shared variables selected in the source codes, respectively; producing shared variable mapping information; and transmitting the source codes and the shared variable mapping information to the control device, wherein in the development supporting device, executing programs described by the source codes; and processing each of mapped shared variables as common shared variables on the basis of the shared variable mapping information.
According to the control method for a control system of this disclosure, even if shared variables having different names are defined between different programs, these shared variables are subjected to the mapping process in the shared variable mapping information. Therefore, the shared variables are used as common shared variables in each of the programs. According to the control system, it is possible to give names to shared variables freely in each of the programs without giving the same name to shared variables, so that it is possible to eliminate restriction when giving names to shared variables. Furthermore, by performing the mapping process using the shared variable mapping information, it is possible to process variables described in program resources in the past as shared variables, so that it is possible to reuse the program resources in the past effectively.
To solve the above-described problem, a program for a control system according to this disclosure, is a program for causing a computer to execute the above-mentioned control method for the control system.
By causing a computer to execute the program according to this disclosure, it is possible to implement the above-mentioned control method for the control system.
As described above clearly, according to the control system, the control method for the control system, and the program for the control system of this disclosure, it is unnecessary to give the same names to the shared variables when using the shared variables in a plurality of programming languages. As a result, the rule for giving a name to a shared variable will be relaxed, so that it is possible to improve freedom in the naming of the shared variable. Furthermore, it is possible to use the shared variable without modifying the program which has already created, so that it is possible to reuse program resources effectively.
In the following, embodiments will be described in detail with reference to the drawings as appropriate.
The controller 10 is a Programmable Logic Controller (PLC) or an industrial computer, for example. It executes a robot control program for controlling the operation of the arm type robot 20, and a sequence control program for controlling the operation of the end effector 40, to output a control signal.
The arm type robot 20 is vertically articulated robot having six axes, for example. It is connected to the controller 10 in a communicable manner. The arm type robot 20 has a power source, such as a servo motor, etc. The servo motor is driven by a control signal output from the controller 10 on the basis of the robot control program, so that it actuates each of joint axes.
The end effector controller 30 is connected to the controller 10 in a communicable manner. The end effector controller 30 drives a servo motor in the end effector 40 by a control signal output from the controller 10 on the basis of the sequence control program.
The end effector 40 is attached to the end part of the arm type robot 20, and has a mechanism for gripping a component, for example. The end effector 40 is connected to the end effector controller 30 in a communicable manner A servo motor in the end effector 40 is driven by a control signal output from the end effector controller 30, so that the operation of gripping the component is executed.
The develop supporting device 50 is a computer, such a personal computer, etc., and is connected to the controller 10 in a communicable manner. The develop supporting device 50 has a function of uploading a robot control program and a sequence control program, which is executed in the controller 10, to the controller 10; a function of debugging those programs; and a function of simulating those programs.
In this embodiment, the develop supporting device 50 is connected to a first programming terminal device 60 and a second programming terminal device 61 in a communicable manner. The robot control program is created in the first programming terminal device 60, such as a personal computer, etc., to be downloaded to the development supporting device 50. The sequence control program is created in the second programming terminal device 61, such as a personal computer, etc., to be downloaded to the development supporting device 50. The robot control program and the sequence control program might be created in the development supporting device 50.
The development supporting device 50 achieves the above-mentioned functions by launching software installed in the computer in advance. The software includes a program according to the present invention. The development supporting device 50 has an input device 51, a display device 52, a central processing device 53, a storage device 54, and a communication interface 55 as shown in
The controller 10 has the same hardware configuration as that of the development supporting device 50. The controller 10 achieves the above-mentioned functions by launching software installed in the computer in advance. The software includes a program according to the present invention. The controller 10 has an input device 81, a display device 82, a central processing device 83, a storage device 84, and a communication interface 85 as shown in
The shared variable setting part 52c includes shared variable displaying fields 52d, 52e. In the shared variable displaying field 52d, shared variables selected from shared variables described in the source code of the V+ program are displayed. In the shared variable displaying field 52e, shared variables selected from shared variables described in the source code of the IEC program are displayed.
(Shared Variable Mapping Processing)
The mapping processing for shared variables in the present embodiment. In this embodiment, for example, a checking process in a program for moving the arm type robot to the position of a workpiece, grasping the workpiece by the end effector, and moving the arm type robot to another position in that state, will be described. In this embodiment, a V+ language is used for the robot control program. The sequence control program is a program written in an IEC language. In this embodiment, an ST language is used for the sequence program, for example.
In this example, as shown in
The above-mentioned operation will be described in accordance with the flowchart in
The program described in the IEC language starts the control of the end effector 40 when the timing flag is turned on, to pick up the workpiece W (S2). In the meantime, the program described in the V+ language waits (S3). The program described in the IEC language turns off the timing flag by using the shared variable when the picking-up of the workpiece W by the end effector 40 is completed (S3-1). The turning-off of the timing flag becomes a notification of the completion of controlling for the end effector 40 to the program described in the V+ language. The program described in the V+ language moves the arm 20a of the arm type robot 20 to another position when the timing flag is turned off (S4).
In the example shown in
As described above, in the present embodiment, the operations of the arm type robot 20 and the end effector 40 are controlled by confirming the contents of the shared variable “reqHandClose” in the program described in the V+ language and of the shared variable “doHandClose” in the program described in the IEC language.
In the present embodiment, the usage of the shared variables having different names between different programs is available since a shared variable mapping information is created in the development supporting device 50 to refer the shared variable mapping information by the controller 10 when the program is executed.
The creation of the shared variable mapping information in the development supporting device 50 is performed after a source code A of the program described in the IEC language, which is a compiled language, is input from the first programming terminal device 60, or a source code B of the program described in the V+ language, which is an interpreter language, is input from the second programming terminal device 61.
The input processing unit 71 inputs the source code B of the program described in V+ language, which is an interpreter language, from the second programming terminal device 61 (S11).
The mapping information producing part 73a executes mappings for the shared variable described in the source code A and the shared variable described in the source code B.
The mapping of the shared variable is performed while the source code A described in the IEC language and the source code B described in the V+ language are displayed on the program displaying parts 52a, 52b as shown in
Variables are registered as shared variables by inputting variables in the shared variable displaying fields 52d, 52e of the shared variable setting part 52c, or drugging and dropping variables in the shared variable displaying fields 52d, 52e, in the state that the source coeds A, B are displayed on the program displaying parts 52a, 52b as described above. In the example shown in
In the example shown in
If there are a plurality of shared variables in a source code, and they are registered as mentioned above, the mapping is performed for the plurality of shared variables to produce the shared variable mapping information.
After producing the shared variable mapping information in the development supporting device 50 as described above, the processing unit 73 and the communication processing unit 75 functioned as a transmitting unit transmits an object code in which the source code A of the program described in the IEC language is compiled, the source code B of the program described in V+ language, and the shared variable mapping information, to the controller 10.
The checking process for the shared variables in the controller 10 will be described. In the controller 10, the processing unit 93 receives an object code of the program described in the IEC language, the source code B of the program described in the V+ language, and the shared variable mapping information, from the development supporting device 50 through the communication processing unit 95. The processing unit 93 stores an object code of the program described in the IEC language in the sequence control program storing part 94b, and stores the source code B of the program described in V+ language in the robot control program storing part 94a. The processing unit 93 stores the shared variable mapping information in the shared variable mapping storing part 94c.
When an executing process for programs is selected in the controller 10, the robot control part 93 a functioned as a program execution unit executes the source code B of the program described in the V+ language while interpreting the source code B, and the sequence control part 93b also functioned as a program execution unit executes an object code of the program described in the IEC language.
At that time, the robot control part 93a and the sequence control part 93b perform a process for checking whether or not the shared variable is included in programs.
The process for each of the mapped shared variables as common shared variables means that it copies data between the mapped shared variables, or uses the same reference address for the mapped shared variables. In the above example, if the robot control part 93a refers to the shared variable “reqHandClose” in the program described in the V+ language, the robot control part 93a confirms the shared variable mapping information stored in the shared variable mapping information storing part 94c. In the shared variable mapping information, the shared variable “doHandClose” is mapped to the shared variable “reqHandClose.” Therefore, the robot control part 93a copies data of the shared variable “reqHandClose” to the shared variable “doHandClose”, or copies the data of the shared variable “doHandClose” to the shared variable “reqHandClose.” Alternatively, the robot control part 93a writes data in an address of the shared memory 94d which is set as a shared reference address for the shared variable “reqHandClose” and the shared variable “doHandClose”, or read in data from the address.
If the sequence control part 93b refers to the shared variable “doHandClose” in the program described in the IEC language, the sequence control part 93b confirms the shared variable mapping information stored in the shared variable mapping information storing part 94c. In the shared variable mapping information, the shared variable “reqHandClose” is mapped to the shared variable “doHandClose.” Therefore, the sequence control part 93b copies data of the shared variable “doHandClose” to the shared variable “reqHandClose”, or copies the data of the shared variable “reqHandClose” to the shared variable “doHandClose.” Alternatively, the sequence control part 93b writes data in an address of the shared memory 94d which is set as a shared reference address for the shared variable “doHandClose” and the shared variable “reqHandClose”, or read in data from the address.
As described above, according to the present embodiment, even if shared variables having the different names between the different programs, such as the program described in the V+ language, the program described in the IEC language, are defined, it is possible to usage them as common shared variables between these programs by referring the shared variable mapping information. As a result, according to the system of the present embodiment, it is possible to give names to shared variables more freely in the different programs respectively, without giving the same name for the shared variables, so that it can eliminate restriction when giving names to shared variables.
Especially, in the interpreter language, such as the program described in the V+ language, it is impossible to determine whether or not an error about variables will occur without interpreting the source code. However, according to the present embodiment, since the mapping for the shared variables is performed in advance, it can prevent the occurrence of the error.
Furthermore, according to the present embodiment, by performing the mapping on the basis of the shared variable mapping information, it is possible to process variables described in program resources in the past as the shared variables, so that it is possible to reuse the program resources in the past effectively.
The second embodiment of the present disclosure will be described while referring to the attached drawings. In the first embodiment, the shared variable mapping information is produced in the development supporting device 50, and the shared mapping information is referred in the controller 10 when executing the programs. However, in the present embodiment, the shared variable mapping information is referred when producing a cross-reference.
In the present embodiment, the shared variable mapping information is produced in the same way as that of the first embodiment, and is stored in the shared variable mapping information storing unit 74d.
The cross-reference window 52f has a reference object inputting field 52f-1 and a reference information displaying field 52f-2. By inputting an operand in the reference object inputting field 52f-1, or by selecting the shared variables on the V+ program or the IEC program, the operand is displayed on the reference object inputting field 52f-1, and a cross-reference information for a command having the same operand as that displayed on the reference object inputting field 52f-1 is displayed on the reference information displaying field 52f-2. By inputting the shared variables in the reference object inputting field 52f-1, a cross-reference information for commands using the shared variables is displayed on the reference information displaying field 52f-2.
A display example of the cross-reference window 52f is shown in
In the reference object inputting field 52f-1, the name of the program in which a cross-reference is performed, and selected variables are displayed. The “robot hand control” indicated in
In the setting item displaying field 52f-20, variables subjected to the cross-reference is displayed. In
In the detail information displaying filed 52f-22, line numbers in the source code of the program, in which variables displayed in the setting item displaying field 52f-20 are referred, are displayed. In the reference displaying field 52f-23, the source code in the line numbers displayed in the detail information displaying filed 52f-22 is displayed.
In the present embodiment, when the process of the cross-reference starts, and shared variables are input in the occurred section displaying field 52f-21, the cross-reference information producing unit 73c refers to the shared variable mapping information to extract the mapped shared variables. For example, as shown in
The cross-reference information producing unit 73c executes a cross-reference process in the source code B of the program described in the V+ language and the source code A of the program described in the IEC language, for the shared variables input in the he reference object inputting field 52f-1, and the shared variables extracted from the shared variable mapping information. In the above-mentioned example, the cross-reference information producing unit 73c refers to the section, in which the shared variable “reqHandClose” is used, for the source code B of the program described in the V+ language, and stores the name of the program, the number of step, address, language, path, etc., in the cross-reference information storing unit 74c as the cross-reference information. The cross-reference information producing unit 73c refers to the section, in which the shared variable “doHandClose” is used, for the source code A of the program described in the IEC language, and stores the name of the program, the number of step, address, language, path, etc., in the cross-reference information storing unit 74c as the cross-reference information.
As the result of the above-mentioned process, in the cross-reference window 52f, as shown in
As described above, according to the present embodiment, even if the shared variables each having a different name are defined in different programs respectively, by just inputting the name of one shared variable, not only a section in which the one shared variable is referred, but also another section in which another shared variable mapped to the one shared variable is referred, is displayed on the cross-reference window 52f.
Therefore, a user can easily understand whether or not the shared variables are referred properly in a plurality of programs by seeing the contents displayed on the cross-reference window 52f. As a result, it is possible to debug programs smoothly.
As described above, according to the present embodiment, the error message indicating that the shared variable is not used in at least one of the program described in the IEC language and the program described in the V+ language, is displayed. As a result, it is possible to confirm the leakage of the implementation of a shared variable, the mistake in the name of a shared variable, the existence of a useless shared variable, etc. Thus, it is possible to debug programs smoothly.
As described above, according to the present embodiment, the error message indicating that the shared variable is not used in at least one of the program described in the IEC language and the program described in the V+ language, is displayed. Even in this case, by just selecting the shared variable in an outline information in one program, it is possible to display not only the section in which the shared variable is referred in the program, but also the section in which the shared variable is referred in another program on the cross-reference window 52f.
Therefore, a user can easily understand whether or not shared variables are referred properly in all of the programs by seeing the contents displayed on the cross-reference window 52f. As a result, it is possible to confirm the leakage of the implementation of a shared variable, the mistake in the name of a shared variable, the existence of a useless shared variable, etc. Thus, it is possible to debug programs smoothly.
The embodiments are described as the exemplification of the present invention. Therefore, the present invention is not limited to this and various modifications may be made without departing from the scope and spirit of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2018-108920 | Jun 2018 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/021212 | 5/29/2019 | WO | 00 |