Programmable logic controller, control method and program

JPWO2024189785A5Active Publication Date: 2025-02-19MITSUBISHI ELECTRIC CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023550654
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2025-02-19
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

Existing programmable logic controllers (PLCs) require program rewriting to be stopped during debugging, leading to increased debugging time and potential malfunctions due to prolonged program execution stops.

Method used

A programmable logic controller with dual program storage and execution memories, allowing simultaneous execution and updating of programs without stopping the current program, using a program expansion control unit to switch between memories for seamless program updates.

Benefits of technology

Reduces program execution stop time during rewriting, minimizing malfunctions and timing shifts in controlled equipment, and efficiently handling multiple program updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000022_0000
    Figure 00000022_0000
  • Figure 00000022_0001
    Figure 00000022_0001
  • Figure 00000022_0002
    Figure 00000022_0002
Patent Text Reader

Abstract

When the first program storage memory (121) is used to load a program, the program write control unit (154) stores the update program in the second program storage memory (122). When a program is loaded in the first program execution memory (131), the program load control unit (155) loads the update program in the second program execution memory (132). When the program execution unit (157) is executing a program loaded in the first program execution memory (131), the update program switching control unit (158) loads the program execution unit (157) to execute the update program loaded in the second program execution memory (132).
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

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

[0002] Conventionally, in program development, a so-called debugging task is performed to detect and correct errors and defects in the created program. In program development 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, corrects the program if there is a problem with the operation, and writes the corrected program to the PLC. The programmer then repeats checking the operation, correcting 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 demand for a technology that writes corrected programs while continuing operation of the PLC as much as possible.

[0003] Patent Document 1 discloses a PLC device that enables a program stored in the device to be rewritten during operation. In Patent Document 1, the PLC device includes a first memory configured with a non-volatile flash memory that stores the program, a second memory configured with a non-volatile flash memory for backing up the first memory, and a third memory configured with a volatile RAM (Random Access Memory) used when executing the program. In Patent Document 1, the PLC device writes a program to be rewritten during operation into the second memory, and if the writing is successful, copies the written program into the first memory, and then further expands the program into the third memory and starts it up. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2004-272629 A Summary of the Invention [Problem to be solved by the invention]

[0005] In the PLC device described in Patent Document 1, the running program before rewriting that is deployed in the third memory is overwritten with the rewritten program before starting. Therefore, in the PLC device described in Patent Document 1, when the deployment of the rewritten program starts, the execution of the program before rewriting stops, so there is a problem that program execution stops from the start of deployment of the rewritten program until the start of startup.

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

[0007] In order 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 in 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 performs write control to store an update program, which is a program updated during execution of the program, in 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 program being executed 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 program being executed is deployed is the first program execution memory, when the second program storage memory successfully stores the update program. The programmable logic controller further includes an update program switching control unit that performs switching control for causing the program execution unit to execute the update program loaded in the second program execution memory when the program execution unit is executing the program loaded in the first program execution memory, and the update program switching control unit performs the switching control by: The program execution memory used by the program execution unit is changed from the first program execution memory to the second program execution memory. Control the The program execution unit ends the execution of the program currently being executed that is expanded in the first program execution memory as a result of the change in the program execution memory based on the switching control, and starts the execution of the update program expanded in the second program execution memory. . Effect of the Invention

[0008] According to the present disclosure, the programmable logic controller deploys the update program in the second program execution memory that is not used for executing the program. Therefore, the programmable logic controller according to the present disclosure can prevent the execution of the program before the rewrite from stopping even when the deployment of the update program starts. Also, according to the present disclosure, after the deployment of the update program is completed, the programmable logic controller switches the program execution memory used for executing the program 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 the execution of the program before the rewrite to the execution of the update program after the rewrite 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 reduce the time for stopping the execution of the program when rewriting the program. [Brief description of the drawings]

