WO2022168336A1 - Control device, control method, and control program - Google Patents

Control device, control method, and control program Download PDF

Info

Publication number
WO2022168336A1
WO2022168336A1 PCT/JP2021/009183 JP2021009183W WO2022168336A1 WO 2022168336 A1 WO2022168336 A1 WO 2022168336A1 JP 2021009183 W JP2021009183 W JP 2021009183W WO 2022168336 A1 WO2022168336 A1 WO 2022168336A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
execution
program
state machine
state
Prior art date
Application number
PCT/JP2021/009183
Other languages
French (fr)
Japanese (ja)
Inventor
征彦 仲野
哲司 若年
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Publication of WO2022168336A1 publication Critical patent/WO2022168336A1/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Definitions

  • the present invention relates to a control device, control method and control program.
  • Patent Document 1 discloses a configuration in which a single control device realizes control calculations according to a plurality of types of programs with different execution formats.
  • a control device for controlling a controlled object.
  • the control device includes a first program execution unit that executes a first user program including sequence instructions at predetermined intervals, and a second program execution unit that sequentially interprets and executes a second user program written in a predetermined programming language. and managing the execution of a first user-defined process defined as a first user program and a second user-defined process defined as a second user program according to the transition of a state machine having a plurality of states. and an execution manager.
  • the execution management unit transitions the state machine in response to the occurrence of one or more predetermined events, and determines user-defined processing to be executed corresponding to the transition when the state machine transitions. .
  • the execution management section determines the user-defined processing to be executed in the first program execution section and the second program execution section, respectively. It is possible to reduce the time and effort of describing such processing. This facilitates programming of multiple types of programs with different execution formats.
  • Arbitrary user-defined processing may be set in association with each transition that can occur in the state machine. According to this configuration, it is possible to easily set arbitrary processing according to the controlled object without changing the program.
  • User-defined processing associated with each transition that can occur in the state machine may be set via a user interface screen. According to this configuration, it is possible to easily set the user-defined process associated with the transition.
  • the execution management unit may execute user-defined processing according to a predetermined execution form.
  • the execution forms include a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that continues to be executed during the period of existence in the corresponding state, and a transition from the corresponding state to another state. and a third mode of execution that is sometimes executed only once. According to this configuration, it is possible to set the execution form of the user-defined process according to the controlled object.
  • the execution management unit may wait until the execution of the corresponding user-defined process is completed before transitioning. According to this configuration, even if there is a user-defined process that is executed over a predetermined cycle, it is possible to reduce the possibility that the user-defined process will affect a new state.
  • the state machine may include states that transition according to acquisition and release of control rights for the controlled object. According to this configuration, it is possible to reduce the programming effort related to acquisition and release of the control right for the controlled object.
  • the state machine may be defined in association with the state machine corresponding to the operating state of the controlled object. According to this configuration, necessary user-defined processing can be set according to the operating state of the controlled object.
  • a control method executed by a control device for controlling a controlled object.
  • a control method comprises the steps of managing a state machine having a plurality of states, and according to a transition of the state machine, a first user-defined process defined as a first user program including sequence instructions, and a predetermined programming language. a step of managing execution of a second user-defined process defined as a written second user program; a step of executing the first user-defined process at predetermined intervals; and a step of sequentially interpreting the second user-defined process. and performing steps.
  • Managing the state machine includes transitioning the state machine in response to occurrence of one or more predetermined events.
  • Managing execution includes determining, when a transition occurs in the state machine, a user-defined process associated with the transition to be executed.
  • a control program provides a control device for controlling a controlled object, managing a state machine having a plurality of states; managing the execution of a first user-defined process defined as a user program and a second user-defined process defined as a second user program written in a predetermined programming language; A step of executing at predetermined intervals and a step of sequentially interpreting and executing the second user-defined process are executed.
  • Managing the state machine includes transitioning the state machine in response to occurrence of one or more predetermined events.
  • Managing execution includes determining, when a transition occurs in the state machine, a user-defined process associated with the transition to be executed.
  • FIG. 1 is a schematic diagram showing a system configuration example of a control system according to an embodiment
  • FIG. It is a figure which shows the example of application of the control apparatus which concerns on this Embodiment.
  • FIG. 2 is a schematic diagram showing a hardware configuration example of a control device that configures the control system according to the present embodiment
  • FIG. 2 is a schematic diagram showing a hardware configuration example of a support device that configures the control system according to the present embodiment
  • FIG. 3 is a schematic diagram showing the configuration of a program execution environment in the control device according to the embodiment
  • FIG. 5 is a diagram for explaining an example of a processing procedure when common processing is implemented in an IEC program in the control device according to the present embodiment
  • FIG. 2 is a diagram for explaining an outline of execution management of a user program in the control device according to the embodiment
  • FIG. 3 is a schematic diagram showing an example of a state machine for managing execution of user programs in the control device according to the present embodiment
  • FIG. 5 is a schematic diagram showing an example of a user interface screen for defining user-defined process settings in the control device according to the embodiment
  • 4 is a flow chart showing a processing procedure relating to execution management of a user program in the control device according to the present embodiment
  • 4 is a time chart showing an example of a processing order for executing a user program in the control device according to the present embodiment
  • 4 is a time chart showing an example of a processing order for executing a user program in the control device according to the present embodiment
  • 4 is a time chart showing an example of a processing order for executing a user program in the control device according to the present embodiment
  • FIG. 1 is a schematic diagram showing a system configuration example of a control system 1 according to this embodiment.
  • control system 1 includes a control device 100 for controlling a controlled object, a robot controller 250 network-connected to control device 100 via field network 10, and a servo controller 350. .
  • the control device 100 periodically exchanges data with devices connected to the field network 10 and executes processing as described later.
  • the control device 100 may typically be realized by a PLC (Programmable Logic Controller).
  • a teaching pendant 400 is connected to the control device 100 .
  • the teaching pendant 400 is used by an operator to manually operate the position of the robot 200 for teaching.
  • the robot controller 250 is in charge of controlling the robot 200. More specifically, the robot controller 250 functions as an interface with the robot 200, outputs commands for driving the robot 200 in accordance with commands from the control device 100, and obtains state information of the robot 200. and output to the control device 100 .
  • any robot such as a vertical articulated robot, a horizontal articulated (scalar) robot, a parallel link robot, or an orthogonal robot can be adopted.
  • the servo controller 350 is in charge of controlling the servo motor 300. More specifically, servo controller 350 rotationally drives servo motor 300 according to a command from control device 100 , acquires state information of servo motor 300 , and outputs the information to control device 100 .
  • the servomotor 300 is mechanically coupled to any mechanism or robot, and drives the mechanism or robot by rotation.
  • the servomotor 300 is not limited to the name of a servomotor, and may be an induction motor, a synchronous motor, a permanent magnet motor, or a reluctance motor. You may
  • EtherCAT registered trademark
  • EtherNet/IP protocols for industrial networks such as EtherCAT (registered trademark) and EtherNet/IP can be used.
  • EtherCAT registered trademark
  • EtherNet/IP EtherNet/IP
  • the control device 100 may be connected to the display device 600 and the server device 700 via the host network 20 .
  • a protocol for industrial networks such as EtherNet/IP can be used.
  • the control device 100 may be connected to a support device 500 for installing user programs (the IEC program 150 and the application program 160, which will be described later) executed by the control device 100 and performing various settings.
  • user programs the IEC program 150 and the application program 160, which will be described later
  • FIG. 2 is a diagram showing an application example of the control device 100 according to the present embodiment.
  • control device 100 includes an IEC program execution unit 130 that executes IEC program 150 at predetermined intervals, and an application program execution unit 134 that sequentially interprets and executes application program 160 .
  • the IEC program 150 includes one or more user-defined processes 152.
  • Application programs 160 also include one or more user-defined processes 162 .
  • the control device 100 includes an execution management unit 132 that selects an IEC program 150 (user-defined processing 152) and an application program 160 (user-defined processing 162) and causes an IEC program execution unit 130 and an application program execution unit 134 to execute them.
  • the execution management unit 132 has a state machine 180 containing multiple states.
  • the execution management unit 132 transitions the state machine 180 in response to the occurrence of one or more predetermined events, and when the state machine 180 transitions, executes user-defined processing associated with the transition. 152, 162 are determined.
  • execution management unit 132 selects user-defined processes (programs) to be executed in IEC program execution unit 130 and application program execution unit 134, respectively. It is possible to reduce the time and effort of describing such processing. This facilitates programming of multiple types of programs with different execution formats.
  • FIG. 3 is a schematic diagram showing a hardware configuration example of the control device 100 that configures the control system 1 according to the present embodiment.
  • control device 100 includes processor 102, main memory 104, storage 110, memory card interface 112, host network controller 106, field network controller 108, local bus controller 116, USB and a USB controller 120 that provides a (Universal Serial Bus) interface. These components are connected via processor bus 118 .
  • the processor 102 corresponds to an arithmetic processing unit that executes control arithmetic, and is composed of a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), and the like. Specifically, the processor 102 reads a program stored in the storage 110, develops it in the main memory 104, and executes it, thereby implementing control calculations for the controlled object.
  • a CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the main memory 104 is composed of volatile storage devices such as DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory).
  • the storage 110 is configured by, for example, a non-volatile storage device such as SSD (Solid State Drive) or HDD (Hard Disk Drive).
  • the storage 110 stores a system program 111 for realizing basic functions, a user program (IEC program 150 and application program 160) created according to the object to be controlled, and the like.
  • the IEC program 150 includes instructions for realizing main control other than the control of the robot 200 in the control system 1.
  • An IEC program 150 may typically include sequence instructions and motion instructions.
  • the IEC program 150 may be written in any language defined by IEC61131-3 defined by the International Electrotechnical Commission (IEC). However, the IEC program 150 may include a program written in a manufacturer's own language other than the language defined by IEC61131-3.
  • the application program 160 includes instructions for controlling the operation of the robot 200.
  • the application program 160 may include instructions written in a predetermined programming language (for example, programming language for robot control such as V+ language or programming language for NC control such as G code).
  • a predetermined programming language for example, programming language for robot control such as V+ language or programming language for NC control such as G code.
  • the application program 160 is not limited to the application for controlling the operation of the robot 200, and can be used for the application for controlling an NC-controlled machine tool or any mechanism, for example.
  • the case where the application program 160 controls the robot 200 will be mainly exemplified below.
  • the memory card interface 112 accepts a memory card 114, which is an example of a removable storage medium.
  • the memory card interface 112 is capable of reading/writing arbitrary data from/to the memory card 114 .
  • the host network controller 106 exchanges data with arbitrary information processing devices (such as the display device 600 and the server device 700 shown in FIG. 1) via the host network 20 .
  • the field network controller 108 exchanges data with each device via the field network 10.
  • the field network controller 108 may function as a communication master of the field network 10 .
  • the local bus controller 116 exchanges data with any functional unit 124 included in the control device 100 via the local bus 122 .
  • the functional unit 124 is, for example, an analog I/O unit responsible for inputting and/or outputting analog signals, a digital I/O unit responsible for inputting and/or outputting digital signals, a counter unit accepting pulses from encoders, etc. And so on.
  • the USB controller 120 exchanges data with any information processing device (such as the support device 500) via a USB connection.
  • the main components of the robot controller 250 are a network controller that exchanges data with the control device 100 , a processing circuit that executes arithmetic processing necessary to drive the robot 200 , and data exchange with the robot 200 . and interface circuits to interact with.
  • the main components of the servo controller 350 are a network controller that exchanges data with the control device 100 , a processing circuit that performs arithmetic processing necessary to drive the servo motors 300 , and power that is supplied to the servo motors 300 . and a drive circuit for generating
  • the main components of the teaching pendant 400 include an interface for exchanging data with the control device 100, an input section for receiving operations on the robot 200, and a display section for displaying various information.
  • the support device 500 that configures the control system 1 according to the present embodiment may be realized using a general-purpose personal computer as an example.
  • FIG. 4 is a schematic diagram showing a hardware configuration example of the support device 500 that configures the control system 1 according to the present embodiment.
  • support device 500 includes processor 502 such as a CPU or MPU, main memory 504, input unit 506, display unit 508, storage 510, network controller 516, USB controller 518, and an optical drive 520 . These components are connected via bus 524 .
  • the processor 502 reads out various programs stored in the storage 510, develops them in the main memory 504, and executes them, thereby developing user programs (IEC programs 150 and application programs 160) executed by the control device 100. Provide processing.
  • the storage 510 is composed of, for example, non-volatile storage devices such as SSDs and HDDs.
  • the storage 510 typically includes an OS 512, a development program 514 for creating a user program to be executed in the control device 100, debugging the created user program, defining the system configuration, setting various parameters, and the like. is stored.
  • the storage 510 may store necessary programs other than the programs shown in FIG.
  • the input unit 506 is composed of a keyboard, mouse, etc., and receives user operations.
  • a display unit 508 includes a display, various indicators, a printer, and the like, and outputs processing results from the processor 502 and the like.
  • a network controller 516 controls the exchange of data with other devices via any network.
  • the USB controller 518 controls data exchange with the control device 100 via a USB connection.
  • the support device 500 has an optical drive 520, and from a recording medium 522 (for example, an optical recording medium such as a DVD (Digital Versatile Disc)) that stores a computer-readable program non-transitory, The stored program is read and installed in the storage 510 or the like.
  • a recording medium 522 for example, an optical recording medium such as a DVD (Digital Versatile Disc)
  • DVD Digital Versatile Disc
  • Various programs executed by the support device 500 may be installed via the computer-readable recording medium 522, or may be installed by downloading from a server device on the network. Also, the functions provided by the support device 500 according to the present embodiment may be realized by using some of the modules provided by the OS 512 .
  • Display device 600 configuring control system 1 according to the present embodiment may be realized using a general-purpose personal computer as an example. Since the basic hardware configuration example of the display device 600 is well known, detailed description thereof will not be given here.
  • Server device 700 that configures control system 1 according to the present embodiment may be realized using a general-purpose personal computer as an example. Since the basic hardware configuration example of the server device 700 is well known, detailed description thereof will not be given here.
  • FIGS. 3 and 4 show configuration examples in which one or more processors execute programs to provide necessary functions. It may be implemented using a hardware circuit (for example, ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array)).
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • FIG. 5 is a schematic diagram showing the configuration of the program execution environment in control device 100 according to the present embodiment.
  • control device 100 includes an IEC program executing portion 130 , an application program executing portion 134 , a data managing portion 142 and an execution managing portion 132 .
  • the IEC program execution unit 130 executes the IEC program 150, which is a user program including sequence instructions, at predetermined intervals. Note that the IEC program 150 includes motion instructions in addition to sequence instructions.
  • the application program execution unit 134 sequentially interprets and executes an application program 160, which is a user program written in a predetermined programming language.
  • Application program 160 typically includes instructions for controlling robot 200 .
  • Application program execution unit 134 includes interpreter 136 , cache 138 , and command generation unit 140 .
  • the interpreter 136 sequentially interprets the application program 160 to generate intermediate code.
  • the generated intermediate code is queued (enqueued) in the cache 138 .
  • the command generator 140 refers to the intermediate code queued in the cache 138 each time and transmits the command to the target robot 200 .
  • the data management unit 142 holds data necessary for program execution.
  • the data held by the data management unit 142 is refreshed (updated) at predetermined intervals.
  • the data management unit 142 includes an IO data area 144 for holding input/output data, an internal data area 146 and a shared area 148 for holding working data used inside the control device 100 .
  • Shared area 148 stores data that can be commonly referred to by IEC program execution unit 130 and application program execution unit 134 .
  • the data management unit 142 may manage data in the form of variables.
  • the execution management unit 132 manages execution of user programs in the IEC program execution unit 130 and the application program execution unit 134 . Details of the execution management unit 132 will be described later.
  • the control device 100 can execute the IEC program 150 and the application program 160 in parallel.
  • Each user program can be assigned roles as follows, for example.
  • the application program 160 programs the robot 200 to perform predetermined operations such as assembly and processing
  • the IEC program 150 includes peripheral devices, sensors, actuators, and the like related to the operation of the robot 200. You may program so that the operation
  • the IEC program 150 and the application program 160 have different execution formats. It is also necessary to program common processing for systems and robots, such as behavior when detecting signals, according to the execution format.
  • FIG. 6 is a diagram for explaining an example of a processing procedure when common processing is implemented in the IEC program 150 in the control device 100 according to this embodiment.
  • step S1 when an event for executing common processing occurs, the application program 160 executes processing for releasing the control right for the target robot 200 (step S1).
  • the IEC program 150 is notified that the control right has been released (step S2).
  • the application program 160 waits for completion of the processing in the IEC program 150 (step S3).
  • the IEC program 150 executes a process of acquiring control (step S4). Then, the IEC program 150 executes common processing (step S5). After the common processing is executed, the control right is released (step S6), and the application program 160 is notified of the release of the control right (step S7).
  • step S8 executes a process of acquiring the control right
  • step S9 restarts the process
  • FIG. 7 is a diagram for explaining an overview of user program execution management in the control device 100 according to the present embodiment.
  • execution management unit 132 has state machine 180, and according to the transition of state machine 180, user defined process 152 defined as IEC program 150 and application program 160 defined as It manages the execution of the user-defined process 162 that has been created.
  • the execution management unit 132 is provided with a user-defined process setting 133 that defines the correspondence relationship between the transition of the state machine 180 and the user-defined process to be executed.
  • the user-defined process 152 may be defined as one of multiple programs included in the IEC program 150, or may be defined as part of the program included in the IEC program 150.
  • user-defined process 162 may be defined as one of a plurality of programs included in application program 160 or may be defined as part of a program included in application program 160 .
  • FIG. 8 is a schematic diagram showing an example of a state machine 180 for managing execution of user programs in the control device 100 according to this embodiment.
  • the state machine 180 shown in FIG. 8 includes an operation management state and a program execution management state.
  • the motion management state corresponds to a state machine corresponding to the motion state of the controlled object (for example, the entire system including the robot 200).
  • the operation management states include an operating state 182, a decelerating and stopping state 183, a stopping state 184, an invalid state 185, an error decelerating and stopping state 186, and a teaching pendant controlling state 187. including.
  • the operating state 182, the decelerating and stopping state 183, and the stopping state 184 occur when the control device 100 has acquired control (control acquired state 181).
  • the right to control the controlled object means the right to transmit commands to the controlled object.
  • robot 200 can be controlled from both control device 100 and teaching pendant 400 . That is, when the user operates the teaching pendant 400 to control the robot 200, priority is given to the command value or command according to the user's operation.
  • the robot 200 can be controlled from both the IEC program 150 and the application program 160 . Therefore, management using control rights is performed in order to exclusively determine a single entity that controls the robot 200 .
  • the operating state 182 means that the robot 200 is operating
  • the decelerating and stopping state 183 means that the robot 200 is decelerating toward the stopped state
  • the stopping state 184 means that the robot 200 is stopped.
  • the robot 200 is controlled by commands written in the application program 160 to enter one of these states.
  • the invalid state 185 means the process of exchanging control rights, and occurs in the process in which the control device 100 acquires or releases control rights and in the process in which the teaching pendant 400 acquires or releases control rights.
  • An initial state such as immediately after power-on also corresponds to the invalid state 185 .
  • the error deceleration stop state 186 means a state in which some abnormality has occurred and the robot 200 is decelerating toward a stop state.
  • the teaching pendant in control state 187 means that the user is operating the teaching pendant 400 to control the robot 200 .
  • the state machine 180 has a control right acquisition state 191, a control right release state 192, a control right acquisition (TP) state 193, and a control right release (TP) state 194 as program execution management states. , and an abnormal release state 195 .
  • TP means a teaching pendant.
  • the execution management unit 132 of the control device 100 transitions the program execution management state of the state machine 180 in response to the occurrence of one or more predetermined events.
  • a control right acquisition state 191 and a control right acquisition (TP) state 193 are included in the invalid state 185 and occur in the process in which the control device 100 and the teaching pendant 400 respectively acquire control rights. More specifically, when the execution of the instruction for acquiring the control included in the IEC program 150 or the application program 160 is completed, the state transitions to the control acquisition state 191 . Also, when the user changes the mode of the teaching pendant 400 from “Auto” to “Manual”, the state transitions to the control privilege acquisition (TP) state 193 .
  • control right acquisition state 191 When the execution of the preset user-defined process is completed in the control right acquisition state 191, the state transitions to the stopped state 184. In addition, in the control privilege acquisition (TP) state 193, when the execution of the preset user-defined process is completed, the transition to the teaching pendant control state 187 is made.
  • TP control privilege acquisition
  • the control right release state 192 is included in the stopping state 184 and occurs in the process in which the control device 100 releases the control right. More specifically, the control right release state 192 is transitioned to when the execution of the instruction for releasing the control right included in the IEC program 150 or the application program 160 is completed. In the control right release state 192 , when execution of preset user-defined processing is completed, the state transitions to the invalid state 185 .
  • a control release (TP) state 194 is included in the teaching pendant controlling state 187 and occurs in the process of the teaching pendant 400 releasing control. More specifically, when the user changes the mode of the teaching pendant 400 from “Manual” to “Auto”, it transitions to the control right release (TP) state 194 . In the control right release (TP) state 194, when execution of preset user-defined processing is completed, a transition is made to an invalid state 185. FIG.
  • the state machine 180 includes, as program execution management states, transition states according to the acquisition and release of control rights for controlled objects.
  • An error release state 195 is included in the error deceleration stop state 186 and occurs in the process of releasing an error that has occurred. More specifically, when the cancellation of the abnormality that has occurred is completed, the state transitions to the abnormality cancellation state 195 . When execution of preset user-defined processing is completed in the anomaly release state 195 , the state transitions to the invalid state 185 .
  • control right acquisition state 191, control right release state 192, control right acquisition (TP) state 193, control right release (TP) state 194, and error release state 195) are: Even if the conditions for transitioning the state machine 180 are satisfied, the transition is made after the execution of the corresponding user-defined process is completed.
  • the operation management states are not limited to the states shown in FIG. 8, and other states may be added or some states may be omitted.
  • the program execution management state is not limited to the states shown in FIG. 8, and any state can be defined.
  • the conditions for causing the transition are not limited to the conditions shown in FIG. 8, and arbitrary conditions can be added or set. If no user-defined process is set as a transition condition, the transition may occur without waiting for the execution of the user-defined process to be completed.
  • arbitrary user-defined processing can be set in association with each transition that can occur in the state machine 180 (transition of the program execution management state).
  • User-defined processing can include both IEC programs 150 and application programs 160 .
  • the setting contents of the user-defined process are defined in the user-defined process setting 133. FIG.
  • the execution management unit 132 of the control device 100 refers to the user-defined process setting 133 and, when a transition occurs in the state machine 180, determines the user-defined process to be executed corresponding to the transition.
  • the execution management unit 132 of the control device 100 causes the user-defined process to be executed according to a predetermined execution form.
  • a predetermined execution form As an execution mode of the user-defined process, for example, it may be possible to select from three types of candidates: (1) entry, (2) do, and (3) exit. More specifically, (1) entry is an execution form that is executed only once when transitioning to the corresponding state. (2) do is an execution form that continues to be executed during the period in which the corresponding state exists. (3) exit is an execution form that is executed only once when transitioning from the corresponding state to another state.
  • At least one of the above (1) to (3) may be included as a candidate for the execution form of the user-defined process. In other words, it is not necessary to include all of the above (1) to (3) as candidates for execution forms of user-defined processing.
  • control device 100 can execute arbitrary user-defined processing upon acquisition and release of control rights and when an event such as an abnormality occurs.
  • FIG. 9 is a schematic diagram showing an example of a user interface screen 550 that defines the user-defined processing settings 133 in the control device 100 according to this embodiment.
  • User interface screen 550 shown in FIG. 9 is typically output to display unit 508 of support device 500 or the like by processor 502 of support device 500 executing development program 514 .
  • user interface screen 550 includes program execution setting table 560 .
  • the program execution setting table 560 includes a state column 571, an execution mode column 572, an IEC program column 573, and an application program column 574.
  • the state column 571 includes control right acquisition rows 561 corresponding to the control right acquisition state 191, the control right release state 192, the control right acquisition (TP) state 193, the control right release (TP) state 194, and the abnormal release state 195, respectively. , a control right release line 562, a control right acquisition (TP) line 563, a control right release (TP) line 564, and an error release line 565.
  • the execution mode column 572 defines three types of execution modes, an entry row 566, a do row 567, and an exit row 568, associated with each state.
  • the user sets a program for implementing user-defined processing in the IEC program column 573 and/or the application program column 574 in association with the desired state and execution mode.
  • program1 is set as the IEC program 150 and “program100” is set as the application program 160 in association with the entry line 566 of the control right acquisition line 561.
  • program2 is set as the IEC program 150 in association with the do line 567 of the control right acquisition line 561 .
  • the setting contents for the program execution setting table 560 in FIG. 9 are stored as the user-defined process settings 133.
  • user-defined processing associated with each possible transition in state machine 180 is set via user interface screen 550 .
  • FIG. 9 illustrates user-defined processing that is executed according to the transition of the state machine 180, but normally, without depending on the transition of the state machine 180, a constant or predetermined condition is established.
  • FIG. 10 is a flow chart showing a processing procedure related to user program execution management in the control device 100 according to the present embodiment. Each step shown in FIG. 10 is typically implemented by processor 102 of control device 100 executing system program 111 .
  • control device 100 when a new control cycle arrives (YES in step S100), control device 100 outputs the command value calculated in the previous control cycle (step S102), and uses it in the current control cycle. An input value is acquired (step S104).
  • the control device 100 determines whether an event that can cause a transition of the state machine 180 has occurred (step S106).
  • control device 100 determines whether user-defined processing of application program 160 is set in association with "exit" of the current state. (step S108).
  • control device 100 executes the set user-defined processing (application program 160). Start up (step S110).
  • step S110 If the user-defined process of the application program 160 is not set in association with "exit" of the current state (NO in step S108), the process of step S110 is skipped.
  • control device 100 determines whether or not user-defined processing of the IEC program 150 is set in association with "exit" of the current state (step S112).
  • control device 100 executes the set user-defined process (IEC program 150). Execute (step S114).
  • step S114 If the user-defined process of the IEC program 150 is not set in association with "exit" of the current state (NO in step S112), the process of step S114 is skipped.
  • control device 100 determines that the user-defined process associated with "exit” is being executed. (step S116). If the user-defined process associated with "exit” is being executed (YES in step S116), control device 100 determines whether or not the user-defined process associated with "exit” has been completed. (Step S118). If execution of the user-defined process associated with "exit” has not been completed (NO in step S118), control device 100 waits for the arrival of the next control cycle.
  • step S118 If the user-defined process associated with "exit” has been completed (YES in step S118), the control device 100 transitions the state machine 180 to a new state (step S120). Note that even if there is no user-defined process associated with "exit", the process of step S120 is executed. In this manner, the control device 100 performs processing for managing the state machine 180 having multiple states.
  • step S116 if the user-defined process associated with "exit" is not being executed (NO in step S116), the processes of steps S118 and S120 are skipped.
  • control device 100 determines whether or not the state machine 180 has transitioned to a new state (step S122).
  • control device 100 sets user-defined processing of application program 160 in association with the new state "entry”. It is determined whether or not there is (step S124).
  • control device 100 executes the set user-defined process (application program 160). Start up (step S126).
  • step S126 If the user-defined process of the application program 160 is not set in association with the new state "entry" (NO in step S124), the process of step S126 is skipped.
  • control device 100 determines whether or not user-defined processing of the IEC program 150 is set in association with the new state "entry" (step S128).
  • control device 100 executes the set user-defined process (IEC program 150). Execute (step S130).
  • step S130 If the user-defined process of the IEC program 150 is not set in association with the new state "entry" (NO in step S128), the process of step S130 is skipped.
  • control device 100 waits for the arrival of the next control cycle.
  • state machine 180 has not transitioned to a new state (NO in step S122)
  • control device 100 sets user-defined processing of application program 160 in association with the current state of "do”. It is determined whether or not it is set (step S132).
  • control device 100 executes the set user-defined process (application program 160). Start up (step S134).
  • step S134 If the user-defined process of the application program 160 is not set in association with "do" of the current state (NO in step S132), the process of step S134 is skipped.
  • control device 100 determines whether or not user-defined processing of the IEC program 150 is set in association with the current state "do" (step S136).
  • control device 100 executes the set user-defined process (IEC program 150). Execute (step S138).
  • step S138 If the user-defined process of the IEC program 150 is not set in association with "do" of the current state (NO in step S136), the process of step S138 is skipped.
  • control device 100 waits for the arrival of the next control cycle.
  • execution management of arbitrary user-defined processing according to the state can be realized. That is, the control device 100 manages the execution of the user-defined process specified as the IEC program 150 and the user-defined process specified as the application program 160 according to the transition of the state machine 180 (steps S106, S108). , S112, S116, S124, S128, S132, S136).
  • control device 100 executes user-defined processing defined as the IEC program 150 at predetermined intervals (S114, S130, S138), and sequentially interprets and executes user-defined processing defined as the application program 160. (S110, S126, S134).
  • FIG. 11 and FIG. 12 are time charts showing an example of the processing order for executing the user program in control device 100 according to the present embodiment.
  • FIG. 11 shows an example of executing user-defined processing in association with "entry”
  • FIG. 12 shows an example of executing user-defined processing in association with "do”.
  • the control device 100 repeatedly executes the fixed period execution task 170 every control period T1.
  • the periodic execution task 170 is set as a high priority task.
  • the periodic execution task 170 includes input/output refresh processing 171 , application input processing 172 , transition monitoring processing 173 , IEC program execution processing 174 and application output processing 175 .
  • the input/output refresh process 171 includes a process of outputting the command value calculated in the previous control cycle and a process of acquiring the input value used in the current control cycle.
  • the application input processing 172 includes processing for acquiring input values necessary for executing the application program 160 .
  • the transition monitoring processing 173 monitors whether an event that causes any of the transitions included in the state machine 180 has occurred.
  • IEC program execution processing 174 includes processing for executing IEC program 150 .
  • Application output processing 175 includes processing for calculating command values by executing application program 160 . Note that the application output processing 175 mainly includes arithmetic processing according to intermediate codes generated by sequentially interpreting the application program 160 .
  • the application program 160 is executed in parallel with the periodic execution task 170 .
  • the application program 160 is executed sequentially over a period of time longer than the control period T1. Therefore, the execution processing of the application program 160 may be temporarily interrupted while the periodic execution task 170 is being executed.
  • the application program 160 may be one or more programs executed in parallel. For example, assume an application program 177 for causing the robot 200 to perform basic operations, and an application program 178 for defining behavior when an abnormality occurs.
  • the user-defined process 176 (IEC program 150) associated with "entry" is executed. executed.
  • the time required for the IEC program execution process 174 is extended by the execution time of the user-defined process 176 .
  • the application program 178 associated with "entry” is started. Note that it may take a plurality of control cycles T1 to complete execution of the started application program 178 . In this case, the state transitions to a new state upon completion of execution of the application program 178 .
  • the user-defined process 176 (IEC program 150) associated with "do" is repeatedly executed every control cycle T1.
  • the time required for the IEC program execution process 174 is extended by the execution time of the user-defined process 176 .
  • the application program 178 associated with "do" is started. It may take a plurality of control cycles T1 to complete the execution of the started application program 178, but as long as the conditions are satisfied, the application program 178 may be started again after the completion of execution.
  • a control device (100) for controlling a controlled object a first program execution unit (130) that executes a first user program (150) including sequence instructions at predetermined intervals; a second program execution unit (134) that sequentially interprets and executes a second user program (160) written in a predetermined programming language; A first user-defined process (152) defined as the first user program and a second user-defined process defined as the second user program according to the transition of a state machine (180) having a plurality of states.
  • an execution management unit (162) for managing the execution of The execution management unit transitioning the state machine in response to the occurrence of one or more predetermined events;
  • a control device that, when a transition occurs in the state machine, determines a user-defined process to be executed associated with the transition.
  • the execution forms include a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that is continuously executed during the period in which the corresponding state exists, and a transition from the corresponding state to another state. 5.
  • the controller of arrangement 4 selected from candidates including at least one of a third mode of execution and a third mode of execution that is executed only once when
  • a control method executed by a control device (100) for controlling a controlled object comprising: managing a state machine with multiple states (S120); A first user-defined process defined as a first user program containing sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language according to the transition of the state machine.
  • S106, S108, S112, S116, S124, S128, S132, S136 for managing the execution of a step of executing the first user-defined process at predetermined intervals (S114, S130, S138);
  • managing the state machine includes transitioning the state machine in response to the occurrence of one or more predetermined events;
  • a control method, wherein managing execution includes determining a user-defined process to be executed associated with a transition when the state machine transitions.
  • step of managing execution includes transitioning the state machine in response to the occurrence of one or more predetermined events;
  • step of managing execution includes, when a transition occurs in the state machine, determining a user-defined process to be executed associated with the transition.
  • a state machine is used to manage the state of the control device 100, and when some transition occurs in the state machine, arbitrary user-defined processing associated with the transition can be executed. Therefore, it is possible to reduce the need to implement processing such as interlocking between programs, thereby facilitating programming.

