Controls

By combining the overall and sequential execution procedures in a single control device and adopting an exclusive licensing mechanism, the management problem of multiple control devices is solved, and the appropriate control of control objects and the simplification of system construction are achieved.

CN113874797BActive Publication Date: 2024-10-11OMRON CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080038653.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-06-20
Filing Date
2020-02-21
Publication Date
2024-10-11
Estimated Expiration
2040-02-21

AI Technical Summary

Technical Problem

In the existing technology, when multiple control devices are used to simultaneously control control objects, insufficient management may cause the control objects to not behave as expected, and the execution methods of different programs lead to an increase in the load of building the control system and an increase in the difficulty of safety control.

Method used

Using a control device that can execute different programs in a single control device, the first processing unit executes the entire program according to the control cycle, and the second processing unit generates intermediate codes through the interpreter and executes the sequential programs, and executes the program at the timing Use an exclusive licensing mechanism when there is overlap to ensure appropriate controls.

Benefits of technology

It achieves proper control of the control objects, reduces the user's burden when building the system, improves the convenience of the control device and the security of the system, avoids the simultaneous control of different programs, and reduces the load of program generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113874797B_ABST
    Figure CN113874797B_ABST
Patent Text Reader

Abstract

A control device, which has a program based on a first execution mode that is executed as a whole each time it is executed, and a program based on a second execution mode that is executed sequentially. The control device has a processing unit that can calculate a second instruction value for controlling a control object based on the execution of the program according to the second execution mode according to an intermediate code generated by an interpreter, and can also calculate the second instruction value for controlling the same control object starting from the execution of the program based on the first execution mode. The control device also has a permission unit that permits the execution of the program of the two programs that accesses the second processing unit first when the execution timings of the two programs overlap.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a control device for controlling one or more control objects. Background Art

[0002] In various production sites, FA (Factory Automation) technology using control devices such as PLC (Programmable Logic Controller) has become widely popular. Such control devices can not only directly control the control object, but sometimes indirectly control the control object by giving control instructions to other devices. In addition, there is a demand to integrate the control system that has been implemented using multiple dedicated devices to a smaller number of control devices. For example, in the technology shown in Patent Document 1, the action operation program and the user program are executed synchronously in the CPU unit of the PLC.

[0003] In addition, Patent Document 2 discloses a technique for implementing control operations based on a plurality of programs with different execution modes by a single control device. In this technique, for example, a structure is adopted in which command value operations are performed for a program in which the entire program is executed in accordance with a control cycle and a program in which the program is sequentially executed based on an intermediate code generated by partial interpretation, and each command value is outputted collectively in accordance with each control cycle.

[0004] Prior art literature

[0005] Patent Literature

[0006] Patent Document 1: Japanese Patent Application Publication No. 2012-194662

[0007] Patent Document 2: Japanese Patent Application Publication No. 2019-36043 Summary of the invention

[0008] Problems to be solved by the invention

[0009] In the past, a common control object (robot, etc.) was sometimes controlled by a control device and other control devices. The control device, such as a PLC, controls the control object by executing a program in which the entire control cycle program is executed, and the other control device controls the control object by executing a program in which intermediate codes generated by interpreting a part of the program are executed sequentially. However, in such a case, it is necessary to manage which control device controls the control object, and it is not easy for the user to build a control system. If it is assumed that the management is insufficient and the control object is controlled by multiple control devices at the same time, it is possible that the action of the control object will not be as expected.

[0010] In addition, in the prior art, there has been no sufficient research on the situation where a single control device that performs control operations based on multiple programs with different execution modes controls a common control object using different programs. Therefore, there is room for improvement from the perspective of the construction load of the control system and the safe control of the control object.

[0011] The present invention has been made in view of such a problem, and an object of the present invention is to provide a technology for easily constructing a system capable of realizing appropriate control of a control object.

[0012] Means for solving problems

[0013] In order to solve the above-mentioned problems, the present invention adopts the following structure: on the basis of being able to execute a plurality of programs with different execution modes by using a single control device, when the execution timings of different types of programs overlap, it is determined whether each program can be executed by executing only one program. By adopting this structure, the execution status of different types of programs can be grasped in real time, and appropriate control of the control object can be achieved.

