Controls

By executing programs of different execution methods in a single control device and sharing variables, the problem of complexity in sharing and access between multiple control objects is solved, and the user program load is reduced and the convenience of the control device is improved.

CN114585979BActive Publication Date: 2024-12-03OMRON CORP
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202080073707.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-11-12
Filing Date
2020-10-21
Publication Date
2024-12-03
Estimated Expiration
2040-10-21

AI Technical Summary

Technical Problem

In the control operation of multiple control objects, it is difficult for the prior art to effectively share variables between different types of programs, resulting in an increase in user program generation load, and variable access between different control devices requires communication processing, which increases complexity.

Method used

Using a control device, programs of different execution modes can be executed in a single control device. By keeping variables on each program side, they are shared among different processing units, reducing the complexity of variable access, and synchronizing through the output unit. Output command values ​​to reduce the user program generation load.

Benefits of technology

It realizes the reduction of user program generation load in a single control device, simplifies variable management and data exchange, and improves the convenience and efficiency of the control device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114585979B_ABST
    Figure CN114585979B_ABST
Patent Text Reader

Abstract

The control device includes a first processing unit and a second processing unit, wherein the processing unit of either the first processing unit or the second processing unit maintains a specified variable that can be used in both the operation of the first processing unit and the operation of the second processing unit, and the processing unit of the other of the first processing unit and the second processing unit is configured to be able to access the specified variable via the processing unit of the one processing unit.
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 a plurality of control objects. Background Art

[0002] In various production sites, FA (Factory Automation) technology using control devices such as PLC (Programmable Logic Controller) is widely used. Such control devices not only directly control the control object, but also indirectly control the control object by providing control instructions to other devices. In addition, there is a demand to merge the control system that has been implemented using multiple dedicated devices into 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 in accordance with a plurality of programs having different execution modes by a single control device. In this technique, for example, a structure is adopted in which command value operations are performed on a program in which the entire program is executed in each control cycle and a program in which intermediate codes generated by partial interpretation are sequentially executed, and each command value is outputted collectively in 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] When control operations are performed in accordance with a plurality of programs with different execution modes in order to control a plurality of control objects, the variables used in each control operation are generally appropriately set according to the control operation. Therefore, when each control operation is performed by a different control device, when a variable used by another control device needs to be accessed in the control operation of one control device, communication processing for accessing the variable needs to be performed between the different control devices. As a result, in order to control a plurality of control objects at the same time, the user needs to create a program according to the type of program that executes the control operation for controlling each control object, and needs to create a processing program related to the communication of variables (data) between the two programs (two control devices).

[0010] In addition, even when a single control device performs control operations in accordance with a plurality of programs with different execution modes in order to control a plurality of control objects, the specific structure for exchanging variables used for operation processing between different types of programs has not been fully studied. That is, in the prior art, when variables used for control operations are shared between different types of programs, there has been no sufficient research. Therefore, even when a single control device controls different control objects, the program generation load of the user cannot be fully reduced.

[0011] The present invention has been made in view of such problems, and an object of the present invention is to provide a technology capable of reducing the program generation load on a user even when a control operation in accordance with a plurality of programs having different execution modes is performed by a single control device.

