Programmable logic controller, control method, and program

By adopting dual memory structure and program switching control in PLC, the problem of too long execution stop time caused by PLC program update is solved, and continuous program execution during the update process is realized, which improves the stability and control accuracy of the device.

CN120457401AActive Publication Date: 2025-08-08MITSUBISHI ELECTRIC CORP
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202380089910.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2025-08-08
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

During the program update process of programmable logic controller (PLC), the prior art causes program execution stop time to be too long, affecting control timing and device operation stability.

Method used

The dual memory structure is adopted, including the first and second program storage memories and the first and second program execution memories. Through program writing control and deployment control, the update program is stored in the second memory and switched to the second execution memory without stopping the program execution before rewriting.

Benefits of technology

It shortens the execution stop time during program update, improves the control stability of the PLC and the continuity of equipment operation, and avoids control timing deviations and failures caused by shutdown.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120457401A_ABST
    Figure CN120457401A_ABST
Patent Text Reader

Abstract

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

Description

Technical Field

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

[0002] In the past, during the development of a program, a so-called debugging operation was performed to detect errors and faults in the created program and to correct them.

[0003] When developing a program for a Programmable Logic Controller (hereinafter sometimes referred to as a "PLC"), a programmer actually runs the PLC using the created program while verifying its operation. If any problems are found, the program is corrected and written to the PLC. The programmer repeats this process of verifying the operation, correcting the program, and writing the program until the PLC operates normally. Therefore, when developing a PLC program, if the PLC is stopped each time a revised program is written, debugging time increases. Therefore, a technology is sought to enable writing revised programs while maintaining the PLC's operation as much as possible.

[0004] Patent document 1 discloses a PLC instrument that can rewrite a stored program during operation. In Patent document 1, the PLC instrument has: a first memory, which is composed of a non-volatile flash memory for storing the program; a second memory, which is composed of a non-volatile flash memory for backing up the first memory; and a third memory, which is composed of a volatile RAM (Random Access Memory) used when executing the program.

[0005] Furthermore, in Patent Document 1, a PLC device writes a rewritten program during operation into a second memory, and if the writing is successful, copies the written program to a first memory, and then further expands the program into a third memory and starts it.

[0006] Patent Document 1: Japanese Patent Application Laid-Open No. 2004-272629 Summary of the Invention

[0007] In the PLC device described in Patent Document 1, the program currently being executed before being rewritten and expanded in the third memory is overwritten with the rewritten program and then started. Therefore, in the PLC device described in Patent Document 1, when the expansion of the rewritten program starts, the execution of the program before being rewritten stops. This leads to the problem that program execution stops between the start of expansion of the rewritten program and the start of startup.

[0008] The present invention has been made in view of the above-mentioned actual situation, and an object of the present invention is to shorten the time during which the execution of a program is stopped when the program is rewritten.

[0009] To achieve the above-mentioned object, the present invention relates to a programmable logic controller comprising: 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 into the program execution memory; and a program write control unit that controls writing an updated program (i.e., an updated program) stored in the program storage memory while the program is being executed. 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 a first program execution memory and a second program execution memory different from the first program execution memory. Furthermore, the program write control unit stores the updated program into the second program storage memory when the program storage memory used for expansion of the currently executing program is the first program storage memory. The program expansion control unit expands the updated program from the second program storage memory into the second program execution memory when the program execution memory used for expansion of the currently executing program is the first program execution memory. Furthermore, 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 developed in the second program execution memory when the program execution unit is executing the program developed in the first program execution memory.

[0010] Effects of the Invention

[0011] According to the present invention, the programmable logic controller expands the update program to the second program execution memory that is not used for the execution of the program. Therefore, even if the programmable logic controller according to the present invention starts to expand the update program, it is possible not to stop the execution of the program before rewriting. In addition, according to the present invention, after the expansion of the update program is completed, the programmable logic controller switches the program execution memory used for the execution of the program from the first program execution memory to the second program execution memory. Therefore, compared with a programmable logic controller that does not switch the program execution memory from the first program execution memory to the second program execution memory, the programmable logic controller according to the present invention can quickly switch from the execution of the program before rewriting to the execution of the updated program after rewriting. As a result of the above approach, the programmable logic controller according to the present invention can shorten the time for stopping the execution of the program when rewriting the program. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1This is a block diagram showing the configuration of the program development support system according to the first embodiment.

[0013] Figure 2 This is a block diagram showing the functional structure of the program development support system.

[0014] Figure 3 This is a block diagram showing the hardware structure of the PLC and engineering design tools.

[0015] Figure 4 This is a diagram showing an example of the process from receiving a program to storing a management table.

[0016] Figure 5 This is a diagram showing an example of the process from receiving to storing an update program.

[0017] Figure 6 This is a diagram showing an example of the process from developing the update program to storing the management table.

[0018] Figure 7 This is a flowchart showing the flow of update program switching control processing.

[0019] Figure 8 This is a diagram showing an example of processing from synchronizing the program execution memory to developing the second update program.

[0020] Figure 9 This is a diagram showing an example of processing from developing the second updated program without synchronizing the program execution memory to developing the unupdated program. DETAILED DESCRIPTION

[0021] Hereinafter, a programmable logic controller, control method, and program according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings. Identical or corresponding parts in the figures are denoted by the same reference numerals. Hereinafter, a "programmable logic controller" will be referred to as a "PLC."

[0022] (About Program Development Support System 1)

[0023] The program development support system 1 according to the embodiment of the present invention is a system that supports the development of a program by performing debugging operations. Figure 1 As shown, the program development support system 1 includes a PLC 100 for executing a program and an engineering tool 200 for generating and updating a program. The PLC 100 and the engineering tool 200 are connected via a network capable of transmitting and receiving information.