[0014] Specifically, the present invention is a control device having a program based on a first execution mode that is executed as a whole each time it is executed and a program based on a second execution mode that is executed sequentially, the control device comprising: a first processing unit, which is configured to be able to execute the program based on the first execution mode according to a preset control cycle, and calculate a first instruction value for controlling a first control object; a second processing unit, which is configured to execute the program based on the second execution mode, and calculate a second instruction value for controlling a second control object according to the control cycle based on an intermediate code generated by interpreting at least a part of the program by an interpreter, and even if the execution of the program based on the first execution mode by the first processing unit is used as a starting point, the second instruction value for controlling the second control object can be calculated; an output unit, which outputs the first instruction value and the second instruction value according to each of the control cycles; and a permission unit, which, when the execution timing of the program based on the first execution mode overlaps with the execution timing of the program based on the second execution mode for controlling the second control object, only permits the execution of the program that first accesses the second processing unit.

[0015] The control device described above has programs with different execution modes, namely, programs based on a first execution mode and programs based on a second execution mode. The former execution mode is a mode in which the program is executed as a whole each time it is executed, and the latter execution mode is a mode in which the program is executed sequentially. By being able to use programs with different execution modes as described above, the user can appropriately select a program suitable for controlling the control object, which can improve the convenience of the control device. In addition, the first processing unit executes the program based on the first execution mode according to the control cycle, and calculates the first instruction value based on the program.

[0016] In addition, the second processing unit is configured to calculate the second instruction value based on the program according to the second execution method according to the control cycle based on the intermediate code generated by the interpretation of the interpreter. Furthermore, the second processing unit is configured to be able to calculate the second instruction value even if the execution of the program according to the first execution method is used as the starting point. As the advantages of the structure of such a second processing unit, it can be cited that the user can control the control object (second control object) regardless of whether it is a program based on the first execution method or a program based on the second execution method, so the control program of the control object can be flexibly designed to improve user convenience. In addition, by outputting the first instruction value and the second instruction value by the output unit, each instruction value of the program based on different execution methods can be output synchronously. On the other hand, by such a configuration, the same control object can actually be controlled by both the program based on the first execution method and the program based on the second execution method, so an overlap of control timing may occur.

[0017] Therefore, in the above control device, the following structure is adopted: when the timing of the above program execution overlaps, the permission unit only permits the execution of the program of the party that is accessed first for the control of the control object based on the access status to the second processing unit. Therefore, when the program execution of one party is already in progress, even if the request for the execution of the program of the other party overlaps, the permission unit does not permit the execution of the program of the other party. In other words, when the timing of the program execution for the same control object overlaps, the permission unit performs the above permission processing in a manner of exclusively executing the program based on the access status to the second processing unit.

[0018] Therefore, in the control device configured in this way, it is possible to perform flexible program design for controlling the control object, and it is possible to appropriately avoid the situation where the control object is controlled by different types of programs at the same time while improving the convenience of the user. As a result, it is possible to achieve appropriate control of the control object, and in addition, when constructing the system, the user himself is less likely to generate a program to avoid duplication of control programs, thereby reducing the load of program generation and facilitating system construction.

[0019] Here, in the above-mentioned control device, when the control of the second control object by the program that first accesses the second processing unit ends, a state is formed in which either the program based on the first execution mode or the program based on the second execution mode can be executed with the permission of the permission unit as a condition. By configuring the control device in this way, it is possible to continue to execute the exclusive program for the same control object.

[0020] In addition, in the control device, the permission unit, when allowing the execution of the program of the one party, performs an error notification related to the other party whose program execution is not permitted. With such a structure, the party whose program execution is not permitted can perform a prescribed alternative process based on the error notification.

[0021] Effects of the Invention

[0022] A system capable of realizing appropriate control of a control object can be easily constructed. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a diagram showing a schematic configuration of a control system including an integrated controller.

[0024] Figure 2 This is a functional block diagram that graphically illustrates the functions of the integrated controller.

[0025] Figure 3 This is a diagram showing the flow of processing executed by the integrated controller in accordance with the control cycle.