[0009] [Figure 1] FIG. 1 is a block diagram showing a configuration of a program development support system according to a first embodiment. [Diagram 2] Block diagram showing the functional configuration of the program development support system [Diagram 3] Block diagram showing the hardware configuration of the PLC and engineering tool [Figure 4] FIG. 13 is a diagram showing an example of processing from receiving a program to storing a management table. [Diagram 5] A diagram showing an example of the process from receiving an update program to storing it [Figure 6] A diagram showing an example of processing from deploying an update program to storing a management table. [Figure 7] Flowchart showing the flow of update program switching control processing [Figure 8] A diagram showing an example of the process from synchronizing program execution memory to deploying the second update program [Figure 9] A diagram showing an example of the process from deploying the second update program to deploying the unupdated program without synchronizing the program execution memory DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, a programmable logic controller, a control method, and a program according to an embodiment of the present disclosure will be described in detail with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals. In addition, hereinafter, a "programmable logic controller" will be abbreviated as "PLC."

[0011] (About 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 operations. 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 programs. The PLC 100 and the engineering tool 200 are connected by a network that can transmit and receive information.

[0012] In the program development support system 1, the engineering tool 200 transmits a program generated by a user who is a programmer to the PLC 100, and the PLC 100 stores, expands, 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, corrects and updates the program, and the engineering tool 200 transmits an update program that is the updated program to the PLC 100, and the PLC 100 stores, expands, and executes the received update program. Then, in the program development support system 1, the user checks the operation, corrects and updates the program, the engineering tool 200 transmits the update program, and the PLC 100 receives, stores, expands, and executes the program, repeating the process until the operation of the PLC 100 becomes normal. In this way, the program development support system 1 can support the debugging of programs and can support the development of programs.

[0013] (About PLC100) 2, PLC 100 includes a program receiving unit 110 that receives a program. PLC 100 also includes a program storage memory 120 capable of storing a program, a program execution memory 130 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 deployment of programs, 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] (About Engineering Tool 200) 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] (About the hardware configuration of PLC100) 3, PLC 100 includes a control unit 51 that executes processing according to a control program 59. Control unit 51 includes a CPU (Central Processing Unit). In accordance with the 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 a program execution memory 130, a first program execution memory 131, a second program execution memory 132, a management information storage unit 140, a first management information storage unit 141, and a second management information storage unit 142, all of which are shown in FIG.