Abstract

This control device includes: a first program execution unit that executes, for every predetermined cycle, a first user program including a sequence command; a second program execution unit that sequentially interprets and executes a second user program written in a predetermined programming language; and an execution management unit that manages, in accordance with transition of a state machine having a plurality of states, execution of a first user definition process prescribed as the first user program and a second user definition process prescribed as the second user program. The execution management unit causes transition of the state machine in accordance with occurrence of predetermined one or more events, and determines, upon occurrence of transition in the state machine, a user definition process to be executed, the user definition process being associated with the transition.

Description

制御装置、制御方法および制御プログラムControl device, control method and control program
 本発明は、制御装置、制御方法および制御プログラムに関する。 The present invention relates to a control device, control method and control program.
 様々な生産現場において、PLC(プログラマブルコントローラ)などの制御装置を用いたFA(Factory Automation)技術が広く普及している。近年のICT(Information and Communication Technology)の進歩に伴って、制御装置は、従来のシーケンス制御だけではなく、ロボットや工作機械などを制御することも可能になっている。 FA (Factory Automation) technology using control devices such as PLCs (Programmable Controllers) is widely used in various production sites. With recent advances in ICT (Information and Communication Technology), controllers can now control robots, machine tools, and the like in addition to conventional sequence control.
 例えば、特開2019-036043号公報(特許文献1)は、実行形式の異なる複数種類のプログラムに従う制御演算を単一の制御装置で実現する構成を開示する。 For example, Japanese Patent Laying-Open No. 2019-036043 (Patent Document 1) discloses a configuration in which a single control device realizes control calculations according to a plurality of types of programs with different execution formats.