[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 multiple programs with different execution modes by a single control device, variables that can be used in each program are maintained on the program side of one side, and the program of the other side accesses the variables via the program of the one side. By adopting this structure, the user can easily manage the variables, and the program generation load of the user is reduced.

[0014] Specifically, the present invention is a control device having a program that follows a first execution mode that is executed as a whole each time it is executed and a program that follows a second execution mode that is executed sequentially, the control device comprising: a first processing unit that is configured to execute the program that follows the first execution mode in each predetermined control cycle and calculate a first instruction value for controlling a first control object; a second processing unit that is configured to execute the program that follows the second execution mode and calculate a second instruction value for controlling a second control object in each control cycle according to an intermediate code generated by interpreting at least a part of the program by an interpreter; and an output unit that outputs the first instruction value and the second instruction value in each control cycle. In addition, in the control device, the processing unit of either the first processing unit or the second processing unit is configured to hold a predetermined variable that can be used in both the calculation of the first processing unit and the calculation of the second processing unit, and the processing unit of the other of the first processing unit and the second processing unit is configured to access the predetermined variable via the processing unit of the first processing unit.

[0015] The control device has a program that follows a first execution mode and a program that follows a second execution mode as programs with different execution modes. The former execution mode is a form in which the program is executed as a whole each time it is executed, and the latter execution mode is a form in which the program is executed sequentially. By being able to use programs with different execution modes in this way, the user can appropriately select a program suitable for controlling the control object, thereby improving the convenience of the control device.

[0016] The first processing unit executes a program that complies with the first execution mode in each control cycle and calculates a first instruction value based on the program. In addition, the second processing unit is configured to calculate a second instruction value based on a program that complies with the second execution mode in each control cycle according to the intermediate code generated by the interpretation of the interpreter. Furthermore, by outputting the first instruction value and the second instruction value through the output unit, the instruction values ​​of the programs based on different execution modes can be output synchronously.

[0017] In the control device thus constructed, the processing unit of either the first processing unit or the second processing unit is constructed to hold prescribed variables used in both the operation of the first processing unit and the operation of the second processing unit. That is, the prescribed variables are used by the processing units of both parties, but are only held by the processing unit of one party. On this basis, when the processing unit of the other party of the first processing unit and the second processing unit that does not hold the prescribed variables needs the prescribed variables for its own operation, it accesses the prescribed variables via the processing unit of the party holding the prescribed variables. As a result, the processing unit of the other party can also use the prescribed variables to realize its own operation. At this time, the first processing unit and the second processing unit are formed in a single control device, so the user does not need to prepare a program for controlling the data exchange between the first processing unit and the second processing unit, and the user's load can be reduced.

[0018] Here, as an example, the processing unit of one side may be the first processing unit, and the processing unit of the other side may be the second processing unit. In addition, as another method, the processing unit of one side may be the second processing unit, and the processing unit of the other side may be the first processing unit.

[0019] In addition, in the control device described above, the prescribed variable may be set to the same variable name in the calculation of the processing unit of the one party and the calculation of the processing unit of the other party. In this case, when the prescribed variable is used by the processing unit of the other party, the processing unit of the other party uses the value of the variable having the same variable name as the prescribed variable in the processing unit of the one party as the value of the prescribed variable. That is, for the prescribed variable, by making the variable name the same in the processing unit of one party and the processing unit of the other party, the prescribed variable between the two processing units is exchanged using the variable name.

[0020] In addition, as another method, in the control device described above, the first variable name of the prescribed variable in the operation of the processing unit of the one party is different from the second variable name of the prescribed variable in the operation of the processing unit of the other party, and related information that specifies the correlation between the first variable name and the second variable name is maintained. In this case, when the variable with the second variable name is used as the prescribed variable by the processing unit of the other party, the processing unit of the other party uses the value of the variable with the first variable name associated with the second variable name as the value of the prescribed variable based on the related information. That is, with respect to prescribed variables, related information related to variable names that are different between the processing unit of one party and the processing unit of the other party is maintained in the control device, thereby performing exchange of prescribed variables between the two processing units based on the related information.

[0021] Effects of the Invention

[0022] Even when a single control device performs control operations in accordance with a plurality of programs having different execution modes, it is possible to reduce the program generation load on the user. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0025] [ Figure 3 ] Figure 3 This is a diagram showing the correlation between variables used in robot control executed by the integrated controller and variables used in PLC control.

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

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

[0028] [ Figure 6 ] Figure 6 This is a second flowchart related to robot control performed by the integrated controller. DETAILED DESCRIPTION

[0029] <Application Examples>