[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 stored by this 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 a program storage memory 120, a first program storage memory 121, and a 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 transmission / reception unit 56 that transmits and receives information. The transmission / reception unit 56 includes information communication components such as a communication network terminal device that connects to a network, a wireless communication device, etc. The transmission / reception unit 56 functions as the program reception unit 110 shown in FIG.

[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] Also, for example, PLC 100 executes a program execution management step as an example of a program execution determination step performed by program execution management section 152, and a management information storage management step as an example of a management information storage determination step performed by management information storage management section 153. Also, for example, PLC 100 executes a program write control step performed by program write control section 154, a program deployment control step performed by program deployment control section 155, and a management information generation step performed by management information generation section 156. Also, for example, PLC 100 executes a program execution step performed by program execution section 157, and an update program switching control step performed by update program switching control section 158.

[0025] (Hardware configuration of Engineering Tool 200) 3, the engineering tool 200 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, similar to the PLC 100. The control unit 51 functions as a program generation unit 210 and a compilation execution unit 211 shown in FIG. 2 according to a control program 59, the external memory unit 53 functions as a program storage unit 220, and the transmission / reception unit 56 functions as a program transmission unit 230. Returning to FIG. 3, the engineering tool 200 realizes the functions of the above-mentioned units 210, 211, 220, and 230 shown in FIG. 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 engineering tool 200 executes a program generation step performed by the program generation unit 210, a compilation execution step performed by the compilation execution unit 211, and a program transmission step performed by the program transmission unit 230.

[0026] (Details of the functional configuration of the Engineering Tool 200) Returning to FIG. 2, when the user performs an operation to write a program using the operation unit 54, the program generation unit 210 writes the program. 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 format of the program description is source code in the ST language, and is ladder diagram in the ladder language. Also, 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. Also, the program generation unit 210 causes the source file of the generated program and the executable file of the program after compilation to be stored in the program storage unit 220.

[0027] The program transmission unit 230 transmits to the PLC 100 the executable file of the program stored in the program storage unit 220. 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 correct 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 to the PLC 100 the executable file of the update program stored in the program storage unit 220.

[0028] (For details on the functional configuration of PLC100) The program receiving unit 110 receives an executable file of a program from the engineering tool 200. Furthermore, if a user modifies or updates a program while the program is being executed, the program receiving unit 110 receives an executable file of an update program from the engineering tool 200. Hereinafter, the executable file of a program will be simply referred to as a "program", and the executable file of an update program will be simply referred to as an "update program".

[0029] In this embodiment, the first program execution memory 131 is composed of a first volatile memory, and the second program execution memory 132 is composed of a second volatile memory separate from the first volatile memory. The first program storage memory 121 is composed of a first non-volatile memory, and the second program storage memory 122 is composed of a second non-volatile memory separate from the first non-volatile memory. The first management information storage unit 141 is composed of a specific area in the first volatile memory where the program is not loaded, and the second management information storage unit 142 is composed of 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 a 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. It is assumed that the first program storage memory 121 and the second program storage memory 122 are synchronized in a state where there is no information of the programs stored therein, as shown in Fig. 4. In this case, the program write control unit 154 stores the received programs PRG1 to PRG3 in the free area of ​​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 of 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 of the first program execution memory 131. Then, the program expansion control unit 155 expands the third program PRG3 stored in the first program storage memory 121 from the third address 0200H to the fourth address 0300H of 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 of the first program execution memory 131.

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

[0035] For example, as shown in FIG. 4, after each of the programs 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 address of the first program PRG1 is the first address 0000H, the starting address of the second program PRG2 is the second address 0100H, and the starting 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 expanded 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 expanded 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 identifies from the management table stored in the first management information storage unit 141 that the starting locations of the programs PRG1 to PRG3 are addresses 0000H, 0100H, and 0200H, respectively, and executes the programs PRG1 to PRG3 whose storage locations in the first program execution memory 131 have been identified.

[0038] Returning to Fig. 2, when program receiving unit 110 receives an update program while a program is being executed, program storage management unit 151 as an example of a program storage determination unit determines whether program storage memory 120 used to load the executing program is first program storage memory 121 or second program storage memory 122. For example, when a value indicated by a program storage memory flag (not shown) is "1", program storage management unit 151 determines that program storage memory 120 used to load the executing program is first program storage memory 121. On the other hand, when a value indicated by the program storage memory flag is "2", program storage management unit 151 determines that program storage memory 120 used to load the executing program is 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, a case will be considered in which the programs PRG1 to PRG3 are 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 that stores the programs being executed 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 the free area of ​​the second program storage memory 122.

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

[0042] When the storage of the update program is successful, if the determination result of the program execution management unit 152 is the first program execution memory 131, the program expansion control unit 155 expands the update program stored in the second program storage memory 122 to the second program execution memory 132. Then, the program expansion control unit 155 expands the running program that has not been updated and that has been expanded in the first program execution memory 131 to the second program execution memory 132. On the other hand, in this case, if the determination result of the program execution management unit 152 is the second program execution memory 132, the program expansion control unit 155 expands the update program stored in the first program storage memory 121 to the first program execution memory 131. Then, the program expansion control unit 155 expands the running program that has not been updated and that has been expanded 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 expansion control unit 155 expands the first update program PRG11 stored in the second program storage memory 122 from the first address 0000H to the second address 0110H as an example of the first memory area of ​​the second program execution memory 132. The program expansion control unit 155 also expands the third update program PRG13 stored in the second program storage memory 122 from the second address 0110H to the third address 0220H as an example of the first memory area of ​​the second program execution memory 132. Then, the program expansion control unit 155 expands the second program PRG2 stored in the first program execution memory 131 from the third address 0220H to the fourth address 0320H as an example of the second memory area of ​​the second program execution memory 132. That is, the program expansion control unit 155 expands each of the programs PRG11, PRG13, and PRG2 consecutively from the first address 0000H to the fourth address 0320H of the second program execution memory 132.

[0044] Returning to FIG. 2, when the program deployment control unit 155 controls the deployment of an update program during the execution of a program, the management information storage management unit 153 as an example of a management information storage determination unit determines whether the management information storage unit 140 storing the management table used in the program being executed is the first management information storage unit 141 or the second management information storage unit 142. For example, when the value indicated by the management information storage flag (not shown) is "1", the management information storage management unit 153 determines that the management information storage unit 140 storing the management table used in the program being executed is the first management information storage unit 141. On the other hand, when the value indicated by the management information storage flag is "2", the program storage management unit 151 determines that the management information storage unit 140 storing the management table used in the program being executed is the 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] Returning to Fig. 2, when the program execution unit 157 is executing a program expanded in the first program execution memory 131 by 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 update program expanded in the second program execution memory 132 by using the management table stored in the second management information storage unit 142. In addition, when the program execution unit 157 is executing a program expanded in the second program execution memory 132 by using the management table stored in the second management information storage unit 142, the update program switching control unit 158 ​​causes the program execution unit 157 to execute the update program expanded in the first program execution memory 131 by using the management table stored in the first management information storage unit 141.