特開2019-036043号公報JP 2019-036043 A
 上述したような実行形式の異なる複数種類のプログラムを共通の制御対象に対して実行する場合には、プログラム間で実行する処理内容を適宜分担できるように設計する必要がある。このような実行形式の異なる複数種類のプログラムのプログラミングを容易化する技術を提供することを一つの目的としている。  When executing multiple types of programs with different execution formats as described above for a common control target, it is necessary to design so that the processing content to be executed can be appropriately shared among the programs. It is an object of the present invention to provide a technique for facilitating programming of such a plurality of types of programs with different execution formats.
 本発明のある局面に従えば、制御対象を制御するための制御装置が提供される。制御装置は、シーケンス命令を含む第1ユーザプログラムを所定周期毎に実行する第1プログラム実行部と、所定のプログラミング言語で記述された第2ユーザプログラムを逐次解釈して実行する第2プログラム実行部と、複数のステートを有するステートマシーンの遷移に応じて、第1ユーザプログラムとして規定された第1ユーザ定義処理、および、第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理する実行管理部とを含む。実行管理部は、予め定められた1または複数のイベントの発生に応じて、ステートマシーンを遷移させ、ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定する。 According to one aspect of the present invention, a control device for controlling a controlled object is provided. The control device includes a first program execution unit that executes a first user program including sequence instructions at predetermined intervals, and a second program execution unit that sequentially interprets and executes a second user program written in a predetermined programming language. and managing the execution of a first user-defined process defined as a first user program and a second user-defined process defined as a second user program according to the transition of a state machine having a plurality of states. and an execution manager. The execution management unit transitions the state machine in response to the occurrence of one or more predetermined events, and determines user-defined processing to be executed corresponding to the transition when the state machine transitions. .
 この構成によれば、実行管理部が第1プログラム実行部および第2プログラム実行部においてそれぞれ実行されるユーザ定義処理を決定するので、第1ユーザプログラムおよび第2ユーザプログラム自体にインターロックなどの複雑な処理を記述する手間を低減できる。これによって、実行形式の異なる複数種類のプログラムのプログラミングを容易化できる。 According to this configuration, the execution management section determines the user-defined processing to be executed in the first program execution section and the second program execution section, respectively. It is possible to reduce the time and effort of describing such processing. This facilitates programming of multiple types of programs with different execution formats.
 ステートマシーンに生じ得る遷移の各々に対応付けて、任意のユーザ定義処理が設定可能になっていてもよい。この構成によれば、制御対象に応じた任意の処理を、プログラムを変更等しなくても容易に設定できる。 Arbitrary user-defined processing may be set in association with each transition that can occur in the state machine. According to this configuration, it is possible to easily set arbitrary processing according to the controlled object without changing the program.
 ステートマシーンに生じ得る遷移の各々に対応付けられるユーザ定義処理は、ユーザインターフェイス画面を介して設定されてもよい。この構成によれば、遷移に対応付けられるユーザ定義処理を容易に設定できる。 User-defined processing associated with each transition that can occur in the state machine may be set via a user interface screen. According to this configuration, it is possible to easily set the user-defined process associated with the transition.
 実行管理部は、予め定められた実行形態に従ってユーザ定義処理を実行させてもよい。実行形態は、対応するステートに遷移するときに一度だけ実行される第1実行形態と、対応するステートに存在する期間において実行され続ける第2実行形態と、対応するステートから別のステートに遷移するときに一度だけ実行される第3実行形態とのうち少なくとも1つを含む候補から選択されてもよい。この構成によれば、制御対象に応じたユーザ定義処理の実行形態を設定できる。 The execution management unit may execute user-defined processing according to a predetermined execution form. The execution forms include a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that continues to be executed during the period of existence in the corresponding state, and a transition from the corresponding state to another state. and a third mode of execution that is sometimes executed only once. According to this configuration, it is possible to set the execution form of the user-defined process according to the controlled object.
 実行管理部は、ステートマシーンを遷移させる条件が成立した場合であっても、対応するユーザ定義処理の実行完了を待って遷移させてもよい。この構成によれば、所定周期に亘って実行されるユーザ定義処理が存在しても、当該ユーザ定義処理の影響を新たなステートに与える可能性を低減できる。 Even if the conditions for transitioning the state machine are satisfied, the execution management unit may wait until the execution of the corresponding user-defined process is completed before transitioning. According to this configuration, even if there is a user-defined process that is executed over a predetermined cycle, it is possible to reduce the possibility that the user-defined process will affect a new state.
 ステートマシーンは、制御対象に対する制御権の獲得および解放に応じて遷移するステートを含んでいてもよい。この構成によれば、制御対象に対する制御権の獲得および解放に関するプログラミングの手間を削減できる。 The state machine may include states that transition according to acquisition and release of control rights for the controlled object. According to this configuration, it is possible to reduce the programming effort related to acquisition and release of the control right for the controlled object.
 ステートマシーンは、制御対象の動作状態に対応するステートマシーンに関連付けて規定されてもよい。この構成によれば、制御対象の動作状態に応じて、必要なユーザ定義処理を設定できる。 The state machine may be defined in association with the state machine corresponding to the operating state of the controlled object. According to this configuration, necessary user-defined processing can be set according to the operating state of the controlled object.
 本発明の別の局面に従えば、制御対象を制御するための制御装置で実行される制御方法が提供される。制御方法は、複数のステートを有するステートマシーンを管理するステップと、ステートマシーンの遷移に応じて、シーケンス命令を含む第1ユーザプログラムとして規定された第1ユーザ定義処理、および、所定のプログラミング言語で記述された第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理するステップと、第1ユーザ定義処理を所定周期毎に実行するステップと、第2ユーザ定義処理を逐次解釈して実行するステップとを含む。ステートマシーンを管理するステップは、予め定められた1または複数のイベントの発生に応じて、ステートマシーンを遷移させるステップを含む。実行を管理するステップは、ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定するステップを含む。 According to another aspect of the present invention, there is provided a control method executed by a control device for controlling a controlled object. A control method comprises the steps of managing a state machine having a plurality of states, and according to a transition of the state machine, a first user-defined process defined as a first user program including sequence instructions, and a predetermined programming language. a step of managing execution of a second user-defined process defined as a written second user program; a step of executing the first user-defined process at predetermined intervals; and a step of sequentially interpreting the second user-defined process. and performing steps. Managing the state machine includes transitioning the state machine in response to occurrence of one or more predetermined events. Managing execution includes determining, when a transition occurs in the state machine, a user-defined process associated with the transition to be executed.
 本発明のさらに別の局面に従う制御プログラムは、制御対象を制御するための制御装置に、複数のステートを有するステートマシーンを管理するステップと、ステートマシーンの遷移に応じて、シーケンス命令を含む第1ユーザプログラムとして規定された第1ユーザ定義処理、および、所定のプログラミング言語で記述された第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理するステップと、第1ユーザ定義処理を所定周期毎に実行するステップと、第2ユーザ定義処理を逐次解釈して実行するステップとを実行させる。ステートマシーンを管理するステップは、予め定められた1または複数のイベントの発生に応じて、ステートマシーンを遷移させるステップを含む。実行を管理するステップは、ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定するステップを含む。 A control program according to still another aspect of the present invention provides a control device for controlling a controlled object, managing a state machine having a plurality of states; managing the execution of a first user-defined process defined as a user program and a second user-defined process defined as a second user program written in a predetermined programming language; A step of executing at predetermined intervals and a step of sequentially interpreting and executing the second user-defined process are executed. Managing the state machine includes transitioning the state machine in response to occurrence of one or more predetermined events. Managing execution includes determining, when a transition occurs in the state machine, a user-defined process associated with the transition to be executed.
 本発明によれば、実行形式の異なる複数種類のプログラムのプログラミングを容易化できる。 According to the present invention, programming of multiple types of programs with different execution formats can be facilitated.
本実施の形態に係る制御システムのシステム構成例を示す模式図である。1 is a schematic diagram showing a system configuration example of a control system according to an embodiment; FIG. 本実施の形態に係る制御装置の適用例を示す図である。It is a figure which shows the example of application of the control apparatus which concerns on this Embodiment. 本実施の形態に係る制御システムを構成する制御装置のハードウェア構成例を示す模式図である。FIG. 2 is a schematic diagram showing a hardware configuration example of a control device that configures the control system according to the present embodiment; 本実施の形態に係る制御システムを構成するサポート装置のハードウェア構成例を示す模式図である。FIG. 2 is a schematic diagram showing a hardware configuration example of a support device that configures the control system according to the present embodiment; 本実施の形態に係る制御装置におけるプログラム実行環境に関する構成を示す模式図である。FIG. 3 is a schematic diagram showing the configuration of a program execution environment in the control device according to the embodiment; 本実施の形態に係る制御装置において共通処理をIECプログラムに実装した場合の処理手順の一例を説明するための図である。FIG. 5 is a diagram for explaining an example of a processing procedure when common processing is implemented in an IEC program in the control device according to the present embodiment; 本実施の形態に係る制御装置におけるユーザプログラムの実行管理の概要を説明するための図である。FIG. 2 is a diagram for explaining an outline of execution management of a user program in the control device according to the embodiment; FIG. 本実施の形態に係る制御装置におけるユーザプログラムの実行管理を行うためのステートマシーンの一例を示す模式図である。3 is a schematic diagram showing an example of a state machine for managing execution of user programs in the control device according to the present embodiment; FIG. 本実施の形態に係る制御装置におけるユーザ定義処理設定を定義するユーザインターフェイス画面の一例を示す模式図である。FIG. 5 is a schematic diagram showing an example of a user interface screen for defining user-defined process settings in the control device according to the embodiment; 本実施の形態に係る制御装置におけるユーザプログラムの実行管理に係る処理手順を示すフローチャートである。4 is a flow chart showing a processing procedure relating to execution management of a user program in the control device according to the present embodiment; 本実施の形態に係る制御装置におけるユーザプログラムの実行に係る処理順序の一例を示すタイムチャートである。4 is a time chart showing an example of a processing order for executing a user program in the control device according to the present embodiment; 本実施の形態に係る制御装置におけるユーザプログラムの実行に係る処理順序の一例を示すタイムチャートである。4 is a time chart showing an example of a processing order for executing a user program in the control device according to the present embodiment;
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。 Embodiments of the present invention will be described in detail with reference to the drawings. The same or corresponding parts in the drawings are denoted by the same reference numerals, and the description thereof will not be repeated.
 <A.適用例>
 まず、本実施の形態に係る制御システム1のシステム構成例について説明する。
<A. Application example>
First, a system configuration example of the control system 1 according to the present embodiment will be described.
 図1は、本実施の形態に係る制御システム1のシステム構成例を示す模式図である。図1を参照して、制御システム1は、制御対象を制御するための制御装置100と、フィールドネットワーク10を介して制御装置100とネットワーク接続された、ロボットコントローラ250と、サーボコントローラ350とを含む。 FIG. 1 is a schematic diagram showing a system configuration example of a control system 1 according to this embodiment. Referring to FIG. 1, control system 1 includes a control device 100 for controlling a controlled object, a robot controller 250 network-connected to control device 100 via field network 10, and a servo controller 350. .
 制御装置100は、フィールドネットワーク10に接続されたデバイスとの間で周期的にデータをやり取りして、後述するような処理を実行する。制御装置100は、典型的には、PLC(プログラマブルロジックコントローラ)により実現されてもよい。 The control device 100 periodically exchanges data with devices connected to the field network 10 and executes processing as described later. The control device 100 may typically be realized by a PLC (Programmable Logic Controller).
 制御装置100には、ティーチングペンダント400が接続される。ティーチングペンダント400は、オペレータがロボット200の位置を手動で操作して、ティーチングするために用いられる。 A teaching pendant 400 is connected to the control device 100 . The teaching pendant 400 is used by an operator to manually operate the position of the robot 200 for teaching.
 ロボットコントローラ250は、ロボット200の制御を担当する。より具体的には、ロボットコントローラ250は、ロボット200との間のインターフェイスとして機能し、制御装置100からの指令に従って、ロボット200を駆動するための指令を出力するとともに、ロボット200の状態情報を取得して制御装置100へ出力する。 The robot controller 250 is in charge of controlling the robot 200. More specifically, the robot controller 250 functions as an interface with the robot 200, outputs commands for driving the robot 200 in accordance with commands from the control device 100, and obtains state information of the robot 200. and output to the control device 100 .
 ロボット200は、例えば、垂直多関節ロボット、水平多関節(スカラ)ロボット、パラレルリンクロボット、直交ロボットなどの任意のロボットを採用できる。 For the robot 200, any robot such as a vertical articulated robot, a horizontal articulated (scalar) robot, a parallel link robot, or an orthogonal robot can be adopted.
 サーボコントローラ350は、サーボモータ300の制御を担当する。より具体的には、サーボコントローラ350は、制御装置100からの指令に従って、サーボモータ300を回転駆動させるとともに、サーボモータ300の状態情報を取得して制御装置100へ出力する。 The servo controller 350 is in charge of controlling the servo motor 300. More specifically, servo controller 350 rotationally drives servo motor 300 according to a command from control device 100 , acquires state information of servo motor 300 , and outputs the information to control device 100 .
 サーボモータ300は、任意の機構あるいはロボットと機械的に結合されており、回転により機構あるいはロボットを駆動する。サーボモータ300は、サーボモータとの名称に限定されず、誘導型モータ、同期型モータ、永久磁石型モータ、リラクタンスモータのいずれを採用してもよいし、回転型だけではなく、リニアモータを採用してもよい。 The servomotor 300 is mechanically coupled to any mechanism or robot, and drives the mechanism or robot by rotation. The servomotor 300 is not limited to the name of a servomotor, and may be an induction motor, a synchronous motor, a permanent magnet motor, or a reluctance motor. You may
 フィールドネットワーク10には、産業用ネットワーク用のプロトコルである、EtherCAT(登録商標)やEtherNet/IPなどを用いることができる。プロトコルとしてEtherCATを採用した場合には、制御装置100とフィールドネットワーク10に接続されたデバイスとの間で、例えば、数百μ秒~数m秒の定周期でデータを更新できる。 For the field network 10, protocols for industrial networks such as EtherCAT (registered trademark) and EtherNet/IP can be used. When EtherCAT is adopted as the protocol, data can be updated between the control device 100 and devices connected to the field network 10 at regular intervals of several hundred microseconds to several milliseconds, for example.
 制御装置100は、上位ネットワーク20を介して、表示装置600およびサーバ装置700に接続されてもよい。上位ネットワーク20には、産業用ネットワーク用のプロトコルであるやEtherNet/IPなどを用いることができる。 The control device 100 may be connected to the display device 600 and the server device 700 via the host network 20 . For the upper network 20, a protocol for industrial networks such as EtherNet/IP can be used.
 制御装置100には、制御装置100で実行されるユーザプログラム(後述する、IECプログラム150およびアプリケーションプログラム160)のインストールや各種設定を行うためのサポート装置500が接続されてもよい。 The control device 100 may be connected to a support device 500 for installing user programs (the IEC program 150 and the application program 160, which will be described later) executed by the control device 100 and performing various settings.
 図2は、本実施の形態に係る制御装置100の適用例を示す図である。図2を参照して、制御装置100は、IECプログラム150を所定周期毎に実行するIECプログラム実行部130と、アプリケーションプログラム160を逐次解釈して実行するアプリケーションプログラム実行部134とを含む。 FIG. 2 is a diagram showing an application example of the control device 100 according to the present embodiment. Referring to FIG. 2, control device 100 includes an IEC program execution unit 130 that executes IEC program 150 at predetermined intervals, and an application program execution unit 134 that sequentially interprets and executes application program 160 .
 IECプログラム150は、1または複数のユーザ定義処理152を含む。また、アプリケーションプログラム160についても、1または複数のユーザ定義処理162を含む。 The IEC program 150 includes one or more user-defined processes 152. Application programs 160 also include one or more user-defined processes 162 .
 制御装置100は、IECプログラム150(ユーザ定義処理152)およびアプリケーションプログラム160(ユーザ定義処理162)を選択して、IECプログラム実行部130およびアプリケーションプログラム実行部134で実行させる実行管理部132を含む。 The control device 100 includes an execution management unit 132 that selects an IEC program 150 (user-defined processing 152) and an application program 160 (user-defined processing 162) and causes an IEC program execution unit 130 and an application program execution unit 134 to execute them.
 実行管理部132は、複数のステートを含むステートマシーン180を有している。実行管理部132は、予め定められた1または複数のイベントの発生に応じて、ステートマシーン180を遷移させるとともに、ステートマシーン180遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理152,162を決定する。 The execution management unit 132 has a state machine 180 containing multiple states. The execution management unit 132 transitions the state machine 180 in response to the occurrence of one or more predetermined events, and when the state machine 180 transitions, executes user-defined processing associated with the transition. 152, 162 are determined.
 このように、実行管理部132がIECプログラム実行部130およびアプリケーションプログラム実行部134においてそれぞれ実行されるユーザ定義処理(プログラム)を選択するので、IECプログラム150およびアプリケーションプログラム160自体にインターロックなどの複雑な処理を記述する手間を低減できる。これによって、実行形式の異なる複数種類のプログラムのプログラミングを容易化できる。 In this way, execution management unit 132 selects user-defined processes (programs) to be executed in IEC program execution unit 130 and application program execution unit 134, respectively. It is possible to reduce the time and effort of describing such processing. This facilitates programming of multiple types of programs with different execution formats.
 <B.ハードウェア構成例>
 次に、図1に示す制御システム1を構成する主要装置のハードウェア構成例について説明する。
