WO2012124132A1 - Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体 - Google Patents

Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体 Download PDF

Info

Publication number
WO2012124132A1
WO2012124132A1 PCT/JP2011/056768 JP2011056768W WO2012124132A1 WO 2012124132 A1 WO2012124132 A1 WO 2012124132A1 JP 2011056768 W JP2011056768 W JP 2011056768W WO 2012124132 A1 WO2012124132 A1 WO 2012124132A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
cycle
motion
execution
user program
Prior art date
Application number
PCT/JP2011/056768
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 EP11860797.7A priority Critical patent/EP2672346B1/en
Priority to CN201180068882.XA priority patent/CN103403631B/zh
Publication of WO2012124132A1 publication Critical patent/WO2012124132A1/ja
Priority to US14/017,684 priority patent/US10274923B2/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/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/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/414Structure of the control system, e.g. common controller or multiprocessor systems, interface to servo, programmable interface controller
    • G05B19/4145Structure of the control system, e.g. common controller or multiprocessor systems, interface to servo, programmable interface controller characterised by using same processor to execute programmable controller and numerical controller function [CNC] and PC controlled NC [PCNC]
    • 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/30Nc systems
    • G05B2219/34Director, elements to supervisory
    • G05B2219/34287Plc and motion controller combined

Definitions

  • the present invention relates to scheduling of control operations including output processing, input processing, arithmetic processing, and the like in a PLC (also referred to as a programmable logic controller or programmable controller) used to control operations of machines and equipment.
  • a PLC also referred to as a programmable logic controller or programmable controller
  • the PLC is, for example, a CPU (Central Processing Unit) unit that includes a microprocessor that executes user programs, and an IO (Input Output) unit that is responsible for signal input from external switches and sensors and signal output to external relays and actuators. It is composed of multiple units.
  • the PLC performs a control operation while exchanging data via the PLC system bus and / or the field network for each user program execution cycle between these units.
  • Control of the operation of machines, equipment, etc. may include motion control for controlling motor movement.
  • a motion control typically a control process (execution of a motion calculation program) for periodically outputting a command value to a motor driver that drives a motor, is performed in a motion controller provided separately from the PLC. It was done.
  • speeding up of microprocessors and communication networks is progressing. For this reason, it has become possible to execute not only a user program but also a motion operation program in one microprocessor by using those techniques in the PLC.
  • Patent Document 1 Japanese Patent Laid-Open No. 2007-140655 discloses a configuration in which a motion control function for controlling a motor and a PLC function for executing a sequence calculation (user program) are processed by one CPU. Yes. More specifically, for each cycle of the basic clock, “fixed-cycle motion control processing and each axis processing” and “high-speed sequence processing” are executed, and “low speed” is performed in the remaining time in each basic clock cycle. It is disclosed to execute “sequence processing” or “non-constant cycle motion control processing”.
  • the command value for the motor driver is calculated and the calculation result is output within the execution cycle of a constant short period, as with the conventional motion controller. It is natural to consider configuring the user program to execute and other PLC operations in the remaining time of each execution cycle. However, since the remaining time in each execution cycle is limited, it is not possible to perform all processes necessary for operating as a PLC in each execution cycle. In such a case, it is not clear what processing should be performed in the remaining time in which execution cycle. Furthermore, execution of the user program requires input processing and output processing, and at least output processing (and in some cases input processing) is also required for motion calculation execution. It is not clear what should be done.
  • the PLC and the motion controller are asynchronous with each other, and generally the PLC operates with a longer execution cycle.
  • the role of the PLC that executes the user program with respect to motion control is that when executing a motion command in the user program, an instruction to start one operation is given to the motion controller according to the type and parameter of the motion command.
  • the PLC gives an instruction based on a motion command such as “Move according to a specified speed change from coordinate A to coordinate B” to the motion controller.
  • the motion controller is a position command value for the servo motor driver for each execution cycle in order to realize the motion of the command content (depending on the command content, it may be a speed command value, a torque command value, etc. Is calculated and output. Once an activation instruction is given, the motion controller repeats calculation and output of the command value in its own execution cycle until the execution of the motion command is completed.
  • the motion calculation program actually calculates the contents of such a motion command.
  • the motion calculation program itself is provided by the manufacturer of the PLC, and it is not easy for the user to develop the motion calculation program.
  • the user program can be freely programmed by the user himself. Therefore, if the user program defines part of the calculation contents related to the calculation of the motion command value in each execution cycle, and the motion calculation program and the user program are executed in synchronization, the degree of freedom of motion control can be increased. . As a result, there is a possibility that motion control more suitable for the control content required by each individual user can be realized.
  • the inventors of the present application do not have to simply synchronize the execution of the user program and the motion calculation when the user program is involved in the calculation of the motion command value.
  • the present invention relates to input processing and output when a user program executed in synchronization with a motion calculation program in a PLC CPU unit performs calculation related to calculation of a motion command value using input data for motion control.
  • a user program executed in synchronization with a motion calculation program in a PLC CPU unit performs calculation related to calculation of a motion command value using input data for motion control.
  • a PLC CPU unit having a motion control function for controlling the motion of a motor includes a microprocessor, storage means, and a communication circuit.
  • the CPU unit of the PLC is configured to be able to repeatedly execute the motion command value data output processing, the motion control input data input processing, and the execution of the motion calculation program at every fixed motion control cycle.
  • a first user program execution cycle having a cycle that is an integer multiple of the cycle of the motion control cycle is generated according to the control purpose and includes a process that gives instructions necessary for the execution to the motion calculation program. Each is configured so that it can be executed repeatedly.
  • the storage means is used for storing the system program and the first user program.
  • the system program includes a motion calculation program and a scheduler program that controls execution of the first user program and the motion calculation program.
  • the microprocessor executes the system program and the first user program stored in the storage means, and the communication circuit transmits the motion command value data as at least a part of the output process and the input process for each motion control cycle.
  • the input data for motion control is received as at least part of.
  • the scheduler program causes the microprocessor to start execution of the motion operation program for each motion control cycle, and causes the microprocessor to start execution of the first user program for each first user program execution cycle.
  • the output process and input process, the start of execution of the first user program, the end of execution of the first user program, and the start of execution of the motion operation program correspond to the cycle of the first user program execution cycle in this order.
  • the first user program includes a process of calculating user program output data used by the motion calculation program using the input data for motion control
  • the input is started in the input process from the start of the input process.
  • the time required to complete the output processing of the motion command value data reflecting the input data for motion control can be set to a time corresponding to the cycle of the first user program execution cycle.
  • the period of the first user program execution cycle is equal to the period of the motion control cycle.
  • the motion command value data can be calculated using the updated user program output data every time the motion calculation program is executed. That is, the motion command value data updated in such a manner can be output for each output process.
  • the scheduler program includes an instruction for causing the microprocessor to execute the first user program and the motion operation program in this order after the output process and the input process in the motion control cycle.
  • the storage means further does not include a process of calculating user program output data created according to a user's control purpose and used by the motion calculation program using the motion control input data, and the motion It is used for storing a second user program having a second user program execution cycle having a period which is an integer multiple of 2 or more of the period of the control cycle.
  • the scheduler program causes the microprocessor to store the surplus from the end of the execution of the first motion operation program to the end of the motion control cycle in the second user program execution cycle.
  • the PLC CPU unit can realize high-speed processing by creating a user program as follows. That is, the first user program includes a command for calculating user program output data used for calculation in the motion calculation program using the motion control input data.
  • the second user program includes instructions for realizing all or part of the processing other than that included in the first user program.
  • the amount of processing allocated to the first user program is smaller than when the first user program includes an instruction for realizing all processing, and thus the execution time of the first user program is shortened. be able to. Therefore, there is a possibility that the cycle of the motion control cycle can be further shortened.
  • the period of the first user program execution cycle is equal to an integer multiple of 2 or more of the period of the motion control cycle.
  • the scheduler program causes the microprocessor to execute the execution of the motion arithmetic program, the output process and the input process, and the execution of the first user program in this order within the first user program execution cycle. including.
  • execution of the motion calculation program, output processing and input processing, and execution of the first user program are executed in this order.
  • the time from the execution of the output process and the input process to the end of the motion control cycle may vary from motion control cycle to motion control cycle. With this instruction, this time is used to execute the first user program. It can be used without waste. As a result, it becomes difficult for the waiting time of the microprocessor to occur, so that the user program execution cycle may be further shortened.
  • a PLC system program executed by a PLC CPU unit having a motion control function for controlling the motion of a motor.
  • the CPU unit of the PLC includes storage means used for storing the first user program, a microprocessor, and a communication circuit.
  • the CPU unit of the PLC is configured to be able to repeatedly execute the motion command value data output processing, the motion control input data input processing, and the execution of the motion calculation program at every fixed motion control cycle.
  • a first user program execution cycle having a cycle that is an integer multiple of the cycle of the motion control cycle is generated according to the control purpose and includes a process that gives instructions necessary for the execution to the motion calculation program. Each is configured so that it can be executed repeatedly.
  • the PLC system program includes a motion calculation program and a scheduler program that controls execution of the first user program and the motion calculation program.
  • the communication circuit transmits motion command value data as at least a part of output processing and receives motion control input data as at least a part of input processing.
  • the scheduler program causes the microprocessor to start execution of the motion operation program for each motion control cycle, and causes the microprocessor to start execution of the first user program for each first user program execution cycle.
  • the output process and input process, the start of execution of the first user program, the end of execution of the first user program, and the start of execution of the motion operation program correspond to the cycle of the first user program execution cycle in this order. And an instruction to repeat in a cycle.
  • the input is started in the input process from the start of the input process.
  • the time required to complete the output processing of the motion command value data reflecting the input data for motion control can be set to a time corresponding to the cycle of the first user program execution cycle.
  • the period of the first user program execution cycle is equal to the period of the motion control cycle.
  • the scheduler program includes an instruction for causing the microprocessor to execute the first user program and the motion operation program in this order after the output process and the input process in the motion control cycle.
  • the scheduler program does not include a process of calculating user program output data that is created according to the control purpose of the user and used by the motion calculation program using the input data for motion control, and the motion control cycle
  • the microprocessor is connected to the microprocessor within the second user program execution cycle.
  • the execution of the second user program is started in the surplus time from the end of the execution of the first motion calculation program to the end of the motion control cycle, and the second time is exceeded in the surplus time after the end of execution of the motion calculation program in the subsequent motion control cycle.
  • the period of the first user program execution cycle is equal to an integer multiple of 2 or more of the period of the motion control cycle.
  • the scheduler program causes the microprocessor to execute the execution of the motion arithmetic program, the output process and the input process, and the execution of the first user program in this order within the first user program execution cycle. including.
  • a recording medium storing a PLC system program executed by a PLC CPU unit having a motion control function for controlling motor motion.
  • the CPU unit of the PLC includes storage means used for storing the first user program, a microprocessor, and a communication circuit.
  • the CPU unit of the PLC is configured to be able to repeatedly execute the motion command value data output processing, the motion control input data input processing, and the execution of the motion calculation program at every fixed motion control cycle.
  • a first user program execution cycle having a cycle that is an integer multiple of the cycle of the motion control cycle is generated according to the control purpose and includes a process that gives instructions necessary for the execution to the motion calculation program. Each is configured so that it can be executed repeatedly.
  • the PLC system program includes a motion calculation program and a scheduler program that controls execution of the first user program and the motion calculation program.
  • the communication circuit transmits motion command value data as at least a part of output processing and receives motion control input data as at least a part of input processing.
  • the scheduler program causes the microprocessor to start execution of the motion operation program for each motion control cycle, and causes the microprocessor to start execution of the first user program for each first user program execution cycle.
  • the output process and input process, the start of execution of the first user program, the end of execution of the first user program, and the start of execution of the motion operation program correspond to the cycle of the first user program execution cycle in this order. And an instruction to repeat in a cycle.
  • the input is started in the input process from the start of the input process.
  • the time required to complete the output processing of the motion command value data reflecting the input data for motion control can be set to a time corresponding to the cycle of the first user program execution cycle.
  • the period of the first user program execution cycle is equal to the period of the motion control cycle.
  • the scheduler program includes an instruction for causing the microprocessor to execute the first user program and the motion operation program in this order after the output process and the input process in the motion control cycle.
  • the scheduler program does not include a process of calculating user program output data that is created according to the control purpose of the user and used by the motion calculation program using the input data for motion control, and the motion control cycle
  • the microprocessor is connected to the microprocessor within the second user program execution cycle.
  • the execution of the second user program is started in the surplus time from the end of the execution of the first motion calculation program to the end of the motion control cycle, and the second time is exceeded in the surplus time after the end of execution of the motion calculation program in the subsequent motion control cycle.
  • the period of the first user program execution cycle is equal to an integer multiple of 2 or more of the period of the motion control cycle.
  • the scheduler program causes the microprocessor to execute the execution of the motion arithmetic program, the output process and the input process, and the execution of the first user program in this order within the first user program execution cycle. including.
  • instructions in this specification means not only individual instructions appearing in a program source list for realizing a certain function, but also a set of such individual instructions and functions. For example, in English, it should be written in plural form like instructions.
  • the input process when the first user program includes the process of calculating the user program output data used by the motion calculation program using the input data for motion control, the input process
  • the time required to output the motion command value data reflecting the input data for motion control input there can be set to a short time corresponding to the cycle of the user program execution cycle.
  • FIG. 10 is a sequence diagram showing an overall processing operation in a comparative example related to the overall processing operation shown in FIG. 9. It is a sequence diagram which shows the whole process operation
  • the PLC according to the present embodiment has a motion control function for controlling the motion of the motor.
  • the system configuration of the PLC 1 according to the present embodiment will be described with reference to FIG.
  • FIG. 1 is a schematic diagram showing a schematic configuration of a PLC system according to an embodiment of the present invention.
  • PLC system SYS includes PLC 1, servo motor driver 3 and remote IO terminal 5 connected to PLC 1 via field network 2, detection switch 6 and relay 7 which are field devices.
  • the PLC support device 8 is connected to the PLC 1 via the connection cable 10 or the like.
  • the PLC 1 includes a CPU unit 13 that executes main arithmetic processing, one or more IO units 14, and a special unit 15. These units are configured to exchange data with each other via the PLC system bus 11. These units are supplied with power of an appropriate voltage by the power supply unit 12. Since each unit configured as the PLC 1 is provided by a PLC manufacturer, the PLC system bus 11 is generally developed and used independently for each PLC manufacturer. On the other hand, as will be described later, for the field network 2, the standards and the like are often disclosed so that products from different manufacturers can be connected.
  • the IO unit 14 is a unit related to general input / output processing, and controls input / output of binarized data such as on / off. In other words, the IO unit 14 collects information indicating whether a sensor such as the detection switch 6 is detecting a certain object (on) or not detecting any object (off). . In addition, the IO unit 14 outputs either an activation command (ON) or an inactivation command (OFF) to an output destination such as the relay 7 or the actuator.
  • the special unit 15 has functions not supported by the IO unit 14 such as analog data input / output, temperature control, and communication using a specific communication method.
  • the field network 2 transmits various data exchanged with the CPU unit 13.
  • various types of industrial Ethernet registered trademark
  • industrial Ethernet registered trademark
  • industrial Ethernet for example, EtherCAT (registered trademark), Profinet IRT, MECHATROLINK (registered trademark) -III, Powerlink, SERCOS (registered trademark) -III, and CIP Motion are known. Any of them may be adopted.
  • a field network other than industrial Ethernet may be used. For example, if the motion control is not performed, DeviceNet, CompoNet / IP (registered trademark), or the like may be used.
  • the PLC system SYS typically exemplifies a configuration in the case where EtherCAT (registered trademark), which is an industrial Ethernet (registered trademark), is employed as the field network 2 in the present embodiment.
  • FIG. 1 illustrates the PLC system SYS having both the PLC system bus 11 and the field network 2, but a system configuration in which only one of them is mounted may be employed. For example, all units may be connected by the field network 2. Alternatively, the servo motor driver 3 may be directly connected to the PLC system bus 11 without using the field network 2. Further, a communication unit of the field network 2 may be connected to the PLC system bus 11 and communication may be performed between the CPU unit 13 and a device connected to the field network 2 via the communication unit.
  • the CPU unit 13 directly controls the control target without passing through the IO unit 14, the servo motor driver 3, or the like by providing the CPU unit 13 with the function of the IO unit 14 or the function of the servo motor driver 3. It may be configured.
  • the servo motor driver 3 is connected to the CPU unit 13 via the field network 2 and drives the servo motor 4 according to a command value from the CPU unit 13. More specifically, the servo motor driver 3 receives command values such as a position command value, a speed command value, and a torque command value from the PLC 1 at a constant cycle.
  • the servo motor driver 3 receives a position and speed (typically from the difference between the current position and the previous position) from a detector such as a position sensor (rotary encoder) or torque sensor connected to the shaft of the servo motor 4. (Calculated), an actual measurement value related to the operation of the servo motor 4 such as torque is acquired.
  • the servo motor driver 3 sets a command value from the CPU unit 13 as a target value, and performs feedback control using the actually measured value as a feedback value. That is, the servo motor driver 3 adjusts the current for driving the servo motor 4 so that the actual measurement value approaches the target value.
  • the servo motor driver 3 may be referred to as a servo motor amplifier.
  • FIG. 1 shows a system example in which the servo motor 4 and the servo motor driver 3 are combined, but other configurations, for example, a system in which a pulse motor and a pulse motor driver are combined may be employed.
  • a remote IO terminal 5 is further connected to the field network 2 of the PLC system SYS shown in FIG.
  • the remote IO terminal 5 basically performs processing related to general input / output processing in the same manner as the IO unit 14. More specifically, the remote IO terminal 5 includes a communication coupler 52 for performing processing related to data transmission in the field network 2 and one or more IO units 53. These units are configured to exchange data with each other via the remote IO terminal bus 51.
  • FIG. 2 is a schematic diagram showing a hardware configuration of the CPU unit 13 according to the embodiment of the present invention.
  • the CPU unit 13 includes a microprocessor 100, a chip set 102, a main memory 104, a nonvolatile memory 106, a system timer 108, a PLC system bus controller 120, a field network controller 140, USB connector 110.
  • the chip set 102 and other components are coupled via various buses.
  • the microprocessor 100 and the chipset 102 are typically configured according to a general-purpose computer architecture. That is, the microprocessor 100 interprets and executes the instruction codes sequentially supplied from the chip set 102 according to the internal clock.
  • the chip set 102 exchanges internal data with various connected components and generates instruction codes necessary for the microprocessor 100. Further, the chip set 102 has a function of caching data obtained as a result of execution of arithmetic processing in the microprocessor 100.
  • the CPU unit 13 includes a main memory 104 and a nonvolatile memory 106 as storage means.
  • the main memory 104 is a volatile storage area (RAM) and holds various programs to be executed by the microprocessor 100 after the CPU unit 13 is powered on.
  • the main memory 104 is also used as a working memory when the microprocessor 100 executes various programs.
  • a main memory 104 a device such as DRAM (Dynamic Random Access Memory) or SRAM (Static Random Access Memory) is used.
  • the non-volatile memory 106 holds data such as a real-time OS (Operating System), a PLC 1 system program, a user program, a motion calculation program, and system setting parameters in a non-volatile manner. These programs and data are copied to the main memory 104 so that the microprocessor 100 can access them as necessary.
  • a nonvolatile memory 106 a semiconductor memory such as a flash memory can be used.
  • a magnetic recording medium such as a hard disk drive or an optical recording medium such as a DVD-RAM (Digital Versatile Disk Random Access Memory) can be used.
  • the system timer 108 generates an interrupt signal at regular intervals and provides it to the microprocessor 100. Typically, it is configured to generate an interrupt signal at a plurality of different periods depending on the hardware specifications, but interrupts at an arbitrary period depending on the OS (Operating System), BIOS (Basic Input Output System), etc. It can also be set to generate a signal. Using the interrupt signal generated by the system timer 108, a control operation for each motion control cycle as described later is realized.
  • the CPU unit 13 includes a PLC system bus controller 120 and a field network controller 140 as communication circuits. These communication circuits transmit output data such as motion command value data and receive input data such as motion control input data.
  • the transmission of output data and the reception of input data by the communication circuit are performed by using the part responsible for these functions as a communication partner.
  • the PLC system bus controller 120 controls data exchange via the PLC system bus 11. More specifically, the PLC system bus controller 120 includes a DMA (Dynamic Memory Access) control circuit 122, a PLC system bus control circuit 124, and a buffer memory 126. The PLC system bus controller 120 is internally connected to the PLC system bus 11 via the PLC system bus connector 130.
  • DMA Dynamic Memory Access
  • the buffer memory 126 is a transmission buffer for data output to other units via the PLC system bus 11 (hereinafter also referred to as “output data”), and is input from other units via the PLC system bus 11. It functions as a data reception buffer (hereinafter also referred to as “input data”).
  • the output data created by the arithmetic processing by the microprocessor 100 is stored in the main memory 104 originally. Output data to be transferred to a specific unit is read from the main memory 104 and temporarily held in the buffer memory 126. Input data transferred from other units is temporarily stored in the buffer memory 126 and then transferred to the main memory 104.
  • the DMA control circuit 122 transfers output data from the main memory 104 to the buffer memory 126 and transfers input data from the buffer memory 126 to the main memory 104.
  • the PLC system bus control circuit 124 performs processing for transmitting output data of the buffer memory 126 and processing for receiving input data and storing it in the buffer memory 126 with other units connected to the PLC system bus 11. .
  • the PLC system bus control circuit 124 provides functions of a physical layer and a data link layer in the PLC system bus 11.
  • the field network controller 140 controls data exchange through the field network 2. That is, the field network controller 140 controls transmission of output data and reception of input data according to the standard of the field network 2 to be used. As described above, since the field network 2 conforming to the EtherCAT (registered trademark) standard is adopted in the present embodiment, the field network controller 140 including hardware for performing normal Ethernet (registered trademark) communication is used. It is done. In the EtherCAT (registered trademark) standard, a general Ethernet (registered trademark) controller that realizes a communication protocol according to the normal Ethernet (registered trademark) standard can be used.
  • the buffer memory 146 is a transmission buffer for data output to other devices via the field network 2 (this data is also referred to as “output data” hereinafter), and other devices via the field network 2. Or the like (hereinafter, this data is also referred to as “input data”).
  • this data is also referred to as “input data”.
  • the output data created by the arithmetic processing by the microprocessor 100 is stored in the main memory 104 originally.
  • Output data to be transferred to a specific device is read from the main memory 104 and temporarily held in the buffer memory 146.
  • Input data transferred from another device is temporarily stored in the buffer memory 146 and then transferred to the main memory 104.
  • the DMA control circuit 142 transfers output data from the main memory 104 to the buffer memory 146 and transfers input data from the buffer memory 146 to the main memory 104.
  • the field network control circuit 144 performs processing for transmitting output data of the buffer memory 146 and processing for receiving input data and storing it in the buffer memory 146 with other devices connected to the field network 2.
  • the field network control circuit 144 provides physical layer and data link layer functions in the field network 2.
  • the USB connector 110 is an interface for connecting the PLC support device 8 and the CPU unit 13. Typically, a program that can be executed by the microprocessor 100 of the CPU unit 13 and transferred from the PLC support device 8 is taken into the PLC 1 via the USB connector 110.
  • FIG. 3 is a schematic diagram showing a software configuration executed by the CPU unit 13 according to the embodiment of the present invention.
  • the software executed by the CPU unit 13 has three layers of a real-time OS 200, a system program 210, and a user program 236.
  • the real-time OS 200 is designed according to the computer architecture of the CPU unit 13, and provides a basic execution environment for the microprocessor 100 to execute the system program 210 and the user program 236.
  • This real-time OS is typically provided by a PLC manufacturer or a specialized software company.
  • the system program 210 is a software group for providing a function as the PLC 1.
  • the system program 210 includes a scheduler program 212, an output processing program 214, an input processing program 216, a sequence command operation program 232, a motion operation program 234, and other system programs 220.
  • the output processing program 214 and the input processing program 216 are executed continuously (integrally), so these programs may be collectively referred to as an IO processing program 218.
  • the user program 236 is created according to the control purpose of the user. In other words, the program is arbitrarily designed according to the line (process) to be controlled using the PLC system SYS.
  • the user program 236 realizes a control purpose for the user in cooperation with the sequence command calculation program 232 and the motion calculation program 234. That is, the user program 236 implements programmed operations by using instructions, functions, function modules, and the like provided by the sequence instruction calculation program 232 and the motion calculation program 234. Therefore, the user program 236, the sequence command calculation program 232, and the motion calculation program 234 may be collectively referred to as the control program 230.
  • the microprocessor 100 of the CPU unit 13 executes the system program 210 and the user program 236 stored in the storage unit.
  • the user program 236 is created according to a control purpose (for example, a target line or process) by the user.
  • the user program 236 is typically in the form of an object program that can be executed by the microprocessor 100 of the CPU unit 13.
  • the user program 236 is generated by compiling a source program described in a ladder language or the like in the PLC support device 8 or the like. Then, the generated user program 236 in the object program format is transferred from the PLC support device 8 to the CPU unit 13 via the connection cable 10 and stored in the nonvolatile memory 106 or the like.
  • the scheduler program 212 controls the process start in each execution cycle and the process resumption after the process interruption for the output process program 214, the input process program 216, and the control program 230. More specifically, the scheduler program 212 controls the execution of the user program 236 and the motion calculation program 234.
  • the CPU unit 13 employs a constant execution cycle (motion control cycle) suitable for the motion calculation program 234 as a common cycle for the entire process. Therefore, it is difficult to complete all processes within one motion control cycle. Therefore, depending on the priority of the process to be executed, the process to be executed in each motion control cycle and multiple motion controls A process that can be executed over a cycle is distinguished.
  • the scheduler program 212 manages the execution order of these divided processes. More specifically, the scheduler program 212 executes a program having a higher priority first in each motion control cycle period.
  • the output processing program 214 rearranges the output data generated by the execution of the user program 236 (control program 230) into a format suitable for transferring to the PLC system bus controller 120 and / or the field network controller 140.
  • the output processing program 214 issues such an instruction.
  • the input processing program 216 rearranges the input data received by the PLC system bus controller 120 and / or the field network controller 140 into a format suitable for use by the control program 230.
  • the sequence command calculation program 232 is a program that is called when a certain sequence command used in the user program 236 is executed and executed to realize the content of the command.
  • the motion calculation program 234 is a program that is executed in accordance with an instruction from the user program 236 and calculates a command value to be output to a motor driver such as the servo motor driver 3 or the pulse motor driver.
  • Other system programs 220 collectively show a group of programs for realizing various functions of the PLC 1 other than the programs individually shown in FIG.
  • the other system program 220 includes a program 222 for setting the period of the motion control cycle.
  • the period of the motion control cycle can be appropriately set according to the control purpose.
  • the user inputs information specifying the period of the motion control cycle to the PLC support device 8.
  • the input information is transferred from the PLC support device 8 to the CPU unit 13.
  • the program 222 for setting the cycle of the motion control cycle stores information from the PLC support device 8 in the nonvolatile memory 106 and generates an interrupt signal at the cycle of the motion control cycle designated by the system timer 108.
  • the system timer 108 is set.
  • the program 222 for setting the cycle of the motion control cycle is executed, so that information specifying the cycle of the motion control cycle is read from the nonvolatile memory 106, and the read information Accordingly, the system timer 108 is set.
  • the format of the information for specifying the period of the motion control cycle includes a time value indicating the period of the motion control cycle and information for identifying one of a plurality of options prepared in advance relating to the period of the motion control cycle (number Or a character) etc. can be adopted.
  • means for setting the period of the motion control cycle means for communicating with the PLC support device 8 used for acquiring information specifying the period of the motion control cycle, motion control Used to arbitrarily set the period of the motion control cycle, such as the program 222 for setting the cycle period and the configuration of the system timer 108 that can arbitrarily set the period of the interrupt signal that defines the motion control cycle. Applicable element.
  • the real-time OS 200 provides an environment for switching and executing a plurality of programs over time.
  • an output preparation interrupt (P) is used as an event (interrupt) for outputting (transmitting) output data generated by program execution of the CPU unit 13 to another unit or another device.
  • the field network transmission interrupt (X) is initialized.
  • the real-time OS 200 switches the execution target in the microprocessor 100 from the program being executed at the time of the interrupt generation to the scheduler program 212.
  • the real-time OS 200 executes the programs included in the other system programs 210 when the scheduler program 212 and the program that controls the execution of the scheduler program 212 are not executed at all.
  • a program includes, for example, a program related to communication processing via the connection cable 10 (USB) between the CPU unit 13 and the PLC support device 8.
  • FIG. 4 is a schematic diagram showing an area configuration of the main memory 104 of the CPU unit 13 according to the embodiment of the present invention.
  • main memory 104 includes various program areas 1041, control program work area 1042, PLC system bus transmission buffer 1043, PLC system bus reception buffer 1044, and field network transmission buffer 1045.
  • Field network receive buffer 1046 is formed.
  • the various program areas 1041 temporarily store codes for executing various programs.
  • control program work area 1042 output data created by the execution of the control program 230 is temporarily stored.
  • the PLC system bus transmission buffer 1043 and the PLC system bus reception buffer 1044 temporarily store data transmitted and received via the PLC system bus 11, respectively.
  • the field network transmission buffer 1045 and the field network reception buffer 1046 temporarily store data transmitted and received via the field network 2, respectively.
  • the target output data is transmitted from the control program work area 1042 to the PLC system bus. Copy to buffer 1043.
  • the output processing program 214 collects output data groups directed to the same unit in the PLC system bus transmission buffer 1043 so that a plurality of output data to be transmitted to the same unit can be transmitted at once. Rearrange the output data as follows.
  • the output processing program 214 copies the target output data from the work area 1042 of the control program to the field network transmission buffer 1045 when any output data needs to be transmitted via the field network 2. . At this time, the output processing program 214 rearranges the output data in a format that can be transmitted as a serial frame in the field network transmission buffer 1045.
  • the input processing program 216 is input data received by the PLC system bus controller 120 and stored in the PLC system bus reception buffer 1044 and / or received by the field network controller 140 and stored in the field network reception buffer 1046.
  • the input data is copied to the work area 1042 of the control program.
  • the input processing program 216 rearranges the input data in a format suitable for use by the control program 230 in the work area 1042 of the control program.
  • the DMA control circuit 122 of the PLC system bus controller 120 transfers the output data stored in the PLC system bus transmission buffer 1043 to the buffer memory 146 of the PLC system bus controller 120 and the input data stored in the buffer memory 146. Is transferred to the PLC system bus reception buffer 1044.
  • the DMA control circuit 142 of the field network controller 140 transfers the output data stored in the field network transmission buffer 1045 to the buffer memory 146 of the field network controller 140, and inputs the input data stored in the buffer memory 146 to the field network. Transfer to receive buffer 1046.
  • the control program work area 1042, the PLC system bus transmission buffer 1043, the PLC system bus reception buffer 1044, the field network transmission buffer 1045, and the field network reception buffer 1046 are configured so that each access can be controlled independently of each other. Yes. Therefore, for example, the following operations (1) to (3) can be executed in parallel.
  • the user program 236 includes a command for periodically determining whether or not a condition for starting control related to motor movement is satisfied. For example, the logic is such that it is determined whether or not a work to be treated by a driving force of a motor has been conveyed to a predetermined treatment position.
  • the user program 236 further includes a command for starting motion control in response to the determination that the control start condition is satisfied. With the start of this motion control, execution of a motion command is instructed. Then, the motion calculation program 234 corresponding to the instructed motion command is activated, and first, initial processing necessary for calculating a command value for the motor is executed each time the motion calculation program 234 is executed.
  • the command value in the first cycle is calculated in the same motion control cycle as the initial process. Therefore, the initial process and the first command value calculation process are processes that the activated motion calculation program 234 should perform in the first execution. Thereafter, the command value in each cycle is sequentially calculated.
  • FIG. 5 is a flowchart showing an outline processing procedure of motion control provided by the control program 230 (user program 236, sequence command operation program 232, and motion operation program 234) according to the embodiment of the present invention.
  • microprocessor 100 periodically determines whether or not a condition for starting control related to motor motion is satisfied (step S ⁇ b> 2). The determination as to whether or not this control start condition is satisfied is realized by the user program 236 and the sequence instruction operation program 232. If the control start condition is not satisfied (NO in step S2), the determination in step S2 is repeated.
  • step S4 the microprocessor 100 executes an initial process related to motion control.
  • This initial process includes a process for calculating the start position coordinates, end position coordinates, initial speed, initial acceleration, trajectory, and the like of the motor motion.
  • step S6 the microprocessor 100 executes a command value calculation process in the first cycle.
  • step S8 the microprocessor 100 executes an output process of the calculated command value.
  • step S10 the microprocessor 100 waits until the next motion control cycle arrives (step S10). Then, the microprocessor 100 periodically determines whether or not a control termination condition regarding the motor motion is satisfied (step S12).
  • the condition that this control end is satisfied means that the servo motor 4 has reached the end position. If the control termination condition is satisfied (YES in step S12), the processes in and after step S2 are repeated again. At this time, the activated motion calculation program 234 is maintained in an inactive state until a new control start condition is satisfied.
  • step S12 If the control termination condition is not satisfied (NO in step S12), the microprocessor 100 executes a command value calculation process in the current cycle (step S14). Furthermore, the microprocessor 100 executes an output process of the calculated command value (step S16). And the process after step S10 is repeated.
  • FIG. 6 is a schematic diagram showing an application example 1 of the CPU unit 13 according to the embodiment of the present invention.
  • a winding device 500 that winds a long sheet material 502 around a roller 520 is assumed.
  • the sheet is wound around the roller 520 while maintaining a certain tension applied to the sheet material 502.
  • a tension roller 514 disposed on the sheet material 502 delivery side is used to apply a relatively small braking (frictional force) to the sheet material 502, and the driving torque ⁇ or rotational speed of the roller 520.
  • the tension of the sheet material 502 is controlled to be a target value.
  • the winding diameter r of the roller 520 gradually increases as the sheet material 502 is wound.
  • the roller 520 is rotationally driven by a motor 504 mechanically connected to the rotating shaft.
  • the target to be controlled essentially is the tension T on the outermost peripheral surface (the position of the winding diameter r) of the roller 520, and the controllable physical quantity is the torque ⁇ or the rotational speed ⁇ of the motor 504.
  • the relationship between the torque ⁇ or the rotational speed ⁇ and the tension T changes depending on the winding diameter r of the roller 520. More specifically, as the winding diameter r of the roller 520 increases, the tension T changes only slightly even if the torque command value is changed greatly, and even if the rotation speed command value is changed slightly, the tension is changed. T changes greatly.
  • the torque or rotation speed of the motor 504 (that is, the torque command value or rotation speed command value given to the driver 506 for driving the motor 504) needs to be changed according to the winding diameter of the roller 520.
  • the tension T generated in the sheet material 502 is detected, and the torque command value or the speed command value is calculated so that the detected value of the tension T matches the target value.
  • a tension detection roller 512 biased by a spring is provided, and the tension detection roller 512 is pressed against the sheet material 502 moving in the air. Then, the sheet material 502 is slightly bent, and the repulsive force (the tension detection roller 512 is pushed upward) by the pressing force of the tension detection roller 512 (the force by which the spring pulls the tension detection roller 512 downward) and the tension of the sheet material 502.
  • the tension detecting roller 512 is stationary where the force is balanced.
  • the position of the tension detecting roller 512 changes according to the tension of the sheet material 502, this position is detected by a position sensor (rotary encoder) 510.
  • the detected position of the tension detection roller 512 is input to the PLC 1.
  • the position of the tension detection roller 512 is a value corresponding to the magnitude of the tension T of the sheet material 502.
  • the microprocessor 100 of the PLC CPU unit 13 executes the user program 236 to input the detected position of the tension detection roller 512 and the current torque value and speed value of the motor 504 that drives the roller 520. In order to bring the calculated tension T closer to the target value by calculating the tension T of the sheet material 502 based on the position of the tension detection roller 512 and further performing an operation according to the mechanical system of the winding device 500. Calculate the required torque command value or speed command value. The calculated torque command value or speed command value is sent to the motion calculation program 234 executed by the microprocessor 100.
  • the winding diameter r of the roller 520 in each cycle may be detected, and the command value (torque command value or speed command value) may be calculated based on the detection result.
  • a winding diameter detection roller 516 urged by a spring is provided, and the winding diameter detection roller 516 is pressed against the center side of the roller 520. Since the position of the winding diameter detection roller 516 changes in accordance with the winding diameter of the roller 520, this position is detected by the position sensor 518.
  • the microprocessor 100 executes the motion calculation program 234 and the output processing program 214 associated therewith, so that the command value (torque command value or speed command value) given from the user program 236 is transmitted via the field network 2. To the driver 506 that drives the motor 504.
  • the user program 236 is in charge of substantially all parts of the motion calculation, and the motion calculation program 234 is in charge of output management of command values for the driver 506.
  • FIG. 7 is a schematic diagram showing an application example 2 of the CPU unit 13 according to the embodiment of the present invention.
  • a cutting apparatus 600 that cuts sheet material 602 at the position of a pattern break while feeding sheet material 602 on which a certain pattern is repeatedly printed is assumed.
  • the operation of the motor 606 that moves the cutter 604 used for cutting the sheet material 602 is controlled.
  • the PLC 1 controls an electronic cam operation that moves the cutter 604 up and down as the rollers 612 and 614 that feed the sheet material 602 rotate by a predetermined angle.
  • a mark 630 is printed on the sheet material 602 in association with the print position of the pattern.
  • a detection sensor 610 (typically an optical sensor) is provided on the conveyance path of the sheet material 602, and the passage of these marks 630 is detected using this sensor 610.
  • the roller 614 for feeding the sheet material 602 is driven to rotate by a mechanically connected motor 618.
  • the motor 618 is driven by a motor driver 622.
  • the motor 618 mechanically connected to the roller 614 is provided with a rotary encoder 624 for detecting the rotation angle (rotation position).
  • the rotation angle (rotation position) detected by the rotary encoder 624 is input to the PLC 1.
  • the microprocessor 100 of the CPU unit 13 of the PLC executes the user program 236 so that the rotation angle (rotation) of the roller 614 is detected based on the detected value of the rotary encoder 624 and the detected value of the mark 630 by the sensor 610.
  • the initial phase of the cutting timing indicated as (position) is calculated, and the phase and period correction values in each subsequent cycle are calculated periodically.
  • the calculated phase and period correction values are sent to the motion calculation program 234 executed by the microprocessor 100.
  • the microprocessor 100 controls the operation of the motor 618 by executing the motion calculation program 234 and reflecting the initial phase of the given cutting timing and the correction values of the phase and period. In other words, the execution of the motion calculation program 234 outputs the command value reflecting the initial phase of the cutting timing and the correction values of the phase and period to the motor driver 622.
  • a visual sensor having a camera may be used to specify the position of the pattern on the sheet material 602.
  • the camera is arranged so that the visual field range includes the pattern of the sheet material 602.
  • the visual sensor specifies the position of the pattern on the sheet material 602 by performing a matching process between the image captured by the camera and the model image indicating the pattern registered in advance. Then, the detection value of the corresponding rotary encoder 624 is acquired according to the position of the specified pattern.
  • FIG. 8 is a schematic diagram showing an application example 3 of the CPU unit 13 according to the embodiment of the present invention.
  • a transport system 700 in which a transport vehicle 710 moves on a linear rail 702 is assumed.
  • the left and right drive wheels 712 and 722 are driven by independent motors 714 and 724, respectively.
  • the left and right drive wheels 712 and 722 Since the amount of rotation of the left and right drive wheels 712 and 722 is ideally the same as long as the vehicle travels on the linear rail 702, the left and right are the same for each motion control cycle from the PLC 1 to the drivers 718 and 728.
  • the rotational position command values may be given respectively. However, depending on the load of the load mounted on the transport vehicle 710, the state of the rail 702, etc., a situation may occur in which only one of the driving wheels is idle.
  • the rotational position command value for the right drive wheel 722 is corrected with the idle rotation amount (the amount of idle rotation is added). ) It is necessary to give a command value.
  • a motion command called multi-axis composite positioning is prepared. This motion command is a command value of the original rotational position for the main shaft (for example, the left drive wheel 712).
  • the position calculated by adding the value of the auxiliary shaft is set as a command value for the rotational position of the slave shaft (for example, the right drive wheel 722).
  • the microprocessor 100 executes the user program 236 to acquire the rotational positions of the left and right drive wheels 712 and 722 (outputs of the rotary encoders 716 and 726 provided on the left and right drive wheels 712 and 722, respectively) at a constant cycle. Then, it is determined whether or not the difference in rotational position between the left and right drive wheels 712 and 722 exceeds a preset allowable range. If the difference in rotational position exceeds a preset allowable range, the microprocessor 100 updates the value (position) of the auxiliary shaft so as to fall within the allowable range. Further, the updated value (position) of the auxiliary axis is sent to the motion calculation program 234 executed by the microprocessor 100.
  • the microprocessor 100 executes the motion calculation program 234 to calculate the spindle command value for each user program execution cycle in accordance with a separately designated motion command, and to give the latest auxiliary axis value (position) given.
  • the command value of the slave shaft is calculated by correcting the command value of the main shaft.
  • Each calculated command value is output to the corresponding driver 718 and 728.
  • FIG. 9 is a sequence diagram showing an overall processing operation according to Embodiment 1 of the present invention.
  • microprocessor 100 includes at least IO processing program 218 (output processing program 214 and input processing program 216) and user program 236 (first program).
  • the motion calculation program 234 are in an executable state.
  • the real-time OS 200 holds processes (or threads) related to the respective programs in an executable state
  • the scheduler program 212 uses the real-time OS 200 and hardware resources (such as the system timer 108).
  • each program is executed at an appropriate timing and in an appropriate order.
  • the start / interruption / end of execution related to each program is controlled by the scheduler program 212, but the processing related to the scheduler program 212 is not shown in FIG.
  • the field network controller 140 receives the input data for motion control and stores the input data in the field network reception buffer 1046 (FIG. 4), and / or the PLC system bus controller 120 receives the input data for motion control.
  • the received data is received and stored in the PLC system bus reception buffer 1044 (FIG. 4).
  • the motion control input data stored in the field network reception buffer 1046 and / or the PLC system bus reception buffer 1044 is in accordance with the instruction of the IO processing program 218 and the work area related to the user program 236 (typically, the control It is transferred to the work area 1042 of the program (part of FIG. 4). Thereby, when the user program 236 is executed by the microprocessor 100, the input data for motion control can be accessed.
  • the motion control input data stored in the field network reception buffer 1046 and / or the PLC system bus reception buffer 1044 is a work area related to the motion calculation program 234 (typically It is transferred to the work area 1042 (part of FIG. 4) of the control program.
  • the motion calculation program 234 is executed by the microprocessor 100, the input data for motion control can be accessed.
  • the output data of the user program 236 is calculated using the input data for motion control, and the calculated output data is used as a work area (typically, control for the motion calculation program 234). It is transferred to the work area 1042 of the program (part of FIG. 4). Thereby, when the motion calculation program 234 is executed by the microprocessor 100, the output data of the user program 236 can be accessed.
  • a motion command value is calculated using necessary data among the motion control input data and the user program output data, and the calculated motion command value data is converted to the IO processing program 218.
  • the work area typically part of the work area 1042 (FIG. 4) of the control program.
  • the motion command value data is output in accordance with the instruction of the IO processing program 218. More specifically, the motion command value data stored in the work area 1042 (FIG. 4) of the control program is transferred to the field network transmission buffer 1045 (FIG. 4). Further, following the data transfer to the field network transmission buffer 1045, the field network controller 140 transmits the motion command value data to the servo motor driver 3.
  • the “motion control cycle” is a cycle of a series of processes executed at a cycle of execution and communication of the motion calculation program 234, that is, a cycle of giving motion command value data to the servo motor driver 3.
  • the range (from the start to the end) of one motion control cycle may be grasped by any of A, B, and C shown on the right side of FIG.
  • the motion control cycle is not defined by the start timing and / or end timing of a specific program, but is simply a processing cycle including one execution of the motion calculation program 234.
  • the left side of FIG. 9 shows motion control cycles 1 to 3 (for three cycles) when viewed in the way of dividing A shown on the right side of FIG.
  • the scheduler program 212 causes the microprocessor 100 to execute the motion calculation program 234 for each motion control cycle.
  • the instruction to be started and the instruction to cause the microprocessor 100 to start the execution of the user program 236 (first user program) every user program execution cycle (in this example, corresponding to the motion control cycle) are included.
  • the scheduler program 212 performs an IO process (output process and input process), an execution start of the user program 236, an execution end of the user program 236, and an execution start of the motion operation program 234 in this order in the user program execution cycle. Including an instruction to repeat at a period corresponding to the period.
  • the cycle phase (cycle start timing) does not always match between a series of processing cycles by the instruction and the user program execution cycle.
  • the output process is first executed according to the instruction of the output process program 214, and then the input process is executed according to the instruction of the input process program 216. And the input processing may be executed in reverse order, or in parallel if possible.
  • the CPU unit 13 of the PLC 1 performs a motion control cycle with a fixed cycle of motion command value data output processing, motion control input data input processing (IO processing), and execution of the motion calculation program 234. Each is configured to be repeatable. Further, the CPU unit 13 of the PLC 1 creates a user program 236 that is created according to the control purpose of the user and includes a process for giving an instruction necessary for the execution to the motion calculation program 234, which is an integral multiple of the cycle of the motion control cycle. It is configured to be able to be repeatedly executed for each user program execution cycle of the period.
  • the communication circuit (the PLC system bus controller 120 and the field network controller 140) included in the CPU unit 13 transmits at least a part of the output command processing and at least the input processing for each motion control cycle. As a part, it receives input data for motion control.
  • the motion command value data output process (FIG. 9) reflecting the input data for motion control input in the input process.
  • the time required for (6) process) shown in (2) can be made shorter than the period of the user program execution cycle.
  • the cycle of the user program execution cycle is equal to the cycle of the motion control cycle.
  • the scheduler program 212 causes the microprocessor 100 to send the user information to the microprocessor 100 after the output processing and input processing (IO processing) in the motion control cycle.
  • Instructions for causing the program 236 and the motion calculation program 234 to be executed in this order are included.
  • output processing and input processing (IO processing) related to motion control can be performed prior to execution of the user program 236 and the motion calculation program 234, and thereby these input / output operations can be performed. Therefore, it is possible to reduce the variation in the communication cycle. Therefore, the movement of the motor can be controlled with higher accuracy.
  • FIG. 10 is a sequence diagram showing the overall processing operation in the comparative example related to the overall processing operation shown in FIG. 9 shows an example in which the respective programs are executed in the order of “IO processing program 218”, “user program 236”, and “motion calculation program 234”, but FIG. 10 shows a comparative example. , “IO processing program 218”, “motion operation program 234”, and “user program 236” are executed in this order.
  • the input data for motion control input in the input process from the start of the input process (the process (1) shown in FIG. 10). It takes time corresponding to two cycles of the execution cycle of the user program 236 until the output processing of the motion command value data reflecting the above (processing (6 ′) shown in FIG. 10). As a result, the control is delayed by a time corresponding to one cycle of the user program execution cycle as compared with the program execution sequence shown in FIG.
  • the description of the processes (1) to (6) in the comparative example shown in FIG. 10 is the same as the description of the processes (1) to (6) in FIG.
  • the description of the processes (1 ′) to (6 ′) in FIG. 10 is the same as the description of the processes (1) to (6) in FIG.
  • the processing of (1) to (6) takes a time longer by one motion control cycle than the cycle of the user program execution cycle. Then, the processing (1 ') to (6') starts during the processing (1) to (6).
  • the motion calculation program in the motion control cycle 2 is performed in the sequence shown in FIG.
  • M2 the motion calculation program 234
  • input processing of new input data for motion control (the process (1 ′) shown in FIG. 10) is performed by the motion calculation program 234.
  • Complete before execution (M2) Therefore, when the motion calculation program 234 is executed (M2), it should not be used in addition to the motion control input data to be originally used (input data transferred by the process (3) shown in FIG. 10).
  • FIG. 11 is a sequence diagram showing an overall processing operation according to Embodiment 2 of the present invention.
  • “other processing P” is executed from the end of execution of IO processing program 218 to the start of execution of user program 236.
  • “other processing Q” is executed from the end of execution of the user program 236 to the start of execution of the motion calculation program 234.
  • “other processing R” is executed from the end of execution of the motion calculation program 234 to the start of execution of the IO processing program 218.
  • the processing content of “other processing P”, “other processing Q”, and “other processing R” is any processing as long as it does not inhibit the normal execution of the user program 236 and the motion calculation program 234. There may be. More specifically, execution of other system programs 220 (FIG. 3) is assumed as “other processing”. Other processing contents of the system program 220 include, for example, input data and / or output data logging, failure diagnosis, communication with the PLC support device 8, and communication with a host computer via a LAN (this embodiment) In the case where the CPU unit 13 according to the embodiment has a function of communicating with a host computer via Ethernet (registered trademark)).
  • the input process and the output process related to the sequence calculation included in the user program 236 may be performed together with the input process of the motion control input data and the output process of the motion command value data while the IO process program 218 is executed. However, it may be performed as one of the “other processes” at a different timing.
  • FIG. 11 shows a process example in which three types of “other processes” are executed, but the number of “other processes” is not particularly limited. Only one or two of these may be present. Alternatively, a plurality of types of processes may be sequentially executed in a single “other process”.
  • FIG. 12 is a sequence diagram showing the overall processing operation according to Embodiment 3 of the present invention.
  • the sequence shown in FIG. 12 does not include “other process P” and “other process Q” in the sequence shown in FIG. 11, and “other process R” is the low priority user program 236-2 (first process). This corresponds to the case where the second user program is executed.
  • the high priority user program 236-1 includes a command for calculating user program output data used for calculation in the motion calculation program 234 using the motion control input data.
  • the high priority user program 236-1 further includes a motion command.
  • This motion command includes a command for instructing the motion calculation program 234 to start execution by giving parameters necessary for execution. For example, the user can program to execute a motion command when certain conditions are established based on input data representing the state of the detection switch 6 (FIG. 1).
  • the low priority user program 236-2 does not include an instruction for calculating user program output data using the motion control input data.
  • the low-priority user program 236-2 includes the processing contents of a portion that is slower than the motion control.
  • the low priority user program 236-2 is stored in the nonvolatile memory 106 (FIG. 2), and various program areas 1041 (FIG. 2) allocated in the main memory 104 at the time of execution. 4).
  • the period of the execution cycle of the low-priority user program 236-2 is the period of the motion control cycle.
  • the period is set to an integer multiple of 2 or more.
  • the cycle of the execution cycle of the low priority user program 236-2 is set to four times the cycle of the motion control cycle. Therefore, the low priority user program 236-2 is executed by regarding the motion control cycles 1 to 4 shown in FIG. 12 as one execution cycle.
  • the high-priority user program 236-1 and the motion calculation program 234 are implemented in a form included in one thread called a motion control thread. Therefore, the high priority user program 236-1 and the motion calculation program 234 are continuously executed without being controlled by the scheduler program 212.
  • the motion calculation program 234 can also be regarded as being controlled by the scheduler program 212 through the execution control of the entire motion control thread.
  • the motion command is included only in the high priority user program 236-1, and the low priority It is preferable that the user program 236-2 is configured not to include a motion command in order to facilitate understanding of the control operation.
  • the output processing program 214, the input processing program 216, the high-priority user program 236-1, and the motion calculation program 234 shown in FIG. 12 may be implemented in a form included in one motion control thread.
  • the execution order of these programs may be excluded from the scheduler program 212, and the scheduler program 212 may control only the activation of the motion control thread.
  • the scheduler program 212 can be regarded as performing processing for starting execution of each program included in the motion control thread by controlling the execution start timing of the motion control thread.
  • the fact that the scheduler program 212 starts executing a certain program is not necessarily limited to starting the execution of the program individually.
  • Priority is given to each of the output processing program 214, the input processing program 216, the motion control thread (the high priority user program 236-1 and the motion calculation program 234), and the low priority user program 236-2.
  • the priorities given to these programs and threads are, for example, in the order of the output processing program 214, the input processing program 216, the motion control thread, and the low priority user program 236-2 from the highest.
  • the scheduler program 212 causes the microprocessor 100 to execute the programs / threads in descending order in each motion control cycle.
  • “performing the microprocessor 100 to execute” is also simply expressed as “execute”.
  • the scheduler program 212 is not limited to being an object instance itself, but may be a program (process) that is incorporated into various other object instances (for example, the output processing program 214) and operates. For example, it may be a program that operates by being called in another object instance.
  • Symbols P and X shown in FIG. 12 indicate interrupt signals generated at regular intervals from the system timer 108 (FIG. 2). Specifically, “P” indicates an output preparation interrupt, and “X” indicates a field network transmission interrupt. In FIG. 12, the numbers “P” and “X” indicating interrupts are added to the numbers indicating the motion control cycle numbers.
  • the scheduler program 212 In response to the output preparation interrupt (P-1), the scheduler program 212 first executes the output processing program 214 according to the priority.
  • the target output data is sent from the control program work area 1042 (FIG. 4) to the PLC system bus transmission buffer 1043. Copy to. Further, when it is necessary to transmit any output data via the field network 2, the output processing program 214 copies the target output data from the control program work area 1042 to the field network transmission buffer 1045.
  • the output data includes motion command value data that is the execution result of the motion calculation program 234 and other output data that is the execution result of the user program 236.
  • the output processing program 214 instructs the PLC system bus controller 120 to execute transmission (reference A).
  • the output processing program 214 stops executing once the output data copy is completed.
  • the scheduler program 212 resumes the execution of the output processing program 214 in response to the field network transmission interrupt (X-1).
  • the output processing program 214 instructs the field network controller 140 to execute transmission (reference B). Then, the output processing program 214 ends its execution.
  • the scheduler program 212 next executes the input processing program 216 according to the priority.
  • the input processing program 216 waits until it receives a reception completion notification (symbol C) from the PLC system bus controller 120 or a reception completion notification (symbol D) from the field network controller 140.
  • a reception completion notification (symbol C) from the PLC system bus controller 120 is generated first, followed by a reception completion notification (symbol D) from the field network controller 140. As shown, this order of occurrence may be reversed.
  • the input processing program 216 controls the work area of the control program from the PLC system bus reception buffer 1044 or the field network reception buffer 1046 corresponding to which reception completion notification.
  • the input data is copied to 1042.
  • the input data includes motion control input data and other input data necessary for executing the user program 236.
  • the input processing program 216 terminates execution when copying of input data is completed.
  • the scheduler program 212 executes the motion control thread next according to the priority. That is, the user program 236 starts execution.
  • the user program 236 calculates user program output data using the motion control input data. In addition, the user program 236 generates other output data. As the execution of the user program 236 ends, the motion calculation program 234 starts executing. The motion calculation program 234 calculates motion command value data using necessary data among the motion control input data and the user program output data.
  • the scheduler program 212 When the execution of the motion calculation program 234 is completed, the scheduler program 212 finally executes the low priority user program 236-2 according to the priority.
  • the execution of the low priority user program 236-2 is interrupted in response to the output preparation interrupt (P-2) of the next motion control cycle.
  • an interrupt with a fixed period that triggers to start a series of processes by interrupting the process being executed, such as an output preparation interrupt (P) in the present embodiment, such an interrupt is controlled. It is preferable to grasp this as a cycle break.
  • P output preparation interrupt
  • the DMA control circuit 122 of the PLC system bus controller 120 In response to the transmission execution instruction (reference A), the DMA control circuit 122 of the PLC system bus controller 120 outputs the output data stored in the PLC system bus transmission buffer 1043 of the main memory 104 to the buffer memory of the PLC system bus controller 120. To 126.
  • the PLC system bus control circuit 124 transfers the target output data from the buffer memory 126 to the unit that is the destination of each output data. Thereafter, the PLC system bus control circuit 124 transfers input data from each unit on the PLC system bus 11 to the buffer memory 126 of the PLC system bus controller 120.
  • the DMA control circuit 122 of the PLC system bus controller 120 transfers the input data stored in the buffer memory 126 to the PLC system bus reception buffer 1044 of the main memory 104. Thereafter, when the transfer of the input data is completed, the DMA control circuit 122 transmits a reception completion notification (symbol C) to the microprocessor 100.
  • the DMA control circuit 142 of the field network controller 140 transfers the output data stored in the field network transmission buffer 1045 of the main memory 104 to the buffer memory 146 of the field network controller 140 in response to the transmission execution instruction (symbol B). To do.
  • the field network control circuit 144 transfers the output data from the buffer memory 146 to the destination device of each output data. Thereafter, the field network control circuit 144 transfers input data from each device on the field network 2 to the buffer memory 146 of the field network controller 140.
  • the DMA control circuit 142 of the field network controller 140 transfers the input data stored in the buffer memory 146 to the field network reception buffer 1046 of the main memory 104. Thereafter, when the transfer of the input data is completed, the DMA control circuit 142 transmits a reception completion notification (symbol D) to the microprocessor 100.
  • EtherCAT registered trademark
  • output data addressed to each unit and input data from each unit are included in a single frame.
  • the transmitted frame is sequentially transferred via each unit connected in a daisy chain.
  • Each unit other than the CPU unit 13 is set as a slave.
  • the frame returns to the CPU unit 13 via each unit which is a slave again by turning back the full-duplex communication path.
  • Each slave selectively captures the output data addressed to its own slave while passing the outgoing frame through the FIFO (First In First Out) method, and writes the input data generated by its own unit to the appropriate position in the frame. .
  • Each slave passes the return frame without reading the output data and writing the input data.
  • a frame is transmitted to each unit individually, or a single frame is transmitted and received instead of individually receiving a frame from each unit. This corresponds to the transfer of output data from the buffer memory 146 to each unit and the transfer of input data from each unit to the buffer memory 146 by the field network control circuit 144.
  • EtherCAT registered trademark
  • the field network 2 when a frame including output data is transmitted and the frame returns via each unit of the slave, the input data is included in the frame. It will be. Therefore, regarding the execution order, it is natural to execute the input process after the output process. However, depending on the type of the field network 2 to be used, it may be preferable to execute the output process after the input process. As described above, the order of the output process and the input process may be appropriately designed according to the specifications of the field network 2 and the like.
  • H4 Motion control cycles 2 to 4
  • the operations in the motion control cycles 2 to 4 are the same as the operations in the motion control cycle 1. In the following, differences from the operation in the motion control cycle 1 will be mainly described.
  • the scheduler program 212 executes the unexecuted portion of the low priority user program 236-2 when the execution of the motion calculation program 234 is completed.
  • the execution of the low priority user program 236-2 is interrupted again in response to the output preparation interrupt (P-2) of the next motion control cycle.
  • the scheduler program 212 executes the unexecuted portion of the low priority user program 236-2 when the execution of the motion calculation program 234 is completed.
  • the sequence shown in FIG. 12 shows an example in which the low priority user program 236-2 finishes executing within the motion control cycle 3. In this case, there is a waiting time from the end of execution of the low priority user program 236-2 to the output preparation interrupt (P-3) of the next motion control cycle.
  • the user program execution cycle of the low priority user program 236-2 started from the motion control cycle 1 is still continued, but there is no unexecuted portion of the low priority user program 236-2.
  • the scheduler program 212 determines that there is no program to be executed after the execution of the motion calculation program 234, and waits until the output preparation interrupt (P-4) of the next motion control cycle.
  • the other system program 220 may be executed using the control of the real-time OS during the standby time for the program that is controlled by the scheduler program 212.
  • motion control cycle 5 In motion control cycle 5 and later, the same operation as motion control cycles 1 to 4 is repeated.
  • the scheduler program 212 when the low priority user program 236-2 (second user program) is stored in the nonvolatile memory 106 (FIG. 2), the low priority user program 236-2.
  • the microprocessor 100 starts execution of the low-priority user program 236-2 in the surplus time from the end of the execution of the first motion calculation program 234 to the end of the motion control cycle,
  • the microprocessor 100 is caused to start executing the unexecuted portion. .
  • the high-priority user program 236-1 includes a command for calculating user program output data used for calculation in the motion calculation program 234 using the motion control input data.
  • the low priority user program 236-2 includes instructions for realizing all or part of the processing other than that included in the high priority user program 236-1.
  • the amount of processing allocated to the high priority user program 236-1 is smaller than when the high priority user program 236-1 includes an instruction for realizing all processing, and thus the high priority user program 236-1. Execution time can be shortened. Therefore, there is a possibility that the cycle of the motion control cycle can be further shortened.
  • the motion command value data output process and the motion control input data input process within the shorter motion control cycle, the execution of the high priority user program 236-1, and the execution of the motion calculation program 234 are appropriately performed. It becomes possible to do.
  • the sequence shown in FIG. 12 shows an example in which the field network controller 140 is configured to receive a transmission execution instruction from the scheduler program 212 (reference symbol B). Alternatively, the field network controller 140 may receive the interrupt signal from the system timer 108 and execute transmission.
  • the user program 236 and / or the motion operation program 234 can directly access the field network transmission buffer 1045 and / or the field network reception buffer 1046 without copying data in accordance with the instructions of the output processing program 214 and the input processing program 216. May be.
  • the data output processing and input processing via the PLC system bus 11 may also be executed independently of the scheduler program 212. Therefore, the CPU unit 13 can be configured to execute output processing and input processing independently of the scheduler program 212. That is, it is not always necessary for the scheduler program 212 to start execution of output processing and input processing.
  • the microprocessor 100 accesses each transmission buffer and reception buffer of the main memory 104 from when there is an output preparation interrupt (P) until there is a reception completion notification (references C and D). It is preferable to configure so that it does not occur.
  • FIG. 13 is a sequence diagram showing an overall processing operation according to Embodiment 4 of the present invention.
  • the sequence shown in FIG. 13 shows a case where the cycle of the user program execution cycle is twice the cycle of the motion control cycle. Note that the period of the execution cycle of the IO processing program 218 and the motion calculation program 234 coincides with the period of the motion control cycle.
  • the motion command value data is calculated using only the motion control input data (process (3)).
  • the calculated motion command value data is transferred to the work area related to the IO processing program 218 (process (7)). Further, the transferred motion command value data is output in accordance with the instruction of the IO processing program 218 (process (8)).
  • the field network controller 140 receives new input data for motion control and stores the new input data in the field network reception buffer 1046 (FIG. 4), and / or the PLC system bus controller 120
  • the control input data is received and the new input data is stored in the PLC system bus reception buffer 1044 (FIG. 4) (process (9)).
  • new motion control input data stored in the field network reception buffer 1046 and / or the PLC system bus reception buffer 1044 is transferred to the work area related to the motion calculation program 234 in accordance with an instruction of the IO processing program 218. (Processing of (10)).
  • the period of the user program execution cycle does not need to coincide with the period of the motion control cycle, and can generally be an integer multiple of 2 or more of the period of the motion control cycle.
  • the updated motion command value data can be output in a control cycle shorter than the execution cycle of the user program 236.
  • the motion command value data can be updated only for each user program execution cycle by reflecting the user program output data calculated by the user program 236 using the motion control input data.
  • the motion of the motor may be controlled more smoothly by updating and outputting the motion command value data.
  • this embodiment is suitable for application to the above-described application example 3 (FIG. 8).
  • an updated command value is output for each motion control cycle.
  • the position of the auxiliary shaft that gives a deviation (correction value) between the command position of the main shaft and the command value of the slave shaft is updated every user program execution cycle.
  • the update cycle of the position of the auxiliary axis is longer than the update cycle of the command value for the master axis and the command value for the slave axis.
  • this is not a problem.
  • the advantage is that the command value update cycle is short, and that the command value for the slave shaft using the auxiliary shaft can be corrected although it is longer than the command value update cycle.
  • the range of motion control cycle ranges may be any one of A, B, and C.
  • the execution control typically, the execution of the user program 236 is interrupted in the middle of each motion control cycle and the execution of the motion calculation program 234 is started (typically, Use interrupt signals).
  • the user program execution cycle may be shortened. That is, according to the way of dividing C, the scheduler program 212 causes the microprocessor 100 to execute, output processing, and input processing of the motion arithmetic program 234 in the user program execution cycle (for example, from T1 to T3 in FIG. 13). The instruction for causing the user program 236 to be executed in this order is included. As a result, in each motion control cycle (from T1 to T2 and from T2 to T3), execution of the motion calculation program, output processing and input processing, and execution of the first user program are executed in this order. become.
  • the time from the execution of the output process and the input process to the end of the motion control cycle may vary from one motion control cycle to another, but this time is used for the execution of the user program 236. It can be used without waste. As a result, since the standby time of the microprocessor 100 is less likely to occur, there is a possibility that the user program execution cycle can be further shortened.
  • FIG. 14 is a sequence diagram showing the overall processing operation in the comparative example related to the overall processing operation shown in FIG.
  • FIG. 13 shows an example in which the respective programs are executed in the order of “IO processing program 218”, “user program 236”, and “motion calculation program 234”, but FIG. 14 shows a comparative example. , “IO processing program 218”, “motion operation program 234”, and “user program 236” are executed in this order.
  • the input data for motion control input in the input process from the start of the input process (the process (1) shown in FIG. 14).
  • the time corresponding to three periods of the motion control cycle that is, the motion control cycle than the period of the user program execution cycle It takes a long time for one cycle.
  • the control is delayed by a time corresponding to one cycle of the motion control cycle as compared with the execution order of the programs shown in FIG.
  • FIG. 15 is a schematic diagram showing a hardware configuration of the PLC support device 8 used by being connected to the CPU unit according to the embodiment of the present invention.
  • PLC support device 8 is typically configured by a general-purpose computer. From the viewpoint of maintainability, a notebook personal computer with excellent portability is preferable.
  • the PLC support device 8 includes a CPU 81 that executes various programs including an OS, a ROM (Read Only Memory) 82 that stores BIOS and various data, and data that is necessary for the CPU 81 to execute the programs.
  • a memory RAM 83 that provides a work area for storing the program, and a hard disk (HDD) 84 that stores programs executed by the CPU 81 in a nonvolatile manner.
  • HDD hard disk
  • the PLC support device 8 further includes a keyboard 85 and a mouse 86 that accept operations from the user, and a monitor 87 for presenting information to the user. Furthermore, the PLC support device 8 includes a communication interface (IF) 89 for communicating with the PLC 1 (CPU unit 13) and the like.
  • IF communication interface
  • CD-ROM 9 Compact Disk-Read Only Memory
  • HDD hard disk
  • FIG. 16 is a schematic diagram showing a software configuration of the PLC support device 8 used by being connected to the CPU unit according to the embodiment of the present invention.
  • the PLC support device 8 executes the OS 310 and provides an environment in which various programs included in the PLC support program 320 can be executed.
  • the PLC support program 320 includes an editor program 321, a compiler program 322, a debugger program 323, a simulation sequence instruction calculation program 324, a simulation motion calculation program 325, and a communication program 326.
  • Each program included in the PLC support program 320 is typically distributed in a state stored in the CD-ROM 9 and installed in the PLC support device 8.
  • the editor program 321 provides functions such as input and editing for creating the user program 236. More specifically, the editor program 321 provides a storage function and an editing function for the created source program 330 in addition to a function for the user to operate the keyboard 85 and the mouse 86 to create the source program 330 of the user program 236. To do. The editor program 321 accepts an input of the source program 330 from the outside.
  • the compiler program 322 provides a function of compiling the source program 330 and generating a user program 236 in an object program format that can be executed by the microprocessor 100 of the CPU unit 13.
  • the compiler program 322 provides a function of compiling the source program 330 and generating a user program 340 in an object program format that can be executed by the CPU 81 of the PLC support device 8.
  • the user program 340 is a simulation object program used for simulating the operation of the PLC 1 by the PLC support device 8.
  • the debugger program 323 provides a function for debugging the source program of the user program.
  • the contents of the debugging include operations such as partially executing a range designated by the user in the source program, and tracking temporal changes in variable values during the execution of the source program.
  • the debugger program 323 further provides a function of executing a user program 340 that is an object program for simulation.
  • the sequence instruction calculation program 324 and the simulation motion calculation program 325 included in the PLC support program 320 are used instead of the sequence instruction calculation program 232 and the motion calculation program 234 included in the system program of the CPU unit 13. It is done.
  • the communication program 326 provides a function of transferring the user program 236 to the CPU unit 13 of the PLC 1.
  • the system program 210 mounted on the PLC 1 is stored in the nonvolatile memory 106 of the CPU unit 13 at the manufacturing stage of the CPU unit 13.
  • the system program 210 is stored in the CD-ROM 9
  • the user copies the system program 210 of the CD-ROM 9 to the PLC support device 8, and copies the system program using the function provided by the communication program 326. It is also possible to transfer 210 to the CPU unit 13.
  • the real-time OS 200 executed by the CPU unit 13 of the PLC 1 is stored in the CD-ROM 9, the real-time OS 200 can also be reinstalled in the PLC 1 by a user operation.