[0024] In the program development support system 1, the engineering design tool 200 sends a program generated by a programmer, or user, to the PLC 100. The PLC 100 then stores, expands, and executes the received program. Furthermore, the user confirms the operation of the PLC 100 while it is executing the program. If there are any problems with the operation, the program is corrected or updated. The engineering design tool 200 sends the updated program, or updated program, to the PLC 100, which then stores, expands, and executes the received updated program. Furthermore, in the program development support system 1, the user's confirmation of the operation, the correction and update of the program, the transmission of the updated program by the engineering design tool 200, and the reception, storage, expansion, and execution by the PLC 100 are repeated until the PLC 100 operates normally. In this way, the program development support system 1 can assist with program debugging and program development.

[0025] (About PLC 100)

[0026] like Figure 2 As shown, PLC 100 includes a program receiving unit 110 for receiving programs. Furthermore, PLC 100 includes a program storage memory 120 capable of storing programs, a program execution memory 130 used when executing programs, and a management information storage unit 140 that stores management information for managing program execution. Program storage memory 120 includes a first program storage memory 121 and a second program storage memory 122. Program execution memory 130 includes a first program execution memory 131 and a second program execution memory 132. Furthermore, management information storage unit 140 includes a first management information storage unit 141 and a second management information storage unit 142.

[0027] The PLC 100 also includes a program storage management unit 151 that manages the program storage memory 120, a program execution management unit 152 that manages the program execution memory 130, and a management information storage management unit 153 that manages the management information storage unit 140. Furthermore, the PLC 100 includes a program writing control unit 154 that controls program writing, a program expansion control unit 155 that controls program expansion, and a management information generation unit 156 that generates management information. Furthermore, the PLC 100 includes a program execution unit 157 that executes programs and an update program switching control unit 158 that controls switching to an updated program, i.e., an updated program.

[0028] (Regarding Engineering Design Tools 200)

[0029] like Figure 2As shown, the engineering tool 200 includes a program generation unit 210 for generating a program, a program storage unit 220 for storing the program, and a program distribution unit 230 for distributing the program. The program generation unit 210 includes a compile execution unit 211 for compiling the program.

[0030] (About the hardware structure of PLC 100)

[0031] like Figure 3 As shown in FIG. 1 , the PLC 100 includes a control unit 51 that executes processing according to a control program 59. The control unit 51 includes a CPU (Central Processing Unit). The control unit 51 operates according to the control program 59. Figure 2 The program storage management unit 151, program execution management unit 152, management information storage management unit 153, program writing control unit 154, program expansion control unit 155, management information generation unit 156, program execution unit 157, and update program switching control unit 158 function as shown.

[0032] return Figure 3 The PLC 100 has a main storage unit 52 used as a work area for loading a control program 59 and a control unit 51. The main storage unit 52 has a volatile memory such as a RAM. Figure 2 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 the figure function.

[0033] return Figure 3 The PLC 100 has an external storage unit 53 that stores the control program 59 in advance. The external storage unit 53 supplies the information stored in the program to the control unit 51 according to the instruction of the control unit 51, and stores the data supplied from the control unit 51. The external storage unit 53 has a non-volatile memory such as a flash memory, HDD (Hard Disk Drive), or SSD (Solid State Drive). The external storage unit 53 is used as Figure 2 The program storage memory 120 , the first program storage memory 121 , and the second program storage memory 122 shown are functional.

[0034] return Figure 3 The PLC 100 includes an operation unit 54 operated by a user. Input information is supplied to the control unit 51 via the operation unit 54. The operation unit 54 includes information input means such as a keyboard, a mouse, and a touch panel.

[0035] Furthermore, the PLC 100 includes a display unit 55 that displays information input via the operation unit 54 and information output from 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.

[0036] In addition, the PLC 100 has a transceiver 56 for transmitting and receiving information. The transceiver 56 has information communication components such as a communication network terminal device and a wireless communication device connected to the network. The transceiver 56 is used as Figure 2 The program receiving unit 110 shown functions.

[0037] return Figure 3 In the PLC 100 , a main storage unit 52 , an external storage unit 53 , an operation unit 54 , a display unit 55 , and a transceiver unit 56 are all connected to a control unit 51 via an internal bus 50 .

[0038] The PLC 100 realizes the following functions by using the main storage unit 52, the external storage unit 53, the operation unit 54, the display unit 55, and the transceiver unit 56 as resources. Figure 2 The functions of the above-mentioned units 110, 120 to 122, 130 to 132, 140 to 142, and 151 to 158 are as follows: For example, the PLC 100 executes a program receiving step performed by the program receiving 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.

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

[0040] (Regarding the Hardware Structure of the Engineering Design Tool 200)

[0041] In addition, if Figure 3 As shown in FIG. 1 , the engineering design tool 200 also includes a control unit 51, a main storage unit 52, an external storage unit 53, an operation unit 54, a display unit 55, and a transceiver unit 56, similar to the PLC 100. The control unit 51 operates as a control program 59. Figure 2 The program generation unit 210 and the compile execution unit 211 shown in the figure function as the program storage unit 220, the external storage unit 53 functions as the program storage unit 220, and the transceiver unit 56 functions as the program transmission unit 230. Figure 3 The engineering design tool 200 is realized by the control unit 51 using the main storage unit 52, the external storage unit 53, the operation unit 54, the display unit 55 and the transceiver unit 56 as resources. Figure 2 The functions of the above-mentioned units 210, 211, 220, and 230 are shown. For example, the engineering tool 200 executes a program generation step by the program generation unit 210, a compile execution step by the compile execution unit 211, and a program distribution step by the program distribution unit 230.

[0042] (Details of the Functional Structure of the Engineering Tool 200)