<B. Hardware configuration example>
Next, an example of hardware configuration of main devices constituting the control system 1 shown in FIG. 1 will be described.
 (b1:制御装置100)
 図3は、本実施の形態に係る制御システム1を構成する制御装置100のハードウェア構成例を示す模式図である。図3を参照して、制御装置100は、プロセッサ102と、メインメモリ104と、ストレージ110と、メモリカードインターフェイス112と、上位ネットワークコントローラ106と、フィールドネットワークコントローラ108と、ローカルバスコントローラ116と、USB(Universal Serial Bus)インターフェイスを提供するUSBコントローラ120とを含む。これらのコンポーネントは、プロセッサバス118を介して接続されている。
(b1: control device 100)
FIG. 3 is a schematic diagram showing a hardware configuration example of the control device 100 that configures the control system 1 according to the present embodiment. Referring to FIG. 3, control device 100 includes processor 102, main memory 104, storage 110, memory card interface 112, host network controller 106, field network controller 108, local bus controller 116, USB and a USB controller 120 that provides a (Universal Serial Bus) interface. These components are connected via processor bus 118 .
 プロセッサ102は、制御演算を実行する演算処理部に相当し、CPU(Central Processing Unit)やGPU(Graphics Processing Unit)などで構成される。具体的には、プロセッサ102は、ストレージ110に格納されたプログラムを読み出して、メインメモリ104に展開して実行することで、制御対象に対する制御演算を実現する。 The processor 102 corresponds to an arithmetic processing unit that executes control arithmetic, and is composed of a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), and the like. Specifically, the processor 102 reads a program stored in the storage 110, develops it in the main memory 104, and executes it, thereby implementing control calculations for the controlled object.
 メインメモリ104は、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)などの揮発性記憶装置などで構成される。ストレージ110は、例えば、SSD(Solid State Drive)やHDD(Hard Disk Drive)などの不揮発性記憶装置などで構成される。 The main memory 104 is composed of volatile storage devices such as DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory). The storage 110 is configured by, for example, a non-volatile storage device such as SSD (Solid State Drive) or HDD (Hard Disk Drive).
 ストレージ110には、基本的な機能を実現するためのシステムプログラム111、および、制御対象に応じて作成されたユーザプログラム(IECプログラム150およびアプリケーションプログラム160)などが格納される。 The storage 110 stores a system program 111 for realizing basic functions, a user program (IEC program 150 and application program 160) created according to the object to be controlled, and the like.
 IECプログラム150は、制御システム1におけるロボット200の制御以外の主たる制御を実現するための命令を含む。IECプログラム150は、典型的には、シーケンス命令およびモーション命令を含み得る。IECプログラム150は、国際電気標準会議(IEC:International Electrotechnical Commission)が定めるIEC61131-3で規定されるいずれかの言語で記述されてもよい。但し、IECプログラム150は、IEC61131-3で規定される言語以外のメーカ独自言語で記述されるプログラムを含んでいてもよい。 The IEC program 150 includes instructions for realizing main control other than the control of the robot 200 in the control system 1. An IEC program 150 may typically include sequence instructions and motion instructions. The IEC program 150 may be written in any language defined by IEC61131-3 defined by the International Electrotechnical Commission (IEC). However, the IEC program 150 may include a program written in a manufacturer's own language other than the language defined by IEC61131-3.
 アプリケーションプログラム160は、ロボット200の動作を制御するための命令を含む。アプリケーションプログラム160は、所定のプログラミング言語(例えば、V+言語などのロボット制御用プログラミング言語やGコードなどのNC制御に係るプログラミング言語)で記述された命令を含んでいてもよい。なお、アプリケーションプログラム160は、ロボット200の動作を制御する用途に限られず、例えば、NC制御される工作機械や任意の機構を制御する用途にも用いることができる。説明の便宜上、以下では、主として、アプリケーションプログラム160がロボット200を制御する場合について例示する。 The application program 160 includes instructions for controlling the operation of the robot 200. The application program 160 may include instructions written in a predetermined programming language (for example, programming language for robot control such as V+ language or programming language for NC control such as G code). Note that the application program 160 is not limited to the application for controlling the operation of the robot 200, and can be used for the application for controlling an NC-controlled machine tool or any mechanism, for example. For convenience of explanation, the case where the application program 160 controls the robot 200 will be mainly exemplified below.
 メモリカードインターフェイス112は、着脱可能な記憶媒体の一例であるメモリカード114を受け付ける。メモリカードインターフェイス112は、メモリカード114に対して任意のデータの読み書きが可能になっている。 The memory card interface 112 accepts a memory card 114, which is an example of a removable storage medium. The memory card interface 112 is capable of reading/writing arbitrary data from/to the memory card 114 .
 上位ネットワークコントローラ106は、上位ネットワーク20を介して、任意の情報処理装置(図1に示される表示装置600およびサーバ装置700など)との間でデータをやり取りする。 The host network controller 106 exchanges data with arbitrary information processing devices (such as the display device 600 and the server device 700 shown in FIG. 1) via the host network 20 .
 フィールドネットワークコントローラ108は、フィールドネットワーク10を介して、それぞれのデバイスとの間でデータをやり取りする。図1に示すシステム構成例において、フィールドネットワークコントローラ108は、フィールドネットワーク10の通信マスタとして機能してもよい。 The field network controller 108 exchanges data with each device via the field network 10. In the system configuration example shown in FIG. 1 , the field network controller 108 may function as a communication master of the field network 10 .
 ローカルバスコントローラ116は、ローカルバス122を介して、制御装置100に含まれる任意の機能ユニット124との間でデータをやり取りする。機能ユニット124は、例えば、アナログ信号の入力および/または出力を担当するアナログI/Oユニット、デジタル信号の入力および/または出力を担当するデジタルI/Oユニット、エンコーダなどからのパルスを受け付けるカウンタユニットなどからなる。 The local bus controller 116 exchanges data with any functional unit 124 included in the control device 100 via the local bus 122 . The functional unit 124 is, for example, an analog I/O unit responsible for inputting and/or outputting analog signals, a digital I/O unit responsible for inputting and/or outputting digital signals, a counter unit accepting pulses from encoders, etc. And so on.
 USBコントローラ120は、USB接続を介して、任意の情報処理装置(サポート装置500など)との間でデータをやり取りする。 The USB controller 120 exchanges data with any information processing device (such as the support device 500) via a USB connection.
 (b2:ロボットコントローラ250)
 ロボットコントローラ250は、主たるコンポーネントとして、制御装置100との間でデータをやり取りするネットワークコントローラと、ロボット200を駆動するために必要な演算処理を実行する処理回路と、ロボット200との間でデータをやり取りするインターフェイス回路とを含む。
(b2: robot controller 250)
The main components of the robot controller 250 are a network controller that exchanges data with the control device 100 , a processing circuit that executes arithmetic processing necessary to drive the robot 200 , and data exchange with the robot 200 . and interface circuits to interact with.
 (b3:サーボコントローラ350)
 サーボコントローラ350は、主たるコンポーネントとして、制御装置100との間でデータをやり取りするネットワークコントローラと、サーボモータ300を駆動するために必要な演算処理を実行する処理回路と、サーボモータ300へ供給する電力を生成するためのドライブ回路とを含む。
(b3: servo controller 350)
The main components of the servo controller 350 are a network controller that exchanges data with the control device 100 , a processing circuit that performs arithmetic processing necessary to drive the servo motors 300 , and power that is supplied to the servo motors 300 . and a drive circuit for generating
 (b4:ティーチングペンダント400)
 ティーチングペンダント400主たるコンポーネントとして、制御装置100との間でデータをやり取りするインターフェイスと、ロボット200に対する操作を受け付ける入力部と、各種情報を表示する表示部とを含む。
(b4: teaching pendant 400)
The main components of the teaching pendant 400 include an interface for exchanging data with the control device 100, an input section for receiving operations on the robot 200, and a display section for displaying various information.
 (b5:サポート装置500)
 本実施の形態に係る制御システム1を構成するサポート装置500は、一例として、汎用パソコンを用いて実現されてもよい。
(b5: support device 500)
The support device 500 that configures the control system 1 according to the present embodiment may be realized using a general-purpose personal computer as an example.
 図4は、本実施の形態に係る制御システム1を構成するサポート装置500のハードウェア構成例を示す模式図である。図4を参照して、サポート装置500は、CPUやMPUなどのプロセッサ502と、メインメモリ504と、入力部506と、表示部508と、ストレージ510と、ネットワークコントローラ516と、USBコントローラ518と、光学ドライブ520とを含む。これらのコンポーネントはバス524を介して接続される。 FIG. 4 is a schematic diagram showing a hardware configuration example of the support device 500 that configures the control system 1 according to the present embodiment. 4, support device 500 includes processor 502 such as a CPU or MPU, main memory 504, input unit 506, display unit 508, storage 510, network controller 516, USB controller 518, and an optical drive 520 . These components are connected via bus 524 .
 プロセッサ502は、ストレージ510に格納された各種プログラムを読み出して、メインメモリ504に展開して実行することで、制御装置100で実行されるユーザプログラム(IECプログラム150およびアプリケーションプログラム160)の開発などの処理を提供する。 The processor 502 reads out various programs stored in the storage 510, develops them in the main memory 504, and executes them, thereby developing user programs (IEC programs 150 and application programs 160) executed by the control device 100. Provide processing.
 ストレージ510は、例えば、SSDやHDDなどの不揮発性記憶装置などで構成される。ストレージ510には、典型的には、OS512と、制御装置100において実行されるユーザプログラムの作成、作成したユーザプログラムのデバッグ、システム構成の定義、各種パラメータの設定などを行うための開発プログラム514とが格納される。ストレージ510には、図4に示すプログラム以外の必要なプログラムが格納されてもよい。 The storage 510 is composed of, for example, non-volatile storage devices such as SSDs and HDDs. The storage 510 typically includes an OS 512, a development program 514 for creating a user program to be executed in the control device 100, debugging the created user program, defining the system configuration, setting various parameters, and the like. is stored. The storage 510 may store necessary programs other than the programs shown in FIG.
 入力部506は、キーボードやマウスなどで構成され、ユーザ操作を受け付ける。表示部508は、ディスプレイ、各種インジケータ、プリンタなどで構成され、プロセッサ502からの処理結果などを出力する。 The input unit 506 is composed of a keyboard, mouse, etc., and receives user operations. A display unit 508 includes a display, various indicators, a printer, and the like, and outputs processing results from the processor 502 and the like.
 ネットワークコントローラ516は、任意のネットワークを介した他の装置との間のデータのやり取りを制御する。USBコントローラ518は、USB接続を介して制御装置100との間のデータのやり取りを制御する。 A network controller 516 controls the exchange of data with other devices via any network. The USB controller 518 controls data exchange with the control device 100 via a USB connection.
 サポート装置500は、光学ドライブ520を有しており、コンピュータ読取可能なプログラムを非一過的に格納する記録媒体522(例えば、DVD(Digital Versatile Disc)などの光学記録媒体)から、その中に格納されたプログラムが読取られてストレージ510などにインストールされる。 The support device 500 has an optical drive 520, and from a recording medium 522 (for example, an optical recording medium such as a DVD (Digital Versatile Disc)) that stores a computer-readable program non-transitory, The stored program is read and installed in the storage 510 or the like.
 サポート装置500で実行される各種プログラムは、コンピュータ読取可能な記録媒体522を介してインストールされてもよいが、ネットワーク上のサーバ装置などからダウンロードする形でインストールするようにしてもよい。また、本実施の形態に係るサポート装置500が提供する機能は、OS512が提供するモジュールの一部を利用する形で実現される場合もある。 Various programs executed by the support device 500 may be installed via the computer-readable recording medium 522, or may be installed by downloading from a server device on the network. Also, the functions provided by the support device 500 according to the present embodiment may be realized by using some of the modules provided by the OS 512 .
 (b6:表示装置600)
 本実施の形態に係る制御システム1を構成する表示装置600は、一例として、汎用パソコンを用いて実現されてもよい。表示装置600の基本的なハードウェア構成例は、周知であるので、ここでは詳細な説明は行わない。
(b6: display device 600)
Display device 600 configuring control system 1 according to the present embodiment may be realized using a general-purpose personal computer as an example. Since the basic hardware configuration example of the display device 600 is well known, detailed description thereof will not be given here.
 (b7:サーバ装置700)
 本実施の形態に係る制御システム1を構成するサーバ装置700は、一例として汎用パソコンを用いて実現されてもよい。サーバ装置700の基本的なハードウェア構成例は、周知であるので、ここでは詳細な説明は行わない。
(b7: server device 700)
Server device 700 that configures control system 1 according to the present embodiment may be realized using a general-purpose personal computer as an example. Since the basic hardware configuration example of the server device 700 is well known, detailed description thereof will not be given here.
 (b8:その他の形態)
 図3および図4には、1または複数のプロセッサがプログラムを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASIC(Application Specific Integrated Circuit)またはFPGA(Field-Programmable Gate Array)など)を用いて実装してもよい。