[0026] Figure 4 This is the first flowchart related to the robot control executed by the integrated controller.

[0027] Figure 5 This is a second flowchart related to robot control performed by the integrated controller.

[0028] Figure 6 This is the third flow chart related to the robot control executed by the integrated controller. DETAILED DESCRIPTION

[0029] <Application Examples>

[0030] based on Figure 1 and Figure 2 An application example of the control device according to the embodiment will be described. Figure 1 is a schematic structural diagram of a control system 1 to which the control device 100 is applied. Figure 2 The figure is a diagram showing an image of a functional unit formed in the control device 100 .

[0031] The control device 100 is equivalent to an industrial controller that controls various equipment, devices and other control objects. The control device 100 is a computer that performs the control operation described below. The control device 100 can be connected to various field devices via the field network 2. Field devices include actuators that give some physical effect to manufacturing equipment, production lines, etc. (hereinafter, also collectively referred to as "fields"), and input and output devices that exchange information with the field. Figure 1 In the embodiment, as field devices, a robot 210, a servo driver 220, and a motor 222 are exemplified. The servo driver 220 drives the motor 222 according to output data (such as position instructions, speed instructions, etc.) from the control device 100. In addition, as the robot 210, a parallel robot, a SCARA robot, and a multi-joint robot can be exemplified. In this way, the control device 100 is a control device configured in a manner capable of uniformly controlling the robot 210, the servo driver 220, and the motor 222, and the details thereof will be described later.

[0032] The control device 100 exchanges data with one or more field devices via the field network 2 or the like. Generally speaking, a "field network" is also called a "field bus", but for simplicity of description, it is generally referred to as a "field network" in this application. The control device 100 performs processing (input processing) of collecting data collected or generated in various field devices (hereinafter, also referred to as "input data"), processing (calculation processing) of generating data such as instructions for field devices (hereinafter, also referred to as "output data"), and processing (output processing) of sending the generated output data to the target field device.

[0033] Here, the field network 2 preferably adopts a bus or network that performs fixed-cycle communication and can guarantee the arrival time of data. As a bus or network that performs such fixed-cycle communication, EtherCAT (registered trademark) and the like are known. In addition, the data exchanged between the control device 100 and the field device via the field network 2 is updated in an extremely short cycle of hundreds of μsec to tens of msec. In addition, the update process of the data exchanged in this way is also called input / output refresh processing.

[0034] In addition, the control device 100 is also connected to other devices via the host network 6. The host network 6 can adopt Ethernet (registered trademark) or EtherNet / IP (registered trademark) as a general network protocol. More specifically, one or more server devices 10 can be connected to the host network 6. As the server device 10, a database system, a manufacturing execution system (MES: Manufacturing Execution System), etc. are conceivable. The manufacturing execution system obtains information from the manufacturing device and equipment that are the control objects, monitors and manages the entire production, and can process command information, quality information, shipment information, etc. However, it is not limited to this, and a device that provides information system services can also be connected to the host network 6.

[0035] Here, based on Figure 2 The structure of the control device 100 is described. The control device 100 is a computer that performs the specified control operation as described above, and has a processor and memory required for the control operation. The processor is composed of a CPU (Central Processing Unit), an MPU (Micro Processing Unit), a GPU (Graphics Processing Unit), etc. As a processor, a structure with multiple cores can be adopted, and multiple processors can be configured. As the memory, it is composed of volatile storage devices such as DRAM (Dynamic Random Access Memory), SRAM (Static Random Access Memory), HDD (Hard Disk Drive), SSD (Solid State Drive) and other non-volatile storage devices. In addition, the processor realizes the control corresponding to the control object and various processes described later by reading and executing various programs stored in the memory. In the memory, in addition to storing system programs for realizing basic functions, user programs (IEC programs 51 and application programs 52) generated according to manufacturing devices and equipment as control objects are also stored.

