CONTROLLER
20190384637 ยท 2019-12-19
Assignee
Inventors
Cpc classification
G06F9/4881
PHYSICS
International classification
Abstract
A controller includes: a task execution management table in which task information including information on task priority is registered; a new task acquisition unit that acquires new task information to be added to the task execution management table; a temporary priority setting unit that changes a priority included in the new task information, to a temporary priority to temporarily register the new task information in the task execution management table; and a task execution monitoring unit that monitors an influence of execution of an additional task on execution of an existing task, the additional task being a task corresponding to the temporarily registered new task information.
Claims
1. A controller comprising: a processor to execute a program; and a memory to store the program which, when executed by the processor, performs: a process of providing a task execution management table in which task information including information on task priority is registered; a new task acquisition process of acquiring new task information to be added to the task execution management table; a temporary priority setting process of changing a priority included in the new task information, to a temporary priority to temporarily register the new task information in the task execution management table; and a task execution monitoring process of monitoring an influence of execution of an additional task on execution of an existing task, the additional task being a task corresponding to the temporarily registered new task information, wherein when the execution of the additional task does not affect the execution of the existing task, the temporary priority setting process changes the priority included in the temporarily registered task information, to the original priority set prior to being changed to the temporary priority, and formally registers the changed task information in the task execution management table.
2. A controller comprising: a processor to execute a program; and a memory to store the program which, when executed by the processor, performs: a process of providing a task execution management table in which task information including information on task priority is registered; a new task acquisition process of acquiring new task information to be added to the task execution management table; a temporary priority setting process of temporarily registering the new task information in the task execution management table, and changing a priority included in the temporarily registered task information to a temporary priority; and a task execution monitoring process of monitoring an influence of execution of an additional task on execution of an existing task, the additional task being a task corresponding to the temporarily registered new task information having the priority changed to the temporary priority, wherein when the execution of the additional task does not affect the execution of the existing task, the temporary priority setting process changes the priority included in the temporarily registered task information, to the original priority set prior to being changed to the temporary priority, and formally registers the changed task information in the task execution management table.
3. The controller according to claim 1, wherein when the additional task is successfully completed within a preset task execution cycle, the task execution monitoring process determines that the execution of the additional task does not affect the execution of the existing task.
4. The controller according to claim 1, wherein the temporary priority setting process designates, as the temporary priority, a priority lower than any priority included in existing task information registered in the task execution management table.
5. (canceled)
6. The controller according to claim 2, wherein when the additional task is successfully completed within a preset task execution cycle, the task execution monitoring process determines that the execution of the additional task does not affect the execution of the existing task.
7. The controller according to claim 2, wherein the temporary priority setting process designates, as the temporary priority, a priority lower than any priority included in existing task information registered in the task execution management table.
8. The controller according to claim 3, wherein the temporary priority setting process designates, as the temporary priority, a priority lower than any priority included in existing task information registered in the task execution management table.
9. The controller according to claim 6, wherein the temporary priority setting process designates, as the temporary priority, a priority lower than any priority included in existing task information registered in the task execution management table.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
DESCRIPTION OF EMBODIMENT
[0018] Hereinafter, a controller according to an embodiment of the present invention will be described in detail based on the drawings. The present invention is not limited to the embodiment.
[0019] Embodiment
[0020]
[0021] The CPU 101 executes programs such as an operating system (OS) and a user program stored in the memory 102. The input/output interface 103 is an interface for connection to a device that is to be controlled (not illustrated). In accordance with a program executed by the CPU 101, the input/output interface 103 performs input/output for input/output (I/O) control, thereby controlling the connected device. The field communication interface 104 communicates with other controllers and information systems in accordance with a program executed by the CPU 101.
[0022]
[0023] The scheduler 11 of the task execution unit 10 determines the order of execution of the tasks on the basis of the task information registered in the task execution management table 12, such that the tasks are executed by the task execution unit 10.
[0024] The priority of a task is an index for the scheduler 11 to select the task to that is be executed. The scheduler 11 selects the highest priority task from among executable tasks. The priorities of tasks range between multiple degrees, for example, from 0 to 255 degrees. The lower the degree is, the higher the priority, of the task is. The task having such a higher priority preferentially undergoes the scheduling. The scheduling that is performed by the scheduler 11 can be preemptive scheduling, i.e. a scheduling employing a scheme under which when a higher priority task becomes executable during the execution of a task, the execution is immediately switched to effect the execution of such a task higher in priority than the task being executed. For the task execution management table 12 illustrated in
[0025] A task for the controller 1 has to be repeatedly executed, such as the task of performing feedback control at regular intervals, for example. The time interval between executions, that is, the time period from when a task becomes executable until when the same task becomes executable again, is the execution cycle illustrated in
[0026] In the present embodiment, the task execution unit 10 includes the scheduler 11. Alternatively, the scheduler 11 and the task execution unit 10 may be configured separately.
[0027] Next, a description is made as to an example of how the controller 1 operates, in particular, how the controller 1 operates when the user of the controller 1 adds a new task during operations of a plurality of tasks. The task to be added has a target priority, i.e. the priority that should be set. The target priority is predetermined by the user. In view of the processing contents of the task to be added, the user determines the target priority such that the task can operate at the necessary timing. The method of determining the target priority is outside the scope of the present invention.
[0028] In adding a task to be executed by the controller 1, the user uses an engineering tool, i.e. application software for setting the controller 1. This application software is executed by a personal computer connected to the controller 1 via the field communication interface 104 illustrated in
[0029] The engineering tool for setting the controller 1 displays a new task addition window 1000 illustrated in
[0030] The user enters necessary information to the additional task setting area 1001, the priority setting area 1002, and the execution cycle specification area 1003. The entry of information is completed by pressing the specify button included in each setting area. At this time, the engineering tool may determine whether the entered information is correct if the information is incorrect, the engineering tool may, for example, display a notification to that effect, so as to prompt the user to enter information again. The entered information is considered incorrect if, for example, the entered degree of priority is not within the valid range. When completing the entry of necessary information to the priority setting area 1002 and the execution cycle specification area 1003, the user presses the run button 1004. Upon receiving this operation, the engineering tool generates task information including the entered information, that is, the name, priority, and execution cycle of the task to be added, and transmits the task information to the controller 1. As a result, the controller 1 executes processing (described later) to add the task to the task execution management table 12, that is, add the task information received from the engineering tool to the task execution management table 12. Note that, the new task acquisition unit 16 of the controller 1 receives the task information transmitted from the engineering tool. When the result of the task addition process is transmitted from the controller 1, the engineering tool displays the result of the addition process on the display area 1005 of the new task addition window 1000.
[0031] The controller 1 will be explained again. The controller 1 executes the procedure illustrated in
[0032] Once the controller 1 receives the task information on a task to be added, the temporary priority setting unit 13 first determines the temporary priority of the task to be added (step S1). The temporary priority is a priority to be used in the process of determining whether the task corresponding to the task information received from the engineering tool can be added. The temporary priority setting unit 13 designates, as the temporary priority, a value that does not affect the execution timings of the existing tasks. Hereinafter, the task to be added is referred to as an additional task, and the task information on the task to be added is referred to as additional task information In step S1, the temporary priority setting unit 13 determines the temporary priority in accordance with the procedure illustrated in
[0033]
[0034] Reference is made back to the flowchart illustrated in
[0035] Next, the scheduler 11 schedules the additional task corresponding to the additional task information temporarily registered in the task execution management table 12 (step S3). Note that the scheduler 11 also schedules the existing tasks as well as the additional task. Thereafter, the additional task is periodically executed in accordance with the scheduling result.
[0036] The task execution monitoring unit 14 monitors the execution completion timing of the additional task, and registers the monitoring result, that is, information on the execution completion timing of the additional task, in the task execution state storage unit 15. The task execution monitoring unit 14 also analyzes the registered information (step S4). In step S4, the task execution monitoring unit 14 executes each step illustrated in
[0037]
[0038] Next, the task execution monitoring unit 14 determines the number of verification actions required to determine the achievement of the deadline for the additional task. Specifically, the task execution monitoring unit 14 determines the number of executions (L) of the additional task and the reference number (M) of deadline achievements that should be satisfied (step S22). The purpose of this step is to determine the achievement of the deadline statistically appropriately in view of fluctuations in the execution time of the additional task. An exemplary method of determining the number of executions L and the reference number M includes assuming that the execution time of the additional task is normally distributed, and calculating the number of executions L of the additional task and the reference number M of deadline achievements on the basis of the reliability required by the user. This method of determining the required number of executions and the required number of deadline achievements is based on the premise that the task execution monitoring unit 14 holds in advance information on the reliability required by the user.
[0039] Next, the task execution monitoring unit 14 acquires, from the task execution unit 10, information on the execution completion timing of the additional task. The task execution monitoring unit 14 also registers the acquired information in the task execution state storage unit 15 so as to utilize the information for analysis (step S23).
[0040] Next, the task execution monitoring unit 14 checks whether the number of pieces of information registered in the task execution state storage unit 15, that is, the number (N) of pieces of information on the execution completion timing of the additional task, is equal to the number of executions (L) of the additional task determined in step S22 above (step S24). If N=L is not satisfied (step S24: No), the task execution monitoring unit 14 returns to step S23 to execute again the process of acquiring information on the execution completion timing of the additional task and registering the acquired information in the task execution state storage unit 15. If N=L is satisfied (step S24: Yes), the task execution monitoring unit 14 calculates the number of deadline achievements for the additional task (step S25). In step S25, the task execution monitoring unit 14 analyzes the N pieces of information registered in the task execution state storage unit 15, calculates the number of items of information in which the length of time from when the additional task becomes executable until when the additional task is completed is less than the deadline. Then, the number of pieces of information in which such length of time is less than the deadline is set as the number of deadline achievements by the task execution monitoring unit 14. Note that on the basis of the execution cycle of the additional task temporarily registered in the task execution management table 12, the task execution monitoring unit 14 obtains the timing at which the additional task becomes executable.
[0041] Next, the task execution monitoring unit 14 checks whether the number of deadline achievements calculated in step S25 is equal to or more than the reference number N of deadline achievements determined in step S22 (step S26). If M(the number of deadline achievements) is satisfied (step S26: Yes), the task execution monitoring unit 14 determines that the additional task satisfies the deadline (step S27). In a case where the additional task satisfies the deadline, all the tasks can be normally executed, that is, all the tasks satisfy their own deadlines even after the additional task is formally added. On the other hand, if (the number of deadline achievements)<M: is satisfied (step S26: No), the task execution monitoring unit 14 determines that the additional task does not satisfy the deadline (step S28). In a case where the additional task does not satisfy the deadline, one or more tasks cannot be normally executed, that is, one or more tasks do not satisfy their own deadlines after the additional task is formally added. Since the formal addition of the additional task that does not satisfy the deadline causes failure, the additional task is not allowed to be formally added.
[0042] Reference is made back to the flowchart illustrated in
[0043] On the other hand, if the analysis result provided by the task execution monitoring unit 14 in step S4 indicates that the additional task does not satisfy the deadline (step S5: No), the temporary priority setting unit 13 notifies the user that the task cannot be added (step S8). In step S8, the temporary priority setting unit 13 notifies the engineering tool via the new task acquisition unit 16 that the task corresponding to the task information received from the engineering tool cannot be added. As a result, the notification to the effect that the task cannot be added is displayed by the engineering tool on the new task addition window 1000 illustrated in
[0044] Next, a specific example in which the controller 1 executes the operation illustrated in
[0045] The operation example illustrated in
[0046] In the state illustrated in
[0047]
[0048] In the example illustrated in
[0049] As described above, the controller 1 according to the present embodiment holds the task execution management table 12 in which task information is registered for use in task scheduling. In response to receiving, from the outside, in particular, from the engineering tool, new task information to be registered in the task execution management table 12, the controller 1 changes the priority included in the received task information, or additional task information, to a temporary priority lower than any priority included in the existing task information registered in the task execution management table 12. Then, the controller 1 temporarily registers the changed additional task information in the task execution management table 12. Next, in accordance with the task execution management table 12, the controller 1 executes the existing tasks and the task to be added. If the task to be added can be normally completed, the controller 1 determines that the addition of the task does not affect the existing tasks, that is, all the tasks can be normally completed even after the task is added. Note that all the tasks are the additional task and the existing tasks. If the task to be added can be normally completed, the controller 1 changes the priority included in the additional task information from the temporary priority to its original priority, and formally registers the additional task in the task execution management table 12. On the other hand, if the task to be added cannot be normally completed, the controller 1 deletes the temporarily registered additional task information from the task execution management table 12. Consequently, the controller 1 can change settings so as to execute a new task after making sure that the new task does not significantly affect the existing tasks. Therefore, while controlling an instrument at a production site or the like, the controller 1 can keep controlling the instrument normally and add a new task for execution.
[0050] In the embodiment described above, upon receiving new task information, the controller 1 changes the priority included in the received task information, or additional task information, to the temporary priority and temporarily registers the additional task information in the task execution management table 12. However, the present invention is not limited to this procedure. Upon receiving new task information, the controller 1 may temporarily register the received task information, or additional task information, in the task execution management table 12, and may change the priority included in the temporarily registered additional task information to the temporary priority.
[0051] The configuration described in the above-mentioned embodiment indicates an example of the contents of the present invention. The configuration can be combined with another well-known technique, and a part of the configuration can be omitted or changed in a range not departing from the gist of the present invention.
REFERENCE SIGNS LIST
[0052] 1 controller; 10 task execution unit; 11 scheduler; 12 task execution management table; 13 temporary priority setting unit; 14 task execution monitoring unit; 15 task execution state storage unit; 16 new task acquisition unit; 17 OS; 19 task; 101 CPU; 102 memory; 103 input/output interface; 104 field communication interface; 105 bus.