WO2013054725A1 - Controller, monitoring unit, and sequence program updating method - Google Patents

Controller, monitoring unit, and sequence program updating method Download PDF

Info

Publication number
WO2013054725A1
WO2013054725A1 PCT/JP2012/075753 JP2012075753W WO2013054725A1 WO 2013054725 A1 WO2013054725 A1 WO 2013054725A1 JP 2012075753 W JP2012075753 W JP 2012075753W WO 2013054725 A1 WO2013054725 A1 WO 2013054725A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
unit
monitoring unit
update
processor unit
Prior art date
Application number
PCT/JP2012/075753
Other languages
French (fr)
Japanese (ja)
Inventor
義則 望月
小泉 稔
高橋 一郎
Original Assignee
株式会社日立産機システム
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立産機システム filed Critical 株式会社日立産機システム
Publication of WO2013054725A1 publication Critical patent/WO2013054725A1/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
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/13Plc programming
    • G05B2219/13173Selection out of all possible programs with switch
    • 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/20Pc systems
    • G05B2219/23Pc programming
    • G05B2219/23425Selection of program, adaptive to process

Definitions

  • the subject matter disclosed in this specification relates to management of a sequence program in a controller that controls a control target device according to the sequence program.
  • PLC programmable logic controller
  • sequence program software
  • the PLC is composed of a plurality of units including, for example, a CPU unit that executes a sequence program and an I / O unit. Each unit performs data communication with each other by using a shared memory.
  • control target devices examples include an inverter, a compressor, and a servo motor, and each of the plurality of control devices is connected to an I / O unit.
  • the CPU unit transmits a control request to the control device via the I / O unit.
  • the control device operates in response to the control request and transmits a response to the control request to the CPU unit via the I / O unit.
  • the PLC can change the control method for the control device by switching the sequence program.
  • a PLC installed in a production line that produces a plurality of types of products can change the control method by switching the sequence program in accordance with the type of product flowing in the production line.
  • a plurality of products can be manufactured on one manufacturing line, and there is no need to provide a manufacturing line for each type of product to be manufactured.
  • Patent Documents 1 and 2 As a countermeasure for such a problem, there has been proposed a technique that allows a sequence program to be changed without affecting the system even while the system is operating (see Patent Documents 1 and 2).
  • Patent Document 1 The technique of Patent Document 1 is to manage all sequence programs necessary for changing a sequence program in advance by a CPU of a controller and switch the sequence program in accordance with a request from a host device.
  • Patent Document 2 The technique of Patent Document 2 is such that all the sequence programs necessary for changing the sequence program are managed in advance by the CPU of the controller, and the sequence programs are switched in accordance with a preset execution order definition.
  • JP2007-265094 (paragraph 0013) JP 5-307403 (paragraph 0010)
  • Patent Documents 1 and 2 have the following problems.
  • Patent Document 1 is such that all the sequence programs necessary for changing the sequence program are managed in advance by the CPU of the controller, and the sequence programs are switched in accordance with a request from the host device.
  • the host device requests switching of the sequence program regardless of the state of the controller or the control device.
  • Patent Document 2 is such that all the sequence programs required for changing the sequence program are managed in advance by the CPU of the controller, and the sequence programs are switched in accordance with a preset execution order definition. It is.
  • the execution order definition is defined regardless of the state of the controller or the control device.
  • Patent Documents 1 and 2 cannot perform a change process such as adaptively switching the sequence program in accordance with the state of the controller or control device.
  • the technology disclosed in the present specification is a technique that enables adaptive switching of a sequence program in accordance with the state of a controller or a control device.
  • a controller includes a processor unit that executes a program to control a control target device, and a monitoring unit that monitors the processor unit, and the processor unit accompanies execution of the program.
  • the status information of at least one of the own device and the control target device is notified to the monitoring unit, and the monitoring unit cooperates with the processor unit when the status information notified from the processor unit matches a predetermined update condition.
  • the sequence program executed by the processor unit is updated.
  • the processor unit and the monitoring unit each have a shared memory for sharing the same information
  • the processor unit notifies the monitoring unit of the status information via the shared memory
  • the monitoring unit A program to be updated may be selected according to the state information notified from the processor unit, and the selected program may be sent to the processor unit via the shared memory.
  • the controller is a programmable logic controller that performs sequence control on the device to be controlled by executing a sequence program, and a process for writing the state information to the shared memory is incorporated in the program together with the sequence control. It is good.
  • the monitoring unit may periodically read out the state information area of the shared memory and determine whether or not it matches the update condition.
  • a process for setting a request flag for requesting program update in the shared memory when the state information on the state in which the program should be updated is written in the shared memory is incorporated in the program, and the monitoring unit
  • the area of the request flag in the shared memory may be read periodically, and if the request flag for requesting program update is set, the area of the status information may be read out.
  • the monitoring unit determines whether or not to perform the program update requested from the processor unit, and when it is determined not to perform the program update, displays that the requested program update is not performed on the display unit. Good.
  • FIG. 3 is a block diagram illustrating a configuration example of a CPU unit 114.
  • FIG. 3 is a block diagram illustrating a configuration example of a monitoring unit 116.
  • FIG. It is the figure which showed an example of the status table 274 in detail.
  • FIG. 7 is a sequence diagram for transferring a sequence program 272, a status table 274, and a management table 276 from the PC 100 to the monitoring unit 116 when the PLC 110 is initially activated. It is a flowchart which shows operation
  • FIG. 7 is a sequence diagram for transferring a sequence program 272, a status table 274, and a management table 276 from the PC 100 to the monitoring unit 116 when the PLC 110 is initially activated. It is a flowchart which shows operation
  • FIG. 6 is a sequence diagram when a new sequence program is delivered from the PC 100 to the monitoring unit 116.
  • FIG. 11 is a sequence diagram of a modified example when a new sequence program is delivered from the PC 100 to the monitoring unit 116.
  • 12 is a flowchart showing a detailed operation of the monitoring unit 116 in the program update process shown in step 1118.
  • FIG. 1 is a block diagram showing an example of a control system in the present embodiment.
  • the control system of the present embodiment includes a PC (personal computer) 100, a PLC (programmable logic controller) 110, an inverter 120, a compressor 122, and a servo motor 124.
  • the inverter 120, the compressor 122, and the servo motor 124 are examples of control devices to be controlled by the PLC 110.
  • a FA (Factory Automation) network system corresponds to this control system.
  • a communication protocol for serial communication is used for data transmission / reception between the PLC 110 and these control devices (inverter 120, compressor 122, servo motor 124).
  • these control devices inverter 120, compressor 122, servo motor 124.
  • Modbus registered trademark
  • CC-Link registered trademark
  • FA Regenery Automation
  • the PLC 110 includes a power supply unit 112, a CPU (Central Processing Unit) unit 114, a monitoring unit 116, and a plurality of I / O units 118.
  • a CPU Central Processing Unit
  • the CPU unit 114, the monitoring unit 116, and the I / O unit 118 each have a shared memory. These shared memories are connected to each other via a bus, and are memories that synchronize data with each other and hold common data.
  • the CPU unit 114, the monitoring unit 116, and the I / O unit 118 can perform data communication between the units by writing data to and reading data from the shared memory.
  • the I / O unit 118 is a unit for connecting a control device to this control system.
  • Control devices such as an inverter 120, a compressor 122, and a servo motor 124 are connected to the plurality of I / O units 118.
  • the PLC 110 of this embodiment may further include other units such as a communication unit and a counter unit.
  • the communication unit and the counter unit may also have a shared memory and perform data communication with the CPU unit 114 and the monitoring unit 116.
  • the CPU unit 114 stores a sequence program that defines a control sequence, and executes the sequence control on the control device connected to the I / O unit 118 by executing the sequence program.
  • the monitoring unit 116 sends a sequence program to the CPU unit 114 in accordance with the state of the CPU unit 114, and updates the sequence program in the CPU unit 114. At that time, the monitoring unit 116 monitors the setting value set in the shared memory by the CPU unit 114. This set value is set by the CPU unit 114 with the execution of the control sequence, and the update of the sequence program and the sequence program to be updated are determined by the value. The monitoring unit 116 selects a sequence program corresponding to the set value set by the CPU unit 114 from the plurality of sequence programs held, and the sequence program is stored in the CPU unit 114 using a shared memory. Forward.
  • FIG. 2A is a block diagram showing a configuration example of the CPU unit 114.
  • the CPU unit 114 includes a hardware module 200 and a storage device 220 as a hardware configuration.
  • the hardware module 200 is hardware necessary for the operation of the CPU unit 114, and includes a microcomputer 201, a bus ASIC 210, and a display unit 212.
  • the microcomputer 201 includes a CPU 202, an input / output port 203, an external I / F 204, a ROM 205, a RAM 206, and a nonvolatile memory 207.
  • the bus ASIC 210 is a module constituting a shared memory of each unit mounted on the PLC 110, and synchronizes data with each other. Thereby, data communication between units becomes possible.
  • the memory configuration of the shared memory will be described later.
  • the display unit 212 is a module that visually displays information to the user, and is used for display when the user inputs information to the CPU unit 114 or notifies the user of information from the CPU unit 114.
  • the storage device 220 is a storage device composed of, for example, a nonvolatile semiconductor memory or a magnetic storage medium, and stores programs and data necessary for the operation of the CPU unit 114.
  • the sequence program 222 and a load program 224 that transfers the sequence program 222 to the memory in the hardware module 200 are stored in the storage device 220.
  • the CPU unit 114 has an OS function unit 230, a program update application function unit 240, and a control application function unit 246 as functional configurations realized by the CPU 202 executing the software program.
  • the OS function unit 230 is realized by basic software, and comprehensively controls the operation of the CPU unit 114.
  • the program update application function unit 240 is realized by application software, and updates the sequence program in cooperation with the monitoring unit 116.
  • the program update application function unit 240 includes a program update function 242 and a program load function 244.
  • the program update function 242 monitors the data at the address in the shared memory to set a value. When the value that requests the update is detected, the program update function 242 This function prepares for program update.
  • the program load function 244 is a function for storing the sequence program set in the shared memory by the monitoring unit 116 at a predetermined address in the memory of the CPU unit 114 itself.
  • the control application function unit 246 is realized by application software and executes the sequence program 222.
  • FIG. 2B is a block diagram illustrating a configuration example of the monitoring unit 116.
  • the monitoring unit 116 includes a hardware module 250 and a storage device 270 as a hardware configuration.
  • the hardware module 250 has the same configuration as the hardware module 200 of the CPU unit 114, the description thereof is omitted.
  • the storage device 270 holds a plurality of sequence programs 272, a state table 274, and a management table 276 necessary for updating the sequence program stored in the CPU unit 114.
  • the storage device 270 holds a plurality of sequence programs having different functions so that the sequence programs can be flexibly switched in accordance with the state of the CPU unit 114 and the state of the control device.
  • FIG. 3A shows an example of the status table 274 in detail.
  • the status table 274 is a table indicating information related to the sequence program executed by the CPU unit 114, and includes an address 310, a program ID 312 and a program size 314 of each executed sequence program.
  • the address 310 indicates the address of the memory in which the sequence program indicated by the program ID 312 is stored.
  • the program ID 312 is identification information that uniquely identifies the sequence program being executed.
  • the program size 314 indicates the size of the sequence program indicated by the program ID 312.
  • the table 274 may further include a storage address of a sequence program executed after the execution of the sequence program indicating the program ID 312.
  • FIG. 3B shows an example of the management table 276 in detail.
  • the management table 276 is a table showing information on a plurality of sequence programs stored in the storage device 270 by the monitoring unit 116.
  • the program ID 312 of each sequence program, the program name 320, the program size 314, the storage destination address 322, An update condition 324 and a version 326 are included.
  • the program ID 312 of the management table 276 is identification information for uniquely identifying each sequence program stored in the monitoring unit 116.
  • the program name 320 is the name of the sequence program indicated by the program ID 312.
  • the storage destination address 322 indicates an address for storing the sequence program indicated by the program ID 312 when the sequence program is updated.
  • the update condition 324 indicates a condition for updating the sequence program indicated by the program ID 312. When this update condition 324 is satisfied, the sequence program is updated.
  • Version 326 is a version of the sequence program indicated by the program ID 312 and is used for managing the sequence program.
  • the above is the description of the management table 276.
  • the management table 276 may further include the program ID of the program, the date and time when the sequence program is stored in the storage device 270, and the like.
  • the monitoring unit 116 has an OS function unit 280 and a monitoring application function unit 290 as functional configurations realized by the CPU 252 executing the software program.
  • the OS function unit 280 is realized by basic software, and comprehensively controls the operation of the monitoring unit 116.
  • the monitoring application function unit 290 is realized by application software, uses a shared memory, monitors the state of the CPU unit 114 and the state of the control device, and selects a sequence program according to the obtained state.
  • Functions of the monitoring application function unit 290 include a CPU unit state monitoring function 292, a sequence program selection function 294, and a sequence program transfer function 296.
  • the CPU unit state monitoring function 292 is a function that the CPU unit 114 monitors the data of the address (program update condition 406) in the shared memory that sets the state of the CPU unit 114 and the state of the control device. This is a function for detecting a change in the state of the device.
  • the program update condition 406 is status information indicating the status of the CPU unit 114 or the control device, which the CPU unit 114 notifies the monitoring unit 116 using the shared memory.
  • the sequence program selection function 294 is a function for selecting a sequence program in which the state change of the CPU unit 114 and the control device detected by the CPU unit state monitoring function 292 matches the update condition 324 of the management table 276.
  • the sequence program transfer function 296 is a function of transferring the sequence program selected by the sequence program selection function 294 to the CPU unit 114 using a shared memory.
  • FIG. 4 shows the memory configuration of the shared memory in detail. Since the shared memories synchronize data by the functions of the bus ASICs 210 and 260, the shared memory of the CPU unit 114 and the shared memory of the monitoring unit 116 are maintained in a state of holding the same data. For example, data written by the CPU unit 114 to its own shared memory is also written to the shared memory of the monitoring unit 116.
  • the shared memory includes a program update management area 400, a program update area 410, and a system area 420.
  • the program update management area 400 is an area for storing information necessary for changing the sequence program without affecting the control system.
  • the program update management area 400 includes a program update preparation flag 402, a program update completion flag 404, and a program update condition 406.
  • the program update preparation flag 402 is normally set to “0”, and is a flag that sets “1” when the monitoring unit 116 is ready to change the sequence program. When the monitoring unit 116 sets “1” in the flag, the CPU unit 114 is notified that the sequence program is to be updated.
  • the program update completion flag 404 is normally set to “0”, and is a flag that sets “1” when the CPU unit 114 completes the update of the sequence program. When the CPU unit 114 sets “1” in the flag, the monitoring unit 116 is notified that the update of the sequence program has been completed.
  • the program update condition 406 is information indicating a condition for updating the sequence program.
  • the CPU unit 114 sets the value of the update condition here during execution of the sequence control.
  • the monitoring unit 116 uses the CPU unit state monitoring function 292 to monitor this area, and determines to update the sequence program based on the value of this area.
  • the arrangement of the program update condition 406 shown in FIG. 4 is an example, and the program update condition 406 may be in an area other than the program update management area 400.
  • the program update area 410 is an area used when the monitoring unit 116 transfers a sequence program to the CPU unit 114, and includes an update destination address 412, a program size 414, and an update program 416.
  • the storage destination address 412 indicates the storage destination address of the sequence program to be updated.
  • Program size 414 indicates the program size of the sequence program to be updated.
  • the update program 416 is an area for storing a sequence program to be updated.
  • the system area 420 is an area for storing information necessary for each unit mounted on the PLC 110 to operate.
  • FIG. 5 is a sequence diagram for transferring the sequence program 272, the status table 274, and the management table 276 from the PC 100 to the monitoring unit 116 when the PLC 110 is initially activated.
  • the PC 100 After the PC 100 and the monitoring unit 116 are activated, the PC 100 transmits a plurality of sequence programs and various table information necessary for operating the control system to the monitoring unit 116 (step 500).
  • the monitoring unit 116 When the monitoring unit 116 receives the sequence program and information on various tables (step 510), the monitoring unit 116 saves the sequence program in the storage device 270 (step 520), and based on the received information on the various tables, the status table 274 and A management table 276 is created (step 530).
  • the monitoring unit 116 transmits information setting completion to the PC 100 (step 540).
  • the initial startup sequence is terminated (step 550).
  • PC 100 may use a dedicated application to execute this initial startup sequence.
  • the monitoring unit 116 When the sequence program and each table are already set in the monitoring unit 116, the monitoring unit 116 returns information indicating that it has already been set to the PC 100 as a response to the sequence program transmitted by the PC 100 in step 500. You may decide to do it. Further, the monitoring unit 116 may notify the user that the setting has already been made using the display unit 264, and may cause the user to select whether or not to overwrite already set information. . Furthermore, when the information setting completion notification cannot be received from the monitoring unit 116, the PC 100 may retransmit the sequence program and table information.
  • the example in which the sequence program is transmitted only from the PC 100 to the monitoring unit 116 on the assumption that the sequence program is set in the CPU unit 114 in advance is shown. However, if no sequence program is set in the CPU unit 114 in advance, the PC 100 transmits the sequence program set in the CPU 114 and the sequence program stored in the monitoring unit 116 to the monitoring unit 116 so that they can be distinguished from each other. To do.
  • FIG. 6 is a flowchart showing the operation of the monitoring unit 116 when the sequence program of the CPU unit 114 is updated.
  • FIG. 7 is a flowchart showing the operation of the CPU unit 114 when the sequence program of the CPU unit 114 is updated. The operation of the monitoring unit 116 shown in FIG. 6 and the operation of the CPU unit 114 shown in FIG. 7 are linked.
  • the monitoring unit 116 uses the CPU unit state monitoring function 292 to check the value of the program update condition 406 (step 600).
  • the monitoring unit 116 uses the sequence program selection function 294 to determine whether or not the changed program update condition 406 matches the update condition 324 in the management table 276 ( Step 602). If the program update condition 406 does not match the update condition 324, the monitoring unit 416 ends the process as it is.
  • the monitoring unit 116 further refers to the state table 274 (step 604), and confirms whether or not the sequence program that is requested to be updated is required ( Step 606).
  • the monitoring unit 116 refers to the management table 276 by using the sequence program selection function 294, and acquires the program size 314 and storage destination address 322 of the sequence program to be updated. . Then, the monitoring unit 116 updates the program size 314 of the sequence program being executed stored in the status table 274 with the program size 314 of the sequence program to be updated stored in the management table 276. It is determined whether or not other sequence programs are affected (step 608).
  • the monitoring unit 116 updates the sequence program using the sequence program transfer function 296.
  • the monitoring unit 116 displays on the display unit 264 that it cannot be updated because it affects the other sequence program (step 620). Further, the monitoring unit 116 may also notify the PC 100 through the external I / F 254 that it cannot be updated (step 622).
  • the monitoring unit 116 uses the sequence program transfer function 296 to update the sequence program update destination address and data size in the program update area 410 of the shared memory. Each sequence program is set (step 610). Further, the monitoring unit 116 sets “1” in the program update preparation flag 402 in order to notify the CPU unit 114 that the preparation for updating the sequence program has been completed (step 612).
  • the CPU unit 114 uses the program update function 242 to check the value of the program update preparation flag 402 at regular intervals (step 702), and whether the value of the program update preparation flag 402 is “1”. It is determined whether or not (step 704).
  • the program update preparation flag 402 being “1” indicates that the monitoring unit 116 is ready for update.
  • the CPU unit 114 executes a sequence program update process (step 704). If the value of the program update preparation flag 402 is other than “1”, the sequence program update process is not executed and the normal process is executed (step 710).
  • the update process of the sequence program in the CPU unit 114 will be described below.
  • the sequence program stored in the CPU unit 114 when it is detected that “1” is set in the memory address for storing the program update preparation flag 402, the memory address that may be updated is not accessed. It is assumed that a function for transitioning to an operation mode (hereinafter referred to as an update state) is incorporated.
  • the CPU unit 114 When the CPU unit 114 detects that the program update preparation flag 402 is set to “1” using the program update function 242, the CPU unit 114 shifts the sequence program to the update state. Thereafter, the CPU unit 114 uses the program load function 244 to load the update program 416 by the program size 414 to the memory address indicated by the update destination address 412 in the program update area 410 (step 706).
  • the CPU unit 114 uses the program load function 244 to set “1” in the program update completion flag 404 (step 708).
  • the monitoring unit 116 uses the CPU module state monitoring function 292 to determine whether or not the program update completion flag 404 is set to “1” until it is set to “1”. Repeat (step 614).
  • the monitoring unit 116 determines that the update of the sequence program in the CPU unit 114 is completed, and sets the program update completion flag 404 and the program update preparation flag 402. “0” is set for each (steps 616 and 618).
  • step 704 when the CPU unit 114 detects that the value of the program update preparation flag 402 is set to “0” (step 704), the CPU unit 114 transitions from the update state to a state in which normal processing is executed (step 710). Restart execution of the sequence program.
  • the CPU unit 114 notifies the monitoring unit 116 of status information indicating the status of the CPU unit 114 or the control device, and the monitoring unit 116 determines whether to update the sequence program according to the status information. Therefore, the sequence program can be adaptively switched so as to match the state of the CPU unit 114 or the control device.
  • sequence program stored in the CPU unit 114 transitions to the update state when “1” is set in the program update preparation flag 402.
  • a sequence program that does not access only a specific memory address according to the value set in the program update preparation flag 402 may be stored in the CPU unit 114 in advance.
  • the monitoring unit 116 periodically confirms that the update of the sequence program has been completed by referring to the value of the program update completion flag 404.
  • the monitoring unit 116 indicates that the update is not completed on the display unit 264 as in steps 620 and 622. May be displayed and notified to the PC 100 via the external I / F 254.
  • the monitoring unit 116 checks the program update condition and determines whether or not to update the program.
  • the update method is not limited to this example.
  • the CPU unit 114 may actively request the monitoring unit 116 to update the program.
  • FIG. 8 is a flowchart showing a modified example of the operation of the monitoring unit 116 when the sequence program of the CPU unit 114 is updated.
  • FIG. 9 is a flowchart showing a modified example of the operation of the CPU unit 114 when the sequence program of the CPU unit 114 is updated. The operation of the monitoring unit 116 shown in FIG. 8 and the operation of the CPU unit 114 shown in FIG. 9 are linked.
  • the CPU unit 114 sets the update condition for the update in the program update condition 406 and then sets “1” in the program update preparation flag 402. Is set (step 902).
  • the sequence program is preinstalled with a process for recognizing whether the sequence program needs to be updated and setting the program update condition 406 and the program update preparation flag 402 when the sequence program needs to be updated. It shall be.
  • the monitoring unit 116 periodically checks the value of the program update preparation flag 402 using the CPU unit state monitoring function 292 (step 802). Then, the monitoring unit 116 determines whether or not the program update preparation flag 402 has become “1” (step 803).
  • the monitoring unit 116 checks the program update condition 406 using the sequence program selection function 294 (step 804). Further, the monitoring unit 116 compares the program update condition with the update condition 324 of the management table 276 (step 806).
  • the monitoring unit 116 refers to the status table 274 using the sequence program selection function 294 (step 808), and the sequence program It is determined whether or not updating is necessary (step 810). For example, if the version of the sequence program that is requested to be updated has already been executed, the update is not necessary.
  • the monitoring unit 116 refers to the status table 274 using the sequence program selection function 294, and acquires the program size 314 and storage destination address 322 of the sequence program to be updated. To do. Then, the monitoring unit 116 compares the program size 314 of the sequence program to be updated with the program size 314 stored in the status table 274 to determine whether there is an influence on other sequence programs.
  • the monitoring unit 116 determines that the sequence program can be updated using the sequence program transfer function 296 (step 812).
  • step 812 If it is confirmed in step 812 that the sequence program can be updated, the monitoring unit 116 uses the sequence program transfer function 296 to update the update destination address of the sequence program to be updated in the program update area 410 of the shared memory. , Data size, and sequence program are set (step 814).
  • the monitoring unit 116 sets “1” in the program update completion flag 404 in order to notify the CPU unit 114 that the sequence program update preparation has been completed (step 816).
  • the CPU unit 114 periodically determines whether or not the value of the program update completion flag 404 is “1” using the program update function 242 (step 904). If the program update completion flag 404 is “1”, the CPU unit 114 executes a sequence program update process.
  • the CPU unit 114 uses the program update function 242 to transition the sequence program stored in the CPU unit 114 to the update state. Thereafter, the CPU unit 114 uses the program load function 244 to set the update program 416 by the program size 414 in the memory address indicated by the update destination address 412 set in the program update area 410 (step 906).
  • the monitoring unit 116 sets “0” in the program update completion flag 404 and the program update preparation flag 402 (steps 908 and 910).
  • the monitoring unit 116 periodically checks whether or not “0” is set in the program update completion flag 404 (step 818), and confirms that the update of the sequence program is completed. Determine and end the process.
  • step 810 If it is determined in step 806, step 810, or step 812 that the sequence program cannot be updated, the monitoring unit 116 displays on the display unit 264 that the update cannot be performed (step 820). The fact is notified to the PC 100 through the external I / F 254 (step 822). Then, the monitoring unit 116 sets “2” in the program update completion flag 404 (step 824), and proceeds to step 818.
  • step 904 determines whether “2” is set in the program update completion flag 404 (step 912).
  • the CPU unit 114 When “2” is set in the program update completion flag 404, the CPU unit 114 recognizes that the sequence program cannot be updated for some reason, and sets “0” only in the program update preparation flag 402. (Step 914). As another example, when “2” is set in the program update completion flag 404, the CPU unit 114 determines that there is something wrong with the sequence program, and enters a safe state in which only safe operation is executed. You may make a transition.
  • the monitoring unit 116 sets a value other than “2” to the program update completion flag 404 if the CPU unit 114 can operate without any problem even if the sequence program cannot be updated. It may be set.
  • the monitoring unit 116 cannot update the sequence program. It is determined that the operation is continued without any problem, and “0” is set to each of the program update completion flag 404 and the program update preparation flag 402 (steps 916 and 918), and the normal operation may be continued (step 920).
  • the above is the operation of the monitoring unit 16 and the CPU unit 114 when the CPU unit 114 requests an update of the sequence program.
  • step 818 the monitoring unit 116 confirms that the update of the sequence program is completed by periodically referring to the value of the program update preparation flag 402.
  • the value does not become “0” even if the monitoring unit 116 monitors the program update preparation flag 402 for a certain period, the update is not completed on the display unit 264 as in the case of Step 820 and Step 822. This may be displayed, and the fact may be notified to the PC 100 via the external I / F 254.
  • the monitoring unit 116 may acquire a new sequence program from the PC 100 when notifying the PC 100 that updating cannot be performed through the external I / F 254. A sequence for transferring a new sequence program from the PC 100 to the monitoring unit 116 will be described below.
  • FIG. 10 is a sequence diagram when a new sequence program is delivered from the PC 100 to the monitoring unit 116.
  • the monitoring unit 116 cannot update the sequence program in Step 806, Step 810, or Step 812 of FIG. 8, the information in the stored state table 274, the information in the management table 276, and the program update condition 406 Is transmitted to the PC 100 through the external I / F 254 (step 1002).
  • the PC 100 Upon receiving the information in the status table 274, the information in the management table 276, and the program update condition 406 (step 1004), the PC 100 analyzes the received data to determine the reason why the update cannot be performed (step 1004). 1006). Then, the PC 100 creates a new sequence program, status table information, management table information, and program update conditions (step 1008), and transmits them to the monitoring unit 116 (step 1010).
  • the monitoring unit 116 stores the received data in the status table 274, management table 276, program update conditions 406, and the like. Each is set (step 1014).
  • the above is the sequence when a new sequence program is transferred from the PC 100 to the monitoring unit 116.
  • step 1014 the monitoring unit 116 may proceed to step 804 and proceed from the confirmation of the program update condition 406.
  • the process of transferring a new sequence program from the monitoring unit 116 to the PC 100 is executed.
  • the processing is not limited to this operation.
  • FIG. 11 is a sequence diagram of a modified example when a new sequence program is delivered from the PC 100 to the monitoring unit 116.
  • the PC 100 transmits a program version request to the monitoring unit 116 in order to confirm the version of the sequence program indicated by the program ID (step 1102).
  • the monitoring unit 116 When receiving the program version request (step 1104), the monitoring unit 116 refers to the management table 276 (step 1106), and uses the program version indicated by the program ID included in the program version request as a response to the program version request. (Step 1108).
  • the PC 100 determines whether or not the program needs to be updated from the program version included in the response (step 1112).
  • the PC 100 transmits a new sequence program and a program version to the monitoring unit 116 (step 1114). If no program update is necessary, the PC 100 does nothing here.
  • the monitoring unit 116 that has received the new sequence program and the program version executes a program update process (step 1118).
  • FIG. 12 is a flowchart showing the detailed operation of the monitoring unit 116 in the program update process shown in step 1118.
  • the monitoring unit 116 updates the management table 276 based on the received information, and sets the update destination address, data size, and sequence program of the sequence program to be updated in the program update area 410 of the shared memory (step 1202). Furthermore, the monitoring unit 116 sets “3” in the program update preparation flag 402 in order to notify the CPU unit 114 that the preparation for updating the sequence program has been completed (step 1204). Subsequent sequences (steps 1206 to 1210) are the same as steps 614 to 618 shown in FIG. 6, and a description thereof will be omitted here.
  • the above is the processing sequence for transferring a new sequence program from the PC 100 to the monitoring unit 116.
  • program update application function unit 246 ... control application function unit, 250 ... hardware module, 251 ... microcomputer, 252 ... CPU, 253 ... input / output port, 254 ... External I / F, 25 ... ROM, 256 ... RAM, 257 ... non-volatile memory, 260 ... bus ASIC, 264 ... display unit, 270 ... storage device, 280 ... OS function unit, 290 ... monitor application function unit,