[0043] return Figure 2 When the user uses the operating unit 54 to perform an operation to describe the program, the program generation unit 210 describes the program. Here, the description format of the program includes not only the form of character data but also the form of graphic data. For example, the description format of the program is source code if it is in ST language, and ladder diagram if it is in ladder diagram language. In addition, when the user uses the operating unit 54 to perform an operation to compile the program, the program generation unit 210 causes the compilation execution unit 211 to compile the program. In addition, the program generation unit 210 causes the program storage unit 220 to store the source file of the generated program and the execution file of the compiled program.

[0044] The program sending unit 230 sends the execution file of the program stored in the program storage unit 220 to the PLC 100. Furthermore, while the PLC 100 is executing the execution 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 the source file and execution file of the updated program, i.e., the updated program, and stores them in the program storage unit 220. Furthermore, the program sending unit 230 sends the execution file of the updated program stored in the program storage unit 220 to the PLC 100.

[0045] (Details of the functional structure of PLC 100)

[0046] The program receiving unit 110 receives the program's execution file from the engineering tool 200. Furthermore, if a user modifies or updates the program while it is running, the program receiving unit 110 receives the updated program's execution file from the engineering tool 200. Hereinafter, the program's execution file will be referred to as a "program," and the updated program's execution file will be referred to as an "updated program."

[0047] 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. Furthermore, 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. Furthermore, the first management information storage unit 141 is composed of a specific area in the first volatile memory where programs are not expanded, and the second management information storage unit 142 is composed of a specific area in the second volatile memory.

[0048] The program write control unit 154 performs write control to cause the program storage memory 120 to store an execution file of the program received by the program receiving unit 110. 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 causes the first program storage memory 121 to store the received program.

[0049] For example, consider Figure 4 As shown in FIG. 1 , the programs received from the engineering design tool 200 are the first program PRG1, the second program PRG2, and the third program PRG3. Figure 4 As shown, the first program storage memory 121 and the second program storage memory 122 do not store any program information and are synchronized. In this case, the program write control unit 154 stores the received programs PRG1 to PRG3 in a free area of the first program storage memory 121.

[0050] return Figure 2 When the program storage memory 120 successfully stores 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 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.

[0051] For example, Figure 4As shown, when the first program storage memory 121 successfully stores each of 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 to the first address 0000H to the second address 0100H of the first program execution memory 131. Furthermore, the program expansion control unit 155 expands the second program PRG2 stored in the first program storage memory 121 to the second address 0100H to the third address 0200H of the first program execution memory 131. Furthermore, the program expansion control unit 155 expands the third program PRG3 stored in the first program storage memory 121 to the third address 0200H to the fourth address 0300H of the first program execution memory 131. In other words, the program expansion control unit 155 continuously expands each of the programs PRG1 to PRG3 to the first address 0000H to the fourth address 0300H of the first program execution memory 131.

[0052] return Figure 2 Before executing a program, the management information generation unit 156 generates a management table as an example of management information and causes the management information storage unit 140 to store the generated management table. Here, the management table refers to a table indicating the location addresses of programs deployed in the program execution memory 130. When a program is not being executed, the management information generation unit 156 generates a management table indicating the location addresses of programs deployed in the first program execution memory 131 and causes the first management information storage unit 141 to store the generated management table.

[0053] For example, Figure 4 As shown, after each program PRG1 to PRG3 is expanded into the first program execution memory 131, the management information generation unit 156 generates a table as a management table indicating that the starting configuration address of the first program PRG1 is the first address 0000H, the starting configuration address of the second program PRG2 is the second address 0100H, and the starting configuration address of the third program PRG3 is the third address 0200H, and causes the first management information storage unit 141 to store the generated management table.

[0054] return Figure 2 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. If no program is being executed, the program execution unit 157 executes the program deployed in the first program execution memory 131 using the management table stored in the first management information storage unit 141.

[0055] For example, Figure 4As shown, the program execution unit 157 determines that the starting configuration addresses of each program PRG1 to PRG3 are addresses 0000H, 0100H, and 0200H respectively based on the management table stored in the first management information storage unit 141, and executes each program PRG1 to PRG3 whose storage target location in the first program execution memory 131 is determined.

[0056] return Figure 2 When the program receiving unit 110 receives an update program during program execution, the program storage management unit 151, which is an example of a program storage determination unit, determines whether the program storage memory 120 used for expansion of the currently executed program is the first program storage memory 121 or the second program storage memory 122. For example, when the value indicated by the program storage memory flag (not shown) is "1," the program storage management unit 151 determines that the program storage memory 120 used for expansion of the currently executed program is the first program storage memory 121. On the other hand, when the value indicated by the program storage memory flag is "2," the program storage management unit 151 determines that the program storage memory 120 used for expansion of the currently executed program is the second program storage memory 122.

[0057] Furthermore, when an update program is received, if the program storage management unit 151 determines that the program is for the first program storage memory 121, the program write control unit 154 synchronizes the information stored in the second program storage memory 122 with the information stored in the first program storage memory 121. The program write control unit 154 then stores the received update program in the second program storage memory 122. On the other hand, if the program storage management unit 151 determines that the program is for the second program storage memory 122, the program write control unit 154 synchronizes the information stored in the first program storage memory 121 with the information stored in the second program storage memory 122. The program write control unit 154 then stores the received update program in the first program storage memory 121.

[0058] For example, consider Figure 5As shown, while programs PRG1 to PRG3 are being executed, the programs received from the engineering design tool 200 are the first updated program PRG11, which is the result of an update of the first program PRG1, and the third updated program PRG13, which is the result of an update of 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 also storing the programs PRG1 to PRG3 stored in the first program storage memory 121 in the second program storage memory 122. Furthermore, the program write control unit 154 stores the received updated programs PRG11 and PRG13 in a free area of the second program storage memory 122.

