This application claims priority from Japanese Patent Application No. 2009-003157, filed on Jan. 9, 2009, the entire contents of which are incorporated by reference herein.
1. Technical Field
The present disclosure relates to a field control device and a field control method. More particularly, the present disclosure relates to a filed control device and a field control method capable of selectively and sequentially executing control tasks relating to a field control and other tasks in the same control period.
2. Related Art
In the field controller, a minimum unit of function of executing control operations is called a block, and plural types of blocks exist. When plural types of blocks are combined mutually and data input from the external device and data output to the external device are employed in combination, various control executive functions are implemented. The object is controlled by executing the control executive functions repeatedly within a given period (scan period). A length of the scan period is set in response to a rate of change of the controlled object, and the control that is made in a higher-speed scan period is required of the controlled object that changes more quickly. Therefore, the control tasks (tasks that execute the calculations necessary for the control) that have plural scan periods are present in response to the controlled object. Also, functions of responding to the request (interrupt) made by the external device and functions other than the control executive functions are allocated to the field controller. These functions must be performed in real time (soft real time).
In order to execute the plural functions, the priorities that specify the execution sequence of respective functions are decided in the field controller in advance. Normally, the priorities of the tasks, which need the real time processing at a high level, and the external interrupts are set higher than those of the control tasks (see e.g., JP-A-2006-163730).
Owing to the influence of the external interrupt or the task whose priority is high, a delay occurs in starting the control task. Depending on whether or not the delay arises or a variation in the delay, a deviation is caused in starting the scan. In this case, the function with higher priority is designed to have a shorter processing time, so that fluctuation (jitter) in control is suppressed to such extent that it does not affect the controllability.
However, when the higher-speed scan (e.g., the scan within about 10 ms period) is required of the control task, in the related-art system, fluctuation (jitter) in control might cause a bad influence upon the control. In some cases, an omission of the process corresponding to one period of the scan periods (scan omission) might be caused. Accordingly, there is a problem in that the field control is not controlled in a stable state.
Exemplary embodiments of the present invention address the above disadvantages and other disadvantages not described above. However, the present invention is not required to overcome the disadvantages described above, and thus, an exemplary embodiment of the present invention may not overcome any of the problems described above.
Accordingly, it is an illustrative aspect of the present invention to provide a field control device and a field control method, capable of handling control tasks requiring a high-speed scan.
According to one or more aspects of the present invention, there is provided a field control device. The field control device includes: a task executing unit configured to selectively and sequentially execute a control task relating to a field control and other tasks in a same control period; and a priority switching unit configured to switch a relative priority of the control task relative to the other tasks in the control period, wherein the priority is a priority of an execution sequence of tasks in the task executing unit. The priority switching unit is configured to: i) set the priority higher than a certain priority, before the control task is started; and ii) set the priority lower than the certain priority, after the control task is ended.
According to the present invention, the relative priority of the control task relative to other tasks is set higher than the certain priority before the control task is started. Meanwhile, the relative priority of the control task is set lower than the certain priority after the control task is ended. Therefore, fluctuation (jitter) of control in the control task can be suppressed effectively.
Other aspects of the invention will be apparent from the following description, the drawings and the claims.
Exemplary embodiments of the present invention will be explained with reference to
As shown in
The field controller 2 includes: a task executing unit 21 that executes sequentially and selectively the control task relating to the field control and other tasks; a priority switching unit 22 that switches a relative priority of the control task with respect to other tasks within a control period in the execution sequence of the tasks in the task executing unit 21; and a delay timer 23 that gives an interrupt as a hardware to switch the priority.
A group of input/output modules for performing a communication with the field devices are installed into the field controller 2.
Next, an operation of the field controller 2 will be described hereunder.
The operation in
In step S1 in
Then, in step S2, the delay timer 23 is set in response to an interrupt at a “level 2” indicating the start of control period (time t0 or time t1 in
Then, in step S3, the process is halted until the “high-speed scan” in the control task is started. If the “high-speed scan” is started, the process goes to step S4. This “high-speed scan” is started when the external interrupt at the “level 2” is ended (e.g., time t01 or time t11 in
Then, in step S4, a status of the control task is set to ready, and the interrupt at the “level 1” is masked. As a result, the interrupts whose priority is low and which are produced in a great deal, e.g., IO (input/output) interrupt corresponding to the interrupt at the “level 1” are eliminated.
Then, in step S5, the process is halted until the “high-speed scan” in the control task is ended (time t02 or time t12 in
In step S6, a mask of the interrupt at the “level 1” is released.
At the same time, in step S7, the priority of the “high-speed scan” in the control task is lowered to priorities corresponding to a “low-speed scan” and a “middle-speed scan” in the control task.
In step S8, the process is halted until the interrupt is issued by the delay timer 23 (time t03 or a time t13 in
In step S9, the priority of the “high-speed scan” in the control tasks is set to an initial value of priority. This initial value of the priority is set to a value that is higher than the priority of the external interrupt at the “level 1”. This process is similar to that in step S1. As shown in
In step S10, the process is halted until the process goes to a state that the “high-speed scan” in the control tasks can be immediately started. If the process goes to a desired state, the process goes to step S11.
In step S11, a status of the control task is brought into a suspend status. Then, the process goes back to step S2.
Here, the operation shown in
According to the field control device of the exemplary embodiment, fluctuation of the scan caused by the interrupt can be suppressed. Therefore, it is possible to apply the control using the high-speed scan (e.g., the scan in about 10 ms period), in which the scan omission is never caused. As a result, even when the high-speed and the high controllability are requested in the turbine and the like, the direct control performed by the field controller 2 can be applied.
While the present invention has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. It is aimed, therefore, to cover in the appended claim all such changes and modifications as fall within the true spirit and scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2009-003157 | Jan 2009 | JP | national |