Landscapes

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

Abstract

 スケジューラプログラムは、モーション制御サイクルごとにモーション演算プログラムの実行を開始させる命令と、マイクロプロセッサに、第1のユーザプログラム実行サイクルごとに第1のユーザプログラムの実行を開始させる命令と、出力処理および入力処理、第1のユーザプログラムの実行開始、第1のユーザプログラムの実行終了、ならびに、モーション演算プログラムの実行開始を、この順序で、第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含む。

Description

PLCのCPUユニット、PLC用システムプログラムおよびPLC用システムプログラムを格納した記録媒体
 本発明は、機械や設備などの動作を制御するために用いられるPLC(Programmable Logic Controller、あるいはプログラマブルコントローラとも称される)における出力処理、入力処理、演算処理などを含む制御動作のスケジューリングに関する。
 PLCは、たとえば、ユーザプログラムを実行するマイクロプロセッサを含むCPU(Central Processing Unit)ユニット、外部のスイッチやセンサからの信号入力および外部のリレーやアクチュエータへの信号出力を担当するIO(Input Output)ユニットといった複数のユニットで構成される。それらのユニット間で、ユーザプログラム実行サイクルごとに、PLCシステムバスおよび/またはフィールドネットワークを経由してデータの授受をしながら、PLCは制御動作を実行する。
 機械、設備などの動作の制御としては、モータの運動を制御するためのモーション制御が含まれる場合がある。従来、このようなモーション制御、典型的には、モータを駆動するモータドライバに対して周期的に指令値を出力する制御処理(モーション演算プログラムの実行)は、PLCとは別に設けたモーションコントローラにおいて行われていた。しかしながら、情報技術の分野においては、マイクロプロセッサや通信ネットワークの高速化が進展しつつある。そのため、PLCにおいてもそれらの技術を利用して、1つのマイクロプロセッサにおいて、ユーザプログラムだけでなくモーション演算プログラムをも実行することが可能になってきた。
 たとえば、特許文献1(特開2007-140655号公報)には、モータを制御するモーション制御機能とシーケンス演算(ユーザプログラム)を実行するPLC機能とを、1つのCPUで処理する構成が開示されている。より具体的には、基本クロックの1サイクルごとに、「定周期モーション制御処理および各軸処理」と「高速シーケンス処理」とを実行し、さらに各基本クロックサイクル内の残りの時間において、「低速シーケンス処理」または「非定周期モーション制御処理」を実行することが開示されている。