Abstract

Provided is a technique whereby a sequence program can be adaptively switched according to the state of a controller or a control device. A controller has a processor unit (114) for executing a program and controlling a device to be controlled, and an monitoring unit (116) for monitoring the processor unit (114). Along with executing the program, the processor unit (114) supplies the monitoring unit (116) with state information of the processor unit and/or state information of the device to be controlled. When the state information supplied from the processor unit (114) coincides with a predetermined updating condition, the monitoring unit (116) links with the processor unit (114) and updates the sequence program executed by the processor unit (114).

Description

コントローラ、監視ユニット、およびシーケンスプログラム更新方法Controller, monitoring unit, and sequence program update method 参照による取り込みImport by reference
 この出願は、2011年10月14日に出願された日本出願特願2011-226492を基礎として優先権の利益を主張するものであり、その開示の全てを引用によってここに取り込む。 This application claims the benefit of priority based on Japanese Patent Application No. 2011-226492 filed on October 14, 2011, the entire disclosure of which is incorporated herein by reference.
 本明細書で開示される主題は、シーケンスプログラムに従って制御対象機器を制御するコントローラにおけるシーケンスプログラムの管理に関する。 The subject matter disclosed in this specification relates to management of a sequence program in a controller that controls a control target device according to the sequence program.
 制御シーケンスを規定したソフトウェア(以下、シーケンスプログラムと呼ぶ)を実行し、制御対象機器を制御するプログラマブルロジックコントローラ(以下、PLCと呼ぶ)という装置がある。PLCは、例えば、シーケンスプログラムを実行するCPUユニットおよびI/Oユニットを含む複数ユニットで構成されている。各ユニットは共有メモリを利用することにより相互にデータ通信を行う。 There is a device called a programmable logic controller (hereinafter referred to as PLC) that executes software (hereinafter referred to as a sequence program) that defines a control sequence and controls a device to be controlled. The PLC is composed of a plurality of units including, for example, a CPU unit that executes a sequence program and an I / O unit. Each unit performs data communication with each other by using a shared memory.
 制御対象機器(以下、制御機器と呼ぶ)として、例えば、インバータ、圧縮機、サーボモータがあり、これら複数の制御機器がそれぞれI/Oユニットに接続される。CPUユニットはI/Oユニットを介して制御機器に対して制御要求を送信する。制御機器は、制御要求に応じて動作するとともに、制御要求に対する応答を、I/Oユニットを介してCPUユニットに送信する。 Examples of control target devices (hereinafter referred to as control devices) include an inverter, a compressor, and a servo motor, and each of the plurality of control devices is connected to an I / O unit. The CPU unit transmits a control request to the control device via the I / O unit. The control device operates in response to the control request and transmits a response to the control request to the CPU unit via the I / O unit.
 また、PLCはシーケンスプログラムを切り替えることにより、制御機器に対する制御方法を変更することが可能である。例えば、複数種類の製品を製造する製造ラインに設置されているPLCは、製造ラインに流れる製品の種類に応じてシーケンスプログラムを切り替えることにより、制御方法を変更することができる。これにより、一つの製造ラインで複数の製品を製造することが可能となり、製造する製品の種類毎に製造ラインを設ける必要がなくなる。 Also, the PLC can change the control method for the control device by switching the sequence program. For example, a PLC installed in a production line that produces a plurality of types of products can change the control method by switching the sequence program in accordance with the type of product flowing in the production line. As a result, a plurality of products can be manufactured on one manufacturing line, and there is no need to provide a manufacturing line for each type of product to be manufactured.
 しかしながら、シーケンスプログラムを変更するときには、一般的に、システムへの影響を最小限に抑えるため、PLCを含め製造ラインに設置してある多くの機器を停止させる。そのため、製造ラインで製造する製品を変更するたびに、製造ラインに設置してある機器を一旦停止させる必要が生じる。ひとつの製造ラインで多種多様な製品を製造する場合、頻繁に機器を停止させることになり、製造ラインにおける製品の製造効率が低下してしまう。 However, when changing the sequence program, generally, many devices installed in the production line including the PLC are stopped in order to minimize the influence on the system. For this reason, every time a product to be manufactured on the manufacturing line is changed, it is necessary to temporarily stop the equipment installed on the manufacturing line. When manufacturing a wide variety of products on one production line, the equipment is frequently stopped, and the production efficiency of the product on the production line is reduced.
 このような問題の対策として、システムが動作している途中でも、システムに影響を与えずにシーケンスプログラムを変更できるようにする技術が提案されている(特許文献1、2参照)。 As a countermeasure for such a problem, there has been proposed a technique that allows a sequence program to be changed without affecting the system even while the system is operating (see Patent Documents 1 and 2).
 特許文献1の技術は、シーケンスプログラムの変更で必要となる全てのシーケンスプログラムをコントローラのCPUで予め管理しておき、上位装置からの要求にしたがってシーケンスプログラムを切り替えるというものである。 The technique of Patent Document 1 is to manage all sequence programs necessary for changing a sequence program in advance by a CPU of a controller and switch the sequence program in accordance with a request from a host device.
 特許文献2の技術は、シーケンスプログラムの変更で必要となる全てのシーケンスプログラムをコントローラのCPUで予め管理しておき、予め設定された実行順序定義にしたがってシーケンスプログラムを切り替えるというものである。 The technique of Patent Document 2 is such that all the sequence programs necessary for changing the sequence program are managed in advance by the CPU of the controller, and the sequence programs are switched in accordance with a preset execution order definition.
