INPUT/OUTPUT SYSTEM FOR AN INDUSTRIAL CONTROL SYSTEM

Abstract: The I/O modules (4, 5, 6) for an industrial control pro­ cessor (1) are connected together in a serial I/O ring (3). The processor (1) performs an I/O scan sequence in which output data for the I/O modules (4, 5, 6) is shifted serially from an output image table onto the I/O ring (3) and input data from the I/O modules (4, 5, 6) is pushed around the I/O ring (3) and into the processor (1) where it updates an input image table.

Description: The invention relates to an input/output system or input/output scanner for industrial control systems, such as numerical controls, programmable controllers and process controls which are connected to numerous sensing devices and operating devices in the factory environment. In numerical controls such as those disclosed in U.S. Patent Nos. 4,038,533 and 4,228,495 and in programmable controllers such as those disclosed in U.S. Patent Nos. 4,266,281 and 3,982,230, a processor operates to input data from sensors, performs calculations and outputs data to operating devices. While some input/output (I/O) data may be directly operated upon by the processor, it is common practice to operate on I/O data contained in an I/O image table which is created in the processor's memory. In such systems an I/O scan is periodically performed to update the state of the input image table with the current status of the sensing devices connected to the machine, and to write the output image table to corresponding operating devices connected to the machine. There are numerous methods presently used to perform the periodic I/O scan. In U.S. Patent No. 4,038,533 the numerical control processor is periodically interrupted from its other functions to perform the I/O scan itself. In U.S. Patent No. 4,228,495 a separate "programmable interface" processor which couples to the main processor performs a number of I/O functions, including the periodic I/O scan. And finally, in U.S. Patent No. 3,942,158 a separate input/output "scanner" circuit is provided to perform the I/O scan on a continuous basis by periodically "stealing" access time to the I/O image table from the main processor. There are also a variety of architectures used for the I/O interface circuitry. The most common structures employ a set of I/O modules which are mounted in an I/O rack such as those disclosed in U.S. Patent Nos. 3,992,684; 4,151,580 and 4,152,750. The I/O rack may also house the processor as in U.S. Patent Nos. 4,294,924 and 4,263,647, or the I/O rack may be physically separate from the processor as in U.S. Patent Nos. 3,997,879; 3,982,230 and 4,258,563. When the I/O modules are located in the same rack with the processor, they usually share a common backplane bus structure in which I/O data is conveyed in parallel. On the other hand, when the I/O racks are physically separate from the processor, the usual practice is to convey I/O data serially to reduce the cost of the electrical interconnection. Such serial communications usually involve a complex protocol that reduces the efficiency of the I/O data link and increases the cost. GB-A-2 111 271 discloses a data transmission and processing system. This known system embodies an input/output system for an industrial control system. It includes a central processing unit coupled to a transmission control unit and a plurality of terminal units connected in series with the transmission control unit. The transmission control unit has a data memory for storing control data to be delivered to the terminal units and collected data received from the terminal units. Furthermore, the transmission control unit has a processor which is connected to the data memory and a transmission control interface for the terminal units. Likewise, each terminal unit has a data memory for storing control data and collected data and a processor which is coupled with the data memory. The processor is connected to a transmission control interface coupled through a line to the transmission control interface of the transmission control unit and is also connected to a field interface coupled to a plurality of data devices which deliver collected data and receive control data. The transmission control unit and the terminal units which are connected in series for serial data transmission are adapted such that during a first portion of a transmission time interval each terminal unit receives control data from the transmission control unit and, then, during a second portion of this interval the terminal units deliver the collected data to the transmission control unit. FR-A-1 462 285 relates to an electronic data transmission system comprising a central station and a succession of outstations. A shift register at each station is coupled to shift registers at other stations so as to connect the shift registers at all stations in series in a closed loop. Shifting of data around the closed loop is performed by simultaneously applying shift pulses to all stages of the shift registers through a separate shift line. The invention as claimed is intended to provide an efficient, cost-effective coupling of I/O data between a processor and separate I/O modules. The invention solves the problem of how to design an efficient I/O data transfer system for an industrial processor. More specifically, the invention includes one or more I/O modules connected in a serial I/O ring with a processor, each I/O module including a serial input port for receiving serial data on the ring, a serial output port for transmitting data on the ring, input means for receiving input data from sensing devices connected to the I/O module, output means for applying output data to operating devices connected to the I/O module, and control means for coupling data received at the serial input port to the serial output port. The processor outputs data to the serial I/O ring, and each I/O module places its input data on the I/O ring. As output data is advanced around the I/O ring from module to module, input data is advanced around the I/O ring until it is received at the processor. Function indicating command data is also advanced around the I/O ring to signal to the control means in each I/O module a function to be carried out. The elements of the I/O ring are linked together by a serial data link, and this substantially reduces the cost of linking I/O modules which are physically separated. The communications protocol is simplified considerably by using the ring configuration and an I/O scan sequence which does not require address data. Furthermore, the invention provides a serial I/O system in which the I/O scan may be executed quickly. This is accomplished in part by the minimal protocol overhead, and in part by the use of a ring configuration. As output data is placed on the serial I/O ring through a serial output port on the processor, input data is received substantially concurrently from the serial I/O ring. This concurrent I/O scan is much quicker than prior techniques in which a separate output scan and then an input scan of the I/O data are performed. The foregoing and other objects and advantages of the invention will appear from the following description. In the description, reference is made to the accompanying drawings which form a part thereof, and in which there is shown by way of illustration a preferred embodiment of the invention. Such embodiment does not necessarily represent the full scope of the invention. In the drawings: Fig. 1 is a pictorial view of a processor connected to a series of I/O modules according to the present invention; Fig. 2 is a schematic diagram showing the flow of I/O data in the system of Fig. 1; Fig. 3 is an electrical schematic diagram of the communications controller circuit which forms part of the processor and I/O modules of Fig. 1; Fig. 4 is an electrical schematic diagram of the processor of Fig. 1; Figs. 5A-5D are schematic diagrams used to illustrate data flow in the system of Fig. 1; Fig. 6 is a flow chart of the I/O scan program which is executed by the processor of Fig. 1; and Figs. 7A and 7B are schematic diagrams of data packets and command packets which are employed in the system of Fig. 1. Referring particularly to Figs. 1 and 2, a processor 1 has a serial output port 2 which connects to a communications ring indicated generally at 3. The communications ring is comprised of three I/O modules 4, 5 and 6 which connect in series to the processor's serial output port 2 and which connect to a serial input port 7 on the processor 1. As will be explained in detail below, data is output serially through the output port 2, shifted through the I/O modules 4, 5 and 6, and into the serial input port 7. Each I/O module 4, 5 and 6 includes a set of output terminals 8 which may be connected to operating devices such as lamps, motor drives, solenoids and alarms. Each I/O module 4, 5 and 6 also includes a set of input terminals 9 which may be connected to sensing devices such as manual switches, pressure sensors, light sensors, proximity switches, and limit switches. The communication link 10 which connects the elements of the ring 3 together may be a twisted wire pair, coaxial cable, optical fiber or other serial communication link media which is suitable for use in an industrial environment. The drivers and receivers at the ends of each link segment 10 are chosen to match the selected communications media. The lengths of each link segment 10 will vary depending on the particular application. For example, the I/O modules 4, 5 and 6 may be located in a separate cabinet from the processor 1, and in such case, the links 10a and 10d are relatively long and the links 10b and 10c are very short. It will become apparent from the description below that the present invention does not limit the number of I/O modules which may be employed in the ring 3, the number of I/O points which may reside at each module, or the choice of communications media which may be used in the ring 3. Referring particularly to Fig. 2, the communications ring 3 is operated when the processor 1 performs an I/O scan to output data from its output image table 11 and to input data to its input image table 12. The I/O scan is performed by sequentially shifting the contents of the output image table 11 on to the ring 3. Concurrently, input data from each I/O module 4, 5 and 6 is inserted on the ring 3 and shifted into the input image table 12. Thus, when all of the output data has been shifted from the output image table 18, the input image table 12 has also been updated by input data returned through serial input port 7. The essence of this I/O scan is illustrated in Figs. 5A-5D. As shown in Fig. 5A, the first step in the I/O scan is for the processor 1 to set pointers to the last entries in both image tables 11 and 12. The output data for I/O module 6 is transmitted to I/O module 4 and the I/O scan advances to the state shown in Fig. 5B. The input data applied to module 4 is latched when it receives this output data. The input data which was previously latched by I/O module 4 is shifted forward around the I/O ring 3, with the input data for the last I/O module 6 being deposited in the last entry of the input image table 12. The pointer for the output image table 11 is then advanced to the entry for I/O module 5, and the output data for I/O module 5 is output from the table 11 by the processor 1. As shown in Fig. 5C, the I/O scan then advances to the next step in which the image table pointers are advanced to the next table entries and the data on the I/O ring 3 is shifted ahead. The input data for I/O module 5 is received by the processor 1 and this is written into the input image table 12. The last of the output data for I/O module 4 is then transmitted on the I/O ring 3 and the I/O scan advances to the state shown in Fig. 5D. Again, the data is shifted forward around the I/O ring 3 and the input data for I/O module 4 is received by the processor 1 and is written into the input image table 12. The processor 1 then transmits a "CHECK COMMAND" on the I/O ring 3 which is passed around the ring 3 by each I/O module 4-6. As each I/O module 4-6 receives this command, it checks the integrity of the output data which is received during the scan. The CHECK COMMAND carries an error indication back to the processor 1 if a problem is detected. The processor 1 then transmits an "UPDATE COMMAND" on the I/O ring 3. As each I/O module 4-6 receives this command, it again checks the integrity of the output data which is received during the scan. If this data is good, the data is latched and output to the I/O module's terminals 8. Receipt of the UPDATE COMMAND back from the I/O ring 3 signals the processor 1 that the I/O scan is complete and that another I/O scan can be started. Referring particularly to Fig. 4, the processor 1 is a microprocessor-based system which is structured about an 8-bit microprocessor 20 that drives an address bus 21 and a data bus 22. The microprocessor 20 operates in response to machine language program instructions which are read from a read-only memory (ROM) 23, and it operates on data which is stored in a random access memory (RAM) 24. In the preferred embodiment described herein the microprocessor 20 performs the programmable interface functions on a numerical control system such as that described in U.S. Patent No. 4,228,495. The I/O loop 3 is operated by the microprocessor 20 through a receiver/transmitter 25. The receiver/transmitter 25 has a serial output line 26 which drives the processor output port 2 through an appropriate serial output circuit 27. Similarly, the processor input port 7 is coupled to a serial input line 28 by a serial input circuit 29. The particular circuits chosen to connect with the I/O loop 3 will, of course, depend on the communications media which is chosen. The receiver/transmitter 25 as well as the other elements in the processor 1 may be enabled when addressed by the microprocessor 20. The addresses which appear on the bus 21 are applied to an address decoder 30 that provides a chip enable signal to the system element being addressed. The receiver/transmitter 25 is thus enabled through control line 31, and data may be written to it or read from it through the data bus 22. A read/write control line 32 which is driven by the microprocessor 20 determines whether a read or a write operation is performed, and an address code from the address bus 21 selects the source or destination of data within the receiver/transmitter 25. For example, a status byte may be read from the receiver/transmitter 25 which indicates if a character has been received through input port 7 and if the transmit buffer is available to accept a character for transmission through serial output port 2. In addition, a character received from the I/O ring 3 may be read from the receiver/transmitter 25, and a character may be written to its transmit buffer for transmission on the I/O ring 3. The input image table 12 and the output image table 11 are stored in the RAM 24 along with other data structures (not shown) required to carry out the programmable interface functions. In addition, an I/O scan program indicated at 33 is stored in the ROM 23. As will now be described in detail, the microprocessor 20 periodically executes the I/O scan program 33 to couple the data in the I/O image tables 11 and 12 with the sensing devices and operating devices connected to the I/O ring 3. Referring particularly to Fig. 6, the I/O scan program is entered at 35 each time the I/O image tables 11 and 12 are to be updated. The outputs for I/O module 6 are then read from the output image table 11, as indicated by process block 37, and two OUTPUT packets in the format shown in Fig. 7A are formed. When the UPDATE COMMAND has traversed the I/O ring 3 and is received back at the receiver/transmitter 25, an "OK" flag in the UPDATE COMMAND is checked at decision block 39. If a problem exists on the I/O ring 3, this flag is set and the system branches to process the error at process block 40. If the I/O ring 3 is operating properly, the output data for I/O module 6 is output, as indicated at process block 41, and a loop is entered at decision block 42 to await receipt of input data. The input data is received in the form of two INPUT packets in the format shown in Fig. 7A. This input data is written to the input image table 12 at the locations for I/O module 6, as indicated at process block 43. The output data for I/O module 5 is then read from the output image table 11 and transmitted on the I/O ring 3, as indicated at process block 44. The process repeats, with the input data for I/O module 5 being received at process block 45 and the output data for I/O module 4 being transmitted at process block 46. When the input data from I/O module 4 is received and written to the input image table 12 at process block 47, the CHECK COMMAND is formed and transmitted at process block 48. The format of this command is shown in Fig. 7B, and when it has traversed the I/O ring 3 and is received back at the receiver/transmitter 25, the "OK" bit therein is checked at decision block 49. If an error is indicated, the system branches to the error processor 40. Otherwise, the processor 1 executes a set of instructions indicated by process block 50 to both form and transmit the UPDATE COMMAND on the I/O ring 3. The format of this command is shown in Fig. 7B. The I/O scan program is then excited. While the I/O modules 4, 5 and 6 can be constructed using a variety of commercially available integrated circuits, in the preferred embodiment, a "state machine" is constructed using a custom integrated circuit. The circuit diagram for each I/O module 4-6 is shown in Fig. 3, where the serial input circuit 60 and the serial output circuit 61 are chosen to match the particular serial communication link 10 chosen. For example, if a fiber optic link 10 is used, the serial input circuit 60 may take the form of an optical receiver such as the model HFBR-2502 from Hewlett Packard Company, and the serial output circuit 61 may take the form of an optical transmitter such as the model HFBR-1502 from Hewlett Packard Company. The data received and transmitted on the serial link 10 is comprised of 10-bit packets. Referring particularly to Figs. 7A and 7B, the first bit in each packet is a "start" bit and the last bit is a "stop" bit. The second bit in each packet indicates whether the packet contains data or command information. As shown in Fig. 7A, data packets contain six data bits and a parity bit, whereas command packets contain six command bits and a parity bit as shown in Fig. 7B. Referring particularly to Fig. 3, when a packet is received at the serial input circuit 60 of an I/O module, a start bit detect circuit 62 is enabled and a timing and control circuit 63 produces a clock signal through line 64 for a receive shift register 65. The remaining bits in the packet are received and shifted into the register 65 by the clock signal. The timing and control circuit 63 then enables a command decoder 66 if the packet is a command packet, and the command data is coupled to the decoder 66 from the register 65 through a bus 67. As will be described in more detail below, command packets indicate a number of different functions that are to be carried out, and the particular function is signaled to the timing and control circuit 63 through a bus 68. The command data is also coupled through the bus 67 to an output multiplexor 70 where it is applied to the inputs of a transmit shift register 71. In response to clock pulses received from the timing and control circuit 63, the command packet is shifted out of the register 71 to the serial output circuit 61. In this manner, command packets received at the serial input circuit 60 are coupled to the serial output circuit 61 for transmission around the I/O ring 3. Referring still to Fig. 3, when a data packet is received and shifted into the register 65, the operation of the I/O module circuitry is different. First, the contents of one of the input latches 72 or 73 or the contents of an A latch 74 is applied through the output multiplexor 70 to the transmit shift register 71. Thus, as the data packet is received, another data packet is being transmitted through the serial output circuit 61. When the data packet is totally received and its parity checked, the contents of B latch 75 is applied to the A latch 74, and the new data packet is stored in the B latch 75. The latches 74 and 75 provide a buffer for two data packets. As the data packets for other I/O modules on the I/O ring 3 are received, they are coupled through the B latch 75, then the A latch 74 and then transmitted through the serial output circuit 61. Similarly, output data for the I/O module is received as two successive data packets. These two output data packets are pushed into the latches 74 and 75. The output bits in the B latch 75 are the complement of the output bits in the A latch 74. At this moment in the I/O scan sequence, the UPDATE COMMAND packet is received at the serial input circuit 60 and decoded by the command decoder 66. In response, the timing and control circuit 63 enables a comparator 76 which produces an enabling signal on line 77 if the output data in the B latch 75 is the exact complement of the output data in the A latch 74. This enabling signal applies the data in A latch 74 to an output latch 78 which drives six output circuits through leads 79. Output circuits such as that disclosed in U.S. Patent No. 3,745,546 may be used for this purpose. Input data is received at the input latches 72 and 73 through lines 80. These lines 80 are driven by input circuits such as those disclosed in U.S. Patent Nos. 3,643,115 and 4,275,307 which connect to the I/O module's input terminals 9. The I/O module of Fig. 3 operates as follows during the I/O scan sequence. When a data packet is received at the shift register 65, the input latches 72 and 73 are clocked and the contents of input latch 72 is applied to the transmit shift register 71 for transmission around the I/O ring 3. The received data packet is applied to the B latch 75. When the next data packet is received, the contents of input latch 73 is transmitted on the I/O ring 3 and the received data packet is stored in the B latch 75 after pushing its contents to the A latch 74. As subsequent data packets are received, the contents of the A latch 74 is applied to the transmit shift register 71 and the received data packet is stored in the B latch 75, pushing its contents to the A latch 74. Data packets are passed through the I/O module until an UPDATE COMMAND is received at the shift register 65. When this occurs, the data stored in the A latch 74 and B latch 75 is compared by the comparator circuit 76. If this data is complementary, the contents of the A latch 74 is applied to the output latch 78 and the UPDATE COMMAND is forwarded to the next I/O module on the ring through the transmit shift register 71. If an error has occurred so that the output data is not complementary, the output data is not applied to the output latch 78. Instead, the "OK" bit is cleared in the UPDATE COMMAND to indicate an error before it is sent on to the next I/O module on the I/O ring 3. Also, a fault light 81 is energized through a D-type flip-flop 82. As indicated above, when the UPDATE COMMAND is received back at the processor 1, the OK bit is checked and appropriate action taken if it is cleared. As indicated previously, the CHECK COMMAND is sent around the I/O ring 3 just prior to the UPDATE COMMAND. A similar comparison of the output data and its complement is made by each I/O module 4-6 when this command is received. The "OK" bit in the CHECK COMMAND is cleared if a problem is found in any of the I/O modules 4-6, and the processor 1 may respond to such an error by not transmitting the UPDATE COMMAND. Thus, if faulty output data is detected, none of the outputs are updated.