(b8: other forms)
3 and 4 show configuration examples in which one or more processors execute programs to provide necessary functions. It may be implemented using a hardware circuit (for example, ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array)).
 <C.IECプログラムおよびアプリケーションプログラムの実行>
 次に、本実施の形態に係る制御装置100におけるユーザプログラム(IECプログラム150およびアプリケーションプログラム160)の実行について説明する。
<C. Execution of IEC Program and Application Program>
Next, execution of user programs (IEC program 150 and application program 160) in control device 100 according to the present embodiment will be described.
 図5は、本実施の形態に係る制御装置100におけるプログラム実行環境に関する構成を示す模式図である。図5を参照して、制御装置100は、IECプログラム実行部130と、アプリケーションプログラム実行部134と、データ管理部142と、実行管理部132とを含む。 FIG. 5 is a schematic diagram showing the configuration of the program execution environment in control device 100 according to the present embodiment. Referring to FIG. 5 , control device 100 includes an IEC program executing portion 130 , an application program executing portion 134 , a data managing portion 142 and an execution managing portion 132 .
 IECプログラム実行部130は、シーケンス命令を含むユーザプログラムであるIECプログラム150を所定周期毎に実行する。なお、IECプログラム150は、シーケンス命令に加えて、モーション命令を含む。 The IEC program execution unit 130 executes the IEC program 150, which is a user program including sequence instructions, at predetermined intervals. Note that the IEC program 150 includes motion instructions in addition to sequence instructions.
 アプリケーションプログラム実行部134は、所定のプログラミング言語で記述されたユーザプログラムであるアプリケーションプログラム160を逐次解釈して実行する。アプリケーションプログラム160は、典型的には、ロボット200を制御するための命令を含む。アプリケーションプログラム実行部134は、インタプリタ136と、キャッシュ138と、コマンド生成部140とを含む。 The application program execution unit 134 sequentially interprets and executes an application program 160, which is a user program written in a predetermined programming language. Application program 160 typically includes instructions for controlling robot 200 . Application program execution unit 134 includes interpreter 136 , cache 138 , and command generation unit 140 .
 インタプリタ136は、アプリケーションプログラム160を逐次解釈して中間コードを生成する。生成された中間コードは、キャッシュ138にキューイング(エンキュー)される。コマンド生成部140は、キャッシュ138にキューイングされた中間コードを都度参照して指令を対象のロボット200に送信する。 The interpreter 136 sequentially interprets the application program 160 to generate intermediate code. The generated intermediate code is queued (enqueued) in the cache 138 . The command generator 140 refers to the intermediate code queued in the cache 138 each time and transmits the command to the target robot 200 .
 データ管理部142は、プログラム実行に必要なデータを保持する。データ管理部142が保持するデータは、予め定められた周期でリフレッシュ(更新)される。データ管理部142は、入出力データを保持するためのIOデータ領域144と、制御装置100の内部で使用されるワーキングデータを保持するための内部データ領域146および共有領域148とを含む。共有領域148には、IECプログラム実行部130およびアプリケーションプログラム実行部134が共通に参照可能なデータが格納される。データ管理部142は、データを変数の形で管理するようにしてもよい。 The data management unit 142 holds data necessary for program execution. The data held by the data management unit 142 is refreshed (updated) at predetermined intervals. The data management unit 142 includes an IO data area 144 for holding input/output data, an internal data area 146 and a shared area 148 for holding working data used inside the control device 100 . Shared area 148 stores data that can be commonly referred to by IEC program execution unit 130 and application program execution unit 134 . The data management unit 142 may manage data in the form of variables.
 実行管理部132は、IECプログラム実行部130およびアプリケーションプログラム実行部134におけるユーザプログラムの実行を管理する。実行管理部132の詳細については、後述する。 The execution management unit 132 manages execution of user programs in the IEC program execution unit 130 and the application program execution unit 134 . Details of the execution management unit 132 will be described later.
 <D.課題>
 次に、図5に示すユーザプログラムの実行において生じ得る課題について説明する。
<D. Issue>
Next, problems that may occur in executing the user program shown in FIG. 5 will be described.
 本実施の形態に係る制御装置100は、IECプログラム150およびアプリケーションプログラム160を並列的に実行することができる。それぞれのユーザプログラムは、例えば、以下のように役割を分担させることができる。 The control device 100 according to the present embodiment can execute the IEC program 150 and the application program 160 in parallel. Each user program can be assigned roles as follows, for example.
 すなわち、アプリケーションプログラム160は、ロボット200に組立や加工などの予め定められた動作を実現するようにプログラミングし、IECプログラム150には、ロボット200の動作に関連する周辺装置、センサおよびアクチュエータなどと連動させた動作を実現するようにプログラミングしてもよい。 That is, the application program 160 programs the robot 200 to perform predetermined operations such as assembly and processing, and the IEC program 150 includes peripheral devices, sensors, actuators, and the like related to the operation of the robot 200. You may program so that the operation|movement which was made may be implement|achieved.
 一方で、IECプログラム150およびアプリケーションプログラム160は、実行形式が異なるため、異常発生時の振る舞い(例えば、停止動作や退避動作など)、タスク完了時の振る舞い(例えば、待機位置への移動など)、信号検出時の振る舞いといった、システムやロボットとしての共通処理についても、実行形式に応じてそれぞれプログラミングする必要がある。 On the other hand, the IEC program 150 and the application program 160 have different execution formats. It is also necessary to program common processing for systems and robots, such as behavior when detecting signals, according to the execution format.
 そこで、共通処理を一方のプログラムにまとめて実装することで、それぞれのプログラムに共通処理を記述しなければならないという手間を削減できるが、プログラム自体が複雑化するという別の課題が生じ得る。 Therefore, by implementing common processing in one program, it is possible to reduce the trouble of having to describe common processing in each program, but another problem may arise in that the program itself becomes more complicated.
 図6は、本実施の形態に係る制御装置100において共通処理をIECプログラム150に実装した場合の処理手順の一例を説明するための図である。 FIG. 6 is a diagram for explaining an example of a processing procedure when common processing is implemented in the IEC program 150 in the control device 100 according to this embodiment.
 図6を参照して、共通処理を実行すべきイベントが発生すると、アプリケーションプログラム160では、対象のロボット200に対する制御権を解放する処理が実行される(ステップS1)。 Referring to FIG. 6, when an event for executing common processing occurs, the application program 160 executes processing for releasing the control right for the target robot 200 (step S1).
 続いて、制御権を解放したことがIECプログラム150に通知される(ステップS2)。アプリケーションプログラム160では、IECプログラム150での処理の完了待ちとなる(ステップS3)。 Subsequently, the IEC program 150 is notified that the control right has been released (step S2). The application program 160 waits for completion of the processing in the IEC program 150 (step S3).
 IECプログラム150では、アプリケーションプログラム160からの通知に応答して、制御権を獲得する処理が実行される(ステップS4)。そして、IECプログラム150では、共通処理が実行される(ステップS5)。共通処理の実行後、制御権が解放され(ステップS6)、制御権を解放したことがアプリケーションプログラム160に通知される(ステップS7)。 In response to the notification from the application program 160, the IEC program 150 executes a process of acquiring control (step S4). Then, the IEC program 150 executes common processing (step S5). After the common processing is executed, the control right is released (step S6), and the application program 160 is notified of the release of the control right (step S7).
 すると、アプリケーションプログラム160では、制御権を獲得する処理が実行され(ステップS8)、処理が再開される(ステップS9)。 Then, the application program 160 executes a process of acquiring the control right (step S8), and restarts the process (step S9).
 図6に示すように、共通処理を一方のプログラムにまとめて実装すると、制御対象のロボット200に対する制御権の獲得および解放、プログラム間のインターロック、タイミング調整などが必要となり、プログラム自体が複雑化し、再利用性も低下する。 As shown in FIG. 6, if common processing is collectively implemented in one program, acquisition and release of the control right for the robot 200 to be controlled, interlock between programs, timing adjustment, etc. are required, and the program itself becomes complicated. , the reusability also decreases.
 <E.解決手段>
 次に、上述したような課題を解決するための構成について説明する。
<E. Solution>
Next, a configuration for solving the problems described above will be described.
 図7は、本実施の形態に係る制御装置100におけるユーザプログラムの実行管理の概要を説明するための図である。図7を参照して、実行管理部132は、ステートマシーン180を有しており、ステートマシーン180の遷移に応じて、IECプログラム150として規定されたユーザ定義処理152、および、アプリケーションプログラム160として規定されたユーザ定義処理162の実行を管理する。実行管理部132には、ステートマシーン180の遷移と、実行されるユーザ定義処理との対応関係を規定したユーザ定義処理設定133が与えられる。 FIG. 7 is a diagram for explaining an overview of user program execution management in the control device 100 according to the present embodiment. Referring to FIG. 7, execution management unit 132 has state machine 180, and according to the transition of state machine 180, user defined process 152 defined as IEC program 150 and application program 160 defined as It manages the execution of the user-defined process 162 that has been created. The execution management unit 132 is provided with a user-defined process setting 133 that defines the correspondence relationship between the transition of the state machine 180 and the user-defined process to be executed.
 ユーザ定義処理152は、IECプログラム150に含まれる複数のプログラムの一つとして規定されてもよいし、IECプログラム150に含まれるプログラムの一部として規定されてもよい。同様に、ユーザ定義処理162は、アプリケーションプログラム160に含まれる複数のプログラムの一つとして規定されてもよいし、アプリケーションプログラム160に含まれるプログラムの一部として規定されてもよい。 The user-defined process 152 may be defined as one of multiple programs included in the IEC program 150, or may be defined as part of the program included in the IEC program 150. Similarly, user-defined process 162 may be defined as one of a plurality of programs included in application program 160 or may be defined as part of a program included in application program 160 .
 <F.ステートマシーン180>
 次に、ユーザプログラムの実行管理を行うためのステートマシーン180の一例について説明する。