特開2007-140655号公報
 モーション演算プログラムを実行する機能をPLCのマイクロプロセッサに統合するにあたり、従来のモーションコントローラと同様に、一定の短い周期の実行サイクル内でモータドライバに対する指令値の算出およびその算出結果の出力を行い、各実行サイクルの残りの時間でユーザプログラムの実行およびその他のPLC動作を行うように構成しようと考えることは自然である。しかしながら、各実行サイクルにおける残り時間の長さは限られているため、各実行サイクル内でPLCとして動作するために必要なすべての処理を行うことはできない。このような場合に、どの実行サイクルにおける残り時間でどのような処理を行うのがよいのかについては明らかではない。さらに、ユーザプログラムの実行には、入力処理および出力処理が必要であり、モーション演算実行にも少なくとも出力処理(場合によっては、入力処理についても)が必要であるが、これらの処理をどのタイミングで行うべきであるかについても明らかではない。
 上述の特許文献1においては、「定周期モーション制御処理および各軸処理」、「高速シーケンス処理」、「低速シーケンス処理」、および、「非定周期モーション制御処理」の各処理について、具体的にどのような処理内容が想定されているのかについては説明されていない。特に、具体的な処理内容からみた場合に「高速シーケンス処理」と「低速シーケンス処理」とがどのように区別されるのか、および、「非定周期モーション制御処理」とはどのような処理内容を想定した処理であるのか、といった事項については不明である。さらに、各処理に関する入力と出力とがいつどのように行われるのかも不明である。
 従来、PLCとは別にモーションコントローラを設けていた場合には、PLCとモーションコントローラとは互いに非同期の、一般にはPLCの方が長い周期の実行サイクルで動作していた。このような場合、ユーザプログラムを実行するPLCの、モーション制御に対する役割は、ユーザプログラムの中のモーション命令を実行する際に、モーション命令の種類およびパラメータに従ってモーションコントローラに対して1つの動作の起動指示を与えることであった。たとえば、PLCは、「座標Aから座標Bまで指定の速度変化に従い移動せよ」といったモーション命令に基づく指示をモーションコントローラへ与える。モーションコントローラは、その指示に応じて、命令内容の運動を実現するために自らの実行サイクルごとにサーボモータドライバに対する位置指令値(命令内容によっては、速度指令値、トルク指令値などである場合もある)を算出し出力する。モーションコントローラは、いったん起動指示が与えられると、そのモーション命令の実行を完了するまで、自らの実行サイクルで指令値の算出および出力を繰り返す。
 一方、モーション制御機能を有するPLCにおいて、モーション演算プログラムの実行サイクルをPLCの動作全体の共通サイクルとした場合には、各実行サイクルにおいて比較的短いユーザプログラムを実行しうることは特許文献1からも知られているが、本願発明者らは、このことを利用してより高度なモーション制御を行える可能性が存在することを見出した。
 すなわち、一般に、モーション命令の仕様として、入力パラメータの与え方および入力パラメータを用いた演算内容が決められている。モーション演算プログラムは、そのようなモーション命令の内容を実際に演算するのである。モーション演算プログラム自体は、多くの場合PLCのメーカーから提供されるのであって、ユーザ自身がモーション演算プログラムを開発することは容易ではない。一方、ユーザプログラムは、ユーザ自身で自由にプログラミングできる。そこで、各実行サイクルにおけるモーション指令値の算出にかかわる演算内容の一部をユーザプログラムにおいて定義し、モーション演算プログラムとユーザプログラムとを同期して実行すれば、モーション制御の自由度を高めることができる。これによって、個別のユーザが必要とする制御内容により適合したモーション制御を実現できる可能性が存在するのである。
 さらに、本願発明者らは、ユーザプログラムがモーション指令値の算出にかかわる場合には、ユーザプログラムとモーション演算との実行が単に同期していればよいというわけではなく、入力処理および出力処理をも含めて、各処理を適切な順序で実行しなければ制御を遅らせる無駄な時間が発生してしまうことを見出した。
 本発明は、PLCのCPUユニットにおいて、モーション演算プログラムと同期して実行されるユーザプログラムが、モーション制御用入力データを用いて、モーション指令値の算出にかかわる演算を行う場合に、入力処理および出力処理をも含めた各処理の実行順序の適正化により、CPUユニットがモーション制御用入力データを入力してからその入力データを反映したモーション指令値データを出力するまでに要する時間を短くすることを目的とする。
 本発明のある局面によれば、モータの運動を制御するためのモーション制御機能を有するPLCのCPUユニットを提供する。PLCのCPUユニットは、マイクロプロセッサと、記憶手段と、通信回路とを含む。PLCのCPUユニットは、モーション指令値データの出力処理およびモーション制御用入力データの入力処理と、モーション演算プログラムの実行とを一定周期のモーション制御サイクルごとに繰り返し実行可能に構成されるとともに、ユーザにおける制御目的に応じて作成され、モーション演算プログラムに対してその実行に必要な指示を与える処理を含む第1のユーザプログラムを、モーション制御サイクルの周期の整数倍の周期の第1のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されている。記憶手段は、システムプログラムと、第1のユーザプログラムとの格納に用いられる。システムプログラムは、モーション演算プログラムと、第1のユーザプログラムおよびモーション演算プログラムの実行を制御するスケジューラプログラムとを含む。マイクロプロセッサは、記憶手段に格納されたシステムプログラムおよび第1のユーザプログラムを実行し、通信回路は、モーション制御サイクルごとに、出力処理の少なくとも一部としてモーション指令値データの送信、および、入力処理の少なくとも一部としてモーション制御用入力データの受信を行う。スケジューラプログラムは、マイクロプロセッサに、モーション制御サイクルごとにモーション演算プログラムの実行を開始させる命令と、マイクロプロセッサに、第1のユーザプログラム実行サイクルごとに第1のユーザプログラムの実行を開始させる命令と、出力処理および入力処理、第1のユーザプログラムの実行開始、第1のユーザプログラムの実行終了、ならびに、モーション演算プログラムの実行開始を、この順序で、第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含む。それにより、第1のユーザプログラムが、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含む場合に、入力処理の開始から、当該入力処理において入力されたモーション制御用入力データを反映したモーション指令値データの出力処理の終了までに要する時間を、第1のユーザプログラム実行サイクルの周期に相当する時間にできる。
 好ましくは、第1のユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期に等しい。このように第1のユーザプログラム実行サイクルの周期を設定することで、モーション演算プログラムの実行ごとに、更新されたユーザプログラム出力データを使用してモーション指令値データを算出することができる。すなわち、毎回の出力処理ごとにそのように更新されたモーション指令値データを出力することができる。
 さらに好ましくは、スケジューラプログラムは、モーション制御サイクル内において、出力処理および入力処理の後に、マイクロプロセッサに、第1のユーザプログラムおよびモーション演算プログラムをこの順に実行させるための命令を含む。この命令によって、モーション制御サイクル内において、第1のユーザプログラムおよびモーション演算プログラムの実行に先行してモーション制御に関する出力処理および入力処理を行うことができ、これによって、これらの入出力のための通信周期のばらつきを少なくできる。よって、モータの運動をより高精度に制御することができる。
 さらに好ましくは、記憶手段は、さらに、ユーザにおける制御目的に応じて作成され、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含まず、かつモーション制御サイクルの周期の2以上の整数倍の周期の第2のユーザプログラム実行サイクルを有する第2のユーザプログラムの格納に用いられる。スケジューラプログラムは、記憶手段に第2のユーザプログラムが格納されている場合に、第2のユーザプログラム実行サイクル内において、マイクロプロセッサに、最初のモーション演算プログラムの実行終了からモーション制御サイクル終了までの余剰時間に第2のユーザプログラムの実行を開始させるとともに、その後のモーション制御サイクルにおけるモーション演算プログラムの実行終了後の余剰時間に、第2のユーザプログラムの未実行の部分があるときには、マイクロプロセッサに、その未実行の部分の実行を開始させる。
 本局面に係るPLCのCPUユニットによれば、以下のようにユーザプログラムを作成することで、処理の高速化を実現できる。すなわち、第1のユーザプログラムには、モーション演算プログラムでの演算に使用されるユーザプログラム出力データを、モーション制御用入力データを使用して算出する命令を含ませる。一方、第2のユーザプログラムには、第1のユーザプログラムに含まれる以外の処理の全部または一部を実現するための命令を含ませる。そうすると、第1のユーザプログラムにすべての処理を実現させるための命令を含ませる場合にくらべて第1のユーザプログラムに割り当てられる処理量が少なくなるため、第1のユーザプログラムの実行時間を短くすることができる。そのため、モーション制御サイクルの周期をより短縮できる可能性が生じる。
 好ましくは、第1のユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期の2以上の整数倍に等しい。このように第1のユーザプログラム実行サイクルの周期を設定することで、ユーザプログラム実行周期よりも短い制御周期で、更新後のモーション指令値データを出力することができる。
 さらに好ましくは、スケジューラプログラムは、第1のユーザプログラム実行サイクル内において、マイクロプロセッサに、モーション演算プログラムの実行、出力処理および入力処理、第1のユーザプログラムの実行をこの順序に実行させるための命令を含む。その結果、各モーション制御サイクル内においても、モーション演算プログラムの実行、出力処理および入力処理、第1のユーザプログラムの実行がこの順序に実行されることになる。各モーション制御サイクルにおいて、出力処理および入力処理の実行後、モーション制御サイクルが終了するまでの時間はモーション制御サイクルごとに変動しうるが、この命令によって、当該時間を第1のユーザプログラムの実行に無駄なく使うことができる。その結果、マイクロプロセッサの待機時間が生じ難くなるので、ユーザプログラム実行サイクルをより短縮できる可能性が生じる。
 本発明の別の局面によれば、モータの運動を制御するためのモーション制御機能を有するPLCのCPUユニットで実行されるPLC用システムプログラムを提供する。PLCのCPUユニットは、第1のユーザプログラムの格納に用いられる記憶手段と、マイクロプロセッサと、通信回路とを含む。PLCのCPUユニットは、モーション指令値データの出力処理およびモーション制御用入力データの入力処理と、モーション演算プログラムの実行とを一定周期のモーション制御サイクルごとに繰り返し実行可能に構成されるとともに、ユーザにおける制御目的に応じて作成され、モーション演算プログラムに対してその実行に必要な指示を与える処理を含む第1のユーザプログラムを、モーション制御サイクルの周期の整数倍の周期の第1のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されている。PLC用システムプログラムは、モーション演算プログラムと、第1のユーザプログラムおよびモーション演算プログラムの実行を制御するスケジューラプログラムとを含む。通信回路は、モーション制御サイクルごとに、出力処理の少なくとも一部としてモーション指令値データの送信、および、入力処理の少なくとも一部としてモーション制御用入力データの受信を行う。スケジューラプログラムは、マイクロプロセッサに、モーション制御サイクルごとにモーション演算プログラムの実行を開始させる命令と、マイクロプロセッサに、第1のユーザプログラム実行サイクルごとに第1のユーザプログラムの実行を開始させる命令と、出力処理および入力処理、第1のユーザプログラムの実行開始、第1のユーザプログラムの実行終了、ならびに、モーション演算プログラムの実行開始を、この順序で、第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含む。それにより、第1のユーザプログラムが、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含む場合に、入力処理の開始から、当該入力処理において入力されたモーション制御用入力データを反映したモーション指令値データの出力処理の終了までに要する時間を、第1のユーザプログラム実行サイクルの周期に相当する時間にできる。
 好ましくは、第1のユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期に等しい。
 さらに好ましくは、スケジューラプログラムは、モーション制御サイクル内において、出力処理および入力処理の後に、マイクロプロセッサに、第1のユーザプログラムおよびモーション演算プログラムをこの順に実行させるための命令を含む。
 さらに好ましくは、スケジューラプログラムは、ユーザにおける制御目的に応じて作成され、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含まず、かつモーション制御サイクルの周期の2以上の整数倍の周期の第2のユーザプログラム実行サイクルを有する第2のユーザプログラムが記憶手段に格納されている場合に、第2のユーザプログラム実行サイクル内において、マイクロプロセッサに、最初のモーション演算プログラムの実行終了からモーション制御サイクル終了までの余剰時間に第2のユーザプログラムの実行を開始させるとともに、その後のモーション制御サイクルにおけるモーション演算プログラムの実行終了後の余剰時間に、第2のユーザプログラムの未実行の部分があるときには、マイクロプロセッサに、その未実行の部分の実行を開始させる。
 好ましくは、第1のユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期の2以上の整数倍に等しい。
 さらに好ましくは、スケジューラプログラムは、第1のユーザプログラム実行サイクル内において、マイクロプロセッサに、モーション演算プログラムの実行、出力処理および入力処理、第1のユーザプログラムの実行をこの順序に実行させるための命令を含む。
 この発明のさらに別の局面によれば、モータの運動を制御するためのモーション制御機能を有するPLCのCPUユニットで実行されるPLC用システムプログラムを格納した記録媒体を提供する。PLCのCPUユニットは、第1のユーザプログラムの格納に用いられる記憶手段と、マイクロプロセッサと、通信回路とを含む。PLCのCPUユニットは、モーション指令値データの出力処理およびモーション制御用入力データの入力処理と、モーション演算プログラムの実行とを一定周期のモーション制御サイクルごとに繰り返し実行可能に構成されるとともに、ユーザにおける制御目的に応じて作成され、モーション演算プログラムに対してその実行に必要な指示を与える処理を含む第1のユーザプログラムを、モーション制御サイクルの周期の整数倍の周期の第1のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されている。PLC用システムプログラムは、モーション演算プログラムと、第1のユーザプログラムおよびモーション演算プログラムの実行を制御するスケジューラプログラムとを含む。通信回路は、モーション制御サイクルごとに、出力処理の少なくとも一部としてモーション指令値データの送信、および、入力処理の少なくとも一部としてモーション制御用入力データの受信を行う。スケジューラプログラムは、マイクロプロセッサに、モーション制御サイクルごとにモーション演算プログラムの実行を開始させる命令と、マイクロプロセッサに、第1のユーザプログラム実行サイクルごとに第1のユーザプログラムの実行を開始させる命令と、出力処理および入力処理、第1のユーザプログラムの実行開始、第1のユーザプログラムの実行終了、ならびに、モーション演算プログラムの実行開始を、この順序で、第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含む。それにより、第1のユーザプログラムが、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含む場合に、入力処理の開始から、当該入力処理において入力されたモーション制御用入力データを反映したモーション指令値データの出力処理の終了までに要する時間を、第1のユーザプログラム実行サイクルの周期に相当する時間にできる。
 好ましくは、第1のユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期に等しい。
 さらに好ましくは、スケジューラプログラムは、モーション制御サイクル内において、出力処理および入力処理の後に、マイクロプロセッサに、第1のユーザプログラムおよびモーション演算プログラムをこの順に実行させるための命令を含む。
 さらに好ましくは、スケジューラプログラムは、ユーザにおける制御目的に応じて作成され、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含まず、かつモーション制御サイクルの周期の2以上の整数倍の周期の第2のユーザプログラム実行サイクルを有する第2のユーザプログラムが記憶手段に格納されている場合に、第2のユーザプログラム実行サイクル内において、マイクロプロセッサに、最初のモーション演算プログラムの実行終了からモーション制御サイクル終了までの余剰時間に第2のユーザプログラムの実行を開始させるとともに、その後のモーション制御サイクルにおけるモーション演算プログラムの実行終了後の余剰時間に、第2のユーザプログラムの未実行の部分があるときには、マイクロプロセッサに、その未実行の部分の実行を開始させる。
 好ましくは、第1のユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期の2以上の整数倍に等しい。
 さらに好ましくは、スケジューラプログラムは、第1のユーザプログラム実行サイクル内において、マイクロプロセッサに、モーション演算プログラムの実行、出力処理および入力処理、第1のユーザプログラムの実行をこの順序に実行させるための命令を含む。
 なお、本明細書における(日本語の)「命令」は、ある機能を実現するための、プログラムのソースリストに表れる個々の命令に限らず、それら個々の命令や関数等の集合をも意味しており、たとえば英語ではinstructionsのように複数形で表記されるべきものである。
 本発明によれば、PLCのCPUユニットにおいて、第1のユーザプログラムが、モーション演算プログラムによって使用されるユーザプログラム出力データを、モーション制御用入力データを用いて算出する処理を含む場合に、入力処理から、そこで入力されたモーション制御用入力データを反映したモーション指令値データの出力処理までに要する時間を、ユーザプログラム実行サイクルの周期に相当する短い時間とすることができる。