特開2007-265094 (段落0013)JP2007-265094 (paragraph 0013) 特開平5-307403 (段落0010)JP 5-307403 (paragraph 0010)
 しかしながら、特許文献1、2の技術には以下のような問題がある。 However, the techniques of Patent Documents 1 and 2 have the following problems.
 上述の通り、特許文献1の技術は、シーケンスプログラムの変更で必要となる全てのシーケンスプログラムをコントローラのCPUで予め管理しておき、上位装置からの要求にしたがってシーケンスプログラムを切り替えるというものである。そして、上位装置はコントローラや制御機器の状態とは関係なく、シーケンスプログラムの切り替えを要求する。 As described above, the technique of Patent Document 1 is such that all the sequence programs necessary for changing the sequence program are managed in advance by the CPU of the controller, and the sequence programs are switched in accordance with a request from the host device. The host device requests switching of the sequence program regardless of the state of the controller or the control device.
 また上述の通り、特許文献2の技術は、シーケンスプログラムの変更で必要となる全てのシーケンスプログラムをコントローラのCPUで予め管理しておき、予め設定された実行順序定義にしたがってシーケンスプログラムを切り替えるというものである。そして、実行順序定義は、コントローラや制御機器の状態とは関係なく定義される。 Further, as described above, the technique of Patent Document 2 is such that all the sequence programs required for changing the sequence program are managed in advance by the CPU of the controller, and the sequence programs are switched in accordance with a preset execution order definition. It is. The execution order definition is defined regardless of the state of the controller or the control device.
 そのため、特許文献1、2の技術では、コントローラや制御機器の状態に合わせてシーケンスプログラムを適応的に切り替えるというような変更処理を行うことができなかった。 For this reason, the techniques of Patent Documents 1 and 2 cannot perform a change process such as adaptively switching the sequence program in accordance with the state of the controller or control device.
 本明細書で開示されるのは、コントローラまたは制御機器の状態に合わせてシーケンスプログラムを適応的に切り替えることを可能にする技術である。 The technology disclosed in the present specification is a technique that enables adaptive switching of a sequence program in accordance with the state of a controller or a control device.
 開示される一態様によるコントローラは、プログラムを実行して制御対象機器を制御するプロセッサユニットと、前記プロセッサユニットを監視する監視ユニットと、を有し、前記プロセッサユニットが、前記プログラムの実行に伴って、自装置と制御対象機器の少なくとも一方の状態情報を前記監視ユニットに通知し、前記監視ユニットが、前記プロセッサユニットから通知された前記状態情報が所定の更新条件と一致すると、前記プロセッサユニットと連携し、前記プロセッサユニットが実行するシーケンスプログラムを更新するものである。 A controller according to one aspect disclosed includes a processor unit that executes a program to control a control target device, and a monitoring unit that monitors the processor unit, and the processor unit accompanies execution of the program. The status information of at least one of the own device and the control target device is notified to the monitoring unit, and the monitoring unit cooperates with the processor unit when the status information notified from the processor unit matches a predetermined update condition. The sequence program executed by the processor unit is updated.
 また、前記プロセッサユニットと前記監視ユニットは互いに同じ情報を共有するための共有メモリをそれぞれ有し、前記プロセッサユニットは前記共有メモリを介して前記監視ユニットに前記状態情報を通知し、前記監視ユニットは、前記プロセッサユニットから通知された前記状態情報に応じて更新するプログラムを選択し、選択したプログラムを、前記共有メモリを介して前記プロセッサユニットに送ることにしてもよい。 In addition, the processor unit and the monitoring unit each have a shared memory for sharing the same information, the processor unit notifies the monitoring unit of the status information via the shared memory, the monitoring unit A program to be updated may be selected according to the state information notified from the processor unit, and the selected program may be sent to the processor unit via the shared memory.
 また、前記コントローラはシーケンスプログラムを実行することによって前記制御対象機器に対するシーケンス制御を行うプログラマブルロジックコントローラであり、前記状態情報を前記共有メモリへ書き込む処理が前記シーケンス制御と共に前記プログラムに組み込まれている、としてもよい。 The controller is a programmable logic controller that performs sequence control on the device to be controlled by executing a sequence program, and a process for writing the state information to the shared memory is incorporated in the program together with the sequence control. It is good.
 また、前記監視ユニットは、前記共有メモリの前記状態情報の領域を定期的に読み出して前記更新条件と一致するか否か判定するものであってもよい。 Further, the monitoring unit may periodically read out the state information area of the shared memory and determine whether or not it matches the update condition.
 また、前記プログラムの更新を行うべき状態の状態情報を前記共有メモリに書き込むときに、プログラム更新を要求する要求フラグを前記共有メモリに設定する処理が前記プログラムに組み込まれており、前記監視ユニットは、前記共有メモリの前記要求フラグの領域を定期的に読み出し、プログラム更新を要求する要求フラグが設定されていたら、前記状態情報の領域を読み出すことにしてもよい。 In addition, a process for setting a request flag for requesting program update in the shared memory when the state information on the state in which the program should be updated is written in the shared memory is incorporated in the program, and the monitoring unit The area of the request flag in the shared memory may be read periodically, and if the request flag for requesting program update is set, the area of the status information may be read out.
 また、前記監視ユニットは、前記プロセッサユニットから要求されたプログラム更新を行うか否か判定し、行わないと判断したとき、要求されたプログラム更新を行わない旨を表示部に表示することにしてもよい。 Further, the monitoring unit determines whether or not to perform the program update requested from the processor unit, and when it is determined not to perform the program update, displays that the requested program update is not performed on the display unit. Good.
 開示によれば、コントローラまたは制御対象機器の状態に合わせてシーケンスプログラムを適応的に切り替えることが可能になる。 According to the disclosure, it is possible to adaptively switch the sequence program according to the state of the controller or the control target device.
