Programmable logic controller, control method, and program
The programmable logic controller with a multi-core CPU allows users to selectively adjust parallel processing of program segments, addressing inflexibility in existing PLCs by enabling precise control over parallel execution.
Patent Information
- Application Number
- PCT/JP2024/015025
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2025-10-23
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, leading to inflexible job execution.
A programmable logic controller (PLC) with a multi-core CPU that includes a parallel processing execution determination unit, program segment allocation unit, start timing determination unit, and parallel processing execution control unit, allowing users to select and adjust parallel processing of program segments based on input information.
Enables users to precisely control parallel processing of program segments according to their specific needs, enhancing flexibility and efficiency in program execution.
Smart Images

Figure JP2024015025_23102025_PF_FP_ABST
Abstract
Description
Programmable logic controller, control method and program
[0001] The present disclosure relates to a programmable logic controller, a control method, and a program.
[0002] 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 have been 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 multiple CPU cores and measures the execution time. Based on the measured execution time of each parallel processing group, the plant control device automatically assigns the multiple parallel processing groups to 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 in which a user can interactively assign a target processor to be processed in a computer system capable of performing parallel processing using a plurality of independently operable processors. In Patent Document 2, the user is asked on a processor option sheet screen whether the target job should be executed in parallel processing or in independent CPU usage mode. 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.
[0005] JP 2015-210728 A JP 07-311743 A
[0006] In the device described in Patent Document 1, the user cannot select whether to execute parallel processing of a function block diagram, whereas in the system described in Patent Document 2, the user can select whether 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 parts of the job to process in parallel and at what timing depending on the purpose, which results in a problem in 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 to adjust the parallel processing of a program according to the user's purpose.
[0008] 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, based on information input by a user, whether to execute a program segment as a segment included in a program in parallel processing with a currently executing program; a program segment allocation unit that, when the program segment is to be executed in parallel processing, assigns the program segment to the second CPU core if the first CPU core is being used but the second CPU core is not being used during program execution; a start timing determination unit that, when the program segment is to be executed in parallel processing, determines, based on information input by the user, a start timing that is a timing for starting execution of the parallel processing of the program segment; and a parallel processing execution control unit that, when the program segment is to be executed in parallel processing, controls execution of the parallel processing of the program by starting execution of the program segment using the second CPU core from the determined start timing.
[0009] According to the present disclosure, by inputting information into a programmable logic controller, a user can select not only whether to execute program segments included in a program executed by the programmable logic controller in parallel processing, but also the start timing of the parallel processing of the program segments if the program segments are to be executed in parallel processing. Therefore, the programmable logic controller according to the present disclosure allows the user to select the parallel processing of the program segments in more detail according to the user's purpose than a programmable logic controller that does not determine the start timing of program segments 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 makes it easier for the user to adjust the parallel processing of a program according to the user's purpose.
[0010] FIG. 1 is a block diagram showing the configuration of an information processing system according to an embodiment; FIG. 2 is a block diagram showing the functional configuration of a PLC; FIG. 3 is a block diagram showing the hardware configuration of a PLC and an engineering tool; FIG. 4 is a diagram showing one display example of a parallel processing setting screen; FIG. 5 is a diagram showing another display example of a parallel processing setting screen; FIG. 6 is a diagram showing a display example of program management information;
[0011] A programmable logic controller, a control method, and a program according to embodiments of the present disclosure will be described in detail below with reference to the drawings. Note that identical or corresponding parts in the drawings are designated by the same reference numerals. Also, hereinafter, a "programmable logic controller" will be abbreviated as a "PLC."
[0012] (Regarding 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 for 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 send 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] (Regarding PLC 100) 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] Each CPU core of PLC 100 also includes an execution management unit that manages the execution of its own program. For example, first CPU core 110 includes first execution management unit 111, second CPU core 120 includes second execution management unit 121, and third CPU core 130 includes third execution management unit 131. Overall execution management unit 170 also includes a parallel processing execution determination unit 171 that determines whether a program component, which is a component included in a program, is to be executed in parallel with a currently executing program. Overall execution management unit 170 also includes a program component allocation unit 172 that assigns a program component to one of the multiple CPU cores. Overall execution management unit 170 also includes a start timing determination unit 173 that determines the start timing for starting the execution of parallel processing of the program components, and a parallel processing execution control unit 174 that controls the execution of parallel processing of the program.
[0016] (Regarding the Engineering Tool 200) The engineering tool 200 is an engineering setting tool, i.e., a computer device on which an engineering setting tool program is installed, which is a program for realizing 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 execution code for the program.
[0017] (Hardware Configuration of PLC 100) As shown in Fig. 3, PLC 100 includes a control unit 51 that executes processing in accordance with a control program 59. 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. 2.
[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 work 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 the program to the control unit 51 in accordance with instructions from the control unit 51, and stores data supplied from the control unit 51. The external storage unit 53 includes a non-volatile memory such as a flash memory, a hard disk drive (HDD), or a solid state drive (SSD). The external storage unit 53 functions as 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 transmitter / receiver 56 that transmits and receives information. The transmitter / receiver 56 includes information communication components such as a communication network terminal device that connects to a network and a wireless communication device. The transmitter / receiver 56 functions as the information receiver 150 shown in FIG. 2.
[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 receiving step performed by the information receiving 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 determination step performed by the parallel processing execution determination unit 171, and a program part allocation step performed by the program part allocation unit 172. Furthermore, 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] 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-described units 210, 211, 220, and 230 shown in FIG. 2 by the control unit 51 using the main memory unit 52, the external memory unit 53, the operation unit 54, the display unit 55, and the transmission / reception unit 56 as resources. For example, the engineering tool 200 executes a program generation step performed by the program generation unit 210 and an execution code generation step performed by the execution code generation unit 211. Furthermore, for example, the engineering tool 200 executes a parameter setting step performed by the parameter setting unit 220 and an information transmission step performed by the information transmission unit 230.
[0027] (Details of the Functional Configuration of the Engineering Tool 200) Returning to FIG. 2 , the program generation unit 210 writes a program when the user performs an operation to write a program using the operation unit 54. Here, the format of the program description includes not only the format of character data but also the format of graphic data. For example, the program description format is source code in the ST language and ladder diagrams in the ladder language. Furthermore, when the user performs an operation to generate execution code for the program using the operation unit 54, the program generation unit 210 causes the execution code generation unit 211 to generate execution code for the program.
[0028] The execution code generation unit 211 generates 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 the entry points of each program component that can be executed in parallel can be identified.
[0029] In this embodiment, a program component is, for example, execution code data for a function block that can execute parallel processing. That is, a program component includes a portion of data in a single program execution file. Therefore, the execution code generator 211 generates execution code so that the entry point of the portion of data that can execute parallel processing in a single 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 configures settings for parallel processing. As shown in Figures 4A and 4B, the parallel processing setting screen 300 includes a program component selection field 310 for selecting a program component to configure, and a parallel processing execution selection field 320 for selecting whether to execute the program using parallel processing. Furthermore, if execution using 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 component selection field 310 is a pull-down selection field for selecting one of the textual information items from a list of textual information items indicating the names of program components identified from the program execution file. For example, as shown in FIG. 1 , consider a case where a program includes a main program named "MAIN" and program components named "FbPou1" and "FbPou2" that indicate function blocks used by the main program. Note that these program components are not function blocks exclusive to the main program named "MAIN" but may also be used by other programs. In this case, the program component selection field 310 allows the user to select one of the textual information items from a list of textual information items, such as "FbPou1" and "FbPou2," that indicate the names of program components identified from the program execution file. Returning to FIG. 4A , the parallel processing execution selection field 320 is a pull-down selection field for selecting one of the textual information items from a list of textual information items, "Enable," indicating that parallel processing execution is enabled, and "Disable," indicating that parallel processing execution is 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 notified to start execution 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, consider a case where a user configures parallel processing for a program component whose name, i.e., "program component name," is "FbPou1." In this case, as shown in FIG. 4A , the user first selects the text information "FbPou1" in the program component selection field 310 using the operation unit 54, and then selects the text "enable" in the parallel processing execution selection field 320. Next, if the user selects the text information "operate when notified of execution start" in the start timing selection field 330 using the operation unit 54, a completion notification selection field 340 is displayed below the start timing selection field 330, allowing the user to select whether or not to notify other CPU cores of completion after execution is completed.
[0035] The completion notification selection field 340 is a pull-down selection field for selecting one of the textual information items from a list display of textual information items, "Enable," which indicates that a completion notification is to be sent, and "Disable," which indicates that a completion notification is to be disabled. Therefore, for example, the user can select the textual 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 setting of parallel processing by identifying from the information input into the parallel processing setting screen 300 shown in Figure 4A that the value of "Program component name" is "FbPou1", the value of "Parallel processing setting" is "Enabled", the value of "Start timing" is "When start command is notified", and the value of "Completion notification" is "Enabled".
[0037] Consider, for example, a case where a user is configuring parallel processing for a program component whose "program component name" is "FbPou2." In this case, as shown in FIG. 4B , the user first selects the text information "FbPou2" in the program component selection field 310 using the operation unit 54, and then selects the text information "enable" in the parallel processing execution selection field 320. Next, if the user selects the text 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 user can input the number of executions specified by the user is displayed below the start timing selection field 330. Therefore, for example, the user can input the text information "5" into the execution count input field 350 using the operation unit 54.
[0038] 4B, the parameter setting unit 220 sets parameters related to the setting of parallel processing by identifying that the value of "Program Component Name" is "FbPou2," the value of "Parallel Processing Setting" is "Enabled," the value of "Start Timing" is "Every Execution Count of the Main Program," and the value of "Number of Executions" is "5." 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 on the execution code of a main program named "MAIN" and data on the execution codes of program parts named "FbPou1" and "FbPou2." Furthermore, 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 the start of execution," and the value of "Completion notification" is "Enable."
[0040] (Details of Functional Configuration of PLC 100) 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] The overall execution management unit 170 generates program management information, which is information for managing programs, based on the executable files and parameter information of the programs stored in the information storage unit 160, and stores the information in the information storage unit 160.
[0042] The program management information stored in the information storage unit 160 is information that can be displayed in the form of a table, for example, as shown in Fig. 5, and is information that indicates 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 that indicates that for a main program with a "name" of "MAIN," the "start address" indicating the entry point is "0x00AB" and the value of "parallel processing setting" is "invalid."
[0043] Furthermore, for example, the program management information includes information indicating that, for a program component 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." Furthermore, for example, the program management information includes information indicating that, for a program component 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, 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 executes the program. The 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 to execute program segments included in a program by parallel processing based on the program management information. For example, the parallel processing execution determination unit 171 determines that the program segments with the "Name" of "FbPou1" and the "FbPou2" are to be executed by parallel processing because the value of the "Parallel Processing Setting" is "Enabled."
[0046] When executing program components in parallel processing, the program component allocation unit 172 obtains information indicating the program execution status from the execution management unit of each CPU core, and assigns program components to be executed in parallel processing if there is a CPU core that is not executing the program. Consider, for example, 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 components. In this case, the program component allocation unit 172 obtains information indicating the program execution status indicating that the program is being executed from the first execution management unit 111 of the first CPU core 110, and obtains information indicating the program execution status indicating that the program is not being executed from the second execution management unit 121 of the second CPU core 120. Therefore, the program component allocation unit 172 can allocate program components to the second CPU core 120.
[0047] Therefore, for example, after determining that a program segment having a "name" of "FbPou1" is to be executed in parallel processing, the program segment allocation unit 172 acquires information indicating the program execution status from the execution management unit of each CPU core. Then, based on the program execution status of each CPU core, the program segment allocation unit 172 can assign the program segment having a "name" of "FbPou1" to the second CPU core 120, which is not executing a program. Furthermore, for example, after determining that a program segment having a "name" of "FbPou2" is to be executed in parallel processing, the program segment allocation unit 172 acquires information indicating the program execution status from the execution management unit of each CPU core. Then, based on the program execution status of each CPU core, the program segment allocation unit 172 can assign the program segment having a "name" of "FbPou2" to the third CPU core 130, which is not executing a program.
[0048] When a program segment is to be executed by 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 segment having a "name" of "FbPou1" is to be executed by parallel processing, the start timing determination unit 173 determines that the value of the "start timing" of the program segment is "when a start command is notified." Also, for example, after determining that a program segment having a "name" of "FbPou2" is to be executed by parallel processing, the start timing determination unit 173 determines that the value of the "start timing" of the program segment is "every execution count of the main program."
[0049] When executing a program segment in parallel processing, the parallel processing execution control unit 174 controls the start of execution of the program segment from the determined start timing. Consider, for example, the case where a program segment 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 segment "upon notification of a start command," i.e., upon receiving information indicating a start command from another program segment being executed by another CPU core. At this time, the parallel processing execution control unit 174 determines that the value of the "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 issue 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 segment having the "Name" "FbPou1" when it receives information indicating a start command from the parallel processing execution control unit 174. Furthermore, the second execution management unit 121 can output information indicating that execution has been completed to the parallel processing execution control unit 174 after the execution of the program segment is completed. The parallel processing execution control unit 174 can then output information indicating that execution has been completed to the other CPU cores that are executing the other program segments that issued the start command, allowing the other CPU cores to continue processing after the execution has been completed.
[0051] Consider, for example, a case where a program segment with a "name" of "FbPou2" is executed in parallel 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 segment "every execution count of the main program," i.e., when the execution count of the main program being 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 determines that the value of the "execution count" is "5" based on the program management information, and when starting execution of the main program whose execution count becomes an integer multiple of 5, it outputs information indicating a start command to the third CPU core 130. As a result, the third execution management unit 131 of the third CPU core 130 can start execution of the program segment with a "name" of "FbPou2" when it obtains information indicating a start command from the parallel processing execution control unit 174.
[0052] (Regarding Information Input / Output When Executing Parallel Processing) The input / output of information between the overall execution management unit 170 and each CPU core when executing parallel processing will be described in detail below with reference to FIGS. 6A and 6B . First, consider the case where a program segment with a "name" of "FbPou1" is executed in parallel processing using the second CPU core 120. In this case, as shown in FIG. 6A , the overall execution management unit 170 first obtains information indicating the program execution status from the second execution management unit 121 and determines that the second CPU core 120 is not executing the program. Next, the overall execution management unit 170 assigns the program segment to the second CPU core 120 by outputting the program segment to the second CPU core 120. Next, the overall execution management unit 170 obtains information indicating a start command from another CPU core, and then outputs information indicating the start command and information instructing the second CPU core 120 to issue a completion notification to the second CPU core 120. Then, the overall execution management unit 170 obtains information indicating that the execution of the program segment has been completed after the second CPU core 120 has executed the program segment. As a result, the overall execution management unit 170 can output information indicating that parallel processing of the program segment has been completed to the other CPU core that issued the start command for the program segment.
[0053] Next, consider the case where a program segment with a "name" of "FbPou2" is executed in parallel using the third CPU core 130. In this case, as shown in FIG. 6B , the overall execution management unit 170 first obtains information indicating the program execution status from the third execution management unit 131 and determines that the third CPU core 130 is not executing a program. Next, the overall execution management unit 170 assigns the program segment to the third CPU core 130 by outputting the program segment to the third CPU core 130. The overall execution management unit 170 then counts the number of times that execution of the main program has been started on the other CPU cores, and when the counted number reaches an integer multiple of a number 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 segment when the number of times the main program has been executed reaches an integer multiple of a number predetermined by the user.
[0054] (Flowchart of Parallel Processing Execution Control Process) Next, control of the PLC 100 executing parallel processing of a program will be described using a flowchart. When the PLC 100 is powered on by a 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 and parameter information of the program 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 and parameter information of the program stored in the information storage unit 160 and stores the information 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 the program execution starts, the parallel processing execution determination unit 171 determines whether to execute each program component in parallel processing based on the program management information (step S104). For example, the parallel processing execution determination unit 171 determines to execute the program components with the "names" "FbPou1" and "FbPou2" in parallel processing.
[0056] After determining to execute parallel processing, the overall execution management unit 170 determines whether there are any program components to be executed by parallel processing (step S105). If there are no program components to be executed by parallel processing (step S105; N), the overall execution management unit 170 terminates the processing. On the other hand, if there are program components to be executed by parallel processing (step S105; Y), the program component allocation unit 172 acquires information indicating the program execution status from the execution management unit of each CPU core and allocates the program components to be executed by parallel processing to CPU cores that are not executing the program (step S106). For example, the program component allocation unit 172 allocates the program components with the "names" "FbPou1" and "FbPou2" to the second CPU core 120 and the third CPU core 130.
[0057] After the program segments are allocated, the start timing determination unit 173 determines the start timings of the program segments 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 segment having the "name" "FbPou1" is "upon notification of a start command" and the start timing of the program segment having 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 any program segment 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 time to start execution of the program segment assigned to the second CPU core 120. Furthermore, for example, when the number of executions of the main program being executed by another CPU core becomes an integer multiple of 5, which is a number predetermined by the user, the parallel processing execution control unit 174 determines that it is time to start execution of the program segment assigned to the third CPU core 130.
[0059] If there is a program segment whose start timing has arrived (step S108; Y), the parallel processing execution control unit 174 controls the second CPU core 120 to start executing the program segment whose start timing has arrived (step S109), and returns to step S108. For example, the parallel processing execution control unit 174 controls the second CPU core 120 to start executing the program segment, and then acquires information from the second CPU core 120 indicating that execution has been completed and outputs the information to the other CPU core. Also, for example, the parallel processing execution control unit 174 controls the third CPU core 130 to start executing the program segment.
[0060] On the other hand, if there is no program component whose start timing has arrived (step S108; N), the parallel processing execution control unit 174 determines whether the program being executed has finished (step S110). If the program being executed has not finished (step S110; N), the parallel processing execution control unit 174 repeats the processing of steps S108 to S110 until the program has finished. Then, if the program being executed has finished (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 determination unit 171 determines whether or not to execute a program part included in a program in parallel with a currently running program, based on parameter information, which is an example of information input by a user via the engineering tool 200.
[0062] Furthermore, when executing program segments by parallel processing, the program segment allocation unit 172 assigns program segments to the second CPU core 120 if the first CPU core 110 is being used but the second CPU core 120 is not being used during program execution. Furthermore, when executing program segments by parallel processing, the start timing determination unit 173 determines the start timing of the program segments based on parameter information. Then, when executing program segments by parallel processing, the parallel processing execution control unit 174 controls the execution of parallel processing of the program by starting execution of the program segments using the second CPU core 120 from the determined start timing.
[0063] In this manner, by transmitting parameter information input by the user from the engineering tool 200 to the PLC 100, the user can select whether or not to execute program segments included in a program executed by the PLC 100 in parallel processing. If the program segments are to be executed in parallel processing, the user can also select the start timing of the parallel processing of the program segments. Therefore, the PLC 100 according to this embodiment allows the user to select the parallel processing of the program segments in more detail according to the user's purpose than a PLC that does not determine the start timing of program segments 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 user's purpose.
[0064] Furthermore, according to the information processing system 1 of this embodiment, the program components executed in parallel by the PLC 100 during program execution include data for realizing one or more functions contained in one program execution file. In this way, the PLC 100 of this embodiment can execute, for example, the execution code data of function blocks contained in one program execution file as program components in parallel during program execution.
[0065] (Modification) While the present embodiment illustrates execution code data of function blocks capable of parallel processing as program components, this is not limiting as long as parallel processing is possible. For example, if there are multiple program executable files generated by the execution code generation unit 211 and the execution code data of a subroutine program is included in the multiple program executable files, the program components may be the execution code data of the multiple subroutine programs included in the multiple program executable files. In other words, if there are multiple program executable files for a program, the program components in this disclosure also include data for implementing one or more functions included in one or more program executable files. In this case, the execution code generation unit 211 generates execution code such that the entry points of the execution code data of the multiple subroutine programs, which are program components capable of parallel processing, are identifiable. In this way, when there are multiple program executable files, the PLC 100 can execute program components that implement one or more functions using the execution code data of 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 capable of executing 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 this is not limiting, 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. Furthermore, for example, the user may directly input information using the operation unit 54 in the PLC 100.
[0068] In this embodiment, the user selects one of the three types of start timings 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 when a predetermined time has elapsed since the start of program execution or when execution of a specific program segment has ended, as the start timing.
[0069] In this embodiment, the execution code data of a function block is used as an example of a portion of data in a single program execution file. However, this is not limited to this, as long as it can be executed in parallel with the currently running program. For example, it may be one or more commands, each of which has a specific start and end point, among multiple commands constituting a program routine. In other words, a program component does not have to be a collection of multiple commands constituting a single function routine, as in a function block. It may be one or more commands that form part of a program routine and have a specific start and end point. In this case, it is necessary to generate the execution code so that at least the entry point of one or more commands that can be executed in parallel must be identifiable. In this way, program components can be adjusted from a single command in a single 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 component for all program components that can execute parallel processing using the engineering tool 200. However, this is not limiting. For example, the user may be able to set parameters related to parallel processing for only a specific program component out of all program components that can execute parallel processing.
[0071] The PLC 100 and the engineering tool 200, which are the core parts that perform the processing and which include the control unit 51, main memory unit 52, external memory unit 53, operation unit 54, transmission / reception unit 56, and internal bus 50, may be configured to perform the above-described processing by, for example, storing and distributing a program for executing the above-described operations in a recording medium, such as a flash memory, that can be read by the PLC 100 and the engineering tool 200, and installing the program. Alternatively, the program may be stored in a storage device of a server device on a communication network such as a LAN (Local Area Network) or the Internet, and downloaded by the PLC 100 and the engineering tool 200 to configure a computer.
[0072] Furthermore, if the functions of the PLC 100 and the engineering tool 200 are realized by sharing the functions of an OS (operating system) and an application program, or by collaboration between the OS and the application program, only the application program portion may be stored in a recording medium or storage device.
[0073] The program may also be superimposed on a carrier wave and provided via a communication network. For example, the program may be posted on a bulletin board system (BBS) on the communication network and provided via the network. The program may then be started and executed under the control of the OS in the same way as other application programs, thereby executing the above-described processing.
[0074] The present disclosure allows various embodiments and modifications without departing from the broad spirit and scope of the present disclosure. Furthermore, the above-described embodiments are intended to explain the present disclosure and do not limit the scope of the present disclosure. In other words, the scope of the present disclosure is defined by the claims, not the embodiments. Various modifications made within the scope of the claims and the meaning of equivalent disclosures are considered to be within the scope of the present disclosure.
[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, comprising: a parallel processing execution determination unit that determines, based on information input by a user, whether to execute a program component as a component included in the program in parallel processing with the program currently being executed; a program component allocation unit that, when executing the program component in parallel processing, assigns the program component to the second CPU core if the first CPU core is being used during execution of the program but the second CPU core is not being used; a start timing determination unit that, when executing the program component in parallel processing, determines, based on information input by the user, a start timing that is the timing to start executing the parallel processing of the program component; and a parallel processing execution control unit that, when executing the program component in parallel processing, controls the execution of the parallel processing of the program by starting the execution of the program component using the second CPU core from the determined start timing.
2. The programmable logic controller according to claim 1, wherein the program parts are configured by data for realizing one or more functions contained in one program execution file of the program.
3. The programmable logic controller according to claim 1, wherein, when there are multiple program execution files for the program, the program components are configured by data for realizing one or more functions contained in one or more program execution files.
4. A control method for 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: a parallel processing execution determination step in which the programmable logic controller determines whether or not to execute program components included in the program in parallel processing based on information input by a user; a program component allocation step in which, when the programmable logic controller executes the program components in parallel processing, if the programmable logic controller is using the first CPU core but not the second CPU core during execution of the program, assigns the program components to the second CPU core; a start timing determination step in which, when the programmable logic controller executes the program components in parallel processing, based on information input by the user, determines a start timing at which to start executing parallel processing of the program components; and a parallel processing execution control step in which, when the programmable logic controller executes the program components in parallel processing, starts execution of the program components using the second CPU core from the determined start timing.
5. A program that causes a programmable logic controller capable of executing parallel processing of a program using at least a first CPU core and a second CPU core to function as: a parallel processing execution determination unit that determines whether or not to execute a program component included in the program using parallel processing based on information input by a user; a program component allocation unit that, when executing the program component using parallel processing, assigns the program component to the second CPU core if the first CPU core is being used during execution of the program but the second CPU core is not being used; a start timing determination unit that, when executing the program component using parallel processing, determines the start timing, which is the timing to start executing the parallel processing of the program component, based on information input by the user; and a parallel processing execution control unit that, when executing the program component using parallel processing, starts execution of the program component using the second CPU core from the determined start timing.
Citation Information
Patent Citations
Dynamic core selection for heterogeneous multicore systems
JP2014507737A
Control device
JP2018132829A
Controller
JP2020061104A
Device-based Engineering System for Programmable Logic Controllers
US20200034218A1