[0036] In addition, the IEC program 51 in the present application refers to a program that is scanned as a whole each time it is executed, and calculates one or more instruction values ​​each time it is executed, and typically includes a program consisting of one or more instructions described in accordance with the international standard IEC61131-3 specified by the International Electrotechnical Commission (IEC). The IEC program 51 includes instructions for sequence control and motion control. Such an IEC program 51 corresponds to an execution method that executes (scans) all programs according to a control cycle, and is suitable for control that requires immediacy and high speed. On the other hand, the application program 52 in the present application is a control program for using a robot to perform specific processing or actions, and includes a program consisting of one or more instructions for implementing a control application of the robot, and is basically distinguished from the IEC program 51. As an example, the application program 52 related to robot control adopts an interpreter mode that is described in a robot language and executed line by line.

[0037] And, if Figure 2 As shown, the control device 100 includes an IEC program processing unit 40, a lower network interface 60, an upper network interface 20, and a control application processing unit 30. The lower network interface 60 mediates data exchange between field devices connected to the IEC program processing unit 40 and the control application processing unit 30 via the field network 2. The upper network interface 20 mediates data exchange between the server device 10 connected to the IEC program processing unit 40 and the control application processing unit 30 via the upper network 6. For example, the control device 100 receives an instruction such as start / end of production from the server device 10 connected via the upper network 6. The server device 10 sometimes also sends an application program and recipe information (information such as parameters applied to production) for operating the control application to the control device 100.

[0038] The IEC program processing unit 40 executes (scans) the IEC program 51 in accordance with each predetermined control cycle to calculate one or more instruction values. That is, the IEC program processing unit 40 calculates the instruction value in accordance with the IEC program 51 in accordance with each control cycle. In addition, in the present application, the IEC program 51 is executed in order to control a predetermined device including the motor 222. And the action processing unit 42 provides a function of calculating the instruction value in each control cycle in accordance with the action command included in the IEC program 51. That is, the action command included in the IEC program 51 includes a command for instructing an action over a plurality of control cycles (for example, a command for causing the output of a predetermined device composed of the motor 222 to draw a certain trajectory). When executing such an action command, the action processing unit 42 calculates the instruction value in accordance with each control cycle based on the instruction content of the executed action command. That is, the action processing unit 42 implements the action indicated by the action command by outputting the instruction value to the above-mentioned predetermined device in accordance with each control cycle.

[0039] Next, the control application processing unit 30 calculates the command value for controlling the control application based on the application 52 and the scheme information. In addition, in the present application, the control application processing unit 30 executes the application 52 in order to control the robot 210. The control application processing unit 30 calculates and outputs the command value for controlling the application in synchronization with the calculation and output of the command value of the IEC program processing unit 40. That is, the control application processing unit 30 performs the calculation processing of the command value in synchronization with the calculation processing of the IEC program processing unit 40. In addition, the synchronization processing of the IEC program processing unit 40 and the control application processing unit 30 will be described later. In order to realize the calculation of the command value synchronized with the calculation processing of the command value of the IEC program processing unit 40, the control application processing unit 30 includes an action processing unit 32, a buffer 33, and an interpreter 34.

[0040] The interpreter 34 has a buffer 33, which sequentially interprets at least a part of the application 52 to generate an intermediate code, and stores the generated intermediate code. The intermediate code in the present application is a concept including commands for calculating instruction values ​​according to each control cycle, and can include one or more commands, or one or more functions. Then, the action processing unit 32 calculates the instruction value according to each control cycle according to the intermediate code pre-generated by the interpreter 34 and stored in the buffer 33. Generally speaking, since the commands (codes) described in the application 52 are executed sequentially, the calculation cycle of the instruction value cannot be guaranteed, but in the present application, by using the intermediate code in this way, the action processing unit 32 can calculate the instruction value according to each control cycle. The commands described in the intermediate code can use the coordinate system corresponding to each control application.

[0041] Furthermore, a shared memory 31 is provided to share data between the IEC program processing unit 40 and the control application processing unit 30. In the present application, a part or all of the processing results of the control application processing unit 30 are stored in the shared memory 31, and the IEC program processing unit 40 can refer to the data stored in the shared memory 31 of the control application processing unit 30. In addition, data can be written from the IEC program processing unit 40 to the shared memory 31 of the control application processing unit 30, so that the data written from the IEC program processing unit 40 can be referred to by the interpreter 34 and the action processing unit 32.