[0059] return Figure 2 When the program write control unit 154 successfully writes an update program while a program is being executed, the program execution management unit 152, as an example of a program execution determination unit, determines whether the program execution memory 130 in which the program being executed is deployed is the first program execution memory 131 or the second program execution memory 132. For example, if the value indicated by the program execution memory flag (not shown) is "1," the program execution management unit 152 determines that the program execution memory 130 in which the program being executed is deployed is the first program execution memory 131. On the other hand, if the value indicated by the program execution memory flag is "2," the program execution management unit 152 determines that the program execution memory 130 in which the program being executed is deployed is the second program execution memory 132.

[0060] Furthermore, if the updated program is successfully stored and the program execution management unit 152 determines that the program is stored in the first program execution memory 131, the program expansion control unit 155 expands the updated program stored in the second program storage memory 122 into the second program execution memory 132. Furthermore, the program expansion control unit 155 expands the currently executing program that has not been updated and is expanded in the first program execution memory 131 into the second program execution memory 132. On the other hand, in this case, if the program execution management unit 152 determines that the program is stored in the second program execution memory 132, the program expansion control unit 155 expands the updated program stored in the first program storage memory 121 into the first program execution memory 131. Furthermore, the program expansion control unit 155 expands the currently executing program that has not been updated and is expanded in the second program execution memory 132 into the first program execution memory 131.

[0061] For example, Figure 6As shown, after the update programs PRG11 and PRG13 are successfully stored in the second program storage memory 122, the program expansion control unit 155 expands the first update program PRG11 stored in the second program storage memory 122 to the first address 0000H to the second address 0110H, which is an example of the first storage area of the second program execution memory 132. Furthermore, the program expansion control unit 155 expands the third update program PRG13 stored in the second program storage memory 122 to the second address 0110H to the third address 0220H, which is an example of the first storage area of the second program execution memory 132. Furthermore, the program expansion control unit 155 expands the second program PRG2 stored in the first program execution memory 131 to the third address 0220H to the fourth address 0320H, which is an example of the second storage area of the second program execution memory 132. That is, the program expansion control unit 155 expands the programs PRG11 , PRG13 , and PRG2 in a continuous state to the first address 0000H to the fourth address 0320H of the second program execution memory 132 .

[0062] return Figure 2 When the program expansion control unit 155 controls the expansion and update of a program while the program is being executed, 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 by the currently executing program is the first management information storage unit 141 or the second management information storage unit 142. For example, if 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 by the currently executing program is the first management information storage unit 141. On the other hand, if 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 by the currently executing program is the second management information storage unit 142.

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

[0064] Specifically, if Figure 6 As shown, the management information generation unit 156 generates a table as a management table indicating that the starting configuration address of the first update program PRG11 is the first address 0000H, the starting configuration address of the second program PRG2 is the second address 0220H, and the starting configuration 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.

[0065] return Figure 2 When the program execution unit 157 executes 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 causes 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. Furthermore, when the program execution unit 157 executes the program deployed in the second program execution memory 132 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 deployed in the first program execution memory 131 using the management table stored in the first management information storage unit 141.

[0066] For example, Figure 6 As shown, the program execution memory 130 and the management information storage unit 140 referenced by the program execution unit 157 are switched. 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 determines, based on the management table stored in the second management information storage unit 142, that the start configuration addresses of the programs PRG11, PRG2, and PRG13 are 0000H, 0220H, and 0110H, respectively. The program execution unit 157 stops executing programs PRG1-PRG3 and executes the programs PRG11, PRG2, and PRG13 at the storage locations determined in the second program execution memory 132. Furthermore, 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."

[0067] (Flowchart of Update Program Switching Control Process)

[0068] Next, the control of program development support system 1, which assists in program development, will be described using a flowchart. Here, the process of sending a generated or updated program from engineering tool 200 to PLC 100 involves simply sending the generated or updated program to PLC 100 by program sending unit 230 after program generation unit 210 generates or updates the program based on user operations and stores it in program storage unit 220.

[0069] In addition, for the processing of the program execution of PLC 100, it is only when the program receiving unit 110 receives the execution file of the program from the engineering design 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 to 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 uses the management table to execute the program.

[0070] Therefore, in order to reduce the length of the description, the diagram and detailed description of the above process are omitted, and only the control of the PLC 100 switching the program being executed to the updated program will be described below. Figure 7 The update program shown switches the execution of the control process.

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

[0072] Next, the program storage management unit 151 determines whether the program storage memory 120 used for expansion of the currently executed program 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 is used for expansion of the currently executed programs PRG1 to PRG3.

[0073] Next, the program write control unit 154 synchronizes the 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 write control unit 154 stores the programs PRG1 to PRG3 stored in the first program storage memory 121 in the second program storage memory 122.

[0074] Next, the program write control unit 154 stores the update program 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 .

[0075] 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.

[0076] Next, based on the determination result of the program execution management unit 152, the program expansion control unit 155 expands the update program stored in the program storage memory 120 into the program execution memory 130 (step S106). For example, 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 from the first address 0000H to the third address 0220H in a continuous state.

[0077] Next, the program expansion control unit 155 expands the expanded, unupdated program into the program execution memory 130 based on the determination result of the program execution management unit 152 (step S107). For example, the program expansion control unit 155 expands 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 continuous state with the update programs PRG11 and PRG13.

[0078] Next, the management information storage management unit 153 determines whether the management information storage unit 140 storing the management table used by the currently executed 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 management unit 153 determines that the first management information storage unit 141 stores the management table used by the currently executed program.

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

[0080] 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.

