Programmable logic controller, control method, and program

The PLC's dual memory system enables continuous operation and rapid switching during updates, addressing the downtime and misalignment issues in conventional PLCs by allowing program updates without stopping execution, thus enhancing debugging efficiency and reducing equipment failure risks.

WO2024189785A1PCT designated stage expired Publication Date: 2024-09-19MITSUBISHI ELECTRIC CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2023/009904
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

Conventional programmable logic controllers (PLCs) experience prolonged downtime and misalignment in control timing during program updates, leading to potential equipment failures and increased debugging time due to the need to stop program execution when rewriting programs.

Method used

The PLC incorporates a dual memory system with separate non-volatile and volatile memory sections for program storage and execution, allowing for seamless switching between memory areas during updates without stopping program execution, enabling continuous operation and rapid switching to updated programs.

Benefits of technology

This approach reduces downtime during program updates, minimizes the risk of equipment failures, and shortens the time required for debugging by allowing the PLC to maintain continuous operation and quick switching between old and new program executions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2023009904_19092024_PF_FP_ABST
    Figure JP2023009904_19092024_PF_FP_ABST
Patent Text Reader

Abstract

In the present invention, if a first program storage memory (121) is used in the development of a program, a program writing control unit (154) stores an update program in a second program storage memory (122). If the program is developed in a first program execution memory (131), a program development control unit (155) develops the update program in a second program execution memory (132). If a program execution unit (157) is executing the program developed in the first program execution memory (131), an update program switching control unit (158) causes the program execution unit (157) to execute the update program developed in the second program execution memory (132).
Need to check novelty before this filing date? Find Prior Art

Description

Programmable logic controller, control method and program

[0001] The present disclosure relates to a programmable logic controller, a control method, and a program.

[0002] Conventionally, in program development, a so-called debugging process is performed to detect and correct errors and defects in the created program. When developing a program for a programmable logic controller (PLC, hereinafter sometimes referred to as "PLC"), a programmer checks the operation of the created program while actually running the PLC. If there is a problem with the operation, the programmer corrects the program and writes the corrected program to the PLC. The programmer then repeats the process of checking the operation, correcting the program, and writing the program until the PLC operates normally. Therefore, in PLC program development, stopping the PLC every time a corrected program is written increases the debugging work time, so there is a need for a technology that can write corrected programs while continuing PLC operation as much as possible.

[0003] Patent Document 1 discloses a PLC device that allows a program stored therein to be rewritten during operation. In Patent Document 1, the PLC device includes a first memory configured as a nonvolatile flash memory for storing the program, a second memory configured as a nonvolatile flash memory for backing up the first memory, and a third memory configured as a volatile random access memory (RAM) used when executing the program. Furthermore, Patent Document 1 also describes how the PLC device writes a program to be rewritten during operation to the second memory, and if the write is successful, copies the written program to the first memory, and then expands the program into the third memory and starts it.

[0004] Japanese Patent Application Laid-Open No. 2004-272629

[0005] In the PLC device described in Patent Document 1, the pre-rewrite running program deployed in the third memory is overwritten with the rewritten program before the device is started. Therefore, in the PLC device described in Patent Document 1, when the deployment of the rewritten program begins, the execution of the pre-rewrite program stops, which causes a problem in that program execution stops from the start of deployment of the rewritten program until the device starts.

[0006] The present disclosure has been made in consideration of the above-described circumstances, and aims to reduce the time that program execution is stopped when the program is rewritten.

[0007] To achieve the above object, a programmable logic controller according to the present disclosure includes a program storage memory capable of storing a program, a program execution memory used when executing the program, a program deployment control unit that controls the deployment of the program stored in the program storage memory into the program execution memory, a program execution unit that executes the program deployed in the program execution memory, and a program write control unit that controls writing to store an update program, which is a program updated during program execution, into the program storage memory. The program storage memory includes a first program storage memory and a second program storage memory different from the first program storage memory, and the program execution memory includes the first program execution memory and the second program execution memory different from the first program execution memory. The program write control unit stores the update program in the second program storage memory when the program storage memory used to deploy the currently running program is the first program storage memory, and the program deployment control unit deploys the update program from the second program storage memory to the second program execution memory when the program execution memory in which the currently running program is deployed is the first program execution memory. The programmable logic controller further includes an update program switching control unit that performs switching control to cause the program execution unit to execute the update program expanded in the second program execution memory when the program execution unit is executing the program expanded in the first program execution memory.

[0008] According to the present disclosure, a programmable logic controller loads an update program into a second program execution memory that is not used for program execution. Therefore, the programmable logic controller according to the present disclosure can prevent execution of the pre-rewritten program from being stopped even when the load of the update program begins. Furthermore, according to the present disclosure, after the load of the update program is completed, the programmable logic controller switches the program execution memory used for program execution from the first program execution memory to the second program execution memory. Therefore, the programmable logic controller according to the present disclosure can switch from execution of the pre-rewritten program to execution of the post-rewritten update program more quickly than a programmable logic controller that does not switch the program execution memory from the first program execution memory to the second program execution memory. As a result, the programmable logic controller according to the present disclosure can shorten the time for stopping program execution when rewriting a program.

[0009] 1 is a block diagram showing the configuration of a program development support system according to a first embodiment; 2 is a block diagram showing the functional configuration of the program development support system; 3 is a block diagram showing the hardware configuration of a PLC and an engineering tool; 4 is a diagram showing an example of processing from receiving a program to storing a management table; 5 is a diagram showing an example of processing from receiving an update program to storing it; 6 is a diagram showing an example of processing from deploying an update program to storing a management table;

[0010] A programmable logic controller, a control method, and a program according to embodiments of the present disclosure will be described in detail below with reference to the drawings. Note that identical or corresponding parts in the drawings are designated by the same reference numerals. Also, hereinafter, a "programmable logic controller" will be abbreviated as a "PLC."

[0011] (Regarding Program Development Support System 1) A program development support system 1 according to an embodiment of the present disclosure is a system that supports program development by performing debugging work. As shown in Fig. 1, the program development support system 1 includes a PLC 100 that executes programs and an engineering tool 200 that generates and updates the programs. The PLC 100 and the engineering tool 200 are connected by a network that can send and receive information.

[0012] In the program development support system 1, the engineering tool 200 transmits a program created by a user who is a programmer to the PLC 100, and the PLC 100 stores, deploys, and executes the received program. The user also checks the operation of the PLC 100 that is executing the program, and if there is a problem with the operation, modifies and updates the program. The engineering tool 200 transmits an update program that is the updated program to the PLC 100, and the PLC 100 stores, deploys, and executes the received update program. The program development support system 1 then repeats the process of the user checking the operation, modifying and updating the program, the engineering tool 200 transmitting the update program, and the PLC 100 receiving, storing, deploying, and executing the program until the PLC 100 operates normally. In this manner, the program development support system 1 can support the debugging of programs and the development of programs.