[0042] Here, as described above, the robot 210 is controlled by the motion processing unit 32 using the intermediate code generated by the interpreter 34, but as another way of controlling the robot 210, the motion processing unit 32 can also control the robot 210 starting from the execution of the IEC program 51. In this case, the IEC program 51 includes control instructions (motion instructions) for the robot 210. First, when the IEC program 51 is executed by the IEC program processing unit 40, the control instructions for the robot 210 included therein are handed over to the motion processing unit 32, and the robot 210 is controlled based on the control instructions.

[0043] In this way, the control device 100 is configured to control the robot 210 according to both the IEC program 51 and the application program 52 having different execution modes, so that the control system 1 for realizing the user's requirements can be flexibly constructed according to the characteristics of each program. On the other hand, adopting such a structure means that the robot 210 can be controlled by different types of programs. Therefore, regarding the control of the robot, if the execution timing of the two programs overlaps, it is difficult to make the robot 210 operate as expected. In other words, in order to avoid such undesirable actions of the robot 210, the user needs to appropriately manage the correlation between the execution timing of the two programs, which is a considerable burden on the user.

[0044] Therefore, the control device 100 includes a permission unit 35, which permits the execution of either program but does not permit the execution of the other program when the execution timing of the IEC program 51 and the application program 52 for robot control overlaps, that is, it permits the execution of either program. The permission unit 35 limits the program for controlling the robot 210 in the control device 100 to either the IEC program 51 or the application program 52. This can prevent the robot 210 from taking an unexpected action when the execution timing of the IEC program 51 and the application program 52 overlap.

[0045] <Synchronous execution of programs>

[0046] In the control device 100, the IEC program 51 and the application program 52 are executed synchronously. The interpreter 34 of the control application processing unit 30 executes the application program 52 in sequence according to a cycle longer than the control cycle, for example, a cycle twice the control cycle. However, the action processing unit 42 of the IEC program processing unit 40 and the action processing unit 32 of the control application processing unit 30 both calculate the command value according to the same control cycle. Therefore, the output of the command value from the control device 100 is performed synchronously according to a predetermined control cycle. In this way, the IEC program processing unit 40 and the control application processing unit 30 each have an action processing unit for continuously controlling the action of the actuator, and these action processing units synchronously calculate the command value, thereby enabling both the control based on the IEC program 51 and the control based on the application program 52 to be executed synchronously with the control cycle, thereby realizing precise control in units of control cycles.