本発明の実施の形態に係るPLCシステムの概略構成を示す模式図である。 本発明の実施の形態に係るCPUユニットのハードウェア構成を示す模式図である。 本発明の実施の形態に係るCPUユニットで実行されるソフトウェア構成を示す模式図である。 本発明の実施の形態に係るCPUユニットのメインメモリの領域構成を示す模式図である。 本発明の実施の形態に係る制御プログラム(ユーザプログラム、シーケンス命令演算プログラムおよびモーション演算プログラム)によって提供されるモーション制御の概略の処理手順を示すフローチャートである。 本発明の実施の形態に係るCPUユニットのアプリケーション例1を示す模式図である。 本発明の実施の形態に係るCPUユニットのアプリケーション例2を示す模式図である。 本発明の実施の形態に係るCPUユニットのアプリケーション例3を示す模式図である。 本発明の実施の形態1に係る全体処理動作を示すシーケンス図である。 図9に示す全体処理動作に関する比較例における全体処理動作を示すシーケンス図である。 本発明の実施の形態2に係る全体処理動作を示すシーケンス図である。 本発明の実施の形態3に係る全体処理動作を示すシーケンス図である。 本発明の実施の形態4に係る全体処理動作を示すシーケンス図である。 図13に示す全体処理動作に関する比較例における全体処理動作を示すシーケンス図である。 本発明の実施の形態に係るCPUユニットに接続して用いられるPLCサポート装置のハードウェア構成を示す模式図である。 本発明の実施の形態に係るCPUユニットに接続して用いられるPLCサポート装置のソフトウェア構成を示す模式図である。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰り返さない。
 <A.システム構成>
 本実施の形態に係るPLCは、モータの運動を制御するためのモーション制御機能を有する。まず、図1を参照して、本実施の形態に係るPLC1のシステム構成について説明する。
 図1は、本発明の実施の形態に係るPLCシステムの概略構成を示す模式図である。図1を参照して、PLCシステムSYSは、PLC1と、PLC1とフィールドネットワーク2を介して接続されるサーボモータドライバ3およびリモートIOターミナル5と、フィールド機器である検出スイッチ6およびリレー7とを含む。また、PLC1には、接続ケーブル10などを介してPLCサポート装置8が接続される。
 PLC1は、主たる演算処理を実行するCPUユニット13と、1つ以上のIOユニット14と、特殊ユニット15とを含む。これらのユニットは、PLCシステムバス11を介して、データを互いに遣り取りできるように構成される。また、これらのユニットには、電源ユニット12によって適切な電圧の電源が供給される。なお、PLC1として構成される各ユニットは、PLCメーカーが提供するものであるので、PLCシステムバス11は、一般にPLCメーカーごとに独自に開発され、使用されている。これに対して、後述するようにフィールドネットワーク2については、異なるメーカーの製品同士が接続できるように、その規格などが公開されている場合も多い。
 CPUユニット13の詳細については、図2を参照して後述する。
 IOユニット14は、一般的な入出力処理に関するユニットであり、オン/オフといった2値化されたデータの入出力を司る。すなわち、IOユニット14は、検出スイッチ6などのセンサが何らかの対象物を検出している状態(オン)および何らの対象物も検出していない状態(オフ)のいずれであるかという情報を収集する。また、IOユニット14は、リレー7やアクチュエータといった出力先に対して、活性化するための指令(オン)および不活性化するための指令(オフ)のいずれかを出力する。
 特殊ユニット15は、アナログデータの入出力、温度制御、特定の通信方式による通信といった、IOユニット14ではサポートしない機能を有する。
 フィールドネットワーク2は、CPUユニット13と遣り取りされる各種データを伝送する。フィールドネットワーク2としては、典型的には、各種の産業用イーサネット(登録商標)を用いることができる。産業用イーサネット(登録商標)としては、たとえば、EtherCAT(登録商標)、Profinet IRT、MECHATROLINK(登録商標)-III、Powerlink、SERCOS(登録商標)-III、CIP Motionなどが知られており、これらのうちのいずれを採用してもよい。さらに、産業用イーサネット(登録商標)以外のフィールドネットワークを用いてもよい。たとえば、モーション制御を行わない場合であれば、DeviceNet、CompoNet/IP(登録商標)などを用いてもよい。本実施の形態に係るPLCシステムSYSでは、典型的に、本実施の形態においては、産業用イーサネット(登録商標)であるEtherCAT(登録商標)をフィールドネットワーク2として採用する場合の構成について例示する。
 なお、図1には、PLCシステムバス11およびフィールドネットワーク2の両方を有するPLCシステムSYSを例示するが、一方のみを搭載するシステム構成を採用することもできる。たとえば、フィールドネットワーク2ですべてのユニットを接続してもよい。あるいは、フィールドネットワーク2を使用せずに、サーボモータドライバ3をPLCシステムバス11に直接接続してもよい。さらに、フィールドネットワーク2の通信ユニットをPLCシステムバス11に接続し、CPUユニット13から当該通信ユニット経由で、フィールドネットワーク2に接続された機器との間の通信を行うようにしてもよい。
 なお、PLC1は、CPUユニット13にIOユニット14の機能やサーボモータドライバ3の機能を持たせることにより、IOユニット14やサーボモータドライバ3などを介さずにCPUユニット13が直接制御対象を制御する構成でもよい。
 サーボモータドライバ3は、フィールドネットワーク2を介してCPUユニット13と接続されるとともに、CPUユニット13からの指令値に従ってサーボモータ4を駆動する。より具体的には、サーボモータドライバ3は、PLC1から一定周期で、位置指令値、速度指令値、トルク指令値といった指令値を受ける。また、サーボモータドライバ3は、サーボモータ4の軸に接続されている位置センサ(ロータリーエンコーダ)やトルクセンサといった検出器から、位置、速度(典型的には、今回位置と前回位置との差から算出される)、トルクといったサーボモータ4の動作に係る実測値を取得する。そして、サーボモータドライバ3は、CPUユニット13からの指令値を目標値に設定し、実測値をフィードバック値として、フィードバック制御を行う。すなわち、サーボモータドライバ3は、実測値が目標値に近づくようにサーボモータ4を駆動するための電流を調整する。なお、サーボモータドライバ3は、サーボモータアンプと称されることもある。
 また、図1には、サーボモータ4とサーボモータドライバ3とを組み合わせたシステム例を示すが、その他の構成、たとえば、パルスモータとパルスモータドライバとを組み合わせたシステムを採用することもできる。
 図1に示すPLCシステムSYSのフィールドネットワーク2には、さらに、リモートIOターミナル5が接続されている。リモートIOターミナル5は、基本的には、IOユニット14と同様に、一般的な入出力処理に関する処理を行う。より具体的には、リモートIOターミナル5は、フィールドネットワーク2でのデータ伝送に係る処理を行うための通信カプラ52と、1つ以上のIOユニット53とを含む。これらのユニットは、リモートIOターミナルバス51を介して、データを互いに遣り取りできるように構成される。
 なお、PLCサポート装置8については後述する。
 <B.CPUユニットのハードウェア構成>
 次に、図2を参照して、CPUユニット13のハードウェア構成について説明する。図2は、本発明の実施の形態に係るCPUユニット13のハードウェア構成を示す模式図である。図2を参照して、CPUユニット13は、マイクロプロセッサ100と、チップセット102と、メインメモリ104と、不揮発性メモリ106と、システムタイマ108と、PLCシステムバスコントローラ120と、フィールドネットワークコントローラ140と、USBコネクタ110とを含む。チップセット102と他のコンポーネントとの間は、各種のバスを介してそれぞれ結合されている。
 マイクロプロセッサ100およびチップセット102は、典型的には、汎用的なコンピュータアーキテクチャに準じて構成される。すなわち、マイクロプロセッサ100は、チップセット102から内部クロックに従って順次供給される命令コードを解釈して実行する。チップセット102は、接続されている各種コンポーネントとの間で内部的なデータを遣り取りするとともに、マイクロプロセッサ100に必要な命令コードを生成する。さらに、チップセット102は、マイクロプロセッサ100での演算処理の実行の結果得られたデータなどをキャッシュする機能を有する。
 CPUユニット13は、記憶手段として、メインメモリ104および不揮発性メモリ106を有する。
 メインメモリ104は、揮発性の記憶領域(RAM)であり、CPUユニット13への電源投入後にマイクロプロセッサ100で実行されるべき各種プログラムを保持する。また、メインメモリ104は、マイクロプロセッサ100による各種プログラムの実行時の作業用メモリとしても使用される。このようなメインメモリ104としては、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)といったデバイスが用いられる。
 一方、不揮発性メモリ106は、リアルタイムOS(Operating System)、PLC1のシステムプログラム、ユーザプログラム、モーション演算プログラム、システム設定パラメータといったデータを不揮発的に保持する。これらのプログラムやデータは、必要に応じて、マイクロプロセッサ100がアクセスできるようにメインメモリ104にコピーされる。このような不揮発性メモリ106としては、フラッシュメモリのような半導体メモリを用いることができる。あるいは、ハードディスクドライブのような磁気記録媒体や、DVD-RAM(Digital Versatile Disk Random Access Memory)のような光学記録媒体などを用いることもできる。
 システムタイマ108は、一定周期ごとに割り込み信号を発生してマイクロプロセッサ100に提供する。典型的には、ハードウェアの仕様によって、複数の異なる周期でそれぞれ割り込み信号を発生するように構成されるが、OS(Operating System)やBIOS(Basic Input Output System)などによって、任意の周期で割り込み信号を発生するように設定することもできる。このシステムタイマ108が発生する割り込み信号を利用して、後述するようなモーション制御サイクルごとの制御動作が実現される。
 CPUユニット13は、通信回路として、PLCシステムバスコントローラ120およびフィールドネットワークコントローラ140を有する。これらの通信回路は、モーション指令値データなどの出力データの送信およびモーション制御用入力データなどの入力データの受信を行う。
 なお、CPUユニット13自体にIOユニット14やサーボモータドライバ3の機能を持たせる場合は、通信回路による出力データの送信および入力データの受信は、それらの機能を担う部分を通信の相手方としてCPUユニット13の内部で行われる送信および受信となる。
 PLCシステムバスコントローラ120は、PLCシステムバス11を介したデータの遣り取りを制御する。より具体的には、PLCシステムバスコントローラ120は、DMA(Dynamic Memory Access)制御回路122と、PLCシステムバス制御回路124と、バッファメモリ126とを含む。なお、PLCシステムバスコントローラ120は、PLCシステムバスコネクタ130を介してPLCシステムバス11と内部的に接続される。
 バッファメモリ126は、PLCシステムバス11を介して他のユニットへ出力されるデータ(以下「出力データ」とも称す。)の送信バッファ、および、PLCシステムバス11を介して他のユニットから入力されるデータ(以下「入力データ」とも称す。)の受信バッファとして機能する。なお、マイクロプロセッサ100による演算処理によって作成された出力データは、原始的にはメインメモリ104に格納される。そして、特定のユニットへ転送されるべき出力データは、メインメモリ104から読み出されて、バッファメモリ126に一次的に保持される。また、他のユニットから転送された入力データは、バッファメモリ126に一次的に保持された後、メインメモリ104に移される。
 DMA制御回路122は、メインメモリ104からバッファメモリ126への出力データの転送、および、バッファメモリ126からメインメモリ104への入力データの転送を行う。
 PLCシステムバス制御回路124は、PLCシステムバス11に接続される他のユニットとの間で、バッファメモリ126の出力データを送信する処理および入力データを受信してバッファメモリ126に格納する処理を行う。典型的には、PLCシステムバス制御回路124は、PLCシステムバス11における物理層およびデータリンク層の機能を提供する。
 フィールドネットワークコントローラ140は、フィールドネットワーク2を介したデータの遣り取りを制御する。すなわち、フィールドネットワークコントローラ140は、用いられるフィールドネットワーク2の規格に従い、出力データの送信および入力データの受信を制御する。上述したように、本実施の形態においてはEtherCAT(登録商標)規格に従うフィールドネットワーク2が採用されるので、通常のイーサネット(登録商標)通信を行うためのハードウェアを含む、フィールドネットワークコントローラ140が用いられる。EtherCAT(登録商標)規格では、通常のイーサネット(登録商標)規格に従う通信プロトコルを実現する一般的なイーサネット(登録商標)コントローラを利用できる。但し、フィールドネットワーク2として採用される産業用イーサネット(登録商標)の種類によっては、通常の通信プロトコルとは異なる専用仕様の通信プロトコルに対応した特別仕様のイーサネット(登録商標)コントローラが用いられる。また、産業用イーサネット(登録商標)以外のフィールドネットワークを採用した場合には、当該規格に応じた専用のフィールドネットワークコントローラが用いられる。
 バッファメモリ146は、フィールドネットワーク2を介して他の装置などへ出力されるデータ(このデータについても、以下「出力データ」と称す。)の送信バッファ、および、フィールドネットワーク2を介して他の装置などから入力されるデータ(このデータについても、以下「入力データ」とも称す。)の受信バッファとして機能する。上述したように、マイクロプロセッサ100による演算処理によって作成された出力データは、原始的にはメインメモリ104に格納される。そして、特定の装置へ転送されるべき出力データは、メインメモリ104から読み出されて、バッファメモリ146に一次的に保持される。また、他の装置から転送された入力データは、バッファメモリ146に一次的に保持された後、メインメモリ104に移される。
 DMA制御回路142は、メインメモリ104からバッファメモリ146への出力データの転送、および、バッファメモリ146からメインメモリ104への入力データの転送を行う。
 フィールドネットワーク制御回路144は、フィールドネットワーク2に接続される他の装置との間で、バッファメモリ146の出力データを送信する処理および入力データを受信してバッファメモリ146に格納する処理を行う。典型的には、フィールドネットワーク制御回路144は、フィールドネットワーク2における物理層およびデータリンク層の機能を提供する。
 USBコネクタ110は、PLCサポート装置8とCPUユニット13とを接続するためのインターフェイスである。典型的には、PLCサポート装置8から転送される、CPUユニット13のマイクロプロセッサ100で実行可能なプログラムなどは、USBコネクタ110を介してPLC1に取込まれる。
 <C.CPUユニットのソフトウェア構成>
 次に、図3を参照して、本実施の形態に係る各種機能を提供するためのソフトウェア群について説明する。これらのソフトウェアに含まれる命令コードは、適切なタイミングで読み出され、CPUユニット13のマイクロプロセッサ100によって実行される。
 図3は、本発明の実施の形態に係るCPUユニット13で実行されるソフトウェア構成を示す模式図である。図3を参照して、CPUユニット13で実行されるソフトウェアとしては、リアルタイムOS200と、システムプログラム210と、ユーザプログラム236との3階層になっている。
 リアルタイムOS200は、CPUユニット13のコンピュータアーキテクチャに応じて設計されており、マイクロプロセッサ100がシステムプログラム210およびユーザプログラム236を実行するための基本的な実行環境を提供する。このリアルタイムOSは、典型的には、PLCのメーカーあるいは専門のソフトウェア会社などによって提供される。
 システムプログラム210は、PLC1としての機能を提供するためのソフトウェア群である。具体的には、システムプログラム210は、スケジューラプログラム212と、出力処理プログラム214と、入力処理プログラム216と、シーケンス命令演算プログラム232と、モーション演算プログラム234と、その他のシステムプログラム220とを含む。なお、一般には出力処理プログラム214および入力処理プログラム216は、連続的(一体として)に実行されるので、これらのプログラムを、IO処理プログラム218と総称する場合もある。
 ユーザプログラム236は、ユーザにおける制御目的に応じて作成される。すなわち、PLCシステムSYSを用いて制御する対象のライン(プロセス)などに応じて、任意に設計されるプログラムである。
 後述するように、ユーザプログラム236は、シーケンス命令演算プログラム232およびモーション演算プログラム234と協働して、ユーザにおける制御目的を実現する。すなわち、ユーザプログラム236は、シーケンス命令演算プログラム232およびモーション演算プログラム234によって提供される命令、関数、機能モジュールなどを利用することで、プログラムされた動作を実現する。そのため、ユーザプログラム236、シーケンス命令演算プログラム232、およびモーション演算プログラム234を、制御プログラム230と総称する場合もある。
 このように、CPUユニット13のマイクロプロセッサ100は、記憶手段に格納されたシステムプログラム210およびユーザプログラム236を実行する。
 以下、各プログラムについてより詳細に説明する。
 上述ユーザプログラム236は、上述したように、ユーザにおける制御目的(たとえば、対象のラインやプロセス)に応じて作成される。ユーザプログラム236は、典型的には、CPUユニット13のマイクロプロセッサ100で実行可能なオブジェクトプログラム形式になっている。このユーザプログラム236は、PLCサポート装置8などにおいて、ラダー言語などによって記述されたソースプログラムがコンパイルされることで生成される。そして、生成されたオブジェクトプログラム形式のユーザプログラム236は、PLCサポート装置8から接続ケーブル10を介してCPUユニット13へ転送され、不揮発性メモリ106などに格納される。
 スケジューラプログラム212は、出力処理プログラム214、入力処理プログラム216、および制御プログラム230について、各実行サイクルでの処理開始および処理中断後の処理再開を制御する。より具体的には、スケジューラプログラム212は、ユーザプログラム236およびモーション演算プログラム234の実行を制御する。
 本実施の形態に係るCPUユニット13では、モーション演算プログラム234に適した一定周期の実行サイクル(モーション制御サイクル)を処理全体の共通サイクルとして採用する。そのため、1つのモーション制御サイクル内で、すべての処理を完了することは難しいので、実行すべき処理の優先度などに応じて、各モーション制御サイクルにおいて実行を完了すべき処理と、複数のモーション制御サイクルに亘って実行してもよい処理とが区分される。スケジューラプログラム212は、これらの区分された処理の実行順序などを管理する。より具体的には、スケジューラプログラム212は、各モーション制御サイクル期間内において、より高い優先度が与えられているプログラムほど先に実行する。
 出力処理プログラム214は、ユーザプログラム236(制御プログラム230)の実行によって生成された出力データを、PLCシステムバスコントローラ120および/またはフィールドネットワークコントローラ140へ転送するのに適した形式に再配置する。PLCシステムバスコントローラ120またはフィールドネットワークコントローラ140が、マイクロプロセッサ100からの、送信を実行するための指示を必要とする場合は、出力処理プログラム214がそのような指示を発行する。
 入力処理プログラム216は、PLCシステムバスコントローラ120および/またはフィールドネットワークコントローラ140によって受信された入力データを、制御プログラム230が使用するのに適した形式に再配置する。
 シーケンス命令演算プログラム232は、ユーザプログラム236で使用されるある種のシーケンス命令が実行されるときに呼び出されて、その命令の内容を実現するために実行されるプログラムである。
 モーション演算プログラム234は、ユーザプログラム236による指示に従って実行され、サーボモータドライバ3やパルスモータドライバといったなモータドライバに対して出力する指令値を算出するプログラムである。
 その他のシステムプログラム220は、図3に個別に示したプログラム以外の、PLC1の各種機能を実現するためのプログラム群をまとめて示したものである。その他のシステムプログラム220は、モーション制御サイクルの周期を設定するプログラム222を含む。
 モーション制御サイクルの周期は、制御目的に応じて適宜設定することができる。典型的には、モーション制御サイクルの周期を指定する情報をユーザがPLCサポート装置8へ入力する。すると、その入力された情報は、PLCサポート装置8からCPUユニット13へ転送される。モーション制御サイクルの周期を設定するプログラム222は、PLCサポート装置8からの情報を不揮発性メモリ106に格納させるとともに、システムタイマ108から指定されたモーション制御サイクルの周期で割り込み信号が発生されるように、システムタイマ108を設定する。CPUユニット13への電源投入時に、モーション制御サイクルの周期を設定するプログラム222が実行されることで、モーション制御サイクルの周期を指定する情報が不揮発性メモリ106から読み出され、読み出された情報に従ってシステムタイマ108が設定される。
 モーション制御サイクルの周期を指定する情報の形式としては、モーション制御サイクルの周期を示す時間の値や、モーション制御サイクルの周期に関する予め用意された複数の選択肢のうちから1つを特定する情報(番号または文字)などを採用することができる。
 本実施の形態に係るCPUユニット13において、モーション制御サイクルの周期を設定する手段としては、モーション制御サイクルの周期を指定する情報を取得するために用いられるPLCサポート装置8との通信手段、モーション制御サイクルの周期を設定するプログラム222、ならびにモーション制御サイクルを規定する割り込み信号の周期を任意に設定可能に構成されているシステムタイマ108の構成といった、モーション制御サイクルの周期を任意の設定するために用いられる要素が該当する。
 リアルタイムOS200は、複数のプログラムを時間の経過に従い切り替えて実行するための環境を提供する。本実施の形態に係るPLC1においては、CPUユニット13のプログラム実行によって生成された出力データを他のユニットまたは他の装置へ出力(送信)するためのイベント(割り込み)として、出力準備割り込み(P)およびフィールドネットワーク送信割り込み(X)が初期設定される。リアルタイムOS200は、出力準備割り込み(P)またはフィールドネットワーク送信割り込み(X)が発生すると、マイクロプロセッサ100での実行対象を、割り込み発生時点で実行中のプログラムからスケジューラプログラム212に切り替える。なお、リアルタイムOS200は、スケジューラプログラム212およびスケジューラプログラム212がその実行を制御するプログラムが何ら実行されていない場合に、その他のシステムプログラム210に含まれているプログラムを実行する。このようなプログラムとしては、たとえば、CPUユニット13とPLCサポート装置8との間の接続ケーブル10(USB)などを介した通信処理に関するものが含まれる。
 <D.メインメモリ構成>
 次に、図4を参照して、CPUユニット13のメインメモリ104に構成される記憶領域について説明する。
 図4は、本発明の実施の形態に係るCPUユニット13のメインメモリ104の領域構成を示す模式図である。図4を参照して、メインメモリ104には、各種のプログラム領域1041と、制御プログラムの作業領域1042と、PLCシステムバス送信バッファ1043と、PLCシステムバス受信バッファ1044と、フィールドネットワーク送信バッファ1045と、フィールドネットワーク受信バッファ1046とが形成される。
 各種のプログラム領域1041には、各種のプログラムを実行するためのコードが一時的に格納される。
 制御プログラムの作業領域1042には、制御プログラム230の実行により作成された出力データが一時的に格納される。
 PLCシステムバス送信バッファ1043およびPLCシステムバス受信バッファ1044は、PLCシステムバス11を介して送信および受信されるデータをそれぞれ一時的に格納する。同様に、フィールドネットワーク送信バッファ1045およびフィールドネットワーク受信バッファ1046は、フィールドネットワーク2を介して送信および受信されるデータをそれぞれ一時的に格納する。
 より具体的には、出力処理プログラム214は、PLCシステムバス11を介していずれかの出力データを送信する必要がある場合には、対象の出力データを制御プログラムの作業領域1042からPLCシステムバス送信バッファ1043へコピーする。その際、出力処理プログラム214は、同一のユニットに送信される複数の出力データを一括して送信できるように、PLCシステムバス送信バッファ1043において、同一のユニットに向けられた出力データ群がまとめられるように出力データを再配置する。
 同様に、出力処理プログラム214は、フィールドネットワーク2を介していずれかの出力データを送信する必要がある場合には、対象の出力データを制御プログラムの作業領域1042からフィールドネットワーク送信バッファ1045へコピーする。その際、出力処理プログラム214は、フィールドネットワーク送信バッファ1045において、シリアルフレームとして送信できる形式に出力データを再配置する。
 一方、入力処理プログラム216は、PLCシステムバスコントローラ120が受信してPLCシステムバス受信バッファ1044に格納された入力データ、および/または、フィールドネットワークコントローラ140が受信してフィールドネットワーク受信バッファ1046に格納された入力データを、制御プログラムの作業領域1042へコピーする。その際、入力処理プログラム216は、制御プログラムの作業領域1042において、制御プログラム230が使用するのに適した形式に入力データを再配置する。
 PLCシステムバスコントローラ120のDMA制御回路122は、PLCシステムバス送信バッファ1043に格納されている出力データをPLCシステムバスコントローラ120のバッファメモリ146へ転送するとともに、バッファメモリ146に格納されている入力データをPLCシステムバス受信バッファ1044へ転送する。
 フィールドネットワークコントローラ140のDMA制御回路142は、フィールドネットワーク送信バッファ1045に格納されている出力データをフィールドネットワークコントローラ140のバッファメモリ146へ転送するとともに、バッファメモリ146に格納されている入力データをフィールドネットワーク受信バッファ1046へ転送する。
 制御プログラムの作業領域1042、PLCシステムバス送信バッファ1043、PLCシステムバス受信バッファ1044、フィールドネットワーク送信バッファ1045、および、フィールドネットワーク受信バッファ1046は、それぞれのアクセスを互いに独立に制御できるように構成されている。そのため、たとえば、以下に示す(1)~(3)といった複数の動作を並列実行することができる。
 (1) マイクロプロセッサ100が行う、ユーザプログラム236実行に伴う制御プログラムの作業領域1042へのアクセス
 (2) PLCシステムバスコントローラ120のDMA制御回路122が行う、メインメモリ104上のPLCシステムバス送信バッファ1043および/またはPLCシステムバス受信バッファ1044とPLCシステムバスコントローラ120内のバッファメモリ126との間のデータ転送のための、メインメモリ104上のPLCシステムバス送信バッファ1043および/またはPLCシステムバス受信バッファ1044へのアクセス
 (3) フィールドネットワークコントローラ140のDMA制御回路142が行う、メインメモリ104上のフィールドネットワーク送信バッファ1045および/またはフィールドネットワーク受信バッファ1046とフィールドネットワークコントローラ140内のバッファメモリ146との間のデータ転送のための、メインメモリ104上のフィールドネットワーク送信バッファ1045および/またはフィールドネットワーク受信バッファ1046へのアクセス
 <E.アプリケーション>
 次に、本実施の形態に係るPLCシステムSYSが適用されるいくつかのアプリケーション例について説明する。
 まず、上述したユーザプログラム236に含まれる典型的な構成について説明する。ユーザプログラム236は、モータの運動に関する制御開始の条件が成立するか否かを周期的に判断させる命令を含む。たとえば、モータの駆動力によって何らかの処置がなされるワークが所定の処置位置まで搬送されたか否かを判断するようなロジックである。そして、ユーザプログラム236は、この制御開始の条件が成立したと判断されたことに応答して、モーション制御を開始させる命令をさらに含む。このモーション制御の開始に伴って、モーション命令の実行が指示される。すると、指示されたモーション命令に対応するモーション演算プログラム234が起動し、まず、モーション演算プログラム234の実行ごとにモータに対する指令値を算出していくために必要な初期処理が実行される。また、初期処理と同じモーション制御サイクルにおいて、第1サイクルでの指令値が算出される。したがって、初期処理および第1番目の指令値算出処理が、起動したモーション演算プログラム234が第1番目の実行においてなすべき処理となる。以降、各サイクルでの指令値が順次算出される。
 図5は、本発明の実施の形態に係る制御プログラム230(ユーザプログラム236、シーケンス命令演算プログラム232およびモーション演算プログラム234)によって提供されるモーション制御の概略の処理手順を示すフローチャートである。図5を参照して、マイクロプロセッサ100は、モータの運動に関する制御開始の条件が成立しているか否かを周期的に判断する(ステップS2)。この制御開始の条件が成立しているか否かの判断は、ユーザプログラム236およびシーケンス命令演算プログラム232によって実現される。制御開始の条件が成立していない場合(ステップS2においてNOの場合)には、ステップS2の判断が繰り返される。
 制御開始の条件が成立している場合(ステップS2においてYESの場合)には、マイクロプロセッサ100は、モーション制御に関する初期処理を実行する(ステップS4)。この初期処理としては、モータの運動の開始位置座標、終了位置座標、初期速度、初期加速度、軌跡などを算出処理が含まれる。続いて、マイクロプロセッサ100は、第1サイクルでの指令値の算出処理を実行する(ステップS6)。さらに、マイクロプロセッサ100は、算出した指令値の出力処理を実行する(ステップS8)。
 その後、マイクロプロセッサ100は、次のモーション制御サイクルが到来するまで待つ(ステップS10)。そして、マイクロプロセッサ100は、モータの運動に関する制御終了の条件が成立しているか否かを周期的に判断する(ステップS12)。この制御終了の条件が成立しているとは、サーボモータ4が終了位置に到達している状態などをいう。制御終了の条件が成立している場合(ステップS12においてYESの場合)には、ステップS2以下の処理が再度繰り返される。このとき、起動中のモーション演算プログラム234は、新たな制御開始の条件が成立するまで不活性の状態に維持される。
 制御終了の条件が成立していない場合(ステップS12においてNOの場合)には、マイクロプロセッサ100は、現在のサイクルでの指令値の算出処理を実行する(ステップS14)。さらに、マイクロプロセッサ100は、算出した指令値の出力処理を実行する(ステップS16)。そして、ステップS10以下の処理が繰り返される。
 以下、ユーザが特別なモーション制御内容を必要とする例をいくつか挙げる。
 [e1:アプリケーション例1]
 図6は、本発明の実施の形態に係るCPUユニット13のアプリケーション例1を示す模式図である。図6を参照して、アプリケーション例1として、長尺のシート材502をローラ520に巻き取るような巻き取り装置500を想定する。この巻き取り装置500では、シート材502に与えられる一定の張力を保ちつつローラ520に巻き取る。より具体的には、シート材502の送り出し側に配置されたテンションローラ514を用いて、シート材502に対して比較的小さい制動(摩擦力)を与えるとともに、ローラ520の駆動トルクτまたは回転速度ωを調整することによって、シート材502の張力が目的の値となるように制御される。
 巻き取り装置500では、シート材502を巻き取るにつれてローラ520の巻き径rがしだいに大きくなる。一方で、ローラ520は、その回転軸と機械的に接続されたモータ504によって回転駆動される。本来的に制御すべき対象は、ローラ520の最外周面(巻き径rの位置)における張力Tであるが、制御可能な物理量としては、モータ504のトルクτまたは回転速度ωである。そして、このトルクτまたは回転速度ωと張力Tとの間の関係は、ローラ520の巻き径rに依存して変化する。より具体的には、ローラ520の巻き径rが大きくなるにつれて、トルク指令値を大きく変化させても張力Tが少ししか変化しないようになり、また、回転速度指令値を少し変化させるだけでも張力Tが大きく変化するようになる。
 そのため、モータ504のトルクまたは回転速度(すなわち、モータ504を駆動するためのドライバ506に与えるトルク指令値または回転速度指令値)は、ローラ520の巻き径に応じて変化させる必要がある。
 巻き取り装置500においては、シート材502に生じている張力Tを検出し、この張力Tの検出値が目標値と一致するように、トルク指令値または速度指令値を算出する。この張力Tを検出する機構の一例として、ばねにより付勢された張力検出用ローラ512を設けて、空中を移動するシート材502に張力検出用ローラ512を押し当てる。するとシート材502が少したわんで、張力検出用ローラ512の押圧力(ばねが張力検出用ローラ512を下方に引っ張る力)とシート材502の張力による反発力(張力検出用ローラ512を上方に押し上げる力)とがつりあうところで張力検出用ローラ512が静止する。張力検出用ローラ512の位置は、シート材502の張力に応じて変化するので、この位置を位置センサ(ロータリーエンコーダ)510で検出する。検出された張力検出用ローラ512の位置は、PLC1へ入力される。この張力検出用ローラ512の位置は、シート材502の張力Tの大きさに応じた値となる。
 PLCのCPUユニット13のマイクロプロセッサ100は、ユーザプログラム236を実行することで、検出された張力検出用ローラ512の位置とローラ520を駆動するモータ504の現在のトルク値および速度値とを入力として、張力検出用ローラ512の位置に基づいてシート材502の張力Tを算出し、さらに、巻き取り装置500の機械系に応じた演算を行うことで、算出した張力Tを目標値に近づけるために必要なトルク指令値または速度指令値を算出する。算出されたトルク指令値または速度指令値は、マイクロプロセッサ100で実行されるモーション演算プログラム234へ送られる。
 なお、トルク指令値または速度指令値を算出する演算処理としては、近い過去において指令値(トルク指令値または速度指令値)をどれだけ変化させればどれだけの張力が変化したかという実績データを利用して、指令値と張力との関係を推定し、この推定した関係に基づいて、今回のサイクルにおける指令値(トルク指令値または速度指令値)を算出するというロジックを採用できる。
 あるいは、各サイクルにおけるローラ520の巻き径rを検出し、その検出結果に基づいて、指令値(トルク指令値または速度指令値)を算出してもよい。この巻き径rを検出する機構の一例として、ばねにより付勢された巻き径検出用ローラ516を設けて、ローラ520の中心側に巻き径検出用ローラ516を押し当てる。巻き径検出用ローラ516の位置は、ローラ520の巻き径に応じて変化するので、この位置を位置センサ518で検出する。
 マイクロプロセッサ100は、モーション演算プログラム234およびそれに関連付けられている出力処理プログラム214を実行することにより、ユーザプログラム236から与えられた指令値(トルク指令値または速度指令値)を、フィールドネットワーク2を介して、モータ504を駆動するドライバ506へ出力する。
 図6に示すアプリケーションにおいては、モーション演算の実質的にすべての部分をユーザプログラム236が担当しており、モーション演算プログラム234は、ドライバ506に対する指令値の出力管理を担当している。
 [e2:アプリケーション例2]
 図7は、本発明の実施の形態に係るCPUユニット13のアプリケーション例2を示す模式図である。図7を参照して、アプリケーション例2として、一定の絵柄が繰り返し印刷されたシート材602を送りながら、絵柄の切れ目の位置でシート材602を切断する切断装置600を想定する。この切断装置600では、シート材602の切断に用いるカッター604を動かすモータ606の動作が制御される。より具体的には、PLC1は、シート材602を送るローラ612,614が所定の角度分だけ回転するのに合わせてカッター604を上下させる電子カム動作を制御する。
 この電子カム動作を実行するにあたって、シート材602の絵柄に合わせて切断を開始するための初期位相を決定する必要がある。また、シート材602は張力や温度の変化によって伸縮するので、シート材602の伸縮があっても絵柄の切れ目で正しく切断できるように切断動作の位相と周期を調整しなければならない。
 図7に示すアプリケーション例2においては、シート材602に絵柄の印刷位置に関連付けてマーク630が印刷されている。シート材602の搬送経路上には、検出用のセンサ610(典型的には、光学センサ)が設けられており、このセンサ610を用いてこれらのマーク630の通過を検出する。
 また、シート材602を送るローラ614は、機械的に接続されたモータ618によって回転駆動される。モータ618は、モータドライバ622によって駆動される。また、ローラ614と機械的に接続されたモータ618には、その回転角度(回転位置)を検出するためのロータリーエンコーダ624が設けられている。ロータリーエンコーダ624で検出された回転角度(回転位置)は、PLC1へ入力される。
 センサ610がマーク630の通過を検出したタイミングにおけるロータリーエンコーダ624での回転角度(回転位置)のそれぞれの検出値を保持しておき、前回保持された検出値と今回保持された検出値との差を算出することで、シート材602の伸縮も反映した各シート材602を切断すべき間隔を決定できる。
 PLCのCPUユニット13のマイクロプロセッサ100は、ユーザプログラム236を実行することで、入力されるロータリーエンコーダ624での検出値およびセンサ610によるマーク630の検出値に基づいて、ローラ614の回転角度(回転位置)として示される切断タイミングの初期位相を算出するとともに、その後の各サイクルにおける位相および周期の補正値を周期的に算出する。算出された位相および周期の補正値は、マイクロプロセッサ100で実行されるモーション演算プログラム234へ送られる。マイクロプロセッサ100は、モーション演算プログラム234を実行することで、与えられた切断タイミングの初期位相、ならびに、位相および周期の補正値を反映してモータ618の動作を制御する。すなわち、モーション演算プログラム234の実行によって、モータドライバ622に対して、切断タイミングの初期位相、ならびに、位相および周期の補正値を反映したそれぞれの指令値が出力される。
 なお、シート材602の絵柄の位置を特定するために、カメラを有する視覚センサを用いてもよい。この場合には、その視野範囲がシート材602の絵柄を含むようにカメラを配置する。視覚センサでは、カメラによって撮像された画像と予め登録された絵柄を示すモデル画像との間でマッチング処理を行うことで、シート材602における絵柄の位置を特定する。そして、この特定された絵柄の位置に応じて、対応するロータリーエンコーダ624での検出値が取得される。
 [e3:アプリケーション例3]
 図8は、本発明の実施の形態に係るCPUユニット13のアプリケーション例3を示す模式図である。図8を参照して、アプリケーション例3として、搬送車710が直線状のレール702上を移動する搬送システム700を想定する。搬送車710では、左右の駆動輪712,722がそれぞれ独立のモータ714,724で駆動される。
 直線状のレール702上を走行する以上、理想的には、左右の駆動輪712,722の回転量は互いに同じであるため、PLC1からドライバ718,728に対して、モーション制御サイクルごとに左右同一の回転位置の指令値をそれぞれ与えればよい。しかしながら、搬送車710に搭載されている荷物の偏りやレール702の状態などによっては、片方の駆動輪のみが空転するような事態も生じ得る。
 たとえば、右側の駆動輪722だけが一時的にスリップして空回りしたとすると、それ以降、右側の駆動輪722に対する回転位置の指令値としては、空回りした回転量で補正した(空回り分を加算した)指令値を与える必要がある。このようなアプリケーションに対応するため、多軸合成位置決めと称されるモーション命令が用意される、このモーション命令は、主軸(たとえば、左側の駆動輪712)についての本来的な回転位置の指令値に対して、補助軸の値を加算して算出した位置を従軸(たとえば、右側の駆動輪722)の回転位置の指令値とする。
 マイクロプロセッサ100は、ユーザプログラム236を実行することで、左右の駆動輪712,722の回転位置(左右の駆動輪712,722にそれぞれ設けられたロータリーエンコーダ716,726の出力)を一定周期で取得し、左右の駆動輪712,722の間における回転位置の差が予め設定されている許容範囲を超えているか否かを判断する。そして、マイクロプロセッサ100は、回転位置の差が予め設定されている許容範囲を超えていれば、その許容範囲におさまるように補助軸の値(位置)を更新する。さらに、更新された補助軸の値(位置)は、マイクロプロセッサ100で実行されるモーション演算プログラム234へ送られる。マイクロプロセッサ100は、モーション演算プログラム234を実行することで、別途指定されたモーション命令に従って主軸の指令値をユーザプログラム実行サイクルごとに算出するとともに、与えられた最新の補助軸の値(位置)を用いて、主軸の指令値を補正することで従軸の指令値を算出する。それぞれの算出された指令値が対応するドライバ718および728へ出力される。
 <F.全体処理動作(実施の形態1)>
 次に、本実施の形態に係る各プログラムの実行順序などについて、以下説明する。なお、本明細書においては、本発明に係る技術思想の具現化例として、実施の形態1~4を例示する。
 [f1:本実施の形態]
 図9は、本発明の実施の形態1に係る全体処理動作を示すシーケンス図である。図9を参照して、本実施の形態に係るPLC1の実行中においては、マイクロプロセッサ100が、少なくとも、IO処理プログラム218(出力処理プログラム214および入力処理プログラム216)と、ユーザプログラム236(第1のユーザプログラム)と、モーション演算プログラム234とが実行可能な状態になっている。厳密に言えば、リアルタイムOS200がそれぞれのプログラムに係るプロセス(または、スレッド)を実行可能な状態に保持しており、スケジューラプログラム212がリアルタイムOS200およびハードウェアリソース(システムタイマ108など)を利用することで、各プログラムが適切なタイミングかつ適切な順序で実行される。このように、それぞれのプログラムに係る実行の開始/中断/終了などは、スケジューラプログラム212によって制御されるが、図9においては、スケジューラプログラム212に係る処理については図示していない。
 図9に示すように、PLC1の実行中においては、以下のようにシーケンスが進行する。
 (1) フィールドネットワークコントローラ140がモーション制御用入力データを受信してフィールドネットワーク受信バッファ1046(図4)に当該入力データを格納、および/または、PLCシステムバスコントローラ120が、モーション制御用入力データを受信してPLCシステムバス受信バッファ1044(図4)に当該入力データを格納する。
 (2) IO処理プログラム218の命令に従って、フィールドネットワーク受信バッファ1046および/またはPLCシステムバス受信バッファ1044に格納されているモーション制御用入力データがユーザプログラム236に係る作業領域(典型的には、制御プログラムの作業領域1042(図4)の一部)へ転送される。これにより、ユーザプログラム236がマイクロプロセッサ100によって実行された際に、モーション制御用入力データへアクセスすることができる。
 (3) IO処理プログラム218の命令に従って、フィールドネットワーク受信バッファ1046および/またはPLCシステムバス受信バッファ1044に格納されているモーション制御用入力データがモーション演算プログラム234に係る作業領域(典型的には、制御プログラムの作業領域1042(図4)の一部)へ転送される。これにより、モーション演算プログラム234がマイクロプロセッサ100によって実行された際に、モーション制御用入力データへアクセスすることができる。
 (4) ユーザプログラム236の命令に従って、モーション制御用入力データを使用してユーザプログラム236の出力データが算出され、算出された出力データがモーション演算プログラム234に係る作業領域(典型的には、制御プログラムの作業領域1042(図4)の一部)へ転送される。これにより、モーション演算プログラム234がマイクロプロセッサ100によって実行された際に、ユーザプログラム236の出力データへアクセスすることができる。
 (5) モーション演算プログラム234の命令に従って、モーション制御用入力データおよびユーザプログラム出力データのうち、必要なデータを使用してモーション指令値が算出され、算出されたモーション指令値データがIO処理プログラム218に係る作業領域(典型的には、制御プログラムの作業領域1042(図4)の一部)へ転送される。これにより、IO処理プログラム218がマイクロプロセッサ100によって実行された際に、モーション演算プログラム234によって算出されたモーション指令値データへアクセスすることができる。
 (6) IO処理プログラム218の命令に従って、モーション指令値データが出力される。より具体的には、制御プログラムの作業領域1042(図4)に格納されているモーション指令値データがフィールドネットワーク送信バッファ1045(図4)へ転送される。さらに、フィールドネットワーク送信バッファ1045へのデータ転送に続いて、フィールドネットワークコントローラ140がモーション指令値データをサーボモータドライバ3へ送信する。
 なお、上記の(1)の処理においては、ユーザプログラム236での演算には使用されるが、モーション演算プログラム234での演算には使用されない入力データについても入力され得る。また、ユーザプログラム236の実行により生成されるユーザプログラム出力データは、モーション演算プログラム234での演算には使用されない出力データであっても、IO処理プログラム218へ送られて、(6)の処理において出力される。
 本実施の形態に係る「モーション制御サイクル」は、モーション演算プログラム234の実行および通信の周期、すなわち、サーボモータドライバ3へモーション指令値データを与える周期で実行される一連の処理のサイクルである。このとき、図9に示すように、1つのモーション制御サイクルの範囲(開始から終了まで)は、図9の右側に示したA,B,Cのいずれによって把握してもよい。すなわち、モーション制御サイクルとは、特定のプログラムの開始タイミングおよび/または終了タイミングによって定義されるものではなく、単に、モーション演算プログラム234の1回の実行を含む処理のサイクルである。一例として、図9の左側には、図9の右側に示したAの区切り方で見た場合の、モーション制御サイクル1~3(3サイクル分)を示す。
 図9に示すように、モーション制御サイクルの区切り方がA,B,Cのいずれであるかにかかわらず、スケジューラプログラム212は、マイクロプロセッサ100に、モーション制御サイクルごとにモーション演算プログラム234の実行を開始させる命令と、マイクロプロセッサ100に、ユーザプログラム実行サイクル(この例では、モーション制御サイクルに一致している)ごとにユーザプログラム236(第1のユーザプログラム)の実行を開始させる命令とを含む。さらに、スケジューラプログラム212は、IO処理(出力処理および入力処理)、ユーザプログラム236の実行開始、ユーザプログラム236の実行終了、ならびに、モーション演算プログラム234の実行開始を、この順序で、ユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令を含む。ただし、その命令による一連の処理のサイクルとユーザプログラム実行サイクルとの間で、サイクルの位相(サイクルの開始タイミング)が一致するとは限らない。
 図9に示すIO処理においては、出力処理プログラム214の命令に従って出力処理が先に実行され、続いて、入力処理プログラム216の命令に従って入力処理が実行されるようになっているが、この出力処理と入力処理との実行順序は、逆であってもよいし、可能であれば、並列的に行われてもよい。
 図9に示すように、PLC1のCPUユニット13は、モーション指令値データの出力処理およびモーション制御用入力データの入力処理(IO処理)と、モーション演算プログラム234の実行とを一定周期のモーション制御サイクルごとに繰り返し可能に構成されている。さらに、PLC1のCPUユニット13は、ユーザにおける制御目的に応じて作成され、モーション演算プログラム234に対してその実行に必要な指示を与える処理を含むユーザプログラム236を、モーション制御サイクルの周期の整数倍の周期のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されている。
 また、CPUユニット13に含まれる通信回路(PLCシステムバスコントローラ120およびフィールドネットワークコントローラ140)は、モーション制御サイクルごとに、出力処理の少なくとも一部としてモーション指令値データの送信、および、入力処理の少なくとも一部としてモーション制御用入力データの受信を行う。
 本実施の形態によれば、入力処理の開始(図9に示す(1)の処理)から、当該入力処理において入力されたモーション制御用入力データを反映したモーション指令値データの出力処理(図9に示す(6)の処理)までに要する時間を、ユーザプログラム実行サイクルの周期に相当する、より短い時間とすることができる。
 図9に示す例では、ユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期に等しい。このようにそれぞれの周期を設定することで、モーション演算プログラム234の実行ごとに、更新されたユーザプログラム出力データを使用してモーション指令値データを算出することができる。すなわち、毎回の出力処理ごとにそのように更新されたモーション指令値データを出力することができる。
 図9に示す例において、モーション制御サイクルの区切り方をAとした場合については、スケジューラプログラム212は、モーション制御サイクル内において、出力処理および入力処理(IO処理)の後に、マイクロプロセッサ100に、ユーザプログラム236およびモーション演算プログラム234をこの順に実行させるための命令を含むことになる。この場合には、モーション制御サイクル内において、ユーザプログラム236およびモーション演算プログラム234の実行に先行してモーション制御に関する出力処理および入力処理(IO処理)を行うことができ、これによって、これらの入出力のための通信周期のばらつきを少なくできる。よって、モータの運動をより高精度に制御することができる。
 [f2:比較例]
 次に、本実施の形態に係るスケジューラプログラム212による効果を説明するために、図9に示すシーケンスとはプログラムの実行順序を異ならせた場合のシーケンスについて比較例として説明する。
 図10は、図9に示す全体処理動作に関する比較例における全体処理動作を示すシーケンス図である。上述の図9においては、「IO処理プログラム218」、「ユーザプログラム236」、「モーション演算プログラム234」の順序でそれぞれのプログラムが実行される例を示したが、図10には、比較例として、「IO処理プログラム218」、「モーション演算プログラム234」、「ユーザプログラム236」の順序でそれぞれのプログラムが実行される例を示す。
 図10に示すような比較例に係るプログラムの実行順序を採用した場合には、入力処理の開始(図10に示す(1)の処理)から、当該入力処理において入力されたモーション制御用入力データを反映したモーション指令値データの出力処理(図10に示す(6’)の処理)までには、ユーザプログラム236の実行サイクルの2周期分に相当する時間を要する。その結果、図9に示すプログラムの実行順序に比較して、ユーザプログラム実行サイクルの1周期分の時間だけ制御が遅れることになる。
 より具体的には、図10に示す比較例における(1)~(6)の処理の説明は、図9の(1)~(6)の処理の説明と同じである。図10における(1’)~(6’)の処理の説明も、図9の(1)~(6)の処理の説明と同じである。図10に示すシーケンスでは、(1)~(6)の処理にユーザプログラム実行サイクルの周期よりもモーション制御サイクル1周期分だけ長い時間がかかる。そして、(1)~(6)の処理の途中で(1’)~(6’)の処理が始まる。
 このように、(1)~(6)の処理および(1’)~(6’)の処理が並行して進められることから、図10に示すシーケンスにおいては、モーション制御サイクル2におけるモーション演算プログラム234の実行時(M2)に、モーション制御用入力データの取扱いが複雑化するという問題も生じる。たとえば、モーション制御サイクル2におけるモーション演算プログラム234の実行時(M2)においては、モーション制御用の新たな入力データの入力処理(図10に示す(1’)の処理)は、モーション演算プログラム234の実行時(M2)より前に完了する。そのため、モーション演算プログラム234の実行時(M2)には、本来使用すべきモーション制御用入力データ(図10に示す(3)の処理によって転送された入力データ)に加えて、使用すべきではない、モーション制御用の新たな入力データ(図10に示す(3’’)の処理によって転送された入力データ)が作業領域に保持されることになる。そのため、モーション演算プログラム234の実行時(M2)において、本来使用すべき入力データが使用され、新たな入力データが使用されないように管理する仕組みが必要になり、処理が複雑化する。
 以上のように、図9に示す本実施の形態に係る実行順序でそれぞれのプログラムを実行させることで、図10に示すシーケンスにおいて生じるような問題を回避できるとともに、制御周期をより高速化できる。
 <G.全体処理動作(実施の形態2)>
 上述の実施の形態1においては、IO処理プログラム218、ユーザプログラム236、およびモーション演算プログラム234の実行順序に着目して説明したが、1つのモーション制御サイクル内において、これらのプログラムをすべて実行したとしても、他の処理を実行できる場合もある。そこで、実施の形態2においては、上述のプログラムに加えて、他の処理を実行する処理動作について説明する。
 図11は、本発明の実施の形態2に係る全体処理動作を示すシーケンス図である。図11を参照して、本実施の形態においては、IO処理プログラム218の実行終了からユーザプログラム236の実行開始までの間に「他の処理P」が実行される。また、ユーザプログラム236の実行終了からモーション演算プログラム234の実行開始までの間に「他の処理Q」が実行される。さらに、モーション演算プログラム234の実行終了からIO処理プログラム218の実行開始までの間に「他の処理R」が実行される。
 「他の処理P」、「他の処理Q」、「他の処理R」の処理内容については、ユーザプログラム236およびモーション演算プログラム234の正常な実行を阻害するものでない限り、どのような処理であってもよい。より具体的には、「他の処理」としては、その他のシステムプログラム220(図3)の実行などが想定される。このその他のシステムプログラム220の処理内容としては、たとえば、入力データおよび/または出力データのロギング、故障診断、PLCサポート装置8との通信、ならびに、上位コンピュータとのLANを経由する通信(本実施の形態に係るCPUユニット13がイーサネット(登録商標)を介する上位コンピュータとの通信機能を有している場合)などが考えられる。
 さらに、ユーザプログラム236に含まれるシーケンス演算に関する入力処理および出力処理については、IO処理プログラム218を実行する中で、モーション制御用入力データの入力処理およびモーション指令値データの出力処理とともに行ってもよいが、それとは別のタイミングで、いずれかの「他の処理」として行ってもよい。
 また、「他の処理」がモーション制御サイクルの最後に実行される場合には、「他の処理」の内容は、次のモーション制御サイクルが開始されるまで待機しているアイドリングであってもよい。
 図11には、3種類の「他の処理」が実行される処理例を示すが、この「他の処理」の数についても特に制限されるものではなく、たとえば、「他の処理」のうちの1つまたは2つだけが存在するようにしてもよい。あるいは、単一の「他の処理」の中で、複数の種類の処理を順次実行するようにしてもよい。
 図11に示すシーケンスにおいて、1つのモーション制御サイクルの範囲(開始から終了まで)としては、「IO処理プログラム218」、「ユーザプログラム236」、「モーション演算プログラム234」の処理開始タイミングをそれぞれ区切りとするA,B,Cのほか、いずれかの「他の処理」の処理開始タイミングを区切りとするA’,B’,C’がありうる。
 <H.全体処理動作(実施の形態3)>
 ユーザにおける制御目的に応じて作成されるユーザプログラムに対して異なる優先度を設定できるようにすることも実用的である。そこで、実施の形態3においては、より高い優先度を設定されたユーザプログラムと、より低い優先度を設定されたユーザプログラム(以下「低優先ユーザプログラム」とも称す。)とが存在する場合の処理動作について説明する。また、本実施の形態においては、低優先ユーザプログラムとの対比上、図11に示されるユーザプログラム236に相当するプログラムを「高優先ユーザプログラム236-1」とも称す。
 図12は、本発明の実施の形態3に係る全体処理動作を示すシーケンス図である。図12に示すシーケンスは、図11に示すシーケンスにおいて、「他の処理P」および「他の処理Q」が存在せず、かつ、「他の処理R」として低優先ユーザプログラム236-2(第2のユーザプログラム)が実行される場合に相当する。
 高優先ユーザプログラム236-1は、モーション演算プログラム234での演算に使用されるユーザプログラム出力データを、モーション制御用入力データを使用して算出する命令を含む。高優先ユーザプログラム236-1は、さらにモーション命令を含む。このモーション命令は、モーション演算プログラム234に対して実行に必要なパラメータを与えて実行開始を指示するための命令を含む。たとえば、ユーザは、検出スイッチ6(図1)の状態を表す入力データに基づいてある条件が成立した場合に、モーション命令を実行するようにプログラムすることができる。
 低優先ユーザプログラム236-2は、モーション制御用入力データを使用してユーザプログラム出力データを算出する命令を含まない。典型的には、低優先ユーザプログラム236-2は、モーション制御に比較して遅い制御で足りる部分の処理内容を含む。
 低優先ユーザプログラム236-2についても、ユーザプログラム236(図3)と同様に不揮発性メモリ106(図2)に格納されており、実行時にはメインメモリ104内に割当てられる各種のプログラム領域1041(図4)にコピーされる。
 上述したように、低優先ユーザプログラム236-2は比較して遅い制御で足りる部分の処理内容で構成されるので、低優先ユーザプログラム236-2の実行サイクルの周期は、モーション制御サイクルの周期の2以上の整数倍の周期に設定される。一例として、図12に示すシーケンスにおいては、低優先ユーザプログラム236-2の実行サイクルの周期は、モーション制御サイクルの周期の4倍に設定される。そのため、低優先ユーザプログラム236-2は、図12に示すモーション制御サイクル1~4を、1つの実行サイクルとみなして実行される。
 説明の便宜上、図12に示すシーケンス図においては、上述の図9~図11とは異なり、スケジューラプログラム212の動作タイミングを示すとともに、IO処理プログラム218を出力処理プログラム214と入力処理プログラム216とに区分して示す。さらに、図12に示すシーケンス図においては、PLCシステムバスコントローラ120およびフィールドネットワークコントローラ140の動作タイミングについても示している。
 本実施の形態においては、高優先ユーザプログラム236-1およびモーション演算プログラム234は、モーション制御スレッドと称される1つのスレッドに含まれる形で実装される。そのため、高優先ユーザプログラム236-1とモーション演算プログラム234とは、スケジューラプログラム212による制御を介さず連続して実行される。しかしながら、モーション演算プログラム234についても、モーション制御スレッド全体の実行制御を介して、スケジューラプログラム212に実行制御されているとみなすことができる。
 本実施の形態においては、高優先ユーザプログラム236-1とモーション演算プログラム234とは常に連続して実行されるので、モーション命令は、高優先ユーザプログラム236-1にのみ含まれるようにし、低優先ユーザプログラム236-2にはモーション命令を含まないように構成するのが、制御動作の理解を容易にする上で好ましい。
 さらに、図12に示す、出力処理プログラム214、入力処理プログラム216、高優先ユーザプログラム236-1、および、モーション演算プログラム234を、1つのモーション制御スレッドに含まれる形で実装してもよい。この場合には、これらのプログラムの実行順序についてはスケジューラプログラム212による関与を無くし、スケジューラプログラム212はこのモーション制御スレッドの起動のみを制御するようにしてもよい。この場合でも、スケジューラプログラム212は、モーション制御スレッドの実行開始タイミングを制御することによって、モーション制御スレッドに含まれるそれぞれのプログラムの実行を開始させる処理を行っているとみなすことができる。
 すなわち、本実施の形態においては、スケジューラプログラム212が何らかのプログラムの実行を開始させるということは、そのプログラムの実行を個別に開始させることには必ずしも限定されない。
 出力処理プログラム214、入力処理プログラム216、モーション制御スレッド(高優先ユーザプログラム236-1およびモーション演算プログラム234)、ならびに、低優先ユーザプログラム236-2には、それぞれ優先度が与えられている。これらのプログラムおよびスレッドに与えられている優先度は、たとえば、高い方から、出力処理プログラム214、入力処理プログラム216、モーション制御スレッド、低優先ユーザプログラム236-2の順である。
 スケジューラプログラム212は、各モーション制御サイクル内において、優先度の高いプログラム/スレッドから順に、マイクロプロセッサ100に実行させる。以下、「マイクロプロセッサ100に実行させる」ことを単に「実行する」とも表現する。
 スケジューラプログラム212は、それ自体がオブジェクトインスタンスである場合に限らず、他の各種オブジェクトインスタンス(たとえば、出力処理プログラム214)に組込まれて動作するプログラム(プロセス)であってもよい。たとえば、他のオブジェクトインスタンスにおいて呼び出されて動作するプログラムであってもよい。
 図12に示される符号PおよびXは、それぞれシステムタイマ108(図2)から一定周期ごとに発生される割り込み信号を示す。具体的には、「P」は出力準備割り込みを示し、「X」はフィールドネットワーク送信割り込みを示す。なお、図12には、割り込みを示す符号「P」および「X」に、モーション制御サイクルの番号を示す数字を付加して表現する。
 (h1:モーション制御サイクル1について)
 スケジューラプログラム212は、出力準備割り込み(P-1)に応答して、優先度に従って、まず出力処理プログラム214を実行する。
 出力処理プログラム214は、PLCシステムバス11を介していずれかの出力データを送信する必要がある場合には、対象の出力データを制御プログラムの作業領域1042(図4)からPLCシステムバス送信バッファ1043へコピーする。また、出力処理プログラム214は、フィールドネットワーク2を介していずれかの出力データを送信する必要がある場合には、対象の出力データを制御プログラムの作業領域1042からフィールドネットワーク送信バッファ1045へコピーする。出力データは、モーション演算プログラム234の実行結果であるモーション指令値データ、および、ユーザプログラム236の実行結果であるその他の出力データを含む。
 続いて、出力処理プログラム214は、PLCシステムバス送信バッファ1043への出力データのコピーが完了すると、PLCシステムバスコントローラ120に対して送信実行を指示する(符号A)。そして、出力処理プログラム214は、出力データのコピーがすべて完了すると、いったん実行を停止する。
 その後、スケジューラプログラム212は、フィールドネットワーク送信割り込み(X-1)に応答して、出力処理プログラム214の実行を再開する。
 出力処理プログラム214は、実行を再開すると、フィールドネットワークコントローラ140に対して送信実行を指示する(符号B)。そして、出力処理プログラム214は、自身の実行を終了する。
 スケジューラプログラム212は、出力処理プログラム214の実行が終了すると、優先度に従って、次に入力処理プログラム216を実行する。
 入力処理プログラム216は、PLCシステムバスコントローラ120からの受信完了通知(符号C)、または、フィールドネットワークコントローラ140からの受信完了通知(符号D)を受信するまで待機する。図12では、一例として、PLCシステムバスコントローラ120からの受信完了通知(符号C)が先に発生し、続いて、フィールドネットワークコントローラ140からの受信完了通知(符号D)が発生している例を示すが、この発生順序は逆になる場合もある。
 入力処理プログラム216は、受信完了通知(符号CまたはD)が発生すると、いずれの受信完了通知であるかに対応して、PLCシステムバス受信バッファ1044またはフィールドネットワーク受信バッファ1046から制御プログラムの作業領域1042に入力データをコピーする。入力データは、モーション制御用入力データ、および、ユーザプログラム236の実行に必要なその他の入力データを含む。
 入力処理プログラム216は、入力データのコピーが完了すると、実行を終了する。
 スケジューラプログラム212は、入力処理プログラム216の実行が終了すると、優先度に従って、次にモーション制御スレッドを実行する。すなわち、ユーザプログラム236が実行を開始する。
 ユーザプログラム236は、モーション制御用入力データを使用してユーザプログラム出力データを算出する。また、ユーザプログラム236は、その他の出力データを生成する。ユーザプログラム236の実行終了に伴いモーション演算プログラム234が実行を開始する。モーション演算プログラム234は、モーション制御用入力データおよびユーザプログラム出力データのうち、必要なデータを使用してモーション指令値データを算出する。
 スケジューラプログラム212は、モーション演算プログラム234の実行が終了すると、優先度に従って、最後に低優先ユーザプログラム236-2を実行する。この低優先ユーザプログラム236-2の実行は、次のモーション制御サイクルの出力準備割り込み(P-2)に応答して中断される。
 本実施の形態における出力準備割り込み(P)のように、実行中の処理を中断させて新しく一連の処理を開始させるトリガとなる一定周期の割り込みが存在する場合には、そのような割り込みを制御サイクルの区切りとして把握することが好ましい。
 (h2:PLCシステムバスコントローラ120の動作について)
 PLCシステムバスコントローラ120のDMA制御回路122は、送信実行指示(符号A)に応答して、メインメモリ104のPLCシステムバス送信バッファ1043に格納されている出力データをPLCシステムバスコントローラ120のバッファメモリ126へ転送する。
 バッファメモリ126への出力データの転送が完了すると、PLCシステムバス制御回路124は、バッファメモリ126から各出力データの宛先となっているユニットに対して対象の出力データを転送する。その後、PLCシステムバス制御回路124は、PLCシステムバス11上の各ユニットから入力データをPLCシステムバスコントローラ120のバッファメモリ126へ転送する。
 バッファメモリ126への入力データの転送が完了すると、PLCシステムバスコントローラ120のDMA制御回路122は、バッファメモリ126に格納されている入力データをメインメモリ104のPLCシステムバス受信バッファ1044へ転送する。その後、入力データの転送が完了すると、DMA制御回路122は、受信完了通知(符号C)をマイクロプロセッサ100に対して送信する。
 (h3:フィールドネットワークコントローラ140の動作について)
 フィールドネットワークコントローラ140のDMA制御回路142は、送信実行指示(符号B)に応答して、メインメモリ104のフィールドネットワーク送信バッファ1045に格納されている出力データをフィールドネットワークコントローラ140のバッファメモリ146へ転送する。
 バッファメモリ146への出力データの転送が完了すると、フィールドネットワーク制御回路144は、バッファメモリ146から各出力データの宛先となっている装置に対して出力データを転送する。その後、フィールドネットワーク制御回路144は、フィールドネットワーク2上の各装置から入力データをフィールドネットワークコントローラ140のバッファメモリ146へ転送する。
 バッファメモリ146への入力データの転送が完了すると、フィールドネットワークコントローラ140のDMA制御回路142は、バッファメモリ146に格納されている入力データをメインメモリ104のフィールドネットワーク受信バッファ1046へ転送する。その後、入力データの転送が完了すると、DMA制御回路142は、受信完了通知(符号D)をマイクロプロセッサ100に対して送信する。
 以上の動作は、フィールドネットワーク2の種類を問わず妥当するが、フィールドネットワーク2が本実施の形態で採用するEtherCAT(登録商標)である場合は、さらに次のような処理が実行される。
 すなわち、EtherCAT(登録商標)では、単一のフレームに、各ユニット宛の出力データおよび各ユニットからの入力データが含まれる。マスタに設定されるCPUユニット13からフレームが送信されると、送信されたフレームはデイジーチェーン接続されたそれぞれのユニットを経由して順次転送される。なお、CPUユニット13以外のそれぞれのユニットは、スレーブに設定される。フレームが末端のユニットに到達すると、そこで当該フレームは全二重の通信路を折り返して再びスレーブであるそれぞれのユニットを経由してCPUユニット13に戻る。各スレーブにおいては、往路のフレームをFIFO(First In First Out)方式で通過させながら、自スレーブ宛の出力データを選択的に取り込むとともに、自ユニットで発生した入力データをフレームの適切な位置に書き込む。各スレーブは、帰路のフレームについては、出力データの読み出し、および、入力データの書き込みは行わずに通過させる。
 このように、EtherCAT(登録商標)の場合は、各ユニットに対して個別にフレームを送信し、あるいは、各ユニットからフレームを個別に受信するのではなく、単一のフレームを送信および受信することが、フィールドネットワーク制御回路144による、バッファメモリ146から各ユニットへの出力データの転送、および、各ユニットからバッファメモリ146への入力データの転送に相当する。
 フィールドネットワーク2としてEtherCAT(登録商標)を用いる場合は、出力データを含むフレームを送信し、そのフレームがスレーブのそれぞれのユニットを経由して戻ってきた場合には、そのフレームに入力データが含まれることになる。そのため、実行順序については、出力処理の後に入力処理を実行することが自然である。但し、使用するフィールドネットワーク2の種類によっては、入力処理の後に出力処理を実行する方が好ましい場合がある。このように、出力処理と入力処理との順序は、フィールドネットワーク2などの仕様に応じて適宜に設計すればよい。
 (h4:モーション制御サイクル2~4について)
 基本的には、モーション制御サイクル2~4における動作は、モーション制御サイクル1における動作と同様である。以下では、主として、モーション制御サイクル1における動作と相違する点について説明する。
 モーション制御サイクル2では、スケジューラプログラム212は、モーション演算プログラム234の実行が終了すると、低優先ユーザプログラム236-2の未実行の部分を実行する。この低優先ユーザプログラム236-2の実行は、次のモーション制御サイクルの出力準備割り込み(P-2)に応答して再び中断される。
 モーション制御サイクル3においても、スケジューラプログラム212は、モーション演算プログラム234の実行が終了すると、低優先ユーザプログラム236-2の未実行の部分を実行する。図12に示すシーケンスにおいては、低優先ユーザプログラム236-2がモーション制御サイクル3内で実行を終了する例を示す。この場合には、低優先ユーザプログラム236-2の実行終了から、次のモーション制御サイクルの出力準備割り込み(P-3)までは待機時間となる。
 モーション制御サイクル4においては、モーション制御サイクル1から始まった低優先ユーザプログラム236-2のユーザプログラム実行サイクルはまだ継続しているが、低優先ユーザプログラム236-2の未実行の部分がないので、スケジューラプログラム212は、モーション演算プログラム234の実行終了後に実行させるべきプログラムがないと判断し、次のモーション制御サイクルの出力準備割り込み(P-4)までの間は待機時間となる。
 なお、スケジューラプログラム212が実行制御するプログラムについての待機時間において、リアルタイムOSの制御を利用して、その他のシステムプログラム220(図3)を実行してもよい。
 モーション制御サイクル5以降では、モーション制御サイクル1~4と同様の動作が繰り返される。
 (h5:まとめ)
 本実施の形態においては、スケジューラプログラム212は、不揮発性メモリ106(図2)に低優先ユーザプログラム236-2(第2のユーザプログラム)が格納されている場合に、低優先ユーザプログラム236-2の実行サイクル(ユーザプログラム実行サイクル)内において、マイクロプロセッサ100に、最初のモーション演算プログラム234の実行終了からモーション制御サイクル終了までの余剰時間に低優先ユーザプログラム236-2の実行を開始させるとともに、その後のモーション制御サイクルにおけるモーション演算プログラム234の実行終了後の余剰時間に、低優先ユーザプログラム236-2の未実行の部分があるときには、マイクロプロセッサ100に、その未実行の部分の実行を開始させる。
 本実施の形態に係るPLC1のように、異なる優先度を設定し、それぞれ異なる実行サイクルでユーザプログラムを実行させることで、以下のような作用効果を奏する。すなわち、高優先ユーザプログラム236-1には、モーション演算プログラム234での演算に使用されるユーザプログラム出力データを、モーション制御用入力データを使用して算出する命令を含ませる。一方、低優先ユーザプログラム236-2には、高優先ユーザプログラム236-1に含まれる以外の処理の全部または一部を実現するための命令を含ませる。そうすると、高優先ユーザプログラム236-1にすべての処理を実現させるための命令を含ませる場合にくらべて高優先ユーザプログラム236-1に割り当てられる処理量が少なくなるため、高優先ユーザプログラム236-1の実行時間を短くすることができる。そのため、モーション制御サイクルの周期をより短縮できる可能性が生じる。
 その結果、より短い周期のモーション制御サイクル内でのモーション指令値データの出力処理およびモーション制御用入力データの入力処理、高優先ユーザプログラム236-1の実行、ならびに、モーション演算プログラム234の実行を適切に行うことが可能になる。
 (h6:変形例)
 図12に示すシーケンスにおいては、フィールドネットワークコントローラ140がスケジューラプログラム212からの送信実行の指示を受ける(符号B)ように構成される例を示す。これに代えて、フィールドネットワークコントローラ140がシステムタイマ108からの割り込み信号を直接受けて送信実行するようにしてもよい。
 出力処理プログラム214および入力処理プログラム216の命令に従うデータのコピーを行うことなく、ユーザプログラム236および/またはモーション演算プログラム234が、フィールドネットワーク送信バッファ1045および/またはフィールドネットワーク受信バッファ1046に直接アクセスするようにしてもよい。
 PLCシステムバス11を介したデータの出処理および入力処理についても、スケジューラプログラム212から独立して実行されるように構成してもよい。したがって、CPUユニット13を、スケジューラプログラム212とは独立して、出力処理および入力処理を実行するように構成することも可能である。すなわち、スケジューラプログラム212が出力処理および入力処理の実行を開始させることは必ずしも必要ではない。
 この場合には、たとえば、出力準備割り込み(P)があってから受信完了通知(符号CおよびD)があるまでは、マイクロプロセッサ100がメインメモリ104のそれぞれの送信バッファおよび受信バッファに対してアクセスしないように構成することが好ましい。
 <I.全体処理動作(実施の形態4)>
 上述の実施の形態1においては、ユーザプログラム236の実行サイクル(ユーザプログラム実行サイクル)の周期がモーション制御サイクルの周期と一致している処理例について説明した。これに対して、実施の形態4においては、ユーザプログラム実行サイクルの周期がモーション制御サイクルの周期の2以上の整数倍である場合の処理例について説明する。
 [i1:本実施の形態]
 図13は、本発明の実施の形態4に係る全体処理動作を示すシーケンス図である。図13に示すシーケンスにおいては、ユーザプログラム実行サイクルの周期がモーション制御サイクルの周期の2倍である場合を示す。なお、IO処理プログラム218およびモーション演算プログラム234の実行サイクルの周期は、モーション制御サイクルの周期と一致している。
 図13に示す(1)~(6)の処理は、図9に示す(1)~(6)の処理にそれぞれ同様であるので、以下では、主として、図9に示すシーケンスと相違する点について説明する。
 すなわち、図13に示すシーケンスのモーション制御サイクル1内でのモーション演算プログラム234の実行開始時には、モーション制御用入力データを使用して算出されるユーザプログラム出力データ((4)の処理)がまだ存在しないので、モーション演算プログラム234の命令に従って、モーション制御用入力データ((3)の処理)のみを使用してモーション指令値データが算出される。この算出されたモーション指令値データはIO処理プログラム218に係る作業領域へ転送される((7)の処理)。さらに、IO処理プログラム218の命令に従って、当該転送されたモーション指令値データが出力される((8)の処理)。
 その後、フィールドネットワークコントローラ140が新たなモーション制御用入力データを受信してフィールドネットワーク受信バッファ1046(図4)に当該新たな入力データを格納、および/または、PLCシステムバスコントローラ120が、新たなモーション制御用入力データを受信してPLCシステムバス受信バッファ1044(図4)に当該新たな入力データを格納する((9)の処理)。続いて、IO処理プログラム218の命令に従って、フィールドネットワーク受信バッファ1046および/またはPLCシステムバス受信バッファ1044に格納されている新たなモーション制御用入力データがモーション演算プログラム234に係る作業領域へ転送される((10)の処理)。
 そして、シーケンスのモーション制御サイクル2において、モーション演算プログラム234の命令に従って、新たなモーション制御用入力データ((10)の処理)およびユーザプログラム出力データ((4)の処理)のうち、必要なデータを使用してモーション指令値が算出される。そして、算出されたモーション指令値データがIO処理プログラム218に係る作業領域へ転送される。最終的に、算出されたモーション指令値データは、IO処理プログラム218の命令に従って出力される((5)および(6)の処理)。
 図13に示すように、ユーザプログラム実行サイクルの周期は、モーション制御サイクルの周期と一致させる必要はなく、一般的には、モーション制御サイクルの周期の2以上の整数倍とすることもできる。
 本実施の形態によれば、ユーザプログラム236の実行周期よりも短い制御周期で、更新後のモーション指令値データを出力することができる。この場合には、モーション制御用入力データを使用してユーザプログラム236によって算出されるユーザプログラム出力データを反映してモーション指令値データの更新をすることは、ユーザプログラム実行サイクルごとにしかできない。しかしながら、そのような反映ができないモーション制御サイクルであっても、モーション指令値データを更新して出力することにより、モータの運動をより滑らかに制御できる場合がある。
 たとえば、本実施の形態は、上述したアプリケーション例3(図8)への適用に好適である。搬送車710の駆動輪に関する、主軸の指令値と従軸の指令値とについては、更新された指令値がモーション制御サイクルごとに出力されることになる。一方、主軸の指令位置と従軸の指令値との間に偏差(補正値)を与える補助軸の位置は、ユーザプログラム実行サイクルごとに更新されることになる。この場合、補助軸の位置の更新周期は、主軸に対する指令値および従軸に対する指令値の更新周期よりも長くなるが、アプリケーション例3の場合は、このことはあまり問題とはならず、むしろ、指令値の更新周期が短いことが利点となり、さらに指令値の更新周期よりは長い周期ではあるが補助軸を用いた従軸に対する指令値の補正もできることが利点となる。
 図13に示すシーケンスにおいても、実施の形態1(図9)と同様に、モーション制御サイクルの範囲の区切り方をA,B,Cのいずれとしてもよい。なお、AまたはBの区切り方を採用した場合には、各モーション制御サイクルの途中でユーザプログラム236の実行を中断し、モーション演算プログラム234の実行を開始するための実行制御(典型的には、割り込み信号を用いる)を実装する必要がある。
 Cの区切り方を採用した場合には、ユーザプログラム実行サイクルをより短縮できる可能性がある。すなわち、Cの区切り方によれば、スケジューラプログラム212が、ユーザプログラム実行サイクル(たとえば、図13のT1からT3まで)内において、マイクロプロセッサ100に、モーション演算プログラム234の実行、出力処理および入力処理、ユーザプログラム236の実行をこの順序に実行させるための命令を含むことになる。その結果、各モーション制御サイクル(T1からT2まで、およびT2からT3まで)内においても、モーション演算プログラムの実行、出力処理および入力処理、第1のユーザプログラムの実行がこの順序に実行されることになる。各モーション制御サイクルにおいて、出力処理および入力処理の実行後、モーション制御サイクルが終了するまでの時間はモーション制御サイクルごとに変動しうるが、この処理の順序により、当該時間をユーザプログラム236の実行に無駄なく使うことができる。その結果、マイクロプロセッサ100の待機時間が生じ難くなるので、ユーザプログラム実行サイクルをより短縮できる可能性が生じる。
 [i2:比較例]
 次に、本実施の形態に係るスケジューラプログラム212による効果を説明するために、図13に示すシーケンスとはプログラムの実行順序を異ならせた場合のシーケンスについて比較例として説明する。
 図14は、図13に示す全体処理動作に関する比較例における全体処理動作を示すシーケンス図である。上述の図13においては、「IO処理プログラム218」、「ユーザプログラム236」、「モーション演算プログラム234」の順序でそれぞれのプログラムが実行される例を示したが、図14には、比較例として、「IO処理プログラム218」、「モーション演算プログラム234」、「ユーザプログラム236」の順序でそれぞれのプログラムが実行される例を示す。
 図14に示すような比較例に係るプログラムの実行順序を採用した場合には、入力処理の開始(図14に示す(1)の処理)から、当該入力処理において入力されたモーション制御用入力データを反映したモーション指令値データの出力処理(図14に示す(6)の処理)までには、モーション制御サイクルの3周期分に相当する時間、すなわち、ユーザプログラム実行サイクルの周期よりもモーション制御サイクル1周期分長い時間を要する。その結果、図13に示すプログラムの実行順序に比較して、モーション制御サイクルの1周期分の時間だけ制御が遅れることになる。
 <J.サポート装置>
 次に、PLC1で実行されるプログラムの作成およびPLC1のメンテナンスなどを行うためのPLCサポート装置8について説明する。
 図15は、本発明の実施の形態に係るCPUユニットに接続して用いられるPLCサポート装置8のハードウェア構成を示す模式図である。図15を参照して、PLCサポート装置8は、典型的には、汎用のコンピュータで構成される。なお、メンテナンス性の観点からは、可搬性に優れたノート型のパーソナルコンピュータが好ましい。
 図15を参照して、PLCサポート装置8は、OSを含む各種プログラムを実行するCPU81と、BIOSや各種データを格納するROM(Read Only Memory)82と、CPU81でのプログラムの実行に必要なデータを格納するための作業領域を提供するメモリRAM83と、CPU81で実行されるプログラムなどを不揮発的に格納するハードディスク(HDD)84とを含む。
 PLCサポート装置8は、さらに、ユーザからの操作を受付けるキーボード85およびマウス86と、情報をユーザに提示するためのモニタ87とを含む。さらに、PLCサポート装置8は、PLC1(CPUユニット13)などと通信するための通信インターフェイス(IF)89を含む。
 後述するように、PLCサポート装置8で実行される各種プログラムは、CD-ROM9に格納されて流通する。このCD-ROM9に格納されたプログラムは、CD-ROM(Compact Disk-Read Only Memory)ドライブ88によって読取られ、ハードディスク(HDD)84などへ格納される。あるいは、上位のホストコンピュータなどからネットワークを通じてプログラムをダウンロードするように構成してもよい。
 上述したように、PLCサポート装置8は、汎用的なコンピュータを用いて実現されるので、これ以上の詳細な説明は行わない。
 図16は、本発明の実施の形態に係るCPUユニットに接続して用いられるPLCサポート装置8のソフトウェア構成を示す模式図である。図16を参照して、PLCサポート装置8ではOS310が実行され、PLCサポートプログラム320に含まれる各種のプログラムを実行可能な環境が提供される。
 PLCサポートプログラム320は、エディタプログラム321と、コンパイラプログラム322と、デバッガプログラム323と、シミュレーション用シーケンス命令演算プログラム324と、シミュレーション用モーション演算プログラム325と、通信プログラム326とを含む。PLCサポートプログラム320に含まれるそれぞれのプログラムは、典型的には、CD-ROM9に格納された状態で流通して、PLCサポート装置8にインストールされる。
 エディタプログラム321は、ユーザプログラム236を作成するための入力および編集といった機能を提供する。より具体的には、エディタプログラム321は、ユーザがキーボード85やマウス86を操作してユーザプログラム236のソースプログラム330を作成する機能に加えて、作成したソースプログラム330の保存機能および編集機能を提供する。また、エディタプログラム321は、外部からのソースプログラム330の入力を受付ける。
 コンパイラプログラム322は、ソースプログラム330をコンパイルして、CPUユニット13のマイクロプロセッサ100で実行可能なオブジェクトプログラム形式のユーザプログラム236を生成する機能を提供する。また、コンパイラプログラム322は、ソースプログラム330をコンパイルして、PLCサポート装置8のCPU81で実行可能なオブジェクトプログラム形式のユーザプログラム340を生成する機能を提供する。このユーザプログラム340は、PLCサポート装置8によってPLC1の動作をシミュレート(模擬)するために使用される、シミュレーション用のオブジェクトプログラムである。
 デバッガプログラム323は、ユーザプログラムのソースプログラムに対してデバッグを行うための機能を提供する。このデバッグの内容としては、ソースプログラムのうちユーザが指定した範囲を部分的に実行する、ソースプログラムの実行中における変数値の時間的な変化を追跡する、といった動作を含む。
 デバッガプログラム323は、さらに、シミュレーション用のオブジェクトプログラムであるユーザプログラム340を実行する機能を提供する。このシミュレーション時には、CPUユニット13のシステムプログラムに含まれるシーケンス命令演算プログラム232およびモーション演算プログラム234に代えて、PLCサポートプログラム320に含まれるシミュレーション用シーケンス命令演算プログラム324およびシミュレーション用モーション演算プログラム325が用いられる。
 通信プログラム326は、PLC1のCPUユニット13へユーザプログラム236を転送する機能を提供する。
 一般的には、PLC1に実装されるシステムプログラム210は、CPUユニット13の製造段階でCPUユニット13の不揮発性メモリ106へ格納される。但し、CD-ROM9にシステムプログラム210を格納しておけば、ユーザは、CD-ROM9のシステムプログラム210をPLCサポート装置8へコピーし、通信プログラム326が提供する機能を利用してコピーしたシステムプログラム210をCPUユニット13へ転送することもできる。さらに、CD-ROM9に、PLC1のCPUユニット13で実行されるリアルタイムOS200を格納しておけば、リアルタイムOS200についてもユーザ操作によってPLC1へ再インストールできる。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 PLC、2 フィールドネットワーク、3 サーボモータドライバ、4 サーボモータ、5 リモートIOターミナル、6 検出スイッチ、7 リレー、8 PLCサポート装置、9 CD-ROM、10 接続ケーブル、11 PLCシステムバス、12 電源ユニット、13 CPUユニット、14,53 IOユニット、15 特殊ユニット、51 リモートIOターミナルバス、52 通信カプラ、81 CPU、83 RAM、85 キーボード、86 マウス、87 モニタ、88 CD-ROMドライブ、100 マイクロプロセッサ、102 チップセット、104 メインメモリ、106 不揮発性メモリ、108 システムタイマ、110 USBコネクタ、120 PLCシステムバスコントローラ、122 DMA制御回路、124 PLCシステムバス制御回路、126,146 バッファメモリ、130 PLCシステムバスコネクタ、140 フィールドネットワークコントローラ、142 DMA制御回路、144 フィールドネットワーク制御回路、210 システムプログラム、212 スケジューラプログラム、214 出力処理プログラム、216 入力処理プログラム、218 IO処理プログラム、220 その他のシステムプログラム、222 モーション制御サイクルの周期を設定するプログラム、230 制御プログラム、232 シーケンス命令演算プログラム、234 モーション演算プログラム、236 ユーザプログラム、236-1 高優先ユーザプログラム、236-2 低優先ユーザプログラム、320 PLCサポートプログラム、321 エディタプログラム、322 コンパイラプログラム、323 デバッガプログラム、324 シミュレーション用シーケンス命令演算プログラム、325 シミュレーション用モーション演算プログラム、326 通信プログラム、330 ソースプログラム、340 ユーザプログラム、500 巻き取り装置、502,602 シート材、504,606,614,714,724 モータ、506,718,728 ドライバ、510,518 位置センサ、512 張力検出用ローラ、514 テンションローラ、516 巻き径検出用ローラ、520,612,618 ローラ、600 切断装置、604 カッター、610 センサ、624,716,726 ロータリーエンコーダ、630 マーク、700 搬送システム、702 レール、710 搬送車、712,722 駆動輪、1041 プログラム領域、1042 制御プログラムの作業領域、1043 PLCシステムバス送信バッファ、1044 PLCシステムバス受信バッファ、1045 フィールドネットワーク送信バッファ、1046 フィールドネットワーク受信バッファ、SYS PLCシステム。

