Programmable controller

Abstract: A programmable controller comprises an input circuit including a plurality of signal input terminals (4 in Fig. 1) which receive signals from a plurality of external input devices, and a power feed terminal (8) and a ground terminal (5) which are respectively exposed in order to supply a power source voltage from outside the programmable controller. Also, current regulator elements (13) are respectively located between the power feed terminal (8) or the ground terminal (5) and the plurality of signal input terminals (4). Owing to this construction, the range of power source voltages to be supplied to the input circuit can be widened, and various external input devices can be connected without altering internal circuitry. A plurality of power sources of fixed voltages which are generally used are built in, whereby a user need not especially prepare a power source and can be freed from the labors of wiring etc. The programmable controller can be readily conformed to the specifications of the external input devices, making it easy to cope with these devices. Since unidirectional photocouplers being economical may which are employed, the programmable controller can be constructed at low cost. Moreover, since the transfer ratios of the input signals can be held constant, a stable performance can be attained.

Description: BACKGROUND OF THE INVENTION The present invention relates to programmable controllers. More particularly, it relates to the input circuit of a programmable controller for making it possible to select the power source voltage of an external input device and to use various external input devices. In general, a programmable controller is constructed as shown in Fig. 6, having an input unit 1 which accepts the signals of external input devices 2 and 3 (in the figure, the output portions of the external input devices are respectively represented by the electronic switch 2 and contact 3 thereof), a control unit 100 which arithmetically or logically processes the signals accepted by the input unit 1, a sequence program memory 102 which stores therein a sequence program for stipulating the procedures of the logical processes of the control unit 100, and an output unit 103 which transmits the logically processed results of the control unit 100 to external loads 104 on the basis of the contents of the memory 102. The sequence program to be stored in the sequence program memory 102 is set by a programming unit 101 and is transferred to this memory in advance. The control unit 100 constitutes a processor means and executes the sequence program stored in the memory 102. Numeral 105 denotes an A.C. power source. An input circuit included in the input unit 1 of such a programmable controller has heretofore been as illustrated in Fig. 7. It is constructed of a power source 9, a limiting resistor 106, a photocoupler 18 which serves to optically transmit the signals for the purpose of isolation, a capacitor 22 and a resistor 21 which reduce noise, and a limiting resistor 20 for the photocoupler 18. With the above construction, when the voltage specifications of the external input devices 2 and 3 are different, the transfer characteristic of the photocoupler 18 changes. This poses the problem that the resistance of the resistor 106 must be changed, or that the resistor 106 generates heat in proportion to the square of the power source voltage 9 when the resistance of the resistor 106 is held constant. Mentioned as a method of solving this problem is a technique which is disclosed in the official gazette of Japanese Utility Model Registration Application Laid-open No. 46805/1989. According to this technique, an input terminal is furnished with two common terminals, and either of two levels of D.C. input voltage is selected by appropriately using the common terminals. In addition, the official gazette of Japanese Patent Application Laid-open No. 146305/1984 discloses a technique wherein a current regulator circuit is connected in series with an LED (light emitting diode) disposed on the input side of the photocoupler, whereby current to be fed to the input side LED is held substantially constant for many levels of input signal voltages having different voltage values. Further, the official gazette of Japanese Patent Application Laid-open No. 237702/1989 discloses a technique wherein the magnitude of a detection reference threshold voltage for an input signal voltage is changed by a voltage control circuit, depending upon the fluctuation of an input voltage level, whereby the input signal voltage is reliably detected in spite of the level fluctuation thereof. With the known example stated in the official gazette of Japanese Utility Model Registration Application Laid-open No. 46805/1989, the specifications of the input voltages are fixed to two voltage levels, for example, 24 V and 12 V. This has led to the drawback that, in the case of accepting the external signal of a TTL (transistor-transistor logic) circuit (based on 5 V), the resistor 106 shown in Fig. 7 must be altered for the purpose of causing a stipulated current to flow. Moreover, the conventional power source of 24 V must be prepared outside the programmable controller in order to avoid the fixation thereof to one sort of power source. This has been very inconvenient to the users of such programmable controllers. In addition, according to the prior-art technique in the official gazette of Japanese Patent Application Laid-open No. 146305/1984, the alteration of the resistor 106 is dispensed with. However, in a case where the current regulator circuits as disclosed herein are applied to the respective photocouplers, increase in the number of external input points has incurred the problems of a large packaging area and a high cost. Besides, in any of the known examples stated above, the direction in which the current of the photocoupler flows is fixed. This has led to the problem that the different specifications of the external input devices, for example, a current absorption type (sink type) and a voltage output type (source type) make it necessary to alter the components of the input circuit or to employ a bidirectional photocoupler, which is expensive. A programmable controller with the features included in the first part of claim 1 is known from EP-A-0 447 776. GB-A-2 241 126 discloses an input signal circuit for a programmable controller and shows a number of external AC and DC power sources to which the input signal circuit may be connected. SUMMARY OF THE INVENTION It is an object of the present invention to provide a programmable controller comprising an input signal circuit which requires little packaging area and can cope with a plurality of input voltages without altering any of its components. This object is met by the programmable controller characterised in claim 1. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a circuit diagram showing the first embodiment of the input circuit of a programmable controller according to the present invention; Fig. 2 is a diagram for explaining an example of application of the input circuit shown in Fig. 1; Fig. 3 is a circuit diagram showing the second embodiment of the input circuit of the programmable controller of the present invention; Fig. 4 is a circuit diagram showing the third embodiment of the input circuit of the programmable controller of the present invention; Fig. 5 is a circuit diagram showing the fourth embodiment of the input circuit of the programmable controller of the present invention; Fig. 6 is a block diagram showing the construction of a general programmable controller; Fig. 7 is a diagram of an input circuit for explaining prior-art examples; and Fig. 8 is a block diagram showing the construction of an embodiment of the programmable controller according to the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS Now, embodiments of the present invention will be described in detail. Fig. 8 illustrates the construction of one embodiment of a programmable controller according to the present invention. In the figure, the same constituents as in Fig. 6 have the same reference numerals affixed thereto. This programmable controller features the portion of its input unit 1, which will be described with reference to Fig. 1 showing the arrangement thereof separately. Referring to Fig. 1, as in the case of Fig. 6, numeral 1 indicates an input unit, and numerals 2 and 3 indicate external input devices. Numeral 4 represents a plurality of input terminals #0, #1, #2, ..., and #n for connecting signal lines from the external input devices 2 and 3. Numeral 5 denotes a terminal of 0 V (a ground terminal), to which one side of the external input device 2 and of the external input device 3 are commonly connected. Numerals 9 and 10 denote an ordinary power source of 24 V and a power source of 12 V often employed in a 12 V encoder etc., respectively. In this embodiment, the power sources 9 and 10 are built into the programmable controller. The negative terminals of the power sources 9 and 10 are commonly connected to the 0 V-terminal. Terminals 6 and 7 are respectively connected to the positive terminal of the power source 9 and that of the power source 10, and they are arranged on the outer surface of the programmable controller. Shown at numeral 11 is a power source of another voltage which is fed from outside the programmable controller as may be needed. A power feed terminal 8 serves to feed a supply voltage to internal circuitry which will be explained later. A protective diode 12 is incorporated to protect against the case where the external power source 11 is erroneously connected the wrong way round. Numeral 13 designates each current regulator element which is essential to the present invention, and as which a current regulator diode is mentioned by way of example. The current regulator diode has the property that, when its applied voltage changes, the internal impedance thereof changes, so a constant current is normally caused to flow therethrough. In the illustrated case of Fig. 1, the current regulator diodes 13 are connected with their cathodes lying on the side of the input terminals 4, for the external input devices of the sink type. The necessity of the "constant current" will be explained. For example, in a case where the external input device 2 or 3 delivers a TTL output (with a working voltage of 5 V), a long wiring line incurs a high impedance and an inferior noise immunity, as a predetermined current (8 mA) needs to flow. As another example, in a case where the external input device 2 or 3 is a contact, the current of 8 mA at the voltage of 24 V is required in consideration of the reliability of the contact. In this manner, the current value is a very important factor. In such cases, accordingly, 8 mA type elements may be adopted as the current regulator elements 13. Numeral 14 represents protective resistors (R 3-0 ∼ R 3-n ). Numerals 15 and 16 denote resistors for generating the reference voltage of comparators which will be stated below. By way of example, when the resistances of the resistors 15 (R 1 ) and 16 (R 2 ) are set at R 1 = R 2 , half of the working voltage (the voltage of the power source connected to the power feed terminal 8) becomes the threshold voltage, and the immunity of the input circuit against noise caused by an impedance change ascribable to wiring. The aforementioned comparators are shown at numeral 17, and are equal in number to the input terminals 4. Each of the comparators 17 compares a signal from the corresponding external input device 2 or 3, with the reference voltage, and it delivers the result of the comparison as a binary value ("0" or "1"). In this embodiment, the output of the comparator becomes "0" = LOW level voltage in response to the "ON" signal of the external input device 2 or 3, and it becomes "1" = HIGH level voltage in response to the "OFF" signal. Numeral 18 represents devices usually called "photocouplers", which transmit the signals optically and in each of which a light emitting element and a light receiving element are combined. Each of the photocouplers 18 is driven by the output of the corresponding comparator 17. Limiting resistors 19 serve to limit currents which flow through the LED's of the respective photocouplers 18. Each of the limiting resistors 19 is connected at one end to the positive terminal of one (here, the 24 V-power source 9) of the plurality of power sources built into the programmable controller as stated before, and at the other end to the anode of the LED of the corresponding photocoupler 18. Thus, when the corresponding comparator 17 turns ON, the current limited to a predetermined magnitude flows through the LED of the photocoupler 18, and the signal is transmitted to a stage succeeding this photocoupler. Further, current limiting resistors 20 are incorporated on the light receiving sides of the photocouplers 18. Resistors 21 and capacitors 22 constitute chattering eliminator circuits which serve to eliminate the chattering of the signals of the external input devices 2 and 3. An interface portion 23 for the control unit 100 stated before, subjects the output signal of the chattering eliminator circuit to waveshaping or changes it over to a counter circuit 24. The counter circuit 24 is so constructed that, in a case where the external input device is one generating pulses at a high rate, such as an encoder, the high-rate pulses can be counted up and down. The input signals to the counter circuit 24 are three sorts of signals; an A-phase signal, a B-phase signal and a marker signal. The interface portion 23 has the function of changing-over its operation in accordance with a command from the control unit 100, so as to deal with the input signal as an ordinary input signal when the counter function is not used. A switch 25 is formed on the pattern of a printed circuit board on which the circuit arrangement of this embodiment is packaged. As indicated in Fig. 1, the switch 25 is connected to a side "A" by a jumper lead, a zero-ohm resistor, or the like when the external input devices 2 and 3 are of the sink type. On the contrary, it is connected to a side "B" when the external input devices 2 and 3 are of the source type, as will be described later with reference to Fig. 2. Here, the method of supplying the power source voltages in the circuit arrangement shown in Fig. 1 will be explained. In a case where the external input device 2 or 3 requires the ordinary voltage (24 V), a connection (between 24 V and S) indicated at 1 ○ in Fig. 1 is made by the use of a short bar or the like. On the other hand, in a case where the external input device 2 or 3 is one operating with 12 V, such as the encoder, a connection (between 12 V and S) indicated at 2 ○ is made, and the connection at 1 ○ is not made. Besides, in a case where the external input device 2 or 3 is a TTL circuit (of 5 V) or the like, a power source of 5 V is prepared as the external power source 11, and a connection (between S and 0 V) indicated at 3 ○ is made. On this occasion, neither of the connections at 1 ○ and 2 ○ is made. The terminals 5 ∼ 8 for these connections are mounted on the outer surface of the programmable controller in an exposed manner, so that a user can connect them at will for his/her purpose. Regarding the three terminals 6, 7 and 8, the power feed terminal 8 is centrally arranged so that the terminals 6 and 8 or the terminals 7 and 8 can be selectively connected by the short bar or the like. According to this embodiment, irrespective of the working power source voltages, the constant currents can be caused to flow to the input terminals 4 without altering any component, owing to the functions of the current regulator elements 13. In this embodiment, however, the input circuit does not have the arrangement in which the currents flowing to the input terminals 4 are caused to directly flow to the LED's of the photocouplers 18, but it is endowed with the arrangement in which the comparators 17 are interposed between the input terminals 4 and the photocouplers 18. As stated before, accordingly, the LED's of the corresponding photocouplers 18 are driven in accordance with the results of the comparisons between the reference voltage obtained with the resistors 15 and 16 and the voltages of the respective input terminals 4. The specified power source (the 24 V-power source 9 in this embodiment) is utilized as the power source for driving the LED's, whereby current values at the turn-ON operations of the LED's can be held constant. Fig. 2 illustrates the input circuit in the case where the external input devices 2 and 3 are of the source type. The switch 25 is connected to the "B" side, and the direction of the connections of the current regulator elements 13 are reversed. In this case, it suffices in the packaging of the input circuit to change the connection of the jumper lead or the like of the switch 25. In point of signals, however, the outputs of the comparators 17 are inverted, and also the outputs to the control unit 100 are reversed. This situation can be coped with using a hardware inverter circuit or a software inversion process within the interface portion 23. By way of example, the hardware inverter circuit can be easily realized by providing a plurality of exclusive-OR circuits, not shown, which take the exclusive OR's between the signal output from the switch 25 once accepted in the interface portion 23 and the outputs of the respective chattering eliminator circuits 21 and 22. Fig. 3 illustrates the second embodiment of the present invention. Referring to the figure, numeral 26 represents bidirectional current regulator elements, and numeral 27 indicates a change-over switch. Each of the bidirectional current regulator elements 26 is in the form of a single package into which two of the current regulator elements 13 stated before are built. It has the characteristic that currents of predetermined magnitude can be caused to flow therethrough in opposite direction. The change-over switch 27 can be manipulated for change-over on the outer surface of the programmable controller of this embodiment. The programmable controller can be properly used through the change-over, depending upon whether the external input devices 2 and 3 stated before are of the sink type or of the source type. Here, the "A" side of the change-over switch 27 is for the sink type, and the "B" side for the source type. The others are the same as in the first embodiment, and shall be omitted from description. Incidentally, although each bidirectional current regulator element 26 is the single-package component here, it may well be simply on assembly in which the two current regulator elements 13 are connected in a parallel inverse relationship. In addition, the inversions of the signals in the interface portion 23 may be carried out by either of the methods stated before. Next, the third embodiment of the present invention will be described with reference to Fig. 4. This embodiment consists in that the switch 25 in the first embodiment is substituted by current regulator elements 13' the directions of which are opposite to those of the current regulator elements 13, and that the current regulator elements 13 and the current regulator elements 13' are respectively connected to a point "A" and a point "B". Thus, the change-over of the switch dependent upon the types of the external input devices is dispensed with. The inversions of the signals are the same as in the foregoing. Next, the fourth embodiment of the present invention will be described with reference to Fig. 5. This embodiment is such that shunt resistors 28 are respectively connected in parallel with the current regulator elements 13 in the first embodiment, and that all other components are the same as in the first embodiment. The shunt resistors 28 function to increase a circuit current in such a case where the current value of 8 mA as exemplified in the first embodiment is insufficient for the current regulator elements 13. By way of example, in a case where a value of at least 10 mA is required, the shunt resistors 28 increase the current value by the amount of 2 mA. The resistance value of the shunt resistors 28 may be determined by the lowest one of the power source voltages which are used. It is to be understood that the expedient of the fourth embodiment is also applicable to the second embodiment. Now, the limiting resistors 19 in each of the first thru fourth embodiments will be detailed. Each of the photocouplers 18 has the characteristic that the input/output transfer ratio thereof changes depending upon the magnitude of current which flows through the light emitting side, namely the LED. In the signal transfer of the programmable controller, the magnitude of the current pertains to the transfer ratio of the input signal and the ON/OFF voltage values of the light receiving side, and hence, it should desirably be rendered constant in order to attain a constant transfer ratio. As stated before, in any embodiment of the present invention, the limiting resistors 19 are connected to the power source 9 built into the programmable controller. Thus, when the corresponding comparators 17 have turned ON, the preferably constant currents flow through the LED's. According to the embodiments of the present invention thus far described, the following effects are attained: (1) The range of power source voltages to be supplied to an input circuit can be widened, so that various external input devices can be connected without altering internal circuitry. (2) A plurality of power sources of fixed voltages which are generally used are built in, whereby a user need not especially prepare a power source and can be freed from the labors of wiring etc. (3) The specifications of the external input devices can be easily conformed to and coped with. (4) Photocouplers may be unidirectional ones which are economical, so that a programmable controller can be constructed inexpensively. Moreover, the transfer ratios of the photocouplers can be held constant to attain a stable performance.

