1. Field of the Invention
The present invention relates to a programmable controller for executing sequence programs.
2. Description of Related Art
A programmable controller executes a sequence program to perform control (M-function, T-function) of a numerical control section of a numerical controller as well as control of peripheral devices such as a workpiece loader and an automatic tool changer (ATC).
As a result of recent enhancement in functionality of machinery, it is often the case that a new peripheral device is added to an existing system. In such cases, a control program for controlling the additional peripheral device is often added as a sequence program for the programmable controller. Also, such a control program is added as a sequence program in order to automate the machine operation. Consequently, the number of sequence programs to be executed by the programmable controller increases, making the maintenance and management of the programs difficult.
To solve the problem, a method has recently been employed wherein sequence programs for controlling the basic parts of the machine and sequence programs for controlling additional peripheral devices are separately prepared. The processor of the programmable controller executes a plurality of sequence programs fraction by fraction successively so that the sequence programs may appear to be executed in parallel, thus facilitating maintenance of the sequence programs.
To execute a plurality of sequence programs in parallel, a ratio of execution time for the fractions of the sequence programs in each execution cycle, and the sequence programs are executed in accordance with the set ratio.
A programmable controller capable of automatically changing the execution time ratio, as provided by the present invention, is neither known in the art nor disclosed in publications.
In the case where a plurality of sequence programs are executed in parallel in the ratio set according to the predetermined execution times, however, the overall efficiency of the sequence programs sometimes lowers if the execution time of the sequence programs for the numerical control section and the execution time of the sequence programs for the peripheral device are in an inappropriate ratio.
The present invention provides a programmable controller capable of freely altering an execution time ratio for a plurality of sequence programs.
The programmable controller of the present invention executes a plurality of sequence programs by repeating an execution cycle of successively executing fractions of the plurality of sequence programs. According to one aspect of the present invention, the programmable controller comprises: a plurality of execution time ratio tables storing different execution time ratios according to which the fractions of the plurality of sequence programs are successively executed in each execution cycle; selecting means for selecting one of the plurality of execution time ratio tables in execution of the plurality of sequence programs; and execution means for successively executing the fractions of the plurality of sequence programs according to the execution time ratio stored in the selected execution time ratio table, thereby the execution time ratio is alterable at desired time in executing the sequence programs.
The selecting means may have a reference table storing relation between bit information and the plurality of execution time ratio tables, and may select one of the plurality of execution time ratio tables in accordance with the reference table and the bit information described in the sequence programs.
Further, the selecting means may select one of the plurality of execution time ratio tables in accordance with a parameter described in the sequence programs, or in accordance with a manual operation by-an-operator.
According to another aspect of the present invention, the programmable controller comprises: storage means storing an execution time ratio according to which the fractions of the plurality of sequence programs are executed in each execution cycle; altering means for altering the execution time ratio stored in the storage means; effecting means for making the altered execution time ratio effective in execution of the plurality sequence programs; and execution means for successively executing the fractions of the plurality of sequence programs according to the altered execution time ratio in each execution cycle after the altered execution time ratio is made effective.
The altering means may comprise means for allowing a manual operation to alter the execution time ratio, and the effecting means may make the altered execution time ratio effective in accordance with bit information described in the sequence programs.
The altering means may alter the execution time ratio in accordance with designation by a parameter described in the sequence programs, and the effecting means may make the altered execution time ratio effective when the parameter is read from the sequence programs.
The altering means may comprise means for allowing a manual operation to alter the execution time ratio, and the effecting means may comprise means for allowing a manual operation to make the altered execution time ratio effective.
According to the present invention, the execution time ratio according to which the fractions of the plurality of sequence programs are successively executed in each execution cycle can be freely altered in execution of the sequence programs, whereby the sequence programs can be executed with an optimum execution time ratio for the state of sequential operations.
The hardware configuration of the above programmable controller 10 is identical with that of conventional programmable controllers. The programmable controller of the invention differs from conventional programmable controllers in that the RAM 12 for storing the system software additionally stores software for changing the execution time ratio of sequence programs to be executed within one execution cycle.
In this embodiment, the program memory 13 stores a plurality of sequence programs, and the signal memory 14 is provided with DI/DO signal tables etc. for storing input and output signals in association with the respective sequence programs. The work RAM 15 stores a scan time (time required to execute a sequence program once) of each sequence program, an execution time ratio according to which each sequence program is executed within one execution cycle, etc.
The backup memory 20 is provided with tables etc. for storing respective execution time ratios of sequence programs to be executed in a preset execution cycle.
In the first embodiment, a plurality of tables storing respective different execution time ratios of sequence programs are set in advance in the backup memory 20, in order to alter the execution time ratio of the sequence programs to be executed within one execution cycle. For example, the tables previously stored in the backup memory may include a table which is normally applied and which allots a large execution time ratio to a main sequence program to preferentially execute the same program, a table which is applied after the main sequence program ends and which allots an increased execution time ratio to a sequence program for peripheral device to quickly execute the same program, and a table which is applied at a certain stage of the process according to the sequence programs and which specifies such an execution time ratio of the sequence programs as to enhance the efficiency of the process.
Also, correlation between bits, which are each an execution time ratio altering command described in sequence programs, and the execution time ratio tables T1, T2 and T3 is stored in advance in the backup memory 20 as a correlation table Tb.
When the power supply to the programmable controller 10 is started, the execution time ratio of the sequence programs stored in the execution time ratio table Ti is read from the backup memory 20 and copied to the work RAM 15 (Step SI). After the execution time ratio of the sequence programs is copied and set in the work RAM 15, the sequence programs are executed at the execution time ratio stored in the work RAM 15 (Step S2), as in a conventional system. As a result, the sequence programs 1, 2 and 3 are executed with one execution cycle divided into 50%,.30% and 20%; as shown in
Then, the sequence programs are monitored to detect the aforementioned set bit and thus an execution time ratio altering command (Step S3). If the bit is included in any of the sequence programs and the execution time ratio altering command is read, a table corresponding to the bit is specified from among the execution time ratio tables T1 to T3 by looking up the correlation table Tb, and the execution time ratio of the sequence programs stored in the selected execution time ratio table is copied to the work RAM 15 (Step S4), to alter the execution time ratio. The process then returns to Step S2 and the sequence programs are executed according to the newly selected execution time ratio.
For example, the sequence programs may be programmed such that the first execution time ratio table T1 which is focused on execution of the main sequence program 1, as shown in
On detection of the set bit “K900.2” in Step S3, the execution time ratio table T3 corresponding to the bit “K900.2” is selected, and the execution time ratio stored in the table T3 is copied to the work RAM 15 to alter the execution time ratio of the sequence programs, as mentioned above. As a result, as shown in
In cases where the overall process can be made to progress efficiently by changing the execution time ratio of sequence programs during execution of the sequence programs, as mentioned above, the execution time ratio tables T1 to Tn and the correlation table Th are set in advance, and the sequence programs are programmed such that the bit for changing the execution time ratio is set at locations where the execution time ratio of the sequence programs is to be altered, whereby the sequential operation can be carried out efficiently as a whole by freely changing the execution time ratio of the sequence programs.
In the first embodiment described above, the bit-specified execution time ratio altering command is programmed in sequence programs to alter the execution time ratio of the sequence programs, but the execution time ratio may alternatively be altered by a parameter. In a second embodiment of the present invention in which the execution time ratio is altered by a parameter, the correlation table Tb is unnecessary, and the execution time ratios of sequence programs have only to be set and stored in the respective execution time ratio tables T1 to Tn. The sequence programs specify an applicable execution time ratio table by such a parameter.
As for the procedure for the second embodiment, the determination as to whether or not the set bit has been detected, in Step S3 of the process shown in
In the third embodiment, an execution time ratio setting screen shown in
The execution time ratio changing process executed by the processor 11 is almost the same as that shown in
In the third embodiment, the execution time ratio of the sequence programs is altered in the next execution cycle-immediately after the operator's input of the ENTER command, and thus the execution time ratio can be altered at a desired point of time.
In the fourth embodiment, only one table is provided for storing the execution time ratio of sequence programs, as shown in
When changing the execution time ratio of the sequence programs, the operator causes the execution time ratio table T stored in the backup memory 20 to be displayed on the display device 18 or the like, and alters the execution time ratio of the sequence programs, as shown in
On the other hand, the processor 11 executes the process shown in
Thus, even in the case where a set bit is detected from any of the sequence programs, the sequence programs are executed in the original execution time ratio if the contents of the execution time ratio table T, that is, the execution time ratio of the sequence programs, remain unaltered, and the execution time ratio is altered only when the execution time ratio of the execution time ratio table T has been altered.
Execution time ratios are set beforehand as parameters, and the processor 11 executes the process of
On the other hand, each sequence program is executed in the manner shown in
As a result, when the execution time ratio is altered by any of the sequence programs, the sequence programs are executed in accordance with the altered execution time ratio from the next execution cycle.
The operator causes the execution time ratio setting screen to be displayed on screen so that the execution time ratio table T stored in the backup memory 20 may be displayed, as shown in
The process executed by the processor 11 is almost identical with that shown in
Number | Date | Country | Kind |
---|---|---|---|
314059-2003 | Sep 2003 | JP | national |