[0047] Next, based on Figure 3 , the details of the execution timing of the IEC program 51 and the application program 52 in the control device 100 will be described. Figure 3 1 is a diagram showing an example of the execution timing of the program in the control device 100. In addition, in the control device 100, a high priority task ( Figure 3 The upper layer processing in the ) and the low priority tasks with low priority ( Figure 3 Specifically, the execution of the lower network interface 60, the IEC program processing unit 40 and its action processing unit 42, and the execution of the action processing unit 32 of the control application processing unit 30 are set as high priority tasks, and the execution of the interpreter 34 of the control application processing unit 30 is set as a low priority task.

[0048] That is, the input / output refresh process B60 associated with the lower network interface 60, the execution process B40 of the IEC program 51, the operation process B42 of the command value performed by the action processing unit 42 based on the IEC program 51, the operation process B32 of the command value performed by the action processing unit 32 based on the application program 52, and the operation process B32' of the command value performed by the action processing unit 32 starting from the IEC program 51 are executed as high priority tasks. On the other hand, the process B34 of sequentially interpreting the application program 52 is executed as a low priority task. In addition, for the high priority task in one control cycle T1, only one of the operation process B32 and the operation process B32' is performed by the permission process of the permission unit 35 described above.

[0049] Here, the high priority task is repeatedly executed according to the preset control cycle T1. The low priority task is executed every time the high priority task is not executed in each control cycle. That is, the execution time of the high priority task is allocated according to the control cycle, and the low priority task is executed during the time other than the execution time of the high priority task.

[0050] First, the high priority task is explained. When each control cycle arrives, after executing the input / output refresh processing B60, the entire IEC program 51 is executed (scanned) by the IEC program processing unit 40, and one or more instruction values ​​for sequence control are calculated (execution processing B40). At the same time, the action processing related to the action command included in the IEC program 51 is executed by the action processing unit 42, and one or more instruction values ​​for the action command are calculated (execution processing B42). Furthermore, the action processing unit 32 of the control application processing unit 30 prepares the action command for controlling the robot 210 according to the intermediate code stored in the buffer 33 (execution processing B32), or prepares the action command for controlling the robot 210 included in the IEC program 51 (execution processing B32'). Whether to execute processing B32 or execution processing B32' depends on the permission processing of the permission unit 35. The specific processing will be described later. In the following, the same processing is overlapped in each control cycle. In addition, the timing of the action processing unit 32 reading the intermediate code from the buffer 33 may not be each control cycle. When the read intermediate code includes a command whose command value can be calculated only in a plurality of control cycles T1, the intermediate code can be read simultaneously in the plurality of control cycles T1.

[0051] In this way, when the execution of the high priority task in a certain control cycle is completed, a set of command values ​​for the sequence control related to the motor 222, the command value for the motion control, and the command value for the control application related to the robot 210 are prepared. These command values ​​are basically reflected to the field side when the next control cycle arrives. That is, the IEC program processing unit 40 and the control application processing unit 30 calculate the command value corresponding to the input data in the same control cycle, so that the output can be synchronized with the input.

[0052] On the other hand, regarding the low priority task, the interpreter 34 of the control application processing unit 30 sequentially executes the application 52. That is, the interpreter 34 reads and analyzes the application 52 at a low priority. The intermediate codes generated by the interpreter 34 analyzing the application 52 are sequentially stored in the buffer 33 while taking the capacity of the buffer 33 into consideration. The intermediate codes stored in the buffer 33 are sequentially referred to by the action processing unit 32 of the control application processing unit 30 to generate the instruction value in the operation processing B32. At this time, the interpreter 34 generates the intermediate codes of the integral multiple of the control cycle as the operation cycle of the high priority task in advance, so that the instruction value for the control application can be calculated according to the control cycle without affecting the processing of the action processing unit 32.

[0053] In addition, the interpreter 34 temporarily stops interpreting the application 52 before the arrival of the preset control application synchronization cycle (integer multiple of the control cycle). At the timing of the temporary stop, data synchronization is performed between the IEC program processing unit 40 and the control application processing unit 30, so that both parties share matching data. In this way, the interpreter 34 updates the data shared with the IEC program processing unit 40 in each synchronization cycle. It is also possible to update the input data and output data obtained from the field side together with the update of the shared data (data synchronization). Thus, even on the control application processing unit 30 side, the data obtained by the IEC program processing unit 40 can be used to control the robot 210. As long as the control application synchronization cycle is set to an integer multiple of the control cycle, it can be of any length. It is appropriately set according to the accuracy of control required in the control application.

[0054] Next, based on Figures 4 to 6 , the processing flow of the field equipment (robot 210 and motor 222) of the control device 100 is explained. Figure 4 is a flowchart related to the processing of the above-mentioned high priority tasks, Figure 5 is a flowchart showing details of robot execution processing performed in a high priority task, Figure 6 This is a flowchart related to the processing of the above-mentioned low priority tasks.

[0055] First, the processing flow of the high priority task is described. When the control cycle T1 arrives, the lower network interface 60 performs input and output refresh processing (processing of S101). As a result, the command value (based on the command value of B40, B42, B32, B32', etc.) calculated in the immediately preceding control cycle T1 is output to the actuator of the field device, etc., and the input data from the field device is obtained. Next, in S102, it is determined whether the control cycle of this time is consistent with the timing of data synchronization. Therefore, if a positive determination is made, data synchronization is performed between the IEC program processing unit 40 and the control application processing unit 30 (processing of S103). In addition, if a negative determination is made in S102, the processing enters S104.

[0056] Next, the execution process B40 described above is performed in S104 , and then the execution process B42 described above is performed in S105 . Thereafter, a robot execution process is performed in S106 , in which a motion command for controlling the robot 210 is prepared.

[0057] Here, based on Figure 5 , the robot execution processing is explained. First, in S201, it is determined whether there is a request for occupying the robot 210, that is, an occupation request, during the control of the robot 210. The occupation request is a request output from the IEC program 51 and the application program 52 containing the control instruction for the robot 210 to the control application processing unit 30 before the instruction starts when it is desired to instruct the robot 210 to control a series of specified contents. In addition, if the output occupation request is permitted by the occupation permission determination in S203 or S206 described later, the robot 210 is controlled to be occupied by any program before the occupation elimination process in S211 described later is performed. If an affirmative determination is made in S201, the process enters S202, and if a negative determination is made, the process enters S220.

[0058] In S202, it is determined whether the program that issued the above-mentioned occupation request is the application program 52 or the IEC program 51. In the case of the former, the processing enters S203, and in the case of the latter, the processing enters S206. Then, in S203, it is determined whether the occupation request issued from the application program 52 is permitted. This determination is performed by the permission unit 35. In this determination, in the case where the control of the robot 210 is not placed in the occupied state by another program, namely, the IEC program 51, the occupation request issued from the application program 52 is permitted (affirmative determination in S203). On the other hand, in the case where the control of the robot 210 has been occupied by the IEC program 51, the occupation request is not permitted (negative determination in S203). In S203, if an affirmative determination is made, the processing enters S204, and if a negative determination is made, the processing enters S208.

[0059] In addition, in S204, the intermediate code is read from the buffer 33 by the action processing unit 32, and then in S205, the action processing unit 32 calculates the action instructions for controlling the robot 210 in this control cycle T1 according to the read intermediate code, in preparation for synchronous control (equivalent to the processing of the calculation processing B32).

[0060] In addition, in S206, it is determined whether the occupation request output from the IEC program 51 is permitted. This determination is also performed by the permitting unit 35. In this determination, when the control of the robot 210 is not placed in the occupied state by another program, that is, the application program 52, the occupation request issued from the IEC program 51 is permitted (affirmative determination in S206). On the other hand, when the control of the robot 210 has been occupied by the application program 52, the occupation request is not permitted (negative determination in S206). In S206, if an affirmative determination is made, the process proceeds to S207, and if a negative determination is made, the process proceeds to S208.

[0061] Furthermore, in S207 , an operation command for controlling the robot 210 included in the IEC program 51 is prepared for synchronous control (processing corresponding to the calculation process B32 ′).

[0062] Here, if a negative determination is made in the above S203 and S206, the process proceeds to S208, and in S208, an error notification is issued by the permission unit 35. This error notification is a notification that the occupation request issued by the own program is not permitted because the robot 210 is in a state occupied by another program in order to control the robot 210. Next, in S209, an action instruction for controlling the robot 210 is prepared according to the program currently occupied for synchronous control. That is, when the robot 210 is occupied by the application program 52, the processing equivalent to S204 and S205 is performed, and when the robot 210 is occupied by the IEC program 51, the processing equivalent to S207 is performed.

[0063] Then, after the processing of S205, S207, and S209, the processing of S210 is performed. In S210, it is determined whether a series of controls of the robot 210 by each program have ended. The end of the control can be determined based on the control end instruction issued from each program, etc. If an affirmative determination is made in S210, then in the next S211, the occupied state of the robot 210 so far is released, and thereafter, the robot 210 can be controlled by any program to become a state where it is not occupied. If a negative determination is made in S210, the occupied state of the robot 210 so far is maintained.

[0064] Here, the case where a negative determination is made in the above-mentioned S201 and the process proceeds to S220 is described. In S220, when there is no occupation request (when a negative determination is made in S201), it is determined whether there is a program that is occupying the control of the robot 210. If a positive determination is made in S220, the process proceeds to S209, and for synchronous control, an action instruction for controlling the robot 210 is prepared according to the program that is occupying at that time. In addition, if a negative determination is made in S220, the robot execution process ends. In this case, an action instruction for controlling the robot 210 is not prepared.

[0065] pass Figure 4 as well as Figure 5 The command value calculated and prepared by a series of processing of the high priority task shown is output to the field when the next control cycle T1 arrives. And, after the completion of the series of processing and before the arrival of the next control cycle T1, the execution Figure 6 Low priority tasks shown.

[0066] based on Figure 6 , the processing flow of the low priority task is described. The low priority task involves the interpretation processing of the application 52 by the interpreter 34. First, in S301, the control application processing unit 30 determines whether there is any intermediate code remaining in the buffer 33. This determination is made in order not to generate intermediate code that exceeds the capacity of the buffer 33. If a positive determination is made in S301, the low priority task ends, and if a negative determination is made, the processing enters S302. In S302, a part of the application 52 is read in by the interpreter 34. For example, one line of code constituting the application 52 is read in. And, in S303, the read code is interpreted by the interpreter 34 to generate intermediate code. The generated intermediate code is stored in the buffer 33 in S304. In addition, regarding the processing of S302 to S304, these processings are not performed when there is no application to be executed, and as a result, the intermediate code is not stored in the buffer 33. The low priority task having such a series of processing is overlapped during the period of time during which the execution time of the program is allocated to itself.

[0067] By conducting Figures 4 to 6 The series of processing shown in FIG. 1 is performed in the control device 100. Figure 3The IEC program 51 and the application program 52 are executed at the execution timing shown. In particular, regarding the motion control of the robot 210, the motion processing unit 32 implements exclusive motion control based on either the IEC program 51 or the application program 52 through the permission processing of the permission unit 35. By adopting such a structure, a user who wants to build the control system 1 can entrust the motion control of the robot 210 to the permission processing of the permission unit 35. Therefore, the user can easily build a control system 1 that can appropriately control the robot 210.

[0068] <Additional Note 1>

[0069] A control device (100) comprising a program (51) based on a first execution mode which is executed in its entirety each time it is executed and a program (52) based on a second execution mode which is executed sequentially,

[0070] The control device (100) comprises:

[0071] A first processing unit (40) is configured to execute a program (51) based on the first execution mode according to a preset control cycle to calculate a first instruction value for controlling a first control object (222);

[0072] a second processing unit (30) configured to execute a program (52) based on the second execution mode, and to calculate a second instruction value for controlling a second controlled object (210) according to the control cycle based on an intermediate code generated by interpreting at least a part of the program by an interpreter (34), and to be able to calculate the second instruction value for controlling the second controlled object (210) even when the first processing unit (40) executes the program (51) based on the first execution mode as a starting point;

[0073] an output unit (60) for outputting the first instruction value and the second instruction value in each control cycle; and

[0074] A permission unit (35) that permits execution of only the program that first accesses the second processing unit (30) when the execution timing of the program (51) based on the first execution method and the execution timing of the program (52) based on the second execution method overlap in order to control the second control object (210).

[0075] Description of symbols

[0076] 1: control system; 2: field network; 6: upper network; 10: server device; 30: control application processing unit; 40: IEC program processing unit; 51: IEC program; 52: application program; 210: robot; 220: servo drive; 222: motor.

Claims

1. A control device comprising a program based on a first execution mode that is executed as a whole each time it is executed and a program based on a second execution mode that is executed sequentially, wherein: The control device comprises: a first processing unit configured to execute a program based on the first execution mode at a preset control cycle to calculate a first command value for controlling a first controlled object; a second processing unit configured to execute a program based on the second execution mode, to calculate a second instruction value for controlling a second controlled object according to the control cycle based on an intermediate code generated by interpreting at least a part of the program by an interpreter, and to calculate the second instruction value for controlling the second controlled object even when the execution of the program based on the first execution mode by the first processing unit is used as a starting point; an output unit configured to output the first instruction value and the second instruction value in each control cycle; as well as The permission unit permits execution of only the program that accesses the second processing unit first when the execution timing of the program based on the first execution method overlaps with the execution timing of the program based on the second execution method for controlling the second control object.

2. The control device according to claim 1, wherein: When control of the second control object based on the program that first accesses the second processing unit ends, a state is formed in which either the program based on the first execution method or the program based on the second execution method can be executed subject to the permission of the permission unit.

3. The control device according to claim 1 or 2, wherein: The permission unit, when the execution of the one program is permitted, performs an error notification regarding the other program for which the execution is not permitted.