<F. state machine 180>
Next, an example of the state machine 180 for managing execution of user programs will be described.
 図8は、本実施の形態に係る制御装置100におけるユーザプログラムの実行管理を行うためのステートマシーン180の一例を示す模式図である。 FIG. 8 is a schematic diagram showing an example of a state machine 180 for managing execution of user programs in the control device 100 according to this embodiment.
 図8に示すステートマシーン180は、動作管理ステートとプログラム実行管理ステートとを含む。動作管理ステートは、制御対象(例えば、ロボット200を含むシステム全体)の動作状態に対応するステートマシーンに相当する。 The state machine 180 shown in FIG. 8 includes an operation management state and a program execution management state. The motion management state corresponds to a state machine corresponding to the motion state of the controlled object (for example, the entire system including the robot 200).
 より具体的には、動作管理ステートは、動作中ステート182と、減速停止中ステート183と、停止中ステート184と、無効ステート185と、エラー減速停止中ステート186と、ティーチングペンダント制御中ステート187とを含む。 More specifically, the operation management states include an operating state 182, a decelerating and stopping state 183, a stopping state 184, an invalid state 185, an error decelerating and stopping state 186, and a teaching pendant controlling state 187. including.
 動作中ステート182、減速停止中ステート183および停止中ステート184は、制御装置100が制御権を獲得した状態(制御権獲得済ステート181)で生じる。 The operating state 182, the decelerating and stopping state 183, and the stopping state 184 occur when the control device 100 has acquired control (control acquired state 181).
 ここで、制御対象(例えば、ロボット200)に対する制御権とは、制御対象に対してコマンドを送信する権利を意味する。制御システム1においては、制御装置100およびティーチングペンダント400のいずれもからロボット200を制御できる。すなわち、ユーザがティーチングペンダント400を操作してロボット200を制御する場合には、ユーザ操作に応じた指令値あるいはコマンドが優先される。また、制御装置100においても、IECプログラム150およびアプリケーションプログラム160のいずれもからロボット200を制御できる。そのため、ロボット200を制御する単一の主体を排他的に決定するために、制御権を用いた管理が行われる。 Here, the right to control the controlled object (for example, the robot 200) means the right to transmit commands to the controlled object. In control system 1 , robot 200 can be controlled from both control device 100 and teaching pendant 400 . That is, when the user operates the teaching pendant 400 to control the robot 200, priority is given to the command value or command according to the user's operation. Also, in the control device 100 , the robot 200 can be controlled from both the IEC program 150 and the application program 160 . Therefore, management using control rights is performed in order to exclusively determine a single entity that controls the robot 200 .
 動作中ステート182は、ロボット200が動作している状態を意味し、減速停止中ステート183は、ロボット200が停止状態に向けて減速している状態を意味し、停止中ステート184は、ロボット200が停止している状態を意味する。アプリケーションプログラム160に記述された命令によって、ロボット200が制御されることで、これらのいずれかの状態となる。 The operating state 182 means that the robot 200 is operating, the decelerating and stopping state 183 means that the robot 200 is decelerating toward the stopped state, and the stopping state 184 means that the robot 200 is stopped. The robot 200 is controlled by commands written in the application program 160 to enter one of these states.
 無効ステート185は、制御権をやり取りする過程を意味し、制御装置100が制御権を獲得あるいは解放する過程、ならびに、ティーチングペンダント400が制御権を獲得あるいは解放する過程において生じる。また、電源投入直後などの初期状態も無効ステート185に相当する。 The invalid state 185 means the process of exchanging control rights, and occurs in the process in which the control device 100 acquires or releases control rights and in the process in which the teaching pendant 400 acquires or releases control rights. An initial state such as immediately after power-on also corresponds to the invalid state 185 .
 エラー減速停止中ステート186は、何らかの異常が発生し、ロボット200が停止状態に向けて減速している状態を意味する。 The error deceleration stop state 186 means a state in which some abnormality has occurred and the robot 200 is decelerating toward a stop state.
 ティーチングペンダント制御中ステート187は、ユーザがティーチングペンダント400を操作し、ロボット200を制御している状態を意味する。 The teaching pendant in control state 187 means that the user is operating the teaching pendant 400 to control the robot 200 .
 このような動作管理ステートに関連付けて、以下のようなプログラム実行管理ステートが規定される。 The following program execution management states are defined in association with such operation management states.
 より具体的には、ステートマシーン180は、プログラム実行管理ステートとして、制御権獲得ステート191と、制御権解放ステート192と、制御権獲得(TP)ステート193と、制御権解放(TP)ステート194と、異常解除ステート195とを含む。なお、「TP」は、ティーチングペンダントを意味する。 More specifically, the state machine 180 has a control right acquisition state 191, a control right release state 192, a control right acquisition (TP) state 193, and a control right release (TP) state 194 as program execution management states. , and an abnormal release state 195 . In addition, "TP" means a teaching pendant.
 制御装置100の実行管理部132は、予め定められた1または複数のイベントの発生に応じて、ステートマシーン180のプログラム実行管理ステートを遷移させる。 The execution management unit 132 of the control device 100 transitions the program execution management state of the state machine 180 in response to the occurrence of one or more predetermined events.
 制御権獲得ステート191および制御権獲得(TP)ステート193は、無効ステート185に含まれ、制御装置100およびティーチングペンダント400がそれぞれ制御権を獲得する過程で生じる。より具体的には、IECプログラム150またはアプリケーションプログラム160に含まれる制御権を獲得するための命令の実行が完了することで、制御権獲得ステート191へ遷移する。また、ユーザがティーチングペンダント400のモードを「Auto」から「Manual」に変更することで、制御権獲得(TP)ステート193へ遷移する。 A control right acquisition state 191 and a control right acquisition (TP) state 193 are included in the invalid state 185 and occur in the process in which the control device 100 and the teaching pendant 400 respectively acquire control rights. More specifically, when the execution of the instruction for acquiring the control included in the IEC program 150 or the application program 160 is completed, the state transitions to the control acquisition state 191 . Also, when the user changes the mode of the teaching pendant 400 from “Auto” to “Manual”, the state transitions to the control privilege acquisition (TP) state 193 .
 制御権獲得ステート191において、予め設定されたユーザ定義処理の実行が完了すると、停止中ステート184へ遷移する。また、制御権獲得(TP)ステート193において、予め設定されたユーザ定義処理の実行が完了すると、ティーチングペンダント制御中ステート187へ遷移する。 When the execution of the preset user-defined process is completed in the control right acquisition state 191, the state transitions to the stopped state 184. In addition, in the control privilege acquisition (TP) state 193, when the execution of the preset user-defined process is completed, the transition to the teaching pendant control state 187 is made.
 制御権解放ステート192は、停止中ステート184に含まれ、制御装置100が制御権を解放する過程で生じる。より具体的には、IECプログラム150またはアプリケーションプログラム160に含まれる制御権を解放するための命令の実行が完了することで、制御権解放ステート192へ遷移する。制御権解放ステート192において、予め設定されたユーザ定義処理の実行が完了すると、無効ステート185へ遷移する。 The control right release state 192 is included in the stopping state 184 and occurs in the process in which the control device 100 releases the control right. More specifically, the control right release state 192 is transitioned to when the execution of the instruction for releasing the control right included in the IEC program 150 or the application program 160 is completed. In the control right release state 192 , when execution of preset user-defined processing is completed, the state transitions to the invalid state 185 .
 制御権解放(TP)ステート194は、ティーチングペンダント制御中ステート187に含まれ、ティーチングペンダント400が制御権を解放する過程で生じる。より具体的には、ユーザがティーチングペンダント400のモードを「Manual」から「Auto」に変更することで、制御権解放(TP)ステート194へ遷移する。制御権解放(TP)ステート194において、予め設定されたユーザ定義処理の実行が完了すると、無効ステート185へ遷移する。 A control release (TP) state 194 is included in the teaching pendant controlling state 187 and occurs in the process of the teaching pendant 400 releasing control. More specifically, when the user changes the mode of the teaching pendant 400 from “Manual” to “Auto”, it transitions to the control right release (TP) state 194 . In the control right release (TP) state 194, when execution of preset user-defined processing is completed, a transition is made to an invalid state 185. FIG.
 このように、ステートマシーン180は、プログラム実行管理ステートとして、制御対象に対する制御権の獲得および解放に応じて遷移するステートを含む。 In this way, the state machine 180 includes, as program execution management states, transition states according to the acquisition and release of control rights for controlled objects.
 異常解除ステート195は、エラー減速停止中ステート186に含まれ、発生した異常が解除される過程で生じる。より具体的には、発生した異常の解除が完了することで、異常解除ステート195へ遷移する。異常解除ステート195において、予め設定されたユーザ定義処理の実行が完了すると、無効ステート185へ遷移する。 An error release state 195 is included in the error deceleration stop state 186 and occurs in the process of releasing an error that has occurred. More specifically, when the cancellation of the abnormality that has occurred is completed, the state transitions to the abnormality cancellation state 195 . When execution of preset user-defined processing is completed in the anomaly release state 195 , the state transitions to the invalid state 185 .
 図8に示すように、プログラム実行管理ステート(制御権獲得ステート191、制御権解放ステート192、制御権獲得(TP)ステート193、制御権解放(TP)ステート194、異常解除ステート195)については、ステートマシーン180を遷移させる条件が成立した場合であっても、対応するユーザ定義処理の実行完了後を待って遷移させる。 As shown in FIG. 8, the program execution management states (control right acquisition state 191, control right release state 192, control right acquisition (TP) state 193, control right release (TP) state 194, and error release state 195) are: Even if the conditions for transitioning the state machine 180 are satisfied, the transition is made after the execution of the corresponding user-defined process is completed.
 動作管理ステートとしては、図8に示すステートに限られず、さらに別のステートを追加してもよいし、一部のステートを省略してもよい。また、プログラム実行管理ステートについても、図8に示されるステートに限られず、任意のステートを定義できる。また、遷移を生じる条件についても、図8に示す条件に限られず、任意の条件を追加ないし設定することができる。なお、遷移の条件とされるユーザ定義処理が設定されていなければ、ユーザ定義処理の実行の完了を待つことなく、遷移が生じるようにしてもよい。 The operation management states are not limited to the states shown in FIG. 8, and other states may be added or some states may be omitted. Also, the program execution management state is not limited to the states shown in FIG. 8, and any state can be defined. Also, the conditions for causing the transition are not limited to the conditions shown in FIG. 8, and arbitrary conditions can be added or set. If no user-defined process is set as a transition condition, the transition may occur without waiting for the execution of the user-defined process to be completed.
 制御装置100においては、ステートマシーン180に生じ得る遷移(プログラム実行管理ステートの遷移)の各々に対応付けて、任意のユーザ定義処理が設定可能になっている。ユーザ定義処理は、IECプログラム150およびアプリケーションプログラム160のいずれをも含めることができる。なお、ユーザ定義処理の設定内容は、ユーザ定義処理設定133に定義される。 In the control device 100, arbitrary user-defined processing can be set in association with each transition that can occur in the state machine 180 (transition of the program execution management state). User-defined processing can include both IEC programs 150 and application programs 160 . The setting contents of the user-defined process are defined in the user-defined process setting 133. FIG.
 制御装置100の実行管理部132は、ユーザ定義処理設定133を参照して、ステートマシーン180に遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定する。 The execution management unit 132 of the control device 100 refers to the user-defined process setting 133 and, when a transition occurs in the state machine 180, determines the user-defined process to be executed corresponding to the transition.
 また、制御装置100の実行管理部132は、予め定められた実行形態に従ってユーザ定義処理を実行させる。ユーザ定義処理の実行形態としては、例えば、(1)entry、(2)do、(3)exitの3種類の候補から選択できるようになっていてもよい。より具体的には、(1)entryは、対応するステートに遷移するときに一度だけ実行される実行形態である。(2)doは、対応するステートに存在する期間において実行され続ける実行形態である。(3)exitは、対応するステートから別のステートに遷移するときに一度だけ実行される実行形態である。 Also, the execution management unit 132 of the control device 100 causes the user-defined process to be executed according to a predetermined execution form. As an execution mode of the user-defined process, for example, it may be possible to select from three types of candidates: (1) entry, (2) do, and (3) exit. More specifically, (1) entry is an execution form that is executed only once when transitioning to the corresponding state. (2) do is an execution form that continues to be executed during the period in which the corresponding state exists. (3) exit is an execution form that is executed only once when transitioning from the corresponding state to another state.
 なお、ユーザ定義処理の実行形態の候補としては、上述の(1)~(3)の少なくとも1つを含むようにすればよい。すなわち、上述の(1)~(3)のすべてをユーザ定義処理の実行形態の候補に含める必要はない。 At least one of the above (1) to (3) may be included as a candidate for the execution form of the user-defined process. In other words, it is not necessary to include all of the above (1) to (3) as candidates for execution forms of user-defined processing.
 このように、本実施の形態に係る制御装置100は、制御権の獲得および解放、ならびに、異常発生などのイベント発生時に、任意のユーザ定義処理を実行することができる。 In this way, the control device 100 according to the present embodiment can execute arbitrary user-defined processing upon acquisition and release of control rights and when an event such as an abnormality occurs.
 図9は、本実施の形態に係る制御装置100におけるユーザ定義処理設定133を定義するユーザインターフェイス画面550の一例を示す模式図である。図9に示すユーザインターフェイス画面550は、典型的には、サポート装置500のプロセッサ502が開発プログラム514を実行することで、サポート装置500の表示部508などに出力される。 FIG. 9 is a schematic diagram showing an example of a user interface screen 550 that defines the user-defined processing settings 133 in the control device 100 according to this embodiment. User interface screen 550 shown in FIG. 9 is typically output to display unit 508 of support device 500 or the like by processor 502 of support device 500 executing development program 514 .
 図9を参照して、ユーザインターフェイス画面550は、プログラム実行設定テーブル560を含む。 Referring to FIG. 9, user interface screen 550 includes program execution setting table 560 .
 プログラム実行設定テーブル560は、ステート列571と、実行形態列572と、IECプログラム列573と、アプリケーションプログラム列574とを含む。 The program execution setting table 560 includes a state column 571, an execution mode column 572, an IEC program column 573, and an application program column 574.
 ステート列571は、制御権獲得ステート191、制御権解放ステート192、制御権獲得(TP)ステート193、制御権解放(TP)ステート194、および、異常解除ステート195にそれぞれ対応する制御権獲得行561、制御権解放行562、制御権獲得(TP)行563、制御権解放(TP)行564、および、異常解除行565を含む。 The state column 571 includes control right acquisition rows 561 corresponding to the control right acquisition state 191, the control right release state 192, the control right acquisition (TP) state 193, the control right release (TP) state 194, and the abnormal release state 195, respectively. , a control right release line 562, a control right acquisition (TP) line 563, a control right release (TP) line 564, and an error release line 565.
 実行形態列572は、各ステートに対応付けて、entry行566、do行567、exit行568の3種類の実行形態が定義されている。 The execution mode column 572 defines three types of execution modes, an entry row 566, a do row 567, and an exit row 568, associated with each state.
 ユーザは、所望のステートおよび実行形態に対応付けて、IECプログラム列573および/またはアプリケーションプログラム列574にユーザ定義処理を実現するためのプログラムを設定する。 The user sets a program for implementing user-defined processing in the IEC program column 573 and/or the application program column 574 in association with the desired state and execution mode.
 図9に示す例では、制御権獲得行561のentry行566に対応付けて、IECプログラム150として「program1」、および、アプリケーションプログラム160として「program100」がそれぞれ設定されている。また、制御権獲得行561のdo行567に対応付けて、IECプログラム150として「program2」が設定されている。 In the example shown in FIG. 9, "program1" is set as the IEC program 150 and "program100" is set as the application program 160 in association with the entry line 566 of the control right acquisition line 561. Also, “program2” is set as the IEC program 150 in association with the do line 567 of the control right acquisition line 561 .
 上述の設定例においては、制御権獲得ステート191への遷移が生じると、「program1」および「program100」が一度だけ実行されるとともに、制御権獲得ステート191に存在する期間において、「program2」が毎周期実行されることになる。 In the above setting example, when a transition to the control right acquisition state 191 occurs, "program1" and "program100" are executed only once, and "program2" is executed every time during the period in which the control right acquisition state 191 exists. It will be executed cyclically.
 図9のプログラム実行設定テーブル560に対する設定内容がユーザ定義処理設定133として格納される。このように、ステートマシーン180に生じ得る遷移の各々に対応付けられるユーザ定義処理は、ユーザインターフェイス画面550を介して設定される。 The setting contents for the program execution setting table 560 in FIG. 9 are stored as the user-defined process settings 133. Thus, user-defined processing associated with each possible transition in state machine 180 is set via user interface screen 550 .
 なお、図9には、ステートマシーン180の遷移に応じて実行されるユーザ定義処理を例示したが、通常、ステートマシーン180の遷移に依存することなく、定常的あるいは予め定められた条件が成立したときに実行される任意のユーザプログラム(IECプログラム150およびアプリケーションプログラム160)も存在する。すなわち、図9に示されるユーザ定義処理は、通常のユーザプログラムの実行処理に加えて、実行されることが想定されている。 Note that FIG. 9 illustrates user-defined processing that is executed according to the transition of the state machine 180, but normally, without depending on the transition of the state machine 180, a constant or predetermined condition is established. There are also optional user programs (IEC programs 150 and application programs 160) that are executed from time to time. That is, it is assumed that the user-defined process shown in FIG. 9 is executed in addition to the normal user program execution process.
 <G.処理手順>
 次に、本実施の形態に係る制御装置100におけるユーザプログラムの実行管理に係る処理手順について説明する。
<G. Processing procedure>
Next, a processing procedure relating to execution management of a user program in control device 100 according to the present embodiment will be described.
 図10は、本実施の形態に係る制御装置100におけるユーザプログラムの実行管理に係る処理手順を示すフローチャートである。図10に示す各ステップは、典型的には、制御装置100のプロセッサ102がシステムプログラム111を実行することで実現される。 FIG. 10 is a flow chart showing a processing procedure related to user program execution management in the control device 100 according to the present embodiment. Each step shown in FIG. 10 is typically implemented by processor 102 of control device 100 executing system program 111 .
 図10を参照して、新たな制御周期が到来すると(ステップS100においてYES)、制御装置100は、前回の制御周期において計算された指令値を出力し(ステップS102)、今回の制御周期において用いる入力値を取得する(ステップS104)。 Referring to FIG. 10, when a new control cycle arrives (YES in step S100), control device 100 outputs the command value calculated in the previous control cycle (step S102), and uses it in the current control cycle. An input value is acquired (step S104).
 制御装置100は、ステートマシーン180の遷移を生じ得るイベントが発生したか否かを判断する(ステップS106)。 The control device 100 determines whether an event that can cause a transition of the state machine 180 has occurred (step S106).
 ステートマシーン180の遷移を生じ得るイベントが発生すると(ステップS106においてYES)、制御装置100は、現在のステートの「exit」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されているか否かを判断する(ステップS108)。 When an event that can cause a transition of state machine 180 occurs (YES in step S106), control device 100 determines whether user-defined processing of application program 160 is set in association with "exit" of the current state. (step S108).
 現在のステートの「exit」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されていれば(ステップS108においてYES)、制御装置100は、設定されているユーザ定義処理(アプリケーションプログラム160)を起動する(ステップS110)。 If user-defined processing of application program 160 has been set in association with "exit" of the current state (YES in step S108), control device 100 executes the set user-defined processing (application program 160). Start up (step S110).
 現在のステートの「exit」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されていなければ(ステップS108においてNO)、ステップS110の処理はスキップされる。 If the user-defined process of the application program 160 is not set in association with "exit" of the current state (NO in step S108), the process of step S110 is skipped.
 続いて、制御装置100は、現在のステートの「exit」に対応付けて、IECプログラム150のユーザ定義処理が設定されているか否かを判断する(ステップS112)。 Subsequently, the control device 100 determines whether or not user-defined processing of the IEC program 150 is set in association with "exit" of the current state (step S112).
 現在のステートの「exit」に対応付けて、IECプログラム150のユーザ定義処理が設定されていれば(ステップS112においてYES)、制御装置100は、設定されているユーザ定義処理(IECプログラム150)を実行する(ステップS114)。 If the user-defined process of IEC program 150 has been set in association with "exit" of the current state (YES in step S112), control device 100 executes the set user-defined process (IEC program 150). Execute (step S114).
 現在のステートの「exit」に対応付けて、IECプログラム150のユーザ定義処理が設定されていなければ(ステップS112においてNO)、ステップS114の処理はスキップされる。 If the user-defined process of the IEC program 150 is not set in association with "exit" of the current state (NO in step S112), the process of step S114 is skipped.
 一方、ステートマシーン180の遷移を生じ得るイベントが発生していなければ(ステップS106においてNO)、あるいは、ステップS114の後、制御装置100は、「exit」に対応付けられたユーザ定義処理が実行中であるか否かを判断する(ステップS116)。「exit」に対応付けられたユーザ定義処理が実行中であれば(ステップS116においてYES)、制御装置100は、「exit」に対応付けられたユーザ定義処理が実行完了したか否かを判断する(ステップS118)。「exit」に対応付けられたユーザ定義処理が実行完了していなければ(ステップS118においてNO)、制御装置100は、次の制御周期の到来を待つ。 On the other hand, if an event that may cause a transition of state machine 180 has not occurred (NO in step S106), or after step S114, control device 100 determines that the user-defined process associated with "exit" is being executed. (step S116). If the user-defined process associated with "exit" is being executed (YES in step S116), control device 100 determines whether or not the user-defined process associated with "exit" has been completed. (Step S118). If execution of the user-defined process associated with "exit" has not been completed (NO in step S118), control device 100 waits for the arrival of the next control cycle.
 「exit」に対応付けられたユーザ定義処理が実行完了していれば(ステップS118においてYES)、制御装置100は、ステートマシーン180を新たなステートへ遷移させる(ステップS120)。なお、「exit」に対応付けられたユーザ定義処理が存在しない場合においても、ステップS120の処理は実行される。このように、制御装置100は、複数のステートを有するステートマシーン180を管理する処理を実行する。 If the user-defined process associated with "exit" has been completed (YES in step S118), the control device 100 transitions the state machine 180 to a new state (step S120). Note that even if there is no user-defined process associated with "exit", the process of step S120 is executed. In this manner, the control device 100 performs processing for managing the state machine 180 having multiple states.
 一方、「exit」に対応付けられたユーザ定義処理が実行中でなければ(ステップS116においてNO)、ステップS118およびS120の処理はスキップされる。 On the other hand, if the user-defined process associated with "exit" is not being executed (NO in step S116), the processes of steps S118 and S120 are skipped.
 続いて、制御装置100は、ステートマシーン180に新たなステートへの遷移が生じたか否かを判断する(ステップS122)。 Subsequently, the control device 100 determines whether or not the state machine 180 has transitioned to a new state (step S122).
 ステートマシーン180に新たなステートへの遷移が生じていれば(ステップS122においてYES)、制御装置100は、新たなステートの「entry」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されているか否かを判断する(ステップS124)。 If state machine 180 has transitioned to a new state (YES in step S122), control device 100 sets user-defined processing of application program 160 in association with the new state "entry". It is determined whether or not there is (step S124).
 新たなステートの「entry」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されていれば(ステップS124においてYES)、制御装置100は、設定されているユーザ定義処理(アプリケーションプログラム160)を起動する(ステップS126)。 If the user-defined process of application program 160 has been set in association with the new state "entry" (YES in step S124), control device 100 executes the set user-defined process (application program 160). Start up (step S126).
 新たなステートの「entry」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されていなければ(ステップS124においてNO)、ステップS126の処理はスキップされる。 If the user-defined process of the application program 160 is not set in association with the new state "entry" (NO in step S124), the process of step S126 is skipped.
 続いて、制御装置100は、新たなステートの「entry」に対応付けて、IECプログラム150のユーザ定義処理が設定されているか否かを判断する(ステップS128)。 Subsequently, the control device 100 determines whether or not user-defined processing of the IEC program 150 is set in association with the new state "entry" (step S128).
 新たなステートの「entry」に対応付けて、IECプログラム150のユーザ定義処理が設定されていれば(ステップS128においてYES)、制御装置100は、設定されているユーザ定義処理(IECプログラム150)を実行する(ステップS130)。 If the user-defined process of IEC program 150 has been set in association with the new state "entry" (YES in step S128), control device 100 executes the set user-defined process (IEC program 150). Execute (step S130).
 新たなステートの「entry」に対応付けて、IECプログラム150のユーザ定義処理が設定されていなければ(ステップS128においてNO)、ステップS130の処理はスキップされる。 If the user-defined process of the IEC program 150 is not set in association with the new state "entry" (NO in step S128), the process of step S130 is skipped.
 そして、制御装置100は、次の制御周期の到来を待つ。
 一方、ステートマシーン180に新たなステートへの遷移が生じていなければ(ステップS122においてNO)、制御装置100は、現在のステートの「do」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されているか否かを判断する(ステップS132)。