[0081] The program execution unit 157 then executes the updated program and the unupdated program (step S111). For example, the program execution unit 157 determines that the start locations of the programs PRG11, PRG2, and PRG13 are 0000H, 0220H, and 0110H, respectively, based on the management table stored in the second management information storage unit 142. The program execution unit 157 then stops executing 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 determined.

[0082] Next, 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 the process 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."

[0083] As described above, according to the program development support system 1 according to the present 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 into the program execution memory 130. Furthermore, the program write control unit 154 controls the writing of an update program into the program storage memory 120 while the program is being executed.

[0084] Here, the program storage memory 120 is constituted by a nonvolatile memory and includes a first program storage memory 121 constituted by a first nonvolatile memory and a second program storage memory 122 constituted by a second nonvolatile memory. On the other hand, the program execution memory 130 is constituted by a volatile memory and includes a first program execution memory 131 constituted by a first volatile memory and a second program execution memory 132 constituted by a second volatile memory.

[0085] Furthermore, when the program storage memory 120 used for expansion of the currently executing program is set to 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 currently executing program is expanded is set to 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 if the update program has been successfully stored in the second program storage memory 122.

[0086] In this manner, the PLC 100 according to the present embodiment stores the received update program in the program storage memory 120 composed of a non-volatile memory. Therefore, even in the event of a power outage, the received update program can be saved in the program storage memory 120. As a result, the PLC 100 according to the present embodiment does not require a measure for saving information in the event of a power outage, such as the program execution memory 130 composed of a volatile memory.

[0087] In addition, according to the program development support system 1 involved in this embodiment, the update program switching control unit 158 performs switching control to make the program execution unit 157 execute the update program expanded in the second program execution memory 132 when the program execution unit 157 is executing the program expanded in the first program execution memory 131.

[0088] As described above, in the PLC device described in Patent Document 1, after the currently executing program expanded in the third memory is updated with the update program, the update program is executed. When the update of the update program starts, the execution of the currently executing program is stopped. Therefore, the PLC device described in Patent Document 1 has the following problem: program execution is stopped between the start of the update of the update program and the start of the execution of the update program.

[0089] In particular, the PLC device described in Patent Document 1 has the following problem: The program execution is suspended for a longer period in order to expand the update program from the first memory, which is made of non-volatile flash memory, to the third memory, which is made of volatile RAM. Consequently, the PLC device described in Patent Document 1 has the following problem: this prolonged period of program suspension can easily cause a mismatch in the control timing of the FA equipment, resulting in an audible warning or, in some cases, a malfunction of the FA equipment.

[0090] In response to this, the PLC 100 involved in the present embodiment expands the update program to the second program execution memory 132 that is not used for the execution of the program. In this way, even if the PLC 100 involved in the present embodiment starts to expand the update program, the execution of the program before the rewrite can be continued. In addition, after the expansion of the update program and the generation and storage of the management table are completed, the PLC 100 involved in the present embodiment switches the program execution memory 130 used for the execution of the program from the first program execution memory 131 to the second program execution memory 132, so that the processing time of the switching control becomes extremely short. In this way, compared with a PLC that does not switch the program execution memory from the first program execution memory to the second program execution memory, the PLC 100 involved in the present embodiment can quickly switch from the execution of the program before the rewrite to the execution of the updated program after the rewrite.

[0091] As a result of these practices, the PLC 100 of this embodiment can shorten the time during which program execution is stopped when rewriting a program. Therefore, the PLC 100 of this embodiment is less likely to cause a misalignment in the control timing of FA equipment controlled by the updated program, thereby reducing the occurrence of warning sounds from the FA equipment and FA equipment failures.

[0092] Furthermore, in the PLC device described in Patent Document 1, a received update program is stored in a second memory comprised of nonvolatile flash memory. The update program stored in the second memory is then copied to a first memory comprised of nonvolatile flash memory, and the update program copied to the first memory is subsequently expanded into a third memory. Consequently, the PLC device described in Patent Document 1 has a problem in that the time between receiving the update program and expanding it into the third memory is prolonged.

[0093] In response to this, the PLC 100 according to the present embodiment stores the received update program in the second program storage memory 122, which is not used for program execution, and then expands the update program into the second program execution memory 132. In this manner, the PLC 100 according to the present embodiment can shorten the time between receiving the update program and expanding the update program into the program execution memory, compared to a PLC that needs to copy the update program into a non-volatile memory between storing the received update program in the program storage memory and expanding the update program into the program execution memory.

[0094] Furthermore, in recent years, structured programming has become the mainstream method for programming PLCs. In structured programming, programs utilize variables such as global and local variables, rather than traditional devices. Global variables are commonly used across multiple programs, so when programmers modify or update a global variable, they must modify or update all programs that use that global variable. Consequently, in recent years, the number of programs that require modification or updates at once has tended to increase in PLC programming.

[0095] As a result, the PLC device described in Patent Document 1 has the following problems: as the number of programs corrected or updated at one time increases, the period during which program execution is stopped becomes longer, and the period from receiving the updated program to developing the updated program in the program execution memory becomes longer.

[0096] In contrast, the PLC 100 according to the present embodiment can shorten these periods when the number of programs to be updated increases, compared to the PLC device described in Patent Document 1.

[0097] Furthermore, according to the program development support system 1 according to this embodiment, the management information generation unit 156 generates a management table, which is information for managing program execution, and stores it in the management information storage unit 140. Furthermore, the program execution unit 157 uses the management table stored in the management information storage unit 140 to execute the program deployed in the program execution memory 130. Furthermore, the management information generation unit 156 generates a management table for managing the execution of the update program, and, if the management information storage unit 140 storing the management table used by the currently executing program is the first management information storage unit 141, stores the generated management table in the second management information storage unit 142. Furthermore, the update program switching control unit 158 switches the program execution unit 157 to execute the program deployed in the first program execution memory 131 using the management table stored in the first management information storage unit 141, causing 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.