Claims: A programmable controller, comprising memory means (102) for storing a sequence program to operate external loads (104) connected to the programmable controller, processor means (100) connected to said memory means (102) for executing said sequence program, output means (103) connected to said processor means (100) for delivering processed results of said processor means to said external loads (104), and an input circuit (1) connected to said processor means (100) and having an input terminal (4) for receiving a signal from an external input device (2, 3), characterised in that the input circuit (1) includes a power feed terminal (8), a ground terminal (5), a plurality of power source terminals (6, 7), a plurality of built-in power sources (9, 10) each connected to a respective one of said power source terminals (6, 7) and to said ground terminal (5), a short bar (1 ○, 2 ○) for selectively connecting said power feed terminal (8) to one of said power source terminals (6, 7), a comparator (17) disposed between said signal input terminal (4) and said processor means (100) for delivering an input signal to said processor means in accordance with the signal from said external input device (2, 3), and a current regulator (13) disposed at one side between said input terminal (4) and said comparator (17) and at the other side to the ground terminal (5) or the power feed terminal (8). The controller of claim 1, wherein said input circuit (1) further includes a reference voltage generator circuit (15, 16) connected to said power feed terminal (8) for generating a reference voltage on the basis of a voltage supplied to said power feed terminal, said comparator (17) being connected to said signal input terminal (4) and said reference voltage generator circuit (15, 16) for comparing the signal from said external input device (2, 3) to said reference voltage, and a photocoupler (18) constituted by an input side light emitting diode driven by the output signal of said comparator (17), and an output side phototransistor which produces the output of said input circuit (1). The controller of claim 2, wherein said light emitting diode has its positive electrode connected to one of said built-in power sources (9, 10) via a limiting resistor (19) and its negative electrode connected to the output of said comparator (17). The controller of claim 1, further comprising a switch (25; 27) for changing-over the connection of said current regulator (13) to said power feed terminal (8) and to said ground terminal (5) . The controller of claim 1, wherein said power source terminals (6, 7) are mounted outside the controller. The controller of claim 4, wherein said current regulator is a bi-directional current regulator (26 in Fig. 3). The controller of claim 1, wherein said current regulator is constituted by a pair of current regulator elements (13, 13' in Fig. 2) which cause currents to flow in opposite directions, either one of said pair of current regulator elements having its one end connected to said signal input terminal (4) and its other end connected to said power feed terminal (8) and said ground terminal (5) respectively. The controller of any of claims 2, 6 and 7, wherein said input circuit (1) includes a resistor (28) connected in parallel with said current regulator (13).

Inventors: KUROKAWA NAOHIRO, UCHIYAMA RYOICHI, KUROKAWA, NAOHIRO, UCHIYAMA, RYOICHI
Applicants: HITACHI LTD, HITACHI, LTD.
Application year: 1992
Main classification: G05B19
IPC codes: G05B19