Then, the control device 100 waits for the arrival of the next control cycle.
On the other hand, if state machine 180 has not transitioned to a new state (NO in step S122), control device 100 sets user-defined processing of application program 160 in association with the current state of "do". It is determined whether or not it is set (step S132).
 現在のステートの「do」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されていれば(ステップS132においてYES)、制御装置100は、設定されているユーザ定義処理(アプリケーションプログラム160)を起動する(ステップS134)。 If the user-defined process of application program 160 has been set in association with the current state of "do" (YES in step S132), control device 100 executes the set user-defined process (application program 160). Start up (step S134).
 現在のステートの「do」に対応付けて、アプリケーションプログラム160のユーザ定義処理が設定されていなければ(ステップS132においてNO)、ステップS134の処理はスキップされる。 If the user-defined process of the application program 160 is not set in association with "do" of the current state (NO in step S132), the process of step S134 is skipped.
 続いて、制御装置100は、現在のステートの「do」に対応付けて、IECプログラム150のユーザ定義処理が設定されているか否かを判断する(ステップS136)。 Subsequently, the control device 100 determines whether or not user-defined processing of the IEC program 150 is set in association with the current state "do" (step S136).
 現在のステートの「do」に対応付けて、IECプログラム150のユーザ定義処理が設定されていれば(ステップS136においてYES)、制御装置100は、設定されているユーザ定義処理(IECプログラム150)を実行する(ステップS138)。 If the user-defined process of IEC program 150 has been set in association with the current state "do" (YES in step S136), control device 100 executes the set user-defined process (IEC program 150). Execute (step S138).
 現在のステートの「do」に対応付けて、IECプログラム150のユーザ定義処理が設定されていなければ(ステップS136においてNO)、ステップS138の処理はスキップされる。 If the user-defined process of the IEC program 150 is not set in association with "do" of the current state (NO in step S136), the process of step S138 is skipped.
 そして、制御装置100は、次の制御周期の到来を待つ。
 以上のような処理手順によって、ステートに応じた任意のユーザ定義処理の実行管理を実現できる。すなわち、制御装置100は、ステートマシーン180の遷移に応じて、IECプログラム150として規定されたユーザ定義処理、および、アプリケーションプログラム160として規定されたユーザ定義処理、の実行を管理する(ステップS106,S108,S112,S116,S124,S128,S132,S136)。
Then, the control device 100 waits for the arrival of the next control cycle.
With the processing procedure as described above, execution management of arbitrary user-defined processing according to the state can be realized. That is, the control device 100 manages the execution of the user-defined process specified as the IEC program 150 and the user-defined process specified as the application program 160 according to the transition of the state machine 180 (steps S106, S108). , S112, S116, S124, S128, S132, S136).
 そして、制御装置100は、IECプログラム150として規定されたユーザ定義処理を所定周期毎に実行する(S114,S130,S138)とともに、アプリケーションプログラム160として規定されたユーザ定義処理を逐次解釈して実行する(S110,S126,S134)。 Then, the control device 100 executes user-defined processing defined as the IEC program 150 at predetermined intervals (S114, S130, S138), and sequentially interprets and executes user-defined processing defined as the application program 160. (S110, S126, S134).
 次に、上述したようなユーザ定義処理の実行に係る処理順序などについて説明する。
 図11および図12は、本実施の形態に係る制御装置100におけるユーザプログラムの実行に係る処理順序の一例を示すタイムチャートである。図11には、「entry」に対応付けてユーザ定義処理を実行する例を示し、図12には、「do」に対応付けてユーザ定義処理を実行する例を示す。
Next, the processing order and the like relating to the execution of the above-described user-defined processing will be described.
FIG. 11 and FIG. 12 are time charts showing an example of the processing order for executing the user program in control device 100 according to the present embodiment. FIG. 11 shows an example of executing user-defined processing in association with "entry", and FIG. 12 shows an example of executing user-defined processing in association with "do".
 図11を参照して、制御装置100は、定周期実行タスク170が制御周期T1毎に繰り返し実行される。定周期実行タスク170は、高優先タスクとして設定されている。定周期実行タスク170は、入出力リフレッシュ処理171と、アプリケーション入力処理172と、遷移監視処理173と、IECプログラム実行処理174と、アプリケーション出力処理175とを含む。 Referring to FIG. 11, the control device 100 repeatedly executes the fixed period execution task 170 every control period T1. The periodic execution task 170 is set as a high priority task. The periodic execution task 170 includes input/output refresh processing 171 , application input processing 172 , transition monitoring processing 173 , IEC program execution processing 174 and application output processing 175 .
 入出力リフレッシュ処理171は、前回の制御周期において計算された指令値を出力する処理、および、今回の制御周期において用いる入力値を取得する処理を含む。 The input/output refresh process 171 includes a process of outputting the command value calculated in the previous control cycle and a process of acquiring the input value used in the current control cycle.
 アプリケーション入力処理172は、アプリケーションプログラム160の実行に必要な入力値を取得する処理を含む。 The application input processing 172 includes processing for acquiring input values necessary for executing the application program 160 .
 遷移監視処理173は、ステートマシーン180に含まれるいずれかの遷移を生じさせるイベントの発生有無を監視する。 The transition monitoring processing 173 monitors whether an event that causes any of the transitions included in the state machine 180 has occurred.
 IECプログラム実行処理174は、IECプログラム150を実行する処理を含む。
 アプリケーション出力処理175は、アプリケーションプログラム160の実行によって指令値を計算する処理を含む。なお、アプリケーション出力処理175は、主として、アプリケーションプログラム160を逐次解釈して生成される中間コードに従う演算処理を含む。
IEC program execution processing 174 includes processing for executing IEC program 150 .
Application output processing 175 includes processing for calculating command values by executing application program 160 . Note that the application output processing 175 mainly includes arithmetic processing according to intermediate codes generated by sequentially interpreting the application program 160 .
 定周期実行タスク170と並列的に、アプリケーションプログラム160が実行される。アプリケーションプログラム160は、制御周期T1より長い時間をかけて、逐次実行される。そのため、アプリケーションプログラム160の実行処理は、定周期実行タスク170の実行中などに一次的に中断されることもある。 The application program 160 is executed in parallel with the periodic execution task 170 . The application program 160 is executed sequentially over a period of time longer than the control period T1. Therefore, the execution processing of the application program 160 may be temporarily interrupted while the periodic execution task 170 is being executed.
 アプリケーションプログラム160は、1または複数のプログラムが並列的に実行されてもよい。例えば、ロボット200に基本動作を実行させるためのアプリケーションプログラム177と、異常発生時の振る舞いを規定するアプリケーションプログラム178とを想定する。 The application program 160 may be one or more programs executed in parallel. For example, assume an application program 177 for causing the robot 200 to perform basic operations, and an application program 178 for defining behavior when an abnormality occurs.
 図11に示す例において、時刻t2から始まる制御周期T1において、遷移監視処理173で遷移を生じさせるイベントが検出されると、「entry」に対応付けられたユーザ定義処理176(IECプログラム150)が実行される。この場合、ユーザ定義処理176の実行時間だけ、IECプログラム実行処理174に要する時間が伸びることになる。 In the example shown in FIG. 11, when an event causing a transition is detected in the transition monitoring process 173 in the control cycle T1 starting at time t2, the user-defined process 176 (IEC program 150) associated with "entry" is executed. executed. In this case, the time required for the IEC program execution process 174 is extended by the execution time of the user-defined process 176 .
 また、「entry」に対応付けられたアプリケーションプログラム178が起動される。なお、起動されたアプリケーションプログラム178の実行完了までに、複数の制御周期T1の時間を要することがある。この場合には、アプリケーションプログラム178の実行が完了したことをもって、新たなステートへ遷移される。 Also, the application program 178 associated with "entry" is started. Note that it may take a plurality of control cycles T1 to complete execution of the started application program 178 . In this case, the state transitions to a new state upon completion of execution of the application program 178 .
 図12に示す例において、時刻t2から始まる制御周期T1において、遷移監視処理173で遷移を生じさせるイベントが検出されると、新たなステートへの遷移が生じ得る。 In the example shown in FIG. 12, when an event causing a transition is detected in the transition monitoring process 173 in the control cycle T1 starting at time t2, a transition to a new state can occur.
 すると、「do」に対応付けられたユーザ定義処理176(IECプログラム150)が制御周期T1毎に繰り返し実行される。この場合、ユーザ定義処理176の実行時間だけ、IECプログラム実行処理174に要する時間が伸びることになる。 Then, the user-defined process 176 (IEC program 150) associated with "do" is repeatedly executed every control cycle T1. In this case, the time required for the IEC program execution process 174 is extended by the execution time of the user-defined process 176 .
 また、「do」に対応付けられたアプリケーションプログラム178が起動される。起動されたアプリケーションプログラム178の実行完了までに、複数の制御周期T1の時間を要することがあるが、条件が満たされる限り、実行完了後に再度起動されるようにしてもよい。 Also, the application program 178 associated with "do" is started. It may take a plurality of control cycles T1 to complete the execution of the started application program 178, but as long as the conditions are satisfied, the application program 178 may be started again after the completion of execution.
 <H.付記>
 上述したような本実施の形態は、以下のような技術思想を含む。
<H. Note>
The present embodiment as described above includes the following technical ideas.
 [構成1]
 制御対象を制御するための制御装置(100)であって、
 シーケンス命令を含む第1ユーザプログラム(150)を所定周期毎に実行する第1プログラム実行部(130)と、
 所定のプログラミング言語で記述された第2ユーザプログラム(160)を逐次解釈して実行する第2プログラム実行部(134)と、
 複数のステートを有するステートマシーン(180)の遷移に応じて、前記第1ユーザプログラムとして規定された第1ユーザ定義処理(152)、および、前記第2ユーザプログラムとして規定された第2ユーザ定義処理(162)、の実行を管理する実行管理部(132)とを備え、
 前記実行管理部は、
  予め定められた1または複数のイベントの発生に応じて、前記ステートマシーンを遷移させ、
  前記ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定する、制御装置。
[Configuration 1]
A control device (100) for controlling a controlled object,
a first program execution unit (130) that executes a first user program (150) including sequence instructions at predetermined intervals;
a second program execution unit (134) that sequentially interprets and executes a second user program (160) written in a predetermined programming language;
A first user-defined process (152) defined as the first user program and a second user-defined process defined as the second user program according to the transition of a state machine (180) having a plurality of states. (162), an execution management unit (132) for managing the execution of
The execution management unit
transitioning the state machine in response to the occurrence of one or more predetermined events;
A control device that, when a transition occurs in the state machine, determines a user-defined process to be executed associated with the transition.
 [構成2]
 前記ステートマシーンに生じ得る遷移の各々に対応付けて、任意のユーザ定義処理が設定可能になっている(133)、構成1に記載の制御装置。
[Configuration 2]
2. The controller of arrangement 1, wherein arbitrary user-defined processing can be set (133) associated with each possible transition of the state machine.
 [構成3]
 前記ステートマシーンに生じ得る遷移の各々に対応付けられるユーザ定義処理は、ユーザインターフェイス画面(550)を介して設定される、構成2に記載の制御装置。
[Configuration 3]
3. The controller of arrangement 2, wherein a user-defined process associated with each possible transition of the state machine is set via a user interface screen (550).
 [構成4]
 前記実行管理部は、予め定められた実行形態に従ってユーザ定義処理を実行させる、構成1~3のいずれか1項に記載の制御装置。
[Configuration 4]
The control device according to any one of configurations 1 to 3, wherein the execution management unit executes user-defined processing according to a predetermined execution form.
 [構成5]
 前記実行形態は、対応するステートに遷移するときに一度だけ実行される第1実行形態と、対応するステートに存在する期間において実行され続ける第2実行形態と、対応するステートから別のステートに遷移するときに一度だけ実行される第3実行形態とのうち少なくとも1つを含む候補から選択される、構成4に記載の制御装置。
[Configuration 5]
The execution forms include a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that is continuously executed during the period in which the corresponding state exists, and a transition from the corresponding state to another state. 5. The controller of arrangement 4, selected from candidates including at least one of a third mode of execution and a third mode of execution that is executed only once when
 [構成6]
 前記実行管理部は、前記ステートマシーンを遷移させる条件が成立した場合であっても、対応するユーザ定義処理の実行完了を待って遷移させる、構成1~5のいずれか1項に記載の制御装置。
[Configuration 6]
The control device according to any one of configurations 1 to 5, wherein even when a condition for transitioning the state machine is satisfied, the execution management unit waits for the completion of execution of the corresponding user-defined process to make the transition. .
 [構成7]
 前記ステートマシーンは、前記制御対象に対する制御権の獲得および解放に応じて遷移するステート(191,192,193,194)を含む、構成1~6のいずれか1項に記載の制御装置。
[Configuration 7]
7. The control device according to any one of configurations 1 to 6, wherein the state machine includes states (191, 192, 193, 194) that transition according to acquisition and release of control right for the controlled object.
 [構成8]
 前記ステートマシーンは、前記制御対象の動作状態に対応するステートマシーン(182,183,184,185,186,187)に関連付けて規定される、構成1~7のいずれか1項に記載の制御装置。
[Configuration 8]
The control device according to any one of configurations 1 to 7, wherein the state machine is defined in association with state machines (182, 183, 184, 185, 186, 187) corresponding to operating states of the controlled object. .
 [構成9]
 制御対象を制御するための制御装置(100)で実行される制御方法であって、
 複数のステートを有するステートマシーンを管理するステップ(S120)と、
 前記ステートマシーンの遷移に応じて、シーケンス命令を含む第1ユーザプログラムとして規定された第1ユーザ定義処理、および、所定のプログラミング言語で記述された第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理するステップ(S106,S108,S112,S116,S124,S128,S132,S136)と、
 前記第1ユーザ定義処理を所定周期毎に実行するステップ(S114,S130,S138)と、
 前記第2ユーザ定義処理を逐次解釈して実行するステップ(S110,S126,S134)とを備え、
 前記ステートマシーンを管理するステップは、予め定められた1または複数のイベントの発生に応じて、前記ステートマシーンを遷移させるステップを含み、
 前記実行を管理するステップは、前記ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定するステップを含む、制御方法。