本実施形態における制御システムの一例を示したブロック図である。It is the block diagram which showed an example of the control system in this embodiment. CPUユニット114の構成例を示したブロック図である。3 is a block diagram illustrating a configuration example of a CPU unit 114. FIG. 監視ユニット116の構成例を示したブロック図である。3 is a block diagram illustrating a configuration example of a monitoring unit 116. FIG. 状態テーブル274の一例を詳細に示した図である。It is the figure which showed an example of the status table 274 in detail. 管理テーブル276の一例を詳細に示した図である。It is the figure which showed an example of the management table 276 in detail. 共有メモリのメモリ構成を詳細に示した図である。It is the figure which showed the memory structure of the shared memory in detail. PLC110の初期起動時に、PC100から監視ユニット116に、シーケンスプログラム272、状態テーブル274、管理テーブル276転送するシーケンス図である。FIG. 7 is a sequence diagram for transferring a sequence program 272, a status table 274, and a management table 276 from the PC 100 to the monitoring unit 116 when the PLC 110 is initially activated. CPUユニット114のシーケンスプログラムを更新するときの監視ユニット116の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the monitoring unit 116 when updating the sequence program of CPU unit 114. FIG. CPUユニット114のシーケンスプログラムを更新するときのCPUユニット114の動作を示すフローチャートである。It is a flowchart which shows operation | movement of CPU unit 114 when the sequence program of CPU unit 114 is updated. CPUユニット114のシーケンスプログラムを更新するときの監視ユニット116の動作の変形例を示すフローチャートである。It is a flowchart which shows the modification of operation | movement of the monitoring unit 116 when updating the sequence program of CPU unit 114. CPUユニット114のシーケンスプログラムを更新するときのCPUユニット114の動作の変形例を示すフローチャートである。It is a flowchart which shows the modification of operation | movement of CPU unit 114 when updating the sequence program of CPU unit 114. PC100から監視ユニット116へ新たなシーケンスプログラムを配送するときのシーケンス図である。FIG. 6 is a sequence diagram when a new sequence program is delivered from the PC 100 to the monitoring unit 116. PC100から監視ユニット116へ新たなシーケンスプログラムを配送するときの変形例のシーケンス図である。FIG. 11 is a sequence diagram of a modified example when a new sequence program is delivered from the PC 100 to the monitoring unit 116. ステップ1118に示したプログラム更新処理における監視ユニット116の詳細な動作を示すフローチャートである。12 is a flowchart showing a detailed operation of the monitoring unit 116 in the program update process shown in step 1118.
 以下、実施形態を図面に基づいて詳細に説明する。尚、実施形態を説明するための図において同一の部分には同一の符号を付し、その繰り返しの説明を省略する。 Hereinafter, embodiments will be described in detail with reference to the drawings. In the drawings for describing the embodiments, the same portions are denoted by the same reference numerals, and repeated description thereof is omitted.
 図1は、本実施形態における制御システムの一例を示したブロック図である。 FIG. 1 is a block diagram showing an example of a control system in the present embodiment.
 本実施形態の制御システムは、PC(パーソナルコンピュータ)100、PLC(プログラマブルロジックコントローラ)110、インバータ120、圧縮機122、およびサーボモータ124を有する。インバータ120、圧縮機122、サーボモータ124は、PLC110による制御の対象となる制御機器の例である。例えば、FA(Factory Automation)ネットワークシステムが本制御システムに該当する。 The control system of the present embodiment includes a PC (personal computer) 100, a PLC (programmable logic controller) 110, an inverter 120, a compressor 122, and a servo motor 124. The inverter 120, the compressor 122, and the servo motor 124 are examples of control devices to be controlled by the PLC 110. For example, a FA (Factory Automation) network system corresponds to this control system.
 PLC110と、これら制御機器(インバータ120、圧縮機122、サーボモータ124)とのデータの送受信には、シリアル通信向けの通信プロトコルが利用される。特に、FA(Factory Automation)ネットワークにおけるシリアル通信に利用される通信プロトコルの規格として、Modbus(登録商標)やCC-Link(登録商標)等がある。 A communication protocol for serial communication is used for data transmission / reception between the PLC 110 and these control devices (inverter 120, compressor 122, servo motor 124). In particular, there are Modbus (registered trademark), CC-Link (registered trademark), and the like as communication protocol standards used for serial communication in an FA (Factory Automation) network.
 PLC110は、電源ユニット112、CPU(Central Processing Unit)ユニット114、監視ユニット116、および複数のI/Oユニット118を含んでいる。 The PLC 110 includes a power supply unit 112, a CPU (Central Processing Unit) unit 114, a monitoring unit 116, and a plurality of I / O units 118.
 CPUユニット114、監視ユニット116、およびI/Oユニット118はそれぞれが共有メモリを有している。それらの共有メモリはバスで相互に接続されており、データを互いに同期させ、共通のデータを保持するメモリである。CPUユニット114、監視ユニット116、I/Oユニット118は、その共有メモリにデータを書き込んだり、そこからデータを読み出したりすることにより、ユニット間でデータ通信を行うことができる。 The CPU unit 114, the monitoring unit 116, and the I / O unit 118 each have a shared memory. These shared memories are connected to each other via a bus, and are memories that synchronize data with each other and hold common data. The CPU unit 114, the monitoring unit 116, and the I / O unit 118 can perform data communication between the units by writing data to and reading data from the shared memory.
 I/Oユニット118は、本制御システムに制御機器を接続するためのユニットである。複数のI/Oユニット118に、インバータ120、圧縮機122、サーボモータ124といった制御機器がそれぞれ接続される。 The I / O unit 118 is a unit for connecting a control device to this control system. Control devices such as an inverter 120, a compressor 122, and a servo motor 124 are connected to the plurality of I / O units 118.
 なお、本実施形態のPLC110は、通信ユニットやカウンタユニットといった他のユニットを更に有してもよい。その場合には、通信ユニットやカウンタユニットも共有メモリを有し、CPUユニット114や監視ユニット116とデータ通信を行うことにしてもよい。 Note that the PLC 110 of this embodiment may further include other units such as a communication unit and a counter unit. In that case, the communication unit and the counter unit may also have a shared memory and perform data communication with the CPU unit 114 and the monitoring unit 116.
 CPUユニット114は、制御シーケンスを規定したシーケンスプログラムを格納しており、そのシーケンスプログラムを実行することにより、I/Oユニット118に接続された制御機器に対して、シーケンス制御を実行する。 The CPU unit 114 stores a sequence program that defines a control sequence, and executes the sequence control on the control device connected to the I / O unit 118 by executing the sequence program.
 監視ユニット116は、CPUユニット114の状態に合わせて、シーケンスプログラムをCPUユニット114に送り、CPUユニット114内のシーケンスプログラムを更新する。その際、監視ユニット116は、CPUユニット114が共有メモリに設定する設定値を監視する。この設定値は、CPUユニット114が制御シーケンスの実行に伴って設定するものであり、その値によってシーケンスプログラムの更新や更新すべきシーケンスプログラムが決まる。監視ユニット116は、保持している複数のシーケンスプログラムの中から、CPUユニット114が設定した設定値に応じたシーケンスプログラムを選択し、そのシーケンスプログラムを、共有メモリを利用して、CPUユニット114に転送する。 The monitoring unit 116 sends a sequence program to the CPU unit 114 in accordance with the state of the CPU unit 114, and updates the sequence program in the CPU unit 114. At that time, the monitoring unit 116 monitors the setting value set in the shared memory by the CPU unit 114. This set value is set by the CPU unit 114 with the execution of the control sequence, and the update of the sequence program and the sequence program to be updated are determined by the value. The monitoring unit 116 selects a sequence program corresponding to the set value set by the CPU unit 114 from the plurality of sequence programs held, and the sequence program is stored in the CPU unit 114 using a shared memory. Forward.
 図2AはCPUユニット114の構成例を示したブロック図である。 FIG. 2A is a block diagram showing a configuration example of the CPU unit 114.
 図2Aを参照すると、CPUユニット114は、ハードウェア構成としてはハードウェアモジュール200と記憶装置220を有する。 Referring to FIG. 2A, the CPU unit 114 includes a hardware module 200 and a storage device 220 as a hardware configuration.
 ハードウェアモジュール200は、CPUユニット114の動作に必要なハードウェアであり、マイコン201、バスASIC210、表示部212を有する。 The hardware module 200 is hardware necessary for the operation of the CPU unit 114, and includes a microcomputer 201, a bus ASIC 210, and a display unit 212.
 マイコン201はCPU202、入出力ポート203、外部I/F204、ROM205、RAM206、不揮発性メモリ207を有する。 The microcomputer 201 includes a CPU 202, an input / output port 203, an external I / F 204, a ROM 205, a RAM 206, and a nonvolatile memory 207.
 バスASIC210は、PLC110に搭載されている各ユニットの共有メモリを構成するモジュールであり、相互にデータを同期化する。これによりユニット間のデータ通信が可能となる。共有メモリのメモリ構成に関しては後に述べる。 The bus ASIC 210 is a module constituting a shared memory of each unit mounted on the PLC 110, and synchronizes data with each other. Thereby, data communication between units becomes possible. The memory configuration of the shared memory will be described later.
 表示部212は、ユーザに視覚的に情報を表示するモジュールであり、ユーザがCPUユニット114に対して情報を入力するときや、CPUユニット114からの情報をユーザに通知するときの表示に利用される。 The display unit 212 is a module that visually displays information to the user, and is used for display when the user inputs information to the CPU unit 114 or notifies the user of information from the CPU unit 114. The
 記憶装置220は、例えば不揮発性の半導体メモリや磁気記憶媒体などで構成される記憶装置であり、CPUユニット114の動作に必要なプログラムやデータを保存する。例えば、シーケンスプログラム222や、ハードウェアモジュール200内のメモリにシーケンスプログラム222を転送するロードプログラム224が記憶装置220に保存される。 The storage device 220 is a storage device composed of, for example, a nonvolatile semiconductor memory or a magnetic storage medium, and stores programs and data necessary for the operation of the CPU unit 114. For example, the sequence program 222 and a load program 224 that transfers the sequence program 222 to the memory in the hardware module 200 are stored in the storage device 220.
 また、CPUユニット114は、CPU202がソフトウェアプログラムを実行することによって実現される機能的な構成として、OS機能部230、プログラム更新アプリケーション機能部240、制御アプリケーション機能部246を有する。 The CPU unit 114 has an OS function unit 230, a program update application function unit 240, and a control application function unit 246 as functional configurations realized by the CPU 202 executing the software program.
 OS機能部230は、基本ソフトウェアによって実現され、CPUユニット114の動作を統括的に制御する。 The OS function unit 230 is realized by basic software, and comprehensively controls the operation of the CPU unit 114.
 プログラム更新アプリケーション機能部240は、アプリケーションソフトウェアで実現され、監視ユニット116と連携してシーケンスプログラムの更新を行う。プログラム更新アプリケーション機能部240の機能としてプログラム更新機能242とプログラムロード機能244が含まれる。 The program update application function unit 240 is realized by application software, and updates the sequence program in cooperation with the monitoring unit 116. The program update application function unit 240 includes a program update function 242 and a program load function 244.
 プログラム更新機能242は、監視ユニット116がシーケンスプログラムの更新をCPUユニット114に要求する際に値を設定する共有メモリ内のアドレスのデータを監視し、更新を要求する値を検出すると、後に述べるシーケンスプログラム更新に向けた準備を行う機能である。 When the monitoring unit 116 requests the CPU unit 114 to update the sequence program, the program update function 242 monitors the data at the address in the shared memory to set a value. When the value that requests the update is detected, the program update function 242 This function prepares for program update.
 プログラムロード機能244は、監視ユニット116が共有メモリに設定したシーケンスプログラムを、CPUユニット114自身のメモリの所定のアドレスに保存する機能である。 The program load function 244 is a function for storing the sequence program set in the shared memory by the monitoring unit 116 at a predetermined address in the memory of the CPU unit 114 itself.
 制御アプリケーション機能部246は、アプリケーションソフトウェアで実現され、シーケンスプログラム222を実行する。 The control application function unit 246 is realized by application software and executes the sequence program 222.
 図2Bは監視ユニット116の構成例を示したブロック図である。 FIG. 2B is a block diagram illustrating a configuration example of the monitoring unit 116.
 監視ユニット116は、ハードウェア構成として、ハードウェアモジュール250と記憶装置270とを有している。 The monitoring unit 116 includes a hardware module 250 and a storage device 270 as a hardware configuration.
 ハードウェアモジュール250は、CPUユニット114のハードウェアモジュール200と同様の構成であるため説明は省略する。 Since the hardware module 250 has the same configuration as the hardware module 200 of the CPU unit 114, the description thereof is omitted.
 記憶装置270は、CPUユニット114に保存されているシーケンスプログラムを更新するために必要な複数のシーケンスプログラム272、状態テーブル274、および管理テーブル276を保持する。尚、記憶装置270にはCPUユニット114の状態ならびに制御機器の状態に合わせて、柔軟にシーケンスプログラムの切り替えが出来るように、異なる機能を持った複数のシーケンスプログラムが保持される。 The storage device 270 holds a plurality of sequence programs 272, a state table 274, and a management table 276 necessary for updating the sequence program stored in the CPU unit 114. The storage device 270 holds a plurality of sequence programs having different functions so that the sequence programs can be flexibly switched in accordance with the state of the CPU unit 114 and the state of the control device.
 図3Aは状態テーブル274の一例を詳細に示した図である。 FIG. 3A shows an example of the status table 274 in detail.
 状態テーブル274とは、CPUユニット114が実行しているシーケンスプログラムに関する情報を示すテーブルであり、実行している各シーケンスプログラムのアドレス310、プログラムID312、およびプログラムサイズ314が含まれる。 The status table 274 is a table indicating information related to the sequence program executed by the CPU unit 114, and includes an address 310, a program ID 312 and a program size 314 of each executed sequence program.
 アドレス310は、プログラムID312によって示されたシーケンスプログラムが格納されているメモリのアドレスを示す。 The address 310 indicates the address of the memory in which the sequence program indicated by the program ID 312 is stored.
 プログラムID312は、実行しているシーケンスプログラムを一意に識別する識別情報である。 The program ID 312 is identification information that uniquely identifies the sequence program being executed.
 プログラムサイズ314は、プログラムID312が示すシーケンスプログラムのサイズを示す。 The program size 314 indicates the size of the sequence program indicated by the program ID 312.
 以上が状態テーブル274の説明である。尚、アドレス310、プログラムID312、プログラムサイズ314の他に、プログラムID312を示すシーケンスプログラム実行後に実行されるシーケンスプログラムの格納先アドレスなどテーブル274に更に含んでもよい。 The above is the description of the state table 274. In addition to the address 310, the program ID 312 and the program size 314, the table 274 may further include a storage address of a sequence program executed after the execution of the sequence program indicating the program ID 312.
 図3Bは管理テーブル276の一例を詳細に示した図である。 FIG. 3B shows an example of the management table 276 in detail.
 管理テーブル276とは、監視ユニット116が記憶装置270に格納している複数のシーケンスプログラムに関する情報を示すテーブルであり、各シーケンスプログラムのプログラムID312、プログラム名320、プログラムサイズ314、格納先アドレス322、更新条件324、バージョン326が含まれる。 The management table 276 is a table showing information on a plurality of sequence programs stored in the storage device 270 by the monitoring unit 116. The program ID 312 of each sequence program, the program name 320, the program size 314, the storage destination address 322, An update condition 324 and a version 326 are included.
 管理テーブル276のプログラムID312は、監視ユニット116が格納している各シーケンスプログラムを一意に識別する識別情報である。 The program ID 312 of the management table 276 is identification information for uniquely identifying each sequence program stored in the monitoring unit 116.
 プログラム名320は、プログラムID312によって示されるシーケンスプログラムの名称である。 The program name 320 is the name of the sequence program indicated by the program ID 312.
 格納先アドレス322は、シーケンスプログラム更新時にプログラムID312が示すシーケンスプログラムを格納するアドレスを示す。 The storage destination address 322 indicates an address for storing the sequence program indicated by the program ID 312 when the sequence program is updated.
 更新条件324は、プログラムID312が示すシーケンスプログラムを更新する条件を示す。この更新条件324が満たされたときにシーケンスプログラムの更新を行う。 The update condition 324 indicates a condition for updating the sequence program indicated by the program ID 312. When this update condition 324 is satisfied, the sequence program is updated.
 バージョン326は、プログラムID312によって示されたシーケンスプログラムのバージョンであり、シーケンスプログラムの管理に使用される。 Version 326 is a version of the sequence program indicated by the program ID 312 and is used for managing the sequence program.
 以上が管理テーブル276の説明である。尚、プログラムID312、プログラム名320、プログラムサイズ314、格納先アドレス322、更新条件324、バージョン326の他に、例えば、プログラムID312が示すシーケンスプログラムと同時に実行すると不具合が生じる等の関係性が悪いシーケンスプログラムのプログラムIDや、記憶装置270にシーケンスプログラムを格納した日時などを管理テーブル276に更に含んでもよい。 The above is the description of the management table 276. In addition to the program ID 312, the program name 320, the program size 314, the storage destination address 322, the update condition 324, and the version 326, for example, a sequence having a bad relationship such as a problem that occurs when executed simultaneously with the sequence program indicated by the program ID 312. The management table 276 may further include the program ID of the program, the date and time when the sequence program is stored in the storage device 270, and the like.
 また、監視ユニット116は、CPU252がソフトウェアプログラムを実行することによって実現される機能的な構成として、OS機能部280と監視アプリケーション機能部290を有する。 Further, the monitoring unit 116 has an OS function unit 280 and a monitoring application function unit 290 as functional configurations realized by the CPU 252 executing the software program.
 OS機能部280は、基本ソフトウェアによって実現され、監視ユニット116の動作を統括的に制御する。 The OS function unit 280 is realized by basic software, and comprehensively controls the operation of the monitoring unit 116.
 監視アプリケーション機能部290は、アプリケーションソフトウェアによって実現され、共有メモリを利用して、CPUユニット114の状態ならびに制御機器の状態を監視し、得た状態に応じてシーケンスプログラムを選択する。監視アプリケーション機能部290の機能として、CPUユニット状態監視機能292、シーケンスプログラム選択機能294、およびシーケンスプログラム転送機能296が含まれる。 The monitoring application function unit 290 is realized by application software, uses a shared memory, monitors the state of the CPU unit 114 and the state of the control device, and selects a sequence program according to the obtained state. Functions of the monitoring application function unit 290 include a CPU unit state monitoring function 292, a sequence program selection function 294, and a sequence program transfer function 296.
 CPUユニット状態監視機能292とは、CPUユニット114がCPUユニット114の状態ならびに制御機器の状態を設定する共有メモリ内のアドレス(プログラム更新条件406)のデータを監視することにより、CPUユニット114ならびに制御機器の状態変化を検出する機能である。このプログラム更新条件406は、CPUユニット114が共有メモリを利用して監視ユニット116に通知する、CPUユニット114あるいは制御機器の状態を示す状態情報である。 The CPU unit state monitoring function 292 is a function that the CPU unit 114 monitors the data of the address (program update condition 406) in the shared memory that sets the state of the CPU unit 114 and the state of the control device. This is a function for detecting a change in the state of the device. The program update condition 406 is status information indicating the status of the CPU unit 114 or the control device, which the CPU unit 114 notifies the monitoring unit 116 using the shared memory.
 シーケンスプログラム選択機能294とは、CPUユニット状態監視機能292が検出したCPUユニット114ならびに制御機器の状態変化と管理テーブル276の更新条件324とが一致するシーケンスプログラムを選択する機能である。 The sequence program selection function 294 is a function for selecting a sequence program in which the state change of the CPU unit 114 and the control device detected by the CPU unit state monitoring function 292 matches the update condition 324 of the management table 276.
 シーケンスプログラム転送機能296とは、シーケンスプログラム選択機能294が選択したシーケンスプログラムを、共有メモリ利用してCPUユニット114に転送する機能である。 The sequence program transfer function 296 is a function of transferring the sequence program selected by the sequence program selection function 294 to the CPU unit 114 using a shared memory.
 以上が、CPUユニット114ならびに監視ユニット116の説明である。 The above is the description of the CPU unit 114 and the monitoring unit 116.
 図4は共有メモリのメモリ構成を詳細に示した図である。バスASIC210,260の機能によって共有メモリ同士がデータを同期させているので、CPUユニット114の共有メモリと監視ユニット116の共有メモリは同じデータを保持した状態に維持されている。例えば、CPUユニット114が自身の共有メモリに書き込んだデータは、監視ユニット116の共有メモリにも書き込まれる。 FIG. 4 shows the memory configuration of the shared memory in detail. Since the shared memories synchronize data by the functions of the bus ASICs 210 and 260, the shared memory of the CPU unit 114 and the shared memory of the monitoring unit 116 are maintained in a state of holding the same data. For example, data written by the CPU unit 114 to its own shared memory is also written to the shared memory of the monitoring unit 116.
 共有メモリには、プログラム更新管理領域400、プログラムは更新領域410、システム領域420が含まれる。 The shared memory includes a program update management area 400, a program update area 410, and a system area 420.
 プログラム更新管理領域400とは、制御システムに影響を与えずにシーケンスプログラムを変更するために必要な情報を格納するための領域である。プログラム更新管理領域400には、プログラム更新準備フラグ402、プログラム更新完了フラグ404、プログラム更新条件406が含まれる。 The program update management area 400 is an area for storing information necessary for changing the sequence program without affecting the control system. The program update management area 400 includes a program update preparation flag 402, a program update completion flag 404, and a program update condition 406.
 プログラム更新準備フラグ402とは、通常は「0」に設定されており、監視ユニット116がシーケンスプログラムを変更する準備が完了したときに「1」を設定するフラグである。監視ユニット116がフラグに「1」を設定することにより、CPUユニット114に対してシーケンスプログラムを更新することが通知される。 The program update preparation flag 402 is normally set to “0”, and is a flag that sets “1” when the monitoring unit 116 is ready to change the sequence program. When the monitoring unit 116 sets “1” in the flag, the CPU unit 114 is notified that the sequence program is to be updated.
 プログラム更新完了フラグ404は、通常は「0」に設定されており、CPUユニット114がシーケンスプログラムの更新を完了したときに「1」を設定するフラグである。CPUユニット114がフラグに「1」を設定することにより、監視ユニット116に対してシーケンスプログラムの更新が完了したことが通知される。 The program update completion flag 404 is normally set to “0”, and is a flag that sets “1” when the CPU unit 114 completes the update of the sequence program. When the CPU unit 114 sets “1” in the flag, the monitoring unit 116 is notified that the update of the sequence program has been completed.
 プログラム更新条件406は、シーケンスプログラムを更新する条件を示す情報である。CPUユニット114が、シーケンス制御の実行中に、ここに更新条件の値を設定する。そして、監視ユニット116は、CPUユニット状態監視機能292を利用して、この領域を監視しており、この領域の値に基づいてシーケンスプログラムを更新することを判断する。尚、図4に示したプログラム更新条件406の配置は一例であり、プログラム更新条件406はプログラム更新管理領域400以外の領域にあってもよい。 The program update condition 406 is information indicating a condition for updating the sequence program. The CPU unit 114 sets the value of the update condition here during execution of the sequence control. The monitoring unit 116 uses the CPU unit state monitoring function 292 to monitor this area, and determines to update the sequence program based on the value of this area. The arrangement of the program update condition 406 shown in FIG. 4 is an example, and the program update condition 406 may be in an area other than the program update management area 400.
 プログラム更新領域410とは、監視ユニット116がCPUユニット114へシーケンスプログラムを転送するときに使用する領域であり、更新先アドレス412、プログラムサイズ414、および更新プログラム416が含まれる。 The program update area 410 is an area used when the monitoring unit 116 transfers a sequence program to the CPU unit 114, and includes an update destination address 412, a program size 414, and an update program 416.
 格納先アドレス412は、更新するシーケンスプログラムの格納先アドレスを示す。 The storage destination address 412 indicates the storage destination address of the sequence program to be updated.
 プログラムサイズ414は、更新するシーケンスプログラムのプログラムサイズを示す。 Program size 414 indicates the program size of the sequence program to be updated.
 更新プログラム416は、更新するシーケンスプログラムを格納する領域である。 The update program 416 is an area for storing a sequence program to be updated.
 システム領域420は、PLC110に搭載されている各ユニットが動作するために必要な情報を格納する領域である。 The system area 420 is an area for storing information necessary for each unit mounted on the PLC 110 to operate.
 以上が、共有メモリの説明である。 The above is an explanation of shared memory.
 図5は、PLC110の初期起動時に、PC100から監視ユニット116に、シーケンスプログラム272、状態テーブル274、管理テーブル276を転送するシーケンス図である。 FIG. 5 is a sequence diagram for transferring the sequence program 272, the status table 274, and the management table 276 from the PC 100 to the monitoring unit 116 when the PLC 110 is initially activated.
 PC100ならびに監視ユニット116が起動した後、PC100は制御システムを動作させるために必要な複数のシーケンスプログラムと各種テーブルの情報とを監視ユニット116に送信する(ステップ500)。 After the PC 100 and the monitoring unit 116 are activated, the PC 100 transmits a plurality of sequence programs and various table information necessary for operating the control system to the monitoring unit 116 (step 500).
 監視ユニット116は、シーケンスプログラムと各種テーブルの情報とを受信すると(ステップ510)、シーケンスプログラムを記憶装置270に保存し(ステップ520)、また受信した各種テーブルの情報を基に、状態テーブル274ならびに管理テーブル276を作成する(ステップ530)。 When the monitoring unit 116 receives the sequence program and information on various tables (step 510), the monitoring unit 116 saves the sequence program in the storage device 270 (step 520), and based on the received information on the various tables, the status table 274 and A management table 276 is created (step 530).
 それらの処理を完了すると、監視ユニット116はPC100に対して情報設定完了を送信する(ステップ540)。 When these processes are completed, the monitoring unit 116 transmits information setting completion to the PC 100 (step 540).
 PC100が情報設定完了を受信すると、初期起動シーケンスを終了する(ステップ550)。 When the PC 100 receives the information setting completion, the initial startup sequence is terminated (step 550).
 以上が監視ユニット116における初期起動時のシーケンスの説明である。 The above is the description of the sequence at the time of initial startup in the monitoring unit 116.
 尚、PC100は、この初期起動シーケンスを実行するために専用のアプリケーションを利用しても良い。 Note that the PC 100 may use a dedicated application to execute this initial startup sequence.
 また、監視ユニット116に、既にシーケンスプログラムならびに各テーブルが設定されている場合、ステップ500でPC100が送信したシーケンスプログラム等に対する応答として、監視ユニット116は既に設定済みである旨の情報をPC100に返送することにしてもよい。また、監視ユニット116は表示部264を利用して、既に設定済みであることをユーザに通知してもよく、既に設定済みの情報に対して上書きを行うかどうかをユーザに選択させてもよい。更に、監視ユニット116より情報設定完了の通知を受信できないとき、PC100は、シーケンスプログラムおよびテーブル情報を再送してもよい。 When the sequence program and each table are already set in the monitoring unit 116, the monitoring unit 116 returns information indicating that it has already been set to the PC 100 as a response to the sequence program transmitted by the PC 100 in step 500. You may decide to do it. Further, the monitoring unit 116 may notify the user that the setting has already been made using the display unit 264, and may cause the user to select whether or not to overwrite already set information. . Furthermore, when the information setting completion notification cannot be received from the monitoring unit 116, the PC 100 may retransmit the sequence program and table information.
 図5の説明では、事前にCPUユニット114にシーケンスプログラムが設定されていることを前提に、PC100から監視ユニット116だけにシーケンスプログラムを送信する例を示した。しかし、事前にCPUユニット114にシーケンスプログラムが設定されていない場合、PC100は、CPU114に設定するシーケンスプログラムと、監視ユニット116に保存するシーケンスプログラムとを、それらを区別できるように監視ユニット116に送信する。 In the description of FIG. 5, the example in which the sequence program is transmitted only from the PC 100 to the monitoring unit 116 on the assumption that the sequence program is set in the CPU unit 114 in advance is shown. However, if no sequence program is set in the CPU unit 114 in advance, the PC 100 transmits the sequence program set in the CPU 114 and the sequence program stored in the monitoring unit 116 to the monitoring unit 116 so that they can be distinguished from each other. To do.
 図6は、CPUユニット114のシーケンスプログラムを更新するときの監視ユニット116の動作を示すフローチャートである。図7は、CPUユニット114のシーケンスプログラムを更新するときのCPUユニット114の動作を示すフローチャートである。図6に示した監視ユニット116の動作と、図7に示したCPUユニット114の動作とは連携している。 FIG. 6 is a flowchart showing the operation of the monitoring unit 116 when the sequence program of the CPU unit 114 is updated. FIG. 7 is a flowchart showing the operation of the CPU unit 114 when the sequence program of the CPU unit 114 is updated. The operation of the monitoring unit 116 shown in FIG. 6 and the operation of the CPU unit 114 shown in FIG. 7 are linked.
 監視ユニット116はCPUユニット状態監視機能292を利用して、プログラム更新条件406の値を確認する(ステップ600)。 The monitoring unit 116 uses the CPU unit state monitoring function 292 to check the value of the program update condition 406 (step 600).
 プログラム更新条件406の値に変化があったら、監視ユニット116は、シーケンスプログラム選択機能294を利用して、変化したプログラム更新条件406が管理テーブル276の更新条件324と一致するか否か判定する(ステップ602)。プログラム更新条件406が更新条件324と一致しなければ、監視ユニット416はそのまま処理を終了する。 If there is a change in the value of the program update condition 406, the monitoring unit 116 uses the sequence program selection function 294 to determine whether or not the changed program update condition 406 matches the update condition 324 in the management table 276 ( Step 602). If the program update condition 406 does not match the update condition 324, the monitoring unit 416 ends the process as it is.
 プログラム更新条件406が更新条件327と一致すれば、監視ユニット116は、更に状態テーブル274を参照し(ステップ604)、更新が要求されているシーケンスプログラムについて、その更新が必要か否か確認する(ステップ606)。 If the program update condition 406 matches the update condition 327, the monitoring unit 116 further refers to the state table 274 (step 604), and confirms whether or not the sequence program that is requested to be updated is required ( Step 606).
 確認した結果、シーケンスプログラムの更新が必要な場合、監視ユニット116は、シーケンスプログラム選択機能294を利用して管理テーブル276を参照し、更新するシーケンスプログラムのプログラムサイズ314ならびに格納先アドレス322を取得する。そして、監視ユニット116は、状態テーブル274に格納されている実行中のシーケンスプログラムのプログラムサイズ314と、管理テーブル276に格納されている更新するシーケンスプログラムのプログラムサイズ314とを比較することにより、更新が他のシーケンスプログラムに影響するか否か判定する(ステップ608)。 As a result of checking, when the sequence program needs to be updated, the monitoring unit 116 refers to the management table 276 by using the sequence program selection function 294, and acquires the program size 314 and storage destination address 322 of the sequence program to be updated. . Then, the monitoring unit 116 updates the program size 314 of the sequence program being executed stored in the status table 274 with the program size 314 of the sequence program to be updated stored in the management table 276. It is determined whether or not other sequence programs are affected (step 608).
 例えば、管理テーブル276に格納されている更新するシーケンスプログラムのプログラムサイズ314が、状態テーブル274に格納されている実行中のシーケンスプログラムのプログラムサイズ314を超えていなければ、更新が他のシーケンスプログラムへ影響することは無いと判断する。 For example, if the program size 314 of the sequence program to be updated stored in the management table 276 does not exceed the program size 314 of the sequence program being executed stored in the status table 274, the update is transferred to another sequence program. Judge that there is no effect.
 他のシーケンスプログラムに影響がないことを確認できたら、監視ユニット116は、シーケンスプログラム転送機能296を利用して、シーケンスプログラムの更新を行う。 If it is confirmed that there is no influence on other sequence programs, the monitoring unit 116 updates the sequence program using the sequence program transfer function 296.
 他のシーケンスプログラムに影響がある場合には、監視ユニット116は、他のシーケンスプログラムに影響を与えるため更新できない旨を表示部264に表示する(ステップ620)。更に、監視ユニット116は、更新できない旨を外部I/F254を通じてPC100にも通知してよい(ステップ622)。 If the other sequence program is affected, the monitoring unit 116 displays on the display unit 264 that it cannot be updated because it affects the other sequence program (step 620). Further, the monitoring unit 116 may also notify the PC 100 through the external I / F 254 that it cannot be updated (step 622).
 以下、監視ユニット116におけるシーケンスプログラムの更新処理について述べる。 Hereinafter, the update process of the sequence program in the monitoring unit 116 will be described.
 ステップ608で、シーケンスプログラムの更新が可能と判定されると、監視ユニット116は、シーケンスプログラム転送機能296を利用して、共有メモリのプログラム更新領域410に更新するシーケンスプログラムの更新先アドレス、データサイズ、シーケンスプログラム自体をそれぞれ設定する(ステップ610)。更に、監視ユニット116は、シーケンスプログラムの更新準備が完了した旨をCPUユニット114に通知するため、プログラム更新準備フラグ402に「1」を設定する(ステップ612)。 If it is determined in step 608 that the sequence program can be updated, the monitoring unit 116 uses the sequence program transfer function 296 to update the sequence program update destination address and data size in the program update area 410 of the shared memory. Each sequence program is set (step 610). Further, the monitoring unit 116 sets “1” in the program update preparation flag 402 in order to notify the CPU unit 114 that the preparation for updating the sequence program has been completed (step 612).
 図7を参照すると、CPUユニット114は、プログラム更新機能242を利用して、プログラム更新準備フラグ402の値を一定間隔で確認し(ステップ702)、プログラム更新準備フラグ402の値が「1」か否か判定する(ステップ704)。プログラム更新準備フラグ402が「1」であることは、監視ユニット116にて更新の準備ができたことを示している。 Referring to FIG. 7, the CPU unit 114 uses the program update function 242 to check the value of the program update preparation flag 402 at regular intervals (step 702), and whether the value of the program update preparation flag 402 is “1”. It is determined whether or not (step 704). The program update preparation flag 402 being “1” indicates that the monitoring unit 116 is ready for update.
 プログラム更新準備フラグ402の値が「1」である場合、CPUユニット114はシーケンスプログラムの更新処理を実行する(ステップ704)。プログラム更新準備フラグ402の値が「1」以外の場合、シーケンスプログラムの更新処理は実行せず、通常処理を実行する(ステップ710)。 When the value of the program update preparation flag 402 is “1”, the CPU unit 114 executes a sequence program update process (step 704). If the value of the program update preparation flag 402 is other than “1”, the sequence program update process is not executed and the normal process is executed (step 710).
 以下にCPUユニット114におけるシーケンスプログラムの更新処理について述べる。尚、CPUユニット114に格納してあるシーケンスプログラムには、プログラム更新準備フラグ402を格納するメモリアドレスに「1」が設定されていることを検知すると、更新する可能性があるメモリアドレスにアクセスしないという動作モード(以下、更新状態と呼ぶ)に遷移する機能が組み込まれているものとする。 The update process of the sequence program in the CPU unit 114 will be described below. In the sequence program stored in the CPU unit 114, when it is detected that “1” is set in the memory address for storing the program update preparation flag 402, the memory address that may be updated is not accessed. It is assumed that a function for transitioning to an operation mode (hereinafter referred to as an update state) is incorporated.
 CPUユニット114は、プログラム更新機能242を利用して、プログラム更新準備フラグ402に「1」が設定されたことを検出すると、シーケンスプログラムを上記の更新状態に遷移させる。その後、CPUユニット114はプログラムロード機能244を利用して、プログラム更新領域410の更新先アドレス412に示されたメモリアドレスに、更新プログラム416をプログラムサイズ414分だけロードする(ステップ706)。 When the CPU unit 114 detects that the program update preparation flag 402 is set to “1” using the program update function 242, the CPU unit 114 shifts the sequence program to the update state. Thereafter, the CPU unit 114 uses the program load function 244 to load the update program 416 by the program size 414 to the memory address indicated by the update destination address 412 in the program update area 410 (step 706).
 更新プログラム416のロードが終了すると、CPUユニット114は、プログラムロード機能244を利用して、プログラム更新完了フラグ404に「1」を設定する(ステップ708)。 When the loading of the update program 416 is completed, the CPU unit 114 uses the program load function 244 to set “1” in the program update completion flag 404 (step 708).
 図6に戻り、監視ユニット116は、CPUモジュール状態監視機能292を利用して、プログラム更新完了フラグ404が「1」に設定されたか否かの判定を、それが「1」に設定されるまで繰り返す(ステップ614)。 Returning to FIG. 6, the monitoring unit 116 uses the CPU module state monitoring function 292 to determine whether or not the program update completion flag 404 is set to “1” until it is set to “1”. Repeat (step 614).
 監視ユニット116は、プログラム更新完了フラグ404に「1」が設定されたことを確認すると、CPUユニット114におけるシーケンスプログラムの更新が完了したと判断し、プログラム更新完了フラグ404ならびにプログラム更新準備フラグ402にそれぞれ「0」を設定する(ステップ616、618)。 When the monitoring unit 116 confirms that “1” is set in the program update completion flag 404, the monitoring unit 116 determines that the update of the sequence program in the CPU unit 114 is completed, and sets the program update completion flag 404 and the program update preparation flag 402. “0” is set for each (steps 616 and 618).
 図7に戻り、CPUユニット114は、プログラム更新準備フラグ402の値が「0」に設定されたことを検知すると(ステップ704)、更新状態から通常処理を実行する状態に遷移し(ステップ710)、シーケンスプログラムの実行を再開する。 Returning to FIG. 7, when the CPU unit 114 detects that the value of the program update preparation flag 402 is set to “0” (step 704), the CPU unit 114 transitions from the update state to a state in which normal processing is executed (step 710). Restart execution of the sequence program.
 以上がシーケンスプログラムの更新を行う場合のシーケンスである。本実施形態によれば、CPUユニット114から監視ユニット116にCPUユニット114あるいは制御機器の状態を示す状態情報を通知し、監視ユニット116は、その状態情報に応じてシーケンスプログラムの更新を判断する。そのため、CPUユニット114あるいは制御機器の状態に合わせるように適応的にシーケンスプログラムを適応的に切り替えることができる。 The above is the sequence when updating the sequence program. According to the present embodiment, the CPU unit 114 notifies the monitoring unit 116 of status information indicating the status of the CPU unit 114 or the control device, and the monitoring unit 116 determines whether to update the sequence program according to the status information. Therefore, the sequence program can be adaptively switched so as to match the state of the CPU unit 114 or the control device.
 尚、ここでは、プログラム更新準備フラグ402に「1」が設定されるとCPUユニット114に格納されたシーケンスプログラムが更新状態に遷移することを前提条件とした。しかし、他の例として、プログラム更新準備フラグ402に設定される値に応じて、特定のメモリアドレスにのみアクセスしないようなシーケンスプロフラムを予めCPUユニット114に格納しておいてもよい。 Here, it is assumed that the sequence program stored in the CPU unit 114 transitions to the update state when “1” is set in the program update preparation flag 402. However, as another example, a sequence program that does not access only a specific memory address according to the value set in the program update preparation flag 402 may be stored in the CPU unit 114 in advance.
 また、ステップ614において、シーケンスプログラムの更新が完了したことを、監視ユニット116はプログラム更新完了フラグ404の値を定期的に参照することにより、確認することにした。しかし、他の例として、監視ユニット116は、一定期間参照してもプログラム更新完了フラグ404の値が「1」にならない場合、ステップ620、622と同様に、表示部264に更新が完了しない旨を表示し、PC100に外部I/F254を通じて通知してもよい。 In step 614, the monitoring unit 116 periodically confirms that the update of the sequence program has been completed by referring to the value of the program update completion flag 404. However, as another example, if the value of the program update completion flag 404 does not become “1” even if it is referred to for a certain period, the monitoring unit 116 indicates that the update is not completed on the display unit 264 as in steps 620 and 622. May be displayed and notified to the PC 100 via the external I / F 254.
 図6、7に示したように、本実施形態では、プログラムを更新する際、監視ユニット116がプログラム更新条件を確認し、プログラムの更新を行うか否か判断している。しかし、更新方法がこの例に限定されることは無い。他の例として、CPUユニット114が主体的に監視ユニット116にプログラムの更新を要求することにしてもよい。 As shown in FIGS. 6 and 7, in this embodiment, when the program is updated, the monitoring unit 116 checks the program update condition and determines whether or not to update the program. However, the update method is not limited to this example. As another example, the CPU unit 114 may actively request the monitoring unit 116 to update the program.
 図8は、CPUユニット114のシーケンスプログラムを更新するときの監視ユニット116の動作の変形例を示すフローチャートである。図9は、CPUユニット114のシーケンスプログラムを更新するときのCPUユニット114の動作の変形例を示すフローチャートである。図8に示した監視ユニット116の動作と、図9に示したCPUユニット114の動作とは連携している。 FIG. 8 is a flowchart showing a modified example of the operation of the monitoring unit 116 when the sequence program of the CPU unit 114 is updated. FIG. 9 is a flowchart showing a modified example of the operation of the CPU unit 114 when the sequence program of the CPU unit 114 is updated. The operation of the monitoring unit 116 shown in FIG. 8 and the operation of the CPU unit 114 shown in FIG. 9 are linked.
 図9を参照すると、CPUユニット114は、シーケンスプログラムの実行中に、シーケンスプログラムの更新が必要になると、その更新の更新条件をプログラム更新条件406に設定した後、プログラム更新準備フラグ402に「1」を設定する(ステップ902)。 Referring to FIG. 9, when the sequence program needs to be updated during execution of the sequence program, the CPU unit 114 sets the update condition for the update in the program update condition 406 and then sets “1” in the program update preparation flag 402. Is set (step 902).
 尚、この例では、シーケンスプログラムには、シーケンスプログラムの更新の要否を認識し、シーケンスプログラムの更新が必要なときにプログラム更新条件406ならびにプログラム更新準備フラグ402を設定する処理が予め組み込まれているものとする。 In this example, the sequence program is preinstalled with a process for recognizing whether the sequence program needs to be updated and setting the program update condition 406 and the program update preparation flag 402 when the sequence program needs to be updated. It shall be.
 図8を参照すると、監視ユニット116は、CPUユニット状態監視機能292を利用して、プログラム更新準備フラグ402の値を定期的に確認する(ステップ802)。そして、監視ユニット116は、プログラム更新準備フラグ402が「1」になったか否か判定する(ステップ803)。 Referring to FIG. 8, the monitoring unit 116 periodically checks the value of the program update preparation flag 402 using the CPU unit state monitoring function 292 (step 802). Then, the monitoring unit 116 determines whether or not the program update preparation flag 402 has become “1” (step 803).
 プログラム更新準備フラグ402が「1」になったら、監視ユニット116は、シーケンスプログラム選択機能294を利用して、プログラム更新条件406を確認する(ステップ804)。更に、監視ユニット116は、そのプログラム更新条件と、管理テーブル276の更新条件324とを比較する(ステップ806)。 When the program update preparation flag 402 becomes “1”, the monitoring unit 116 checks the program update condition 406 using the sequence program selection function 294 (step 804). Further, the monitoring unit 116 compares the program update condition with the update condition 324 of the management table 276 (step 806).
 プログラム更新条件406に、管理テーブル276の更新条件324と同じプログラム更新条件があった場合、監視ユニット116は、シーケンスプログラム選択機能294を利用して状態テーブル274を参照し(ステップ808)、シーケンスプログラムの更新が必要か否か判定する(ステップ810)。例えば、更新が要求されているバージョンのシーケンスプログラムが既に実行されていれば、更新は必要ない。 When the program update condition 406 has the same program update condition as the update condition 324 of the management table 276, the monitoring unit 116 refers to the status table 274 using the sequence program selection function 294 (step 808), and the sequence program It is determined whether or not updating is necessary (step 810). For example, if the version of the sequence program that is requested to be updated has already been executed, the update is not necessary.
 確認した結果、シーケンスプログラムの更新が必要であれば、監視ユニット116は、シーケンスプログラム選択機能294を利用して状態テーブル274を参照し、更新するシーケンスプログラムのプログラムサイズ314と格納先アドレス322を取得する。そして、監視ユニット116は、更新するシーケンスプログラムのプログラムサイズ314と、状態テーブル274に格納されているプログラムサイズ314とを比較することにより、他のシーケンスプログラムに影響があるか否か判断する。 As a result of checking, if the sequence program needs to be updated, the monitoring unit 116 refers to the status table 274 using the sequence program selection function 294, and acquires the program size 314 and storage destination address 322 of the sequence program to be updated. To do. Then, the monitoring unit 116 compares the program size 314 of the sequence program to be updated with the program size 314 stored in the status table 274 to determine whether there is an influence on other sequence programs.
 他のシーケンスプログラムに影響がないことを確認できたら、監視ユニット116は、シーケンスプログラム転送機能296を利用して、シーケンスプログラムの更新が可能と判断する(ステップ812)。 If it is confirmed that there is no influence on other sequence programs, the monitoring unit 116 determines that the sequence program can be updated using the sequence program transfer function 296 (step 812).
 ステップ812により、シーケンスプログラムの更新が可能であることが確認できた場合、監視ユニット116はシーケンスプログラム転送機能296を利用して、共有メモリのプログラム更新領域410に、更新するシーケンスプログラムの更新先アドレス、データサイズ、およびシーケンスプログラムをそれぞれ設定する(ステップ814)。 If it is confirmed in step 812 that the sequence program can be updated, the monitoring unit 116 uses the sequence program transfer function 296 to update the update destination address of the sequence program to be updated in the program update area 410 of the shared memory. , Data size, and sequence program are set (step 814).
 更に、監視ユニット116は、シーケンスプログラムの更新準備が完了したことをCPUユニット114に通知するため、プログラム更新完了フラグ404に「1」を設定する(ステップ816)。 Further, the monitoring unit 116 sets “1” in the program update completion flag 404 in order to notify the CPU unit 114 that the sequence program update preparation has been completed (step 816).
 図9に戻り、CPUユニット114は、プログラム更新機能242を利用して、プログラム更新完了フラグ404の値が「1」か否か定期的に判定する(ステップ904)。プログラム更新完了フラグ404が「1」であれば、CPUユニット114は、シーケンスプログラムの更新処理を実行する。 Returning to FIG. 9, the CPU unit 114 periodically determines whether or not the value of the program update completion flag 404 is “1” using the program update function 242 (step 904). If the program update completion flag 404 is “1”, the CPU unit 114 executes a sequence program update process.
 プログラム更新完了フラグ404が「1」であることを検知すると、CPUユニット114は、プログラム更新機能242を利用して、CPUユニット114に格納されてあるシーケンスプログラムを更新状態に遷移させる。その後、CPUユニット114はプログラムロード機能244を利用して、プログラム更新領域410に設定されている更新先アドレス412に示すメモリアドレスに、更新プログラム416をプログラムサイズ414分だけ設定する(ステップ906)。 When detecting that the program update completion flag 404 is “1”, the CPU unit 114 uses the program update function 242 to transition the sequence program stored in the CPU unit 114 to the update state. Thereafter, the CPU unit 114 uses the program load function 244 to set the update program 416 by the program size 414 in the memory address indicated by the update destination address 412 set in the program update area 410 (step 906).
 更新プログラム416の設定が終了すると、監視ユニット116は、プログラム更新完了フラグ404とプログラム更新準備フラグ402にそれぞれ「0」を設定する(ステップ908、910)。 When the setting of the update program 416 is completed, the monitoring unit 116 sets “0” in the program update completion flag 404 and the program update preparation flag 402 (steps 908 and 910).
 図8に戻り、監視ユニット116は、プログラム更新完了フラグ404に「0」が設定されているか否かを定期的に確認し(ステップ818)、それを確認すると、シーケンスプログラムの更新が完了したと判断して処理を終了する。 Returning to FIG. 8, the monitoring unit 116 periodically checks whether or not “0” is set in the program update completion flag 404 (step 818), and confirms that the update of the sequence program is completed. Determine and end the process.
 また、ステップ806、ステップ810、ステップ812においてシーケンスプログラムの更新を行うことが出来ないと判断された場合、監視ユニット116は、表示部264に更新が出来ない旨を表示し(ステップ820)、またその旨をPC100に外部I/F254を通じて通知する(ステップ822)。そして、監視ユニット116は、プログラム更新完了フラグ404に「2」を設定し(ステップ824)、ステップ818に進む。 If it is determined in step 806, step 810, or step 812 that the sequence program cannot be updated, the monitoring unit 116 displays on the display unit 264 that the update cannot be performed (step 820). The fact is notified to the PC 100 through the external I / F 254 (step 822). Then, the monitoring unit 116 sets “2” in the program update completion flag 404 (step 824), and proceeds to step 818.
 図9に戻り、ステップ904においてプログラム更新完了フラグが「1」以外であれば、CPUユニット114は、プログラム更新完了フラグ404に「2」が設定されているか否か判断する(ステップ912)。 Returning to FIG. 9, if the program update completion flag is other than “1” in step 904, the CPU unit 114 determines whether “2” is set in the program update completion flag 404 (step 912).
 プログラム更新完了フラグ404に「2」が設定された場合、CPUユニット114は、何かの理由でシーケンスプログラムの更新が出来ないことを認識し、プログラム更新準備フラグ402だけに「0」を設定する(ステップ914)。また他の例として、CPUユニット114はプログラム更新完了フラグ404に「2」が設定されたら、CPUユニット114は何かシーケンスプログラムに異常があると判断し、安全な動作のみを実行する安全状態に遷移してもよい。 When “2” is set in the program update completion flag 404, the CPU unit 114 recognizes that the sequence program cannot be updated for some reason, and sets “0” only in the program update preparation flag 402. (Step 914). As another example, when “2” is set in the program update completion flag 404, the CPU unit 114 determines that there is something wrong with the sequence program, and enters a safe state in which only safe operation is executed. You may make a transition.
 尚、図8には示していないが、監視ユニット116は、シーケンスプログラムを更新できなくても、CPUユニット114が問題なく動作できるのであれば、プログラム更新完了フラグ404に「2」以外の値を設定してもよい。 Although not shown in FIG. 8, the monitoring unit 116 sets a value other than “2” to the program update completion flag 404 if the CPU unit 114 can operate without any problem even if the sequence program cannot be updated. It may be set.
 その場合、監視ユニット116は、ステップ912にて、プログラム更新完了フラグに「2」以外の値が設定されていることから、CPUユニット114はシーケンスプログラムを更新することはできないが、CPUユニット114の動作は問題なく継続されると判断し、プログラム更新完了フラグ404とプログラム更新準備フラグ402にそれぞれ「0」を設定し(ステップ916、918)、通常動作を継続してもよい(ステップ920)。 In that case, since the value other than “2” is set to the program update completion flag in step 912, the monitoring unit 116 cannot update the sequence program. It is determined that the operation is continued without any problem, and “0” is set to each of the program update completion flag 404 and the program update preparation flag 402 (steps 916 and 918), and the normal operation may be continued (step 920).
 以上が、CPUユニット114がシーケンスプログラムの更新を要求する場合の監視ユニット16およびCPUユニット114の動作である。 The above is the operation of the monitoring unit 16 and the CPU unit 114 when the CPU unit 114 requests an update of the sequence program.
 尚、ここではステップ818において、シーケンスプログラムの更新が完了したことを、監視ユニット116はプログラム更新準備フラグ402の値を定期的に参照することにより、確認している。しかし、他の例として、監視ユニット116は一定期間プログラム更新準備フラグ402を監視してもその値が「0」にならない場合、ステップ820、ステップ822と同様に、表示部264に更新が完了しない旨を表示し、その旨をPC100に外部I/F254を通じて通知してもよい。 Here, in step 818, the monitoring unit 116 confirms that the update of the sequence program is completed by periodically referring to the value of the program update preparation flag 402. However, as another example, if the value does not become “0” even if the monitoring unit 116 monitors the program update preparation flag 402 for a certain period, the update is not completed on the display unit 264 as in the case of Step 820 and Step 822. This may be displayed, and the fact may be notified to the PC 100 via the external I / F 254.
 また、ステップ822において、監視ユニット116は、外部I/F254を通じてPC100に更新を行うことが出来ないことを通知する際に、PC100より新しいシーケンスプログラムを取得しても良い。以下に、PC100より監視ユニット116へ新しいシーケンスプログラムを転送するシーケンスを説明する。 In step 822, the monitoring unit 116 may acquire a new sequence program from the PC 100 when notifying the PC 100 that updating cannot be performed through the external I / F 254. A sequence for transferring a new sequence program from the PC 100 to the monitoring unit 116 will be described below.
 図10は、PC100から監視ユニット116へ新たなシーケンスプログラムを配送するときのシーケンス図である。 FIG. 10 is a sequence diagram when a new sequence program is delivered from the PC 100 to the monitoring unit 116.
 監視ユニット116は、図8のステップ806、ステップ810、ステップ812においてシーケンスプログラムの更新を行うことが出来ない場合、格納している状態テーブル274の情報、管理テーブル276の情報、およびプログラム更新条件406を外部I/F254を通じてPC100に送信する(ステップ1002)。 When the monitoring unit 116 cannot update the sequence program in Step 806, Step 810, or Step 812 of FIG. 8, the information in the stored state table 274, the information in the management table 276, and the program update condition 406 Is transmitted to the PC 100 through the external I / F 254 (step 1002).
 状態テーブル274の情報、管理テーブル276の情報、およびプログラム更新条件406を受信すると(ステップ1004)、PC100は、それらの受信したデータを解析し、更新を行うことが出来ない原因を究明する(ステップ1006)。そして、PC100は、新しいシーケンスプログラム、状態テーブルの情報、管理テーブルの情報、ならびにプログラム更新条件を作成し(ステップ1008)、それらを監視ユニット116に送信する(ステップ1010)。 Upon receiving the information in the status table 274, the information in the management table 276, and the program update condition 406 (step 1004), the PC 100 analyzes the received data to determine the reason why the update cannot be performed (step 1004). 1006). Then, the PC 100 creates a new sequence program, status table information, management table information, and program update conditions (step 1008), and transmits them to the monitoring unit 116 (step 1010).
 新しいシーケンスプログラム、状態テーブルの情報、管理テーブルの情報、ならびにプログラム更新条件を受信すると(ステップ1012)、監視ユニット116は、受信したデータを状態テーブル274、管理テーブル276、ならびにプログラム更新条件406等にそれぞれ設定する(ステップ1014)。 When a new sequence program, status table information, management table information, and program update conditions are received (step 1012), the monitoring unit 116 stores the received data in the status table 274, management table 276, program update conditions 406, and the like. Each is set (step 1014).
 以上が、PC100から監視ユニット116へ新しいシーケンスプログラムを転送する場合のシーケンスである。 The above is the sequence when a new sequence program is transferred from the PC 100 to the monitoring unit 116.
 尚、ステップ1014の後、監視ユニット116はステップ804に進み、プログラム更新条件406の確認から処理を進めてもよい。 Note that after step 1014, the monitoring unit 116 may proceed to step 804 and proceed from the confirmation of the program update condition 406.
 上述の通り、図10では、監視ユニット116よりPC100に対して新しいシーケンスプログラムを転送する処理を実行した。しかし、処理がこの動作に限定されることはない。 As described above, in FIG. 10, the process of transferring a new sequence program from the monitoring unit 116 to the PC 100 is executed. However, the processing is not limited to this operation.
 図11は、PC100から監視ユニット116へ新たなシーケンスプログラムを配送するときの変形例のシーケンス図である。 FIG. 11 is a sequence diagram of a modified example when a new sequence program is delivered from the PC 100 to the monitoring unit 116.
 PC100は、プログラムIDが示すシーケンスプログラムのバージョンを確認するため、監視ユニット116に対してプログラムバージョン要求を送信する(ステップ1102)。 The PC 100 transmits a program version request to the monitoring unit 116 in order to confirm the version of the sequence program indicated by the program ID (step 1102).
 プログラムバージョン要求を受信すると(ステップ1104)、監視ユニット116は、管理テーブル276を参照し(ステップ1106)、プログラムバージョン要求に含まれるプログラムIDが示すプログラムのバージョンを、プログラムバージョン要求の応答として、PC100に送信する(ステップ1108)。 When receiving the program version request (step 1104), the monitoring unit 116 refers to the management table 276 (step 1106), and uses the program version indicated by the program ID included in the program version request as a response to the program version request. (Step 1108).
 応答を受信すると(ステップ1110)、PC100は、その応答に含まれるプログラムバージョンからプログラムの更新が必要か否か判断する(ステップ1112)。 When the response is received (step 1110), the PC 100 determines whether or not the program needs to be updated from the program version included in the response (step 1112).
 プログラムの更新が必要の場合、PC100は、新しいシーケンスプログラム、ならびにプログラムバージョンを、監視ユニット116に送信する(ステップ1114)。尚、プログラムの更新が必要ない場合は、PC100はここでは何もしない。 When the program needs to be updated, the PC 100 transmits a new sequence program and a program version to the monitoring unit 116 (step 1114). If no program update is necessary, the PC 100 does nothing here.
 新しいシーケンスプログラム、ならびにプログラムバージョンを受信した監視ユニット116は、プログラム更新処理を実行する(ステップ1118)。 The monitoring unit 116 that has received the new sequence program and the program version executes a program update process (step 1118).
 図12は、ステップ1118に示したプログラム更新処理における監視ユニット116の詳細な動作を示すフローチャートである。 FIG. 12 is a flowchart showing the detailed operation of the monitoring unit 116 in the program update process shown in step 1118.
 監視ユニット116は、受信した情報に基づいて管理テーブル276を更新し、共有メモリのプログラム更新領域410に更新するシーケンスプログラムの更新先アドレス、データサイズ、シーケンスプログラムをそれぞれ設定する(ステップ1202)。更に、監視ユニット116は、シーケンスプログラムの更新準備が完了したことをCPUユニット114に通知するため、プログラム更新準備フラグ402に「3」を設定する(ステップ1204)。それ以降のシーケンス(ステップ1206~1210)は、図6に示したステップ614~618と同様であるため、ここでは説明を省略する。 The monitoring unit 116 updates the management table 276 based on the received information, and sets the update destination address, data size, and sequence program of the sequence program to be updated in the program update area 410 of the shared memory (step 1202). Furthermore, the monitoring unit 116 sets “3” in the program update preparation flag 402 in order to notify the CPU unit 114 that the preparation for updating the sequence program has been completed (step 1204). Subsequent sequences (steps 1206 to 1210) are the same as steps 614 to 618 shown in FIG. 6, and a description thereof will be omitted here.
 以上がPC100より監視ユニット116に新しいシーケンスプログラムを転送する処理のシーケンスである。 The above is the processing sequence for transferring a new sequence program from the PC 100 to the monitoring unit 116.
 以上、実施形態を具体的に説明したが、上記開示に限定されるものでなく、趣旨を逸脱しない範囲において種々変更可能であることは言うまでもない。 As mentioned above, although embodiment was described concretely, it cannot be overemphasized that it can change variously in the range which is not limited to the said indication and does not deviate from the meaning.
