WO2019082627A1 - 制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体 - Google Patents

制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体

Info

Publication number
WO2019082627A1
WO2019082627A1 PCT/JP2018/037462 JP2018037462W WO2019082627A1 WO 2019082627 A1 WO2019082627 A1 WO 2019082627A1 JP 2018037462 W JP2018037462 W JP 2018037462W WO 2019082627 A1 WO2019082627 A1 WO 2019082627A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
variables
value
variable
unit
Prior art date
Application number
PCT/JP2018/037462
Other languages
English (en)
French (fr)
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 オムロン株式会社
Priority to US16/641,796 priority Critical patent/US11287793B2/en
Priority to CN201880056330.9A priority patent/CN111095138B/zh
Priority to EP18871093.3A priority patent/EP3702852B1/en
Publication of WO2019082627A1 publication Critical patent/WO2019082627A1/ja

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/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/056Programming the PLC
    • 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
    • G05B19/054Input/output
    • 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
    • G05B19/0421Multiprocessor system
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/12Plc mp multi processor system
    • G05B2219/1204Multiprocessing, several plc's, distributed logic control
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/12Plc mp multi processor system
    • G05B2219/1211Exchange control, I-O data to other plc, using separate synchronizing
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/12Plc mp multi processor system
    • G05B2219/1214Real-time communication between plc, Ethernet for configuration, monitor
    • 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 used to control the operation of machines and equipment.
  • an industrial control device such as a programmable controller (Programmable Logic Controller, hereinafter abbreviated as "PLC") is computerized (that is, utilization of information acquired / generated by the industrial control device in an external device, etc.) and high performance
  • PLC Programmable Logic Controller
  • Patent Document 1 As an attempt to computerize PLC, PLC as a server apparatus and a client apparatus according to OPCUA (OPC Unified Architecture), which is a protocol for communication between apparatuses for industrial use. And a technique to connect with each other is disclosed.
  • OPCUA OPC Unified Architecture
  • Patent Document 2 as an attempt to improve the performance of PLC, a plurality of tasks are executed in parallel by time division, and each task is executed in a cycle according to each task, that is, multitasking.
  • a PLC for performing the process is disclosed.
  • Japanese Patent Publication Japanese Patent Application Laid-Open No. 2017-84143 (May 18, 2017)
  • Japanese patent publication Japanese Patent Laid-open Publication 2009-181443 (March 13, 2009 published)
  • an updated value of each of a plurality of variables is collectively inquired to an industrial control device that periodically executes a plurality of tasks in parallel during task execution.
  • an industrial control device that periodically executes a plurality of tasks in parallel is configured to execute each of the plurality of variables with respect to a plurality of variables, each of which is updated in at least one task.
  • One embodiment of the present invention is an industrial control device that executes a plurality of tasks in parallel periodically and when the updated values of each of a plurality of variables are collectively queried during task execution,
  • the object is to achieve synchronization between updated values of each of a plurality of variables to which the controller responds.
  • a control device is a control device that controls a control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each task.
  • a receiving unit for externally receiving a request for collectively inquiring each value during execution of the task for a plurality of variables, each value being updated in at least one of the plurality of tasks, and the receiving unit
  • the point in time when the reading of the value of each of the plurality of variables is completed is all from the start point to the end point of one cycle of the task with the shortest cycle interval among the plurality of tasks.
  • a reading unit that reads the value updated in at least one of the plurality of tasks of each of the plurality of variables, and the reading unit reads And an output section for outputting a value of each of the plurality of variables outside.
  • a control method is a control method of a control device that controls a control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each task.
  • the point in time when the reading of the value of each of the plurality of variables is completed is the start point of one cycle of the task with the shortest interval of the cycle among the plurality of tasks. Reading out the updated value of at least one of the plurality of tasks of each of the plurality of variables, so as to be included between Comprising the steps, and outputting the respective values of said plurality of variables read in the reading step to the outside.
  • an industrial control device that periodically executes a plurality of tasks in parallel, when updated values of each of a plurality of variables are collectively queried during task execution, An effect is achieved that synchronization can be realized between the updated values of each of the plurality of variables to which the industrial control device responds.
  • FIG. 2 is a block diagram showing an essential configuration and the like of a CPU unit according to Embodiment 1 of the present invention. It is a figure which shows the whole outline
  • Embodiment 1 an embodiment according to one aspect of the present invention (hereinafter, also referred to as “the present embodiment”) will be described based on the drawings, and first, the first embodiment of the present invention will be described based on FIGS. Will be described in detail. In the drawings, the same or corresponding portions are denoted by the same reference characters and description thereof will not be repeated.
  • a PLC Programmable Logic Controller
  • control device controller
  • FIG. 2 is a diagram showing an overview of the management system 1.
  • the management system 1 includes the following two systems. That is, the control system 2 in which input devices and output devices in the production facility are controlled by one or more PLCs 10, and various information acquired and generated in the control system 2 are stored, analyzed, etc. And an information system 3 used for the operation of 2 and the like.
  • the PLC 10 is connected to both the control system 2 and the information system 3, and realizes access from the information system 3 to the control system 2 (in particular, data (variables) used in the control system 2).
  • the PLC 10 and the client device 80 are mutually connected using, for example, the OPCUA protocol.
  • the client device 80 of the information system 3 collectively collects, for the variables used when the PLC 10 executes the control process, “updated values of each of the plurality of variables for which synchronization is secured” during operation of the PLC 10 , Contact PLC10.
  • Contact the PLC 10 collectively with the updated values of.
  • the client device 80 updates the updated values of the variables A to C whose update time points are approximately simultaneous, Inquire collectively to PLC10.
  • the updated value of each of the plurality of variables whose values are updated in the task is the end point of one cycle of the task (or By reading out all at the start point), synchronization between the read values can be secured.
  • the task Tp may be executed one or more times.
  • the PLC 10 reads the updated values of each of the plurality of variables so as to prevent occurrence of such a situation and to ensure synchronization between the updated values of each of the plurality of read variables, The read value is output to the client device 80.
  • the PLC 10 makes all of the points at which the reading of the values of the plurality of variables is completed be included in the cycle of the task having the smallest cycle interval among the plurality of tasks. Read the updated value. For example, in the task Tp, the PLC 10 performs the task Tp from the completion of reading of updated values of the variables A and B updated in the task Tp to the completion of reading of the updated value of the variable C in the task Ts. And Ts are read out so that each is not executed even once. Then, the PLC 10 outputs the read “updated value of each of the plurality of variables” to the client device 80.
  • the client device 80 can collectively acquire, from the PLC 10, the updated values of each of the plurality of “synchronized secured (that is, nearly simultaneous update points)” variables. That is, in the management system 1, the information system 3 is a value after updating of each of the plurality of variables used in the control system 2, and the values after updating in which the synchronization between the values is secured are collectively Can be grasped.
  • the fact that "synchronization" is secured among the plurality of read values means, for example, that the reading of the updated value P1 of the variable P is completed and then the reading of the updated value Q1 of the variable Q is completed. It means that the value of at least one of the variables P and Q has not been updated. That is, “The value of variable P is not updated to P2 or the value of variable Q is updated to Q2 after the completion of the reading of P1 until the completion of the reading of Q1. “The synchronization between each updated value of the read out variables P and Q is ensured”.
  • the PLC 10 is, for example, an updated value of each of a plurality of variables when adopting “single-core” and performing “parallel execution” in which other tasks are not executed during execution of a certain task for multitasking, The updated values with synchronization between each value are read out at once. Also, for example, when the PLC 10 adopts a multi-core and performs “parallel execution” to execute another task while executing a certain task for multitasking, the value is an updated value of each of the plurality of variables, , The updated values whose synchronization is secured between the values are collectively read.
  • PLC 10 is the updated value of each of the plurality of variables, and the synchronization between each value, even when performing parallel execution or when performing parallel execution for a multitask. Read out the updated values that were secured at once.
  • “to execute a plurality of tasks repeatedly and in parallel in a cycle for each task” includes both the case of performing parallel execution and the case of performing parallel execution.
  • Control system 2 includes PLC 10, servo drivers 33 and 34 and remote IO terminal 35 connected to PLC 10 via field network 20, and devices 31 and 32 which are field devices. Further, the support device 60 is connected to the PLC 10 via the connection cable 50.
  • PLC 10 that control input devices and output devices in a production facility and devices whose operations are controlled by the PLC 10 are connected to a network of control systems such as a field network 20. .
  • the PLC 10 and the device cyclically communicate with each other via the network of the control system to transmit and receive IN data and OUT data (hereinafter referred to as “IO data”) to control a production facility.
  • IO data IN data and OUT data
  • the PLC 10 is a control device that controls controlled objects such as machines and facilities in the control system 2, and is a master device that manages data transmission in the control system 2 via the field network 20.
  • the PLC 10 includes a CPU unit 100 that executes main arithmetic processing, a power supply unit 101, one or more IO units (IO units 102 to 104 in the example of FIG. 2), and a special unit 105.
  • the CPU unit 100, each of the IO units 102 to 104, and the special unit 105 are configured to be able to exchange data with each other via the PLC system bus 106.
  • the CPU unit 100 executes various processes related to the state of the control target, etc. For example, “the transmission of output data, the reception of input data, and the execution of a control program that generates output data using input data, Control object by repeating the process. The details of the CPU unit 100 will be described later with reference to FIG.
  • the power supply unit 101 supplies power of an appropriate voltage to the CPU unit 100, the IO units 102 to 104, and the special unit 105.
  • Each of the IO units 102 to 104 is a unit related to general input / output processing, and controls input / output of data such as on / off (that is, binarized data). Specifically, each of the IO units 102 to 104 is in a state (on) in which the device 31 which is an input device such as a sensor detects some kind of object (on), and a state (in which no object is detected) Collect information on whether it is off. In addition, each of the IO units 102 to 104 is either a command to activate (on) or a command to deactivate (off) to the device 32, which is an output device such as a relay or an actuator. Output
  • the special unit 105 has functions that are not supported by the IO units 102 to 104, such as input / output of data (for example, analog data) different from data processed by the IO units 102 to 104, temperature control, and communication by a specific communication method. .
  • the devices 31 and 32 are each an input / output device controlled by the PLC 10.
  • the device 31 which is an input device is, for example, a “detector” such as a temperature sensor or an optical sensor, a “switch (pushbutton switch, limit switch, pressure switch or the like)” or the like.
  • the device 32, which is an output device is, for example, an "actuator”, a “relay”, an "electromagnetic valve”, an "indicator”, a “indicator” or the like.
  • Field network 20 transmits various data exchanged between CPU unit 100 and field devices (servo drivers 33 and 34 and remote IO terminal 35).
  • various industrial Ethernets registered trademark
  • industrial Ethernet registered trademark
  • EtherCAT registered trademark
  • Profinet IRT a registered trademark
  • MECHATROLINK registered trademark
  • MECHATROLINK registered trademark
  • SERCOS registered trademark
  • CIP Motion CIP Motion
  • field networks other than Industrial Ethernet may be used.
  • DeviceNet a registered trademark
  • CompoNet / IP registered trademark
  • the control system 2 exemplarily shows a configuration in the case of adopting EtherCAT (registered trademark) which is industrial Ethernet (registered trademark) as the field network 20.
  • the PLC 10 allows the CPU unit 100 to directly control an object within a range that can be covered by such built-in functions by causing the CPU unit 100 to have the respective functions of the IO units 102 to 104 and the functions of the servo drivers 33 and 34. You may control.
  • Each of the servo drivers 33 and 34 is connected to the CPU unit 100 via the field network 20 and drives each of the servomotors 41 and 42 in accordance with a command value from the CPU unit 100.
  • each of the servo drivers 33 and 34 receives command values such as a position command value, a speed command value, and a torque command value repeatedly (that is, periodically) from the PLC 10 at fixed time intervals. Further, each of the servo drivers 33 and 34 is various detection values (actually measured values) related to the operation of each of the servomotors 41 and 42 from various detectors (devices 31) connected to each of the servomotors 41 and 42. To get For example, measured values related to the operation of each of the servomotors 41 and 42, such as position, speed, and torque, from detectors such as position sensors (rotary encoders) and torque sensors connected to the axes of the servomotors 41 and 42, respectively. To get The actual measurement value relating to the speed may be calculated from the difference between the current position and the previous position.
  • each of the servo drivers 33 and 34 sets a command value from the CPU unit 100 as a target value, and performs feedback control using the actual measurement value as a feedback value. That is, each of the servo drivers 33 and 34 adjusts the current for driving each of the servomotors 41 and 42 so that the actual measurement value approaches the target value.
  • Each of the servo drivers 33 and 34 may be referred to as a servo motor amplifier.
  • FIG. 2 shows an example of a system in which each of servomotors 41 and 42 and each of servodrivers 33 and 34 are combined
  • another system for example, a system in which a pulse motor and a pulse motor driver are combined is shown. It can also be adopted.
  • the remote IO terminal 35 basically performs processing relating to general input / output processing in the same manner as the IO units 102 to 104. More specifically, the remote IO terminal 35 includes a communication coupler 36 for performing processing related to data transmission in the field network 20, and one or more IO units (IO units 37 and 38 in the example of FIG. 2). And. Communication coupler 36 and each of IO units 37 and 38 are configured to communicate data with each other via remote IO terminal bus 39.
  • the support device 60 is an information processing device connectable to the PLC 10.
  • the support device 60 is connected to the PLC 10 via a connection cable 50, which is, for example, a USB (Universal Serial Bus) cable, and performs processing such as setting, programming, monitoring, debugging and the like of various parameters with the PLC 10.
  • a connection cable 50 which is, for example, a USB (Universal Serial Bus) cable, and performs processing such as setting, programming, monitoring, debugging and the like of various parameters with the PLC 10.
  • the various programs executed by the support device 60 may be stored in the CD-ROM 61 and distributed.
  • the program stored in the CD-ROM 61 may be read by a CD-ROM (Compact Disk-Read Only Memory) drive of the support device 60 and stored in a hard disk (HDD) of the support device 60 or the like.
  • the support device 60 may download a program to be executed by the support device 60 from a host computer or the like on the upper level through a network.
  • the support device 60 is, for example, a personal computer, and executes creation / editing processing of a user program executed in the PLC 10. Further, the support device 60 executes a process of downloading a user program from the PLC 10 and executes a process of uploading the user program to the PLC 10.
  • the user can use the support device 60 to set a task that is an execution unit of a program in the PLC 10 (in particular, the CPU unit 100).
  • the PLC 10 (in particular, the control unit 130 of the CPU unit 100) is configured to control a control target by executing a task, and the task includes execution of a user program or the like for controlling the control target. It is done.
  • the user program is one of control programs for controlling the control target device.
  • the user uses the support device 60 to perform various settings related to the task execution cycle and execution timing, the program executed by the task, the refresh of input / output executed by the task, variables shared among tasks (global variables etc.) It can be defined.
  • the support device 60 notifies (uploads) the above-described various settings defined by the user to the PLC 10.
  • the information system 3 includes a PLC 10 and a client device 80.
  • the PLC 10 and the client device 80 are connected by an arbitrary communication cable 70, and may be communicably connected by, for example, EtherIP (registered trademark).
  • EtherIP registered trademark
  • the PLC 10 and the client device 80 can transmit and receive data to and from each other via the communication cable 70.
  • data exchange between the two is performed in accordance with OPCUA (OPC Unified Architecture), which is a communication protocol used for data exchange for industry.
  • OPCUA is a manufacturer and platform independent, secure, reliable, industrial-to-instrument communication protocol.
  • OPCUA is an architecture that generalizes and extends the conventional Object Linking and Embedding for Process Control (OPC).
  • the PLC 10 supports the OPCA in the information system 3 and has an OPCUA server function (connection function with an OPCUA client). Specifically, the PLC 10 makes a connection with the client apparatus 80 as an OPCUA client based on the OPCUA standard, and responds to the service request from the client apparatus 80 (for example, a data read request) by executing the service. .
  • the client device 80 supports the OPCUA in the management system 1 (information system 3), and issues a service request (for example, a data read request) to the PLC 10 as the OPCUA server.
  • the client device 80 may have SCADA (Supervisory Control And Data Acquisition) software installed.
  • the client device 80 may also be a device for realizing a MES (Manufacturing Execution System).
  • the PLC 10 (in particular, the CPU unit 100) supports OPCUA communication that simultaneously realizes the versatility of the connection method and the security risk handling. Therefore, the PLC 10 can output a secure response to a request for collection of manufacturing progress information from the client device 80 as a higher-order system compatible with OPCUA, such as SCADA or MES. Also, the PLC 10 can securely receive the manufacturing instruction and the like from the client device 80.
  • the client device 80 which is an OPCUA client, is connected to the PLC 10 (in particular, the CPU unit 100) as an OPCUA server via the communication cable 70, and reads and writes variables in the CPU unit 100 using OPCUA communication. Can.
  • the client device 80 is connected, for example, in accordance with the OPCUA standard, with a request “inquires collectively the values of a plurality of variables (for example, variables A to C) during execution of a task by the PLC 10”. Output to the PLC 10 by the method.
  • the PLC 10 receives the above request, the values of the plurality of variables (for example, variables A to C) specified in the request are synchronized between the values read out during the execution of the control process. Read out as it will.
  • the PLC 10 collectively outputs the read values of each of the plurality of variables to the client device 80 by, for example, a connection method conforming to the OPCA standard.
  • the client device 80 collectively acquires the values of the plurality of variables used by the PLC 10 in the control process, in particular, the values of the plurality of variables after the values are updated by the execution of the control process. be able to.
  • FIG. 3 is a diagram showing an example of a hardware configuration of the CPU unit 100 according to the present embodiment.
  • the CPU unit 100 includes a processor 151, a chipset 152, a non-volatile memory 153, a main memory 154, a clock 155, an upper communication controller 156, a PLC system bus controller 157, a field bus controller 158, and a USB connector. 161, a host communication connector 162, a PLC system bus connector 163, a memory card interface 164, and a field bus connector 165.
  • the chipset 152 and other components are respectively coupled via various buses.
  • the processor 151 and the chipset 152 are typically configured according to a general-purpose computer architecture. That is, the processor 151 interprets and executes an instruction code sequentially supplied from the chipset 152 in accordance with the internal clock.
  • the chipset 152 exchanges internal data with the various connected components, and generates an instruction code necessary for the processor 151. Further, the chipset 152 has a function of caching data obtained as a result of execution of arithmetic processing in the processor 151.
  • the CPU unit 100 includes a main memory 154 and a non-volatile memory 153 as storage means.
  • the main memory 154 is a volatile storage area (RAM), and holds various programs to be executed by the processor 151 after the CPU unit 100 is powered on.
  • the main memory 154 is also used as a working memory when the processor 151 executes various programs.
  • a main memory 154 for example, a dynamic random access memory (DRAM), a static random access memory (SRAM), or the like can be used.
  • DRAM dynamic random access memory
  • SRAM static random access memory
  • the non-volatile memory 153 holds data such as system programs such as IO (input / output) control, user programs, motion calculation programs, various applications, and system setting parameters in a non-volatile manner. These programs and data are copied to the main memory 154 so that the processor 151 can access them as needed.
  • semiconductor memory such as flash memory can be used.
  • a magnetic recording medium such as a hard disk drive, an optical recording medium such as a digital versatile disk random access memory (DVD-RAM), or the like can be used.
  • the clock 155 generates a system clock of a predetermined cycle and provides it to the processor 151, specifically, generates an interrupt signal every predetermined time interval (cycle) to provide the processor 151.
  • Clock 155 is typically configured to generate an interrupt signal at a plurality of different time intervals, depending on the hardware specification. However, the clock 155 can also be set to generate an interrupt signal at an arbitrary time interval by an operating system (OS), a basic input output system (BIOS) or the like. Using an interrupt signal generated by the clock 155, a control operation for each execution cycle as described later is realized.
  • OS operating system
  • BIOS basic input output system
  • the CPU unit 100 has an upper level communication controller 156, a PLC system bus controller 157, and a field bus controller 158 as communication means.
  • Upper communication controller 156, PLC system bus controller 157, and field bus controller 158 each include a buffer memory (transmission / reception buffer memory) (not shown), a communication control circuit, and a DMA (Dynamic Memory Access) control circuit. It is.
  • These communication means transmit output data to units other than the CPU unit 100 and devices other than the PLC 10, and receive input data from units other than the CPU unit 100 and devices other than the PLC 10. Furthermore, these communication means execute transmission and reception of data with the main memory 154.
  • the DMA control circuit transfers output data from main memory 154 to each buffer memory.
  • the DMA control circuit also transfers input data from each buffer memory to the main memory 154.
  • the buffer memory implements the following two functions. That is, the buffer memory implements a function as a transmission buffer of data (output data) output to devices other than the PLC 10 and units other than the CPU unit 100. Further, the buffer memory realizes a function as a reception buffer of data (input data) input from a device other than the PLC 10 and a unit other than the CPU unit 100.
  • the upper communication controller 156 is connected to the communication cable 70 via the upper communication connector 162, and performs connection based on, for example, the client apparatus 80 as an OPCUA client based on the OPCUA standard. Specifically, the upper communication controller 156 receives a service request (for example, a data read request) from the client device 80, and transmits the execution result of the service to the client device 80 (performs a response to the client device 80). .
  • a service request for example, a data read request
  • the PLC system bus controller 157 is connected to the PLC system bus 106 via the PLC system bus connector 163, and controls exchange of data via the PLC system bus 106.
  • the PLC system bus controller 157 provides, for example, physical layer and data link layer functions in the PLC system bus 106. That is, the PLC system bus controller 157 controls transmission and reception between the CPU unit 100 and units other than the CPU unit 100 connected to the PLC system bus 106.
  • the PLC system bus controller 157 transmits data (output data) stored in its buffer memory to each of the IO units 102 to 104 and the special unit 105 via the PLC system bus 106. Further, PLC system bus controller 157 receives data (input data) input from each of IO units 102 to 104 and special unit 105 via PLC system bus 106, and stores the data in its own buffer memory.
  • the field bus controller 158 is connected to the field network 20 via the field bus connector 165 and controls data exchange via the field network 20.
  • the field bus controller 158 provides, for example, the functions of the physical layer and the data link layer in the field network 20. That is, the fieldbus controller 158 controls transmission of output data and reception of input data in accordance with the standard of the field network 20 used. Specifically, Fieldbus controller 158 transmits output data of its buffer memory to / from a field device connected to field network 20, and receives input data and stores it in its buffer memory. Do.
  • the USB connector 161 is an interface for connecting the support device 60 and the CPU unit 100, and the connection cable 50 is connected. For example, an executable program or the like transferred from the support device 60 is taken into the CPU unit 100 via the connection cable 50.
  • the memory card interface 164 connects the removable memory card 90 to the CPU unit 100 and the processor 151.
  • the PLC 10 (control device) is a control device that controls a control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each task, and each value is at least one of the plurality of tasks.
  • the OPCUA input unit 111 (reception unit) that receives a request from the outside (for example, the client device 80) to inquire collectively for each value during execution of the task for a plurality of variables updated in
  • the point in time when the reading of the value of each of the plurality of variables is completed is all one of the plurality of tasks (eg, task Tp) of the task with the shortest interval of the period
  • OPCUA output unit 113 for outputting the respective values of said plurality of variables are read section 112 read out to the outside (output section), and Te.
  • the PLC 10 controls the control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each of the tasks. Further, when the PLC 10 receives the request, the point in time when the reading of the value of each of the plurality of variables is completed is the start point of one cycle of the task with the shortest cycle interval among the plurality of tasks. The value updated in at least one of the plurality of tasks of each of the plurality of variables is read out so as to be included from the point of time to the point of termination. And PLC10 outputs the value of each of the read said several variables outside.
  • PLC 10 can execute a plurality of tasks in parallel periodically, and when a request for collectively inquiring updated values of each of a plurality of variables is received from the outside during task execution, The updated value of each of the variables is effective to be able to respond to the synchronized value.
  • the reading completion time point of the updated values of each of the plurality of variables spans two or more “periods of the task with the shortest period interval” (hereinafter referred to as “basic period”).
  • basic period the shortest period interval
  • synchronization is not ensured among the read values. That is, when the time interval between the completion of reading of the updated values of each of the plurality of variables is equal to or greater than the interval of the basic cycle, synchronization is not ensured among the plurality of read values.
  • the time interval between the reading completion time of the updated value of variable A and the reading completion time of the updated value of variable C is equal to or longer than the interval of the basic cycle, 1 in the time interval
  • the task Tp will be executed more than once. Therefore, the user can change the value of the variable C after the task Tp for updating the value of the variable A is executed one or more times after (1) the value of the variable A and (2) “the value of the variable A is read. The value of "and" will be obtained. Therefore, the synchronization between the value of the read variable A and the value of the variable C is not secured, and the user grasps the relationship between the synchronized values of each of the plurality of variables. Can not do it.
  • the user can not grasp the updated values of each of the variable A and the variable C which are updated substantially simultaneously in each of the tasks Tp and Ts which are periodically executed in parallel.
  • the user acquires (1) the value of variable A and (2) “The value of variable A is read, and then task Tp for updating the value of variable A is executed one or more times. And the value of the variable C.
  • all the time points when the PLC 10 completes reading of the values of the plurality of variables are all included in one cycle of the task with the smallest interval of the cycle among the plurality of tasks. Reading values updated in at least one of the plurality of tasks of each of the plurality of variables, and outputting the value of each of the plurality of read variables to the outside. That is, the PLC 10 updates each of the plurality of variables after updating so that the time interval between reading completion values of the updated values of each of the plurality of variables is smaller than the time interval of the basic cycle. The value is read, and the value of each of the plurality of read variables is output to the outside.
  • the PLC 10 has a time interval between the reading completion time of the updated value of the variable A and the reading completion time of the updated value of the variable C in the basic cycle.
  • the updated values of each of the variable A and the variable C are read out so as to be smaller than the time interval.
  • the PLC 10 performs the variable A so that neither the task Tp nor the task Ts is executed from when the PLC 10 completes reading the updated value of the variable A to when completing reading the updated value of the variable C. And the updated value of each of C.
  • the PLC 10 allows the user to grasp the updated values of the plurality of variables updated substantially simultaneously in each of the plurality of tasks executed in parallel, that is, the synchronization is secured.
  • the updated values of each of the plurality of variables can be grasped.
  • synchronization between the updated values of each of the plurality of variables to which the PLC 10 responds is realized. It is done.
  • the PLC 10 allows the user to update the value of the variable A updated in the task Tp and the value of the variable C updated in the task Ts substantially simultaneously with the time when the variable A is updated.
  • the updated value can be grasped. That is, the PLC 10 allows the user to grasp “the synchronized value is maintained, the updated value” for each of the variable A and the variable C.
  • the reading unit 112 of the PLC 10 subtracts the expected reading period predicted as the time required to read all the values of the plurality of variables. Start reading out the value of each of the plurality of variables.
  • the PLC 10 extends from the time when the cycles of each of the plurality of tasks are aligned to the time when an expected reading period predicted as a time required to read all the values of the plurality of variables is subtracted. Start reading out the value of each of the plurality of variables.
  • the PLC 10 uses information on the point in time when the cycles of each of the plurality of tasks are aligned, and information on the predicted reading period predicted as the period required to read out all the values of the plurality of variables. And reads the updated value of each of the plurality of variables. In other words, in order to read out the updated value of each of the plurality of variables, the PLC 10 “in which one of the plurality of tasks is updated the value of each of the plurality of variables” There is no need to grasp.
  • the PLC 10 executes the plurality of variables by a process that is easy to realize as compared to the case where “the value of each of the plurality of variables is updated in which of the plurality of tasks”. The effect of being able to read out the value after each update of.
  • the PLC 10 has an OPCUA server function, and the OPCUA input unit 111 receives the request from the client device 80 (OPCUA client device) in a connection method conforming to the OPCA standard, and the OPCUA output unit 113 transmits the request to the client device 80.
  • the values of each of the plurality of variables are output in a connection scheme conforming to the OPCUA standard.
  • the PLC 10 has an OPCUA server function, receives the request from the client device 80 by the connection method conforming to the OPCUA standard, and transmits the respective values of the plurality of variables to the client device 80 according to the OPCUA standard Output by the connection method in accordance with.
  • the PLC 10 receives the request in a connection scheme conforming to the OPCUA standard, which is a safe and reliable industrial-to-equipment communication protocol independent of the manufacturer and the platform, and the value of each of the plurality of variables is The effect of being able to output by the connection method conforming to the OPCA standard is exhibited.
  • the plurality of tasks include a reference task (for example, task Tp) and tasks other than the reference task (for example, task Ts), and the cycles of the tasks other than the reference task are the items of the reference It may be set to an integral multiple of the task cycle.
  • the plurality of tasks include a reference task and tasks other than the reference task, and the cycles of tasks other than the reference task are integers of the cycles of the reference task. It is set to double.
  • the PLC 10 can easily synchronize the plurality of tasks, that is, it is possible to easily align the cycles of the plurality of tasks.
  • FIG. 1 is a block diagram showing the main configuration of a CPU unit 100 according to a first embodiment of the present invention.
  • the CPU unit 100 includes an OPCUA server unit 110, a storage unit 120, and a control unit 130 as functional blocks.
  • the CPU unit 100 is an execution subject of control processing for controlling a control target device.
  • Control unit 130 executes tasks including programs, and in particular, executes a plurality of tasks (for example, tasks Tp and Ts) in parallel, and executes each of the plurality of tasks in a cycle corresponding to each task.
  • the storage unit 120 stores variables that can be referenced and updated in the program.
  • the OPCUA server unit 110 communicates with the client device 80, such as collecting variables stored in the variable table 122 of the storage unit 120 when a task including a program is executed by the control unit 130. Execute the processing requested from
  • the CPU unit 100 may have the omitted configuration.
  • the processor 151 CPU, central processing unit illustrated in FIG. 3, etc. may be a read only memory (ROM) or a non-volatile random access memory (NVRAM).
  • ROM read only memory
  • NVRAM non-volatile random access memory
  • Etc. by reading the program stored in the non-volatile memory 153 (the storage unit 120) realized by the second embodiment to the main memory 154 realized by the RAM or the like and executing the program.
  • each functional block in the CPU unit 100 will be described.
  • the OPCUA server unit 110 realizes communication between the information system 3 (in particular, the client device 80) and the control system 2 (in particular, the PLC 10), and realizes, for example, an OPCUA server function that operates the PLC 10 as an "OPCUA server" Do. Specifically, the OPCUA server unit 110 receives the OPCUA service request from the client device 80, executes the OPCUA service processing according to the received service request, and sends a response indicating the execution result to the client device 80 of the request source. Output.
  • a service (process) of the OPCUA that requests execution from the client device 80 to the PLC 10 is, for example, a process called “Subscription”.
  • “Subscription” refers to “data related to control processing executed by the PLC 10 (in particular, the control unit 130) (in particular, values of variables used in the control processing, specifically, variables of which values are updated in the control processing Value).
  • the process of “update the value of the variable” may be referred to as “write”, and the process of “read the value of the variable” may be referred to as “read”.
  • the “Subscription” that the client device 80 requests the PLC 10 to execute may be, for example, “read out (that is, Read) the values of each of a plurality of variables collectively”.
  • the “separately reading out the values of the variables A to C” Subscription, which the client device 80 requests the PLC 10 to execute, may be abbreviated as “SubX”.
  • the OPCUA server unit 110 illustrated in FIG. 1 includes an OPCUA input unit 111, a reading unit 112, an OPCUA output unit 113, a reading period calculation unit 114, and a reading time point determination unit 115 as functional blocks.
  • the OPCUA input unit 111 of the OPCUA server unit 110 is an example of the “reception unit” of the present invention
  • the reading unit 112 is an example of the “reading unit” of the present invention
  • the OPCUA output unit 113 is This is an example of the “output unit”.
  • the OPCUA input unit 111 and the OPCUA output unit 113 are functional blocks that connect and communicate with the client apparatus 80 having the OPCUA client function based on the OPCA standard.
  • the OPCUA input unit 111 receives an execution request of a predetermined process from the client device 80 via the communication cable 70, and instructs the reading unit 112 to execute a predetermined process corresponding to the received execution request.
  • the OPCUA input unit 111 receives an OPCUA service request (OPCUA request message) from the client apparatus 80, and instructs the reading unit 112 to execute a process corresponding to the received service request.
  • the service request of OPCUA is, for example, read out of a variable used when executing control processing of PLC 10 (particularly, CPU unit 100) (in particular, a variable whose value is updated when executing a control function) Is a request that involves access to in-system data.
  • the OPCUA input unit 111 executes, from the client device 80, an execution request (request message) of SubX, that is, execution of "read all the values of variables A to C at once". Accept the request.
  • the OPCUA output unit 113 transmits the execution result of the process corresponding to the execution request (service request) of the predetermined process received by the OPCUA input unit 111 from the client apparatus 80 via the communication cable 70 as a response to the execution request.
  • the OPCUA output unit 113 acquires, from the reading unit 112, the execution result of the process instructed by the OPCUA input unit 111 to the reading unit 112, and transmits the acquired execution result to the client device 80.
  • the OPCUA output unit 113 transmits the execution result acquired from the reading unit 112 to the client device 80 by, for example, a connection method conforming to the OPCA standard.
  • the OPCUA output unit 113 transmits the execution result of SubX to the client device 80. That is, the OPCUA output unit 113 collectively transmits “the values of the variables A to C during execution of the control process by the control unit 130” read by the reading unit 112 to the client device 80 at one time.
  • the reading unit 112, the reading period calculating unit 114, and the reading time point determining unit 115 execute a process corresponding to the “execution request of a predetermined process” received by the OPCUA input unit 111 from the client device 80.
  • Execute processing here, SubX). That is, reading (Read) of each value of variables A to C during execution of control processing by control unit 130 is executed by reading unit 112, reading period calculation unit 114, and reading time point determination unit 115.
  • the reading unit 112 is an execution unit of the OPCUA service related to reading of the value of the variable, and the value of the variable whose value is updated in each task at the reading time notified from the reading time determination unit 115 (in particular, Collect the value), that is, read the value of the variable.
  • reading unit 112 when a task is being executed by control unit 130 (particularly operation unit 131), reading unit 112 reads a variable notified of value by each task at the reading time point notified from reading time point determination unit 115. Read the value, that is, Read.
  • the reading unit 112 reads each value of the variables A to C with reference to the variable table 122 of the storage unit 120 at the reading time point instructed by the reading time point determination unit 115.
  • the reading unit 112 refers to the variable table 122 of the storage unit 120 at the read time point instructed by the read time point determination unit 115, and starts the process of reading the values of the variables A to C.
  • the reading period calculation unit 114 is a predicted reading that is the time (period) required for “the reading unit 112 refers to the variable table 122 to execute the reading process of the values of the desired variables (for example, variables A to C)”. Calculate the period.
  • the reading period calculation unit 114 may calculate the expected reading period based on, for example, the data type (specifically, Byte, Int, Long, etc.) of each variable from which the reading unit 112 reads the value.
  • the reading period calculation unit 114 is, for example, based on the number of variables from which the reading unit 112 reads a value (specifically, “3” if the variables from which the reading unit 112 reads a value are variables A to C).
  • the predicted reading period may be calculated.
  • the reading period calculation unit 114 may calculate the expected reading period based on, for example, the data type of each variable from which the reading unit 112 reads the value, and the number of variables from which the reading unit 112 reads the value. .
  • the read time point determination unit 115 determines a read time point that is a start time point of the read process performed by the read unit 112, and notifies the read unit 112 of the determined read time point.
  • the read time point determination unit 115 determines a read time point which is a start time point of the read process performed by the read unit 112 so that the following conditions are satisfied while the control process by the control unit 130 is performed.
  • the read time point determination unit 115 determines from the completion of reading of the value of one variable P among the plurality of variables to be read out to the completion of reading of the value of the variable Q different from the variable P. , The read time point of each of the variables P and Q is determined so that the value of the variable P or Q is not updated. In other words, the read time determination unit 115 does not execute a task (particularly, a program) for updating the value of variable P or Q from the completion of reading of the value of variable P to the completion of reading of the value of variable Q. Then, the read point of each of the variables P and Q is determined.
  • read time determination unit 115 determines the read time of each of variables P and Q as follows. Do. That is, the time interval from the completion of reading of the value of variable P to the completion of reading of the value of variable Q is the cycle of the task having the shortest cycle interval among the plurality of tasks ("1 ms" in the above example) Determine the read point of each of the variables P and Q so as to be smaller than.
  • read time point determination unit 115 determines the read time points of variables P and Q as follows. decide. That is, the time interval from the completion of reading of the value of variable P to the completion of reading of the value of variable Q is the cycle of the task having the highest priority among the plurality of tasks ("1 ms" in the above example) The read points of each of the variables P and Q are determined to be smaller.
  • the read time point determination unit 115 reads SubX ("Read of each value of variables A to C during execution of control processing by control unit 130") executed by the read unit 112.
  • the read time which is the start time of execution, is determined as follows. That is, read time point determination unit 115 causes all the time points when reading unit 112 completes reading of the values of variables A to C to be included between the start time point and the end time point of one cycle of task Tp. , Determine the read point. That is, the read time point determination unit 115 determines that all the read completion times of the values of the variables A to C are one cycle of the task Tp, which is the task with the shortest cycle interval among the plurality of tasks executed by the control unit 130. The read time is determined to be included between the start time and the end time.
  • the control unit 130 is an execution subject of control processing for controlling a control target such as a machine and a facility, and executes transmission of output data, reception of input data, and execution of a control program which generates output data using input data. Control the control object by repeating.
  • the control unit 130 includes “an operation unit 131 that executes a control program that generates output data using input data”, and “a field communication unit 132 that executes transmission of output data and reception of input data”. ,including.
  • the control unit 130 is the same as the control unit of the conventional CPU unit (PLC) that does not have the OPCUA server function (the execution subject of the control process for controlling the control target such as a machine and equipment).
  • the arithmetic unit 131 executes various programs such as a control program using input data acquired by the field communication unit 132 to generate output data, and outputs the generated output data to the field communication unit 132. Specifically, as the “execution of various programs”, the arithmetic unit 131 executes a plurality of tasks in parallel and executes each task at a cycle corresponding to each task. The arithmetic unit 131 executes, for example, a plurality of tasks in parallel by time division, and executes each task at a cycle corresponding to each task. That is, the computing unit 131 performs processing in multitasking.
  • the task includes execution of a control program such as a user program corresponding to each task.
  • the arithmetic unit 131 executes tasks Tp and Ts in parallel by time division, for example. Further, the computing unit 131 executes the task Tp in a cycle of 1 ms, and executes the task Ts in a cycle of 2 ms. Furthermore, the computing unit 131 may execute a task Tt different from any of the tasks Tp and Ts in a cycle of 4 ms.
  • the task executed by the operation unit 131 has a preset execution condition. It may include a task to be executed when it is established.
  • the task to be executed when a preset execution condition is satisfied is, for example, called an “event task”, and specifically, the task Te may be an event task.
  • Field communication unit 132 exchanges data with various field devices (for example, device 31, device 32, servo driver 33, servo driver 34, etc.) via at least one of PLC system bus 106 and field network 20. I will exchange.
  • field devices include an actuator for performing some process on the control target, a sensor for acquiring various information from the control target, and the like.
  • the field communication unit 132 acquires input data from the device 31, which is an input device, and outputs output data to the device 32, which is an output device, the servo driver 33, the servo driver 34, and the like.
  • the storage unit 120 is a storage device that stores various data used by the CPU unit 100.
  • the storage unit 120 includes (1) control programs executed by the CPU unit 100, (2) OS programs, (3) application programs for executing various functions of the CPU unit 100, and (4) the application programs. Various data to be read out upon execution may be stored temporarily.
  • the storage unit 120 further stores a program table 121, a variable table 122, and a task table 123.
  • the program table 121 is various programs to be executed by the control unit 130 (in particular, the calculation unit 131).
  • the program executed by the OPCUA server unit 110 may be stored in the storage unit 120 separately from the program table 121, for example, as an application program (an application program for realizing the OPCUA server function).
  • the program table 121 which is various programs executed by the control unit 130 (in particular, the calculation unit 131), may be in three layers of a real time OS, a system program, and a user program.
  • the real-time OS is designed according to the computer architecture of the CPU unit 100, and provides a basic execution environment for the processor 151 to execute a system program and a user program.
  • This real-time OS is typically provided by a maker of PLC or a specialized software company.
  • the system program is a software group for providing a function as the PLC 10 (in particular, the CPU unit 100).
  • the system program includes a scheduler program, an output processing program, an input processing program, a sequence instruction calculation program, a motion calculation program, and other system programs.
  • the output processing program includes a program for executing processing for outputting the calculation result by the CPU unit 100 to the IO units 102 to 104 as output units.
  • the input processing program includes a program for executing a process of taking into the CPU unit 100 signals input to the IO units 102 to 104 as input units.
  • the output processing program and the input processing program may be generically referred to as an IO processing program.
  • the user program is a program that is created according to the control purpose of the user, in other words, a program that is arbitrarily designed according to a line (process) to be controlled using the control system 2 or the like.
  • the user program is configured to be editable by the support device 60 connected to the CPU unit 100, and is described in, for example, a ladder language, an SFC language, a structured text, etc., and a plurality of languages may be mixed.
  • the user program cooperates with the sequence instruction operation program and the motion operation program to realize the control purpose of the user. That is, the user program realizes a programmed operation by using an instruction, a function, a functional module and the like provided by the sequence instruction operation program and the motion operation program. Therefore, the user program, the sequence instruction operation program, and the motion operation program may be collectively referred to as a control program.
  • the variable table 122 is a variable used by a program (in particular, a control program such as a user program), that is, the value of each variable in the variable table 122 is updated upon execution of the control program such as a user program (that is, , Will be written).
  • the task table 123 is information on tasks, and, for example, names of tasks, priorities of the tasks, cycles (control cycles) in which the tasks are executed, and programs such as user programs executed in the tasks And its composition.
  • a control cycle of a preset time interval (for example, 1 ms) may be adopted as a common cycle of the entire processing. This common cycle may be referred to as a "reference cycle”, and a task whose control cycle (ie, cycle) is a "reference cycle” may be referred to as a "reference task”.
  • the operation unit 131 of the PLC 10 executes various programs in the program table 121 in units of execution called “tasks”. That is, in the PLC 10, control programs such as user programs are allocated and executed for each task. For example, the entire user program is composed of a plurality of user programs, and each user program is assigned to each of a plurality of tasks. Further, in the PLC 10, tasks are roughly classified into periodic execution tasks that are periodically executed and event execution tasks that are executed when an event occurs.
  • the program table 121 which is a process / program that can be executed by the operation unit 131 in the “task”, includes the “IO process program”, the “control program”, and the “other process / program” as described above.
  • the user can use the support device 60 to set a task that is an execution unit of a program. Specifically, it is possible to set and define an execution cycle and an execution timing of a task, a program (for example, a control program) executed by the task, execution necessity of IO control in the task, and the like. A user may be able to assign, for example, up to 128 programs per task using the support device 60.
  • the setting of the task is transferred from the support device 60 to the CPU unit 100 via, for example, the connection cable 50, and stored in the task table 123 of the storage unit 120 realized by the non-volatile memory 153 or the like.
  • the user can use the support device 60 to set priorities among a plurality of tasks. Specifically, using the support device 60, the user uses “task Tp, which is a primary periodic task having different priorities,” “task Ts, which is a periodic task,” and “task Te, which is an event task”. "3 types of tasks” may be set.
  • task processing in the overlapping time when the user program of the task with high priority and the user program of the task with priority lower than the task are simultaneously executed, the operation unit 131 of the PLC 10 performs the following processing You may That is, the calculation unit 131 may interrupt the execution of the program assigned to the low priority task and execute interrupt control to execute the program assigned to the high priority task.
  • the primary periodic task and the periodic task are both periodic tasks, and the priority of the primary periodic task is higher than the priority of the periodic task.
  • the value of the priority of the primary fixed cycle task is smaller than the value of the priority of the fixed cycle task.
  • the computing unit 131 may preferentially execute the task with the smaller priority value among the plurality of tasks.
  • the task Tp may have, for example, “IO control, user program, motion operation program (and system service)” as the main processing content (execution content).
  • the task Ts may have, for example, “IO control, user program (and system service)” as the main processing content.
  • the task Te may have, for example, “user program (and system service)” as the main processing content.
  • the operation unit 131 of the PLC 10 may execute the task Tp with the highest priority, and the user may be able to specify the priority relationship between the task Ts and the task Te.
  • the periodically executed tasks that are periodically executed are not limited to two, task Tp and task Ts.
  • a priority related to the execution order may be set between three or more periodic execution tasks (for example, tasks Tp, Ts, and Tt), and a period (execution period) is set for each periodic execution task.
  • FIG. 4 is a diagram showing an outline of processing executed by the PLC 10 (in particular, the CPU unit 100). First, the multitasking process executed by the PLC 10 will be described with reference to FIG. 4.
  • the CPU unit 100 (in particular, the computing unit 131) repeatedly executes a plurality of tasks (tasks Tp and Ts in the example shown in FIG. 4) in parallel in a cycle of each task by time division. That is, the CPU unit 100 executes processing in multitasking, and the cycles of the tasks executed by the CPU unit 100 are different.
  • the task Tp is executed with priority over the task Ts and is executed, for example, in a cycle of 1 ms. That is, the task Tp takes one control cycle (time interval of 1 ms) as an execution cycle. Further, the task Tp includes a program Pp such as a user program, that is, the program Pp such as a user program is assigned to the task Tp.
  • the task Tp is an example of the “reference task” in the present invention.
  • the task Ts is executed at a lower level than the task Tp, and is executed, for example, in a cycle of 2 ms, that is, two control cycles (time intervals of 2 ms) are used as execution cycles. Further, the cycle of the task Ts is set to an integral multiple (for example, twice) of the cycle of the task Tp. Also, the task Ts includes a program Ps such as a user program, that is, the program Ps such as a user program is assigned to the task Ts. The task Ts is an example of the “task other than the reference task” in the present invention.
  • the CPU unit 100 may execute the task Tt subordinate to the tasks Tp and Ts in a cycle of 4 ms. That is, the CPU unit 100 may execute the task Tt with four control cycles (time intervals of 4 ms) as execution cycles.
  • the cycle of the task Tt may be set to an integral multiple (for example, four times) of the cycle of the task Tp.
  • the task Tt may include a program (a user program or the like).
  • the task Tt is an example of the “task other than the reference task” in the present invention.
  • tasks Tp, Ts and Tt can be made easy to synchronize by making the cycle of tasks Ts and Tt an integral multiple of the cycle of task Tp.
  • the tasks Tp, Ts and Tt are synchronized means that “the cycles (execution cycles) of the tasks Tp, Ts and Tt are started at the same time (the start point is the same), or“ the tasks Tp, Ts and The cycle of Tt ends at the same time (the end point becomes the same).
  • the area indicated by horizontal stripes indicates a period during which the program Ps executed in the task Ts which is a fixed cycle task, that is, the program Ps allocated to the task Ts is executed. Further, regions indicated by two or more diagonal lines crossing each other indicate a period during which “A variable C is collectively read (Subscription: SubX)” is executed.
  • the task Tp is executed in a cycle of 1 ms, and the task Ts is executed in a cycle of 2 ms.
  • the program Pp to be executed until then is particularly expressed as "program Pp1”.
  • the program Pp to be executed in the second cycle of task Tp is executed as the “program Pp2” in the third cycle.
  • program Ps to be executed in the second cycle of the task Ts is executed in the third cycle with the “program Ps2”.
  • the program Ps is expressed as "program Ps3".
  • program Psn The program Ps to be executed is expressed as "program Psn".
  • the client device 80 outputs, to the PLC 10, a service request that "the variables A to C are collectively read (Subscription: SubX)".
  • the PLC 10 receives this service request (SubX) from the client device 80 (Step 1).
  • the readout period calculation unit 114 of the PLC 10 executes the execution time of SubX, that is, the readout period which is “time required to read out variables A to C”. Calculate (Proc: Y ⁇ s) (Step 2).
  • the read point in time determination unit 115 determines a read point in time using the predicted read period Y ⁇ s notified from the read period calculation portion 114. That is, the read point in time determination unit 115 of the PLC 10 determines “the point in time before the predicted read period Y ⁇ s from the timing (point in time) at which the cycles of tasks Tp and Ts are aligned” as the read point in time.
  • the read point in time determination unit 115 instructs the read out unit 112 on the determined read point in time.
  • the OPCUA output unit 113 of the PLC 10 collectively transmits the “values of variables A to C” read by the reading unit 112 to the client device 80. That is, the OPCUA server unit 110 of the PLC 10 returns the execution result (Read result) of SubX to the client device 80 (Step 4).
  • control method executed by the PLC 10 is a control method of a control device that controls a control target device by repeatedly and concurrently executing a plurality of tasks in a cycle for each task, each value being the plurality of the plurality
  • a request step of externally receiving a request for collectively inquiring each value in the execution of the task for a plurality of variables to be updated in at least one of the tasks in the step (Step 1);
  • the point of time when the reading of the value of each of the plurality of variables is completed is all from the start point to the end point of one cycle of the task with the smallest interval of the cycle among the plurality of tasks.
  • a read out procedure for reading out the updated value of at least one of the plurality of tasks of each of the plurality of variables, as included.
  • a flop (Step3), and an output step (Step4) for outputting the respective values of said plurality of variables read in the reading step to the exterior of the.
  • the control method controls the control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each of the tasks.
  • the point in time when the reading of each value of the plurality of variables is completed is one cycle of the task with the shortest interval of the cycle among the plurality of tasks.
  • the value updated in at least one of the plurality of tasks of each of the plurality of variables is read out so as to be included between the start time and the end time, and the value of each of the read out plurality of variables is externalized Output to
  • control method can periodically execute a plurality of tasks in parallel, and externally receives a request from the outside to collectively inquire the updated values of the plurality of variables during task execution.
  • An updated value of each of the plurality of variables can be responded to, and the synchronized value can be responded.
  • the time interval between the reading completion time of the updated value of variable A and the reading completion time of the updated value of variable C is equal to or longer than the interval of the basic cycle, 1 in the time interval
  • the task Tp will be executed more than once. Therefore, the user can obtain the value of the variable A and "the value of the variable C after the task Tp for updating the value of the variable A is read one or more times after the value of the variable A is read" I will get it. Therefore, the synchronization between the value of the read variable A and the value of the variable C is not secured, and the user grasps the relationship between the synchronized values of each of the plurality of variables. Can not do it.
  • the user can not grasp the updated values of each of the variable A and the variable C which are updated substantially simultaneously in each of the tasks Tp and Ts which are periodically executed in parallel.
  • the user acquires the value of the variable A and the variable “after the task Tp for updating the value of the variable A is executed one or more times after the value of the variable A is read. And the value of C.
  • the point in time when the reading of the value of each of the plurality of variables is completed is included in one cycle of the task with the smallest interval of the cycle among the plurality of tasks.
  • the value updated in at least one of the plurality of tasks of each of the plurality of variables is read, and the value of each of the plurality of read variables is output to the outside. That is, the control method updates each of the plurality of variables such that a time interval between reading completion values of the updated values of each of the plurality of variables is smaller than a time interval of the basic cycle. The subsequent value is read out, and the value of each of the read out variables is output to the outside.
  • the control method is such that the time interval between the reading completion point of the updated value of variable A and the reading completion point of the updated value of variable C is the basic interval
  • the updated values of each of Variable A and Variable C are read out so as to be smaller than the time interval of the cycle.
  • the control is performed so that neither the task Tp nor the task Ts is executed from when the control method completes reading of the updated value of the variable A until when reading of the updated value of the variable C is completed.
  • the method reads the updated values of each of the variables A and C.
  • the user can grasp the updated value of each of the plurality of variables updated substantially simultaneously in each of the plurality of tasks executed in parallel, that is, ensuring the synchronization.
  • the updated values of each of the plurality of variables can be grasped.
  • the control method makes it possible to adjust the updated value of each of the plurality of variables in the response. Synchronization is realized.
  • the control method causes the user to update the updated value of the variable A updated in the task Tp and the variable updated in the task Ts substantially at the same time the variable A is updated.
  • the updated value of C can be grasped. That is, according to the control method, the user can grasp “the synchronized value is maintained, the updated value” for each of the variable A and the variable C.
  • the processing unit 131 starts processing of the task Tp having a higher priority than the task Ts.
  • the task Ts since the task Ts has a lower priority than the task Tp, the task Ts is in a standby state without the actual processing being started.
  • the computing unit 131 executes the program Pp (in particular, Pp1) including the user program of the task Tp, and when the processing of the task Tp is completed, the computing unit 131 selects the task Ts having the highest priority next to the task Tp. Start processing That is, the computing unit 131 executes the program Ps (particularly, Ps1) including the user program of the task Ts.
  • the read point determination unit 115 determines “a point in time before the expected read period Y ⁇ s from the timing (point in time when the cycles of tasks Tp and Ts are aligned”) as the read point.
  • the value of each of the variables A to C is read.
  • the reading unit 112 reads the updated values of the variables A and B updated in the task Tp (in particular, the updated values of the variables A and B updated by the execution of the program Pp1). Further, the reading unit 112 reads the updated value of the variable C updated in the task Ts (in particular, the updated value of the variable C updated by the execution of the program Ps1).
  • the reading unit 112 is a task including a program for updating each value of variables A to C from the completion of execution of the program for updating each value of variables A to C. Read out by the next start point of. Specifically, reading unit 112 sets each value of variables A to C to each of programs Pp and Ps from the completion of execution of each of programs Pp and Ps for updating each value of variables A to C. Read out by the next start of each of the tasks Tp and Ts involved.
  • the reading unit 112 After the reading unit 112 completes reading of the values of variables A and B, all variables A to C are set by tasks Tp or Ts until reading of the value of variable C is completed. The value has not been updated. That is, the reading unit 112 reads out the synchronized values of the variables A to C after update.
  • FIG. 5 is a block diagram showing the main configuration and the like of the CPU unit 200 of the PLC 11 according to the second embodiment of the present invention.
  • the CPU unit 200 in the present embodiment further includes an acquisition unit 210 as a functional block in addition to the configuration of the CPU unit 100 in the above-described first embodiment, and the storage unit 220 stores a variable management table 221. ing.
  • the CPU unit 200 includes the acquisition unit 210, and has the same configuration as the above-described CPU unit 100 except that the variable management table 221 is stored in the storage unit 220. Therefore, in the following, the acquisition unit 210 and the variables The management table 221 will be mainly described.
  • the outline thereof is organized as follows. That is, the PLC 11 uses the information (that is, the correspondence information) related to “a task in which the value of each variable is updated for a plurality of variables to be read (for example, variables A to C)”. Determine when to read the updated value of each of the variables in.
  • the PLC 11 further includes an acquisition unit 210 that acquires correspondence information in which the variable and the task that updates the value of the variable are associated, and the readout unit 112 acquires the correspondence information acquired by the acquisition unit 210 Using the correspondence information, the value of each of the plurality of variables is read in the period of the task that updates the value of each of the plurality of variables.
  • the PLC 11 acquires correspondence information in which the variable and the task for updating the value of the variable are associated, and each of the plurality of variables is acquired using the acquired correspondence information. Are read out in the period of the task for updating the value of each of the plurality of variables.
  • the PLC 11 has an effect of being able to read out the value of each of the plurality of variables in the cycle of the task for updating the value of each of the plurality of variables using the correspondence information.
  • the unit 112 may complete reading of the value of the certain variable immediately before the period when the cycles of each of two or more of the tasks that update the value of the certain variable are aligned.
  • the PLC 11 associates, with respect to a certain variable among the plurality of variables, two or more tasks that update the value of the certain variable.
  • the reading of the value of the certain variable is completed just before the point in time when the cycles of each of the two or more tasks that update the value of the certain variable are aligned.
  • the value after the update of the certain variable is read .
  • the read values are further updated in tasks other than the “task with the shortest cycle interval” before the “task with the shortest cycle interval” is re-executed.
  • the PLC 11 reads the value of the certain variable by the time when the cycles of each of the two or more tasks for updating the value of the certain variable are aligned. Therefore, after the PLC 11 reads out the value of the certain variable after being updated in a certain task, before the certain task is re-executed, the PLC 11 can execute the above-mentioned process in a task other than the above-mentioned certain task. This has the effect of being able to prevent the situation where the value of a certain variable is updated.
  • the acquisition unit 210 acquires correspondence information in which each of a plurality of variables is associated with a task for updating the value of each variable from the support device 60 or the like, and the acquired correspondence information is stored in the variable management table of the storage unit 220. Store in 221
  • the support device 60 when compiling and building the control program created by the user to create an executable file, the support device 60 generates correspondence information, and outputs the generated correspondence information to the acquisition unit 210.
  • the support device 60 grasps which control program is used to update the value of each of a plurality of variables for a variable whose value is updated by a control program such as a user program, and which task the control program is assigned to And generate correspondence information.
  • the reading time determination unit 115 uses the correspondence information stored in the variable management table 221, the reading time determination unit 115 reads "the time when the reading unit 112 reads the updated value of each of the variables A to C". Each value is determined within each period of tasks Tp and Ts to update. The read time point determination unit 115 notifies the read unit 112 of the determined “read time point of each updated value of variables A to C”.
  • the reading unit 112 reads the updated values of each of the variables A to C at the “reading time of each updated value of the variables A to C” notified from the reading time determination unit 115.
  • FIG. 6 is a diagram showing the data structure of the variable management table 221 stored in the storage unit 220 of the CPU unit 200.
  • correspondence information is stored by the acquisition unit 210, and, for example, correspondence information acquired by the acquisition unit 210 from the support device 60 is stored.
  • the correspondence information is information indicating the task of updating the value of each variable for each of the plurality of variables stored in the variable table 122.
  • each variable A, B, C (user variable A, B, C) is written in which task is executed by a user program (that is, the value is updated in which task Information about
  • the correspondence information may further indicate, for each of the plurality of variables stored in the variable table 122, the data type of each variable.
  • the correspondence information illustrated in FIG. 6A indicates that “variable A is updated in task Tp, which is a primary periodic task”, and further, “the data type of variable A is“ Int ””. It is shown that. Further, the correspondence information illustrated in (A) of FIG. 6 indicates that “variable B is updated in task Tp, which is a primary periodic task”, and “data type of variable B is“ Int ”. It shows that there is. Furthermore, the correspondence information illustrated in (A) of FIG. 6 indicates that “the variable C is updated in the task Ts which is a periodic task”, and further, “the data type of the variable C is“ Long ”. "It is shown that.
  • the task of updating the value of a certain variable is not limited to one task. More than one task may update the value of a certain variable.
  • the correspondence information illustrated in (B) of FIG. 6 indicates the same contents as the correspondence information illustrated in (A) of FIG. 6 for the variables A and B, but the variable C is more than one. It indicates that the task is updated (the value of the variable C is updated in two or more tasks). That is, the correspondence information illustrated in (B) of FIG. 6 indicates that “variable C is updated in“ task Tp that is a primary fixed cycle task ”and“ task Ts that is a fixed cycle task ”. Furthermore, it indicates that "the data type of variable C is" Long ".
  • the task (task name) corresponding to the variable may be “Unknown”.
  • the correspondence information illustrated in (C) of FIG. 6 indicates that the task (task name) corresponding to the variable C is “Unknown”, which indicates that the value of the variable C is updated in a plurality of tasks. ing.
  • the acquisition unit 210 is an example of the “acquisition unit” in the present invention
  • the correspondence information stored in the variable management table 221 is an example of the “correspondence information” in the present invention.
  • FIG. 7 is a diagram showing an outline of processing executed by the PLC 11 (in particular, the CPU unit 200).
  • the correspondence information exemplified in (A) of FIG. 6 is stored in the variable management table 221 stored in the storage unit 220 of the PLC 11 (CPU unit 200). That is, in the example shown in FIG. 7, the variables A and B are updated in the task Tp which is a primary fixed cycle task, and the variable C is updated in the task Ts which is a fixed cycle task.
  • the task Tp is executed with priority over the task Ts and is executed, for example, in a cycle of 1 ms.
  • the task Ts is executed subordinate to the task Tp, and is executed, for example, in a cycle of 2 ms.
  • the support device 60 notifies the PLC 11 of correspondence information between tasks and variables. As described above, in the example illustrated in FIG. 7, the support device 60 “changes the variables A and B in the task Tp which is a primary periodic task and the variable C in the task Ts which is a periodic task. "" Is notified to the PLC 11.
  • the acquisition unit 210 stores the correspondence information in the variable management table 221 of the storage unit 220.
  • the client device 80 outputs, to the PLC 10, a service request that "the variables A to C are collectively read (Subscription: SubX)".
  • the PLC 11 executes a task in which each of the variables A to C is written based on the correspondence information stored in the variable management table 221, Read each of the variables A to C.
  • the read point in time determination unit 115 determines the point in time when the “readout unit 112 reads each of the variables A to C” as follows.
  • read time point determination unit 115 determines the time point of “read unit 112 reads each of variables A and B” as follows. That is, the read time point determination unit 115 determines the time point at which the “read unit 112 reads each of the variables A and B” within the cycle of the task Tp and after the execution of the program Pp is completed. Do. In other words, the read time point determination unit 115 determines the time point at which the updated values of each of the variables A and B are read out at a time point within the cycle of the task Tp.
  • the read time point determination unit 115 determines the time point of “the read unit 112 reads the variable C” as follows. That is, the read point in time determination unit 115 determines the point in time when the “readout unit 112 reads the variable C” within the cycle of the task Ts and after the execution of the program Ps is completed. In other words, the read time point determination unit 115 determines the time point at which the updated value of the variable C is read out as the time point within the cycle of the task Ts.
  • the read time point determination unit 115 determines one cycle of the task Tp, which is the task with the shortest cycle interval among a plurality of tasks executed by the control unit 130, at all read completion times of the values of the variables A to C.
  • the read point is determined so as to be included between the start point and the end point of.
  • read time point determination unit 115 determines that at least one of variables A and B is at least one of read completion of updated values of variables A and B and read completion of updated values of variable C.
  • the read points of each of the variables AC are determined so that the values are not updated. In other words, with respect to the updated values of each of the variables A to C, the read point in time determination unit 115 can ensure synchronization between the values of each of the read out variables A to C after the update. Determine the read point of the updated value of.
  • the computing unit 131 executes the program Pp (in particular, Pp1) including the user program of the task Tp, and when the processing of the task Tp is completed, the computing unit 131 selects the task Ts having the highest priority next to the task Tp. Start processing That is, the computing unit 131 executes the program Ps (particularly, Ps1) including the user program of the task Ts.
  • the reading unit 112 starts reading (Read) of the value of the variable C with reference to the variable table 122 of the storage unit 120 at the reading time point determined by the reading time point determination unit 115 (in FIG. Start of the hatched area that extends to the lower left).
  • Reading time determination unit 115 determines that the time between reading completion of each of values of variables A and B and reading completion of variable C is smaller than “one cycle of task Tp (that is, 1 ms)”. Then, the read points of the values of the variables A and B are determined. Specifically, read time point determination unit 115 determines the read time points of variables A and B whose values are updated in task Tp within the cycle of task Tp (in the example shown in FIG. 2 ms ′ ′) and determined after the execution of the program Ps2 is completed. That is, the reading unit 112 reads the updated values of the variables A and B in the “region indicated by the diagonal lines extending from the upper left to the lower right on the sheet of FIG. 7”.
  • the task Ts (in particular, the program Ps) that updates the value of the variable C after the reading of the variable C by the reading unit 112 is interrupted until the reading of the variable C by the reading unit 112 is resumed Not run. Therefore, while the variable C is read by the reading unit 112, the value of the variable C is not updated by the task Ts (particularly, the program Ps).
  • the reading unit 112 reads (1) “value after update by the program Pp2” of each of the variables A and B, and (2) “program Ps1 of the variable C. "Value after updated by” is read. Since the time between reading completion of the values of variables A and B and reading completion of variable C is smaller than "one cycle of task Tp", task Tp is not executed during this time, That is, the synchronization between the values after update of each of the read out variables A to C is ensured.
  • the OPCUA output unit 113 of the PLC 11 collectively transmits the “values of the variables A to C” read by the reading unit 112 to the client device 80. That is, the OPCUA server unit 110 of the PLC 11 returns the execution result (Read result) of SubX to the client device 80.
  • the read time point determination unit 115 determines from the completion of reading of the value of one variable P among the plurality of variables to be read out to the completion of reading of the value of the variable Q different from the variable P. , The read time point of each of the variables P and Q is determined so that the value of the variable P or Q is not updated. In other words, the read time determination unit 115 does not execute a task (particularly, a program) for updating the value of variable P or Q from the completion of reading of the value of variable P to the completion of reading of the value of variable Q. Then, the read point of each of the variables P and Q is determined.
  • FIG. 8 is a diagram for explaining the details of the process shown in FIG.
  • the support device 60 notifies the PLC 11 of correspondence information between tasks and variables in advance (S1). Specifically, at the time of building a control program such as a user program, the support device 60 “in which task the variables A to C are written in the control program to be executed (the value is updated) "" Is searched (S11). The support device 60 generates correspondence information, and stores, for example, information of “a task in which each of the variables A to C is written” in the user variable management table in association with each of the variables A to C (S12) . The support device 60 downloads various setting information including correspondence information (for example, a variable management table) to the PLC 11, that is, outputs the setting information to the PLC 11 (S13).
  • correspondence information for example, a variable management table
  • the client device 80 outputs a service request “I want to collectively read the variables A to C (Subscription: SubX)” to the PLC 11 (S 2). Specifically, the client device 80 outputs an execution request for SubX to the PLC 11 (S14).
  • the reading unit 112 reads each of the variables A to C in the task to which each variable is written based on the correspondence information acquired from the support device 60 in S1. Read the value (S3).
  • the read time point determination unit 115 derives a task in which each of the variables A to C is written from the variable management table 221 (S15). That is, the read time point determination unit 115 acquires the task to which each of the variables A to C is written based on the correspondence information stored in the variable management table 221, in other words, the value of each of the variables A to C Figure out which task is to be updated.
  • the OPCUA server unit 110 executes SubX in the task to which each of the variables A to C is written with reference to the variable management table 221, that is, in the task to which each of the variables A to C is written, the variable A Each of C is read (S16). That is, first, using the correspondence information stored in the variable management table 221, the reading time determination unit 115 reads "the time when the reading unit 112 reads the updated value of each of the variables A to C" The values of each of A to C are determined within the period of each of tasks Tp and Ts to be updated. Then, the reading unit 112 reads the updated values of each of the variables A to C at the “reading time of each updated value of the variables A to C” determined by the reading time determination unit 115.
  • the determination method of the “reading point of each updated value of variables A to C” by the reading point determination unit 115 has already been described with reference to FIG.
  • the OPCUA output unit 113 of the PLC 11 returns the execution result of SubX to the client device 80 (S4). Specifically, the OPCUA output unit 113 outputs the read result of each of the variables A to C to the client device 80 (S17).
  • FIG. 9 is a diagram showing an outline of processing in the case where there is a plurality of tasks for updating the value of a certain variable, with regard to processing executed by the PLC 11 (in particular, the CPU unit 200).
  • the correspondence information exemplified in (C) of FIG. 6 is stored in the variable management table 221 stored in the storage unit 220 of the PLC 11 (CPU unit 200). That is, in the example shown in FIG. 7, (1) variables A and B are updated in task Tp which is a primary fixed cycle task, and (2) variable C is task Tp which is a primary fixed cycle task, and fixed cycle The task Ts is updated in the task Ts.
  • the task Tp is executed prior to the task Ts and is executed, for example, in a cycle of 1 ms.
  • the task Ts is executed subordinate to the task Tp, and is executed, for example, in a cycle of 2 ms.
  • the support device 60 notifies the PLC 11 of correspondence information between tasks and variables. As described above, in the example illustrated in FIG. 9, the support device 60 notifies the PLC 11 of correspondence information that “variables A and B are updated in task Tp and variable C is updated in tasks Tp and Ts”.
  • the acquisition unit 210 stores the correspondence information in the variable management table 221 of the storage unit 220.
  • the client device 80 outputs, to the PLC 10, a service request that "the variables A to C are collectively read (Subscription: SubX)".
  • the PLC 11 executes a task in which each of the variables A to C is written based on the correspondence information stored in the variable management table 221, Read each of the variables A to C.
  • the read point in time determination unit 115 determines the point in time when the “readout unit 112 reads each of the variables A to C” as follows.
  • read time point determination unit 115 determines the time point of “read unit 112 reads each of variables A and B” as follows. That is, the read time point determination unit 115 determines the time point at which the “read unit 112 reads each of the variables A and B” within the cycle of the task Tp and after the execution of the program Pp is completed. Do. In other words, the read time point determination unit 115 determines the time point at which the updated values of each of the variables A and B are read out at a time point within the cycle of the task Tp.
  • the read point in time determination unit 115 determines the point in time when the “read unit 112 reads the variable C” as follows. That is, the read point in time determination unit 115 determines the point immediately before the timing when the cycles of the tasks Tp and Ts are aligned as the point in time at which the read unit 112 reads the variable C.
  • the cycles of the tasks Tp and Ts are aligned during execution of control processing of the control unit 130
  • the processing unit 131 starts processing of the task Tp having a higher priority than the task Ts.
  • the task Ts is in a standby state without the actual processing being started.
  • the computing unit 131 executes the program Pp (in particular, Pp1) including the user program of the task Tp, and when the processing of the task Tp is completed, the computing unit 131 selects the task Ts having the highest priority next to the task Tp.
  • the computing unit 131 executes the program Ps (particularly, Ps1) including the user program of the task Ts.
  • the reading unit 112 starts reading (Read) of the value of the variable C with reference to the variable table 122 of the storage unit 120 at the reading time point determined by the reading time point determination unit 115 (in FIG. Start of the hatched area that extends to the lower left).
  • the reading unit 112 reads (1) “value after update by the program Pp2” of each of the variables A and B, and (2) “program Pp2 of the variable C. "Value after updated by” is read. Since the time between reading completion of the values of variables A and B and reading completion of variable C is smaller than "one cycle of task Tp", task Tp is not executed during this time, That is, the synchronization between the values after update of each of the read out variables A to C is ensured.
  • the OPCUA output unit 113 of the PLC 11 collectively transmits the “values of the variables A to C” read by the reading unit 112 to the client device 80. That is, the OPCUA server unit 110 of the PLC 11 returns the execution result (Read result) of SubX to the client device 80.
  • the read time point determination unit 115 determines from the completion of reading of the value of one variable P among the plurality of variables to be read out to the completion of reading of the value of the variable Q different from the variable P. , The read time point of each of the variables P and Q is determined so that the value of the variable P or Q is not updated. In other words, the read time determination unit 115 does not execute a task (particularly, a program) for updating the value of variable P or Q from the completion of reading of the value of variable P to the completion of reading of the value of variable Q. Then, the read point of each of the variables P and Q is determined.
  • FIG. 10 is a diagram for explaining the details of the process shown in FIG.
  • the support device 60 notifies the PLC 11 of correspondence information between tasks and variables in advance (S1). Specifically, at the time of building a control program such as a user program, the support device 60 “in which task the variables A to C are written in the control program to be executed (the value is updated) "" Is searched (S11). The support device 60 generates correspondence information, and stores, for example, information of “task for which each of the variables A to C is written” in the user variable management table in association with each of the variables A to C. Here, the support device 60 associates the task: Unknown with the variable (for example, the variable C) written from the plurality of tasks (for example, tasks Tp and Ts) (S12 '). The support device 60 downloads various setting information including correspondence information (for example, a variable management table) to the PLC 11, that is, outputs the setting information to the PLC 11 (S13).
  • correspondence information for example, a variable management table
  • the client device 80 outputs a service request “I want to collectively read the variables A to C (Subscription: SubX)” to the PLC 11 (S 2). Specifically, the client device 80 outputs an execution request for SubX to the PLC 11 (S14).
  • the reading unit 112 reads each of the variables A to C in the task to which each variable is written based on the correspondence information acquired from the support device 60 in S1. Read the value (S3).
  • the read time point determination unit 115 derives a task in which each of the variables A to C is written from the variable management table 221 (S15). That is, the read time point determination unit 115 acquires the task to which each of the variables A to C is written based on the correspondence information stored in the variable management table 221, in other words, the value of each of the variables A to C Figure out which task is to be updated.
  • the OPCUA server unit 110 executes SubX in the task to which each of the variables A to C is written with reference to the variable management table 221, that is, in the task to which each of the variables A to C is written, the variable A Read each of ⁇ C.
  • the variable C associated with the task: Unknown is read at the timing when the cycles of a plurality of tasks are aligned (S16 ').
  • the reading point determination unit 115 determines that “the value of the variable C is updated in the tasks Tp and Ts” using the correspondence information stored in the variable management table 221, the reading point of the variable C is It decides as follows.
  • the reading unit 112 reads the updated values of each of the variables A to C at the “reading time of each updated value of the variables A to C” determined by the reading time determination unit 115.
  • the determination method of “the read point of time after updating each of the variables A to C” by the read point determination unit 115 has already been described with reference to FIG.
  • the OPCUA output unit 113 of the PLC 11 returns the execution result of SubX to the client device 80 (S4). Specifically, the OPCUA output unit 113 outputs the read result of each of the variables A to C to the client device 80 (S17).
  • one PLC 10 is connected to the client device 80 and the input device and output device in the control system 2.
  • the management system 1 may include a plurality of PLCs 10.
  • each of the plurality of PLCs 10 may be communicably connected to each other via the field network 20.
  • the PLC 10 mainly performing control in the control system 2 and the PLC 10 that receives a service request (for example, execution request for SubX) from the client device 80 in the information system 3 are one and the same PLC 10 is not.
  • the PLC 10A that has received the execution request of SubX from the client device 80 may cause the PLC 10B that is mainly responsible for control in the control system 2 to execute SubX, and the PLC 10A may output the execution result of SubX to the client device 80 .
  • the PLC 10A and the PLC 10B may be communicably connected to each other, for example, via the field network 20.
  • the PLC 10 and the PLC 11 need only be able to “perform processing in multitasking”, and not only “perform multiple tasks in parallel by time division” but “perform multiple tasks in parallel simultaneously” May be
  • the processor 151 may be single core, and may execute a plurality of tasks in parallel by time division, that is, the processor 151 may execute processing in multitasking.
  • the processor 151 is a multi-core, and executes multiple tasks simultaneously in parallel, that is, the processor 151 may execute processing in multitasking.
  • the processor 151 can improve the processing capability of tasks by simultaneously executing a plurality of tasks in parallel.
  • the PLC 10 and the PLC 11 may adopt a single core and perform “parallel execution” in which one task does not execute another task while another task is being executed. Moreover, PLC10 and PLC11 may employ
  • PLC10 and PLC11 are the updated values of each of the plurality of variables, and the synchronization between the respective values, whether in parallel execution or in parallel execution for multitasking. Read out the updated values that were secured at once.
  • the functional blocks (in particular, the OPCUA server unit 110, the control unit 130, and the acquisition unit 210) of the PLCs 10 and 11 are logic circuits (IC chip) formed in an integrated circuit (IC chip) or the like. It may be realized by hardware) or software.
  • the PLCs 10 and 11 include a computer that executes instructions of a program that is software that implements each function.
  • the computer includes, for example, one or more processors, and a computer readable recording medium storing the program.
  • the processor reads the program from the recording medium and executes the program to achieve the object of the present invention.
  • a CPU Central Processing Unit
  • the above-mentioned recording medium a tape, a disk, a card, a semiconductor memory, a programmable logic circuit or the like can be used besides “a non-temporary tangible medium”, for example, a ROM (Read Only Memory).
  • a RAM Random Access Memory
  • the program may be supplied to the computer via any transmission medium (communication network, broadcast wave, etc.) capable of transmitting the program.
  • any transmission medium communication network, broadcast wave, etc.
  • one aspect of the present invention can also be realized in the form of a data signal embedded in a carrier wave in which the program is embodied by electronic transmission.
  • a control device is a control device that controls a control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each task, each value of which is the plurality of tasks.
  • a receiving unit for receiving a request from the outside for collectively querying each value during execution of the task for at least one of the plurality of variables, and the receiving unit receiving the request, the plurality of variables being updated
  • the plurality of time points for completing reading of each value of the variables are all included between the start time point and the end time point of one cycle of the task having the smallest cycle interval among the plurality of tasks.
  • a reading unit for reading the updated value in at least one of the plurality of tasks of each of the plurality of variables, and the value of each of the plurality of variables read by the reading unit. And an output unit for outputting to.
  • the control target device is controlled by repeatedly and concurrently executing a plurality of tasks in a cycle of each of the tasks.
  • the point in time when the reading of the value of each of the plurality of variables is completed is one cycle of the task with the shortest interval of the cycle among the plurality of tasks.
  • the value updated in at least one of the plurality of tasks of each of the plurality of variables is read out so as to be included between the start time and the end time, and the value of each of the read out plurality of variables is externalized Output to
  • control device can periodically execute a plurality of tasks in parallel, and receives a request from the outside to collectively inquire the updated values of each of the plurality of variables during task execution.
  • An updated value of each of the plurality of variables can be responded to, and the synchronized value can be responded.
  • the reading completion time point of the updated values of each of the plurality of variables spans two or more “periods of the task with the shortest period interval” (hereinafter referred to as “basic period”).
  • basic period the shortest period interval
  • synchronization is not ensured among the read values. That is, when the time interval between the completion of reading of the updated values of each of the plurality of variables is equal to or greater than the interval of the basic cycle, synchronization is not ensured among the plurality of read values.
  • the time interval between the reading completion time of the updated value of variable A and the reading completion time of the updated value of variable C is equal to or longer than the interval of the basic cycle, 1 in the time interval
  • the task Tp will be executed more than once. Therefore, the user can obtain the value of the variable A and "the value of the variable C after the task Tp for updating the value of the variable A is read one or more times after the value of the variable A is read" I will get it. Therefore, the synchronization between the value of the read variable A and the value of the variable C is not secured, and the user grasps the relationship between the synchronized values of each of the plurality of variables. Can not do it.
  • the user can not grasp the updated values of each of the variable A and the variable C which are updated substantially simultaneously in each of the tasks Tp and Ts which are periodically executed in parallel.
  • the user acquires the value of the variable A and the variable “after the task Tp for updating the value of the variable A is executed one or more times after the value of the variable A is read. And the value of C.
  • all the time points when the control device completes reading of the values of the plurality of variables are included in one cycle of the task with the smallest interval of the cycle among the plurality of tasks.
  • the value updated in at least one of the plurality of tasks of each of the plurality of variables is read, and the value of each of the plurality of read variables is output to the outside. That is, the control device updates each of the plurality of variables so that the time interval between reading completion values of the updated values of each of the plurality of variables is smaller than the time interval of the basic cycle. The subsequent value is read out, and the value of each of the read out variables is output to the outside.
  • the control device has a time interval between the reading completion point of the updated value of variable A and the reading completion point of the updated value of variable C is the basic interval
  • the updated values of each of Variable A and Variable C are read out so as to be smaller than the time interval of the cycle.
  • the control is performed so that neither the task Tp nor the task Ts is executed from when the controller completes reading of the updated value of the variable A until when reading of the updated value of the variable C is completed.
  • the device reads the updated values of each of the variables A and C.
  • the control device allows the user to grasp the values after updating of each of the plurality of variables updated substantially simultaneously in each of the plurality of tasks executed in parallel, that is, ensuring the synchronization.
  • the updated values of each of the plurality of variables can be grasped.
  • the updated values of each of the plurality of variables are inquired collectively to the control device during task execution, between the updated values of each of the plurality of variables to which the control device responds Synchronization has been realized.
  • the control device causes the user to change the updated value of the variable A updated in the task Tp and the variable updated in the task Ts substantially simultaneously with the time when the variable A is updated.
  • the updated value of C can be grasped. That is, the control device allows the user to grasp “the synchronized value is maintained, the updated value” for each of the variable A and the variable C.
  • the reading unit is a predicted reading expected as a period required to read all the values of the plurality of variables from the time when the cycles of the plurality of tasks are aligned. Reading of the value of each of the plurality of variables may begin by the time the period is subtracted.
  • the control device subtracts the expected reading period predicted as the time required to read all the values of the plurality of variables from the time when the periods of the plurality of tasks are aligned. By the time point, reading of the value of each of the plurality of variables is started.
  • the control device has information on a point in time when the cycles of each of the plurality of tasks are aligned, and information on an expected reading period predicted as a period required to read out all the values of the plurality of variables. To read the updated value of each of the plurality of variables. In other words, in order for the control device to read the updated value of each of the plurality of variables, “in each of the plurality of tasks, the value of each of the plurality of variables is updated There is no need to understand
  • control device can execute the plurality of processes by a process that is easy to realize as compared with the case where “the value of each of the plurality of variables is updated in which of the plurality of tasks”.
  • the effect is that the updated value of each of the variables can be read out.
  • the control device further includes an acquisition unit that acquires correspondence information in which the variable and the task that updates the value of the variable are associated, and the reading unit is a part of the acquisition unit.
  • the value of each of the plurality of variables may be read out in the cycle of the task for updating the value of each of the plurality of variables using the acquired correspondence information.
  • the control device acquires correspondence information in which the variable and the task for updating the value of the variable are associated, and the plurality of variables are acquired using the acquired correspondence information.
  • the value of each is read out in the period of the task that updates the value of each of the plurality of variables.
  • control device can use the correspondence information to read out the value of each of the plurality of variables in the cycle of the task for updating the value of each of the plurality of variables. Play.
  • a certain variable among the plurality of variables is associated with two or more of the tasks for updating the value of the certain variable.
  • the reading unit may complete reading of the value of the certain variable immediately before the cycle of each of the two or more tasks for updating the value of the certain variable is aligned.
  • the control device associates two or more of the tasks that update the value of the certain variable with respect to the certain variable among the plurality of variables. In the case where the value of the certain variable is updated, reading of the value of the certain variable is completed immediately before the period of time of each of the two or more tasks that update the value of the certain variable is aligned.
  • the value after the update of the certain variable is read .
  • the read values are further updated in tasks other than the “task with the shortest cycle interval” before the “task with the shortest cycle interval” is re-executed.
  • the control device reads the value of the certain variable by the time when the cycles of each of two or more of the tasks for updating the value of the certain variable are aligned. Therefore, after the control device reads out the value of the certain variable after being updated in a certain task, before the certain task is re-executed, in a task other than the certain task.
  • the effect is that it is possible to prevent the situation where the value of the certain variable is updated.
  • the control device has an OPCUA server function, and the reception unit receives the request from the OPCUA client device by a connection method conforming to the OPCUA standard, and the output unit transmits the request to the OPCUA client device
  • the values of each of the plurality of variables may be output in a connection scheme conforming to the OPCA standard.
  • the control device has an OPCUA server function, receives the request from the OPCUA client device by a connection method conforming to the OPCUA standard, and causes the OPCUA client device to receive each value of the plurality of variables. Is output in a connection method conforming to the OPCUA standard.
  • control device receives the request in a connection scheme conforming to the OPCUA standard, which is a safe and reliable industrial-to-device communication protocol independent of the manufacturer and the platform, and each of the plurality of variables is There is an effect that the value of can be output by a connection method conforming to the OPCA standard.
  • the plurality of tasks include a reference task and a task other than the reference task, and a cycle of tasks other than the reference task is a cycle of the reference task. It may be set to an integral multiple.
  • the plurality of tasks include a reference task and a task other than the reference task, and a cycle of tasks other than the reference task is a cycle of the reference task. It is set to an integral multiple of.
  • control device can easily synchronize the plurality of tasks, that is, it is possible to easily align the cycles of the plurality of tasks.
  • a control method is a control method of a control device that controls a control target device by repeatedly and parallelly executing a plurality of tasks in a cycle of each task, each value of which is the value described above.
  • the request is accepted in an accepting step, and an accepting step for accepting, from the outside, a request for collectively inquiring each value in the execution of the task for a plurality of variables updated in at least one of a plurality of tasks.
  • the point of time when the reading of the value of each of the plurality of variables is completed is included between the start point and the end point of one cycle of the task with the smallest interval of the cycle among the plurality of tasks.
  • reading out the updated value of at least one of the plurality of tasks for each of the plurality of variables Including an output step of outputting the respective values of said plurality of variables in the external read in.
  • the control method controls the control target device by repeatedly and concurrently executing a plurality of tasks in a cycle of each of the tasks.
  • the point in time when the reading of each value of the plurality of variables is completed is one cycle of the task with the shortest interval of the cycle among the plurality of tasks.
  • the value updated in at least one of the plurality of tasks of each of the plurality of variables is read out so as to be included between the start time and the end time, and the value of each of the read out plurality of variables is externalized Output to
  • control method can periodically execute a plurality of tasks in parallel, and externally receives a request from the outside to collectively inquire the updated values of the plurality of variables during task execution.
  • An updated value of each of the plurality of variables can be responded to, and the synchronized value can be responded.
  • the time interval between the reading completion time of the updated value of variable A and the reading completion time of the updated value of variable C is equal to or longer than the interval of the basic cycle, 1 in the time interval
  • the task Tp will be executed more than once. Therefore, the user can obtain the value of the variable A and "the value of the variable C after the task Tp for updating the value of the variable A is read one or more times after the value of the variable A is read" I will get it. Therefore, the synchronization between the value of the read variable A and the value of the variable C is not secured, and the user grasps the relationship between the synchronized values of each of the plurality of variables. Can not do it.
  • the user can not grasp the updated values of each of the variable A and the variable C which are updated substantially simultaneously in each of the tasks Tp and Ts which are periodically executed in parallel.
  • the user acquires the value of the variable A and the variable “after the task Tp for updating the value of the variable A is executed one or more times after the value of the variable A is read. And the value of C.
  • the point in time when the reading of the value of each of the plurality of variables is completed is included in one cycle of the task with the smallest interval of the cycle among the plurality of tasks.
  • the value updated in at least one of the plurality of tasks of each of the plurality of variables is read, and the value of each of the plurality of read variables is output to the outside. That is, the control method updates each of the plurality of variables such that a time interval between reading completion values of the updated values of each of the plurality of variables is smaller than a time interval of the basic cycle. The subsequent value is read out, and the value of each of the read out variables is output to the outside.
  • the control method is such that the time interval between the reading completion point of the updated value of variable A and the reading completion point of the updated value of variable C is the basic interval
  • the updated values of each of Variable A and Variable C are read out so as to be smaller than the time interval of the cycle.
  • the control is performed so that neither the task Tp nor the task Ts is executed from when the control method completes reading of the updated value of the variable A until when reading of the updated value of the variable C is completed.
  • the method reads the updated values of each of the variables A and C.
  • the user can grasp the updated value of each of the plurality of variables updated substantially simultaneously in each of the plurality of tasks executed in parallel, that is, ensuring the synchronization.
  • the updated values of each of the plurality of variables can be grasped.
  • the updated value of each of the plurality of variables in the response is Synchronization between is realized.
  • the control method causes the user to update the updated value of the variable A updated in the task Tp and the variable updated in the task Ts substantially at the same time the variable A is updated.
  • the updated value of C can be grasped. That is, according to the control method, the user can grasp “the synchronized value is maintained, the updated value” for each of the variable A and the variable C.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

マルチタスク実行中に、同期性を確保した複数の変数の更新後の値を読み出す。PLC(10)は、変数A~Cの各々の更新後の値の読出を完了する時点が全て、周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、変数A~Cの各々の更新後の値を読み出す。

Description

制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体
 本発明は、機械および設備等の動作を制御するために用いられる制御装置に関する。
 従来、プログラマブルコントローラ(Programmable Logic Controller、以下「PLC」と略記)等の産業用制御装置について、情報化(すなわち、産業用制御装置が取得・生成した情報の外部装置での利用等)と高性能化とを両立させるための種々の試みが知られている。
 例えば、下掲の特許文献1には、PLCの情報化への試みとして、産業用の機器間通信のプロトコルであるOPCUA(OPC Unified Architecture)に準拠して、サーバ装置としてのPLC等とクライアント装置とが接続する技術が開示されている。
 また、特許文献2には、PLCの高性能化への試みとして、時分割により複数のタスクを並行して実行するとともに、各タスクを各タスクに応じた周期で実行する、つまり、マルチタスクで処理を実行するPLCが開示されている。
日本国公開特許公報「特開2017-84143号公報(2017年5月18日公開)」 日本国公開特許公報「特開2009-181443号公報(2009年8月13日公開)」
 ここで、特許文献2に開示されるようなPLCについて、並行して実行される複数のタスクの各々において略同時に更新された複数の変数の各々の更新後の値を把握したい、つまり、同期性の確保された複数の変数の各々の更新後の値を把握したいとの要望がある。
 しかしながら、特許文献1の従来技術には、複数のタスクを並行して周期的に実行する産業用制御装置に対し、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、応答中の複数の変数の各々の値の同期が保証されていないという問題がある。言い換えれば、上述の従来技術には、複数のタスクを並行して周期的に実行する産業用制御装置が、「各々が少なくとも1つのタスクにおいて更新される」複数の変数について、複数の変数の各々の更新後の値を読み出す時点を制御していないという問題がある。
 本発明の一態様は、複数のタスクを並行して周期的に実行する産業用制御装置において、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、前記産業用制御装置が応答する複数の変数の各々の更新後の値の間の同期を実現することを目的とする。
 上記の課題を解決するために、本発明の一態様に係る制御装置は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置であって、各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付部と、前記受付部が前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出部と、前記読出部が読み出した前記複数の変数の各々の値を外部に出力する出力部と、を備える。
 上記の課題を解決するために、本発明の一態様に係る制御方法は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置の制御方法であって、各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付ステップと、前記受付ステップにて前記要求が受け付けられると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出ステップと、前記読出ステップにて読み出された前記複数の変数の各々の値を外部に出力する出力ステップと、を含む。
 本発明の一態様によれば、複数のタスクを並行して周期的に実行する産業用制御装置において、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、前記産業用制御装置が応答する複数の変数の各々の更新後の値の間の同期を実現することができるという効果を奏する。
本発明の実施形態1に係るCPUユニットの要部構成等を示すブロック図である。 図1のCPUユニットを備えるPLCを含む管理システムの全体概要を示す図である。 図1のCPUユニットのハードウェア構成を示す図である。 図1のCPUユニットが実行する処理の概要を示す図である。 本発明の実施形態2に係るCPUユニットの要部構成等を示すブロック図である。 図5のCPUユニットの記憶部に格納される変数管理テーブルのデータ構造を示す図である。 図5のCPUユニットが実行する処理の概要を示す図である。 図7に示した処理について、その詳細を説明する図である。 図5のCPUユニットが実行する処理について、或る1つの変数の値を更新するタスクが複数ある場合の処理の概要を示す図である。 図9に示した処理について、その詳細を説明する図である。
 〔実施形態1〕
 以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明し、先ず、本発明の実施形態1について、図1から図4に基づいて詳細に説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰返さない。本実施の形態においては、機械および設備等の制御対象を制御するPLC(プログラマブル・ロジック・コントローラ、Programmable Logic Controller)を制御装置(コントローラ)の典型例として説明を行う。
 §1.適用例
 本発明の一態様に係るPLC10(制御装置)についての理解を容易にするため、先ず、本発明が適用される場面の一例について、具体的には、PLC10を含む管理システム1の概要について、図2を用いて説明する。
 図2は、管理システム1の全体概要を示す図である。管理システム1は、以下の2つのシステムを含む。すなわち、1つ以上のPLC10により生産設備内の入力機器および出力機器が制御される制御システム2と、制御システム2において取得、生成された各種の情報について、蓄積、解析等を実施し、制御システム2の運用等に利用する情報システム3と、を含む。
 PLC10は、制御システム2と情報システム3との両方に接続され、情報システム3から、制御システム2(特に、制御システム2において使用されるデータ(変数))へのアクセスを実現する。PLC10とクライアント装置80とは、例えば、OPCUAプロトコルを利用して、相互に接続している。
 情報システム3のクライアント装置80は、PLC10が制御処理を実行する際に使用する変数について、PLC10の稼働中における「複数の変数の各々の、同期生が確保された更新後の値」を一括して、PLC10に問い合わす。言い換えれば、クライアント装置80は、PLC10による制御処理の実行に際して値が更新される変数について、複数の変数の間の関係を把握する等の目的により、更新時点が略同時である複数の変数の各々の更新後の値を一括して、PLC10に問い合わす。例えば、クライアント装置80は、変数A、B、および、C(以下、「変数A~C」と略記する)について、更新時点が略同時である変数A~Cの各々の更新後の値を、PLC10に一括して問い合わせる。
 ここで、1つのタスクのみを繰り返し実行する制御装置であれば、そのタスクにおいて各々の値が更新される複数の変数の各々の更新後の値は、そのタスクの1周期の終了時点(または、開始時点)で全て読み出すことで、読み出した値の間の同期を確保できる。
 しかしながら、制御システム2においてPLC10による制御には厳しいリアルタイム性が要求され、PLC10はこの要求に応えるためにマルチタスクで処理を実行する。そして、マルチタスクで処理が実行される場合、複数の変数について、単に「各タスクの1周期の終了時点(または、開始時点)で、そのタスクにおいて更新された変数の値を読み出す」だけでは、読み出した値の間の同期は確保することができない。例えば、変数AおよびBが更新されるタスクTpと、変数Cが更新されるタスクTsとが並行して実行される場合、「各タスクの1周期の終了時点(または、開始時点)で、そのタスクにおいて更新された変数の値を読み出す」だけでは、以下の事態が発生し得る。
 すなわち、変数AおよびBの更新後の値の読出を完了した時点(例えば、タスクTpの1回目の周期の終了時点)から、変数Cの読出を完了する時点(例えば、タスクTsの1回目の周期の終了時点)までの間に、タスクTpが1回以上実行されていることがある。
 PLC10は、このような事態が発生するのを防ぎ、読み出した複数の変数の各々の更新後の値の間の同期が確保されるように、複数の変数の各々の更新後の値を読み出し、読み出した値をクライアント装置80に出力する。
 すなわち、PLC10は、複数の変数の各々の値の読出を完了する時点が全て、複数のタスクのうち周期の間隔が最も小さいタスクの周期内に含まれるようにして、それら複数の変数の各々の更新後の値を読み出す。例えば、PLC10は、タスクTpにおいて更新された変数AおよびBの更新後の値の読出完了時点から、タスクTsにおいて更新された変数Cの更新後の値の読出完了時点までの間に、タスクTpおよびTsの各々が1回も実行されないように、読出を実行する。そして、PLC10は、読み出した「複数の変数の各々の更新後の値」を、クライアント装置80に出力する。
 これにより、クライアント装置80は、「同期の確保された(つまり、更新時点が略同時である)」複数の変数の各々の更新後の値を、一括してPLC10から取得することができる。すなわち、管理システム1において情報システム3は、制御システム2において使用される複数の変数の各々の更新後の値であって、各々の値の間の同期が確保された更新後の値を、一括して把握することができる。
 読み出した複数の値の間で「同期」が確保されているとは、例えば、変数Pの更新後の値P1の読出を完了してから、変数Qの更新後の値Q1の読出を完了するまでの間に、変数PおよびQの少なくとも一方の値が更新されていないことをいう。つまり、「P1の読出を完了してから、Q1の読出を完了するまでの間に、変数Pの値がP2に更新されたり、変数Qの値がQ2に更新されたりしていることがない」ことを、「読み出した変数PおよびQの各々の更新後の値の間の同期が確保されている」という。
 なお、「マルチタスクで処理を実行する」とは、「複数のタスクを並行に実行する」ことをいい、具体的には、「複数のタスクを同時に並行して実行する」場合と、「時分割により複数のタスクを並行して実行する」場合とを含む。以下の説明においては、PLC10が「時分割により複数のタスクを並行して実行する」場合について説明する。しかしながら、「複数のタスクを同時に並行して実行する」場合においても、PLC10は、複数の変数の各々の更新後の値であって、各々の値の間の同期が確保された更新後の値を、一括して読み出す。
 PLC10は、例えば、シングルコアを採用し、マルチタスクについて、或るタスクの実行中は他のタスクを実行しない「並行実行」を行なう場合、複数の変数の各々の更新後の値であって、各々の値の間の同期が確保された更新後の値を、一括して読み出す。また、PLC10は、例えば、マルチコアを採用し、マルチタスクについて、或るタスクの実行中に他のタスクを実行する「並列実行」を行なう場合、複数の変数の各々の更新後の値であって、各々の値の間の同期が確保された更新後の値を、一括して読み出す。すなわち、PLC10は、マルチタスクについて、並行実行を行なう場合であっても、並列実行を行なう場合であっても、複数の変数の各々の更新後の値であって、各々の値の間の同期が確保された更新後の値を、一括して読み出す。PLC10について、「複数のタスクを、タスクごとの周期で繰り返し並行して実行する」とは、並行実行を行なう場合と、並列実行を行なう場合と、の両方を含む。
 §2.構成例
 (制御システムの概要)
 制御システム2は、PLC10と、PLC10とフィールドネットワーク20を介して接続されるサーボドライバ33および34およびリモートIOターミナル35と、フィールド機器であるデバイス31および32と、を含む。また、PLC10には、接続ケーブル50を介して、サポート装置60が接続される。制御システム2において、生産設備内の入力機器及び出力機器の制御を司る、1つ以上のPLC10と、PLC10により動作が制御される機器とは、フィールドネットワーク20等の制御系のネットワークに接続される。PLC10と機器とは、その制御系のネットワークを介してサイクリックに通信を行なうことで、INデータ及びOUTデータ(以下、「IOデータ」という)の送受信を行ない、生産設備を制御する。
 PLC10は、制御システム2において、機械および設備などの制御対象を制御する制御装置であり、制御システム2における、フィールドネットワーク20を介したデータ伝送を管理するマスタ装置である。PLC10は、主たる演算処理を実行するCPUユニット100と、電源ユニット101と、1つ以上のIOユニット(図2の例では、IOユニット102~104)と、特殊ユニット105と、を含む。CPUユニット100と、IOユニット102~104の各々と、特殊ユニット105とは、PLCシステムバス106を介して、互いにデータを遣り取りできるように構成される。
 CPUユニット100は、制御対象の状態等に係る種々の処理を実行し、例えば、「出力データの送信と、入力データの受信と、入力データを使用して出力データを生成する制御プログラムの実行とを繰り返すことによって制御対象を制御する」処理を実行する。CPUユニット100の詳細については、図1を参照して後述する。
 電源ユニット101は、CPUユニット100、IOユニット102~104、および、特殊ユニット105に、適切な電圧の電源を供給する。
 IOユニット102~104は、各々、一般的な入出力処理に関するユニットであり、オン/オフといったデータ(つまり、2値化されたデータ)の入出力を司る。具体的には、IOユニット102~104の各々は、センサなどの入力機器であるデバイス31が何らかの対象物を検出している状態(オン)、および、何らの対象物も検出していない状態(オフ)のいずれであるかという情報を収集する。また、IOユニット102~104の各々は、リレー、アクチュエータといった出力機器であるデバイス32に対して、活性化するための指令(オン)、および、不活性化するための指令(オフ)のいずれかを出力する。
 特殊ユニット105は、IOユニット102~104が処理するデータとは異なるデータ(例えば、アナログデータ)の入出力、温度制御、特定の通信方式による通信といった、IOユニット102~104ではサポートしない機能を有する。
 デバイス31および32は、各々、PLC10によって制御される入出力機器である。入力機器であるデバイス31は、例えば、温度センサ、光センサなどの「検出器」、「スイッチ(押ボタンスイッチ、リミットスイッチ、圧力スイッチなど)」などである。出力機器であるデバイス32は、例えば、「アクチュエータ」、「リレー」、「電磁弁」、「表示器」、「表示灯」などである。
 フィールドネットワーク20は、CPUユニット100とフィールド機器(サーボドライバ33および34、およびリモートIOターミナル35)との間で遣り取りされる各種データを伝送する。フィールドネットワーク20としては、典型的には、各種の産業用イーサネット(登録商標)を用いることができる。産業用イーサネット(登録商標)としては、たとえば、EtherCAT(登録商標)、Profinet IRT、MECHATROLINK(登録商標)-III、Powerlink、SERCOS(登録商標)-III、CIP Motionなどが知られており、これらのうちのいずれを採用してもよい。さらに、産業用イーサネット(登録商標)以外のフィールドネットワークを用いてもよい。たとえば、モーション制御を行わない場合であれば、DeviceNet、CompoNet/IP(登録商標)などを用いてもよい。制御システム2では、典型的に、産業用イーサネット(登録商標)であるEtherCAT(登録商標)をフィールドネットワーク20として採用する場合の構成について例示する。
 なおPLC10は、CPUユニット100にIOユニット102~104の各々の機能およびサーボドライバ33および34の機能を持たせることにより、そのような内蔵機能でまかなえる範囲については、CPUユニット100が直接制御対象を制御してもよい。
 サーボドライバ33および34の各々は、フィールドネットワーク20を介してCPUユニット100と接続されるとともに、CPUユニット100からの指令値に従ってサーボモータ41および42の各々を駆動する。
 より具体的には、サーボドライバ33および34の各々は、PLC10から一定の時間間隔で繰り返し(つまり、周期的に)、位置指令値、速度指令値、トルク指令値といった指令値を受ける。また、サーボドライバ33および34の各々は、サーボモータ41および42の各々に接続されている各種検出器(デバイス31)から、サーボモータ41および42の各々の動作に係る各種検出値(実測値)を取得する。例えば、サーボモータ41および42の各々の軸に接続されている位置センサ(ロータリーエンコーダ)およびトルクセンサ等の検出器から、位置、速度、トルクといったサーボモータ41および42の各々の動作に係る実測値を取得する。速度に係る実測値は、今回位置と前回位置との差から算出されてもよい。
 そして、サーボドライバ33および34の各々は、CPUユニット100からの指令値を目標値に設定し、実測値をフィードバック値として、フィードバック制御を行う。すなわち、サーボドライバ33および34の各々は、実測値が目標値に近づくようにサーボモータ41および42の各々を駆動するための電流を調整する。なお、サーボドライバ33および34の各々は、サーボモータアンプと称されることもある。
 なお、図2には、サーボモータ41および42の各々とサーボドライバ33および34の各々とを組み合わせたシステム例を示すが、その他の構成、たとえば、パルスモータとパルスモータドライバとを組み合わせたシステムを採用することもできる。
 リモートIOターミナル35は、基本的には、IOユニット102~104と同様に、一般的な入出力処理に関する処理を行う。より具体的には、リモートIOターミナル35は、フィールドネットワーク20でのデータ伝送に係る処理を行うための通信カプラ36と、1つ以上のIOユニット(図2の例では、IOユニット37および38)とを含む。通信カプラ36と、IOユニット37および38の各々とは、リモートIOターミナルバス39を介して、データを互いに遣り取りできるように構成される。
 サポート装置60は、PLC10に接続可能な情報処理装置である。サポート装置60は、例えばUSB(Universal Serial Bus)ケーブルである接続ケーブル50を介して、PLC10に接続され、PLC10との間で各種パラメータの設定、プログラミング、モニタ、デバッグなどの処理を実行する。
 サポート装置60で実行される各種プログラムは、CD-ROM61に格納されて流通してもよい。CD-ROM61に格納されたプログラムは、サポート装置60のCD-ROM(Compact Disk-Read Only Memory)ドライブによって読取られ、サポート装置60のハードディスク(HDD)等へ格納されてもよい。あるいは、サポート装置60は、上位のホストコンピュータ等からネットワークを通じて、サポート装置60で実行されるプログラムをダウンロードしてもよい。
 サポート装置60は、例えば、パーソナルコンピュータであり、PLC10において実行されるユーザプログラムの作成・編集処理を実行する。また、サポート装置60は、ユーザプログラムをPLC10からダウンロードする処理を実行するとともに、ユーザプログラムをPLC10にアップロードする処理を実行する。
 ユーザは、サポート装置60を用いて、PLC10(特に、CPUユニット100)におけるプログラムの実行単位であるタスクを設定することができる。PLC10(特に、CPUユニット100の制御部130)は、タスクを実行することにより制御対象を制御するように構成されており、タスクには、制御対象を制御するためのユーザプログラム等の実行が含まれている。ユーザプログラムは、制御対象機器を制御するための制御プログラムの一つである。ユーザは、サポート装置60を用いて、タスクの実行周期および実行タイミング、タスクで実行するプログラム、タスクで実行する入出力のリフレッシュ、タスク間で共有する変数等(グローバル変数等)に係る各種設定を定義することができる。サポート装置60は、ユーザにより定義された上述の各種設定を、PLC10に通知する(アップロードする)。
 (情報システムの概要)
 情報システム3は、PLC10と、クライアント装置80と、を含んでいる。PLC10とクライアント装置80とは、任意の通信ケーブル70によって接続されており、例えば、EtherIP(登録商標)により通信接続されていてもよい。PLC10とクライアント装置80とは、通信ケーブル70を介して互いにデータを送受信することができる。例えば、両者のデータ交換は、産業向けのデータ交換に用いる通信プロトコルであるOPCUA(OPC Unified Architecture)に準拠して行われる。OPCUAは、メーカおよびプラットフォームから独立した、安全で信頼性の高い、産業用の機器間通信のプロトコルである。OPCUAは、従来のOPC(Object Linking and Embedding for Process Control)を、汎用化・広範囲にしたアーキテクチャである。
 PLC10は、情報システム3において、OPCUAをサポートしており、OPCUAサーバ機能(OPCUAクライアントとの接続機能)を備えている。具体的には、PLC10は、OPCUAクライアントとしてのクライアント装置80とOPCUA規格に基づいた接続を行ない、クライアント装置80からのサービス要求(例えば、データ読み取り要求)に対し、そのサービスを実行し応答を行う。
 クライアント装置80は、管理システム1(情報システム3)において、OPCUAをサポートしており、OPCUAサーバとしてのPLC10に対し、サービス要求(例えば、データ読出要求)を発行する。クライアント装置80には、SCADA(Supervisory Control And Data Acquisition)ソフトがインストールされていてもよい。また、クライアント装置80は、MES(Manufacturing Execution System、製造実行システム)を実現するための装置であってもよい。
 PLC10(特に、CPUユニット100)は、接続方式の汎用性とセキュリティリスク対応とを同時に実現したOPCUA通信をサポートしている。そのため、PLC10は、SCADA、MES等のOPCUA対応の上位システムとしてのクライアント装置80からの製造進捗情報収集への要求に対し、セキュアに応答を出力することができる。また、PLC10は、クライアント装置80からの製造指示などを、セキュアに受信することができる。一方、OPCUAクライアントであるクライアント装置80は、OPCUAサーバとしてのPLC10(特に、CPUユニット100)に通信ケーブル70を介して接続し、OPCUA通信を使用して、CPUユニット100内の変数を読み書きすることができる。
 具体的には、クライアント装置80は、「PLC10によるタスクの実行中における、複数の変数(例えば、変数A~C)の各々の値を一括して問い合わせる」要求を、例えばOPCUA規格に準拠した接続方式で、PLC10に出力する。PLC10は、上記の要求を受信すると、この要求において指定されている複数の変数(例えば、変数A~C)の各々の値を、制御処理の実行中に、読み出した値の間の同期が確保されるように読み出す。そして、PLC10は、読み出した複数の変数の各々の値を一括して、例えばOPCUA規格に準拠した接続方式で、クライアント装置80に出力する。クライアント装置80は、PLC10が制御処理に用いている複数の変数の各々の値を、特に、制御処理の実行により値が更新された後の複数の変数の各々の値を、一括して取得することができる。
 これまで、図2を用いて、PLC10を含む管理システム1の全体概要を説明してきた。次に、図3を参照して、PLC10におけるCPUユニット100のハードウェア構成について説明する。
 (CPUユニットのハードウェア構成)
 図3は、本実施の形態に係るCPUユニット100のハードウェア構成の一例を示す図である。CPUユニット100は、プロセッサ151と、チップセット152と、不揮発性メモリ153と、メインメモリ154と、クロック155と、上位通信コントローラ156と、PLCシステムバスコントローラ157と、フィールドバスコントローラ158と、USBコネクタ161と、上位通信コネクタ162と、PLCシステムバスコネクタ163と、メモリカードインターフェイス164と、フィールドバスコネクタ165と、を含む。チップセット152と他のコンポーネントとの間は、各種のバスを介してそれぞれ結合されている。
 プロセッサ151およびチップセット152は、典型的には、汎用的なコンピュータアーキテクチャに準じて構成される。すなわち、プロセッサ151は、チップセット152から内部クロックに従って順次供給される命令コードを解釈して実行する。
 チップセット152は、接続されている各種コンポーネントとの間で内部的なデータを遣り取りするとともに、プロセッサ151に必要な命令コードを生成する。さらに、チップセット152は、プロセッサ151での演算処理の実行の結果得られたデータなどをキャッシュする機能を有する。
 CPUユニット100は、記憶手段として、メインメモリ154および不揮発性メモリ153を備えている。メインメモリ154は、揮発性の記憶領域(RAM)であり、CPUユニット100へ電源投入後にプロセッサ151で実行されるべき各種プログラムを保持する。また、メインメモリ154は、プロセッサ151による各種プログラムの実行時の作業用メモリとしても使用される。このようなメインメモリ154として、例えば、DRAM(Dynamic Random Access Memory)、SRAM(Static Random Access Memory)等を用いることができる。
 一方、不揮発性メモリ153は、IO(入出力)制御などのシステムプログラム、ユーザプログラム、モーション演算プログラム、各種のアプリケーション、およびシステム設定パラメータといったデータを不揮発的に保持する。これらのプログラムおよびデータは、必要に応じて、プロセッサ151がアクセスできるようにメインメモリ154にコピーされる。このような不揮発性メモリ153は、フラッシュメモリのような半導体メモリを用いることができる。あるいは、ハードディスクドライブのような磁気記録媒体、DVD-RAM(Digital Versatile Disk Random Access Memory)のような光学記録媒体などを用いることもできる。
 クロック155は、予め定められた周期のシステムクロックを発生してプロセッサ151に提供し、具体的には、一定の時間間隔(周期)ごとに割り込み信号を発生してプロセッサ151に提供する。クロック155は、典型的には、ハードウェアの仕様によって、複数の異なる時間間隔でそれぞれ割り込み信号を発生するように構成される。ただし、クロック155は、OS(Operating System)、BIOS(Basic Input Output System)等によって、任意の時間間隔で割り込み信号を発生するように設定することもできる。クロック155が発生する割り込み信号を利用して、後述するような実行周期ごとの制御動作が実現される。
 CPUユニット100は、通信手段として、上位通信コントローラ156、PLCシステムバスコントローラ157、および、フィールドバスコントローラ158を有する。上位通信コントローラ156、PLCシステムバスコントローラ157、および、フィールドバスコントローラ158は、各々、不図示のバッファメモリ(送受信バッファメモリ)と、通信制御回路と、DMA(Dynamic Memory Access)制御回路と、を含んでいる。これらの通信手段は、CPUユニット100以外のユニットおよびPLC10以外の装置へ出力データを送信し、また、CPUユニット100以外のユニットおよびPLC10以外の装置からの入力データを受信する。さらに、これらの通信手段は、メインメモリ154との間でデータの送受信を実行する。
 上位通信コントローラ156、PLCシステムバスコントローラ157、および、フィールドバスコントローラ158の各々において、DMA制御回路は、メインメモリ154から、各々のバッファメモリへの出力データの転送を行なう。また、DMA制御回路は、各々のバッファメモリからメインメモリ154への入力データの転送を行う。上位通信コントローラ156、PLCシステムバスコントローラ157、および、フィールドバスコントローラ158の各々において、バッファメモリは、以下の2つの機能を実現する。すなわち、バッファメモリは、PLC10以外の装置、および、CPUユニット100以外のユニットへ出力されるデータ(出力データ)の送信バッファとしての機能を実現する。また、バッファメモリは、PLC10以外の装置、および、CPUユニット100以外のユニットから入力されるデータ(入力データ)の受信バッファとしての機能を実現する。
 上位通信コントローラ156は、上位通信コネクタ162を介して通信ケーブル70と接続され、例えば、OPCUAクライアントとしてのクライアント装置80とOPCUA規格に基づいた接続を行なう。具体的には、上位通信コントローラ156は、クライアント装置80からのサービス要求(例えば、データ読出要求)を受信し、そのサービスの実行結果をクライアント装置80に送信する(クライアント装置80に応答を行う)。
 PLCシステムバスコントローラ157は、PLCシステムバスコネクタ163を介してPLCシステムバス106と接続され、PLCシステムバス106を介したデータの遣り取りを制御する。PLCシステムバスコントローラ157は、例えば、PLCシステムバス106における物理層およびデータリンク層の機能を提供する。すなわち、PLCシステムバスコントローラ157は、PLCシステムバス106に接続されるCPUユニット100以外のユニットと、CPUユニット100との間の送受信を制御する。
 PLCシステムバスコントローラ157は、自らのバッファメモリに格納されているデータ(出力データ)を、IOユニット102~104および特殊ユニット105の各々に、PLCシステムバス106を介して送信する。また、PLCシステムバスコントローラ157は、PLCシステムバス106を介して、IOユニット102~104および特殊ユニット105の各々から入力されるデータ(入力データ)を受信して、自らのバッファメモリに格納する。
 フィールドバスコントローラ158は、フィールドバスコネクタ165を介してフィールドネットワーク20と接続され、フィールドネットワーク20を介したデータの遣り取りを制御する。フィールドバスコントローラ158は、例えば、フィールドネットワーク20における物理層およびデータリンク層の機能を提供する。すなわち、フィールドバスコントローラ158は、用いられるフィールドネットワーク20の規格に従い、出力データの送信および入力データの受信を制御する。具体的には、フィールドバスコントローラ158は、フィールドネットワーク20に接続されるフィールド機器との間で、自らのバッファメモリの出力データを送信し、また、入力データを受信して自らのバッファメモリに格納する。
 USBコネクタ161は、サポート装置60とCPUユニット100とを接続するためのインターフェイスであり、接続ケーブル50が接続される。例えば、サポート装置60から転送される実行可能なプログラム等は、接続ケーブル50を介して、CPUユニット100に取込まれる。メモリカードインターフェイス164は、CPUユニット100に対して着脱可能なメモリカード90とプロセッサ151とを接続する。
 これまで、図3を用いて、CPUユニット100のハードウェア構成を説明してきた。次に、図1を参照して、CPUユニット100を備えるPLC10の構成および処理の内容等を、図1等を用いて説明していく。図1を参照して詳細を説明する前に、PLC10についての理解を容易にするため、その概要について以下のように整理しておく。
 (制御装置の機能構成の概要について)
 PLC10(制御装置)は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置であって、各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部(例えば、クライアント装置80)から受け付けるOPCUA入力部111(受付部)と、OPCUA入力部111が前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの(例えば、タスクTp)、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出部112と、読出部112が読み出した前記複数の変数の各々の値を外部に出力するOPCUA出力部113(出力部)と、を備えている。
 前記の構成によれば、PLC10は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する。また、PLC10は、前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す。そして、PLC10は、読み出した前記複数の変数の各々の値を外部に出力する。
 したがって、PLC10は、複数のタスクを並行して周期的に実行することができ、かつ、タスク実行中に複数の変数の各々の更新後の値を一括して問い合わせる要求を外部から受け付けると、複数の変数の各々の更新後の値であって、同期させた値を応答することができるとの効果を奏する。
 ここで、前記複数の変数の各々の更新後の値の読出完了時点が、2つ以上の「前記周期の間隔が最も小さいタスクの周期」(以下、「基本周期」と呼ぶ)にまたがっている場合、読み出された複数の値の間で同期が確保されない。すなわち、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の間隔以上である場合、読み出された複数の値の間で同期が確保されない。
 このことは、例えば、「前記基本周期に対応し、変数Aの値を更新する」タスクTpと、「前記基本周期と異なる周期に対応し、変数Aとは異なる変数Cの値を更新する」タスクTsと、が並行して周期的に実行される場合を想定すると、明確となる。
 つまり、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の間隔以上である場合、前記時間間隔において1回以上、タスクTpが実行されることになる。そのため、ユーザは、(1)変数Aの値と、(2)「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、を取得することになる。したがって、読み出された変数Aの値と変数Cの値との間の同期は確保されておらず、ユーザは、同期する「複数の変数の各々の更新後の値」の間の関係を把握することができない。言い換えれば、ユーザは、並行して周期的に実行されるタスクTpおよびTsの各々において略同時に更新された変数Aおよび変数Cの各々の更新後の値を、把握することができない。前述の例では、ユーザが取得するのは、(1)変数Aの値と、(2)「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、である。
 これに対して、PLC10は、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期内に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。すなわち、PLC10は、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、前記複数の変数の各々の更新後の値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 上述の例に即して言えば、PLC10は、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、変数Aおよび変数Cの各々の更新後の値を読み出す。PLC10が変数Aの更新後の値の読出を完了した時点から、変数Cの更新後の値の読出を完了した時点までの間に、タスクTpもタスクTsも実行されないように、PLC10は変数AおよびCの各々の更新後の値を読み出す。
 したがって、PLC10により、ユーザは、並行して実行される複数のタスクの各々において略同時に更新された複数の変数の各々の更新後の値を把握することができ、つまり、同期性の確保された複数の変数の各々の更新後の値を把握することができる。言い換えれば、PLC10に対して、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、PLC10が応答する複数の変数の各々の更新後の値の間の同期が実現されている。
 上述の例に即して言えば、PLC10により、ユーザは、タスクTpにおいて更新された変数Aの更新後の値と、変数Aが更新された時点と略同時にタスクTsにおいて更新された変数Cの更新後の値と、を把握することができる。つまり、PLC10により、ユーザは、変数Aおよび変数Cの各々について、「同期性が確保された、更新後の値」を把握することができる。
 ここで、PLC10の読出部112は、前記複数のタスクの各々の周期が揃う時点から、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間を差し引いた時点までに、前記複数の変数の各々の値の読出を開始する。
 前記の構成によれば、PLC10は、前記複数のタスクの各々の周期が揃う時点から、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間を差し引いた時点までに、前記複数の変数の各々の値の読出を開始する。
 つまり、PLC10は、前記複数のタスクの各々の周期が揃う時点についての情報と、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間についての情報と、を用いて、前記複数の変数の各々の更新後の値を読み出す。言い換えれば、PLC10は、前記複数の変数の各々の更新後の値を読み出すために、「前記複数の変数の各々の値が、前記複数のタスクのうちのいずれのタスクにおいて更新されるか」を把握する必要が無い。
 したがって、PLC10は、「前記複数の変数の各々の値が、前記複数のタスクのうちのいずれのタスクにおいて更新されるか」を把握する場合に比べて実現の容易な処理によって、前記複数の変数の各々の更新後の値を読み出すことができるとの効果を奏する。
 PLC10は、OPCUAサーバ機能を備え、OPCUA入力部111は、クライアント装置80(OPCUAクライアント装置)から、OPCUA規格に準拠した接続方式で前記要求を受け付け、OPCUA出力部113は、クライアント装置80に、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力する。
 前記の構成によれば、PLC10は、OPCUAサーバ機能を備え、クライアント装置80から、OPCUA規格に準拠した接続方式で前記要求を受け付け、クライアント装置80に、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力する。
 したがって、PLC10は、メーカおよびプラットフォームから独立した、安全で信頼性の高い、産業用の機器間通信のプロトコルであるOPCUA規格に準拠した接続方式で前記要求を受け付け、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力することができるとの効果を奏する。
 PLC10について、前記複数のタスクは、基準のタスク(例えば、タスクTp)と、基準のタスク以外のタスク(例えば、タスクTs)とを含み、前記基準のタスク以外のタスクの周期は、前記基準のタスクの周期の整数倍に設定されていてもよい。
 前記の構成によれば、PLC10において、前記複数のタスクは、基準のタスクと、基準のタスク以外のタスクとを含み、前記基準のタスク以外のタスクの周期は、前記基準のタスクの周期の整数倍に設定されている。
 したがって、PLC10は、前記複数のタスクを同期させやすくすることができ、つまり、前記複数のタスクの各々の周期を揃えやすくすることができるとの効果を奏する。
 これまでに概要を整理してきたPLC10について、次に、PLC10の構成等の詳細について、特に、CPUユニット100の構成等の詳細について、図1等を用いて説明していく。
 (制御装置の機能構成の詳細)
 図1は、本発明の実施形態1に係るCPUユニット100の要部構成を示すブロック図である。図1に示すように、CPUユニット100は、機能ブロックとして、OPCUAサーバ部110、記憶部120、および、制御部130を備えている。CPUユニット100は、制御対象機器を制御する制御処理の実行主体である。制御部130は、プログラムを含むタスクを実行し、特に、複数のタスク(例えば、タスクTpおよびTs)を並行に実行し、かつ、複数のタスクの各々を、各タスクに応じた周期で、実行する。記憶部120は、プログラムにおいて参照および更新することが可能な変数を記憶する。OPCUAサーバ部110は、制御部130によりプログラムを含むタスクが実行されているときに、記憶部120の変数テーブル122に格納されている変数を収集する等、クライアント装置80と通信し、クライアント装置80から要求された処理を実行する。
 なお、記載の簡潔性を担保するため、本実施の形態に直接関係のない構成は、説明およびブロック図から省略している。ただし、実施の実情に則して、CPUユニット100は、当該省略された構成を備えてもよい。図1に例示したOPCUAサーバ部110および制御部130は、例えば、図3に例示したプロセッサ151(CPU、central processing unit)等が、ROM(read only memory)、NVRAM(non-Volatile random access memory)等で実現された不揮発性メモリ153(記憶部120)に記憶されているプログラムを、RAM等により実現されるメインメモリ154に読み出して実行することで実現できる。以下、CPUユニット100における各機能ブロックについて説明する。
  (記憶部以外の機能ブロックの詳細(1)-OPCUAサーバ機能)
 OPCUAサーバ部110は、情報システム3(特に、クライアント装置80)と制御システム2(特に、PLC10)との間の通信を実現し、例えば、PLC10を「OPCUAサーバ」として動作させるOPCUAサーバ機能を実現する。具体的には、OPCUAサーバ部110は、クライアント装置80からのOPCUAのサービス要求を受け取り、受け取ったサービス要求に従ってOPCUAのサービス処理を実行し、実行結果を示す応答を、要求元のクライアント装置80に出力する。
 本実施の形態において、クライアント装置80からPLC10に実行を要求するOPCUAのサービス(処理)は、例えば「Subscription」と呼ばれる処理である。「Subscription」とは、「PLC10(特に、制御部130)が実行する制御処理に関するデータ(特に、制御処理において使用される変数の値、具体的には、制御処理において値が更新される変数の値)を、読み出す」処理である。なお、以下の説明においては、「変数の値を更新する」処理を「Write」と称し、「変数の値を読み出す」処理を「Read」と称することがある。
 クライアント装置80がPLC10に実行を要求する「Subscription」は、例えば「複数の変数の各々の値を一括して、読み出す(つまり、Readする)」ものであってもよい。以下の説明においては、クライアント装置80がPLC10に実行を要求する、「変数A~Cの各々の値を一括して読み出す」Subscriputionを、「SubX」と略記することがある。
 図1に例示するOPCUAサーバ部110は、機能ブロックとして、OPCUA入力部111、読出部112、OPCUA出力部113、読出期間算出部114、および、読出時点決定部115を含んでいる。OPCUAサーバ部110のOPCUA入力部111は、本発明の「受付部」の一例であり、読出部112は、本発明の「読出部」の一例であり、OPCUA出力部113は、本発明の「出力部」の一例である。
 クライアント装置80とCPUユニット100との情報のやり取りはOPCUA入力部111およびOPCUA出力部113を介して行なわれる。すなわち、OPCUA入力部111およびOPCUA出力部113は、OPCUAクライアント機能を有するクライアント装置80とOPCUA規格に基づいて接続して通信を行なう機能ブロックである。
 OPCUA入力部111は、通信ケーブル70を経由してクライアント装置80から所定の処理の実行要求を受け取り、受け取った実行要求に対応する所定の処理の実行を読出部112に指示する。OPCUA入力部111は、例えば、クライアント装置80からのOPCUAのサービス要求(OPCUAの要求メッセージ)を受け取り、受け取ったサービス要求に対応する処理の実行を読出部112に指示する。本実施の形態において、OPCUAのサービス要求は、例えば、PLC10(特に、CPUユニット100)の制御処理の実行時に使用される変数(特に、制御機能の実行時に値が更新される変数)に対する読出等のシステム内データへのアクセスを伴う要求である。具体的には、OPCUA入力部111は、クライアント装置80から、SubXの実行要求(要求メッセージ)を、つまり、「変数A~Cの各々の値を一括して読み出す(Readする)」処理の実行要求を受け付ける。
 OPCUA出力部113は、OPCUA入力部111がクライアント装置80から受け取った所定の処理の実行要求(サービス要求)に対応する処理の実行結果を、その実行要求への応答として、通信ケーブル70を経由してクライアント装置80に送信する。具体的には、OPCUA出力部113は、OPCUA入力部111が読出部112に指示した処理の実行結果を読出部112から取得し、取得した実行結果をクライアント装置80に送信する。OPCUA出力部113は、読出部112から取得した実行結果を、例えばOPCUA規格に準拠した接続方式で、クライアント装置80に送信する。
 OPCUA入力部111がクライアント装置80からSubXの要求メッセージを受け付けると、OPCUA出力部113は、SubXの実行結果をクライアント装置80に送信する。すなわち、OPCUA出力部113は、読出部112が読み出した「制御部130による制御処理の実行中における、変数A~Cの各々の値」を、一括してクライアント装置80に送信する。
 読出部112、読出期間算出部114、および、読出時点決定部115は、OPCUA入力部111がクライアント装置80から受け取った「所定の処理の実行要求」に対応する処理を実行し、例えばOPCUAのサービス処理(ここでは、SubX)を実行する。すなわち、読出部112、読出期間算出部114、および、読出時点決定部115によって、「制御部130による制御処理の実行中における、変数A~Cの各々の値」の読出(Read)が実行される。
 読出部112は、変数の値の読み出しに係るOPCUAサービスの実行手段であり、読出時点決定部115から通知された読出時点で、各タスクにおいて値が更新される変数の値(特に、更新後の値)を収集し、つまり、変数の値を読み出す。特に、読出部112は、制御部130(特に、演算部131)によりタスクが実行されているときに、読出時点決定部115から通知された読出時点で、各タスクにおいて値が更新された変数の値を読み出し、つまり、Readする。具体的には、読出部112は、読出時点決定部115から指示された読出時点で記憶部120の変数テーブル122を参照して、変数A~Cの各々の値を読み出す。言い換えれば、読出部112は、読出時点決定部115から指示された読出時点で、記憶部120の変数テーブル122を参照し、変数A~Cの各々の値の読出処理を開始する。
 読出期間算出部114は、「読出部112が変数テーブル122を参照して所望の変数(例えば、変数A~C)の値の読出処理を実行する」のに要する時間(期間)である予想読出期間を算出する。読出期間算出部114は、例えば、読出部112が値を読み出す各変数のデータ型(具体的には、Byte、Int、Long等)に基づいて、予想読出期間を算出してもよい。また、読出期間算出部114は、例えば、読出部112が値を読み出す変数の数(具体的には、読出部112が値を読み出す変数が変数A~Cであれば、「3」)に基づいて、予想読出期間を算出してもよい。さらに、読出期間算出部114は、例えば、読出部112が値を読み出す各変数のデータ型と、読出部112が値を読み出す変数の数と、に基づいて、予想読出期間を算出してもよい。
 例えば、読出期間算出部114は、「読出部112が変数テーブル122を参照して変数A~Cの各々の値を読み出すのに要する時間Ya、Yb、およびYc」の和を、読出部112がSubXの実行に要する時間として算出する。「読出部112がSubXの実行に要する時間」を「予想読出期間Y」μs(「μs」は単位)とすると、読出期間算出部114は、「予想読出期間Y=Ya+Yb+Yc」として、予想読出期間Yを算出する。読出期間算出部114は、算出した予想読出期間Yμsを、読出時点決定部115に通知する。
 読出時点決定部115は、読出部112が実行する読出処理の開始時点である読出時点を決定し、決定した読出時点を読出部112に通知する。読出時点決定部115は、制御部130による制御処理の実行中において、以下の条件が満たされるように、読出部112が実行する読出処理の開始時点である読出時点を決定する。
 すなわち、読出時点決定部115は、読出処理の対象である複数の変数の内の或る1つの変数Pの値の読出完了時点から、変数Pとは異なる変数Qの値の読出完了時点までに、変数PまたはQの値が更新されないように、変数PおよびQの各々の読出時点を決定する。言い換えれば、読出時点決定部115は、変数Pの値の読出完了時点から、変数Qの値の読出完了時点までに、変数PまたはQの値を更新するタスク(特に、プログラム)が実行されないように、変数PおよびQの各々の読出時点を決定する。
 具体的には、制御部130が複数のタスクを、タスクごとの周期で繰り返し並行して実行する場合、読出時点決定部115は、以下のように、変数PおよびQの各々の読出時点を決定する。すなわち、変数Pの値の読出完了時点から、変数Qの値の読出完了時点までの時間間隔が、それら複数のタスクのうち周期の間隔が最も小さいタスクの周期(上述までの例では「1ms」)よりも小さくなるように、変数PおよびQの各々の読出時点を決定する。
 特に、制御部130が、時分割により複数のタスクを、タスクごとの周期で繰り返し並行して実行する場合、読出時点決定部115は、以下のように、変数PおよびQの各々の読出時点を決定する。すなわち、変数Pの値の読出完了時点から、変数Qの値の読出完了時点までの時間間隔が、それら複数のタスクのうち優先度が最も高いタスクの周期(上述までの例では「1ms」)よりも小さくなるように、変数PおよびQの各々の読出時点を決定する。
 具体的には、読出時点決定部115は、読出部112が実行するSubX(「制御部130による制御処理の実行中における、変数A~Cの各々の値」の読出(Read))について、その実行開始時点である読出時点を、以下のように決定する。すなわち、読出時点決定部115は、読出部112が変数A~Cの各々の値の読出を完了する時点が全て、タスクTpの1つの周期の開始時点から終了時点までの間に含まれるように、読出時点を決定する。つまり、読出時点決定部115は、変数A~Cの値の読出完了時点が全て、制御部130により実行される複数のタスクのうち周期の間隔が最も小さいタスクであるタスクTpの1つの周期の開始時点から終了時点までの間に含まれるように、読出時点を決定する。
 ここで特に、読出時点決定部115は、読出期間算出部114から通知された予想読出期間Yμsを用いて、読出時点を決定する。具体的には、読出時点決定部115は、制御部130により実行される複数のタスクの各々の周期が揃う時点から、変数A~Cの各々の値を全て読み出すのに要する期間として予想された予想読出期間Yμsを差し引いた時点を、読出時点に決定する。例えば、読出時点決定部115は、タスクTpおよびTsの各々の周期が揃う時点である「t=2ms」から、予想読出期間Yμsを差し引いた時点を、読出時点に決定する。詳細は図4を用いて後述するが、「制御部130により実行される複数のタスクの各々の周期が揃う時点から、予想読出期間Yμsを差し引いた時点」で読出部112が変数A~Cの各々の値を読み出すことにより、読み出された値の間の同期が保証される。
  (記憶部以外の機能ブロックの詳細(2)-制御機能)
 制御部130は、機械および設備などの制御対象を制御する制御処理の実行主体であり、出力データの送信と、入力データの受信と、入力データを使用して出力データを生成する制御プログラムの実行とを繰り返すことによって制御対象を制御する。制御部130は、「入力データを使用して出力データを生成する制御プログラムを実行する演算部131」と、「出力データの送信と、入力データの受信と、を実行するフィールド通信部132」と、を含む。制御部130は、OPCUAサーバ機能を備えていない従来までのCPUユニット(PLC)の制御部(機械および設備などの制御対象を制御する制御処理の実行主体)と同様である。
 演算部131は、フィールド通信部132の取得した入力データを使用して制御プログラム等の各種プログラムを実行して出力データを生成し、生成した出力データをフィールド通信部132に出力する。演算部131は、「各種プログラムの実行」として、具体的には、複数のタスクを並行に実行するとともに、各タスクを各タスクに応じた周期で実行する。演算部131は、例えば、時分割により複数のタスクを並行して実行するとともに、各タスクを各タスクに応じた周期で実行する。すなわち、演算部131は、マルチタスクで処理を実行する。なお、タスクには、各タスクに応じたユーザプログラム等の制御プログラムの実行が含まれている。
 演算部131は、例えば、時分割によりタスクTpおよびTsを並行に実行する。また、演算部131は、タスクTpを1msの周期で実行し、タスクTsを2msの周期で実行する。さらに、演算部131は、タスクTpおよびTsのいずれとも異なるタスクTtを4msの周期で実行してもよい。
 なお、演算部131が実行するタスクには、定期的に繰り返し実行されるタスク(周期的に実行されるタスク、具体的には、タスクTpおよびTs)に加えて、予め設定された実行条件が成立した場合に実行されるタスクが含まれてもよい。予め設定された実行条件が成立した場合に実行されるタスクは、例えば「イベントタスク」と呼ばれ、具体的には、タスクTeがイベントタスクであってもよい。
 フィールド通信部132は、PLCシステムバス106およびフィールドネットワーク20の少なくとも一方を介して、各種のフィールド機器(例えば、デバイス31、デバイス32、サーボドライバ33、およびサーボドライバ34等)との間でデータを遣り取りする。これらのフィールド機器は、制御対象に対して何らかの処理を行うためのアクチュエータ、制御対象から各種情報を取得するためのセンサなどを含む。
 フィールド通信部132は、例えば、入力機器であるデバイス31から入力データを取得し、出力機器であるデバイス32、サーボドライバ33、およびサーボドライバ34等に出力データを出力する。
  (記憶部の詳細)
 記憶部120は、CPUユニット100が使用する各種データを格納する記憶装置である。記憶部120は、CPUユニット100が実行する(1)制御プログラム、(2)OSプログラム、(3)CPUユニット100が有する各種機能を実行するためのアプリケーションプログラム、および、(4)該アプリケーションプログラムを実行するときに読み出す各種データを非一時的に記憶してもよい。記憶部120はさらに、プログラムテーブル121、変数テーブル122、およびタスクテーブル123を格納している。
 プログラムテーブル121は、制御部130(特に、演算部131)によって実行される各種プログラムである。なお、OPCUAサーバ部110によって実行されるプログラムは、プログラムテーブル121とは別に、例えばアプリケーションプログラム(OPCUAサーバ機能を実現するアプリケーションプログラム)として、記憶部120に格納されていてもよい。
 制御部130(特に、演算部131)によって実行される各種プログラムであるプログラムテーブル121は、リアルタイムOSと、システムプログラムと、ユーザプログラムとの3階層になっていてもよい。
 リアルタイムOSは、CPUユニット100のコンピュータアーキテクチャに応じて設計されており、プロセッサ151がシステムプログラムおよびユーザプログラムを実行するための基本的な実行環境を提供する。このリアルタイムOSは、典型的には、PLCのメーカあるいは専門のソフトウェア会社などによって提供される。
 システムプログラムは、PLC10(特に、CPUユニット100)としての機能を提供するためのソフトウェア群である。具体的には、システムプログラムは、スケジューラプログラムと、出力処理プログラムと、入力処理プログラムと、シーケンス命令演算プログラムと、モーション演算プログラムと、その他のシステムプログラムとを含む。出力処理プログラムは、CPUユニット100による演算結果を出力ユニットとしてのIOユニット102~104に出力する処理を実行するためのプログラムを含む。入力処理プログラムは、入力ユニットとしてのIOユニット102~104に入力された信号をCPUユニット100に取り込む処理を実行するためのプログラムを含む。なお、一般には出力処理プログラムおよび入力処理プログラムは、連続的(一体として)に実行されるので、出力処理プログラムおよび入力処理プログラムは、IO処理プログラムと総称してもよい。
 ユーザプログラムは、ユーザにおける制御目的に応じて作成され、言い換えれば、制御システム2を用いて制御する対象のライン(プロセス)などに応じて、任意に設計されるプログラムである。ユーザプログラムは、CPUユニット100に接続されるサポート装置60により編集可能に構成されており、例えば、ラダー言語、SFC言語、ストラクチャードテキスト等で記述され、複数の言語が混在していてもよい。
 ユーザプログラムは、シーケンス命令演算プログラムおよびモーション演算プログラムと協働して、ユーザにおける制御目的を実現する。すなわち、ユーザプログラムは、シーケンス命令演算プログラムおよびモーション演算プログラムによって提供される命令、関数、機能モジュールなどを利用することで、プログラムされた動作を実現する。そのため、ユーザプログラム、シーケンス命令演算プログラム、およびモーション演算プログラムは、制御プログラムと総称する場合もある。
 変数テーブル122は、プログラム(特に、ユーザプログラム等の制御プログラム)によって使用される変数であり、つまり、変数テーブル122における各変数の値は、ユーザプログラム等の制御プログラムの実行に際して更新される(つまり、Writeされる)。
 タスクテーブル123は、タスクに関する情報であり、例えば、各タスクの名称と、各タスクの優先度と、各タスクが実行される周期(制御サイクル)と、各タスクで実行されるユーザプログラム等のプログラムの構成と、が含まれている。また、CPUユニット100では、予め設定された時間間隔(たとえば、1ms)の制御サイクルを処理全体の共通サイクルとして採用していてもよい。この共通サイクルは「基準の周期」と称されることがあり、制御サイクル(つまり周期)が「基準の周期」であるタスクは「基準のタスク」と称されることがある。
 PLC10(CPUユニット100)の演算部131は、プログラムテーブル121における種々のプログラムを「タスク」という実行単位で実行する。すなわち、PLC10において、ユーザプログラム等の制御プログラムは、タスク毎に割り当てられて実行される。例えば、ユーザプログラムの全体は、複数のユーザプログラムから構成され、各ユーザプログラムは、複数のタスクの各々に割り当てられる。また、PLC10において、タスクは、周期的に実行される周期実行型タスクと、何らかのイベントが発生したときに実行されるイベント実行型タスクとに大別される。
 演算部131が「タスク」において実行可能な処理・プログラムであるプログラムテーブル121は、前述の通り、「IO処理プログラム」、「制御プログラム」、および、「それ以外の処理・プログラム」を含む。
 ユーザは、サポート装置60を用いて、プログラムの実行単位であるタスクを設定することができる。具体的には、タスクの実行周期および実行タイミング、タスクで実行するプログラム(例えば、制御プログラム)、タスク内でのIO制御の実行要否等を設定・定義することができる。ユーザは、サポート装置60を用いて、1タスクあたり、例えば最大128のプログラムを割り当てることができてもよい。タスクの設定は、サポート装置60から例えば接続ケーブル50を介してCPUユニット100へ転送され、不揮発性メモリ153などにより実現された記憶部120の、タスクテーブル123に格納される。
 ここで、ユーザは、サポート装置60を用いて、複数のタスクの間に優先順位を設定することができる。具体的には、ユーザは、サポート装置60を用いて、優先順位が互いに異なる「プライマリ定周期タスクであるタスクTp」と、「定周期タスクであるタスクTs」と、「イベントタスクであるタスクTe」という3種類のタスクを設定できてもよい。タスク処理について、優先度が高いタスクのユーザプログラムと、そのタスクより優先度が低いタスクのユーザプログラムとを同時期に実行した場合の重なった時間において、PLC10の演算部131は以下の処理を実行してもよい。すなわち、演算部131は、優先度の低いタスクに割り当てられているプログラムの実行を中断し、優先度の高いタスクに割り当てられているプログラムを実行する割込制御を行なってもよい。
 プライマリ定周期タスクと、定周期タスクとは共に周期実行型タスクであり、プライマリ定周期タスクの優先度は、定周期タスクの優先度よりも高い。言い換えれば、プライマリ定周期タスクの優先度の値は、定周期タスクの優先度の値よりも小さい。なお、演算部131は、複数のタスクのうち、優先度の値が小さいタスクを優先的に実行してもよい。
 タスクTpは、例えば、「IO制御、ユーザプログラム、モーション演算プログラム(、および、システムサービス)」を主な処理内容(実行内容)としてもよい。タスクTsは、例えば、「IO制御、ユーザプログラム(、および、システムサービス)」を主な処理内容としてもよい。タスクTeは、例えば、「ユーザプログラム(、および、システムサービス)」を主な処理内容としてもよい。PLC10の演算部131は、タスクTpを最優先で実行し、タスクTsとタスクTeとの間の優先関係はユーザが指定できてもよい。さらに、周期的に実行される周期実行型タスクは、タスクTpおよびタスクTsの2つに限られるわけではない。3つ以上の周期実行型タスク(例えば、タスクTp、Ts、および、Tt)の間に実行順位に係る優先度が設定されてもよく、各周期実行型タスクについて周期(実行周期)が設定されてもよい。
 これまでに構成を説明してきたPLC10(特に、CPUユニット100)について、次にその処理(動作)の概要を、図4を用いて説明していく。
 §3.動作例
 (制御装置が実行する処理の概要)
 図4は、PLC10(特に、CPUユニット100)が実行する処理の概要を示す図である。図4を参照しながら、PLC10の実行するマルチタスク処理について、先ず説明する。
  (マルチタスクについて)
 CPUユニット100(特に、演算部131)は、時分割により複数のタスク(図4に示す例では、タスクTpおよびTs)を並行して、各タスクの周期で繰り返し、実行する。すなわち、CPUユニット100は、マルチタスクで処理を実行し、CPUユニット100が実行する各タスクの周期は異なる。
 図4の例では、タスクTpは、タスクTsよりも優先的に実行されるとともに、例えば1msの周期で実行される。すなわち、タスクTpは、1回分の制御サイクル(1msの時間間隔)を実行サイクルとしている。また、タスクTpは、ユーザプログラム等のプログラムPpを含んでおり、つまり、ユーザプログラム等のプログラムPpがタスクTpに割り当てられている。なお、タスクTpは、本発明の「基準のタスク」の一例である。
 また、タスクTsは、タスクTpよりも劣後して実行されるとともに、例えば2msの周期で実行され、すなわち、2回分の制御サイクル(2msの時間間隔)を実行サイクルとしている。また、タスクTsの周期は、タスクTpの周期の整数倍(例えば、2倍)に設定されている。また、タスクTsは、ユーザプログラム等のプログラムPsを含んでおり、つまり、ユーザプログラム等のプログラムPsがタスクTsに割り当てられている。なお、タスクTsは、本発明の「基準のタスク以外のタスク」の一例である。
 さらに、CPUユニット100(特に、演算部131)は、タスクTpおよびTsよりも劣後するタスクTtを、4msの周期で実行してもよい。すなわち、CPUユニット100は、タスクTtを、4回分の制御サイクル(4msの時間間隔)を実行サイクルとして、実行してもよい。ここで、タスクTtの周期は、タスクTpの周期の整数倍(例えば、4倍)に設定されていてもよい。また、タスクTtは、プログラム(ユーザプログラム等)を含んでいてもよい。なお、タスクTtは、本発明の「基準のタスク以外のタスク」の一例である。
 ここで、タスクTsおよびTtの周期を、タスクTpの周期の整数倍にすることによって、タスクTp、TsおよびTtを同期させやすくすることができる。「タスクTp、TsおよびTtが同期する」とは、「タスクTp、TsおよびTtの周期(実行サイクル)が同時に開始される(開始時点が同じになる)」こと、または「タスクTp、TsおよびTtの周期が同時に終了する(終了時点が同じになる)」ことをいう。
  (図中の表現について)
 図4において、一点鎖線で示されているのは、プライマリ定周期タスクであるタスクTpの周期であり、特に、タスクTpの周期の開始時点であり、終了時点である。また、二点鎖線で示されているのは定周期タスクであるタスクTsの周期であり、特に、タスクTsの周期の開始時点であり、終了時点である。図4において、縦縞で示している領域は、プライマリ定周期タスクであるタスクTpにおいて実行されるプログラムPpが、つまり、タスクTpに割り当てられているプログラムPpが、実行されている期間を示している。また、横縞で示している領域は、定周期タスクであるタスクTsにおいて実行されるプログラムPsが、つまり、タスクTsに割り当てられているプログラムPsが、実行されている期間を示している。さらに、互いに交差する2つ以上の斜線で示している領域は、「変数A~CをまとめてReadする(Subscription:SubX)」が実行される期間を示している。
 図4に示す例では、タスクTpは1msの周期で実行され、タスクTsは2msの周期で実行される。図4においては、制御部130(特に、演算部131)による制御処理の開始時点(t=0)から、タスクTpの1回目の周期(開始時点:t=0から、終了時点:t=1msまでの間)に実行されるプログラムPpを特に「プログラムPp1」と表現している。同様に、タスクTpの2回目の周期(開始時点:t=1msから、終了時点:t=2msまでの間)に実行されるプログラムPpを「プログラムPp2」と、3回目の周期に実行されるプログラムPpを「プログラムPp3」と表現している。すなわち、「n」を自然数として、タスクTpのn回目の周期(開始時点:t=「n-1」msから、終了時点:t=「n」msまでの間)に実行されるプログラムPpを「プログラムPpn」と表現している。
 また、制御部130による制御処理の開始時点(t=0)から、タスクTsの1回目の周期(開始時点:t=0から、終了時点:t=2msまでの間)に実行されるプログラムPsを特に「プログラムPs1」と表現している。同様に、タスクTsの2回目の周期(開始時点:t=2msから、終了時点:t=4msまでの間)に実行されるプログラムPsを「プログラムPs2」と、3回目の周期に実行されるプログラムPsを「プログラムPs3」と表現している。すなわち、「n」を自然数として、タスクTsのn回目の周期(開始時点:t=「2×(n-1)」msから、終了時点:t=「2×n」msまでの間)に実行されるプログラムPsを「プログラムPsn」と表現している。
  (変数の読出処理の概要について)
 以下、図4に示した管理システム1において実行される処理の概要について説明する。
 第1に、クライアント装置80は、「変数A~CをまとめてReadする(Subscription:SubX)」とのサービス要求をPLC10に出力する。PLC10は、クライアント装置80からのこのサービス要求(SubX)を受け付ける(Step1)。
 第2に、PLC10のOPCUA入力部111がサービス要求:SubXを受信すると、PLC10の読出期間算出部114は、SubXの実行時間、つまり、「変数A~Cの読出に要する時間」である読出期間(Proc:Yμs)を算出する(Step2)。
 読出時点決定部115は、読出期間算出部114から通知された予想読出期間Yμsを用いて、読出時点を決定する。すなわち、PLC10の読出時点決定部115は、「タスクTpおよびTsの周期が揃うタイミング(時点)から、予想読出期間Yμs前の時点」を、読出時点に決定する。
 図4に示す例では、タスクTpは1msの周期で実行され、タスクTsは2msの周期で実行されるため、「制御部130の制御処理の実行中に、『タスクTpおよびTsの周期が揃う時点』」は、例えば、「t=2ms、4ms、6ms、・・・」である。つまり、図4に示す例では、制御部130により実行されている複数のタスクの実行サイクル(周期)が揃う時点(複数のタスクが同期する時点)は、例えば、「t=2ms、4ms、6ms、・・・」である。
 したがって、図4に示す例で、読出時点決定部115は、「t=2msから、予想読出期間Yμs前の時点」、つまり「2msからYμsを差し引いた時点(t=2ms-Yμsである時点)」を、読出時点に決定する。読出時点決定部115は、決定した読出時点を読出部112に指示する。
 第3に、読出部112は、読出時点決定部115から指示された読出時点、つまり、「t=2msから、予想読出期間Yμs前の時点」で、記憶部120の変数テーブル122を参照して、変数A~Cの各々の値を読み出す(Readする)。すなわち、PLC10のOPCUAサーバ部110は、複数のタスクの周期が揃うタイミングからYμs前に割込みを入れ、SubXを実行する(Step3)。
 第4に、PLC10のOPCUA出力部113は、読出部112が読み出した「変数A~Cの各々の値」を一括してクライアント装置80に送信する。すなわち、PLC10のOPCUAサーバ部110は、SubXの実行結果(Read結果)を、クライアント装置80に返す(Step4)。
 以上に概要を説明してきたPLC10の実行する処理は、次のように整理することができる。すなわち、PLC10の実行する制御方法は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置の制御方法であって、各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付ステップ(Step1)と、前記受付ステップにて前記要求が受け付けられると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出ステップ(Step3)と、前記読出ステップにて読み出された前記複数の変数の各々の値を外部に出力する出力ステップ(Step4)と、を含んでいる。
 前記の方法によれば、前記制御方法は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する。また、前記制御方法は、前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 したがって、前記制御方法は、複数のタスクを並行して周期的に実行することができ、かつ、タスク実行中に複数の変数の各々の更新後の値を一括して問い合わせる要求を外部から受け付けると、複数の変数の各々の更新後の値であって、同期させた値を応答することができるとの効果を奏する。
 ここで、前記複数の変数の各々の更新後の値の読出完了時点が、2つ以上の基本周期にまたがっている場合、読み出された複数の値の間で同期が確保されない。すなわち、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の間隔以上である場合、読み出された複数の値の間で同期が確保されない。
 このことは、例えば、「前記基本周期に対応し、変数Aの値を更新する」タスクTpと、「前記基本周期と異なる周期に対応し、変数Aとは異なる変数Cの値を更新する」タスクTsと、が並行して周期的に実行される場合を想定すると、明確となる。
 つまり、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の間隔以上である場合、前記時間間隔において1回以上、タスクTpが実行されることになる。そのため、ユーザは、変数Aの値と、「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、を取得することになる。したがって、読み出された変数Aの値と変数Cの値との間の同期は確保されておらず、ユーザは、同期する「複数の変数の各々の更新後の値」の間の関係を把握することができない。言い換えれば、ユーザは、並行して周期的に実行されるタスクTpおよびTsの各々において略同時に更新された変数Aおよび変数Cの各々の更新後の値を、把握することができない。前述の例では、ユーザが取得するのは、変数Aの値と、「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、である。
 これに対して、前記制御方法は、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期内に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。すなわち、前記制御方法は、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、前記複数の変数の各々の更新後の値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 上述の例に即して言えば、前記制御方法は、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、変数Aおよび変数Cの各々の更新後の値を読み出す。前記制御方法が変数Aの更新後の値の読出を完了した時点から、変数Cの更新後の値の読出を完了した時点までの間に、タスクTpもタスクTsも実行されないように、前記制御方法は変数AおよびCの各々の更新後の値を読み出す。
 したがって、前記制御方法により、ユーザは、並行して実行される複数のタスクの各々において略同時に更新された複数の変数の各々の更新後の値を把握することができ、つまり、同期性の確保された複数の変数の各々の更新後の値を把握することができる。言い換えれば、PLC10に対して、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、前記制御方法によって、応答における複数の変数の各々の更新後の値の間の同期が実現されている。
 上述の例に即して言えば、前記制御方法により、ユーザは、タスクTpにおいて更新された変数Aの更新後の値と、変数Aが更新された時点と略同時にタスクTsにおいて更新された変数Cの更新後の値と、を把握することができる。つまり、前記制御方法により、ユーザは、変数Aおよび変数Cの各々について、「同期性が確保された、更新後の値」を把握することができる。
  (変数の読出処理の詳細について)
 以下、さらに詳細に図4について説明していく。図4において、制御部130(特に、演算部131)により、t=0の時点で、つまり、制御処理の開始時点で、タスクTpおよびTsの実行サイクル(つまり、周期)が同時に開始される。
 具体的には、t=0の時点で先ず、演算部131により、タスクTsよりも優先度の高いタスクTpの処理が開始される。このとき、タスクTsは、タスクTpよりも優先度が低いことから、実際の処理が開始されることなく待機状態となる。
 そして、演算部131は、タスクTpのユーザプログラムを含むプログラムPp(特に、Pp1)を実行し、タスクTpの処理を完了すると、演算部131は、タスクTpの次に優先度が高いタスクTsの処理を開始する。つまり、演算部131は、タスクTsのユーザプログラムを含むプログラムPs(特に、Ps1)を実行する。ここで、図4に示す例では、演算部131は、タスクTpおよびTsの実行サイクルが同時に開始されてから1ms経過するまでに、つまり、t=1msまでに、タスクTsの処理を完了している。
 次に、タスクTpおよびTsの実行サイクルが同時に開始されてから1ms経過すると(t=1ms)、タスクTpの実行サイクルが経過することから、演算部131により、タスクTpの実行が開始される。すなわち、「t=1ms」の時点から、タスクTpのプログラムPp(特に、Pp2)が実行され、タスクTpの処理が完了する。
 前述の通り、読出時点決定部115は、「タスクTpおよびTsの周期が揃うタイミング(時点)から、予想読出期間Yμs前の時点」を、読出時点に決定する。図4に示す例では、読出時点決定部115は、「タスクTpおよびTsの周期が揃う『t=2ms』の時点から、予想読出期間Yμs前の時点」を読出時点に決定し、読出部112は、この読出時点で、変数A~Cの各々の値をReadする。
 したがって、読出部112は、タスクTpにおいて更新された変数AおよびBの各々の更新後の値(特に、プログラムPp1の実行により更新された変数AおよびBの各々の更新後の値)を読み出す。また、読出部112は、タスクTsにおいて更新された変数Cの更新後の値(特に、プログラムPs1の実行により更新された変数Cの更新後の値)を読み出す。特に、読出部112は、変数A~Cの各々の値を、変数A~Cの各々の値を更新するプログラムの実行完了時点から、変数A~Cの各々の値を更新するプログラムを含むタスクの次の開始時点までに、読み出す。具体的には、読出部112は、変数A~Cの各々の値を、変数A~Cの各々の値を更新するプログラムPpおよびPsの各々の実行完了時点から、プログラムPpおよびPsの各々を含むタスクTpおよびTsの各々の次の開始時点までに、読み出す。
 ここで、読出部112が変数AおよびBの各々の値の読出を完了してから、変数Cの値の読出を完了するまでの間に、変数A~Cのいずれも、タスクTpまたはTsにより値が更新されていない。つまり、読出部112は、変数A~Cの各々の、同期している更新後の値を、読み出す。
 〔実施形態2〕
 本発明の他の実施形態について、以下に説明する。なお、説明の便宜上、上記実施形態にて説明した部材と同じ機能を有する部材については、同じ符号を付記し、その説明を省略する。
 図5は、本発明の実施形態2に係るPLC11のCPUユニット200の要部構成等を示すブロック図である。本実施形態におけるCPUユニット200は、上述の実施形態1におけるCPUユニット100の備える構成に加えて、機能ブロックとして取得部210をさらに備え、また、記憶部220には、変数管理テーブル221が格納されている。CPUユニット200は、取得部210を備え、記憶部220に変数管理テーブル221が格納されている点を除いて、上述のCPUユニット100と同様の構成であるため、以下では、取得部210および変数管理テーブル221について、重点的に説明を行なう。
 (制御装置の概要)
 先ず、PLC11についての理解を容易にするため、その概要について以下のように整理しておく。すなわち、PLC11は、「読出対象の複数の変数(例えば、変数A~C)について、各変数の値がどのタスクにおいて更新されるのか」に係る情報(つまり、対応情報)を用いて、それら複数の変数の各々の更新後の値を読み出す時点を決定する。
 より詳細には、PLC11は、前記変数と、前記変数の値を更新する前記タスクと、を対応付けた対応情報を取得する取得部210をさらに備え、読出部112は、取得部210の取得した前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出す。
 前記の構成によれば、PLC11は、前記変数と、前記変数の値を更新する前記タスクと、を対応付けた対応情報を取得し、取得した前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出す。
 したがって、PLC11は、前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出すことができるとの効果を奏する。
 PLC11について、前記対応情報において、前記複数の変数のうちの或る変数(例えば、変数C)に対し、前記或る変数の値を更新する前記タスクが2つ以上対応付けられている場合、読出部112は、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点の直前に、前記或る変数の値の読出を完了してもよい。
 前記の構成によれば、PLC11は、前記対応情報において、前記複数の変数のうちの或る変数に対し、前記或る変数の値を更新する前記タスクが2つ以上対応付けられている場合、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点の直前に、前記或る変数の値の読出を完了する。
 ここで、前記或る変数について、前記或る変数の値を更新する2つ以上の前記タスクのうち、前記周期の間隔が最も小さいタスクにおいて、前記或る変数の更新後の値を読み出した場合、以下の事態が発生する。すなわち、読み出した値は、「前記周期の間隔が最も小さいタスク」が再実行される前に、「前記周期の間隔が最も小さいタスク」以外のタスクにおいて、さらに値が更新されることになる。
 これに対し、PLC11は、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点までに、前記或る変数の値を読み出す。したがって、PLC11は、前記或る変数の、或るタスクにおいて更新された後の値を読み出した後、前記或るタスクが再実行される前に、「前記或るタスク」以外のタスクにおいて、前記或る変数の値が更新されるという事態を防ぐことができるとの効果を奏する。
 (制御装置の詳細)
 取得部210は、サポート装置60等から、複数の変数の各々と、各変数の値を更新するタスクと、を対応付けた対応情報を取得し、取得した対応情報を記憶部220の変数管理テーブル221に格納する。
 例えば、サポート装置60は、ユーザにより作成された制御プログラムをコンパイル・ビルドして実行ファイルを作成する際に、対応情報を生成し、生成した対応情報を、取得部210に出力する。サポート装置60は、ユーザプログラム等の制御プログラムによって値が更新される変数について、複数の変数の各々の値が、どの制御プログラムによって更新され、その制御プログラムがどのタスクに割り当てられているのかを把握して、対応情報を生成する。
 読出時点決定部115は、変数管理テーブル221に格納されている対応情報を用いて、「読出部112が、変数A~Cの各々の更新後の値を読み出す時点」を、変数A~Cの各々の値を更新するタスクTpおよびTsの各々の周期内に決定する。読出時点決定部115は、決定した「変数A~Cの各々の更新後の値の読出時点」を読出部112に通知する。
 読出部112は、読出時点決定部115から通知された「変数A~Cの各々の更新後の値の読出時点」で、変数A~Cの各々の更新後の値を読み出す。
 図6は、CPUユニット200の記憶部220に格納される変数管理テーブル221のデータ構造を示す図である。変数管理テーブル221には、取得部210によって対応情報が格納され、例えば、取得部210がサポート装置60から取得した対応情報が格納される。対応情報は、変数テーブル122に格納されている複数の変数の各々について、各変数の値を更新するタスクを示す情報である。例えば、対応情報は、「変数A、B、C(ユーザ変数A、B、C)の各々が、どのタスクにおいて実行されるユーザプログラムでWriteされているか(つまり、どのタスクにおいて値が更新されるか)についての情報」である。対応情報は、変数テーブル122に格納されている複数の変数の各々について、さらに、各変数のデータ型を示してもよい。
 図6の(A)に例示される対応情報は、「変数Aがプライマリ定周期タスクであるタスクTpにおいて更新される」ことを示し、さらに、「変数Aのデータ型は『Int』である」ことを示している。また、図6の(A)に例示される対応情報は、「変数Bがプライマリ定周期タスクであるタスクTpにおいて更新される」ことを示し、さらに、「変数Bのデータ型は『Int』である」ことを示している。さらに、図6の(A)に例示される対応情報は、「変数Cが定周期タスクであるタスクTsにおいて更新される」ことを示し、さらに、「変数Cのデータ型は『Long』である」ことを示している。
 ここで、或る変数の値を更新するタスクが或る1つのタスクであるとは限られない。或る変数の値を、複数のタスクが更新することもあり得る。
 例えば、図6の(B)に例示される対応情報は、変数AおよびBについては、図6の(A)に例示される対応情報と同様の内容を示しているが、変数Cが複数のタスクにおいて更新される(変数Cの値は2つ以上のタスクにおいて更新される)ことを示している。すなわち、図6の(B)に例示される対応情報は、「変数Cが、『プライマリ定周期タスクであるタスクTp』および『定周期タスクであるタスクTs』において更新される」ことを示し、さらに、「変数Cのデータ型は『Long』である」ことを示している。
 なお、対応情報は、複数のタスクにおいて値が更新される変数について、その変数に対応するタスク(タスク名)を「Unknown」としてもよい。図6の(C)に例示される対応情報は、変数Cに対応するタスク(タスク名)を「Unknown」としているが、これは、変数Cの値が複数のタスクにおいて更新されることを示している。
 取得部210は、本発明の「取得部」の一例であり、変数管理テーブル221に格納される対応情報は、本発明の「対応情報」の一例である。
 (制御装置の実行する処理について)
  (1.各変数の値が、1つのタスクにおいて更新される場合)
 図7は、PLC11(特に、CPUユニット200)が実行する処理の概要を示す図である。図7に示す例において、PLC11(CPUユニット200)の記憶部220に格納される変数管理テーブル221には、図6の(A)に例示される対応情報が格納されている。すなわち、図7に示す例において、変数AおよびBは、プライマリ定周期タスクであるタスクTpにおいて更新され、変数Cは、定周期タスクであるタスクTsにおいて更新される。
  (図中の表現について)
 図7における表現について、図4と同様であるものについては、説明を省略する。図7において、紙面左上から右下へと延びる斜線で示している領域は、プライマリ定周期タスクであるタスクTpにおいて実行されるプログラムPpにより値が更新される変数AおよびBのReadが実行される期間を示している。紙面右上から左下へと延びる斜線で示している領域は、定周期タスクであるタスクTsにおいて実行されるプログラムPsにより値が更新される変数CのReadが実行される期間を示している。
 図7において、タスクTpは、タスクTsよりも優先的に実行されるとともに、例えば1msの周期で実行される。また、タスクTsは、タスクTpよりも劣後して実行されるとともに、例えば2msの周期で実行される。
  (変数の読出処理の概要について)
 以下、図7において例示しているPLC11が実行する処理の概要について説明する。
 第1に、サポート装置60は、タスクと変数との対応情報をPLC11に通知する。前述の通り、図7に示す例において、サポート装置60は、「変数AおよびBは、プライマリ定周期タスクであるタスクTpにおいて更新され、変数Cは、定周期タスクであるタスクTsにおいて更新される」との対応情報をPLC11に通知する。取得部210は、この対応情報を、記憶部220の変数管理テーブル221に格納する。
 第2に、クライアント装置80は、「変数A~CをまとめてReadする(Subscription:SubX)」とのサービス要求をPLC10に出力する。
 第3に、PLC11のOPCUA入力部111がサービス要求:SubXを受信すると、PLC11は、変数管理テーブル221に格納されている対応情報に基づいて、変数A~Cの各々がWriteされるタスクにおいて、変数A~Cの各々をReadする。
 具体的には、読出時点決定部115は、「読出部112が、変数A~Cの各々をReadする」時点を、以下のように決定する。
 (1)タスクTpにおいて値が更新される変数AおよびBについて、読出時点決定部115は、「読出部112が、変数AおよびBの各々をReadする」時点を、以下のように決定する。すなわち、読出時点決定部115は、「読出部112が、変数AおよびBの各々をReadする」時点を、タスクTpの周期内であって、プログラムPpの実行が完了した後の時点に、決定する。言い換えれば、読出時点決定部115は、変数AおよびBの各々の更新後の値を読み出す時点を、タスクTpの周期内の時点に、決定する。
 (2)タスクTsにおいて値が更新される変数Cについて、読出時点決定部115は、「読出部112が、変数CをReadする」時点を、以下のように決定する。すなわち、読出時点決定部115は、「読出部112が、変数CをReadする」時点を、タスクTsの周期内であって、プログラムPsの実行が完了した後の時点に、決定する。言い換えれば、読出時点決定部115は、変数Cの更新後の値を読み出す時点を、タスクTsの周期内の時点に、決定する。
 ここで、読出時点決定部115は、変数A~Cの値の読出完了時点が全て、制御部130により実行される複数のタスクのうち周期の間隔が最も小さいタスクであるタスクTpの1つの周期の開始時点から終了時点までの間に含まれるように、読出時点を決定する。例えば、読出時点決定部115は、変数AおよびBの各々の更新後の値の読出完了時点から、変数Cの更新後の値の読出完了時点までの間に、変数AおよびBの少なくとも一方の値が更新されることがないように、変数A~Cの各々の読出時点を決定する。言い換えれば、読出時点決定部115は、変数A~Cの各々の更新後の値について、読み出された変数A~Cの各々の更新後の値の間の同期が確保されるように、各々の更新後の値の読出時点を決定する。
 図7において、読出時点決定部115は、変数A~Cの各々の更新後の値の読出時点について、以下のように決定している。すなわち、図7において、制御部130(特に、演算部131)により、t=0の時点で、つまり、制御処理の開始時点で、タスクTpおよびTsの実行サイクル(つまり、周期)が同時に開始される。具体的には、t=0の時点で先ず、演算部131により、タスクTsよりも優先度の高いタスクTpの処理が開始される。このとき、タスクTsは、タスクTpよりも優先度が低いことから、実際の処理が開始されることなく待機状態となる。そして、演算部131は、タスクTpのユーザプログラムを含むプログラムPp(特に、Pp1)を実行し、タスクTpの処理を完了すると、演算部131は、タスクTpの次に優先度が高いタスクTsの処理を開始する。つまり、演算部131は、タスクTsのユーザプログラムを含むプログラムPs(特に、Ps1)を実行する。ここで、図7に示す例では、演算部131は、タスクTpおよびTsの実行サイクルが同時に開始されてから1ms経過するまでに、つまり、t=1msまでに、タスクTsの処理を完了している。
 読出時点決定部115は、タスクTsにおいて値が更新される変数Cの読出時点について、タスクTsの周期内(つまり、T=0ms~2ms)であって、プログラムPs(例えば、プログラムPs1)の実行が完了した後の時点に、決定する。読出部112は、読出時点決定部115によって決定された読出時点で、記憶部120の変数テーブル122を参照して、変数Cの値の読出(Read)を開始する(図7において、紙面右上から左下へと延びる斜線で示している領域の開始)。
 ここで、読出部112が変数Cを読み出している途中に、「t=1ms」の時点に達すると、タスクTpの実行サイクルが経過することから、「t=1ms」の時点から、演算部131により、タスクTpの実行が開始される。すなわち、「t=1ms」の時点において、読出部112による変数Cの読出(Read)が中断され、演算部131によってタスクTpのプログラムPp(特に、Pp2)の実行が開始され、演算部131によってタスクTpの処理が完了する。すなわち、読出部112が変数Cを読み出している途中に、「t=1ms」の時点に達すると、読出部112による変数Cの読出(Read)が完了する時点は、早くとも「t=1ms~2ms」の間となる。
 読出時点決定部115は、変数AおよびBの各々の値の読出完了時点と、変数Cの読出完了時点との間が、「タスクTpの1周期分(つまり、1ms)」よりも小さくなるように、変数AおよびBの各々の値の読出時点を決定する。具体的には、読出時点決定部115は、タスクTpにおいて値が更新される変数AおよびBの各々の値の読出時点について、タスクTpの周期内(図7に示す例では「t=1ms~2ms」)であって、プログラムPs2の実行が完了した後の時点に、決定する。すなわち、図7の「紙面左上から右下へと延びる斜線で示している領域」において、読出部112は、変数AおよびBの更新後の値を読み出す。
 なお、読出部112による変数Cの読出が中断されてから、読出部112による変数Cの読出が再開されるまでの間には、変数Cの値を更新するタスクTs(特に、プログラムPs)は実行されない。したがって、読出部112による変数Cの読出中に、タスクTs(特に、プログラムPs)によって変数Cの値が更新されることはない。
 以上に示した通り、図7において、読出部112は、(1)変数AおよびBの各々の「プログラムPp2によって更新された後の値」を読み出し、また、(2)変数Cの「プログラムPs1によって更新された後の値」を読み出す。変数AおよびBの各々の値の読出完了時点と、変数Cの読出完了時点との間は、「タスクTpの1周期分」よりも小さいため、この間にタスクTpが実行されることはなく、つまり、読み出された変数A~Cの各々の更新後の値の間の同期が確保される。
 第4に、PLC11のOPCUA出力部113は、読出部112が読み出した「変数A~Cの各々の値」を一括してクライアント装置80に送信する。すなわち、PLC11のOPCUAサーバ部110は、SubXの実行結果(Read結果)を、クライアント装置80に返す。
 図7に示す例では、変数Cの読出完了時点が「t=1ms~2ms」の間であるため、変数AおよびBの各々の値の読出時点は、タスクTpの周期内(具体的には、「t=1ms~2ms」)であって、プログラムPs2の実行が完了した後の時点となる。「t=1ms」の時点までに変数Cの読出が完了する場合、変数AおよびBの各々の値の読出時点は、タスクTpの周期内(具体的には、「t=0ms~1ms」)であって、プログラムPs1の実行が完了した後の時点となる。
 すなわち、読出時点決定部115は、読出処理の対象である複数の変数の内の或る1つの変数Pの値の読出完了時点から、変数Pとは異なる変数Qの値の読出完了時点までに、変数PまたはQの値が更新されないように、変数PおよびQの各々の読出時点を決定する。言い換えれば、読出時点決定部115は、変数Pの値の読出完了時点から、変数Qの値の読出完了時点までに、変数PまたはQの値を更新するタスク(特に、プログラム)が実行されないように、変数PおよびQの各々の読出時点を決定する。
  (変数の読出処理の詳細について)
 図8は、図7に示した処理について、その詳細を説明する図である。
 サポート装置60は、予め、タスクと変数との対応情報をPLC11に通知しておく(S1)。具体的には、サポート装置60は、ユーザプログラム等の制御プログラムのビルド時に、「変数A~Cの各々が、どのタスクにおいて実行される制御プログラムでWriteされているか(値が更新されるか)」をSearch(検索)する(S11)。サポート装置60は、対応情報を生成し、例えば、ユーザ変数管理テーブルに「変数A~Cの各々がWriteされるタスク」の情報を、変数A~Cの各々と対応付けて格納する(S12)。サポート装置60は、対応情報(例えば、変数管理テーブル)を含む、各種の設定情報をPLC11にダウンロードし、つまり、PLC11に出力する(S13)。
 次に、クライアント装置80は、「変数A~CをまとめてReadしたい(Subscription:SubX)」とのサービス要求をPLC11に出力する(S2)。具体的には、クライアント装置80は、SubXの実行要求をPLC11に出力する(S14)。
 PLC11のOPCUA入力部111がサービス要求:SubXを受信すると、読出部112は、S1によりサポート装置60から取得した対応情報に基づいて、各変数がWriteされるタスク内で変数A~Cの各々の値をReadする(S3)。
 具体的には、読出時点決定部115は、変数A~Cの各々がWriteされるタスクを変数管理テーブル221から導き出す(S15)。すなわち、読出時点決定部115は、変数管理テーブル221に格納されている対応情報に基づいて、変数A~Cの各々がWriteされるタスクを取得し、言い換えれば、変数A~Cの各々の値がどのタスクにおいて更新されるのかを把握する。
 OPCUAサーバ部110は、変数管理テーブル221を参照して、変数A~Cの各々がWriteされるタスク内でSubXを実行し、つまり、変数A~Cの各々がWriteされるタスク内で変数A~Cの各々をReadする(S16)。すなわち、先ず、読出時点決定部115が、変数管理テーブル221に格納されている対応情報を用いて、「読出部112が、変数A~Cの各々の更新後の値を読み出す時点」を、変数A~Cの各々の値を更新するタスクTpおよびTsの各々の周期内に決定する。そして、読出部112は、読出時点決定部115が決定した「変数A~Cの各々の更新後の値の読出時点」で、変数A~Cの各々の更新後の値を読み出す。読出時点決定部115による「変数A~Cの各々の更新後の値の読出時点」の決定方法については、既に図7を用いて説明したので、詳細は略記する。
 最後に、PLC11のOPCUA出力部113は、クライアント装置80に、SubXの実行結果を返す(S4)。具体的には、OPCUA出力部113は、変数A~Cの各々のRead結果をクライアント装置80に出力する(S17)。
  (2.各変数の値が、2つ以上のタスクにおいて更新される場合)
 図9は、PLC11(特に、CPUユニット200)が実行する処理について、或る1つの変数の値を更新するタスクが複数ある場合の処理の概要を示す図である。図9に示す例において、PLC11(CPUユニット200)の記憶部220に格納される変数管理テーブル221には、図6の(C)に例示される対応情報が格納されている。すなわち、図7に示す例において、(1)変数AおよびBは、プライマリ定周期タスクであるタスクTpにおいて更新され、(2)変数Cは、プライマリ定周期タスクであるタスクTp、および、定周期タスクであるタスクTsにおいて更新される。
  (図中の表現について)
 図9における表現について、図4または図7と同様であるものについては、説明を省略する。図9において、タスクTpは、タスクTsよりも優先的に実行されるとともに、例えば1msの周期で実行される。また、タスクTsは、タスクTpよりも劣後して実行されるとともに、例えば2msの周期で実行される。
  (変数の読出処理の概要について)
 以下、図9において例示しているPLC11が実行する処理の概要について説明する。
 第1に、サポート装置60は、タスクと変数との対応情報をPLC11に通知する。前述の通り、図9に示す例において、サポート装置60は、「変数AおよびBはタスクTpにおいて更新され、変数CはタスクTpおよびTsにおいて更新される」との対応情報をPLC11に通知する。取得部210は、この対応情報を、記憶部220の変数管理テーブル221に格納する。
 第2に、クライアント装置80は、「変数A~CをまとめてReadする(Subscription:SubX)」とのサービス要求をPLC10に出力する。
 第3に、PLC11のOPCUA入力部111がサービス要求:SubXを受信すると、PLC11は、変数管理テーブル221に格納されている対応情報に基づいて、変数A~Cの各々がWriteされるタスクにおいて、変数A~Cの各々をReadする。
 具体的には、読出時点決定部115は、「読出部112が、変数A~Cの各々をReadする」時点を、以下のように決定する。
 (1)タスクTpにおいて値が更新される変数AおよびBについて、読出時点決定部115は、「読出部112が、変数AおよびBの各々をReadする」時点を、以下のように決定する。すなわち、読出時点決定部115は、「読出部112が、変数AおよびBの各々をReadする」時点を、タスクTpの周期内であって、プログラムPpの実行が完了した後の時点に、決定する。言い換えれば、読出時点決定部115は、変数AおよびBの各々の更新後の値を読み出す時点を、タスクTpの周期内の時点に、決定する。
 (2)タスクTpおよびTsにおいて値が更新される変数Cについて、読出時点決定部115は、「読出部112が、変数CをReadする」時点を、以下のように決定する。すなわち、読出時点決定部115は、タスクTpおよびTsの周期が揃うタイミングの直前を、「読出部112が、変数CをReadする」時点に決定する。
 図9に示す例では、タスクTpは1msの周期で実行され、タスクTsは2msの周期で実行されるため、「制御部130の制御処理の実行中に、『タスクTpおよびTsの周期が揃う時点』」は、例えば、「t=2ms、4ms、6ms、・・・」である。つまり、図9に示す例では、制御部130により実行されている複数のタスクの実行サイクル(周期)が揃う時点(複数のタスクが同期する時点)は、例えば、「t=2ms、4ms、6ms、・・・」である。そこで、図9に示す例において読出時点決定部115は、タスクTpおよびTsの周期が揃うタイミングである「t=2ms」の直前を、「読出部112が、変数CをReadする」時点に決定する。
 図9において、制御部130(特に、演算部131)により、t=0の時点で、つまり、制御処理の開始時点で、タスクTpおよびTsの実行サイクル(つまり、周期)が同時に開始される。具体的には、t=0の時点で先ず、演算部131により、タスクTsよりも優先度の高いタスクTpの処理が開始される。このとき、タスクTsは、タスクTpよりも優先度が低いことから、実際の処理が開始されることなく待機状態となる。そして、演算部131は、タスクTpのユーザプログラムを含むプログラムPp(特に、Pp1)を実行し、タスクTpの処理を完了すると、演算部131は、タスクTpの次に優先度が高いタスクTsの処理を開始する。つまり、演算部131は、タスクTsのユーザプログラムを含むプログラムPs(特に、Ps1)を実行する。ここで、図9に示す例では、演算部131は、タスクTpおよびTsの実行サイクルが同時に開始されてから1ms経過するまでに、つまり、t=1msまでに、タスクTsの処理を完了している。
 読出時点決定部115は、タスクTpおよびTsにおいて値が更新される変数Cの読出時点について、タスクTpおよびTsの周期が揃うタイミングである「t=2ms」の直前に、決定する。具体的には、読出時点決定部115は、「読出部112が変数Cの値の読出処理を実行する」のに要する時間である予想読出期間Ycを読出期間算出部114から取得する。そして、読出時点決定部115は、タスクTpおよびTsの各々の周期が揃う時点である「t=2ms」から、予想読出期間Ycを差し引いた時点を、変数Cの値の読出時点に決定する。読出部112は、読出時点決定部115によって決定された読出時点で、記憶部120の変数テーブル122を参照して、変数Cの値の読出(Read)を開始する(図9において、紙面右上から左下へと延びる斜線で示している領域の開始)。
 また、読出時点決定部115は、変数AおよびBの各々の値の読出完了時点と、変数Cの読出完了時点との間が、「タスクTpの1周期分(つまり、1ms)」よりも小さくなるように、変数AおよびBの各々の値の読出時点を決定する。具体的には、読出時点決定部115は、変数AおよびBの各々の値の読出時点について、タスクTpの周期内(図9に示す例では「t=1ms~2ms」)であって、プログラムPs2の実行が完了した後の時点に、決定する。すなわち、図9の「紙面左上から右下へと延びる斜線で示している領域」において、読出部112は、変数AおよびBの更新後の値を読み出す。
 なお、変数Cの値はタスクTpおよびTsにおいて更新されるから、図9において、プログラムPp2の実行によって変数Cの値は更新されている。
 以上に示した通り、図9において、読出部112は、(1)変数AおよびBの各々の「プログラムPp2によって更新された後の値」を読み出し、また、(2)変数Cの「プログラムPp2によって更新された後の値」を読み出す。変数AおよびBの各々の値の読出完了時点と、変数Cの読出完了時点との間は、「タスクTpの1周期分」よりも小さいため、この間にタスクTpが実行されることはなく、つまり、読み出された変数A~Cの各々の更新後の値の間の同期が確保される。
 第4に、PLC11のOPCUA出力部113は、読出部112が読み出した「変数A~Cの各々の値」を一括してクライアント装置80に送信する。すなわち、PLC11のOPCUAサーバ部110は、SubXの実行結果(Read結果)を、クライアント装置80に返す。
 すなわち、読出時点決定部115は、読出処理の対象である複数の変数の内の或る1つの変数Pの値の読出完了時点から、変数Pとは異なる変数Qの値の読出完了時点までに、変数PまたはQの値が更新されないように、変数PおよびQの各々の読出時点を決定する。言い換えれば、読出時点決定部115は、変数Pの値の読出完了時点から、変数Qの値の読出完了時点までに、変数PまたはQの値を更新するタスク(特に、プログラム)が実行されないように、変数PおよびQの各々の読出時点を決定する。
  (変数の読出処理の詳細について)
 図10は、図9に示した処理について、その詳細を説明する図である。
 図8に例示したのと同様に、サポート装置60は、予め、タスクと変数との対応情報をPLC11に通知しておく(S1)。具体的には、サポート装置60は、ユーザプログラム等の制御プログラムのビルド時に、「変数A~Cの各々が、どのタスクにおいて実行される制御プログラムでWriteされているか(値が更新されるか)」をSearch(検索)する(S11)。サポート装置60は、対応情報を生成し、例えば、ユーザ変数管理テーブルに「変数A~Cの各々がWriteされるタスク」の情報を、変数A~Cの各々と対応付けて格納する。ここで、サポート装置60は、複数のタスク(例えば、タスクTpおよびTs)からWriteされる変数(例えば、変数C)には、タスク:Unknownを対応付ける(S12’)。サポート装置60は、対応情報(例えば、変数管理テーブル)を含む、各種の設定情報をPLC11にダウンロードし、つまり、PLC11に出力する(S13)。
 次に、クライアント装置80は、「変数A~CをまとめてReadしたい(Subscription:SubX)」とのサービス要求をPLC11に出力する(S2)。具体的には、クライアント装置80は、SubXの実行要求をPLC11に出力する(S14)。
 PLC11のOPCUA入力部111がサービス要求:SubXを受信すると、読出部112は、S1によりサポート装置60から取得した対応情報に基づいて、各変数がWriteされるタスク内で変数A~Cの各々の値をReadする(S3)。
 具体的には、読出時点決定部115は、変数A~Cの各々がWriteされるタスクを変数管理テーブル221から導き出す(S15)。すなわち、読出時点決定部115は、変数管理テーブル221に格納されている対応情報に基づいて、変数A~Cの各々がWriteされるタスクを取得し、言い換えれば、変数A~Cの各々の値がどのタスクにおいて更新されるのかを把握する。
 OPCUAサーバ部110は、変数管理テーブル221を参照して、変数A~Cの各々がWriteされるタスク内でSubXを実行し、つまり、変数A~Cの各々がWriteされるタスク内で変数A~Cの各々をReadする。ここで、タスク:Unknownが対応付けられている変数Cは、複数のタスクの周期が揃うタイミングでReadする(S16’)。
 すなわち、読出時点決定部115は、変数管理テーブル221に格納されている対応情報を用いて「変数Cの値はタスクTpおよびTsにおいて更新される」ことを把握すると、変数Cの読出時点を、以下のように決定する。読出時点決定部115は、タスクTpおよびTsにおいて値が更新される変数Cの読出時点を、タスクTpおよびTsの周期が揃うタイミング(例えば、「t=2ms」)の直前に、決定する。
 読出部112は、読出時点決定部115が決定した「変数A~Cの各々の更新後の値の読出時点」で、変数A~Cの各々の更新後の値を読み出す。読出時点決定部115による「変数A~Cの各々の更新後の値の読出時点」の決定方法については、既に図9を用いて説明したので、詳細は略記する。
 最後に、PLC11のOPCUA出力部113は、クライアント装置80に、SubXの実行結果を返す(S4)。具体的には、OPCUA出力部113は、変数A~Cの各々のRead結果をクライアント装置80に出力する(S17)。
 §4.変形例
 (制御装置について)
 これまでに説明してきた実施形態においては、本発明に係る制御装置(コントローラ)としてPLC10およびPLC11について説明を行なってきたが、本発明に係る制御装置は、PLCに限られることなく、各種の制御装置へ適用可能である。
 (制御装置の台数について)
 図2に例示する管理システム1おいては、1台のPLC10が、クライアント装置80と、制御システム2内の入力機器および出力機器と、に接続している。しかしながら、管理システム1おいてPLC10が1台であることは必須ではなく、管理システム1は、複数台のPLC10を含んでもよい。管理システム1において、複数のPLC10の各々は、フィールドネットワーク20を介して、相互に通信可能に接続されていてもよい。
 例えば、制御システム2における制御を主体的に担うPLC10と、情報システム3においてクライアント装置80からのサービス要求(例えば、SubXの実行要求)を受け付けるPLC10と、が1台の同じPLC10であることも必須ではない。クライアント装置80からSubXの実行要求を受け付けたPLC10Aが、制御システム2における制御を主体的に担っているPLC10BにSubXを実行させ、PLC10Aが、SubXの実行結果をクライアント装置80に出力してもよい。その場合、PLC10AとPLC10Bとは、例えば、フィールドネットワーク20を介して、相互に通信可能に接続されていてもよい。
 (マルチタスクについて)
 PLC10およびPLC11は、「マルチタスクで処理を実行する」ことができればよく、「時分割により複数のタスクを並行して実行する」だけでなく、「複数のタスクを同時に並行して実行する」ことができてもよい。例えば、プロセッサ151は、シングルコアであり、時分割により複数のタスクを並行して実行してもよく、すなわち、プロセッサ151は、マルチタスクで処理を実行してもよい。また、プロセッサ151は、マルチコアであり、複数のタスクを同時に並行して実行し、すなわち、プロセッサ151は、マルチタスクで処理を実行してもよい。プロセッサ151は、複数のタスクを同時に並行して実行することによって、タスクの処理能力の向上を図ることができる。
 PLC10およびPLC11は、シングルコアを採用し、マルチタスクについて、或るタスクの実行中は他のタスクを実行しない「並行実行」を行なってもよい。また、PLC10およびPLC11は、マルチコアを採用し、マルチタスクについて、或るタスクの実行中に他のタスクを実行する「並列実行」を行なってもよい。PLC10およびPLC11は、マルチタスクについて、並行実行を行なう場合であっても、並列実行を行なう場合であっても、複数の変数の各々の更新後の値であって、各々の値の間の同期が確保された更新後の値を、一括して読み出す。
 〔ソフトウェアによる実現例〕
 PLC10および11(特に、CPUユニット100およびCPUユニット200)の機能ブロック(特に、OPCUAサーバ部110、制御部130、および取得部210)は、集積回路(ICチップ)等に形成された論理回路(ハードウェア)によって実現してもよいし、ソフトウェアによって実現してもよい。
 後者の場合、PLC10および11は、各機能を実現するソフトウェアであるプログラムの命令を実行するコンピュータを備えている。このコンピュータは、例えば1つ以上のプロセッサを備えていると共に、上記プログラムを記憶したコンピュータ読み取り可能な記録媒体を備えている。そして、上記コンピュータにおいて、上記プロセッサが上記プログラムを上記記録媒体から読み取って実行することにより、本発明の目的が達成される。上記プロセッサとしては、例えばCPU(Central Processing Unit)を用いることができる。上記記録媒体としては、「一時的でない有形の媒体」、例えば、ROM(Read Only Memory)等の他、テープ、ディスク、カード、半導体メモリ、プログラマブルな論理回路などを用いることができる。また、上記プログラムを展開するRAM(Random Access Memory)などをさらに備えていてもよい。また、上記プログラムは、該プログラムを伝送可能な任意の伝送媒体(通信ネットワークや放送波等)を介して上記コンピュータに供給されてもよい。なお、本発明の一態様は、上記プログラムが電子的な伝送によって具現化された、搬送波に埋め込まれたデータ信号の形態でも実現され得る。
 (付記事項)
 本発明の一態様に係る制御装置は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置であって、各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付部と、前記受付部が前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出部と、前記読出部が読み出した前記複数の変数の各々の値を外部に出力する出力部と、を備える。
 前記の構成によれば、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する。また、前記制御装置は、前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 したがって、前記制御装置は、複数のタスクを並行して周期的に実行することができ、かつ、タスク実行中に複数の変数の各々の更新後の値を一括して問い合わせる要求を外部から受け付けると、複数の変数の各々の更新後の値であって、同期させた値を応答することができるとの効果を奏する。
 ここで、前記複数の変数の各々の更新後の値の読出完了時点が、2つ以上の「前記周期の間隔が最も小さいタスクの周期」(以下、「基本周期」と呼ぶ)にまたがっている場合、読み出された複数の値の間で同期が確保されない。すなわち、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の間隔以上である場合、読み出された複数の値の間で同期が確保されない。
 このことは、例えば、「前記基本周期に対応し、変数Aの値を更新する」タスクTpと、「前記基本周期と異なる周期に対応し、変数Aとは異なる変数Cの値を更新する」タスクTsと、が並行して周期的に実行される場合を想定すると、明確となる。
 つまり、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の間隔以上である場合、前記時間間隔において1回以上、タスクTpが実行されることになる。そのため、ユーザは、変数Aの値と、「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、を取得することになる。したがって、読み出された変数Aの値と変数Cの値との間の同期は確保されておらず、ユーザは、同期する「複数の変数の各々の更新後の値」の間の関係を把握することができない。言い換えれば、ユーザは、並行して周期的に実行されるタスクTpおよびTsの各々において略同時に更新された変数Aおよび変数Cの各々の更新後の値を、把握することができない。前述の例では、ユーザが取得するのは、変数Aの値と、「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、である。
 これに対して、前記制御装置は、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期内に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。すなわち、前記制御装置は、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、前記複数の変数の各々の更新後の値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 上述の例に即して言えば、前記制御装置は、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、変数Aおよび変数Cの各々の更新後の値を読み出す。前記制御装置が変数Aの更新後の値の読出を完了した時点から、変数Cの更新後の値の読出を完了した時点までの間に、タスクTpもタスクTsも実行されないように、前記制御装置は変数AおよびCの各々の更新後の値を読み出す。
 したがって、前記制御装置により、ユーザは、並行して実行される複数のタスクの各々において略同時に更新された複数の変数の各々の更新後の値を把握することができ、つまり、同期性の確保された複数の変数の各々の更新後の値を把握することができる。言い換えれば、前記制御装置に対して、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、前記制御装置が応答する複数の変数の各々の更新後の値の間の同期が実現されている。
 上述の例に即して言えば、前記制御装置により、ユーザは、タスクTpにおいて更新された変数Aの更新後の値と、変数Aが更新された時点と略同時にタスクTsにおいて更新された変数Cの更新後の値と、を把握することができる。つまり、前記制御装置により、ユーザは、変数Aおよび変数Cの各々について、「同期性が確保された、更新後の値」を把握することができる。
 本発明の一態様に係る制御装置について、前記読出部は、前記複数のタスクの各々の周期が揃う時点から、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間を差し引いた時点までに、前記複数の変数の各々の値の読出を開始してもよい。
 前記の構成によれば、前記制御装置は、前記複数のタスクの各々の周期が揃う時点から、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間を差し引いた時点までに、前記複数の変数の各々の値の読出を開始する。
 つまり、前記制御装置は、前記複数のタスクの各々の周期が揃う時点についての情報と、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間についての情報と、を用いて、前記複数の変数の各々の更新後の値を読み出す。言い換えれば、前記制御装置は、前記複数の変数の各々の更新後の値を読み出すために、「前記複数の変数の各々の値が、前記複数のタスクのうちのいずれのタスクにおいて更新されるか」を把握する必要が無い。
 したがって、前記制御装置は、「前記複数の変数の各々の値が、前記複数のタスクのうちのいずれのタスクにおいて更新されるか」を把握する場合に比べて実現の容易な処理によって、前記複数の変数の各々の更新後の値を読み出すことができるとの効果を奏する。
 本発明の一態様に係る制御装置は、前記変数と、前記変数の値を更新する前記タスクと、を対応付けた対応情報を取得する取得部をさらに備え、前記読出部は、前記取得部の取得した前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出してもよい。
 前記の構成によれば、前記制御装置は、前記変数と、前記変数の値を更新する前記タスクと、を対応付けた対応情報を取得し、取得した前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出す。
 したがって、前記制御装置は、前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出すことができるとの効果を奏する。
 本発明の一態様に係る制御装置について、前記対応情報において、前記複数の変数のうちの或る変数に対し、前記或る変数の値を更新する前記タスクが2つ以上対応付けられている場合、前記読出部は、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点の直前に、前記或る変数の値の読出を完了してもよい。
 前記の構成によれば、前記制御装置は、前記対応情報において、前記複数の変数のうちの或る変数に対し、前記或る変数の値を更新する前記タスクが2つ以上対応付けられている場合、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点の直前に、前記或る変数の値の読出を完了する。
 ここで、前記或る変数について、前記或る変数の値を更新する2つ以上の前記タスクのうち、前記周期の間隔が最も小さいタスクにおいて、前記或る変数の更新後の値を読み出した場合、以下の事態が発生する。すなわち、読み出した値は、「前記周期の間隔が最も小さいタスク」が再実行される前に、「前記周期の間隔が最も小さいタスク」以外のタスクにおいて、さらに値が更新されることになる。
 これに対し、前記制御装置は、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点までに、前記或る変数の値を読み出す。したがって、前記制御装置は、前記或る変数の、或るタスクにおいて更新された後の値を読み出した後、前記或るタスクが再実行される前に、「前記或るタスク」以外のタスクにおいて、前記或る変数の値が更新されるという事態を防ぐことができるとの効果を奏する。
 本発明の一態様に係る制御装置は、OPCUAサーバ機能を備え、前記受付部は、OPCUAクライアント装置から、OPCUA規格に準拠した接続方式で前記要求を受け付け、前記出力部は、前記OPCUAクライアント装置に、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力してもよい。
 前記の構成によれば、前記制御装置は、OPCUAサーバ機能を備え、OPCUAクライアント装置から、OPCUA規格に準拠した接続方式で前記要求を受け付け、前記OPCUAクライアント装置に、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力する。
 したがって、前記制御装置は、メーカおよびプラットフォームから独立した、安全で信頼性の高い、産業用の機器間通信のプロトコルであるOPCUA規格に準拠した接続方式で前記要求を受け付け、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力することができるとの効果を奏する。
 本発明の一態様に係る制御装置について、前記複数のタスクは、基準のタスクと、基準のタスク以外のタスクとを含み、前記基準のタスク以外のタスクの周期は、前記基準のタスクの周期の整数倍に設定されていてもよい。
 前記の構成によれば、前記制御装置において、前記複数のタスクは、基準のタスクと、基準のタスク以外のタスクとを含み、前記基準のタスク以外のタスクの周期は、前記基準のタスクの周期の整数倍に設定されている。
 したがって、前記制御装置は、前記複数のタスクを同期させやすくすることができ、つまり、前記複数のタスクの各々の周期を揃えやすくすることができるとの効果を奏する。
 本発明の一態様に係る制御方法は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置の制御方法であって、各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付ステップと、前記受付ステップにて前記要求が受け付けられると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出ステップと、前記読出ステップにて読み出された前記複数の変数の各々の値を外部に出力する出力ステップと、を含む。
 前記の方法によれば、前記制御方法は、複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する。また、前記制御方法は、前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 したがって、前記制御方法は、複数のタスクを並行して周期的に実行することができ、かつ、タスク実行中に複数の変数の各々の更新後の値を一括して問い合わせる要求を外部から受け付けると、複数の変数の各々の更新後の値であって、同期させた値を応答することができるとの効果を奏する。
 ここで、前記複数の変数の各々の更新後の値の読出完了時点が、2つ以上の基本周期にまたがっている場合、読み出された複数の値の間で同期が確保されない。すなわち、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の間隔以上である場合、読み出された複数の値の間で同期が確保されない。
 このことは、例えば、「前記基本周期に対応し、変数Aの値を更新する」タスクTpと、「前記基本周期と異なる周期に対応し、変数Aとは異なる変数Cの値を更新する」タスクTsと、が並行して周期的に実行される場合を想定すると、明確となる。
 つまり、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の間隔以上である場合、前記時間間隔において1回以上、タスクTpが実行されることになる。そのため、ユーザは、変数Aの値と、「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、を取得することになる。したがって、読み出された変数Aの値と変数Cの値との間の同期は確保されておらず、ユーザは、同期する「複数の変数の各々の更新後の値」の間の関係を把握することができない。言い換えれば、ユーザは、並行して周期的に実行されるタスクTpおよびTsの各々において略同時に更新された変数Aおよび変数Cの各々の更新後の値を、把握することができない。前述の例では、ユーザが取得するのは、変数Aの値と、「変数Aの値が読み出された後、変数Aの値を更新するタスクTpが1回以上実行された後の、変数Cの値」と、である。
 これに対して、前記制御方法は、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期内に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。すなわち、前記制御方法は、前記複数の変数の各々の更新後の値の読出完了時点の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、前記複数の変数の各々の更新後の値を読み出し、読み出した前記複数の変数の各々の値を外部に出力する。
 上述の例に即して言えば、前記制御方法は、変数Aの更新後の値の読出完了時点と、変数Cの更新後の値の読出完了時点と、の間の時間間隔が、前記基本周期の時間間隔よりも小さくなるように、変数Aおよび変数Cの各々の更新後の値を読み出す。前記制御方法が変数Aの更新後の値の読出を完了した時点から、変数Cの更新後の値の読出を完了した時点までの間に、タスクTpもタスクTsも実行されないように、前記制御方法は変数AおよびCの各々の更新後の値を読み出す。
 したがって、前記制御方法により、ユーザは、並行して実行される複数のタスクの各々において略同時に更新された複数の変数の各々の更新後の値を把握することができ、つまり、同期性の確保された複数の変数の各々の更新後の値を把握することができる。言い換えれば、前記制御装置に対して、タスク実行中に複数の変数の各々の更新後の値を一括して問合せた場合、前記制御方法によって、応答における複数の変数の各々の更新後の値の間の同期が実現されている。
 上述の例に即して言えば、前記制御方法により、ユーザは、タスクTpにおいて更新された変数Aの更新後の値と、変数Aが更新された時点と略同時にタスクTsにおいて更新された変数Cの更新後の値と、を把握することができる。つまり、前記制御方法により、ユーザは、変数Aおよび変数Cの各々について、「同期性が確保された、更新後の値」を把握することができる。
 本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。
  10、10A、10B、11 PLC(制御装置)
  80 クライアント装置(OPCUAクライアント装置)
 111 OPCUA入力部(受付部)
 112 読出部
 113 OPCUA出力部(出力部)
 210 取得部
  Tp タスク(基準のタスク)
  Ts タスク(基準のタスク以外のタスク)
  Yμs 予想読出期間
  Step1 受付ステップ
  Step3 読出ステップ
  Step4 出力ステップ

Claims (9)

  1.  複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置であって、
     各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付部と、
     前記受付部が前記要求を受け付けると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出部と、
     前記読出部が読み出した前記複数の変数の各々の値を外部に出力する出力部と、を備えることを特徴とする制御装置。
  2.  前記読出部は、前記複数のタスクの各々の周期が揃う時点から、前記複数の変数の各々の値を全て読み出すのに要する期間として予想された予想読出期間を差し引いた時点までに、前記複数の変数の各々の値の読出を開始することを特徴とする請求項1に記載の制御装置。
  3.  前記変数と、前記変数の値を更新する前記タスクと、を対応付けた対応情報を取得する取得部をさらに備え、
     前記読出部は、前記取得部の取得した前記対応情報を用いて、前記複数の変数の各々の値を、前記複数の変数の各々の値を更新する前記タスクの前記周期において、読み出すことを特徴とする請求項1または2に記載の制御装置。
  4.  前記対応情報において、前記複数の変数のうちの或る変数に対し、前記或る変数の値を更新する前記タスクが2つ以上対応付けられている場合、
     前記読出部は、前記或る変数の値を更新する2つ以上の前記タスクの各々の前記周期が揃う時点の直前に、前記或る変数の値の読出を完了することを特徴とする請求項3に記載の制御装置。
  5.  OPCUAサーバ機能を備え、
     前記受付部は、OPCUAクライアント装置から、OPCUA規格に準拠した接続方式で前記要求を受け付け、
     前記出力部は、前記OPCUAクライアント装置に、前記複数の変数の各々の値をOPCUA規格に準拠した接続方式で出力することを特徴とする請求項1から4のいずれか1項に記載の制御装置。
  6.  前記複数のタスクは、基準のタスクと、基準のタスク以外のタスクとを含み、
     前記基準のタスク以外のタスクの周期は、前記基準のタスクの周期の整数倍に設定されていることを特徴とする請求項1から5のいずれか1項に記載の制御装置。
  7.  複数のタスクを、前記タスクごとの周期で繰り返し並行して実行することにより制御対象機器を制御する制御装置の制御方法であって、
     各々の値が前記複数のタスクの少なくとも1つにおいて更新される、複数の変数について、前記タスクの実行中における各々の値を一括して問い合わせる要求を外部から受け付ける受付ステップと、
     前記受付ステップにて前記要求が受け付けられると、前記複数の変数の各々の値の読出を完了する時点が全て、前記複数のタスクのうち前記周期の間隔が最も小さいタスクの、1つの周期の開始時点から終了時点までの間に含まれるように、前記複数の変数の各々の、前記複数のタスクの少なくとも1つにおいて更新された値を読み出す読出ステップと、
     前記読出ステップにて読み出された前記複数の変数の各々の値を外部に出力する出力ステップと、を含むことを特徴とする制御方法。
  8.  請求項1から6のいずれか1項に記載の制御装置としてコンピュータを機能させるための情報処理プログラムであって、前記各部としてコンピュータを機能させるための情報処理プログラム。
  9.  請求項8に記載の情報処理プログラムを記録したコンピュータ読み取り可能な記録媒体。
PCT/JP2018/037462 2017-10-24 2018-10-05 制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体 WO2019082627A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US16/641,796 US11287793B2 (en) 2017-10-24 2018-10-05 Control device, control method for control device, information processing program, and recording medium
CN201880056330.9A CN111095138B (zh) 2017-10-24 2018-10-05 控制装置、控制装置的控制方法、信息处理程序及记录介质
EP18871093.3A EP3702852B1 (en) 2017-10-24 2018-10-05 Control device, control method for control device, information processing program, and recording medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2017205426A JP6859922B2 (ja) 2017-10-24 2017-10-24 制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体
JP2017-205426 2017-10-24

Publications (1)

Publication Number Publication Date
WO2019082627A1 true WO2019082627A1 (ja) 2019-05-02

Family

ID=66246395

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/037462 WO2019082627A1 (ja) 2017-10-24 2018-10-05 制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体

Country Status (5)

Country Link
US (1) US11287793B2 (ja)
EP (1) EP3702852B1 (ja)
JP (1) JP6859922B2 (ja)
CN (1) CN111095138B (ja)
WO (1) WO2019082627A1 (ja)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020224753A1 (de) * 2019-05-06 2020-11-12 Siemens Aktiengesellschaft Verfahren zum konfigurieren eines kommunikationsnetzwerks für das zyklische übertragen von nachrichten
CN112327740B (zh) * 2020-10-28 2021-10-22 中国工程物理研究院计算机应用研究所 集成Tango设备服务的嵌入式运动控制器
JP7422959B1 (ja) 2023-02-17 2024-01-26 三菱電機株式会社 表示プログラム、クライアント装置、ネットワークシステム及び表示制御方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099258A (ja) * 2004-09-28 2006-04-13 Digital Electronics Corp エディタ装置、コンピュータをエディタ装置として機能させるためのプログラム、そのプログラムを格納した記録媒体、制御システム、および表示器
JP2009181443A (ja) 2008-01-31 2009-08-13 Omron Corp 産業用コントローラ用機器
JP2009245009A (ja) * 2008-03-28 2009-10-22 Fujitsu Ten Ltd 車両制御装置及びマルチコアプロセッサ
JP2017084143A (ja) 2015-10-29 2017-05-18 横河電機株式会社 電子機器

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0863462B8 (en) * 1997-03-04 2010-07-28 Panasonic Corporation Processor capable of efficiently executing many asynchronous event tasks
JP2002099433A (ja) * 2000-09-22 2002-04-05 Sony Corp 演算処理システム及び演算処理制御方法、タスク管理システム及びタスク管理方法、並びに記憶媒体
US7328370B2 (en) * 2003-09-12 2008-02-05 Rockwell Automation Technologies, Inc. Safety controller with simplified interface
JP4770664B2 (ja) * 2006-09-20 2011-09-14 株式会社デンソー マイクロプロセッサおよびそれを用いたマイクロコンピュータ
EP2634981B1 (en) * 2010-04-08 2015-06-10 Vadasz, Istvan Cell based data transfer with dynamic multi-path routing in a full mesh network without central control
FR2965077B1 (fr) * 2010-09-21 2016-12-09 Continental Automotive France Procede de gestion de taches dans un microprocesseur ou un ensemble de microprocesseurs
CN101976247B (zh) * 2010-09-30 2013-01-16 北京新媒传信科技有限公司 Rss数据采集方法及系统
JP5218585B2 (ja) * 2011-03-15 2013-06-26 オムロン株式会社 制御装置およびシステムプログラム
JP5747584B2 (ja) * 2011-03-15 2015-07-15 オムロン株式会社 制御装置およびシステムプログラム
JP5252014B2 (ja) * 2011-03-15 2013-07-31 オムロン株式会社 制御装置、制御システム、ツール装置および収集指示プログラム
CN103617472B (zh) * 2013-07-09 2016-10-26 成都希盟泰克科技发展有限公司 多项目多任务管理中的资源平衡自适应调度方法
US10156837B2 (en) * 2014-03-14 2018-12-18 Omron Corporation Control systems for setting sampling timing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099258A (ja) * 2004-09-28 2006-04-13 Digital Electronics Corp エディタ装置、コンピュータをエディタ装置として機能させるためのプログラム、そのプログラムを格納した記録媒体、制御システム、および表示器
JP2009181443A (ja) 2008-01-31 2009-08-13 Omron Corp 産業用コントローラ用機器
JP2009245009A (ja) * 2008-03-28 2009-10-22 Fujitsu Ten Ltd 車両制御装置及びマルチコアプロセッサ
JP2017084143A (ja) 2015-10-29 2017-05-18 横河電機株式会社 電子機器

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3702852A4

Also Published As

Publication number Publication date
US11287793B2 (en) 2022-03-29
JP2019079256A (ja) 2019-05-23
EP3702852A1 (en) 2020-09-02
CN111095138A (zh) 2020-05-01
JP6859922B2 (ja) 2021-04-14
CN111095138B (zh) 2023-03-10
EP3702852A4 (en) 2021-07-14
US20200264578A1 (en) 2020-08-20
EP3702852B1 (en) 2022-06-22

Similar Documents

Publication Publication Date Title
JP6540166B2 (ja) 制御装置
JP6409557B2 (ja) 制御装置、コントローラ・システム、出力制御方法、およびプログラム
EP2687927B1 (en) Cpu of plc, system program for plc, and recording medium storing system program for plc
US10761884B2 (en) Control device for operating multiple types of programs in different execution formats
WO2012124143A1 (ja) 演算ユニット、支援装置、出力制御方法、表示制御方法、およびプログラム
JP6488830B2 (ja) 制御装置
WO2012124144A1 (ja) 演算ユニット、出力制御方法、およびプログラム
EP2515189A1 (en) Plc cpu unit, system program for plc, and storage medium having system program for plc stored therein
WO2019082627A1 (ja) 制御装置、制御装置の制御方法、情報処理プログラム、および記録媒体
US10579031B2 (en) Controller
JP6299064B2 (ja) 制御装置、制御方法、およびプログラム
CN110192159B (zh) 控制装置
JP2019106225A (ja) 制御装置
US9568905B2 (en) CPU of PLC, system program for PLC, and recording medium storing system program for PLC
JP4993208B2 (ja) 産業用コントローラ用機器
EP3764175B1 (en) Control device and control system
US11374788B2 (en) Network system having master device carrying out part of a process and slave device carrying out remainder of the process
JP7110911B2 (ja) コントローラおよびコントローラの備える通信制御部の制御方法

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: 18871093

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018871093

Country of ref document: EP

Effective date: 20200525