[0048] For example, as shown in FIG. 6, the program execution unit 157 switches the program execution memory 130 and the management information storage unit 140 referred to. 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 that the head allocation addresses of the programs PRG11, PRG2, and PRG13 are addresses 0000H, 0220H, and 0110H, respectively, from the management table stored in the second management information storage unit 142, stops the execution of the programs PRG1 to PRG3, and executes the programs PRG11, PRG2, and PRG13 whose storage destinations in the second program execution memory 132 have been identified. After executing 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 control for supporting program development by the program development support system 1 will be described with reference to a flowchart. Here, the process of transmitting a program generated or updated by the engineering tool 200 to the PLC 100 is performed simply by the program generating unit 210 generating or updating a program based on a user's operation, storing the program in the program storage unit 220, and then the program transmitting unit 230 transmitting the generated or updated program to the PLC 100.

[0050] In addition, with regard to the process in which PLC 100 executes a program, the program receiving unit 110 receives the executable file of the program from the engineering tool 200, the program write 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 description, illustrations and detailed descriptions of the above-mentioned processing are omitted, and only the control of switching the program being executed by PLC 100 to the update program will be described below. When program execution unit 157 starts executing the program, 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, when the user determines that there is a problem in the operation of the PLC 100 during execution of each of the programs PRG1 to PRG3 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 judges whether the program storage memory 120 used to load 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 judges that the first program storage memory 121 has been used to load the currently running programs PRG1 to PRG3.

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

[0055] Next, the program write 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 write 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 judges whether the program execution memory 130 in which the currently executing program is loaded 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 judges that each of the currently executing programs PRG1 to PRG3 is loaded in the first program execution memory 131.

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

[0058] Next, the program loading control unit 155 loads the unupdated program that has 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 third address 0220H to the fourth address 0320H of the second program execution memory 132 in a state where it 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 storing the management table used in the program being executed 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 program being executed.

[0060] Next, the management information generating 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 managing unit 153, and stores the management table in the management information storage unit 140 (step S109). For example, the management information generating unit 156 generates a table indicating that the start allocation address of the first update program PRG11 is the first address 0000H, the start allocation address of the second program PRG2 is the second address 0220H, and the start allocation address of the third update program PRG13 is the third address 0110H, as the management table, and stores the 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] Furthermore, the program execution unit 157 executes the update program and the non-updated program that has not been updated (step S111). For example, the program execution unit 157 identifies that the top allocation addresses of the programs PRG11, PRG2, and PRG13 are addresses 0000H, 0220H, and 0110H, respectively, from the management table stored in the second management information storage unit 142, stops the execution of the programs PRG1 to PRG3, and executes the programs PRG11, PRG2, and PRG13 whose storage destinations 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 the program stored in the program storage memory 120 into the program execution memory 130. Furthermore, the program execution unit 157 executes the program expanded into the program execution memory 130. Furthermore, the program write control unit 154 performs write control to store an update program in the program storage memory 120 while the program is being executed.