100…PC、110…PLC、112…電源ユニット、114…CPUユニット、116…監視ユニット、118…Oユニット、120…インバータ、122…圧縮機、124…サーボモータ、200…ハードウェアモジュール、201…マイコン、202…CPU、203…入出力ポート、204…外部I/F、205…ROM、206…RAM、207…不揮発性メモリ、210…バスASIC、212…表示部、220…記憶装置、222…シーケンスプログラム、224…ロードプログラム、230…OS機能部、240…プログラム更新アプリケーション機能部、246…制御アプリケーション機能部、250…ハードウェアモジュール、251…マイコン、252…CPU、253…入出力ポート、254…外部I/F、255…ROM、256…RAM、257…不揮発性メモリ、260…バスASIC、264…表示部、270…記憶装置、280…OS機能部、290…監視アプリケーション機能部、
 
DESCRIPTION OF SYMBOLS 100 ... PC, 110 ... PLC, 112 ... Power supply unit, 114 ... CPU unit, 116 ... Monitoring unit, 118 ... O unit, 120 ... Inverter, 122 ... Compressor, 124 ... Servo motor, 200 ... Hardware module, 201 ... Microcomputer, 202 ... CPU, 203 ... I / O port, 204 ... External I / F, 205 ... ROM, 206 ... RAM, 207 ... Non-volatile memory, 210 ... Bus ASIC, 212 ... Display unit, 220 ... Storage device, 222 ... Sequence program, 224 ... load program, 230 ... OS function unit, 240 ... program update application function unit, 246 ... control application function unit, 250 ... hardware module, 251 ... microcomputer, 252 ... CPU, 253 ... input / output port, 254 ... External I / F, 25 ... ROM, 256 ... RAM, 257 ... non-volatile memory, 260 ... bus ASIC, 264 ... display unit, 270 ... storage device, 280 ... OS function unit, 290 ... monitor application function unit,