[0013] (Regarding PLC 100) As shown in Fig. 2, PLC 100 includes a program receiving unit 110 that receives a program. PLC 100 also includes a program storage memory 120 that can store a program, a program execution memory 130 that is used when executing the program, and a management information storage unit 140 that stores management information that is information for managing the execution of the program. Program storage memory 120 includes a first program storage memory 121 and a second program storage memory 122. Program execution memory 130 also includes a first program execution memory 131 and a second program execution memory 132. Management information storage unit 140 also includes a first management information storage unit 141 and a second management information storage unit 142.

[0014] PLC 100 also includes a program storage management unit 151 that manages program storage memory 120, a program execution management unit 152 that manages program execution memory 130, and a management information storage management unit 153 that manages management information storage unit 140. PLC 100 also includes a program write control unit 154 that controls writing of programs, a program deployment control unit 155 that controls program deployment, and a management information generation unit 156 that generates management information. PLC 100 also includes a program execution unit 157 that executes programs, and an update program switching control unit 158 ​​that controls switching to an update program that is an updated program.

[0015] 2, the engineering tool 200 includes a program generation unit 210 that generates a program, a program storage unit 220 that stores the program, and a program transmission unit 230 that transmits the program. The program generation unit 210 includes a compilation execution unit 211 that compiles the program.

[0016] (Hardware Configuration of PLC 100) As shown in Fig. 3, PLC 100 includes a control unit 51 that executes processing in accordance with a control program 59. Control unit 51 includes a CPU (Central Processing Unit). In accordance with control program 59, control unit 51 functions as a program storage management unit 151, a program execution management unit 152, a management information storage management unit 153, a program write control unit 154, a program deployment control unit 155, a management information generation unit 156, a program execution unit 157, and an update program switching control unit 158 ​​shown in Fig. 2.

[0017] 3 , the PLC 100 includes a main memory unit 52 into which the control program 59 is loaded and which is used as a working area for the control unit 51. The main memory unit 52 includes a volatile memory such as a RAM. The main memory unit 52 functions as the program execution memory 130, the first program execution memory 131, the second program execution memory 132, the management information storage unit 140, the first management information storage unit 141, and the second management information storage unit 142 shown in FIG. 2 .

[0018] 3 , the PLC 100 includes an external storage unit 53 that stores a control program 59 in advance. The external storage unit 53 supplies information to be stored in the program to the control unit 51 in accordance with instructions from the control unit 51, and stores data supplied from the control unit 51. The external storage unit 53 includes a non-volatile memory such as a flash memory, a hard disk drive (HDD), or a solid state drive (SSD). The external storage unit 53 functions as the program storage memory 120, the first program storage memory 121, and the second program storage memory 122 shown in FIG. 2 .

[0019] 3 , the PLC 100 includes an operation unit 54 that is operated by a user. Information input via the operation unit 54 is supplied to the control unit 51. The operation unit 54 includes information input components such as a keyboard, a mouse, and a touch panel.

[0020] The PLC 100 also includes a display unit 55 that displays information input via the operation unit 54 and information output by the control unit 51. The display unit 55 includes a display device such as an LCD (Liquid Crystal Display) or an organic EL (Electro-Luminescence) display.

[0021] The PLC 100 also includes a transmitting / receiving unit 56 that transmits and receives information. The transmitting / receiving unit 56 includes information communication components such as a communication network terminal device that connects to a network and a wireless communication device. The transmitting / receiving unit 56 functions as the program receiving unit 110 shown in FIG. 2.

[0022] Returning to FIG. 3, in the PLC 100 , the main memory unit 52 , the external memory unit 53 , the operation unit 54 , the display unit 55 and the transmission / reception unit 56 are all connected to the control unit 51 via the internal bus 50 .

[0023] 2 by the control unit 51 using the main memory unit 52, the external memory unit 53, the operation unit 54, the display unit 55, and the transmission / reception unit 56 as resources. For example, the PLC 100 executes a program reception step performed by the program reception unit 110 and a program storage management step as an example of a program storage determination step performed by the program storage management unit 151.

[0024] Furthermore, for example, PLC 100 executes a program execution management step as an example of a program execution determination step performed by program execution management unit 152, and a management information storage management step as an example of a management information storage determination step performed by management information storage management unit 153. Furthermore, for example, PLC 100 executes a program write control step performed by program write control unit 154, a program deployment control step performed by program deployment control unit 155, and a management information generation step performed by management information generation unit 156. Furthermore, for example, PLC 100 executes a program execution step performed by program execution unit 157, and an update program switching control step performed by update program switching control unit 158.

[0025] (Hardware Configuration of Engineering Tool 200) As shown in FIG. 3 , like PLC 100, engineering tool 200 also includes a control unit 51, a main memory unit 52, an external memory unit 53, an operation unit 54, a display unit 55, and a transmission / reception unit 56. In accordance with a control program 59, control unit 51 functions as program generation unit 210 and compilation execution unit 211 shown in FIG. 2 , external memory unit 53 functions as program storage unit 220, and transmission / reception unit 56 functions as program transmission unit 230. Returning to FIG. 3 , in the engineering tool 200, control unit 51 uses main memory unit 52, external memory unit 53, operation unit 54, display unit 55, and transmission / reception unit 56 as resources to realize the functions of the above-described units 210, 211, 220, and 230 shown in FIG. 2 . For example, the engineering tool 200 executes a program generation step performed by program generation unit 210, a compilation execution step performed by compilation execution unit 211, and a program transmission step performed by program transmission unit 230.

[0026] (Details of the Functional Configuration of the Engineering Tool 200) Returning to FIG. 2 , the program generation unit 210 writes a program when the user performs an operation to write a program using the operation unit 54. Here, the format of the program description includes not only the format of character data but also the format of graphic data. For example, the program description format is source code for ST language and ladder diagram for ladder language. Furthermore, when the user performs an operation to compile a program using the operation unit 54, the program generation unit 210 causes the compilation execution unit 211 to compile the program. Furthermore, the program generation unit 210 stores the source file of the generated program and the executable file of the program after compilation in the program storage unit 220.

[0027] The program transmission unit 230 transmits the executable file of the program stored in the program storage unit 220 to the PLC 100. Note that when the PLC 100 is executing the executable file of the program received from the engineering tool 200, the user may determine that there is a problem with the operation of the PLC 100 and modify or update the program. In this case, the program generation unit 210 generates a source file and an executable file of an update program, which is the updated program, and stores them in the program storage unit 220. The program transmission unit 230 then transmits the executable file of the update program stored in the program storage unit 220 to the PLC 100.

[0028] (Details of the Functional Configuration of PLC 100) The program receiving unit 110 receives an executable file for a program from the engineering tool 200. Furthermore, if a user modifies or updates a program while the program is running, the program receiving unit 110 receives an executable file for an update program from the engineering tool 200. Hereinafter, the executable file for a program will be simply referred to as a "program," and the executable file for an update program will be simply referred to as an "update program."