[0065] Here, the program storage memory 120 is composed of non-volatile memory, and includes a first program storage memory 121 composed of a first non-volatile memory, and a second program storage memory 122 composed of a second non-volatile memory. On the other hand, the program execution memory 130 is composed of volatile memory, and includes a first program execution memory 131 composed of a first volatile memory, and a second program execution memory 132 composed of a second volatile memory.

[0066] Furthermore, when the program storage memory 120 used to expand the running program is the first program storage memory 121, the program write control unit 154 stores the update program in the second program storage memory 122. Furthermore, when the program execution memory 130 in which the running program is expanded is the first program execution memory 131, the program expansion control unit 155 expands the update 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 update program.

[0067] In this manner, PLC 100 according to the present embodiment stores the received update program in program storage memory 120 configured as a non-volatile 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 the present embodiment does not require a measure to enable information to be stored in program execution memory 130 configured as a volatile memory when a power outage occurs.

[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 the update program expanded in the second program execution memory 132.

[0069] As described above, in the PLC device described in Patent Document 1, the 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 is started, the execution of the running program is stopped. Therefore, in the PLC device described in Patent Document 1, there is a problem that the program execution is stopped from the start of the update to the update program until the execution of the update program is started.

[0070] In particular, the PLC device described in Patent Document 1 has a problem in that the period during which program execution is stopped becomes longer because an update program is deployed from a first memory configured as a non-volatile flash memory to a 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 becomes longer, which makes it easier for the control timing of the FA device to become out of sync, causing an alarm sound from the FA device and, in some cases, causing the FA device to break down.

[0071] In contrast, the PLC 100 according to the present embodiment deploys the update program in the second program execution memory 132 that is not used for program execution. In this way, the PLC 100 according to the present embodiment can prevent the execution of the program before rewriting from being stopped even when the deployment of the update program is started. In addition, after the deployment of the update program and the generation and storage of the management table are completed, the PLC 100 according to the present 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, so that the processing time of the switching control is extremely short. In this way, the PLC 100 according to the present embodiment can switch from the execution of the program before rewriting to the execution of the update program after rewriting 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 the present embodiment can reduce the time for which program execution is stopped when the program is rewritten. Therefore, the PLC 100 according to the present embodiment can reduce the occurrence of deviations in the control timing of the FA device controlled by the update program, and can reduce events such as the generation of warning sounds from the FA device and failures of the FA device.

[0073] In addition, the PLC device described in Patent Document 1 stores the received update program in a second memory configured with a non-volatile flash memory. After that, the update program stored in the second memory is copied to a first memory configured with a non-volatile flash memory, and then the update program copied to the first memory is expanded in a third memory. For this reason, 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 expanded in the third memory.

[0074] In contrast, PLC 100 according to the present embodiment stores the received update program in second program storage memory 122 that 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 when an update program is received to when the update program is deployed 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 conventional devices. Global variables in particular are common variables used in multiple programs, so when a programmer makes a modification or update that changes a global variable, the programmer must modify or update all programs that use that global variable. For this reason, there is a trend in recent PLC programming for an increasing number of programs to be modified or updated at one time.

[0076] As a result, the PLC device described in Patent Document 1 has a problem 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 deploying that update program in the program execution memory become longer. In contrast, the PLC 100 according to the present embodiment can reduce the time required for updating an increased number of programs compared to the PLC device described in Patent Document 1.

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

[0078] In this way, the PLC 100 according to the present embodiment stores the newly generated management table in the second management information storage unit 142 that is not used for the execution of the program, so that the execution of the program before the rewrite is not stopped even when the generation of the management table is started. In addition, after the generation and storage of the management table is completed, the PLC 100 according to the present embodiment switches the management information storage unit 140 used for the execution of the program from the first management information storage unit 141 to the second management information storage unit 142, so that the processing time for the switching control is extremely short. In this way, the PLC 100 according to the present embodiment can reduce the time required for generating and storing the 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, and can further reduce the time required for switching from the execution of the program before the rewrite to the execution of the update program after the rewrite.

[0079] Moreover, according to the program development support system 1 of this embodiment, the program includes the first program PRG1 and the third program PRG3, and the update program includes the first update program PRG11 obtained by updating the first program PRG1, and the 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 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, in a case where each of the programs PRG1 to PRG3 being executed is expanded in the first program execution memory 131, when the second program storage memory 122 has successfully stored the first update program PRG11 and the third update program PRG13, 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 table used in each of the programs PRG1 to PRG3 being executed, 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 multiple update programs are received, PLC 100 according to the present embodiment can switch from execution of the program before rewriting to execution of the update program after rewriting with a single switch control. As a result, PLC 100 according to the present embodiment can reduce the time for stopping program execution when rewriting a program compared to a PLC that cannot switch from execution of the program before rewriting to execution of the update program after rewriting with a single switch control when multiple update programs are received, and can further reduce the time for stopping program execution when the number of programs to be updated increases.

[0083] According to the program development support system 1 of the present embodiment, the program further includes a second program PRG2. When the first program storage memory 121 is used to expand the programs PRG1 to PRG3 being executed, the program write control unit 154 stores the update programs PRG11 and PRG13 in the second program storage memory 122.

[0084] In addition, when the programs PRG1 to PRG3 being executed are expanded in the first program execution memory 131, when the second program storage memory 122 successfully stores the update programs PRG11, PRG13, the program expansion control unit 155 expands the update programs PRG11, 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 generating 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 executing 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 executing 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 this embodiment has not received all update programs for the program being executed, it can load the program from first program execution memory 131 used to execute second program PRG2 that is not updated to second program execution memory 132 that is not used to execute the second program PRG2. As a result, PLC 100 according to this embodiment can reduce the time it takes to load the program compared to a PLC in which a program that is not updated is loaded from the first program storage memory or the second program storage memory configured of a 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, PRG13 in a continuous state 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 in the second memory area continuous after the first memory area of ​​the second program execution memory 132, from the third address 0220H to 0320H.

[0088] In this way, the PLC 100 according to the present embodiment can load the update programs PRG11, PRG13 and the unupdated second program PRG2 in a continuous state from the first memory area to the second memory area. As a result, the PLC 100 according to the present embodiment can prevent fragmentation of the program execution memory 130 even if the update programs are repeatedly received.

[0089] Here, consider a PLC that not only synchronizes the program storage memory 120 before writing a program, but also synchronizes the program execution memory 130 before controlling the program deployment. Assume that this PLC receives a second update program PRG12 that updates the second program PRG2 while executing each of the programs PRG1 to PRG3, and that the file size of the second update program PRG12 is larger than that of the second program PRG2. In this case, as shown in FIG. 8, when the second update program PRG12 is deployed in the second program execution memory 132 in this PLC, the memory area in the second program execution memory 132 where the second program PRG2 was stored becomes a free area. For this reason, even if the second update program PRG12 is deployed in a state where it is continuous with the third program PRG3, this PLC has a problem of memory fragmentation occurring due to the free area where the second program PRG2 was stored.

[0090] In contrast, the PLC 100 according to the present embodiment does not synchronize the program execution memory 130 before controlling the program to be loaded. Therefore, as shown in Fig. 9, the PLC 100 according to the present embodiment loads the second update program PRG12, and then loads 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 the present embodiment can reduce the shortage of available memory area caused by memory fragmentation more than a PLC that synchronizes the program execution memory 130 before controlling the program to be loaded.

[0091] Moreover, according to the program development support system 1 of this embodiment, the program storage management unit 151 judges 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. Moreover, the program execution management unit 152 judges whether the program execution memory 130 in which the running 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 judges whether the management information storage unit 140 that stores the management table used in the running 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 between and manage, during execution of a program, 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] (Example of change) In the above embodiment, after program receiving unit 110 receives an update program, program write control unit 154 synchronizes the program information stored in first program storage memory 121 and second program storage memory 122, but the timing of synchronizing the program information is not limited to this. For example, program write 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 a program and an update program.