Claims (15)

  1.  プログラムを実行して制御対象機器を制御するプロセッサユニットと、
     前記プロセッサユニットを監視する監視ユニットと、を有し、
     前記プロセッサユニットが、前記プログラムの実行に伴って、自装置と制御対象機器の少なくとも一方の状態情報を前記監視ユニットに通知し、
     前記監視ユニットが、前記プロセッサユニットから通知された前記状態情報が所定の更新条件と一致すると、前記プロセッサユニットと連携し、前記プロセッサユニットが実行するシーケンスプログラムを更新する、
    コントローラ。
    A processor unit that executes a program to control a control target device; and
    A monitoring unit for monitoring the processor unit,
    With the execution of the program, the processor unit notifies the monitoring unit of status information of at least one of its own device and a control target device,
    When the status information notified from the processor unit matches a predetermined update condition, the monitoring unit updates the sequence program executed by the processor unit in cooperation with the processor unit.
    controller.
  2.  前記プロセッサユニットと前記監視ユニットは互いに同じ情報を共有するための共有メモリをそれぞれ有し、
     前記プロセッサユニットは前記共有メモリを介して前記監視ユニットに前記状態情報を通知し、
     前記監視ユニットは、前記プロセッサユニットから通知された前記状態情報に応じて更新するプログラムを選択し、選択したプログラムを、前記共有メモリを介して前記プロセッサユニットに送る、
    請求項1に記載のコントローラ。
    The processor unit and the monitoring unit each have a shared memory for sharing the same information with each other,
    The processor unit notifies the status information to the monitoring unit via the shared memory;
    The monitoring unit selects a program to be updated according to the state information notified from the processor unit, and sends the selected program to the processor unit via the shared memory.
    The controller according to claim 1.
  3.  前記コントローラはシーケンスプログラムを実行することによって前記制御対象機器に対するシーケンス制御を行うプログラマブルロジックコントローラであり、前記状態情報を前記共有メモリへ書き込む処理が前記シーケンス制御と共に前記プログラムに組み込まれている、請求項2に記載のコントローラ。 The said controller is a programmable logic controller which performs sequence control with respect to the said control object apparatus by executing a sequence program, The process which writes the said status information to the said shared memory is built in the said program with the said sequence control. 2. The controller according to 2.
  4.  前記監視ユニットは、前記共有メモリの前記状態情報の領域を定期的に読み出して前記更新条件と一致するか否か判定する、請求項3に記載のコントローラ。 The controller according to claim 3, wherein the monitoring unit periodically reads out the state information area of the shared memory and determines whether or not the update condition matches.
  5.  前記プログラムの更新を行うべき状態の状態情報を前記共有メモリに書き込むときに、プログラム更新を要求する要求フラグを前記共有メモリに設定する処理が前記プログラムに組み込まれており、
     前記監視ユニットは、前記共有メモリの前記要求フラグの領域を定期的に読み出し、プログラム更新を要求する要求フラグが設定されていたら、前記状態情報の領域を読み出す、請求項3に記載のコントローラ。
    A process of setting a request flag for requesting program update in the shared memory when writing state information of a state in which the program should be updated to the shared memory is incorporated in the program,
    4. The controller according to claim 3, wherein the monitoring unit periodically reads the request flag area of the shared memory, and reads the state information area if a request flag for requesting program update is set.
  6.  前記監視ユニットは、前記プロセッサユニットから要求されたプログラム更新を行うか否か判定し、行わないと判断したとき、要求されたプログラム更新を行わない旨を表示部に表示すること、または外部端末に通知することの少なくとも一方を行う、請求項4に記載のコントローラ。 The monitoring unit determines whether or not to perform the program update requested from the processor unit, and displays that the requested program update is not performed on the display unit when it is determined that it is not performed or on an external terminal The controller according to claim 4, wherein at least one of notifying is performed.
  7.  前記監視ユニットは、前記プロセッサユニットから要求されたプログラム更新を行うか否か判定し、行わないと判断したとき、要求されたプログラム更新を行わない旨を表示部に表示すること、または外部端末に通知することの少なくとも一方を行う、請求項5に記載のコントローラ。 The monitoring unit determines whether or not to perform the program update requested from the processor unit, and displays that the requested program update is not performed on the display unit when it is determined that it is not performed or on an external terminal The controller according to claim 5, wherein at least one of the notifications is performed.
  8.  制御対象機器を制御するコントローラにおいて、プログラムを実行して前記制御対象機器を制御するプロセッサユニットと共に備えられ、前記プロセッサユニットを監視する監視ユニットにおいて、
     前記プロセッサユニットから、前記プログラムの実行に伴う、前記プロセッサユニットと前記制御対象機器の少なくとも一方の状態情報が通知され、前記状態情報が所定の更新条件と一致すると、前記プロセッサユニットと連携し、前記プロセッサユニットが実行するシーケンスプログラムを更新することを特徴とする監視ユニット。
    In a controller for controlling a control target device, a monitoring unit for monitoring the processor unit, which is provided together with a processor unit for controlling the control target device by executing a program,
    When the processor unit is notified of status information of at least one of the processor unit and the device to be controlled accompanying execution of the program, and the status information matches a predetermined update condition, the processor unit cooperates with the processor unit, A monitoring unit that updates a sequence program executed by a processor unit.
  9.  前記プロセッサユニットと前記監視ユニットは互いに同じ情報を共有するための共有メモリをそれぞれ有し、
     前記プロセッサユニットは前記共有メモリを介して前記監視ユニットに前記状態情報を通知し、
     前記監視ユニットは、前記プロセッサユニットから通知された前記状態情報に応じて更新するプログラムを選択し、選択したプログラムを、前記共有メモリを介して前記プロセッサユニットに送る、
    請求項8に記載の監視ユニット。
    The processor unit and the monitoring unit each have a shared memory for sharing the same information with each other,
    The processor unit notifies the status information to the monitoring unit via the shared memory;
    The monitoring unit selects a program to be updated according to the state information notified from the processor unit, and sends the selected program to the processor unit via the shared memory.
    The monitoring unit according to claim 8.
  10.  前記コントローラはシーケンスプログラムを実行することによって前記制御対象機器に対するシーケンス制御を行うプログラマブルロジックコントローラであり、前記状態情報を前記共有メモリへ書き込む処理が前記シーケンス制御と共に前記プログラムに組み込まれている、請求項9に記載の監視ユニット。 The said controller is a programmable logic controller which performs sequence control with respect to the said control object apparatus by executing a sequence program, The process which writes the said status information to the said shared memory is built in the said program with the said sequence control. 9. The monitoring unit according to 9.
  11.  前記監視ユニットは、前記共有メモリの前記状態情報の領域を定期的に読み出して前記更新条件と一致するか否か判定する、請求項10に記載の監視ユニット。 The monitoring unit according to claim 10, wherein the monitoring unit periodically reads out the state information area of the shared memory to determine whether or not the update condition matches.
  12.  前記プログラムの更新を行うべき状態の状態情報を前記共有メモリに書き込むときに、プログラム更新を要求する要求フラグを前記共有メモリに設定する処理が前記プログラムに組み込まれており、
     前記監視ユニットは、前記共有メモリの前記要求フラグの領域を定期的に読み出し、プログラム更新を要求する要求フラグが設定されていたら、前記状態情報の領域を読み出す、請求項10に記載の監視ユニット。
    A process of setting a request flag for requesting program update in the shared memory when writing state information of a state in which the program should be updated to the shared memory is incorporated in the program,
    The monitoring unit according to claim 10, wherein the monitoring unit periodically reads the request flag area of the shared memory, and reads the state information area if a request flag for requesting program update is set.
  13.  前記監視ユニットは、前記プロセッサユニットから要求されたプログラム更新を行うか否か判定し、行わないと判断したとき、要求されたプログラム更新を行わない旨を表示部に表示すること、または外部端末に通知することの少なくとも一方を行う、請求項10に記載の監視ユニット。 The monitoring unit determines whether or not to perform the program update requested from the processor unit, and displays that the requested program update is not performed on the display unit when it is determined that it is not performed or on an external terminal The monitoring unit according to claim 10, wherein at least one of notifying is performed.
  14.  前記監視ユニットは、前記プロセッサユニットから要求されたプログラム更新を行うか否か判定し、行わないと判断したとき、要求されたプログラム更新を行わない旨を表示部に表示すること、または外部端末に通知することの少なくとも一方を行う、請求項11に記載の監視ユニット。 The monitoring unit determines whether or not to perform the program update requested from the processor unit, and displays that the requested program update is not performed on the display unit when it is determined that it is not performed or on an external terminal The monitoring unit according to claim 11, wherein at least one of notifying is performed.
  15.  コントローラにおいてシーケンスプログラムを実行して前記制御対象機器を制御するプロセッサユニットの前記シーケンスプログラムを更新するためのシーケンスプログラム更新方法であって、
     前記プロセッサユニットが、前記プログラムの実行に伴って、自装置と制御対象機器の少なくとも一方の状態情報を、前記プロセッサユニットを監視する監視ユニットに通知するステップと、
     前記監視ユニットが、前記プロセッサユニットから通知された前記状態情報が所定の更新条件と一致すると、前記プロセッサユニットと連携し、前記プロセッサユニットが実行するシーケンスプログラムを更新するステップと、を有するシーケンスプログラム更新方法。
     
    A sequence program update method for updating the sequence program of a processor unit that executes a sequence program in a controller to control the device to be controlled,
    The processor unit notifies the monitoring unit that monitors the processor unit of status information of at least one of the device itself and a control target device in accordance with the execution of the program;
    Updating the sequence program executed by the processor unit in cooperation with the processor unit when the status information notified from the processor unit matches a predetermined update condition; Method.