[0098] In this way, the PLC 100 involved in this 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. Therefore, even if the generation of the management table is started, the execution of the program before the rewrite can be continued. In addition, after the generation and storage of the management table are completed, the PLC 100 involved in this 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 the processing time of the switching control becomes extremely short. In this way, compared with the PLC that does not switch the management information storage unit from the first management information storage unit to the second management information storage unit, the PLC 100 involved in this embodiment can shorten the time required for the generation and storage of the management table, and can further shorten the time for switching from the execution of the program before the rewrite to the execution of the updated program after the rewrite.

[0099] Furthermore, according to the program development support system 1 of this embodiment, the program includes a first program PRG1 and a third program PRG3, and the updated program includes 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 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.

[0100] Furthermore, when the programs PRG1 to PRG3 currently being executed are expanded into the first program execution memory 131, and when the first update program PRG11 and the third update program PRG13 are successfully stored in the second program storage memory 122, 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 into 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 when the first management information storage unit 141 stores the management table used by the programs PRG1 to PRG3 currently being executed, the management information generation unit 156 stores the generated management table in the second management information storage unit 142.

[0101] Furthermore, when the program execution unit 157 uses the management table stored in the first management information storage unit 141 to execute the first program PRG1 and the third program PRG3 expanded in the first program execution memory 131, the update program switching control unit 158 causes the program execution unit 157 to use the management table stored in the second management information storage unit 142 to execute the first update program PRG11 and the third update program PRG13 expanded in the second program execution memory 132.

[0102] In this manner, the PLC 100 according to this embodiment can switch from executing the program before the rewrite to executing the updated program after the rewrite through a single switching control, even when receiving multiple update programs. As a result, compared to PLCs that cannot switch from executing the program before the rewrite to executing the updated program after the rewrite through a single switching control when receiving multiple update programs, the PLC 100 according to this embodiment can shorten the time it takes to stop program execution when rewriting a program, and can further shorten the time it takes to stop program execution when the number of updated programs increases.

[0103] 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 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.

[0104] In addition, when the programs PRG1 to PRG3 being executed are expanded to the first program execution memory 131, and when the updated programs PRG11 and PRG13 are successfully stored in the second program storage memory 122, the program expansion control unit 155 expands the updated 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.

[0105] Furthermore, the management information generation unit 156 generates a management table for managing the execution of the update programs PRG11 and PRG13 and the second program PRG2, and, if the first management information storage unit 141 stores the management table used by the currently executing programs PRG1 to PRG3, stores the generated management table in the second management information storage unit 142. Furthermore, if the program execution unit 157 executes the programs PRG1 to PRG3 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 causes the program execution unit 157 to execute the update programs PRG11 and PRG13 and the second program PRG2 deployed in the second program execution memory 132 using the management table stored in the second management information storage unit 142.

[0106] In this manner, the PLC 100 according to this embodiment can expand the update program from the first program execution memory 131 used for the execution of the second program PRG2 that has not been updated to the second program execution memory 132 that has not been used for the execution of the second program PRG2, when not all update programs have been received for the program currently being executed. As a result, the PLC 100 according to this embodiment can shorten the time required to expand the update program, compared to a PLC that expands the unupdated program from the first program storage memory or the second program storage memory that is formed of a non-volatile memory to the second program execution memory.

[0107] In particular, according to the program development support system 1 according to this embodiment, the program expansion control unit 155 expands the update programs PRG11 and PRG13 in a continuous state into the first storage area of the second program execution memory 132, that is, the first address 0000H to the third address 0220H. Furthermore, the program expansion control unit 155 expands the second program PRG2 into the second storage area of the second program execution memory 132, that is, the third address 0220H to 0320H, which is the second storage area following the first storage area.

[0108] In this manner, the PLC 100 according to this embodiment can expand the update programs PRG11 and PRG13 and the unupdated second program PRG2 in a continuous manner from the first storage area to the second storage area. As a result, the PLC 100 according to this embodiment can prevent the program execution memory 130 from becoming fragmented even when repeatedly receiving update programs.

[0109] Here, consider a PLC that synchronizes not only the program storage memory 120 before writing a program, but also the program execution memory 130 before controlling the program expansion. Furthermore, while each program PRG1 to PRG3 is being executed, the PLC receives a second update program PRG12 that is an update of the second program PRG2. The file size of the second update program PRG12 is larger than that of the second program PRG2. In this case, Figure 8 As shown, in this PLC, when the second update program PRG12 is expanded into the second program execution memory 132, the storage area of the second program execution memory 132 that originally stored the second program PRG2 becomes a free area. Therefore, this PLC has the following problem: even if the second update program PRG12 is expanded continuously with the third program PRG3, the free area that once stored the second program PRG2 causes memory fragmentation.

[0110] In this regard, the PLC 100 according to this embodiment does not synchronize the program execution memory 130 before controlling the expansion program. Figure 9 As shown, the PLC 100 according to this embodiment prevents memory fragmentation by expanding the unupdated programs PRG1 and PRG3 after expanding the second update program PRG12 in a continuous state with the second update program PRG12. As a result, compared to a PLC that synchronizes the program execution memory 130 before expanding the program control, the PLC 100 according to this embodiment can reduce the situation where the available storage area is insufficient due to memory fragmentation.

[0111] Furthermore, according to the program development support system 1 according to this embodiment, the program storage management unit 151 determines whether the program storage memory 120 used for expansion of the currently executed 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 executed program is expanded is the first program execution memory 131 or the second program execution memory 132. Furthermore, the management information storage management unit 153 determines whether the management information storage unit 140 storing the management table used by the currently executed program is the first management information storage unit 141 or the second management information storage unit 142.