[Configuration 9]
A control method executed by a control device (100) for controlling a controlled object, comprising:
managing a state machine with multiple states (S120);
A first user-defined process defined as a first user program containing sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language according to the transition of the state machine. (S106, S108, S112, S116, S124, S128, S132, S136) for managing the execution of
a step of executing the first user-defined process at predetermined intervals (S114, S130, S138);
A step of sequentially interpreting and executing the second user-defined process (S110, S126, S134);
managing the state machine includes transitioning the state machine in response to the occurrence of one or more predetermined events;
A control method, wherein managing execution includes determining a user-defined process to be executed associated with a transition when the state machine transitions.
 [構成10]
 制御プログラム(111)であって、制御対象を制御するための制御装置(100)に、
 複数のステートを有するステートマシーンを管理するステップ(S120)と、
 前記ステートマシーンの遷移に応じて、シーケンス命令を含む第1ユーザプログラムとして規定された第1ユーザ定義処理、および、所定のプログラミング言語で記述された第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理するステップ(S106,S108,S112,S116,S124,S128,S132,S136)と、
 前記第1ユーザ定義処理を所定周期毎に実行するステップ(S114,S130,S138)と、
 前記第2ユーザ定義処理を逐次解釈して実行するステップ(S110,S126,S134)とを実行させ、
 前記ステートマシーンを管理するステップは、予め定められた1または複数のイベントの発生に応じて、前記ステートマシーンを遷移させるステップを含み、
 前記実行を管理するステップは、前記ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定するステップを含む、制御プログラム。
[Configuration 10]
A control program (111) for a control device (100) for controlling a controlled object,
managing a state machine with multiple states (S120);
A first user-defined process defined as a first user program containing sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language according to the transition of the state machine. (S106, S108, S112, S116, S124, S128, S132, S136) for managing the execution of
a step of executing the first user-defined process at predetermined intervals (S114, S130, S138);
causing a step (S110, S126, S134) of sequentially interpreting and executing the second user-defined process,
managing the state machine includes transitioning the state machine in response to the occurrence of one or more predetermined events;
A control program according to claim 1, wherein the step of managing execution includes, when a transition occurs in the state machine, determining a user-defined process to be executed associated with the transition.
 <I.利点>
 本実施の形態に係る制御システム1において、ステートマシーンを用いて制御装置100の状態を管理するとともに、ステートマシーンに何らかの遷移が生じると、当該遷移に対応付けられた任意のユーザ定義処理を実行できるので、プログラム間のインターロックなどの処理を実装する必要性を低減でき、これによって、プログラミングを容易化できる。
<I. Advantage>
In the control system 1 according to the present embodiment, a state machine is used to manage the state of the control device 100, and when some transition occurs in the state machine, arbitrary user-defined processing associated with the transition can be executed. Therefore, it is possible to reduce the need to implement processing such as interlocking between programs, thereby facilitating programming.
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiments disclosed this time should be considered illustrative in all respects and not restrictive. The scope of the present invention is indicated by the scope of the claims rather than the above description, and is intended to include all modifications within the scope and meaning equivalent to the scope of the claims.
 1 制御システム、10 フィールドネットワーク、20 上位ネットワーク、100 制御装置、102,502 プロセッサ、104,504 メインメモリ、106 上位ネットワークコントローラ、108 フィールドネットワークコントローラ、110,510 ストレージ、111 システムプログラム、112 メモリカードインターフェイス、114 メモリカード、116 ローカルバスコントローラ、118 プロセッサバス、120,518 USBコントローラ、122 ローカルバス、124 機能ユニット、130 IECプログラム実行部、132 実行管理部、133 ユーザ定義処理設定、134 アプリケーションプログラム実行部、136 インタプリタ、138 キャッシュ、140 コマンド生成部、142 データ管理部、144 データ領域、146 内部データ領域、148 共有領域、150 IECプログラム、152,162,176 ユーザ定義処理、160,177,178 アプリケーションプログラム、170 定周期実行タスク、171 入出力リフレッシュ処理、172 アプリケーション入力処理、173 遷移監視処理、174 IECプログラム実行処理、175 アプリケーション出力処理、180 ステートマシーン、181 制御権獲得済ステート、182 動作中ステート、183 減速停止中ステート、184 停止中ステート、185 無効ステート、186 エラー減速停止中ステート、187 ティーチングペンダント制御中ステート、191 制御権獲得ステート、192 制御権解放ステート、193 制御権獲得(TP)ステート、194 制御権解放(TP)ステート、195 異常解除ステート、200 ロボット、250 ロボットコントローラ、300 サーボモータ、350 サーボコントローラ、400 ティーチングペンダント、500 サポート装置、506 入力部、508 表示部、512 OS、514 開発プログラム、516 ネットワークコントローラ、520 光学ドライブ、522 記録媒体、524 バス、550 ユーザインターフェイス画面、560 プログラム実行設定テーブル、561 制御権獲得行、562 制御権解放行、563 制御権獲得(TP)行、564 制御権解放(TP)行、565 異常解除行、566 entry行、567 do行、568 exit行、571 ステート列、572 実行形態列、573 IECプログラム列、574 アプリケーションプログラム列、600 表示装置、700 サーバ装置、T1 制御周期。 1 control system, 10 field network, 20 upper network, 100 control device, 102, 502 processor, 104, 504 main memory, 106 upper network controller, 108 field network controller, 110, 510 storage, 111 system program, 112 memory card interface , 114 memory card, 116 local bus controller, 118 processor bus, 120, 518 USB controller, 122 local bus, 124 function unit, 130 IEC program execution unit, 132 execution management unit, 133 user-defined processing settings, 134 application program execution unit , 136 interpreter, 138 cache, 140 command generation unit, 142 data management unit, 144 data area, 146 internal data area, 148 shared area, 150 IEC program, 152, 162, 176 user-defined processing, 160, 177, 178 application program , 170 periodic execution task, 171 input/output refresh processing, 172 application input processing, 173 transition monitoring processing, 174 IEC program execution processing, 175 application output processing, 180 state machine, 181 control right acquired state, 182 running state, 183 Deceleration stop state, 184 Stop state, 185 Invalid state, 186 Error deceleration stop state, 187 Teaching pendant control state, 191 Control right acquisition state, 192 Control right release state, 193 Control right acquisition (TP) state, 194 Control right release (TP) state, 195 Abnormal release state, 200 Robot, 250 Robot controller, 300 Servo motor, 350 Servo controller, 400 Teaching pendant, 500 Support device, 506 Input section, 508 Display section, 512 OS, 514 Development Program, 516 network controller, 520 optical drive, 522 recording medium, 524 bus, 550 user interface screen, 560 program execution setting table, 561 control right acquisition line, 562 control right release line, 563 control right acquisition (TP) line, 564 Control right release (TP) line, 565 abnormal release line, 566 entry line, 567 do line, 568 e xit row, 571 state column, 572 execution mode column, 573 IEC program column, 574 application program column, 600 display device, 700 server device, T1 control cycle.

Claims (10)

  1.  制御対象を制御するための制御装置であって、
     シーケンス命令を含む第1ユーザプログラムを所定周期毎に実行する第1プログラム実行部と、
     所定のプログラミング言語で記述された第2ユーザプログラムを逐次解釈して実行する第2プログラム実行部と、
     複数のステートを有するステートマシーンの遷移に応じて、前記第1ユーザプログラムとして規定された第1ユーザ定義処理、および、前記第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理する実行管理部とを備え、
     前記実行管理部は、
      予め定められた1または複数のイベントの発生に応じて、前記ステートマシーンを遷移させ、
      前記ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定する、制御装置。
    A control device for controlling a controlled object,
    a first program execution unit that executes a first user program including sequence instructions at predetermined intervals;
    a second program execution unit that sequentially interprets and executes a second user program written in a predetermined programming language;
    managing the execution of a first user-defined process specified as the first user program and a second user-defined process specified as the second user program according to transitions of a state machine having a plurality of states; an execution management unit;
    The execution management unit
    transitioning the state machine in response to the occurrence of one or more predetermined events;
    A control device that, when a transition occurs in the state machine, determines a user-defined process to be executed associated with the transition.
  2.  前記ステートマシーンに生じ得る遷移の各々に対応付けて、任意のユーザ定義処理が設定可能になっている、請求項1に記載の制御装置。 The control device according to claim 1, wherein arbitrary user-defined processing can be set in association with each transition that can occur in the state machine.
  3.  前記ステートマシーンに生じ得る遷移の各々に対応付けられるユーザ定義処理は、ユーザインターフェイス画面を介して設定される、請求項2に記載の制御装置。 3. The control device according to claim 2, wherein user-defined processing associated with each transition that can occur in said state machine is set via a user interface screen.
  4.  前記実行管理部は、予め定められた実行形態に従ってユーザ定義処理を実行させる、請求項1~3のいずれか1項に記載の制御装置。 The control device according to any one of claims 1 to 3, wherein the execution management unit causes user-defined processing to be executed according to a predetermined execution form.
  5.  前記実行形態は、対応するステートに遷移するときに一度だけ実行される第1実行形態と、対応するステートに存在する期間において実行され続ける第2実行形態と、対応するステートから別のステートに遷移するときに一度だけ実行される第3実行形態とのうち少なくとも1つを含む候補から選択される、請求項4に記載の制御装置。 The execution forms include a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that is continuously executed during the period in which the corresponding state exists, and a transition from the corresponding state to another state. 5. The controller of claim 4, selected from candidates including at least one of a third mode of execution that is executed only once when
  6.  前記実行管理部は、前記ステートマシーンを遷移させる条件が成立した場合であっても、対応するユーザ定義処理の実行完了を待って遷移させる、請求項1~5のいずれか1項に記載の制御装置。 6. The control according to any one of claims 1 to 5, wherein, even when a condition for transitioning the state machine is satisfied, the execution management unit waits for completion of execution of a corresponding user-defined process before transitioning the state machine. Device.
  7.  前記ステートマシーンは、前記制御対象に対する制御権の獲得および解放に応じて遷移するステートを含む、請求項1~6のいずれか1項に記載の制御装置。 The control device according to any one of claims 1 to 6, wherein said state machine includes states transitioned according to acquisition and release of control right for said controlled object.
  8.  前記ステートマシーンは、前記制御対象の動作状態に対応するステートマシーンに関連付けて規定される、請求項1~7のいずれか1項に記載の制御装置。 The control device according to any one of claims 1 to 7, wherein the state machine is defined in association with a state machine corresponding to the operating state of the controlled object.
  9.  制御対象を制御するための制御装置で実行される制御方法であって、
     複数のステートを有するステートマシーンを管理するステップと、
     前記ステートマシーンの遷移に応じて、シーケンス命令を含む第1ユーザプログラムとして規定された第1ユーザ定義処理、および、所定のプログラミング言語で記述された第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理するステップと、
     前記第1ユーザ定義処理を所定周期毎に実行するステップと、
     前記第2ユーザ定義処理を逐次解釈して実行するステップとを備え、
     前記ステートマシーンを管理するステップは、予め定められた1または複数のイベントの発生に応じて、前記ステートマシーンを遷移させるステップを含み、
     前記実行を管理するステップは、前記ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定するステップを含む、制御方法。
    A control method executed by a control device for controlling a controlled object,
    managing a state machine having multiple states;
    A first user-defined process defined as a first user program containing sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language according to the transition of the state machine. a step of managing the execution of
    a step of executing the first user-defined process every predetermined period;
    sequentially interpreting and executing the second user-defined process;
    managing the state machine includes transitioning the state machine in response to the occurrence of one or more predetermined events;
    A control method, wherein managing execution includes determining a user-defined process to be executed associated with a transition when the state machine transitions.
  10.  制御プログラムであって、制御対象を制御するための制御装置に、
     複数のステートを有するステートマシーンを管理するステップと、
     前記ステートマシーンの遷移に応じて、シーケンス命令を含む第1ユーザプログラムとして規定された第1ユーザ定義処理、および、所定のプログラミング言語で記述された第2ユーザプログラムとして規定された第2ユーザ定義処理、の実行を管理するステップと、
     前記第1ユーザ定義処理を所定周期毎に実行するステップと、
     前記第2ユーザ定義処理を逐次解釈して実行するステップとを実行させ、
     前記ステートマシーンを管理するステップは、予め定められた1または複数のイベントの発生に応じて、前記ステートマシーンを遷移させるステップを含み、
     前記実行を管理するステップは、前記ステートマシーンに遷移が生じると、当該遷移に対応付けられた実行すべきユーザ定義処理を決定するステップを含む、制御プログラム。
    A control program, a control device for controlling a controlled object,
    managing a state machine having multiple states;
    A first user-defined process defined as a first user program containing sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language according to the transition of the state machine. a step of managing the execution of
    a step of executing the first user-defined process every predetermined period;
    a step of sequentially interpreting and executing the second user-defined process;
    managing the state machine includes transitioning the state machine in response to the occurrence of one or more predetermined events;
    A control program according to claim 1, wherein the step of managing execution includes, when a transition occurs in the state machine, determining a user-defined process to be executed associated with the transition.
PCT/JP2021/009183 2021-02-03 2021-03-09 Control device, control method, and control program WO2022168336A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2021-015577 2021-02-03
JP2021015577A JP2022118822A (en) 2021-02-03 2021-02-03 Control device, control method, and control program

Publications (1)

Publication Number Publication Date
WO2022168336A1 true WO2022168336A1 (en) 2022-08-11

Family

ID=82741017

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/009183 WO2022168336A1 (en) 2021-02-03 2021-03-09 Control device, control method, and control program

Country Status (2)

Country Link
JP (1) JP2022118822A (en)
WO (1) WO2022168336A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003177806A (en) * 2001-12-12 2003-06-27 Mitsubishi Electric Corp Personal computer nc, programmable controller with personal computer and software developing tool for programmable controller
JP2004259010A (en) * 2003-02-26 2004-09-16 Canon Inc Multi-sequence type sequence control device
JP2005321954A (en) * 2004-05-07 2005-11-17 Sony Corp Robot device, information processing system, information processing method, and computer program
WO2017098564A1 (en) * 2015-12-07 2017-06-15 三菱電機株式会社 Signal processing device
US20180341241A1 (en) * 2017-05-23 2018-11-29 Siemens Corporation Cloud-Based Integration Rule Engine to Enable Plug and Play Device for Building Automation Systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003177806A (en) * 2001-12-12 2003-06-27 Mitsubishi Electric Corp Personal computer nc, programmable controller with personal computer and software developing tool for programmable controller
JP2004259010A (en) * 2003-02-26 2004-09-16 Canon Inc Multi-sequence type sequence control device
JP2005321954A (en) * 2004-05-07 2005-11-17 Sony Corp Robot device, information processing system, information processing method, and computer program
WO2017098564A1 (en) * 2015-12-07 2017-06-15 三菱電機株式会社 Signal processing device
US20180341241A1 (en) * 2017-05-23 2018-11-29 Siemens Corporation Cloud-Based Integration Rule Engine to Enable Plug and Play Device for Building Automation Systems

Also Published As

Publication number Publication date
JP2022118822A (en) 2022-08-16

Similar Documents

Publication Publication Date Title
US10761515B2 (en) Control system for controlling control object and control device for linking control applications in control system
CN109507980B (en) Control device and control method
US10908577B2 (en) Control device
WO2012124143A1 (en) Computation unit, assistance device, output control method, display control method, and program
US20190079499A1 (en) Control device and control method
JP6299064B2 (en) Control device, control method, and program
JP2019061467A (en) Support system and support program
US11855907B2 (en) Robot control system and control method
WO2022168336A1 (en) Control device, control method, and control program
CN111176225B (en) Method and apparatus for proxy execution and calculation using industrial controller
JP6881174B2 (en) Control device and control method
WO2019171845A1 (en) Control device and control system
WO2020026622A1 (en) Control device
WO2012124145A1 (en) Computation unit, assistance unit, assistance program, recording medium storing assistance program, and operation method in assistance device
WO2022249713A1 (en) Control system, system program, and debugging method
JP7375632B2 (en) Control system and support equipment
WO2022162958A1 (en) Control device, program execution method, and program
WO2022162959A1 (en) Control system, robot controller, and control method
WO2019216191A1 (en) Control system, support device, and support program
JP2023151731A (en) Control system, control method, and control program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21924726

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21924726

Country of ref document: EP

Kind code of ref document: A1