PCT/JP2012/075753 2011-10-14 2012-10-04 Controller, monitoring unit, and sequence program updating method WO2013054725A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011-226492 2011-10-14
JP2011226492A JP5687171B2 (en) 2011-10-14 2011-10-14 Controller, monitoring unit, and sequence program update method

Publications (1)

Publication Number Publication Date
WO2013054725A1 true WO2013054725A1 (en) 2013-04-18

Family

ID=48081781

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/075753 WO2013054725A1 (en) 2011-10-14 2012-10-04 Controller, monitoring unit, and sequence program updating method

Country Status (2)

Country Link
JP (1) JP5687171B2 (en)
WO (1) WO2013054725A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6977507B2 (en) * 2017-11-24 2021-12-08 オムロン株式会社 Controls and control systems

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001142511A (en) * 1999-11-17 2001-05-25 Digital Electronics Corp Control host computer and recording medium recording its program
JP2002006910A (en) * 2000-06-27 2002-01-11 Matsushita Electric Works Ltd Programable controller with updating function and method for updating function of function extention unit in programable controller
JP2009090940A (en) * 2007-10-12 2009-04-30 Honda Motor Co Ltd Updating device of vehicle control program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4533331B2 (en) * 2006-03-02 2010-09-01 三菱電機株式会社 Control equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001142511A (en) * 1999-11-17 2001-05-25 Digital Electronics Corp Control host computer and recording medium recording its program
JP2002006910A (en) * 2000-06-27 2002-01-11 Matsushita Electric Works Ltd Programable controller with updating function and method for updating function of function extention unit in programable controller
JP2009090940A (en) * 2007-10-12 2009-04-30 Honda Motor Co Ltd Updating device of vehicle control program