[0029] In this embodiment, first program execution memory 131 is configured from a first volatile memory, and second program execution memory 132 is configured from a second volatile memory separate from the first volatile memory. Furthermore, first program storage memory 121 is configured from a first nonvolatile memory, and second program storage memory 122 is configured from a second nonvolatile memory separate from the first nonvolatile memory. Furthermore, first management information storage unit 141 is configured from a specific area in the first volatile memory where programs are not loaded, and second management information storage unit 142 is configured from a specific area in the second volatile memory.

[0030] The program write control unit 154 performs write control to store the executable file of the program received by the program receiving unit 110 in the program storage memory 120. When the program is not being executed, the program write control unit 154 synchronizes the program information stored in the first program storage memory 121 and the second program storage memory 122, and then stores the received program in the first program storage memory 121.

[0031] For example, consider the case where the programs received from the engineering tool 200 are a first program PRG1, a second program PRG2, and a third program PRG3, as shown in Fig. 4. As shown in Fig. 4, the first program storage memory 121 and the second program storage memory 122 are synchronized with no program information stored therein. In this case, the program write control unit 154 stores the received programs PRG1 to PRG3 in free space in the first program storage memory 121.

[0032] 2 , when the program storage memory 120 has successfully stored the program, the program expansion control unit 155 controls the expansion of the program stored in the program storage memory 120 into the program execution memory 130. When the program is not being executed, the program expansion control unit 155 expands the program stored in the first program storage memory 121 into the first program execution memory 131.

[0033] 4 , after the first program storage memory 121 has successfully stored the programs PRG1 to PRG3, the program expansion control unit 155 first expands the first program PRG1 stored in the first program storage memory 121 from the first address 0000H to the second address 0100H in the first program execution memory 131. The program expansion control unit 155 also expands the second program PRG2 stored in the first program storage memory 121 from the second address 0100H to the third address 0200H in the first program execution memory 131. The program expansion control unit 155 then expands the third program PRG3 stored in the first program storage memory 121 from the third address 0200H to the fourth address 0300H in the first program execution memory 131. That is, the program expansion control unit 155 expands each of the programs PRG1 to PRG3 consecutively from the first address 0000H to the fourth address 0300H in the first program execution memory 131.

[0034] 2 , before executing a program, the management information generation unit 156 generates a management table as an example of management information and stores the generated management table in the management information storage unit 140. Here, the management table is a table that indicates the location addresses of the program loaded in the program execution memory 130. When the program is not being executed, the management information generation unit 156 generates a management table that indicates the location addresses of the program loaded in the first program execution memory 131 and stores the generated management table in the first management information storage unit 141.

[0035] For example, as shown in FIG. 4, after each program PRG1 to PRG3 is expanded in the first program execution memory 131, the management information generation unit 156 generates a management table indicating that the starting location address of the first program PRG1 is the first address 0000H, the starting location address of the second program PRG2 is the second address 0100H, and the starting location address of the third program PRG3 is the third address 0200H, and stores the generated management table in the first management information storage unit 141.

[0036] 2 , the program execution unit 157 executes the program loaded in the program execution memory 130 by using the management table stored in the management information storage unit 140. When the program execution unit 157 is not executing a program, it executes the program loaded in the first program execution memory 131 by using the management table stored in the first management information storage unit 141.

[0037] For example, as shown in FIG. 4, the program execution unit 157 determines from the management table stored in the first management information storage unit 141 that the initial location addresses of each of the programs PRG1 to PRG3 are addresses 0000H, 0100H, and 0200H, respectively, and executes each of the programs PRG1 to PRG3 whose storage locations in the first program execution memory 131 have been determined.

[0038] 2 , when the program receiving unit 110 receives an update program while a program is being executed, the program storage management unit 151, which is an example of a program storage determination unit, determines whether the program storage memory 120 used to expand the running program is the first program storage memory 121 or the second program storage memory 122. For example, when a program storage memory flag (not shown) indicates a value of "1," the program storage management unit 151 determines that the program storage memory 120 used to expand the running program is the first program storage memory 121. On the other hand, when the program storage memory flag indicates a value of "2," the program storage management unit 151 determines that the program storage memory 120 used to expand the running program is the second program storage memory 122.

[0039] When an update program is received, if the determination result of program storage management unit 151 is the first program storage memory 121, program write control unit 154 synchronizes the information stored in second program storage memory 122 with the information stored in first program storage memory 121. Thereafter, program write control unit 154 stores the received update program in second program storage memory 122. On the other hand, if the determination result of program storage management unit 151 is the second program storage memory 122, program write control unit 154 synchronizes the information stored in first program storage memory 121 with the information stored in second program storage memory 122. Thereafter, program write control unit 154 stores the received update program in first program storage memory 121.

[0040] For example, as shown in FIG. 5 , consider a case where the programs PRG1 to PRG3 are currently being executed, and the programs received from the engineering tool 200 are a first update program PRG11 that updates the first program PRG1 and a third update program PRG13 that updates the third program PRG3. In this case, the program storage management unit 151 determines that the program storage memory 120 storing the currently executing programs is the first program storage memory 121. Next, the program write control unit 154 synchronizes the information of the programs PRG1 to PRG3 by storing the programs PRG1 to PRG3 stored in the first program storage memory 121 in the second program storage memory 122 as well. Then, the program write control unit 154 stores the received update programs PRG11 and PRG13 in an available area of ​​the second program storage memory 122.

[0041] 2 , when the program write control unit 154 successfully writes an update program during program execution, the program execution management unit 152, which is an example of a program execution determination unit, determines whether the program execution memory 130 in which the running program is deployed is the first program execution memory 131 or the second program execution memory 132. For example, when a program execution memory flag (not shown) indicates a value of "1," the program execution management unit 152 determines that the program execution memory 130 in which the running program is deployed is the first program execution memory 131. On the other hand, when the program execution memory flag indicates a value of "2," the program execution management unit 152 determines that the program execution memory 130 in which the running program is deployed is the second program execution memory 132.

[0042] If the storage of the update program is successful, and the program execution management unit 152 determines that the first program execution memory 131 is the target, the program deployment control unit 155 deploys the update program stored in the second program storage memory 122 to the second program execution memory 132. The program deployment control unit 155 then deploys the running program that has not been updated and that has been deployed in the first program execution memory 131 to the second program execution memory 132. On the other hand, in this case, if the program execution management unit 152 determines that the second program execution memory 132 is the target, the program deployment control unit 155 deploys the update program stored in the first program storage memory 121 to the first program execution memory 131. The program deployment control unit 155 then deploys the running program that has not been updated and that has been deployed in the second program execution memory 132 to the first program execution memory 131.

[0043] 6 , after the second program storage memory 122 has successfully stored the update programs PRG11 and PRG13, the program deployment control unit 155 deploys the first update program PRG11 stored in the second program storage memory 122 from the first address 0000H to the second address 0110H, which is an example of a first memory area of ​​the second program execution memory 132. The program deployment control unit 155 also deploys the third update program PRG13 stored in the second program storage memory 122 from the second address 0110H to the third address 0220H, which is an example of a first memory area of ​​the second program execution memory 132. The program deployment control unit 155 then deploys the second program PRG2 stored in the first program execution memory 131 from the third address 0220H to the fourth address 0320H, which is an example of a second memory area of ​​the second program execution memory 132. That is, the program expansion control unit 155 expands the programs PRG11, PRG13, and PRG2 consecutively from the first address 0000H to the fourth address 0320H in the second program execution memory 132.

