PROGRAMMABLE CONTROLLER

Abstract: The programme controller performs a sequential control by using a software comprising basic instructions and functional instructions written in a ladder language. The functional instructions are registered as subroutines and called from a main program. The controller provides a unified form of such arbitrary functional instructions (FUNC), where the form of functional instruction is changed depending on the input conditions (A, B,C) which are registered in the parameter region (P), and the top address of a memory area for a particular functional instruction is accessed. This enables the user to register any functional instructions.

Description: Technical Field This invention relates to a programmable controller capable of executing a functional instruction constituted by a ladder. Background Art A programmable controller (hereinafter referred to as a "PC") implements sequence control of an NC machine tool by means of software and is so adapted that a sequence expressed by a ladder diagram is written in a program stored in memory means such as a ROM, and the program is called whenever needed in order to control a machine tool. Control instructions constituting each step of sequence control include a basic instruction and a functional instruction. The former is an instruction implementing a one-bit logical operation such as AND or OR, and the latter is an instruction prepared in order to instruct a complicated function peculiar to a machine. More specifically, since forming arithmetic functions necessary for various kinds of control using one-bit basic instructions requires too much actual labor, generally a repeatedly used control function is registered beforehand as a functional instruction in a subroutine and is called from a main program. Recently, the greater diversification and sophistication of objects subjected to control has been accompanied by a need to execute various subroutines besides the functional instructions registered by ladder language. In such cases, there is a tendency on the user side to require sequence control of higher speed. However, in the preparation of such a prior-art ladder diagram, programming must be performed using basic instructions and already registered functional instructions when a subroutine other than a registered functional instruction is executed. Consequently, there is an increase in the number of steps. Accordingly, in cases where an individual functional instruction corresponding to a machine tool is used repeatedly in preparing a ladder, there is a need for a system in which any desired functional instruction can be created on the user side. EP-A-0 180 647 by the present applicant discloses a programmable controller according to the preamble of accompanying claim 1. According to this document, functional instruction subroutines are fixed and cannot be modified by a user. According to the present invention, there is provided a programmable controller in which functional instructions are formed by ladders and executed, comprising:- a memory means for storing a plurality of functional instruction subroutines, each of which includes a parameter area for storing parameters of the functional instruction subroutine and each of which specifies at least a first input condition, so as to define the type of functional instruction subroutine; and characterised in that said memory means is arranged such that the parameter area of each functional instruction subroutine includes an area for storing additional input conditions, and in that setting means are provided for setting input conditions whereby a plurality of individual types of functional instruction subroutine all sharing said first input condition can be created by a user by selectively setting said additional input conditions in said parameter area using said setting means. Accordingly, with the programmable controller of the present invention, programming is facilitated and the number of ladder steps is reduced to make high-speed control possible. Reference is made, by way of example, to the accompanying drawings in which:- Fig. 1 is a block diagram illustrating an embodiment of the present invention, Fig. 2 is a view illustrating an example of a functional instruction format, and Figs. 3(a), (b), (c) are views illustrating a ladder, a program corresponding to the ladder, and a flowchart of execution based on the program, respectively. An embodiment of the invention will now be described in detail with reference to the drawings. Fig. 1 is a view illustrating the format of a functional instruction Func stipulated by one input condition A, in which (a) is an equivalent relay circuit diagram and (b) a view showing a parameter area. The parameter area P has an area which stores separate input conditions such as B and C, and an area for storing parameters P1, P2, P3 ... which stipulate input/output data. More specifically, even if an input condition to be prepared in a ladder changes with every functional instruction, a separate input instruction can be set in a parameter area by suitably applying a modification, thereby making it possible to create any functional instruction. Fig. 2 is a view illustrating the format of an equivalent relay circuit for implementing a functional instruction F1 stipulated by three input conditions A, B and C. Conventionally, when this functional instruction has not been registered as a subprogram, the functional instruction F1 must be formed as a combination of basic instructions. However, with the format of the equivalent relay circuit shown in Fig. 1, a functional instruction (any functional instruction) is registered in which a change in an input condition can be set in a parameter area. Therefore, the input condition can be registered even for a functional instruction having the format of Fig. 2 or a functional instruction having an input format different from this. That is, a ladder is set in the parameter area and the user is capable of individually creating any functional instruction executed by the single fixed input condition A. In this sense, the format of the functional instruction shown in Fig. 1(a) is a model format of the present invention. Accordingly, if a functional instruction having the model formal of Fig. 1 is registered in advance, the user will be capable of calling this instruction when appropriate, fixing the contents of the parameter and creating an individual functional instruction. Fig. 3 illustrates a ladder diagram (a) which includes a basic model for creating any functional instruction using the above-described model format, the contents (b) of a memory accessable from this ladder, and a flowchart (c) of ladder execution. Ordinarily, the meaning of the control condition and the number thereof differ depending upon each functional instruction. However, in a functional instruction set by the model format of the kind shown in Fig. 1(a), the input condition data are set from address A1 to address A′, and these data are set by the ladder in such a manner as to be called from an address A2 as a parameter of any functional instruction by a control condition S1. The lead address A1 of the area storing the contents of the parameter is set at the address A2′. Therefore, when the control condition S1 is satisfied, first reference is made to the parameter of the optional functional instruction, then operation is executed with the designated area serving as another input condition. Thus, a plurality of functional instruction subroutines are stored and, in order to access them from a ladder, an input condition conforming to the type of functional instruction subroutine is constructed by a ladder. In other words, it will suffice to set any functional instruction of the model format and form an individual functional instruction having the lead address of the corresponding input condition in a parameter area. Industrial Applicability The programmable controller of the present invention makes it possible to fully exploit subroutine functions in a machine in which a ladder language and another language, such as PASCAL, coexist. By interfacing a ladder and a functional instruction, individual functional instructions other than already prepared functional instructions can be created with ease.

Claims: A programmable controller in which functional instructions are formed by ladders and executed, comprising:- a memory means for storing a plurality of functional instruction subroutines, each of which includes a parameter area for storing parameters of the functional instruction subroutine and each of which specifies at least a first input condition (A), so as to define the type of functional instruction subroutine; and characterised in that said memory means is arranged such that the parameter area of each functional instruction subroutine includes an area for storing additional input conditions (B, C), and in that setting means are provided for setting input conditions whereby a plurality of individual types of functional instruction subroutine all sharing said first input condition (A) can be created by a user by selectively setting said additional input conditions in said parameter area using said setting means.

Inventors: KIYA NOBUYUKI, MAEDA KIMIO, SAIKI YOSHIHARU, TANAKA KUNIO, KIYA, NOBUYUKI, MAEDA, KIMIO, SAIKI, YOSHIHARU, TANAKA, KUNIO
Applicants: FANUC LTD, FANUC LTD.
Application year: 1988
Main classification: G05B19
IPC codes: G05B19