[0094] As in the above embodiment, it is preferable that program deployment control unit 155 deploys the update programs on the condition that program writing control unit 154 has successfully stored all the update programs, but this is not limiting. For example, if program writing 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 that is not updated from the first program execution memory 131, which is a volatile memory, to the second program execution memory 132, but is not limited to this. For example, the program load control unit 155 may load the second program PRG2 that 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", but the number of flags is not limited to this. For example, since the program execution memory 130 and the management information storage unit 140 are configured by 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 value indicated by the volatile memory flag updated by the update program switching control unit 158. Also, 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, but updating 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 deployment of the 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 the first update program PRG11 in which the first program PRG1 is updated and the third update program PRG13 in which the third program PRG3 is updated as the update programs, but the update programs are not limited to this. For example, the program receiving unit 110 may receive the second update program PRG12 in which the second program PRG2 is updated as the update program. In addition, when the program receiving unit 110 receives the first update program PRG11 and the second update program PRG12 as the update programs, the above-mentioned "third update program PRG13" may be read as "second update program PRG12" for the control of the PLC 100. Therefore, in order to reduce redundant explanation, illustrations and detailed explanations of the case where the program receiving unit 110 receives the first update program PRG11 and the second update program PRG12 as the update programs will be omitted.

[0099] In the above embodiment, the program storage memory 120 is two memories, the first program storage memory 121 and the second program storage memory 122, but is not limited to this and may be three or more memories. In this case, the program storage management unit 151 needs to manage three or more memories as the program storage memory 120, the program write control unit 154 needs to enable writing control to three or more memories as the program storage memory 120, and the update program switching control unit 158 ​​needs to control switching of the three or more memories as the 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 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 enable control of deployment to three or more memories as program execution memory 130, and update program switching control unit 158 ​​needs to control switching of three or more memories as program execution memory 130.

[0101] In the above embodiment, management information storage unit 140 is two storage units, first management information storage unit 141 and second management information storage unit 142, but is not limited to this and may be 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 by a specific area in a first volatile memory constituting the first program execution memory 131, and the second management information storage unit 142 is configured by a specific area in a second volatile memory constituting 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 by a first specific area and a second specific area in a third volatile memory.

[0103] The core part of the PLC 100, which includes the control unit 51, main memory unit 52, external memory unit 53, operation unit 54, transmission / reception unit 56, internal bus 50, etc., that performs the processing may be configured by, for example, storing and distributing a program for executing the above-mentioned operations in a recording medium readable by the PLC 100, such as a flash memory, and installing the program to configure the PLC 100 that performs the above-mentioned processing. Also, 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] It is also possible to superimpose the program on a carrier wave and provide it 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-mentioned processing.

[0106] Various embodiments and modifications of the present disclosure are possible without departing from the broad spirit and scope of the present disclosure. The above-described embodiments are for explaining the present disclosure and do not limit the scope of the present disclosure. In other words, the scope of the present disclosure is indicated by the claims, not the embodiments. Various modifications made within the scope of the claims and within the scope of the disclosure equivalent thereto are considered to be within the scope of the present disclosure. [Explanation of symbols]

[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...transmission / reception unit, 59...control program, 100...PLC, 110...program reception 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 memory unit, 142...second management information memory 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 memory unit, 230...program transmission unit.

Claims

1. a program storage memory capable of storing a program; a program execution memory used when executing the program; a program expansion control unit that controls expansion of the program stored in the program storage memory into the program execution memory; a program execution unit that executes the program expanded in the program execution memory; a program write control unit that performs write control to store an update program, which is the program updated during execution of the program, in the program storage memory; Equipped with 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 expand 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; when the program execution memory in which the program being executed is loaded is the first program execution memory, when the second program storage memory has successfully stored the update program, the program load control unit loads the update program from the second program storage memory to the second program execution memory; an update program switching control unit that performs switching control to cause the program execution unit to execute the update program loaded in the second program execution memory when the program execution unit is executing the program loaded in the first program execution memory, the update program switching control unit performs control to start execution of the update program expanded in the second program execution memory without performing control to end execution of the program being executed that is expanded in the first program execution memory, in the switching control. Programmable logic controller.

2. a management information generating unit that generates management information that is information for managing execution of the program; a management information storage unit that stores the management information; Further comprising: the program execution unit executes the program deployed in the program execution memory by 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, the management information generating unit generates the management information for managing execution of the update program, and when the management information storage unit storing the management information used in the program being executed is the first management information storage unit, stores the generated management information for managing execution of the update program in the second management information storage unit; the update program switching control unit, when the program execution unit is executing the program expanded in the first program execution memory by 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 by using the management information stored in the second management information storage unit.

2. The programmable logic controller of claim 1.

3. 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; a program execution determination unit that determines whether the program execution memory in which the program being executed is deployed is the first program execution memory or the second program execution memory.

2. The programmable logic controller of claim 1.

4. the program includes a first program and a second program different from the first program, the update program includes a first update program which is the updated first program, and a second update program which is the updated second program, when the program storage memory used to expand the first program and the second program being executed is the first program storage memory, the program write control unit stores the first update program and the second update program in the second program storage memory, 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, when the second program storage memory has successfully stored the first update program and the second update program, the program expansion control unit expands the first update program and the second update program from the second program storage memory to the second program execution memory, 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; 2. The programmable logic controller of claim 1.

5. the program includes a first program and a second program different from the first program, the update program is a first update program that is an updated version of the first program, when the program storage memory used to expand the first program and the second program being executed is set as the first program storage memory, the program write control unit stores the first update program in the second program storage memory; when the program execution memory in which the first program and the second program being executed are loaded is defined as the first program execution memory, when the second program storage memory has successfully stored the first update program, the program loading control unit loads the first update program from the second program storage memory to the second program execution memory and loads the second program from the first program execution memory to the second program execution memory; 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 program expanded in the second program execution memory, 2. The programmable logic controller of claim 1.

6. the program load control unit loads the first updating program in a first memory area of ​​the second program execution memory, and then loads the second program in a second memory area subsequent to the first memory area of ​​the second program execution memory; 6. The programmable logic controller of claim 5.

7. A method for controlling a programmable logic controller, comprising the steps of: a program expansion control step in which the programmable logic controller controls the expansion of the 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; a program write control step in which the programmable logic controller performs write control to store an update program, which is the program updated during execution of the program, in the program storage memory; Including, 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; In the program writing control step, when the program storage memory used for expanding the program being executed is the first program storage memory, the update program is stored in the second program storage memory; In the program expansion control step, when the program execution memory in which the program being executed is expanded is the first program execution memory, the update program is expanded from the second program storage memory to the second program execution memory; The program control method further includes an update program switching control step of performing a switching control for executing the update program loaded in the second program execution memory when the programmable logic controller is executing the program loaded in the first program execution memory, In the update program switching control step, a control is performed to start the execution of the update program expanded in the second program execution memory without performing a control to end the execution of the program being executed expanded in the first program execution memory. Control methods.

8. Programmable logic controller, a program expansion control unit that controls the expansion of a program stored in a program storage memory capable of storing a program into a program execution memory that is used when executing the program; a program execution unit that executes the program deployed in the program execution memory; a program write control unit that performs write control to store an update program, which is the program updated during execution of the program, in the program storage memory; Functioning as a 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 expand 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; when the program execution memory in which the program being executed is loaded is the first program execution memory, when the second program storage memory has successfully stored the update program, the program load control unit loads the update program from the second program storage memory to the second program execution memory; When the program execution unit is executing the program loaded in the first program execution memory, the program execution unit further functions as an update program switching control unit that performs switching control to cause the program execution unit to execute the update program loaded in the second program execution memory, the update program switching control unit performs control to start execution of the update program expanded in the second program execution memory without performing control to end execution of the program being executed that is expanded in the first program execution memory, in the switching control. program.