[0044] 2 , when program deployment control unit 155 controls the deployment of an update program during program execution, management information storage management unit 153, as an example of a management information storage determination unit, determines whether management information storage unit 140 storing the management table used in the running program is first management information storage unit 141 or second management information storage unit 142. For example, when a management information storage flag (not shown) indicates a value of “1,” management information storage management unit 153 determines that management information storage unit 140 storing the management table used in the running program is first management information storage unit 141. On the other hand, when the management information storage flag indicates a value of “2,” program storage management unit 151 determines that management information storage unit 140 storing the management table used in the running program is second management information storage unit 142.

[0045] In this case, if the determination result of management information storage management unit 153 is first management information storage unit 141, management information generation unit 156 generates a management table indicating the allocation addresses of the update programs expanded in second program execution memory 132, and stores the generated management table in second management information storage unit 142. On the other hand, in this case, if the determination result of management information storage management unit 153 is second management information storage unit 142, management information generation unit 156 generates a management table indicating the allocation addresses of the update programs expanded in first program execution memory 131, and stores the generated management table in first management information storage unit 141.

[0046] Specifically, as shown in FIG. 6, the management information generation unit 156 generates a management table indicating that the starting location address of the first update program PRG11 is the first address 0000H, the starting location address of the second program PRG2 is the second address 0220H, and the starting location address of the third update program PRG13 is the third address 0110H, and stores the generated management table in the second management information storage unit 142.

[0047] 2 , when program execution unit 157 is executing a program expanded in first program execution memory 131 by using the management table stored in first management information storage unit 141, update program switching control unit 158 ​​causes program execution unit 157 to execute an update program expanded in second program execution memory 132 by using the management table stored in second management information storage unit 142. Furthermore, when program execution unit 157 is executing a program expanded in second program execution memory 132 by using the management table stored in second management information storage unit 142, update program switching control unit 158 ​​causes program execution unit 157 to execute an update program expanded in first program execution memory 131 by using the management table stored in first management information storage unit 141.

[0048] 6 , the update program switching control unit 158 ​​switches the program execution memory 130 and management information storage unit 140 referenced by the program execution unit 157. Specifically, the update program switching control unit 158 ​​changes the volatile memory used by the program execution unit 157 from the first volatile memory to the second volatile memory. As a result, the program execution unit 157 identifies from the management table stored in the second management information storage unit 142 that the leading allocation addresses of the programs PRG11, PRG2, and PRG13 are addresses 0000H, 0220H, and 0110H, respectively, and stops execution of the programs PRG1 to PRG3 and executes the programs PRG11, PRG2, and PRG13 whose storage locations in the second program execution memory 132 have been identified. After executing each of the programs PRG11, PRG2, and PRG13, the update program switching control unit 158 ​​updates the values ​​indicated by the program storage memory flag, the program execution memory flag, and the management information storage flag from "1" to "2."

[0049] (Flowchart of update program switching control process) Next, a description will be given of control for supporting program development by the program development support system 1, using a flowchart. Here, the process of transmitting a program generated or updated by the engineering tool 200 to the PLC 100 involves the program generation unit 210 generating or updating a program based on a user operation and storing the program in the program storage unit 220, and then the program transmission unit 230 transmitting the generated or updated program to the PLC 100.

[0050] Furthermore, with regard to the process in which PLC 100 executes a program, the program receiving unit 110 receives the program's executable file from the engineering tool 200, the program writing control unit 154 stores the program in the first program storage memory 121, the program expansion control unit 155 expands the program in the first program execution memory 131, the management information generation unit 156 generates a management table and stores it in the first management information storage unit 141, and then the program execution unit 157 executes the program using the management table.

[0051] Therefore, in order to reduce redundant explanation, illustrations and detailed explanations of the above-mentioned processing will be omitted, and the following description will focus on the control of switching the program being executed by the PLC 100 to the update program. When the program execution unit 157 starts executing the program, the PLC 100 starts executing the update program switching control processing shown in FIG.

[0052] First, the program receiving unit 110 receives an update program (step S101). For example, if a user determines that there is a problem with the operation of the PLC 100 while each of the programs PRG1 to PRG3 is being executed and modifies and updates each of the programs PRG1 and PRG3, the program receiving unit 110 receives a first update program PRG11 and a third update program PRG13 from the engineering tool 200.

[0053] Next, the program storage management unit 151 determines whether the program storage memory 120 used to expand the currently running programs is the first program storage memory 121 or the second program storage memory 122 (step S102). For example, if the value indicated by the program storage memory flag is "1", the program storage management unit 151 determines that the first program storage memory 121 was used to expand each of the currently running programs PRG1 to PRG3.

[0054] Next, the program write control unit 154 synchronizes the contents stored in the program storage memory 120 based on the determination result of the program storage management unit 151 (step S103). For example, the program write control unit 154 stores each of the programs PRG1 to PRG3 stored in the first program storage memory 121 in the second program storage memory 122 as well.

[0055] Next, the program writing control unit 154 stores the update programs in the program storage memory 120 based on the determination result of the program storage management unit 151 (step S104). For example, the program writing control unit 154 stores the update programs PRG11 and PRG13 in the second program storage memory 122.

[0056] Next, the program execution management unit 152 determines whether the program execution memory 130 in which the currently executing program is deployed is the first program execution memory 131 or the second program execution memory 132 (step S105). For example, if the value indicated by the program execution memory flag is "1", the program execution management unit 152 determines that the currently executing programs PRG1 to PRG3 are deployed in the first program execution memory 131.

[0057] Next, the program deployment control unit 155 deploys the update programs stored in the program storage memory 120 in the program execution memory 130 based on the determination result of the program execution management unit 152 (step S106). For example, the program deployment control unit 155 deploys the update programs PRG11, PRG13 from the second program storage memory 122 consecutively from the first address 0000H to the third address 0220H of the second program execution memory 132.

[0058] Next, the program loading control unit 155 loads the unupdated programs that have been loaded based on the determination result of the program execution management unit 152 into the program execution memory 130 (step S107). For example, the program loading control unit 155 loads the second program PRG2 from the first program execution memory 131 to the second program execution memory 132, from the third address 0220H to the fourth address 0320H, in a state where the second program PRG2 is continuous with the update programs PRG11 and PRG13.

[0059] Next, the management information storage manager 153 determines whether the management information storage unit 140 that stores the management table used in the currently running program is the first management information storage unit 141 or the second management information storage unit 142 (step S108). For example, if the value indicated by the management information storage flag is "1", the management information storage manager 153 determines that the first management information storage unit 141 stores the management table used in the currently running program.