Claims (18)

  1.  モータの運動を制御するためのモーション制御機能を有するPLCのCPUユニットであって、
     マイクロプロセッサと、
     記憶手段と、
     通信回路とを備え、
     前記PLCのCPUユニットは、
      モーション指令値データの出力処理およびモーション制御用入力データの入力処理と、モーション演算プログラムの実行とを一定周期のモーション制御サイクルごとに繰り返し実行可能に構成されるとともに、
      ユーザにおける制御目的に応じて作成され、前記モーション演算プログラムに対してその実行に必要な指示を与える処理を含む第1のユーザプログラムを、前記モーション制御サイクルの周期の整数倍の周期の第1のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されており、
     前記記憶手段は、システムプログラムと、前記第1のユーザプログラムとの格納に用いられ、
     前記システムプログラムは、前記モーション演算プログラムと、前記第1のユーザプログラムおよび前記モーション演算プログラムの実行を制御するスケジューラプログラムとを含み、
     前記マイクロプロセッサは、前記記憶手段に格納された前記システムプログラムおよび前記第1のユーザプログラムを実行し、
     前記通信回路は、前記モーション制御サイクルごとに、前記出力処理の少なくとも一部として前記モーション指令値データの送信、および、前記入力処理の少なくとも一部として前記モーション制御用入力データの受信を行い、
     前記スケジューラプログラムは、
      前記マイクロプロセッサに、前記モーション制御サイクルごとに前記モーション演算プログラムの実行を開始させる命令と、
      前記マイクロプロセッサに、前記第1のユーザプログラム実行サイクルごとに前記第1のユーザプログラムの実行を開始させる命令と、
     前記出力処理および前記入力処理、前記第1のユーザプログラムの実行開始、前記第1のユーザプログラムの実行終了、ならびに、前記モーション演算プログラムの実行開始を、この順序で、前記第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含み、
     それにより、前記第1のユーザプログラムが、前記モーション演算プログラムによって使用されるユーザプログラム出力データを、前記モーション制御用入力データを用いて算出する処理を含む場合に、前記入力処理の開始から、当該入力処理において入力されたモーション制御用入力データを反映した前記モーション指令値データの出力処理の終了までに要する時間が、前記第1のユーザプログラム実行サイクルの周期に相当する時間となる、PLCのCPUユニット。
  2.  前記第1のユーザプログラム実行サイクルの周期は、前記モーション制御サイクルの周期に等しい、請求項1に記載のPLCのCPUユニット。
  3.  前記スケジューラプログラムは、前記モーション制御サイクル内において、前記出力処理および前記入力処理の後に、前記マイクロプロセッサに、前記第1のユーザプログラムおよび前記モーション演算プログラムをこの順に実行させるための命令を含む、請求項2に記載のPLCのCPUユニット。
  4.  前記記憶手段は、さらに、ユーザにおける制御目的に応じて作成され、前記モーション演算プログラムによって使用されるユーザプログラム出力データを、前記モーション制御用入力データを用いて算出する処理を含まず、かつ前記モーション制御サイクルの周期の2以上の整数倍の周期の第2のユーザプログラム実行サイクルを有する第2のユーザプログラムの格納に用いられ、
     前記スケジューラプログラムは、前記記憶手段に前記第2のユーザプログラムが格納されている場合に、前記第2のユーザプログラム実行サイクル内において、前記マイクロプロセッサに、最初の前記モーション演算プログラムの実行終了から前記モーション制御サイクル終了までの余剰時間に前記第2のユーザプログラムの実行を開始させるとともに、その後の前記モーション制御サイクルにおける前記モーション演算プログラムの実行終了後の余剰時間に、前記第2のユーザプログラムの未実行の部分があるときには、前記マイクロプロセッサに、その未実行の部分の実行を開始させる、請求項3に記載のPLCのCPUユニット。
  5.  前記第1のユーザプログラム実行サイクルの周期は、前記モーション制御サイクルの周期の2以上の整数倍に等しい、請求項1に記載のPLCのCPUユニット。
  6.  前記スケジューラプログラムは、前記第1のユーザプログラム実行サイクル内において、前記マイクロプロセッサに、前記モーション演算プログラムの実行、前記出力処理および前記入力処理、前記第1のユーザプログラムの実行をこの順序に実行させるための命令を含む、請求項5に記載のPLCのCPUユニット。
  7.  モータの運動を制御するためのモーション制御機能を有するPLCのCPUユニットで実行されるPLC用システムプログラムであって、
     前記PLCのCPUユニットは、第1のユーザプログラムの格納に用いられる記憶手段と、マイクロプロセッサと、通信回路とを含み、
     前記PLCのCPUユニットは、
      モーション指令値データの出力処理およびモーション制御用入力データの入力処理と、モーション演算プログラムの実行とを一定周期のモーション制御サイクルごとに繰り返し実行可能に構成されるとともに、
      ユーザにおける制御目的に応じて作成され、前記モーション演算プログラムに対してその実行に必要な指示を与える処理を含む第1のユーザプログラムを、前記モーション制御サイクルの周期の整数倍の周期の第1のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されており、
     前記PLC用システムプログラムは、前記モーション演算プログラムと、前記第1のユーザプログラムおよび前記モーション演算プログラムの実行を制御するスケジューラプログラムとを含み、
     前記通信回路は、前記モーション制御サイクルごとに、前記出力処理の少なくとも一部として前記モーション指令値データの送信、および、前記入力処理の少なくとも一部として前記モーション制御用入力データの受信を行い、
     前記スケジューラプログラムは、
      前記マイクロプロセッサに、前記モーション制御サイクルごとに前記モーション演算プログラムの実行を開始させる命令と、
      前記マイクロプロセッサに、前記第1のユーザプログラム実行サイクルごとに前記第1のユーザプログラムの実行を開始させる命令と、
     前記出力処理および前記入力処理、前記第1のユーザプログラムの実行開始、前記第1のユーザプログラムの実行終了、ならびに、前記モーション演算プログラムの実行開始を、この順序で、前記第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含み、
     それにより、前記第1のユーザプログラムが、前記モーション演算プログラムによって使用されるユーザプログラム出力データを、前記モーション制御用入力データを用いて算出する処理を含む場合に、前記入力処理の開始から、当該入力処理において入力されたモーション制御用入力データを反映した前記モーション指令値データの出力処理の終了までに要する時間が、前記第1のユーザプログラム実行サイクルの周期に相当する時間となる、PLC用システムプログラム。
  8.  前記第1のユーザプログラム実行サイクルの周期は、前記モーション制御サイクルの周期に等しい、請求項7に記載のPLC用システムプログラム。
  9.  前記スケジューラプログラムは、前記モーション制御サイクル内において、前記出力処理および前記入力処理の後に、前記マイクロプロセッサに、前記第1のユーザプログラムおよび前記モーション演算プログラムをこの順に実行させるための命令を含む、請求項8に記載のPLC用システムプログラム。
  10.  前記スケジューラプログラムは、ユーザにおける制御目的に応じて作成され、前記モーション演算プログラムによって使用されるユーザプログラム出力データを、前記モーション制御用入力データを用いて算出する処理を含まず、かつ前記モーション制御サイクルの周期の2以上の整数倍の周期の第2のユーザプログラム実行サイクルを有する第2のユーザプログラムが前記記憶手段に格納されている場合に、前記第2のユーザプログラム実行サイクル内において、前記マイクロプロセッサに、最初の前記モーション演算プログラムの実行終了から前記モーション制御サイクル終了までの余剰時間に前記第2のユーザプログラムの実行を開始させるとともに、その後の前記モーション制御サイクルにおける前記モーション演算プログラムの実行終了後の余剰時間に、前記第2のユーザプログラムの未実行の部分があるときには、前記マイクロプロセッサに、その未実行の部分の実行を開始させる、請求項9に記載のPLC用システムプログラム。
  11.  前記第1のユーザプログラム実行サイクルの周期は、前記モーション制御サイクルの周期の2以上の整数倍に等しい、請求項7に記載のPLC用システムプログラム。
  12.  前記スケジューラプログラムは、前記第1のユーザプログラム実行サイクル内において、前記マイクロプロセッサに、前記モーション演算プログラムの実行、前記出力処理および前記入力処理、前記第1のユーザプログラムの実行をこの順序に実行させるための命令を含む、請求項11に記載のPLC用システムプログラム。
  13.  モータの運動を制御するためのモーション制御機能を有するPLCのCPUユニットで実行されるPLC用システムプログラムを格納した記録媒体であって、
     前記PLCのCPUユニットは、第1のユーザプログラムの格納に用いられる記憶手段と、マイクロプロセッサと、通信回路とを含み、
     前記PLCのCPUユニットは、
      モーション指令値データの出力処理およびモーション制御用入力データの入力処理と、モーション演算プログラムの実行とを一定周期のモーション制御サイクルごとに繰り返し実行可能に構成されるとともに、
      ユーザにおける制御目的に応じて作成され、前記モーション演算プログラムに対してその実行に必要な指示を与える処理を含む第1のユーザプログラムを、前記モーション制御サイクルの周期の整数倍の周期の第1のユーザプログラム実行サイクルごとに繰り返し実行可能に構成されており、
     前記PLC用システムプログラムは、前記モーション演算プログラムと、前記第1のユーザプログラムおよび前記モーション演算プログラムの実行を制御するスケジューラプログラムとを含み、
     前記通信回路は、前記モーション制御サイクルごとに、前記出力処理の少なくとも一部として前記モーション指令値データの送信、および、前記入力処理の少なくとも一部として前記モーション制御用入力データの受信を行い、
     前記スケジューラプログラムは、
      前記マイクロプロセッサに、前記モーション制御サイクルごとに前記モーション演算プログラムの実行を開始させる命令と、
      前記マイクロプロセッサに、前記第1のユーザプログラム実行サイクルごとに前記第1のユーザプログラムの実行を開始させる命令と、
     前記出力処理および前記入力処理、前記第1のユーザプログラムの実行開始、前記第1のユーザプログラムの実行終了、ならびに、前記モーション演算プログラムの実行開始を、この順序で、前記第1のユーザプログラム実行サイクルの周期に相当する周期で繰り返すための命令とを含み、
     それにより、前記第1のユーザプログラムが、前記モーション演算プログラムによって使用されるユーザプログラム出力データを、前記モーション制御用入力データを用いて算出する処理を含む場合に、前記入力処理の開始から、当該入力処理において入力されたモーション制御用入力データを反映した前記モーション指令値データの出力処理の終了までに要する時間が、前記第1のユーザプログラム実行サイクルの周期に相当する時間となる、PLC用システムプログラムを格納した記録媒体。
  14.  前記第1のユーザプログラム実行サイクルの周期は、前記モーション制御サイクルの周期に等しい、請求項13に記載のPLC用システムプログラムを格納した記録媒体。
  15.  前記スケジューラプログラムは、前記モーション制御サイクル内において、前記出力処理および前記入力処理の後に、前記マイクロプロセッサに、前記第1のユーザプログラムおよび前記モーション演算プログラムをこの順に実行させるための命令を含む、請求項14に記載のPLC用システムプログラムを格納した記録媒体。
  16.  前記スケジューラプログラムは、ユーザにおける制御目的に応じて作成され、前記モーション演算プログラムによって使用されるユーザプログラム出力データを、前記モーション制御用入力データを用いて算出する処理を含まず、かつ前記モーション制御サイクルの周期の2以上の整数倍の周期の第2のユーザプログラム実行サイクルを有する第2のユーザプログラムが前記記憶手段に格納されている場合に、前記第2のユーザプログラム実行サイクル内において、前記マイクロプロセッサに、最初の前記モーション演算プログラムの実行終了から前記モーション制御サイクル終了までの余剰時間に前記第2のユーザプログラムの実行を開始させるとともに、その後の前記モーション制御サイクルにおける前記モーション演算プログラムの実行終了後の余剰時間に、前記第2のユーザプログラムの未実行の部分があるときには、前記マイクロプロセッサに、その未実行の部分の実行を開始させる、請求項15に記載のPLC用システムプログラムを格納した記録媒体。
  17.  前記第1のユーザプログラム実行サイクルの周期は、前記モーション制御サイクルの周期の2以上の整数倍に等しい、請求項13に記載のPLC用システムプログラムを格納した記録媒体。
  18.  前記スケジューラプログラムは、前記第1のユーザプログラム実行サイクル内において、前記マイクロプロセッサに、前記モーション演算プログラムの実行、前記出力処理および前記入力処理、前記第1のユーザプログラムの実行をこの順序に実行させるための命令を含む、請求項17に記載のPLC用システムプログラムを格納した記録媒体。