[0112] In this way, the PLC 100 involved in this embodiment can identify and manage the valid program storage memory 120, program execution memory 130 and management information storage unit 140 used for the execution of the program, and the invalid program storage memory 120, program execution memory 130 and management information storage unit 140 not used for the execution of the program when the program is being executed.

[0113] (Change Example)

[0114] Furthermore, in the above embodiment, the program writing control unit 154 synchronizes the program information stored in the first program storage memory 121 and the second program storage memory 122 after the program receiving unit 110 receives the updated program. However, the timing of synchronizing the program information is not limited to this. For example, the program writing control unit 154 may synchronize the program information stored in the first program storage memory 121 and the second program storage memory 122 after the program executing unit 157 executes the program or updates the program.

[0115] Furthermore, as described in the above embodiment, the program expansion control unit 155 preferably expands the update program based on the condition that the program writing control unit 154 has successfully stored all update programs. However, this is not limiting. For example, if the program writing control unit 154 has successfully stored at least one of the received update programs, the program expansion control unit 155 may expand the successfully stored update program.

[0116] Furthermore, as shown in the above embodiment, the program expansion control unit 155 preferably expands the unupdated second program PRG2 from the first program execution memory 131, which is a volatile memory, to the second program execution memory 132. However, the present invention is not limited thereto. For example, the program expansion control unit 155 may also expand the unupdated second program PRG2 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.

[0117] Furthermore, 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 to between "1" and "2." However, the number of flags is not limited to this. For example, if the program execution memory 130 and the management information storage unit 140 are composed of the same volatile memory, the update program switching control unit 158 may also update the values indicated by the volatile memory flag, which is a combination of the program execution memory flag and the management information storage flag, to 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. Alternatively, for example, the update program switching control unit 158 may also update the values indicated by the switching flag, which is a combination of the program storage memory flag, the program execution memory flag, and the management information storage flag, to 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 .

[0118] Furthermore, in the above-described embodiment, the update program switching control unit 158 updates the flag for the program storage memory, the flag for the program execution memory, and the flag for the management information storage. However, the flags are not limited to being updated by 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 flag for the program storage memory after the program write control unit 154 controls writing to the program storage memory 120. Alternatively, the program expansion control unit 155 or the program execution management unit 152 may update the flag for the program execution memory after the program expansion control unit 155 controls expanding the update program into the program execution memory 130. Alternatively, the management information generation unit 156 or the management information storage management unit 153 may update the flag for the management information storage after the management information generation unit 156 generates a management table and stores it in the management information storage unit 140.

[0119] Furthermore, in the above-described embodiment, the program receiving unit 110 receives as update programs 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, but the update program is not limited thereto. For example, the program receiving unit 110 may also receive as update programs the second update program PRG12 obtained by updating the second program PRG2. Furthermore, in the case where the program receiving unit 110 receives the first update program PRG11 and the second update program PRG12 as update programs, for the control of the PLC 100, it is sufficient to replace the above-mentioned "third update program PRG13" with "second update program PRG12". Therefore, in order to reduce redundant descriptions, illustrations and detailed descriptions of the case where the program receiving unit 110 receives the first update program PRG11 and the second update program PRG12 as update programs are omitted.

[0120] Furthermore, in the above embodiment, the program storage memory 120 is composed of two memories, namely the first program storage memory 121 and the second program storage memory 122. However, this is not limited to this and may be composed of three or more memories. In this case, the program storage management unit 151 needs to manage the three or more memories serving as the program storage memory 120, the program write control unit 154 can control writing to the three or more memories serving as the program storage memory 120, and the update program switching control unit 158 needs to control switching between the three or more memories serving as the program storage memory 120.

[0121] Furthermore, in the above embodiment, program execution memory 130 comprises two memories: first program execution memory 131 and second program execution memory 132. However, this is not limiting and may comprise three or more memories. In this case, program execution management unit 152 must manage three or more memories serving as program execution memory 130, program expansion control unit 155 must be able to control expansion into the three or more memories serving as program execution memory 130, and update program switching control unit 158 must control switching between the three or more memories serving as program execution memory 130.

[0122] Furthermore, in the above embodiment, the management information storage unit 140 comprises two storage units: a first management information storage unit 141 and a second management information storage unit 142. However, this is not limiting and may comprise three or more storage units. In this case, the management information storage management unit 153 must manage the three or more memories serving as the management information storage unit 140, the management information generation unit 156 must be able to store the generated management table in the three or more memories serving as the management information storage unit 140, and the update program switching control unit 158 must control switching among the three or more memories serving as the management information storage unit 140.

[0123] Furthermore, in the above embodiment, the first management information storage unit 141 is configured from a specific area in the first volatile memory constituting the first program execution memory 131, and the second management information storage unit 142 is configured from a specific area in the second volatile memory constituting the second program execution memory 132. However, the configurations of the management information storage units 141 and 142 are not limited to this. For example, the first management information storage unit 141 and the second management information storage unit 142 may be configured from a first specific area and a second specific area in a third volatile memory.

[0124] Furthermore, regarding the portion of the PLC 100 that is central to processing, which includes the control unit 51, main storage unit 52, external storage unit 53, operation unit 54, transceiver unit 56, and internal bus 50, for example, a program for executing the aforementioned operations can be stored in a recording medium such as a flash memory that can be read by the PLC 100 and distributed, and the program can be installed to thereby configure the PLC 100 that executes the aforementioned processing. Alternatively, the program can be pre-stored in a storage device of a server device on a communication network such as a LAN (Local Area Network) or the Internet, and downloaded by the PLC 100 to thereby configure a computer.

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