[0060] Next, the management information generation unit 156 generates a management table indicating the allocation addresses of the update programs expanded in the program execution memory 130 based on the determination result of the management information storage management unit 153, and stores the management table in the management information storage unit 140 (step S109). For example, the management information generation unit 156 generates a management table indicating that the starting allocation address of the first update program PRG11 is the first address 0000H, the starting allocation address of the second program PRG2 is the second address 0220H, and the starting allocation address of the third update program PRG13 is the third address 0110H, and stores the generated management table in the second management information storage unit 142.

[0061] Next, the update program switching control unit 158 ​​switches the program execution memory 130 and the management information storage unit 140 used by the program execution unit 157 (step S110). For example, the update program switching control unit 158 ​​changes the volatile memory used by the program execution unit 157 from the first volatile memory to the second volatile memory.

[0062] The program execution unit 157 also executes the updated programs and the unupdated programs that have not been updated (step S111). For example, the program execution unit 157 identifies from the management table stored in the second management information storage unit 142 that the starting addresses of the programs PRG11, PRG2, and PRG13 are addresses 0000H, 0220H, and 0110H, respectively, and then stops the execution of the programs PRG1 to PRG3 and executes the programs PRG11, PRG2, and PRG13 whose storage locations in the second program execution memory 132 have been identified.

[0063] Then, the update program switching control unit 158 ​​updates the values ​​indicated by the program storage memory flag, the program execution memory flag, and the management information storage flag (step S112), and returns to step S101. For example, the update program switching control unit 158 ​​updates the values ​​indicated by the program storage memory flag, the program execution memory flag, and the management information storage flag from "1" to "2."

[0064] As described above, according to the program development support system 1 of this embodiment, in the PLC 100, the program expansion control unit 155 controls the expansion of a program stored in the program storage memory 120 into the program execution memory 130. Furthermore, the program execution unit 157 executes the program expanded in the program execution memory 130. Furthermore, the program write control unit 154 controls the writing of an update program to be stored in the program storage memory 120 while the program is being executed.

[0065] Here, the program storage memory 120 is made up of nonvolatile memory and includes a first program storage memory 121 made up of a first nonvolatile memory and a second program storage memory 122 made up of a second nonvolatile memory, while the program execution memory 130 is made up of volatile memory and includes a first program execution memory 131 made up of a first volatile memory and a second program execution memory 132 made up of a second volatile memory.

[0066] Furthermore, when the program storage memory 120 used to expand the currently running program is the first program storage memory 121, the program write control unit 154 stores the updated program in the second program storage memory 122. Furthermore, when the program execution memory 130 in which the currently running program is expanded is the first program execution memory 131, the program expansion control unit 155 expands the updated program from the second program storage memory 122 to the second program execution memory 132 when the second program storage memory 122 has successfully stored the updated program.

[0067] In this way, PLC 100 according to this embodiment stores the received update program in program storage memory 120 configured as a nonvolatile memory, so that even if a power outage occurs, the received update program can be stored in program storage memory 120. As a result, PLC 100 according to this embodiment does not require a measure to enable information to be stored in program execution memory 130 configured as a volatile memory in the event of a power outage.

[0068] Furthermore, according to the program development support system 1 of this embodiment, when the program execution unit 157 is executing a program expanded in the first program execution memory 131, the update program switching control unit 158 ​​performs switching control to cause the program execution unit 157 to execute an update program expanded in the second program execution memory 132.

[0069] As described above, in the PLC device described in Patent Document 1, the currently running program deployed in the third memory is updated to an update program before the update program is executed, and when the update to the update program starts, the execution of the currently running program stops. Therefore, in the PLC device described in Patent Document 1, there is a problem in that program execution stops between the start of the update to the update program and the start of execution of the update program.

[0070] In particular, the PLC device described in Patent Document 1 has a problem in that the period during which program execution is stopped is extended because the updated program is deployed from the first memory configured as a non-volatile flash memory to the third memory configured as a volatile RAM. Therefore, the PLC device described in Patent Document 1 has a problem in that the period during which program execution is stopped is extended, which makes it more likely that the control timing of the FA device will be out of sync, causing the FA device to emit an alarm or, in some cases, break down.

[0071] In contrast, the PLC 100 according to this embodiment deploys the update program in the second program execution memory 132, which is not used for program execution. In this manner, the PLC 100 according to this embodiment can prevent execution of the pre-rewritten program from being stopped even when the deployment of the update program begins. Furthermore, the PLC 100 according to this embodiment switches the program execution memory 130 used for program execution from the first program execution memory 131 to the second program execution memory 132 after the deployment of the update program and the generation and storage of the management table are completed, thereby significantly shortening the processing time for the switching control. In this manner, the PLC 100 according to this embodiment can switch from the execution of the pre-rewritten program to the execution of the post-rewritten update program more quickly than a PLC that does not switch the program execution memory from the first program execution memory to the second program execution memory.

[0072] As a result, the PLC 100 according to this embodiment can reduce the time for which program execution is stopped when the program is rewritten. As a result, the PLC 100 according to this embodiment is less likely to experience deviations in the control timing of the FA devices controlled by the update program, and can reduce events such as the generation of warning sounds from the FA devices and breakdowns in the FA devices.

[0073] Furthermore, the PLC device described in Patent Document 1 stores the received update program in a second memory configured with a non-volatile flash memory. The update program stored in the second memory is then copied to a first memory configured with a non-volatile flash memory, and the update program copied to the first memory is then loaded into a third memory. Therefore, the PLC device described in Patent Document 1 has a problem in that it takes a long time from when the update program is received until when it is loaded into the third memory.

[0074] In contrast, PLC 100 according to the present embodiment stores the received update program in second program storage memory 122, which is not used for program execution, and then deploys the update program in second program execution memory 132. In this manner, PLC 100 according to the present embodiment can shorten the period from receiving the update program to deploying the update program in the program execution memory, compared to a PLC that needs to copy the update program to non-volatile memory between storing the received update program in the program storage memory and deploying the update program in the program execution memory.

[0075] In recent years, structured programming has become the mainstream programming method for PLCs. In structured programming, variables such as global variables and local variables are used in programs instead of traditional devices. Global variables, in particular, are common variables used by multiple programs. Therefore, when a programmer modifies or updates a global variable, they must also modify or update all programs that use that global variable. For this reason, the number of programs that need to be modified or updated at one time has tended to increase in recent PLC programming.

[0076] As a result, the PLC device described in Patent Document 1 has problems in that as the number of programs to be modified or updated at one time increases, the period during which program execution is stopped and the period from receiving an update program to loading the update program into the program execution memory become longer. In contrast, the PLC 100 according to the present embodiment can shorten these periods when the number of programs to be updated increases more than the PLC device described in Patent Document 1.

[0077] Furthermore, according to the program development support system 1 of this embodiment, the management information generation unit 156 generates a management table, which is information for managing program execution, and stores the management table in the management information storage unit 140. The program execution unit 157 executes the program deployed in the program execution memory 130 using the management table stored in the management information storage unit 140. The management information generation unit 156 generates a management table for managing the execution of an update program, and, when the management information storage unit 140 that stores the management table used in the program being executed is the first management information storage unit 141, stores the generated management table in the second management information storage unit 142. When the program execution unit 157 is executing the program deployed in the first program execution memory 131 using the management table stored in the first management information storage unit 141, the update program switching control unit 158 ​​performs switching control to cause the program execution unit 157 to execute the update program deployed in the second program execution memory 132 using the management table stored in the second management information storage unit 142.

[0078] In this manner, PLC 100 according to the present embodiment stores a newly generated management table in second management information storage unit 142, which is not used for program execution, so that execution of the pre-rewritten program does not stop even when generation of the management table is started. Furthermore, PLC 100 according to the present embodiment switches management information storage unit 140 used for program execution from first management information storage unit 141 to second management information storage unit 142 after completing generation and storage of the management table, thereby significantly shortening the processing time for switching control. In this manner, PLC 100 according to the present embodiment can reduce the time required to generate and store a management table compared to a PLC that does not switch the management information storage unit from the first management information storage unit to the second management information storage unit, thereby further reducing the time required to switch from execution of the pre-rewritten program to execution of the updated program after rewriting.

[0079] Furthermore, according to the program development support system 1 of this embodiment, the programs include a first program PRG1 and a third program PRG3, and the update programs include a first update program PRG11 obtained by updating the first program PRG1, and a third update program PRG13 obtained by updating the third program PRG3. Furthermore, when the first program storage memory 121 is used to expand each of the programs PRG1 to PRG3 that are being executed, the program write control unit 154 stores the first update program PRG11 and the third update program PRG13 in the second program storage memory 122.

[0080] Furthermore, when the second program storage memory 122 has successfully stored the first update program PRG11 and the third update program PRG13, in a case where the currently executing programs PRG1 to PRG3 are expanded in the first program execution memory 131, the program expansion control unit 155 expands the first update program PRG11 and the third update program PRG13 from the second program storage memory 122 to the second program execution memory 132. Furthermore, the management information generation unit 156 generates a management table for managing the execution of the first update program PRG11 and the third update program PRG13, and, in a case where the first management information storage unit 141 stores the management tables used in the currently executing programs PRG1 to PRG3, causes the second management information storage unit 142 to store the generated management table.

[0081] Then, when the program execution unit 157 is executing the first program PRG1 and the third program PRG3 expanded in the first program execution memory 131 using the management table stored in the first management information storage unit 141, the update program switching control unit 158 ​​causes the program execution unit 157 to execute the first update program PRG11 and the third update program PRG13 expanded in the second program execution memory 132 using the management table stored in the second management information storage unit 142.

[0082] In this way, even when PLC 100 according to the present embodiment receives multiple update programs, it can switch from executing the program before rewriting to executing the update program after rewriting with a single switch control. As a result, PLC 100 according to the present embodiment can shorten the time for stopping program execution when rewriting a program compared to a PLC that cannot switch from executing the program before rewriting to executing the update program after rewriting with a single switch control when multiple update programs are received, and can further shorten the time for stopping program execution when the number of programs to be updated increases.

[0083] Furthermore, according to the program development support system 1 of this embodiment, the program further includes a second program PRG2. Furthermore, when the first program storage memory 121 is used to expand each of the currently running programs PRG1 to PRG3, the program write control unit 154 stores each of the update programs PRG11 and PRG13 in the second program storage memory 122.

[0084] In addition, when the programs PRG1 to PRG3 currently being executed are expanded in the first program execution memory 131, when the second program storage memory 122 successfully stores the update programs PRG11 and PRG13, the program expansion control unit 155 expands the update programs PRG11 and PRG13 from the second program storage memory 122 to the second program execution memory 132, and expands the second program PRG2 from the first program execution memory 131 to the second program execution memory 132.

[0085] Furthermore, the management information generation unit 156 generates a management table for managing the execution of each of the update programs PRG11, PRG13 and the second program PRG2, and, when the first management information storage unit 141 stores the management table used in each of the programs PRG1 to PRG3 being executed, stores the generated management table in the second management information storage unit 142. Then, when the program execution unit 157 is executing each of the programs PRG1 to PRG3 expanded in the first program execution memory 131 using the management table stored in the first management information storage unit 141, the update program switching control unit 158 ​​causes the program execution unit 157 to execute each of the update programs PRG11, PRG13 and the second program PRG2 expanded in the second program execution memory 132 using the management table stored in the second management information storage unit 142.

[0086] In this way, when PLC 100 according to the present embodiment has not received all update programs for the currently running program, the program can be deployed from first program execution memory 131, which is used to execute second program PRG2 that is not updated, to second program execution memory 132 that is not used to execute second program PRG2. As a result, PLC 100 according to the present embodiment can shorten the time it takes to deploy the program compared to a PLC in which a program that is not updated is deployed from the first program storage memory or second program storage memory configured with non-volatile memory to the second program execution memory.

[0087] In particular, according to the program development support system 1 of this embodiment, the program expansion control unit 155 expands the update programs PRG11 and PRG13 consecutively from the first address 0000H to the third address 0220H, which is the first memory area of ​​the second program execution memory 132. Then, the program expansion control unit 155 expands the second program PRG2 consecutively from the third address 0220H to 0320H, which is the second memory area subsequent to the first memory area of ​​the second program execution memory 132.

[0088] In this way, the PLC 100 according to this embodiment can load the update programs PRG11 and PRG13 and the unupdated second program PRG2 in a continuous state from the first memory area to the second memory area, thereby preventing fragmentation of the program execution memory 130 even when the PLC 100 repeatedly receives update programs.

[0089] Consider a PLC that not only synchronizes program storage memory 120 before writing a program, but also synchronizes program execution memory 130 before controlling program deployment. Assume that this PLC receives a second update program PRG12 that updates second program PRG2 while executing programs PRG1 to PRG3, and that the file size of second update program PRG12 is larger than that of second program PRG2. In this case, as shown in FIG. 8 , when this PLC deploys second update program PRG12 in second program execution memory 132, the memory area in second program execution memory 132 that previously stored second program PRG2 becomes free space. Therefore, even if this PLC deploys second update program PRG12 contiguous to third program PRG3, memory fragmentation occurs due to the free space that previously stored second program PRG2.

[0090] In contrast, the PLC 100 according to this embodiment does not synchronize the program execution memory 130 before controlling the program deployment. Therefore, as shown in Fig. 9, the PLC 100 according to this embodiment deploys the second update program PRG12 and then deploys the unupdated programs PRG1 and PRG3 in a state where they are contiguous to the second update program PRG12, thereby preventing memory fragmentation. As a result, the PLC 100 according to this embodiment can reduce the shortage of available memory area due to memory fragmentation more effectively than a PLC that synchronizes the program execution memory 130 before controlling the program deployment.

[0091] Furthermore, according to the program development support system 1 of this embodiment, the program storage management unit 151 determines whether the program storage memory 120 used to expand the currently executing program is the first program storage memory 121 or the second program storage memory 122. Furthermore, the program execution management unit 152 determines whether the program execution memory 130 in which the currently executing program is expanded is the first program execution memory 131 or the second program execution memory 132. Then, the management information storage management unit 153 determines whether the management information storage unit 140 that stores the management table used in the currently executing program is the first management information storage unit 141 or the second management information storage unit 142.

[0092] In this way, the PLC 100 of this embodiment can distinguish and manage, during program execution, valid program storage memory 120, program execution memory 130, and management information storage unit 140 that are being used to execute the program, and invalid program storage memory 120, program execution memory 130, and management information storage unit 140 that are not being used to execute the program.

[0093] (Modification) In the above embodiment, after program receiving unit 110 receives an update program, program writing control unit 154 synchronizes the program information stored in first program storage memory 121 and second program storage memory 122. However, the timing for synchronizing the program information is not limited to this. For example, program writing control unit 154 may synchronize the program information stored in first program storage memory 121 and second program storage memory 122 after program execution unit 157 executes the program and update program.

[0094] As in the above embodiment, it is preferable that program deployment control unit 155 deploys update programs on the condition that program write control unit 154 has successfully stored all update programs, but this is not limiting. For example, if program write control unit 154 has successfully stored at least one of the update programs received, program deployment control unit 155 may deploy the successfully stored update program.

[0095] As in the above embodiment, it is preferable that the program load control unit 155 loads the second program PRG2, which is not updated, from the first program execution memory 131, which is a volatile memory, to the second program execution memory 132. However, this is not limiting. For example, the program load control unit 155 may load the second program PRG2, which is not updated, from the first program storage memory 121 or the second program storage memory 122, which is a non-volatile memory, to the second program execution memory 132.

[0096] In the above embodiment, the update program switching control unit 158 ​​updates the values ​​indicated by the program storage memory flag, the program execution memory flag, and the management information storage flag between "1" and "2." However, the number of flags is not limited to this. For example, because the program execution memory 130 and the management information storage unit 140 are configured from the same volatile memory, the update program switching control unit 158 ​​may update the value indicated by the volatile memory flag, which is an integration of the program execution memory flag and the management information storage flag, between "1" and "2." In this case, the program execution management unit 152 and the management information storage management unit 153 need to manage the program execution memory 130 and the management information storage unit 140 based on the values ​​indicated by the volatile memory flag updated by the update program switching control unit 158. Furthermore, for example, the update program switching control unit 158 ​​may update the value indicated by the switching flag, which is an integration of the program storage memory flag, the program execution memory flag, and the management information storage flag, between "1" and "2." In this case, the program storage management unit 151, the program execution management unit 152, and the management information storage management unit 153 need to manage the program storage memory 120, the program execution memory 130, and the management information storage unit 140 based on the value indicated by the switching flag updated by the update program switching control unit 158.

[0097] In the above embodiment, the update program switching control unit 158 ​​updates the program storage memory flag, the program execution memory flag, and the management information storage flag. However, updating of these flags is not limited to the update program switching control unit 158. For example, the program write control unit 154 or the program storage management unit 151 may update the program storage memory flag after the program write control unit 154 controls writing to the program storage memory 120. Also, for example, the program deployment control unit 155 or the program execution management unit 152 may update the program execution memory flag after the program deployment control unit 155 controls the deployment of an update program in the program execution memory 130. Also, for example, the management information generation unit 156 or the management information storage management unit 153 may update the management information storage flag after the management information generation unit 156 generates a management table and stores it in the management information storage unit 140.

[0098] In the above embodiment, the program receiving unit 110 receives, as update programs, a first update program PRG11 obtained by updating the first program PRG1 and a third update program PRG13 obtained by updating the third program PRG3. However, the update programs are not limited to this. For example, the program receiving unit 110 may receive, as update programs, a second update program PRG12 obtained by updating the second program PRG2. When the program receiving unit 110 receives the first update program PRG11 and the second update program PRG12 as update programs, the above-mentioned "third update program PRG13" can be read as "second update program PRG12" in controlling the PLC 100. Therefore, to reduce redundant description, illustrations and detailed description of a case in which the program receiving unit 110 receives the first update program PRG11 and the second update program PRG12 as update programs will be omitted.

[0099] In the above embodiment, program storage memory 120 is two memories, first program storage memory 121 and second program storage memory 122, but the present invention is not limited to this and may be three or more memories. In this case, program storage management unit 151 needs to manage three or more memories as program storage memory 120, program write control unit 154 needs to be able to control writing to three or more memories as program storage memory 120, and update program switching control unit 158 ​​needs to control switching between three or more memories as program storage memory 120.

[0100] In the above embodiment, program execution memory 130 is two memories, first program execution memory 131 and second program execution memory 132, but the present invention is not limited to this and may be three or more memories. In this case, program execution management unit 152 needs to manage three or more memories as program execution memory 130, program deployment control unit 155 needs to be able to control deployment to three or more memories as program execution memory 130, and update program switching control unit 158 ​​needs to control switching between three or more memories as program execution memory 130.

[0101] In the above embodiment, management information storage unit 140 includes two storage units, first management information storage unit 141 and second management information storage unit 142. However, the present invention is not limited to this and may include three or more storage units. In this case, management information storage management unit 153 needs to manage three or more memories as management information storage unit 140, management information generation unit 156 needs to be able to store the generated management table in three or more memories as management information storage unit 140, and update program switching control unit 158 ​​needs to control switching between three or more storage units as management information storage unit 140.

[0102] In the above embodiment, the first management information storage unit 141 is configured as a specific area in a first volatile memory that constitutes the first program execution memory 131, and the second management information storage unit 142 is configured as a specific area in a second volatile memory that constitutes the second program execution memory 132, but the configuration of each management information storage unit 141, 142 is not limited to this. For example, the first management information storage unit 141 and the second management information storage unit 142 may be configured as a first specific area and a second specific area in a third volatile memory.

[0103] The PLC 100, which is the core of the processing performed by the PLC 100 including the control unit 51, main memory unit 52, external memory unit 53, operation unit 54, transmission / reception unit 56, internal bus 50, etc., may be configured to execute the above-described processing by, for example, storing and distributing a program for executing the above-described operations in a recording medium readable by the PLC 100, such as a flash memory, and installing the program. Alternatively, the program may be stored in a storage device of a server device on a communication network such as a LAN (Local Area Network) or the Internet, and the PLC 100 may download the program to configure a computer.

[0104] Furthermore, when the functions of PLC 100 are realized by sharing the functions of an OS (operating system) and an application program, or by cooperation between the OS and the application program, only the application program portion may be stored in a recording medium or storage device.

[0105] The program may also be superimposed on a carrier wave and provided via a communication network. For example, the program may be posted on a bulletin board system (BBS) on the communication network and provided via the network. The program may then be started and executed under the control of the OS in the same way as other application programs, thereby executing the above-described processing.