[0030] based on Figure 1 as well as 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 control operations as described below. The control device 100 can also be connected to various field devices via the field network 2. Field devices include actuators that give certain physical effects 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 figure, 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 the command value (e.g., position command, speed command, 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 configured to be able to comprehensively control the robot 210, the servo driver 220, and the motor 222, and its details 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, a "field network" is also called a "field bus", but for simplicity of description, it is collectively referred to as a "field network" in this application. The control device 100 performs processing (input processing) of collecting data (hereinafter, also referred to as "input data") collected or generated in various field devices, 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 guarantees the arrival time of data. As a bus or network that performs such fixed-cycle communication, EtherCAT (registered trademark) and the like are known. Moreover, 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 the order of several 100 μsec to the order of several 10 msec. In addition, the update process of such exchanged data is also called input / output refresh processing.

[0034] In addition, the control device 100 is also connected to other devices via the upper network 6. The upper network 6 may also adopt Ethernet (registered trademark) or EtherNet / IP (registered trademark) as general network protocols. More specifically, one or more server devices 10 may also be connected to the upper network 6. As the server device 10, a database system, a manufacturing execution system (MES: Manufacturing Execution System), etc. are envisioned. The manufacturing execution system obtains information from the manufacturing devices and equipment of the controlled object, monitors and manages the overall production, and can also process order information, quality information, shipping information, etc. Without being limited to this, a device that provides information system services may also be connected to the upper 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 processing described later by reading and executing various programs stored in the memory. In the memory, in addition to the system program for realizing the basic functions, the user program (IEC program 51 and application program 52) made according to the manufacturing device or equipment as the control object is also stored.

[0036] In addition, the IEC program 51 in the present application is 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. Typically, it 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 commands for sequence control and motion control. This IEC program 51 corresponds to an execution method that executes (scans) all programs in each 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 robot-based control application, which is distinguished from the IEC program 51. As an example, the application program 52 related to robot control adopts an interpreter method that is described in a robot language and executed line by line.

[0037] Moreover, if Figure 2 As shown, the control device 100 includes a control application processing unit 30, an IEC program processing unit 40, an upper network interface 20, and a lower network interface 60. The lower network interface 60 mediates data exchange between the IEC program processing unit 40 and the control application processing unit 30 and the field device connected via the field network 2. The upper network interface 20 mediates data exchange between the IEC program processing unit 40 and the control application processing unit 30 and the server device 10 connected 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 suitable for 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 each predetermined control cycle to calculate one or more command values. That is, the IEC program processing unit 40 calculates the command value in each control cycle according to the IEC program 51. In addition, in the present application, the IEC program 51 is executed in order to control the prescribed device composed of the motor 222. Moreover, the motion processing unit 42 provides a function of calculating the command value in each control cycle according to the motion command contained in the IEC program 51. That is, the motion command contained in the IEC program 51 includes a command indicating a behavior across multiple control cycles (for example, a command for causing the output of the prescribed device composed of the motor 222 to draw a certain trajectory). When such a motion command is executed, the motion processing unit 42 calculates the command value in each control cycle according to the instruction content of the executed motion command. That is, the motion processing unit 42 realizes the behavior indicated by the motion command by outputting the command value to the above-mentioned prescribed device in each control cycle.

[0039] In addition, the IEC program processing unit 40 has a shared memory 41. The shared memory 41 holds data (variable data) related to a predetermined variable used in the operation processing of the command value of the action processing unit 42. Therefore, the IEC program processing unit 40 accesses the shared memory 41 at an appropriate time when the command value is operated to control the behavior of the predetermined device. In addition, the variable data held in the shared memory 41 is configured to be accessible also from the control application processing unit 30 described later, and the details thereof will be described later. In addition, data other than the variable data used for the command value operation described above can also be stored in the shared memory 41. For example, in the disclosure of the present application, part or all of the processing results of the IEC program processing unit 40 are stored in the shared memory 41, and the control application processing unit 30 can refer to the data stored in the shared memory 41 of the IEC program processing unit 40. In addition, data can also be written from the control application processing unit 30 to the shared memory 41 of the IEC program processing unit 40, so that the data written from the control application processing unit 30 can be referred to by the action processing unit 42.

[0040] Next, the control application processing unit 30 calculates the command value for controlling the control application based on the application 52 and the recipe 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 the control application in synchronization with the command value calculation and output of the IEC program processing unit 40. That is, the control application processing unit 30 performs the calculation processing of the command value for controlling the robot 210 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.

[0041] The interpreter 34 has a buffer 33 for successively interpreting at least a part of the application 52 to generate an intermediate code, and storing the generated intermediate code. The intermediate code in the present application is a concept including commands for calculating instruction values ​​in each control cycle, and may also include one or more commands, or one or more functions. Then, the motion processing unit 32 calculates the instruction value in each control cycle according to the intermediate code generated in advance by the interpreter 34 and stored in the buffer 33. Generally speaking, since the commands (codes) recorded in the application 52 are executed one by one, the calculation cycle of the instruction value cannot be guaranteed, but in the disclosure of the present application, by using the intermediate code in this way, the motion processing unit 32 can calculate the instruction value in each control cycle. The commands recorded in the intermediate code can also use the coordinate system corresponding to each control application.

[0042] In addition, the control application processing unit 30 is configured to be able to access the shared memory 41 as needed for the calculation processing of the command value for controlling the robot 210 by the motion processing unit 32. For example, when a predetermined device including the motor 222 and the robot 210 are synchronously controlled, if the action of the robot 210 needs to be determined corresponding to the action of the predetermined device, it is necessary to use the variable data associated with the predetermined device and stored in the shared memory 41 in the calculation processing of the action processing unit 32. In this case, the control application processing unit 30 accesses the shared memory 41 via the IEC program processing unit 40 to obtain the variable data.

[0043] A specific method of variable data in the shared memory 41 based on the control application processing unit 30 is described. In the first method, the variable name used for the command value calculation of the IEC program processing unit 40 and the variable name used for the command value calculation of the control application processing unit 30 are set to be the same. In this case, when the operation processing of the motion processing unit 32 is performed in the control application processing unit 30, the IEC program processing unit 40 is queried by returning the value of the variable with the same name as the variable included in the application 52. If the variable with the same name is stored in the shared memory 41, the IEC program processing unit 40 that is queried returns the variable data of the variable to the control application processing unit 30. As a result, the motion processing unit 32 continues the operation processing. In addition, if the variable with the same name is not stored in the shared memory 41, the IEC program processing unit 40 returns an error signal to the control application processing unit 30.

[0044] In the second embodiment, the variable names used for the command value calculation of the IEC program processing unit 40 and the variable names used for the command value calculation of the control application processing unit 30 are set to different variable names. In addition, the table (refer to Figure 3 ) is stored in the control application processing unit 30. In this case, when the operation processing of the action processing unit 32 is performed in the control application processing unit 30, the variable ( Figure 3 The variables ( Figure 3 In the "variable on the IEC program processing unit side" in the IEC program processing unit, the control application processing unit 30 performs an inquiry process on the IEC program processing unit 40 in order to return the value of the determined variable. The response after the inquiry is the same as the first method.

[0045] In this way, by adopting a method of sharing variables used for command value calculations between the IEC program processing unit 40 and the control application processing unit 30 via the shared memory 41, the user does not need to prepare a separate program for controlling data exchange between the IEC program processing unit 40 and the control application processing unit 30 when performing synchronous control of a specified device and the robot 210, thereby reducing the user's load.

[0046] <Synchronous execution of programs>

[0047] In the control device 100, the synchronous execution of the IEC program 51 and the application program 52 is realized. The interpreter 34 of the control application processing unit 30 executes the application program 52 successively in a cycle longer than the control cycle, for example, a cycle twice the control cycle. Among them, 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 instruction value in each identical control cycle. Therefore, the output of the instruction value from the control device 100 is synchronized with the predetermined control cycle. In this way, the IEC program processing unit 40 and the control application processing unit 30 respectively have an action processing unit for continuously controlling the action of the actuator, and these action processing units synchronously calculate the instruction value, thereby being able to execute both the control following the IEC program 51 and the control following the application program 52 in synchronization with the control cycle, thereby realizing precise control in units of control cycles.

[0048] Next, based on Figure 4 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 4 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, considering the resources of the processor, a high priority task ( Figure 4 The upper part of the processing) and low priority tasks with low priority ( Figure 4 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.

[0049] 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 instruction value calculation process B42 performed by the action processing unit 42 according to the IEC program 51, and the instruction value calculation process B32 performed by the action processing unit 32 according to the application program 52 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.

[0050] Here, the high priority task is repeatedly executed in each predetermined control cycle T1. The low priority task is executed each time during the period when the high priority task is not executed in each control cycle. That is, the execution time of the high priority task is allocated to each control cycle, and the low priority task is executed at a time other than the execution time of the high priority task.

[0051] 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). In addition, the action processing related to the action command contained 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). The same processing is repeated in each control cycle. In addition, the timing of the motion processing unit 32 reading the intermediate code from the buffer 33 may not be each control cycle. This is because, when the read intermediate code contains a command that can calculate the instruction value across multiple control cycles T1, the intermediate code can be read once in the multiple control cycles T1.

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

[0053] On the other hand, regarding the low-priority task, the interpreter 34 of the control application processing unit 30 executes the application 52 one by one. 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 stored in the buffer 33 one by one in consideration of the capacity of the buffer 33. 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 for the generation of the instruction value in the calculation process B32. At this time, the interpreter 34 generates the intermediate codes of the calculation cycle of the high-priority task, that is, the integer multiple of the control cycle, in advance, so that the instruction value for the control application can be calculated in each control cycle without affecting the processing of the action processing unit 32.

[0054] In addition, the interpreter 34 temporarily stops interpreting the application 52 before the predetermined control application synchronization cycle (an integer multiple of the control cycle) arrives. 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, thereby sharing matching data between the two. In this way, the interpreter 34 updates the data shared with the IEC program processing unit 40 in each synchronization cycle. Along with the update of the shared data, the input data and output data obtained from the field side can also be updated (data synchronization). As a result, the robot 210 can also be controlled on the control application processing unit 30 side using the data obtained by the IEC program processing unit 40. The control application synchronization cycle can be of any length as long as it is set to an integer multiple of the control cycle, and can be appropriately set according to the control accuracy required by the control application.

[0055] Next, based on Figure 5 , Figure 6 , the flow of processing of the field equipment (robot 210 and motor 222) performed by the control device 100 is described. Figure 5 is a flowchart related to the processing of the above high priority tasks, Figure 6 is a flowchart related to the processing of the above-mentioned low priority tasks.

[0056] 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, 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. If the determination is affirmative here, data synchronization is performed between the IEC program processing unit 40 and the control application processing unit 30 (processing of S103). In addition, if the determination is negative in S102, the processing enters S104.

[0057] Next, the execution process B40 is performed in S104, and then the execution process B42 is performed in S105. Then, in S106, the robot execution process B32 is performed, and the robot execution process B32 prepares the motion command for controlling the robot 210. When the robot execution process B32 is performed, if the application program 52 includes a predetermined variable, the value of the corresponding variable held in the shared memory 41 is used according to the first method or the second method.

[0058] pass Figure 5The 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. Then, after the completion of the series of processing and until the next control cycle T1 arrives, the execution Figure 6 Low priority tasks shown.

[0059] 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 S201, 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 S201, the low priority task ends, and if a negative determination is made, the processing enters S202. In S202, a part of the application 52 is read by the interpreter 34. For example, a line of code constituting the application 52 is read. Then, in S203, the interpreter 34 interprets the read code to generate an intermediate code. The generated intermediate code is stored in the buffer 33 in S204. In addition, regarding the processing of S202 to S204, these processing 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 repeated during the period of the execution time of the program allocated to itself.

[0060] By doing so Figure 5 , Figure 6 In the series of processing shown in FIG. 1 , in the control device 100, Figure 4 At the execution timing shown, the IEC program 51 and the application program 52 are executed.

[0061] <Additional Note 1>

[0062] A control device (100) having a program (51) in accordance with a first execution mode which is executed as a whole each time it is executed and a program (52) in accordance with a second execution mode which is executed sequentially, the control device (100) having:

[0063] A first processing unit (40) configured to execute a program (51) in accordance with the first execution mode in each predetermined control cycle to calculate a first instruction value for controlling a first controlled object (222);

[0064] a second processing unit (30) configured to execute a program (52) conforming to the second execution mode, and to calculate a second instruction value for controlling a second controlled object (210) in each control cycle according to an intermediate code generated by interpreting at least a part of the program by an interpreter (34); and

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

[0066] The processing unit of either the first processing unit (40) or the second processing unit (30) is configured to maintain a specified variable that can be used in both the operation of the first processing unit (40) and the operation of the second processing unit (30), and the processing unit of the other of the first processing unit (40) and the second processing unit (30) can access the specified variable via the processing unit of the one party.

[0067] Description of symbols

[0068] 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; 100: Control device; 210: Robot; 220: Servo drive; 222: Motor.

Claims

1. A control device having a program in accordance with a first execution mode which is executed as a whole each time it is executed and a program in accordance with a second execution mode which is executed sequentially, the control device comprising: a first processing unit configured to execute a program in accordance with the first execution mode at each predetermined control cycle to calculate a first command value for controlling a first controlled object; a second processing unit configured to execute a program conforming to the second execution mode, and to calculate a second command value for controlling a second controlled object in each of the control cycles according to an intermediate code generated by interpreting at least a part of the program by an interpreter; as well as an output unit that outputs the first instruction value and the second instruction value in each control cycle, The processing unit of either the first processing unit or the second processing unit is configured to hold a predetermined variable that can be used in both the calculation of the first processing unit and the calculation of the second processing unit, and the processing unit of the other of the first processing unit and the second processing unit is configured to be able to access the predetermined variable via the processing unit of the one processing unit. A first variable name of the predetermined variable in the calculation of the one processing unit is different from a second variable name of the predetermined variable in the calculation of the other processing unit. The control device holds relevant information that specifies the correlation between the first variable name and the second variable name, When the processing unit of the other party uses the variable of the second variable name as the prescribed variable, the processing unit of the other party uses the value of the variable of the first variable name associated with the second variable name as the value of the prescribed variable based on the relevant information.

2. The control device according to claim 1, wherein: The one processing unit is the first processing unit, and the other processing unit is the second processing unit.

Citation Information

Patent Citations

  • CPU unit of PLC, system program for PLC and recording medium storing system program for PLC

    JP2012194662A

  • Control device

    JP2019036043A

  • Control device

    CN109388107A

  • Control device and control method

    CN109491307A

  • Control device and control method

    CN109507980A