Claims: An input/output system for an industrial system which comprises: a control processor (1) having-memory means (24) for storing an input image table (12) and an output image table (11), and having a serial output port (2) for transmitting packets consisting of data from the output image table or command data to a first serial link (10a) and having a serial input port (7) for receiving input data packets from a second serial link (10d) and storing them as entries in the input image table (12); and a plurality of I/O modules (4, 5, 6) each having a serial input port (60) and a serial output port (61) the I/O modules being connected in series and the input port (60) of the first I/O module (4) being connected to the first serial data link (10a) and the serial output port of the last I/O module (6) being connected to the second serial data link (10d) to form a serial I/O ring (3), and wherein each I/O module includes: (a) memory means (74, 75) for the temporary storage of at least one data packet received at the I/O module's serial input port (60); (b) an output latch (78) for applying contents of said memory means (74, 75) to a set of output terminals (8, 79); (c) an input latch (72, 73) for applying input data received at a set of I/O module input terminals (9, 80) to the I/O module's serial output port (61); (d) control means (62, 63, 66) for distinguishing between received command data and data packets, in the first case causing the command contained therein to be executed and further causing said command data to be transmitted to the next I/O module, and in the second case causing one or more of the following actions to take place: causing input data from the input latch (72, 73) to be directed to the I/O module's serial output port (61), causing the data packet received at the I/O module's serial input port (60) to be stored in the memory means (74, 75), causing the data packet stored in the memory means (74, 75) to be directed to the I/O module's serial output port, wherein the control processor (1) performs a sequence in which it outputs all the entries of the output image table (11) to the first serial data link (10a) one after another as a series of data packets, each I/O module (4,5, 6) stores each data packet it receives in the memory means (74, 75), and further if the received data packet is the first of the sequence, the contents of the input latches (72, 73) are directed to the I/O module's serial output port (61) and transmitted as a data packet, and if the received data packet is not the first of the sequence, the previous contents of memory means (74, 75) are directed to the I/O module's serial output port (61) and transmitted as a data packet, the data packet received by the control processor (1) on the second serial data link (10b) being entered sequentially into the input image table, thereby causing the output image table (11) to be output to the I/O modules (4, 5, 6) and the input image table (12) to be input substantially concurrently, and wherein the sequence performed by the control processor (1) includes outputting command data which is received by each I/O module (4, 5, 6) and which causes each I/O module (4, 5, 6) to transfer the contents of its memory means (74, 75) to its output latch (78). The input/output system as recited in claim 1 in which each module's output data includes redundant output data and each I/O module (4, 5, 6) includes comparator means (76) for checking the integrity of its output data by comparing it with the redundant output data. The input/output system as recited in claim 2 in which each module (4, 5, 6) includes means coupled to the comparator means (76) for altering the command data received when an error is detected in the output data, and the control processor (1) includes means for receiving the command data after it has been transmitted around the I/O ring (3) and indicating an error if the command data has been altered. The input/output system as recited in claim 2 in which each module (4, 5, 6) includes means (81) coupled to the comparator means (76) for providing a visual indication if errors are detected in the output data.

Inventors: WEPPLER, ROBERT C.
Applicants: ALLEN-BRADLEY COMPANY
Application year: 1985
Main classification: G05B19
IPC codes: G06F15, G05B15, G06F13, H04L12, G05B19