PCT/JP2011/056768 2011-03-15 2011-03-22 Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体 WO2012124132A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP11860797.7A EP2672346B1 (en) 2011-03-15 2011-03-22 Cpu of plc, system program for plc, and recording medium storing system program for plc
CN201180068882.XA CN103403631B (zh) 2011-03-15 2011-03-22 可编程逻辑控制器的cpu单元
US14/017,684 US10274923B2 (en) 2011-03-15 2013-09-04 CPU of PLC, system program for PLC, and recording medium storing system program for PLC

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011056766A JP4877423B1 (ja) 2011-03-15 2011-03-15 Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体
JP2011-056766 2011-03-15

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/017,684 Continuation US10274923B2 (en) 2011-03-15 2013-09-04 CPU of PLC, system program for PLC, and recording medium storing system program for PLC

Publications (1)

Publication Number Publication Date
WO2012124132A1 true WO2012124132A1 (ja) 2012-09-20

Family

ID=45781982

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/056768 WO2012124132A1 (ja) 2011-03-15 2011-03-22 Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体

Country Status (5)

Country Link
US (1) US10274923B2 (ja)
EP (1) EP2672346B1 (ja)
JP (1) JP4877423B1 (ja)
CN (1) CN103403631B (ja)
WO (1) WO2012124132A1 (ja)