Also Published As

Publication number Publication date
JP2013088887A (en) 2013-05-13
JP5687171B2 (en) 2015-03-18

Similar Documents

Publication Publication Date Title
US9110843B2 (en) Rack and method thereof for simultaneously updating basic input output systems
CN108023809B (en) System and method for enabling control of a device in a process control system
US20100042715A1 (en) Method and systems for redundant server automatic failover
JP4888718B2 (en) Distributed control system
JP4788912B2 (en) PLC
JP2010233006A (en) Server system, collective server apparatus, and mac address management method
JP5962088B2 (en) PLC simulation system, PLC simulator, control program, and recording medium
EP3432098B1 (en) Relay device, control method for relay device, control program, and recording medium
WO2018052882A1 (en) On-process migration of non-redundant input/output (i/o) firmware
JP5687171B2 (en) Controller, monitoring unit, and sequence program update method
US20180013857A1 (en) Local hart proxy server for modular smart transmitter devices
JP5088490B2 (en) Redundant controller
CN103777618A (en) Method for controlling instruction execution of semiconductor technology
JP6797312B2 (en) Communication system, master device and slave device
KR20130011186A (en) A method for downloading firmware of module for plc
WO2020184062A1 (en) Control system and control device
JP2006277733A (en) Programmable controller system
WO2020184063A1 (en) Control system and control device
JP2008226111A (en) Duplication controller system and operation system controller
US9442874B2 (en) Expansion unit
CN109643089B (en) Control unit, data updating method, and storage medium
CN109643094B (en) Security control unit, security control method, and storage medium
JP2008077265A (en) Program update method for programmable controller
WO2020184034A1 (en) Control system and control device
JP6912502B2 (en) Communication control device and wireless communication method

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12840659

Country of ref document: EP

Kind code of ref document: A1