Abstract:
An input signal (A) and an output signal (B) with respect to an output memory (8), and an output signal (C) of an output circuit (9) in a programmable controller are compared with each other. The identification of and an abnormal part is displayed in accordance with the comparison results.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a programmable controller for detecting an abnormal state of an output signal. 
     A conventional programmable controller performs sequence control such that a sequence program is stored in a memory therein and a relay or the like of an external device is operated in accordance with the sequence program. When a load resistance of the external device, is small, an element, such as a transistor of an output circuit of a programmable controller, may be damaged. When sequence control is continued even though the element of the output circuit is damaged, normal sequence control cannot be performed. A conventional programmable controller does not have a means for checking such a failure. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a programmable controller to eliminate the conventional drawback described above, by detecting an abnormal state of an output signal therefrom and determining an abnormal part in a circuit. 
     In order to achieve the above object of the present invention, there is provided a programmable controller, wherein a feedback circuit is provided for feeding an output from an output circuit back to an operation device, the output circuit transmitting an output signal from an output memory to an external circuit; input and output signals with respect to the output memory and the output signal from the output circuit are compared with each other; an abnormality of the output circuit is displayed on a display device when the output signal from the output circuit does not coincide with the input signal to the output memory and the input signal to the output memory coincides with the output signal therefrom, and an abnormality of the output memory is displayed on the display device when the output signal from the output circuit does not coincide with the input signal to the output memory and the input signal to the output memory does not coincide with the output signal therefrom. 
     With the arrangement described above, since the input and output signals with respect to the output memory and the output signal from the output circuit are compared to detect coincidences and an abnormal part in the circuit is displayed on the display device upon detection of a noncoincidence, the abnormality and failure of the output circuit and the output memory which tend to be influenced by an external circuit connected thereto are immediately found, thereby preventing erroneous operation of the programmable controller. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of an embodiment the present invention; 
     FIG. 2 is a circuit diagram of a feedback circuit of the embodiment; and 
     FIG. 3 is a flow chart for explaining processing in accordance with the embodiment. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     The present invention will be described with reference to the accompanying drawings. 
     FIG. 1 is a block diagram of a programmable controller according to an embodiment of the present invention. Reference numeral 1 denotes a computing unit (to be referred to as a CPU hereinafter) having an arithmetic and logic function for determining the state of an output signal upon reception of an input signal, and a display instruction function for causing a CRT 3 to display data in accordance with a program stored in a ROM 5 for sequence control (to be described later). Reference numeral 2 denotes an input circuit for receiving signals from an external limit switch, a proximity switch and switches on an operation panel. Reference numeral 3 denotes a display device for displaying a state of the programmable controller and states of the input and output signals. Reference numeral 4 denotes a key input device for designating a display mode for the CPU 1 and an operation mode of the programmable controller. Reference numeral 5 denotes a ROM for storing a sequence program for determining the operation of a machine as an object of interest. Reference numeral 6 denotes a ROM for receiving the sequence program from the ROM 5 and causing the CPU 1 to perform arithmetic operations. The ROM 6 also stores a program for reading a keyboard input and causing the display device 3 to display data. Reference numeral 7 denotes a RAM for temporarily storing data during arithmetic operations; 8, an output memory for generating an arithmetic result of the CPU 1 to an external device; and 9, an output circuit for generating a signal representing a state of the output memory 8. 
     The main feature of the present invention lies in the arrangement wherein output signals from the output memory 8 and the output circuit 9 are fed back to the CPU 1. An arrangement of the feedback circuit is shown in FIG. 2. Referring to FIG. 2, reference symbol M denotes a memory element in the output memory 8; b1 and b2, buffers, respectively; T, a transistor; D1, a diode; and R1 and R2, resistors, respectively. The buffers b1 and b2, the transistor T, the diode D1, the resistors R1 and R2 are provided for each memory element M in the output memory 8 to constitute the output circuit 9. Unlike in the conventional output circuit, the diode D1, the resistors R1 and R2 and the buffer b2 are added in the feedback circuit of this embodiment. The CPU receives a feedback signal C of the output signal from the feedback circuit. Reference numeral 10 denotes an external circuit in an external device. Reference symbol E is a power supply unit; RL, a relay; and D2, a diode. An output signal (i.e., an input signal A to the output memory) from the CPU 1 is stored in one memory element M in the output memory 8. An output signal B read from the memory element M in the output memory 8 is supplied to the output circuit 9 and is fed back to the CPU 1. The output signal B1 from the output memory 8 is supplied to the buffer b1 in the output circuit 9 to control on/off operation of the transistor T. An output signal C from the output circuit 9 is supplied to the external circuit 10 to energize the relay RL or the like. The output signal C is also fed back to the CPU 1 through the feedback circuit consisting of the diode D1, the resistors R1 and R2 and the buffer b2. 
     Abnormal state detection processing of the present invention will be described with reference to an operation flow of FIG. 3. 
     When the input signal A is supplied from the CPU 1 to the output memory 8, a comparing means in the CPU 1 compares all bits of the input signal A to the output memory 8 with those of the output signal C fed back from the output circuit 9 (step S1). When the comparing means detects a coincidence between all the bits of the input signal A and the output signal C, the CPU detects that normal operation is performed, so that the flow advances to a normal processing (i.e., step S5). However, if there is not coincidence (i.e., NO in step S1), i.e., the comparing means compares all bits of the input signal A to the output memory 8 with those of the output signal B from the output memory 8 (step S2). If YES in step S2, the CPU 1 determines that the output memory 8 is normally operated and that the output circuit 9 is abnormal, thereby causing the display device 3 to display an abnormality of the output circuit 9 (step S4). However, when the comparing means detects that all the bits of the input signal A to the output memory 8, do not coincide with those of the output signal B from the output memory 8, the CPU 1 determines that the output memory 8 is abnormal, thereby causing the display device 3 to display an abnormality of the output memory 8 (step S3).