Families Citing this family (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015090548A (ja) * 2013-11-05 2015-05-11 オムロン株式会社 制御装置
JP6626240B2 (ja) 2014-03-13 2019-12-25 オムロン株式会社 コントローラ
JP2015210751A (ja) * 2014-04-30 2015-11-24 パナソニック デバイスSunx株式会社 プログラマブルコントローラ、制御方法及び制御プログラム
WO2016009477A1 (ja) * 2014-07-14 2016-01-21 三菱電機株式会社 制御装置
CN104597832B (zh) * 2014-12-31 2017-04-19 浙江中控研究院有限公司 一种基于amba总线的plc程序调度器ip核
JP6488830B2 (ja) * 2015-03-31 2019-03-27 オムロン株式会社 制御装置
JP2016194831A (ja) * 2015-03-31 2016-11-17 オムロン株式会社 制御装置
DE102015218906B4 (de) * 2015-09-30 2021-06-10 Siemens Mobility GmbH Verfahren zum Betreiben eines Datenübertragungssystems und Datenübertragungssystem
KR102079499B1 (ko) * 2015-10-20 2020-02-21 엘에스산전 주식회사 Plc 위치 결정 시스템의 축별 제어주기 독립 할당 방법
CN105550152B (zh) * 2015-12-11 2018-03-30 中国航空工业集团公司西安航空计算技术研究所 一种基于时间的gjb289数据总线命令调度电路及方法
WO2017141332A1 (ja) * 2016-02-15 2017-08-24 三菱電機株式会社 負荷分散装置
JP6165286B1 (ja) * 2016-02-29 2017-07-19 株式会社安川電機 モータ制御システム、ロボットシステム、及びモータ制御システムの通信方法
WO2018078841A1 (ja) 2016-10-31 2018-05-03 三菱電機株式会社 撮像機器連携装置、撮像機器連携プログラム、連携サポートシステムおよび制御システム
JP6903976B2 (ja) * 2017-03-22 2021-07-14 オムロン株式会社 制御システム
JP6984199B2 (ja) * 2017-07-07 2021-12-17 オムロン株式会社 制御システム、および、制御方法
JP6919404B2 (ja) 2017-08-10 2021-08-18 オムロン株式会社 制御装置
JP6950385B2 (ja) * 2017-09-12 2021-10-13 オムロン株式会社 制御装置および制御方法
JP6881174B2 (ja) 2017-09-13 2021-06-02 オムロン株式会社 制御装置および制御方法
JP6903275B2 (ja) 2017-09-14 2021-07-14 オムロン株式会社 制御装置および制御方法
JP6900863B2 (ja) 2017-09-22 2021-07-07 オムロン株式会社 制御装置、制御方法および制御プログラム
JP2019061467A (ja) * 2017-09-26 2019-04-18 オムロン株式会社 サポート装置およびサポートプログラム
JP7087316B2 (ja) * 2017-09-27 2022-06-21 オムロン株式会社 情報処理装置、情報処理方法およびプログラム
JP7059673B2 (ja) * 2018-02-14 2022-04-26 オムロン株式会社 制御装置、制御システム、制御方法、および、制御プログラム
JP6927089B2 (ja) 2018-03-05 2021-08-25 オムロン株式会社 制御装置、システムプログラム、制御方法
JP7020198B2 (ja) 2018-03-09 2022-02-16 オムロン株式会社 制御装置および制御システム
CN108762197B (zh) * 2018-06-14 2019-12-31 杭州电子科技大学 基于plc的运动控制方法和运动控制器
JP7024679B2 (ja) * 2018-10-05 2022-02-24 オムロン株式会社 開発支援プログラム、開発支援装置、および開発支援方法
JP6761584B2 (ja) 2018-10-23 2020-09-30 株式会社安川電機 産業機器の制御装置、産業機器の制御システム、及び産業機器の制御方法
JP7103214B2 (ja) * 2018-12-28 2022-07-20 オムロン株式会社 サポート装置および支援プログラム
JP6918849B2 (ja) * 2019-01-22 2021-08-11 ファナック株式会社 システム
JP6729746B2 (ja) * 2019-04-08 2020-07-22 オムロン株式会社 制御装置
JP7230703B2 (ja) 2019-06-20 2023-03-01 オムロン株式会社 制御装置
JP7423920B2 (ja) * 2019-07-03 2024-01-30 オムロン株式会社 制御システム、設定装置およびコンピュータプログラム
JP7318406B2 (ja) 2019-08-07 2023-08-01 オムロン株式会社 制御装置
JP7294078B2 (ja) 2019-11-12 2023-06-20 オムロン株式会社 制御装置
JP7456165B2 (ja) 2020-01-16 2024-03-27 オムロン株式会社 制御装置
CN114598664A (zh) * 2020-12-03 2022-06-07 武汉斗鱼鱼乐网络科技有限公司 一种任务执行方法及相关装置
CN114454237B (zh) * 2022-02-18 2024-05-14 杭州勤鹄科技有限公司 一种珍珠棉定长切断装置及方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004259112A (ja) * 2003-02-27 2004-09-16 Omron Corp 評価用システム及び評価方法並びにモーションコントローラ
JP2007140655A (ja) 2005-11-15 2007-06-07 Yaskawa Electric Corp モーションコントローラ
JP2008146357A (ja) * 2006-12-11 2008-06-26 Fuji Electric Fa Components & Systems Co Ltd プログラマブルコントローラ、及びその支援装置

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63310004A (ja) * 1987-06-12 1988-12-19 Omron Tateisi Electronics Co プログラマブル・コントロ−ラ
JP3371349B2 (ja) * 1995-07-21 2003-01-27 オムロン株式会社 制御処理装置
JP3563541B2 (ja) * 1996-09-13 2004-09-08 株式会社東芝 データ格納装置及びデータ格納方法
JPH11249715A (ja) * 1998-02-26 1999-09-17 Yaskawa Electric Corp シーケンスプログラムの自動生成方法とモーションコントローラ
DE10065417B4 (de) * 2000-12-27 2011-07-21 Siemens AG, 80333 Programmierung von zyklischen Maschinen
DE60225443T2 (de) * 2001-05-31 2009-03-26 Omron Corp. Sicherheitseinheit, steuerungsverkettungsverfahren, steuerungssystemsteuerverfahren und steuerungssystemüberwachungsverfahren
JP3715258B2 (ja) * 2002-05-29 2005-11-09 ファナック株式会社 制御装置
JP3882783B2 (ja) * 2002-05-31 2007-02-21 オムロン株式会社 プログラマブルコントローラ及びcpuユニット並びに通信ユニット及び通信ユニットの制御方法
JP3606281B2 (ja) * 2002-06-07 2005-01-05 オムロン株式会社 プログラマブルコントローラ及びcpuユニット並びに特殊機能モジュール及び二重化処理方法
JP2005129026A (ja) * 2003-10-02 2005-05-19 Omron Corp プログラマブルコントローラおよび通信ユニットならびにコントローラシステムおよびデータ処理方法ならびに変数解決方法およびデータ受渡方法
DE10357824A1 (de) * 2003-12-09 2005-07-14 Kuka Roboter Gmbh Verfahren und Vorrichtung zum Betreiben zusammenarbeitender unterschiedlicher Geräte
EP1574921B1 (en) * 2004-03-11 2012-12-12 Omron Corporation Synchronous controller
JP4442358B2 (ja) * 2004-08-02 2010-03-31 株式会社デンソーウェーブ 制御装置及びコンピュータプログラム
JP2006107312A (ja) * 2004-10-08 2006-04-20 Yaskawa Electric Corp モーションコントローラ
JP2008097323A (ja) * 2006-10-12 2008-04-24 Koyo Electronics Ind Co Ltd モーションコントロールシステム
US20090106755A1 (en) * 2007-10-19 2009-04-23 Sundeep Chandhoke Programmable Controller with Multiple Processors Using Scanning and Data Acquisition Architectures
JP5069325B2 (ja) * 2010-03-11 2012-11-07 株式会社豊田中央研究所 タスク実行制御装置及びプログラム
US8504176B2 (en) * 2011-03-15 2013-08-06 Omron Corporation CPU unit of PLC, system program for PLC, and recording medium storing system program for PLC
US8977534B2 (en) * 2011-03-15 2015-03-10 Omron Corporation Controller support apparatus, controller support program executed on the apparatus, storage medium storing the program, and method of estimating execution time of control program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004259112A (ja) * 2003-02-27 2004-09-16 Omron Corp 評価用システム及び評価方法並びにモーションコントローラ
JP2007140655A (ja) 2005-11-15 2007-06-07 Yaskawa Electric Corp モーションコントローラ
JP2008146357A (ja) * 2006-12-11 2008-06-26 Fuji Electric Fa Components & Systems Co Ltd プログラマブルコントローラ、及びその支援装置

Also Published As

Publication number Publication date
CN103403631A (zh) 2013-11-20
US20140005835A1 (en) 2014-01-02
JP2012194662A (ja) 2012-10-11
US10274923B2 (en) 2019-04-30
CN103403631B (zh) 2016-01-20
EP2672346A1 (en) 2013-12-11
JP4877423B1 (ja) 2012-02-15
EP2672346A4 (en) 2015-09-02
EP2672346B1 (en) 2019-06-19

Similar Documents

Publication Publication Date Title
JP4877423B1 (ja) Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体
US9618922B2 (en) CPU of PLC, system program for PLC, and recording medium storing system program for PLC
US10274936B2 (en) Control apparatus
JP4752984B1 (ja) Plcのcpuユニット、plc用のシステムプログラムおよびplc用のシステムプログラムを格納した記録媒体
JP4807475B1 (ja) 演算ユニット、出力制御方法、およびプログラム
JP5803337B2 (ja) 同期制御装置、同期制御方法、同期制御プログラム、および同期制御プログラムを記録したコンピュータ読み取り可能な記録媒体
JP6409557B2 (ja) 制御装置、コントローラ・システム、出力制御方法、およびプログラム
JP6488830B2 (ja) 制御装置
US9618924B2 (en) CPU of PLC, system program for PLC, and recording medium storing system program for PLC
US8706262B2 (en) CPU unit of PLC, system program for PLC, and recording medium storing system program for PLC
EP2555068B1 (en) Synchronization control apparatus
US8504176B2 (en) CPU unit of PLC, system program for PLC, and recording medium storing system program for PLC
JP6729746B2 (ja) 制御装置
CN110192159B (zh) 控制装置
JP6299064B2 (ja) 制御装置、制御方法、およびプログラム
JP2016194831A (ja) 制御装置
US9568905B2 (en) CPU of PLC, system program for PLC, and recording medium storing system program for PLC
JP2012194955A (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: 11860797

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2011860797

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE