Programmable logic controller, control method and program
Patent Information
- Application Number
- JP2024542241
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2025-10-23
- Estimated Expiration
- 2044-04-15
AI Technical Summary
Existing programmable logic controllers (PLCs) lack flexibility in adjusting parallel processing of jobs, as users cannot specify which parts of a job to process in parallel and at what timing, limiting the ability to tailor processing to specific purposes.
A programmable logic controller equipped with multiple CPU cores that allows users to determine whether to execute program components in parallel processing, allocate them to specific CPU cores, set start timings, and control the execution of parallel processing based on user input parameters.
Enables users to selectively execute program parts in parallel processing, adjusting start timings, thereby enhancing the flexibility and customization of parallel processing according to specific user requirements.
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a programmable logic controller, a control method, and a program. [Background technology]
[0002] 2. Description of the Related Art Conventionally, so-called multi-core programmable logic controllers (PLCs) that perform parallel processing using a plurality of central processing unit (CPU) cores are known.
[0003] Patent Document 1 discloses a plant control device having multiple CPU cores. In Patent Document 1, the plant control device automatically creates multiple parallel processing groups by dividing a function block diagram into groups that can be executed in parallel with each other. The plant control device also test-executes each of the multiple parallel processing groups on at least one of the multiple CPU cores to measure the execution time. Then, based on the measured execution time of each parallel processing group, the plant control device automatically assigns the multiple parallel processing groups to the multiple CPU cores so that the calculation time of each CPU core is as short as possible and the calculations of each CPU core are completed as simultaneously as possible.
[0004] Patent Document 2 discloses a processor designation method that allows a user to interactively assign a processor to be processed in a computer system capable of performing parallel processing using multiple processors that can operate independently. In Patent Document 2, the screen of a processor option sheet asks the user whether the job to be executed should be executed in parallel processing or in independent CPU usage mode, and when the user selects parallel processing, the user can operate a selection button and then specify the number of CPUs that will perform parallel processing and the CPU that will actually execute the job. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2015-210728 A [Patent Document 2] Japanese Patent Application Publication No. 07-311743 Summary of the Invention [Problem to be solved by the invention]
[0006] In the device described in Patent Document 1, the user cannot select whether or not to execute parallel processing of a function block diagram, whereas in the system described in Patent Document 2, the user can select whether or not to execute a job to be executed in parallel processing mode. However, in the system described in Patent Document 2, when executing a job to be executed in parallel processing, the user cannot specify in detail which part of the job will be processed in parallel and at what timing according to the purpose, resulting in a problem that the parallel processing of the job cannot be flexibly adjusted.
[0007] The present disclosure has been made in consideration of the above-described circumstances, and aims to make it easier for users to adjust the parallel processing of a program in accordance with their objectives. [Means for solving the problem]
[0008] In order to achieve the above object, the programmable logic controller according to the present disclosure is a programmable logic controller capable of executing parallel processing of a program using at least a first CPU core and a second CPU core. The programmable logic controller according to the present disclosure includes a parallel processing execution determination unit that determines whether or not to execute a program part as one part included in a program in parallel processing with a currently executing program based on information input by a user, a program part allocation unit that assigns the program part to the second CPU core if the first CPU core is used and the second CPU core is not used during the execution of the program when the program part is executed in parallel processing, a start timing determination unit that determines a start timing that is a timing for starting the execution of the parallel processing of the program part based on information input by a user when the program part is executed in parallel processing, and a parallel processing execution control unit that controls the execution of the parallel processing of the program by starting the execution of the program part using the second CPU core from the determined start timing when the program part is executed in parallel processing. Effect of the Invention
[0009] According to the present disclosure, by inputting information into a programmable logic controller, a user can select not only whether or not to execute program parts included in a program executed by the programmable logic controller in parallel processing, but also select the start timing of the parallel processing of the program parts if the program parts are executed in parallel processing. Thus, the programmable logic controller according to the present disclosure allows the user to select the parallel processing of the program parts in more detail according to the purpose than a programmable logic controller that does not determine the start timing of the program parts to be executed in parallel processing based on information input by the user. As a result, the programmable logic controller according to the present disclosure can make it easier to adjust the parallel processing of a program according to the purpose of the user. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a block diagram showing a configuration of an information processing system according to an embodiment. [Diagram 2] Block diagram showing the functional configuration of a PLC [Diagram 3] Block diagram showing the hardware configuration of the PLC and engineering tool [Figure 4A] FIG. 1 is a diagram showing an example of a parallel processing setting screen. [Figure 4B] Another example of the parallel processing setting screen [Diagram 5] Figure showing an example of program management information display [Figure 6A] A timing chart showing input and output of information between the overall execution management unit and the second CPU core. [Figure 6B] A timing chart showing the input and output of information between the overall execution management unit and the third CPU core. [Figure 7] Flowchart showing the flow of parallel processing execution control processing DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] 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."
[0012] (About Information Processing System 1) An information processing system 1 according to an embodiment of the present disclosure is a system that controls the execution of a program created by a user, specifically, a sequence program of a PLC. As shown in Fig. 1, the information processing system 1 includes a PLC 100 that executes the program, and an engineering tool 200 that generates and updates the program. The PLC 100 and the engineering tool 200 are connected by a network that can transmit and receive information.
[0013] In the information processing system 1, the engineering tool 200 transmits a program developed by a user who is an engineer and parameters used by the program that are set by the user to the PLC 100. The PLC 100 receives and stores the program and parameters, and executes the program using the stored parameters. In this way, the information processing system 1 allows the user to control the execution of the program in the PLC 100.
[0014] (About PLC100) PLC 100 is a computer device equipped with a CPU unit equipped with a multi-core CPU capable of executing parallel processing of a program using multiple CPU cores. As shown in Fig. 2, PLC 100 includes a first CPU core 110, a second CPU core 120, and a third CPU core 130 as examples of multiple CPU cores. PLC 100 also includes an information receiving unit 150 that receives information, an information storage unit 160 that stores information, and an overall execution management unit 170 that manages the execution of the entire program.
[0015] Moreover, each CPU core of the PLC 100 includes an execution management unit that manages the execution of its own program. For example, the first CPU core 110 includes a first execution management unit 111, the second CPU core 120 includes a second execution management unit 121, and the third CPU core 130 includes a third execution management unit 131. The overall execution management unit 170 also includes a parallel processing execution decision unit 171 that decides whether or not to execute a program part as one part included in a program in parallel with a currently executing program. The overall execution management unit 170 also includes a program part allocation unit 172 that allocates a program part to any one of the multiple CPU cores. The overall execution management unit 170 also includes a start timing decision unit 173 that decides a start timing, which is the timing to start the execution of the parallel processing of the program part, and a parallel processing execution control unit 174 that controls the execution of the parallel processing of the program.
[0016] (About Engineering Tool 200) The engineering tool 200 is an engineering setting tool, i.e., a computer device in which an engineering setting tool program is installed, which is a program for implementing the functions of a setting tool used by a user who is an engineer. As shown in Fig. 2, the engineering tool 200 includes a program generation unit 210 that generates a program, a parameter setting unit 220 that sets parameters used by the program, and an information transmission unit 230 that transmits information. The program generation unit 210 includes an execution code generation unit 211 that generates an execution code for the program.
[0017] (About the hardware configuration of PLC100) 3, the PLC 100 includes a control unit 51 that executes processing according to a control program 59. The control unit 51 includes the above-mentioned multiple CPU cores. In accordance with the control program 59, the control unit 51 functions as a first execution management unit 111, a second execution management unit 121, a third execution management unit 131, an overall execution management unit 170, a parallel processing execution determination unit 171, a program part allocation unit 172, a start timing determination unit 173, and a parallel processing execution control unit 174 shown in FIG.
[0018] 3, the PLC 100 includes a main memory unit 52 into which a 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 (Random Access Memory).
[0019] 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 an information storage unit 160 shown in FIG. 2.
[0020] 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.
[0021] 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.
[0022] 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 information receiving unit 150 shown in FIG.
[0023] 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 .
[0024] 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 first execution management step performed by the first execution management unit 111, a second execution management step performed by the second execution management unit 121, a third execution management step performed by the third execution management unit 131, an information reception step performed by the information reception unit 150, and an information storage step performed by the information storage unit 160. Also, for example, the PLC 100 executes an overall execution management step performed by the overall execution management unit 170, a parallel processing execution decision step performed by the parallel processing execution decision unit 171, and a program part allocation step performed by the program part allocation unit 172. Also, for example, the PLC 100 executes a start timing determination step performed by the start timing determination unit 173 and a parallel processing execution control step performed by the parallel processing execution control unit 174.
[0025] (Hardware configuration of Engineering Tool 200) 3, like the PLC 100, the engineering tool 200 also includes a control unit 51, a main memory unit 52, an external memory unit 53, an operation unit 54, a display unit 55, and a transmission / reception unit 56. The control unit 51 functions as a program generation unit 210, an execution code generation unit 211, and a parameter setting unit 220 shown in FIG. 2 in accordance with a control program 59, and the transmission / reception unit 56 functions as an information transmission unit 230.
[0026] 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 a program generation unit 210 and an execution code generation step performed by an execution code generation unit 211. In addition, for example, the engineering tool 200 executes a parameter setting step performed by a parameter setting unit 220 and an information transmission step performed by an information transmission unit 230.
[0027] (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 ladder diagram in the ladder language. Also, when the user performs an operation to generate an execution code for the program using the operation unit 54, the program generation unit 210 causes the execution code generation unit 211 to generate the execution code for the program.
[0028] The execution code generation unit 211 generates an execution code for a program, and generates a program execution file based on the generated execution code. The execution code generation unit 211 generates the execution code so that an entry point for each program part capable of executing parallel processing can be identified.
[0029] In this embodiment, the program parts are, for example, data of execution codes of function blocks capable of executing parallel processing. That is, the program parts include a part of data in one program execution file. Therefore, the execution code generating unit 211 generates the execution code so that the entry point of the part of data capable of executing parallel processing in one program execution file can be identified.
[0030] When the user performs an operation to set parameters used by the program using the operation unit 54, the parameter setting unit 220 sets the parameters and generates parameter information that is information indicating the set parameters. The parameter setting unit 220 sets parameters related to the setting of parallel processing based on information that the user inputs into the parallel processing setting screen 300 shown in Figures 4A and 4B using the operation unit 54, for example.
[0031] Here, the parallel processing setting screen 300 is a screen that is displayed on the display unit 55 when the user sets the parallel processing. As shown in Fig. 4A and Fig. 4B, the parallel processing setting screen 300 includes a program part selection field 310 for selecting the program part to be set, and a parallel processing execution selection field 320 for selecting whether to execute in parallel processing. Furthermore, when execution in parallel processing is selected, the parallel processing setting screen 300 includes a start timing selection field 330 for selecting the start timing.
[0032] The program part selection field 310 is a pull-down selection field for selecting any character information from a list of character information indicating the name of a program part identified from a program execution file. For example, as shown in FIG. 1, consider a case where a program includes a main program named "MAIN" and program parts named "FbPou1" and "FbPou2" indicating function blocks used by the main program. Note that these program parts are not function blocks exclusive to the main program named "MAIN" and may be used by other programs. In this case, the program part selection field 310 allows selection of any character information from a list of character information such as "FbPou1" and "FbPou2" indicating the name of a program part identified from a program execution file. Returning to FIG. 4A, the parallel processing execution selection field 320 is a pull-down selection field for selecting any character information from a list of character information, "enable" indicating that the execution of parallel processing is to be enabled and "disable" indicating that the execution of parallel processing is to be disabled.
[0033] The start timing selection field 330 is a pull-down selection field for selecting one of the following textual information from a list of textual information: "Operates when notified to start execution", which indicates that the start timing is the timing when notification to start execution is received from any program; "Operates simultaneously with the main program", which indicates that the start timing is simultaneous with the start of execution of the main program; or "Operates according to the number of times the main program is executed", which indicates that the start timing is simultaneous with the start of execution of the main program when the number of executions becomes an integer multiple of the number of times specified by the user.
[0034] Here, for example, a case will be considered where a setting is made for parallel processing of a program part whose name, i.e., "program part name" is "FbPou1". In this case, first, as shown in Fig. 4A, the user uses the operation unit 54 to select the text information "FbPou1" in the program part selection field 310, and then selects the character string "Enable" in the parallel processing execution selection field 320. Next, when the user uses the operation unit 54 to select the text information "Operate when notified of execution start" in the start timing selection field 330, a completion notification selection field 340 for selecting whether or not to notify other CPU cores of completion after execution is completed is displayed below the start timing selection field 330.
[0035] The completion notification selection field 340 is a pull-down selection field for selecting one of the pieces of text information from a list display of "enable" indicating that a completion notification is to be performed, and "disable" indicating that a completion notification is to be disabled. Therefore, for example, the user can select the text information "enable" in the completion notification selection field 340 using the operation unit 54.
[0036] Therefore, for example, the parameter setting unit 220 sets parameters related to the settings of parallel processing by determining from the information inputted into the parallel processing setting screen 300 shown in FIG. 4A that the value of "program part name" is "FbPou1", the value of "parallel processing setting" is "enabled", the value of "start timing" is "at the time of notification of start command", and the value of "completion notification" is "enabled".
[0037] Also, for example, consider a case where a setting is made for parallel processing of a program part whose "program part name" is "FbPou2". In this case, first, as shown in FIG. 4B, the user selects the character information "FbPou2" in the program part selection field 310 using the operation unit 54, and then selects the character string "Enable" in the parallel processing execution selection field 320. Next, when the user selects the character information "Operate according to the number of times the main program is executed" in the start timing selection field 330 using the operation unit 54, an execution count input field 350 in which the number of executions designated by the user is input is displayed below the start timing selection field 330. Therefore, for example, the user can input the character information "5" in the execution count input field 350 using the operation unit 54.
[0038] Therefore, for example, the parameter setting unit 220 sets parameters related to the setting of parallel processing by identifying that the value of "program part name" is "FbPou2," the value of "parallel processing setting" is "enabled," the value of "start timing" is "every execution count of main program," and the value of "number of executions" is "5" from the information input to the parallel processing setting screen 300 shown in Fig. 4B. Then, the parameter setting unit 220 generates parameter information including information indicating the set parameters and their values.
[0039] The information transmitting unit 230 transmits to the PLC 100 the program execution file generated by the execution code generating unit 211 and the parameter information generated by the parameter setting unit 220. For example, the information transmitting unit 230 transmits a program execution file including data of the execution code of a main program named "MAIN" and data of the execution codes of program parts named "FbPou1" and "FbPou2". In addition, for example, the information transmitting unit 230 transmits parameter information including information indicating that the value of "program part name" is "FbPou1", the value of "parallel processing setting" is "enable", the value of "start timing" is "operate when notified of execution start", and the value of "completion notification" is "enable".
[0040] (For details on the functional configuration of PLC100) The information receiving unit 150 receives the executable file and parameter information of the program transmitted by the engineering tool 200 , and stores them in the information storage unit 160 .
[0041] Based on the executable files and parameter information of the programs stored in the information storage unit 160, the overall execution management unit 170 generates program management information, which is information for managing the programs, and stores the program management information in the information storage unit 160.
[0042] Here, the program management information stored in the information storage unit 160 is information that can be displayed in the form of a table as shown in Fig. 5, for example, and is information indicating parameters such as "name", "start address", and "parallel processing setting" and their values for each piece of executable code data in a program. For example, the program management information includes information indicating that for a main program with a "name" of "MAIN", the "start address" indicating the entry point is "0x00AB", and the value of the "parallel processing setting" is "invalid".
[0043] Also, for example, the program management information includes information indicating that, for a program part having a "name" of "FbPou1", the "start address" is "0x00CD", the "parallel processing setting" value is "enabled", the "start timing" value is "at the time of notification of a start command", and the "completion notification" value is "enabled". Also, for example, the program management information includes information indicating that, for a program part having a "name" of "FbPou2", the "start address" is "0x00EF", the "parallel processing setting" value is "enabled", the "start timing" value is "every execution count of the main program", and the "number of executions" value is "5".
[0044] 2, overall execution management unit 170 acquires the executable file and program management information of the program stored in information storage unit 160, and executes the program. Overall execution management unit 170 manages the execution of the entire program by inputting and outputting information to and from each CPU core.
[0045] The parallel processing execution determination unit 171 determines whether or not to execute the program parts included in the program in parallel processing based on the program management information. For example, the parallel processing execution determination unit 171 determines that the program parts with the "Name" of "FbPou1" and "FbPou2" are to be executed in parallel processing because the value of the "Parallel Processing Setting" is "Enabled."
[0046] When executing program parts in parallel processing, the program part allocation unit 172 acquires information indicating the program execution state from the execution management unit of each CPU core, and assigns the program parts to be executed in parallel processing if there is a CPU core that is not executing the program. Here, for example, consider a case where the first CPU core 110 is used to execute the main program and the second CPU core 120 is not used to execute other program parts. In this case, the program part allocation unit 172 acquires information indicating the program execution state that the program is being executed from the first execution management unit 111 of the first CPU core 110, and acquires information indicating the program execution state that the program is not being executed from the second execution management unit 121 of the second CPU core 120. Therefore, the program part allocation unit 172 can allocate the program parts to the second CPU core 120.
[0047] Therefore, for example, after it is determined that the program part with the "name" of "FbPou1" is to be executed in parallel processing, the program part allocation unit 172 acquires information indicating the program execution state from the execution management unit of each CPU core. Then, the program part allocation unit 172 can assign the program part with the "name" of "FbPou1" to the second CPU core 120 that is not executing a program based on the program execution state of each CPU core. Also, for example, after it is determined that the program part with the "name" of "FbPou2" is to be executed in parallel processing, the program part allocation unit 172 acquires information indicating the program execution state from the execution management unit of each CPU core. Then, the program part allocation unit 172 can assign the program part with the "name" of "FbPou2" to the third CPU core 130 that is not executing a program based on the program execution state of each CPU core.
[0048] When executing program parts in parallel processing, the start timing determination unit 173 determines the start timing based on the program management information. For example, after determining that a program part with a "name" of "FbPou1" is to be executed in parallel processing, the start timing determination unit 173 determines that the value of the "start timing" of the program part is "at the time of notification of a start command." Also, for example, after determining that a program part with a "name" of "FbPou2" is to be executed in parallel processing, the start timing determination unit 173 determines that the value of the "start timing" of the program part is "every execution count of the main program."
[0049] When executing a program part in parallel processing, the parallel processing execution control unit 174 controls the execution of the program part to start from the determined start timing. Here, for example, consider a case where a program part with a "name" of "FbPou1" is executed in parallel processing using the second CPU core 120. In this case, the parallel processing execution control unit 174 causes the second CPU core 120 to start execution of the program part "when a start command is notified", that is, when information indicating a start command is obtained from another program part being executed by another CPU core. At this time, the parallel processing execution control unit 174 specifies that the value of "completion notification" is "valid" based on the program management information, and outputs information indicating a start command and information instructing the second CPU core 120 to perform a completion notification to the second CPU core 120.
[0050] As a result, the second execution management unit 121 of the second CPU core 120 can start execution of the program part having a "name" of "FbPou1" when it acquires information indicating a start command from the parallel processing execution control unit 174. Furthermore, the second execution management unit 121 can output information indicating the completion of execution after the execution of the program part is completed to the parallel processing execution control unit 174. Then, the parallel processing execution control unit 174 can output information indicating the completion of execution to the other CPU cores that are executing the other program parts for which the start command was issued, and the other CPU cores can execute subsequent processing after the execution is completed.
[0051] Also, for example, consider a case where a program part with a "name" of "FbPou2" is executed in parallel processing using the third CPU core 130. In this case, the parallel processing execution control unit 174 causes the third CPU core 130 to start execution of the program part "every execution count of the main program", that is, when the execution count of the main program executed by the other CPU cores becomes an integer multiple of a count predetermined by the user. Specifically, the parallel processing execution control unit 174 specifies that the value of the "number of executions" is "5" based on the program management information, and outputs information indicating a start command to the third CPU core 130 when starting execution of the main program whose execution count becomes an integer multiple of 5. As a result, the third execution management unit 131 of the third CPU core 130 can start execution of the program part with a "name" of "FbPou2" when acquiring information indicating a start command from the parallel processing execution control unit 174.
[0052] (About input and output of information when performing parallel processing) Hereinafter, the input and output of information between the overall execution management unit 170 and each CPU core when performing parallel processing will be described in detail with reference to FIG. 6A and FIG. 6B. First, consider a case where a program part with a "name" of "FbPou1" is executed in parallel processing using the second CPU core 120. In this case, as shown in FIG. 6A, first, the overall execution management unit 170 acquires information indicating the program execution state from the second execution management unit 121, and identifies that the second CPU core 120 is not executing the program. Next, the overall execution management unit 170 assigns the program part to the second CPU core 120 by outputting the program part to the second CPU core 120. Next, after acquiring information indicating a start command from the other CPU cores, the overall execution management unit 170 outputs information indicating the start command and information instructing to perform a completion notification to the second CPU core 120. Then, the overall execution management unit 170 acquires information indicating that the execution has been completed after the second CPU core 120 has executed the program part. As a result, the overall execution management unit 170 can output information indicating that the parallel processing of the program part has been completed to the other CPU core that issued the start command for the program part.
[0053] Next, consider a case where a program part with a "name" of "FbPou2" is executed in parallel processing using the third CPU core 130. In this case, as shown in FIG. 6B, first, the overall execution management unit 170 acquires information indicating the program execution state from the third execution management unit 131, and identifies that the third CPU core 130 is not executing the program. Next, the overall execution management unit 170 assigns the program part to the third CPU core 130 by outputting the program part to the third CPU core 130. Then, the overall execution management unit 170 counts the number of times that the main program has been started in the other CPU cores, and when the counted number of times becomes an integer multiple of the number of times predetermined by the user, outputs information indicating a start command to the third CPU core 130. As a result, the overall execution management unit 170 can cause the third CPU core 130 to start execution of the program part when the number of times that the main program has been executed becomes an integer multiple of the number of times predetermined by the user.
[0054] (Flowchart of parallel processing execution control process) Next, the control of the PLC 100 executing the parallel processing of the program will be described with reference to a flowchart. When the power is turned on by the user, the PLC 100 starts executing the parallel processing execution control process shown in Fig. 7. As shown in Fig. 7, first, the information receiving unit 150 receives the executable file of the program and parameter information transmitted by the engineering tool 200, and stores them in the information storage unit 160 (step S101). After receiving the information, the overall execution management unit 170 generates the program management information shown in Fig. 5 based on the executable file of the program and the parameter information stored in the information storage unit 160, and stores them in the information storage unit 160 (step S102).
[0055] After generating the program management information, the overall execution management unit 170 acquires the executable file and program management information of the program stored in the information storage unit 160, and starts executing the program (step S103). After starting the program execution, the parallel processing execution decision unit 171 decides whether or not to execute each program part by parallel processing, based on the program management information (step S104). For example, the parallel processing execution decision unit 171 decides to execute each program part with the "name" of "FbPou1" and "FbPou2" by parallel processing.
[0056] After the parallel processing execution is decided, the overall execution management unit 170 judges whether or not there are any program parts to be executed in parallel processing (step S105). If there are no program parts to be executed in parallel processing (step S105; N), the overall execution management unit 170 ends the processing. On the other hand, if there are program parts to be executed in parallel processing (step S105; Y), the program part allocation unit 172 acquires information indicating the program execution state from the execution management unit of each CPU core, and allocates the program parts to be executed in parallel processing to the CPU cores that are not executing the program (step S106). For example, the program part allocation unit 172 allocates the program parts with the "names" "FbPou1" and "FbPou2" to the second CPU core 120 and the third CPU core 130.
[0057] After the program parts are allocated, the start timing determination unit 173 determines the start timing of the program parts to be executed in parallel processing based on the program management information (step S107). For example, the start timing determination unit 173 determines that the start timing of the program part with the "name" "FbPou1" is "at the time of notification of a start command" and the start timing of the program part with the "name" "FbPou2" is "every execution count of the main program".
[0058] After determining the start timing, the parallel processing execution control unit 174 determines whether or not there is a program segment whose start timing has reached the determined start timing (step S108). For example, when the parallel processing execution control unit 174 acquires information indicating a start command from another program segment being executed by another CPU core, it determines that it is the start timing for execution of the program segment assigned to the second CPU core 120. Also, for example, the parallel processing execution control unit 174 determines that it is the start timing for execution of the program segment assigned to the third CPU core 130 when the number of times the main program being executed by another CPU core has been executed becomes an integer multiple of 5, which is a number of times predetermined by the user.
[0059] If there is a program segment whose start timing has come (step S108; Y), the parallel processing execution control unit 174 performs control to start execution of the program segment whose start timing has come (step S109), and returns to step S108. For example, the parallel processing execution control unit 174 performs control to cause the second CPU core 120 to start execution of the program segment, and then obtains information indicating that execution has been completed from the second CPU core 120, and outputs the information to the other CPU core. Also, for example, the parallel processing execution control unit 174 performs control to cause the third CPU core 130 to start execution of the program segment.
[0060] On the other hand, if there is no program component whose start timing has come (step S108; N), the parallel processing execution control unit 174 judges whether the running program has ended (step S110). If the running program has not ended (step S110; N), the parallel processing execution control unit 174 repeats the processing of steps S108 to S110 until the program ends. Then, if the running program has ended (step S110; Y), the overall execution management unit 170 ends the processing.
[0061] As described above, according to the information processing system 1 of this embodiment, the PLC 100 is a control device equipped with a multi-core CPU unit capable of executing parallel processing of a program using at least the first CPU core 110 and the second CPU core 120. In the PLC 100, the parallel processing execution decision unit 171 decides whether or not to execute a program part included in a program in parallel processing with the currently running program, based on parameter information as an example of information input by a user via the engineering tool 200.
[0062] Furthermore, when the program parts are executed by parallel processing, the program part allocation unit 172 allocates the program parts to the second CPU core 120 if the first CPU core 110 is used during program execution and the second CPU core 120 is not used. Furthermore, when the program parts are executed by parallel processing, the start timing determination unit 173 determines the start timing of the program parts based on the parameter information. Then, when the program parts are executed by parallel processing, the parallel processing execution control unit 174 controls the execution of parallel processing of the program by starting the execution of the program parts using the second CPU core 120 from the determined start timing.
[0063] In this way, by transmitting parameter information input by the user from the engineering tool 200 to the PLC 100, the user can not only select whether or not to execute program parts included in a program executed by the PLC 100 in parallel processing, but also select the start timing of the parallel processing of the program parts if the program parts are to be executed in parallel processing. Thus, the PLC 100 according to this embodiment allows the user to select the parallel processing of the program parts in more detail according to the purpose than a PLC that does not determine the start timing of the program parts to be executed in parallel processing based on information input by the user. As a result, the PLC 100 according to this embodiment makes it easier for the user to adjust the parallel processing of a program according to the purpose of the user.
[0064] Furthermore, according to the information processing system 1 of this embodiment, the program parts that the PLC 100 executes in parallel during program execution include data for realizing one or more functions contained in one program execution file. In this way, the PLC 100 according to the present embodiment can execute, for example, execution code data of function blocks included in one program execution file as program components in parallel processing during program execution.
[0065] (Example of change) In this embodiment, the data of execution codes of function blocks capable of executing parallel processing is exemplified as program parts, but the present invention is not limited to this as long as parallel processing is possible. For example, when there are multiple program executable files generated by the execution code generating unit 211 and the data of execution codes of a subroutine program is included in the multiple program executable files, the program parts may be data of multiple execution codes of the subroutine program included in the multiple program executable files. That is, when there are multiple program executable files of a program, the program parts in this disclosure also include data for realizing one or more functions included in one or more program executable files. In this case, the execution code generating unit 211 generates execution codes so that the entry points of the data of multiple execution codes of the subroutine program, which is a program part capable of executing parallel processing, can be identified. In this way, when there are multiple program executable files, the PLC 100 can execute program parts that realize one or more functions with data of one or more execution codes in one or more program executable files in parallel processing during program execution.
[0066] In this embodiment, the PLC 100 includes a CPU unit equipped with a multi-core CPU, but is not limited to this as long as it is possible to execute parallel processing of programs using multiple CPU cores. For example, the PLC 100 may include a CPU unit equipped with multiple single-core CPUs, or may include a CPU unit equipped with multiple multi-core CPUs.
[0067] In the present embodiment, the user inputs information to the PLC 100 by transmitting the information from the engineering tool 200 to the PLC 100, but the present invention is not limited to this, and for example, the user may input information to the PLC 100 by transmitting the information to the PLC 100 from a computer device different from the engineering tool 200. Also, for example, the user may directly input information to the PLC 100 using the operation unit 54.
[0068] In this embodiment, the user selects one of the above-mentioned three types of start timing selectable in the start timing selection field 330 of the parallel processing setting screen 300, but the start timing is not limited to this. For example, the user may be able to select another timing, such as a timing when a predetermined time has elapsed since the start of execution of a program, or a timing when execution of a specific program part has ended, as the start timing.
[0069] In this embodiment, the execution code data of the function block is exemplified as an example of a part of data in one program execution file, but is not limited to this as long as it is possible to execute parallel processing with the currently running program. For example, it may be one or more commands whose start and end points can be specified among multiple commands constituting a routine of a program. That is, a program part does not have to be a collection of multiple commands constituting a routine of one function like a function block, but may be one or more commands that constitute a part of a routine of a program and whose start and end points can be specified. In this case, it is necessary to generate execution code so that at least the entry point can be identified for one or more commands that can be executed in parallel. In this way, the program part can be adjusted from one command in one program execution file to multiple commands in multiple program execution files.
[0070] In this embodiment, the user can set parameters related to parallel processing for each program part for all program parts for which parallel processing can be executed using the engineering tool 200, but this is not limiting. For example, the user may be able to set parameters related to parallel processing only for specific program parts among all program parts for which parallel processing can be executed.
[0071] The PLC 100 and the engineering tool 200, which are the core parts of the processing performed by the PLC 100 and the engineering tool 200, each of which includes the control unit 51, the main memory unit 52, the external memory unit 53, the operation unit 54, the transmission / reception unit 56, the internal bus 50, etc., may be configured to execute the above-mentioned processing by, for example, storing and distributing a program for executing the above-mentioned operations in a recording medium, such as a flash memory, which can be read by the PLC 100 and the engineering tool 200, and installing the program. 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 and the engineering tool 200 may download the program to configure a computer.
[0072] Furthermore, when the functions of the PLC 100 and the engineering tool 200 are realized by sharing between 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.
[0073] 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.
[0074] 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]
[0075] 1...information processing 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...first CPU core, 111...first execution management unit, 120...second CPU core, 121...second execution management unit, 130...third CPU core, 131...third execution management unit, 150...information receiving unit, 160...information storage unit, 170...overall execution management unit, 171...parallel processing Execution decision unit, 172...program part allocation unit, 173...start timing decision unit, 174...parallel processing execution control unit, 200...engineering tool, 210...program generation unit, 211...execution code generation unit, 220...parameter setting unit, 230...information transmission unit, 300...parallel processing setting screen, 310...program part selection field, 320...parallel processing execution selection field, 330...start timing selection field, 340...completion notification selection field, 350...number of executions input field.
Claims
1. A programmable logic controller capable of executing parallel processing of a program using at least a first CPU core and a second CPU core, a parallel processing execution determination unit that determines whether or not to execute a program part as a part included in the program in parallel with the program being executed based on information input by a user; a program part allocation unit that allocates the program parts to the second CPU core when the program parts are executed in parallel processing and the first CPU core is not being used during execution of the program; a start timing determination unit that determines a start timing, which is a timing for starting execution of the parallel processing of the program parts, based on information input by the user when the program parts are executed in parallel processing; a parallel processing execution control unit that controls execution of the parallel processing of the program by starting execution of the program parts using the second CPU core from the determined start timing when the program parts are executed in parallel processing; A programmable logic controller comprising:
2. The program part is composed of data for realizing one or more functions included in one program execution file of the program.
2. The programmable logic controller of claim 1.
3. When there are a plurality of program execution files of the program, the program parts are configured by data for realizing one or more functions included in one or more program execution files.
2. The programmable logic controller of claim 1.
4. A method for controlling a programmable logic controller capable of executing parallel processing of a program using at least a first CPU core and a second CPU core, comprising the steps of: a parallel processing execution determination step in which the programmable logic controller determines whether or not to execute a program part included in the program in parallel processing based on information input by a user; a program part allocation step of allocating the program parts to the second CPU core when the programmable logic controller executes the program parts in parallel processing and the first CPU core is used during execution of the program and the second CPU core is not used; a start timing determination step of determining a start timing, which is a timing for starting execution of the parallel processing of the program parts, based on information input by the user when the programmable logic controller executes the program parts in parallel processing; a parallel processing execution control step of starting execution of the program parts using the second CPU core from the determined start timing when the programmable logic controller executes the program parts in parallel processing; A control method comprising:
5. A programmable logic controller capable of executing parallel processing of a program using at least a first CPU core and a second CPU core, a parallel processing execution determination unit that determines whether or not a program part included in the program is to be executed in parallel processing based on information input by a user; a program part allocation unit that allocates the program parts to the second CPU core when the program parts are executed in parallel processing and the first CPU core is not being used during execution of the program; a start timing determination unit that determines a start timing, which is a timing for starting execution of the parallel processing of the program parts, based on information input by the user when the program parts are executed in parallel processing; a parallel processing execution control unit that starts the execution of the program parts using the second CPU core from the determined start timing when the program parts are executed in parallel processing; A program that functions as a