[0106] The present disclosure allows various embodiments and modifications without departing from the broad spirit and scope of the present disclosure. Furthermore, the above-described embodiments are intended to explain the present disclosure and do not limit the scope of the present disclosure. In other words, the scope of the present disclosure is defined by the claims, not the embodiments. Various modifications made within the scope of the claims and the meaning of equivalent disclosures are considered to be within the scope of the present disclosure.

[0107] 1...Program development support system, 50...Internal bus, 51...Control unit, 52...Main memory unit, 53...External memory unit, 54...Operation unit, 55...Display unit, 56...Transmitting / receiving unit, 59...Control program, 100...PLC, 110...Program receiving unit, 120...Program storage memory, 121...First program storage memory, 122...Second program storage memory, 130...Program execution memory, 131...First program execution memory, 132...Second program execution memory, 140...Management information storage unit, 141...first management information storage unit, 142...second management information storage unit, 151...program storage management unit, 152...program execution management unit, 153...management information storage management unit, 154...program write control unit, 155...program deployment control unit, 156...management information generation unit, 157...program execution unit, 158...update program switching control unit, 200...engineering tool, 210...program generation unit, 211...compile execution unit, 220...program storage unit, 230...program transmission unit.

Claims

1. A system comprising: a program storage memory capable of storing a program; a program execution memory used when executing the program; a program deployment control unit which controls the deployment of the program stored in the program storage memory into the program execution memory; a program execution unit which executes the program deployed into the program execution memory; and a program write control unit which controls writing to store an update program, which is the program updated during execution of the program, into the program storage memory; wherein the program storage memory includes a first program storage memory and a second program storage memory different from the first program storage memory; the program execution memory includes a first program execution memory and a second program execution memory different from the first program execution memory; when the program storage memory used to deploy the program being executed is the first program storage memory, the program write control unit stores the update program in the second program storage memory; and when the program execution memory in which the program being executed is deployed is the first program execution memory, the program deployment control unit deploys the update program from the second program storage memory into the second program execution memory when the second program storage memory has successfully stored the update program; an update program switching control unit that performs switching control to cause the program execution unit to execute the update program expanded in the second program execution memory when the program execution unit is executing the program expanded in the first program execution memory.

2. A programmable logic controller as claimed in claim 1, further comprising: a management information generation unit that generates management information which is information for managing the execution of the program; and a management information storage unit that stores the management information, wherein the program execution unit executes the program expanded in the program execution memory using the management information stored in the management information storage unit, the management information storage unit includes a first management information storage unit and a second management information storage unit different from the first management information storage unit, wherein the management information generation unit generates the management information for managing the execution of the update program, and when the management information storage unit that stores the management information used in the program being executed is the first management information storage unit, causes the generated management information for managing the execution of the update program to be stored in the second management information storage unit, and wherein the update program switching control unit, when the program execution unit is executing the program expanded in the first program execution memory using the management information stored in the first management information storage unit, performs the switching control to cause the program execution unit to execute the update program expanded in the second program execution memory using the management information stored in the second management information storage unit.

3. A programmable logic controller as described in claim 1, further comprising: a program storage determination unit that determines whether the program storage memory used to expand the program being executed is the first program storage memory or the second program storage memory; and a program execution determination unit that determines whether the program execution memory in which the program being executed is expanded is the first program execution memory or the second program execution memory.

4. The programmable logic controller according to claim 1, wherein the program includes a first program and a second program different from the first program, the update programs include a first update program which is the updated first program, and a second update program which is the updated second program, the program write control unit, when the program storage memory used to expand the first program and the second program being executed is defined as the first program storage memory, stores the first update program and the second update program in the second program storage memory, the program expansion control unit, when the program execution memory in which the first program and the second program being executed are expanded is defined as the first program execution memory, expands the first update program and the second update program from the second program storage memory to the second program execution memory when the second program storage memory has successfully stored the first update program and the second update program, and the update program switching control unit, when the program execution unit is executing the first program and the second program expanded in the first program execution memory, causes the program execution unit to execute the first update program and the second update program expanded in the second program execution memory.

5. The programmable logic controller according to claim 1, wherein the program includes a first program and a second program different from the first program, the updating program is a first updating program which is an updated first program, the program writing control unit, when the program storage memory used to expand the first program and the second program being executed is defined as the first program storage memory, stores the first updating program in the second program storage memory, the program expansion control unit, when the program execution memory in which the first program and the second program being executed are expanded is defined as the first program execution memory, expands the first updating program from the second program storage memory to the second program execution memory and expands the second program from the first program execution memory to the second program execution memory when the second program storage memory has successfully stored the first updating program, and the update program switching control unit, when the program execution unit is executing the first program and the second program expanded in the first program execution memory, causes the program execution unit to execute the first updating program and the second program expanded in the second program execution memory.

6. The programmable logic controller according to claim 5, wherein the program expansion control unit expands the first update program into a first memory area of ​​the second program execution memory, and then expands the second program into a second memory area that is continuous with and follows the first memory area of ​​the second program execution memory.

7. A method for controlling a programmable logic controller, comprising: a program expansion control step in which the programmable logic controller controls the expansion of a program stored in a program storage memory capable of storing a program, into a program execution memory used when executing the program; a program execution step in which the programmable logic controller executes the program expanded in the program execution memory; and a program write control step in which the programmable logic controller controls writing to store in the program storage memory an update program, which is the program updated during execution of the program; wherein the program storage memory comprises a first program storage memory and a second program storage memory different from the first program storage memory, and the program execution memory comprises a first program execution memory and a second program execution memory different from the first program execution memory, and in the program write control step, when the program storage memory used to expand the program being executed is the first program storage memory, the update program is stored in the second program storage memory, a program expansion control step of expanding the update program from the second program storage memory to the second program execution memory when the program execution memory in which the program being executed is expanded is the first program execution memory, and performing an update program switching control step of performing a switching control for executing the update program expanded in the second program execution memory when the programmable logic controller is executing the program expanded in the first program execution memory.

8. A programmable logic controller is caused to function as: a program deployment control unit which controls the deployment of a program stored in a program storage memory capable of storing a program, into a program execution memory used when executing the program; a program execution unit which executes the program deployed in the program execution memory; and a program write control unit which performs write control to store an update program, which is the program updated during execution of the program, into the program storage memory; wherein the program storage memory includes a first program storage memory and a second program storage memory different from the first program storage memory; and wherein the program execution memory includes a first program execution memory and a second program execution memory different from the first program execution memory; when the program storage memory used to deploy the program being executed is the first program storage memory, the program write control unit stores the update program in the second program storage memory; and when the program execution memory in which the program being executed is deployed is the first program execution memory, the program deployment control unit deploys the update program from the second program storage memory into the second program execution memory when the second program storage memory has successfully stored the update program; when the program execution unit is executing the program expanded in the first program execution memory, the program further functions as an update program switching control unit that performs switching control to cause the program execution unit to execute the update program expanded in the second program execution memory.

Citation Information

Patent Citations

  • Control system, support device of the same, and programmable control device

    JP2016099899A

  • Control device

    JP2019036043A

  • Process control system, process controller, and program update method

    JP2020052668A