[0126] Alternatively, the program can be superimposed on a carrier wave and provided via a communication network. For example, the program can be posted on a bulletin board (BBS) on a communication network and provided via the network. Furthermore, the aforementioned processing can be performed by starting the program and executing it under the control of the OS in the same manner as other application programs.

[0127] The present invention can be implemented in various embodiments and variations without departing from the broad spirit and scope of the present invention. In addition, the above embodiments are intended to illustrate the present invention and are not intended to limit the scope of the present invention. That is, the scope of the present invention is not defined by the embodiments but by the claims. Furthermore, any variations implemented within the scope of the claims and within the scope of inventions equivalent thereto are considered to fall within the scope of the present invention.

[0128] Description of the label

[0129] 1…Program Development Support System, 50…Internal Bus, 51…Control Unit, 52…Main Storage Unit, 53…External Storage Unit, 54…Operation Unit, 55…Display Unit, 56…Transmitter / Receiver Unit, 59…Control Program, 100…PLC, 110…Program Receiver 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 Memory 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 writing control unit, 155…Program expansion control unit, 156…Management information generation unit, 157…Program execution unit, 158…Update program switching control unit, 200…Engineering design tool, 210…Program generation unit, 211…Compilation execution unit, 220…Program storage unit, 230…Program sending unit.

Claims

1. A programmable logic controller comprising: a program storage memory capable of storing programs; 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 into the program execution memory; as well as a program writing control unit for performing writing control to store the program that has been updated while the program is being executed, that is, the updated 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. The program execution memory includes a first program execution memory and a second program execution memory different from the first program execution memory. The program writing control unit stores the update program in the second program storage memory when the program storage memory used for expansion of the program being executed is set to the first program storage memory. The program expansion control unit expands the update program from the second program storage memory to the second program execution memory when the update program is successfully stored in the second program storage memory, when the program execution memory in which the program being executed is expanded is set as 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 into the second program execution memory when the program execution unit is executing the program expanded into the first program execution memory.

2. The programmable logic controller according to claim 1, wherein: The programmable logic controller also has: a management information generating unit that generates management information for managing execution of the program; as well as a management information storage unit that stores the management information, The program execution unit executes the program developed 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. The management information generating unit generates the management information for managing the execution of the update program, and when the management information storage unit storing the management information used by the program being executed is set as the first management information storage unit, the generated management information for managing the execution of the update program is stored in the second management information storage unit. The update program switching control unit performs the switching control to cause the program execution unit to use the management information stored in the second management information storage unit to execute the update program expanded to the second program execution memory when the program execution unit is using the management information stored in the first management information storage unit to execute the program expanded to the first program execution memory.

3. The programmable logic controller according to claim 1, wherein: The programmable logic controller also has: a program storage determination unit for determining whether the program storage memory used for expansion of the program being executed is the first program storage memory or the second program storage memory; as well as A program execution determination unit 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 program includes the first program that has been updated, namely, the first update program, and the second program that has been updated, namely, the second update program. The program writing control unit stores the first update program and the second update program in the second program storage memory when the program storage memory used for expansion of the first program and the second program being executed is set to the first program storage memory. 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 when the first update program and the second update program are successfully stored 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 set as the first program execution memory. The update program switching control unit causes the program execution unit to execute the first update program and the second update program developed in the second program execution memory when the program execution unit is executing the first program and the second program developed in the first 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 update program is the updated first program, that is, the first update program. The program writing control unit stores the first update program in the second program storage memory when the program storage memory used for expansion of the first program and the second program being executed is set to the first program storage memory. The program expansion control unit, when setting the program execution memory in which the first program and the second program being executed are expanded as the first program execution memory, expands the first update 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 first update program is successfully stored in the second program storage memory. The update program switching control unit causes the program execution unit to execute the first update program and the second program developed in the second program execution memory when the program execution unit is executing the first program and the second program developed in the first program execution memory.

6. The programmable logic controller according to claim 5, wherein: After the program expansion control unit expands the first update program into the first storage area of the second program execution memory, the program expansion control unit expands the second program into a second storage area of the second program execution memory subsequent to the first storage area.

7. A control method, which is a control method of a programmable logic controller, comprising the following steps: a program expansion control step in which the programmable logic controller performs control to expand the program stored in the program storage memory capable of storing the program to the program execution memory used when executing the program; a program execution step, wherein the programmable logic controller executes the program expanded into the program execution memory; and a program writing control step in which the programmable logic controller performs writing control to store the program that has been updated while the program is being executed, that is, the updated 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. 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 expansion of the program being executed is set to 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 set as the first program execution memory, the update program is expanded from the second program storage memory to the second program execution memory, The control method further includes an update program switching control step, in which the programmable logic controller performs switching control to execute the update program expanded to the second program execution memory when the programmable logic controller is executing the program expanded to the first program execution memory.

8. A program that causes a programmable logic controller to function as: a program expansion control unit that controls 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 unit that executes the program expanded into the program execution memory; a program writing control unit for performing writing control to store the updated program, that is, the updated program, in the program storage memory while the program is being executed; 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. The program writing control unit stores the update program in the second program storage memory when the program storage memory used for expansion of the program being executed is set to the first program storage memory. The program expansion control unit expands the update program from the second program storage memory to the second program execution memory when the update program is successfully stored in the second program storage memory, when the program execution memory in which the program being executed is expanded is set as the first program execution memory. The program also enables the programmable logic controller to function as an update program switching control unit, which performs switching control to enable the program execution unit to execute the update program expanded to the second program execution memory when the program execution unit is executing the program expanded to the first program execution memory.

Citation Information

Patent Citations

  • Control device

    CN109388107A

  • Industrial control host and a method for undisturbed downloading and updating of an online detection tool

    CN109656609A

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

    CN110955199A

  • On line upgrading method of software and its device

    CN1556474A

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

    JP2016099899A