CA1186062A - Communications network for programmable controllers - Google Patents

Communications network for programmable controllers

Info

Publication number
CA1186062A
CA1186062A CA000419100A CA419100A CA1186062A CA 1186062 A CA1186062 A CA 1186062A CA 000419100 A CA000419100 A CA 000419100A CA 419100 A CA419100 A CA 419100A CA 1186062 A CA1186062 A CA 1186062A
Authority
CA
Canada
Prior art keywords
data
programmable controller
packet
ring
programmable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
CA000419100A
Other languages
French (fr)
Inventor
Gary L. Schumacher
Odo J. Struger
Ronald E. Schultz
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Allen Bradley Co LLC
Original Assignee
Allen Bradley Co LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Allen Bradley Co LLC filed Critical Allen Bradley Co LLC
Application granted granted Critical
Publication of CA1186062A publication Critical patent/CA1186062A/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/052Linking several PLC's

Abstract

COMMUNICATIONS NETWORK FOR PROGRAMMABLE CONTROLLERS
Abstract of the Disclosure Programmable controllers are connected in a ring by serial data links. Each controller periodically transmits information packets on the ring which contain its I/O image table data. All controllers on the ring receive such data and store it in their data tables, and such data is thus available for examination by each controller processor during its execution of the user's control program.

Description

CO~JNICATIONS NETWORK FOR PROGRAMMABLE CONTROLLERS

The field of the invention is programmable controllers such as those disclosed in U. S. Patent Nos. 4,165,534; 4,266,281; and 4,291,388.
Programmable controllers are employed in many industrial and commercial applications to control the operation of various types of machines. Programmable controllers are characterized by the repeated execution of a stored control program which contains instructions that direct the controller to examine the status of various sensing devices on the controlled machine and to operate various output devices on the controlled machine.
The size, or capacity, of a programmable controller should be compatible with the size of the machine or process being controlled. Size is typically measured by the number of I/O
points the controller can support without degrading its response time to changing conditions on the controlled machine or process.
In many applications this goal is met initially with a relatively small capacity programmable controller, but with the passage of time (and further automation) the capacity of the programmable controller is sometimes exceeded.
One solution to this problem is disclosed in U. S. Patent No. 4,250,563 where the processor in a low capacity programmable controller may be easily replaced with a more powerful processor which will support additional I,/O points. Another solution which is applicable to some installations is disclosed in co-pending U.
2S S. Patent No. 4,319,338 entitled "Industrial Communications Network". The industrial communications network enables program-mable controllers to be connected together through a high speed data link. Although this network has very effectively enabled programmable controllers to communicate with each other, and has thereby facilitated the addition of controllers as the control -1 ~

task grows, the hardware required for such communications networks is relatively expensive.
In some applications the sensing devices and operating devices on the machine or process being controlled are distributed over a wide area. In some installations it may b~ more desirable to employ a plurality of small programmable controllers distrib-uted throughout the facility rather than a single large program-mable controller. To implement such a distributed processing strategy, an economical means for connecting the programmable contxollers into a single communications network is required.
The present invention relates to a means for interconnecting a plurality of programmable controllers to form a network which enables them to cooperatively control a machine or process. More specifically, the present invention is an improvement in a pro-grammable controller in which an I/O image table in the program-mable controller is periodically output to other similar program-mable controllers through a serial output port, and I/O image table data from other programmable controllers is received through a serial input port and is stored in a data table; and wherein the control program executed by the programmable controller includes instructions which examine the state of the I/O image table and the data table.
The invention will enable one to interconnect programmable controllers such that they cooperatively control a machine or process. By periodically transferring their I/O image tables to all other controllers in the network, each controller has up-to-date data which indicates the state of all sensing devices and output devices on the machine be~ng controlled. Additional I/O
points may thus be easily supported by adding an additional programmable controller to the network.
The invention will enable one to minimize the hardware and software required to support the interconnection of the program-mable controllers. By connecting the programmable controllers in
-2-~fi~G~
a ring, a serial input port and a serial output port is the only hardware required to connect to the network. No collision detec-tion ox polling software is re~uired since communications is accomplished by passing information packets around the ring.
The invention will also enable one to coordinate the network communications with the execution of the control program in each programmable controller. Each programmable controller sends a packet of I/O status i~formation in synchronizm with its execution of the stored control program. Up-to-date I/O status data can thus be provided to the other controllers on the network with minimal impact on control program execution. On the other hand, the receipt of packets o I/O status information from other controllers on the network is an asynchronous event. Such re-ceived data is stored in the data table with minimal interruption of the ccntrol program execution, and the data is forwarded to the next controller on the ring with mi~imal delay.
The invention will also provide a means for communicating other information to processors in the network. This is accom-plished by including controller identification data and command data in the information packets which are transmitted on the network. The command data is decoded by each controller when it receives the packet, and functions other than the transfer of I/O
status data may thus be initiated. Such functions may include network initialization and control program editing. In addition, by decoding the controller identification data in each packet the integrity of the network and the activity of all controllers on the network can be monitor~d.
The invention also enables one to provide a network in which an "intelligent" processor such as a computer or program loader may be easily added. Such a processor is inserted into the ring to receive all information packets and pass them on and to generate information packets which control the operation of the network.
In drawings which illustate the embodiments of the invention, Fig. 1 is a perspective view of our programmable controllers connected in a communication ring according to the present inven-tio~;
Fig. 2 is a block diagram of a programmable controller which is employed in the system of Fig. 1 and which incorporates the present invention;
Fig. 3 is a schematic diagram of a decoding circuit shown in Fig. 2;
Fig. 4 is an electrical schematic diagram of an EAROM enabla/
disable circuit shown in Fig. 2;
Fi~. 5 is a schematic representation of the information packet format employed in the system of Fig. 1;
Fig. 6 is a flow chart of a RELOAD routine stored in the ROM
in Fig. 2.
Fig. 7 is a flow chart of an INITIALIZATION routine stored in the ROM in Fig. 2;
Fig. 8 is a flow chart of a RUN routine stored in the ROM in Fig. 2; and Fig. 9 is a flow chart of an INTERRUPT SERVICE routine stored in the ROM in Fig. 2.
Referrin~ particularly to Fig. 1, our programmable control lers 1-4 are shown connected in a ring configuration by four cables 5-8. The programmable controllers 1-4 are essentially identical for the purpose of the present invention, and the detailed description of the prog-ammabl~ controller which follows applies egually to all controllers 1-4 in the ring. Although four programmable controllers are shown in the ring of Fig. 1, the present invention can be employed with a ring containing two or more programmable controllers. In the preferred embodiment ~3!36~

described herein, an upper limit in ring size o eight program-mable controllers is contemplated.
Referring still to Fig. 1, each programmable controller lncludes a power supply lO which mounts to the side of a card rack 11. The card rac~ 11 contains a processor module 12 and a set of separate I/O modules 13. The number and type of I/O
modules 13 will vary depending on the particular application, but each includes a connector 14 having terminals which connect to wires leading to sensing devices and operating devices on the machine being controlled (not shown in the drawings). For a detailed description of the mechanical structure of each program~
mable controller 1-4, reference is made to U. S. Patent No.
4,151,580 entitled "Circuit Board Assembly with Disconnect Arm".
Referring particularly to Fi~. 2, the operation of the processor module 12 is directed by a microprocessor 36 which is coupled to an address bus 30 through a set of buers 37 and which is coupled to a data bus 31 through a set of bidirectional buffers 38. The microprocessor 36, which in this embodiment is a model Z-80A microprocessor manufactured by Zilog, Inc., is driven through a clock line 39a by a four-megahertz clocX circuit 33.
Reference is made to the Z80-CPU Technical Manual published in 1976 by Zilog, Inc., for further information on the architecture, the operation and the instruction set for this microprocessor 36.
The address bus 30 and the data bus 31 connect the micropro cessor 36 to three memories. The first of these is a random-access memory (RAM) 40 which stores some test location data 35, a data table 41, a flag table 41' an I/O image table 42, a table of preset and accumulated values of timers and counters 43 and a user control program 44. The RAM 40 can store 2K bytes of data in separately addressable lines with an added parity bit in each line. The second of these memories is a 4K byte read-only memory (ROM) 45. It stores a table of jump statements 46, a first group of microprocessor instructions organized in firmware routines 47 ~6~
and a second group of microprocessor instructions organized in macro-instruction interpreter routines 48.
The third memory is a 2K-byte electrically alterable read-only memory (EAROM) 49 which serves as an archive for data stored in the RAM 40, to protect against its loss. This data includes the data table 41, which is comprised of copies of the I/O image table data from the other programmable controllers in the ring.
It also tncludes the I/O image table 42 which depicts the status of the sensing devices and the status of the operating devices direc~ly connected to the I/O modules 13 of this programmable controller. The control program 44 contains macro-instructions which perform such functions as examining the state of particular bits in the I/O image table 42 and the data table 41, and setting output status bits in the I/O image table 42 according to the logic of such instructions.
The microprocessor 36 is programmed to repeatedly execute the control program 44, execute an I/O scan, and perform network communications functions. The I/O scan operates to input status data from the I/O circuits 13 through an I/O interface circuit 22 and to store this status in the input portion of the I/O image table 42. The I/O scan also operates to write the output portion of the I/O image table 42 to the I/O circuits 13. In this manner the status of the I/O image table 42 is updaked with current information from sensing devices on the machlnes being controlled, and all operating devices on the controlled machine are driven to the current s-tate of the output portion of the table 42.
The network communications functions are performed with a universal asynchronous/synchronous receiver/transmitter (USART) 32. The serial output port on the USART 32 connects to a bus driver 33 whlch connects to the cable 5 and the USART's serial input port is driven by a bus receiver 34 which connects to the cable 8. The USART 32 is enabled through a control line 54 and a byte o input data is read from it when a RD control line 51 is _ ~, O ~ Z

active. Data is output through the enabled USART 32 when a WR
control line 52 becomes active. As will become apparent from the description below, message data is received asynchronously from other programma~le controllers in the ring. When a byte of such data is received through the cable 8, the USART 32 generates a logic low signal on an INT control line 55. This generates an interrupt which vectors the microprocessor 36 to execute an interrupt service routine which is stored in the ROM 45.
The microprocessor 36 controls the coupling of data to the RAM 40, the ROM 45 and the EAROM 49 through the read and write control lines 51 and 52 and lines A10-A15 of the address bus 30.
These lines and a memory request (MREQ) line 55 and a refresh (RFSH) line 56 are connected to a decoding circuit 57. The ROM
45 is connected to the decoding circuit 57 through a four-li~e ROM er.able bus 58. Data is read from the ROM 45 by generating an address on lines AO-A11 of the address bus 30. Lines AO-A9 actually specify the address, while lines A11 and A10 are decoded by the decoding circuit 57 to enable a line in the ROM enable bus 58.
The RAM 40 is also connected to lines AO-A9 of the address bus 30. The RAM 40 is a 2K by nine-bit memory, with eight data bits and one parity bit stored on each of its lines. The stored parity is read out on a parity bit output line 59 to a RAM enable and parity checking circuit 60 as data is read from the RAM 40.
The RAM enabLe and parity checking cirsuit 60 is connectsd to the data bus 31 to receive data read from the RAM 40, and it calcu-lates -the parity of this data and compares it to the stored par ty received on the parity ~i output line 59. The RAM enable and parity checking circuit 60 is connected through a parity error (PE) line 73 and a parity error complement (PE) line 81 to a watchdog timer circuit 74 to signal a parity error.

The RAM enable function is controlled by the microprocessor 36 through the A10 address line and the read llne 51, which ~*~
connect the microprocessor 36 to the RAM enable and parity check-ing circuit 60. The RAM 40 is enabled through two chip select (CSl and CS2j lines 65 and 66 which connect the R~M enable and parity checking circuit 60 to the RAM 40. Through each chip select line 65 and 66, a lK by nine-bit bloc~ of the RAM 40 is enabled for read and write operations.
Data is written to an addressed line of the RAM 40 through a set of input buffers 67 connected in a one-way input branch 31b of the data bus. The input buffers 67 are enabled through a buffer enable line 68 which is driven by the RAM enable and parity checking circuit 60.
Data is read from an addressed line of the RAM 40 through a mapping PROM 69 in an output branch 31c of the data bus 31. The mapping PROM 69 is a mask-programmable read-only memory. Each macro-instruction in the control program specifies an operation, e.g., X~C, XIO, and an eight-bit operand address. The operand address specifies a location in the tables 41-43 of the RAM 40 that contains the data upon which the operation is to be per-formed. The operation codes in each control program instruction is mapped ~o a corresponding macroinstruction interpreter routine stored in the ROM 45, and it is the function of the mapping PROM
69 to assis~ in this process. For a more detailed description of its operation, reference is made to U. S. Patent No. 4,291,388.
The decoding circuit 57 can be addressed through lines A10-A15 of the address bus 30 to enable various elements in the programmable controller. Referring particularly to Fig. 3, the decoding circuit 57 includes a three-line-to eight-line decoder 82 having address lines A12, A13 and A14 connected to three inputs 83 and having the Al5 address line, the memory request line 55, and the refresh line 56 connected to three enable inputs 84. A "O" output on the decoder 82 and the read line 51 are connected to the inputs on an OR gate 85, and thi 9 OR gate 85 is connected to an enable input 86 on a two-line-to-four-line decoder 6~

87. The decoder 87 has four outputs which drive the ROM enable bus 58 in response to the signals on the A10 and All address lines.
A RAM enable line 88, an EA~OM enable line 89 and the USART
enable line 54, are connected to the "2", "3" and "6" outputs on the decoder 82, and the "7" output and the write line 52 are coupled through an OR gate 90 to the dog reset line 79. The "4"
output on the decoder 82 connects to one input on each OR gat 112 and 113. The OR gate 112 is also connected to the RD control line 51, and the gate 112 drives a control line 24 which enables data to be input from the I/O circuits 13 through the I/O inter face circuit 22. Similarly, the OR gate 113 connects to the WR
control line 52 and it drives a control line 25 which enables data to be output to the I/O circuits 13. The "5" output on the decoder 82 and the write line 52 are coupled through one OR gate 91 to the kick dog line 78, and the "5" output and the RD control line 51 are coupled through another OR gate 92 to a bufer enable line 93. The buffer enable llne 93 is connected to a set of buffers 94 which are enabled when a status port is addressed through lines A12-A14 of the address ~us 30. An address of 5,000 (hexadecimal) will enable the buffers 94, so that the status of circuits connected to its inputs can be read.
A mode switch 70 is connected through three flip-flops 95-97 to three inputs 98-100 on the buffers 94. The mode switch 70 includes three st:ationary contacts associated with the LOAD, TEST
and RUN modes, respectively, which are pulled high through pull-up resistors 101-103 by a d-c voltage source 104. A grounded, movable contact 105 pulls the li.e connected to one of the sta-tionary contacts to a logic low level. In Fig. 3, the line connected to the TEST conta~t is pulled low. The LOAD, TEST and RUN switch contacts are connected to the S (set) terminals on the three flip-flops 95-97. The Q outputs of these flip-flops 95-97 are connected through NOR gates 106-108 to R (reset) terminals on each other pair of flip-flops 95 97.
The setting of the mode switch 70 in the TEST mode generates a logic high signal at the Q output of the flip-flop 96, while logic low signals are maintained at the Q outputs of flip-flops 95 and 97. If the movable contact 105 were to be switched to the LOAD position, the Q output on flip-flop 95 would switch to a logic high level, and this signal would be returned through the NOR gate 107 to reset the TEST flip-flop 96. Furthermore, the logic high signal would be coupled through an invexter 109 to produce a logic low signal on a LOMO line 110.
Also connected to four inputs of the tristate buffers 94 is a four pole station number switch 73. As indicated above, up to eight programmable controllers can be connected in the communica-tlons ring. By setting the poles of the switch 73 to the proper binary bit pattern, each pro~rammable controller is assigned a separate station number from one to eight. As will become appar-ent from the description below, it is this station mlmber which i5 employed to identify the source of message data placed on the communications ring and it is this station number which is used to determine if the programmable controller i5 the recipient, or dest.ination, of a message on the communications ring. When all four poles of the switch 73 are open, the programmable controller is operated in a stand-alone mode.
Referring to Fig. 2, the operation o the EAROM 49 is con-trolled by an EAROM enable circuit 150, which has inputs connected to the read line 51~ the EAROM enable line ~9, the LOMO line 110 and the address lines A10 and A~l. The write line 52 and lines A0-A9 of the address bus 30 are connected directly to the EAROM
49, while the All address line, the read line 51 and two chip enable lines (CE1 and CE2) 153 and 154 connect the EAROM enable circuit 150 to the EAROM 49.

Referring particularly to Fig. 4, the EAROM enable circuit 150 includes two NAND gates 155 and 156 with their outputs coupled through a NAND gate 157 to a "2" input terminal on a two-line-to-four-line decoder 158. The LOMO line 110 i5 connected to one input on each NAND gate 155 and 156; and the A11 address line is connected to the other input on the other NAND gate 155. The A10 address line is connected to the "1" input on the decoder 158 and the EAROM enable line 89 is connected to an enable input 151.
The two EAROM chip enable (CEl ,and CE2) lines 153 and 154 are connected to the ilol' and "1" outputs of the decoder 158.
Two lK by eight-bit blocks of the EAROM 49 are alternately enabled through the CE1 and CE2 lines 153 and 154. The selection o one o these lines is controlled by the logic signal on the A10 address line, provided that the outputs o~ the decoder 158 are enabled through the EAROM enable line 89. To protect the EAROM 49 from spurious overwriting, the EAROM 49 is disabled for writing and erasing except when the mode switch 70 (Fig. 3) is set for operation in the LOAD mode. When a logic high signal is present on the LOMO line 110, the chip enable lines 153 and 154 will disable the EAROM or writing and erasing, although data can still be read from the EAROM 49. The address line A11 and the RD
control line 51 provide an erase function for the EAROM 49 in response to logic high voltage signals. The EAROM 49 is prevented from receiving these signals, however, unless the mode switch is in the LOAD rnode, as signalled through the LOMO line 110.
Referring agaln to Fig. 2, the watchdog circuit 74 operates in combination with the ram enable and parity check circuit 60 to monitor the operation of the programmable controller. The opera-tion of the watchdog circuit 74 and any resultiny error indica-tions are communicated through control lines 77-79 to the decoding circuit 57. For a detailed description of the watchdog circuit 74 and the parity check circuit 60, reference is made to U. S.
Patent No. 4,291,388.

The microprocessor 36 is operated in response to timing signals received from the clock 39 to read and execute instruc-tions in the firmware routines 47 stored in the ROM 45. The microprocessor 36 repeatedly executes a FETCH routine stored in the ROM 45 to read macro-instructions (including both an operation code and an operand address) from the R~M 40. As explained previously, the two bytes in the macroinstruction are read out through the mapping PROM 69 and the data bus 31 to the micrc-processor 36. The FETCH routine used in obtaining the ma~ro~
10 instructions is listed in Table 1 below.
Table 1 Instruction Mnemonic Comment POP HL Get next instructioni store the operand address in the L register and store the operation code in the H register.

LD ~,L Load operand address ~the low byte of the macro-instruction) into the E register.

LD L,H Form the address in HL which LD H,C specifies a location in a jump table 46 in the ROM 45.

JP (HL) Jump indirect via the jump table 46 in the ROM 45.
The microprocessor 36 makes use of a number of internal registers in executing the FETCH routine, which will become apparent by reference to the Z80 CPU Technical Manual, referred to above. These registers include:
PC, a sixteen-bit program counter;
SP, a sixteen-bit stack pointer;
B and C, eight-bit registers arranged as a pair;
D and E, eight-bit regiszers arranged as a pair: and H and L, eight-bit registers arranged as a pair.
The program counter PC stores the memory address of the current machine instruction to be read from the ROM 45. While this instruction is being read from the ROM 45 the program counter PC is incremented for addressing the next line of the ROM 45.

~
The stack pointer SP stores the memory address of the programmable controller-type macroinstruction to be read from the RAM 40. As each macroinstruction is fetched, the stack pointer SP in incre-mented two counts to address the next controller instruction, and when the END is reached, the stack pointer is initialized to point at the first macroinstruction in the control program. The control program 44 is thus continuously and rapeatedly executed.
The translated operation code that is read from the mapping PROM 69 as part of each control program macroinstruc_ion is, in ~ fact, an address in the jump table 46 in the ROM 45. Each macro~
instruction must be linked with one of the interpreter routines 48 in the ROM 45. This is done via the jump table 46 which contains instructions to jump to the address of a first instruc-tion in a corresponding interpreter routine 48. When the micro-processor 36 executes the operation code of each macroinstruction, it jumps to the first instruction in one of the interpreter routines 48 in the ROM 45. The last portion of each lnterpreter routine includes the FETCH routine, which is executed to fetch the next control program macroinstruction.
A typical macroinstruction interpreter routine for XIC2 is given below in Table 2. This interpreter routine 48 examines bit 2 o an input status byte in the I/O image table 41. This bit represents the status of some sensing device on the machine being controlled.
Table 2 Instruction Mnemonic Comment LD A,(DE) Load operand in the A register.
BIT 2,A Test the specified bit.
JR NZ;FETCH Return to fetch next macro-instruction if bit 2 = 1 (which represents closed contacts).
RES O,B Reset rung status if bit 2 = 0 (representing open contacts).

FETCH:
~ eferring particularly to Figs. 1 and 5, the communications network is a simple unidirectional ring which requires that each programmable controller processor 12 store and forward all mes-sages r or information packets, it receives. Each informationpacket is comprised of eleven bytes of information, the first byte providing a 4-bit code which identifies the source of -the packet and a 4-bit code which identifies the destination of the packet. When the destination code is the same as the source code, a "global" information packet directed to all programmable controllers in the ring is defined.
A command bvte is included in each information packet and it is employed primarily when a programming terminal or other intel~
ligent processor is inserted in the ring. During normal opera-tion, howe~er, a "background" command byte is employed to transmit I/O data and flag data between the programmable controllers.
Other commands include initialization commands which will be described in detail below, and still other commands may be em-ployed by programming terminals such as that disclosed in co-20 pending Canadian Patent Application Serial No. 360,324 filed September 16, 1980, to change the mode of operation of program-mable controllers in the ring and to load and edit their control programs.
The four bytes of I/O data in a background information packet represent the current state of the I/O image table 42 in the source programmable controller. The four bytes of accompany-ing flag data is user defined information ~hich is transmitted to all controllers in the ring. It should be apparent that the number of bytes required to transfer the I/O image table 42 may be varied to accommodate controllers of different sizes. In addition~ large I/O image tables may be transferred in segments, with one data byte being used as an index that indicates which I/O image table segment is being transferred. Such variations from the format shown in Fig. 5 may be indicated by an appropriate command byte.
As will now be explained in more detail, each programmable controller in the ring operates to periodically generate a global background command which transfers the current state of its I/O
image table 42 to the data tables 41 in each of the other program~
mable controllers. Conversely, each programmable controller in the ring also receives information packet on the ring which must be processed. When in the RUN mode, such processing includes transmitting the information packet to the next controller in the ring and directing the I/O data in the packet to the proper portion of the controller's data table 41.
Referring particularly to Fig. 7A, when the programmable controller is powered up it executes an initialization routine which checks the integrity of the data in its RAM 40 and checks the integrity of the communications ring. The microprocessor 36 first disables both maskable and nonmaskable interrupts as repre-sented by process block 160. The microprocessor 36 then entars a systPm check (SYS CHK) portion of the INITIALIZATION routine in which the mode switch 70 is examined as seen in decision block 161 to determine whether it is in the LOAD mode. If the mode switch 70 is set in the LOAD mod~, the microprocessor 36 branches to load or edit the control program. If the mode switch 70 is not set in the LOAD mode, the microprocessor 36 loads the starting address of the RAM 40 in the HL register pair as represented in process block 162. It then reads the data from the RAM 40 and reads the status port in the decoding circuit 57 to check for a parity error. If a parity errc- is detected in the RAM data, the microprocessor 36 branches at decision block 163 to a RELOAD
routine, otherwise, the register pair HL is incremented, as represented in process block 164 to address the next RAM location.
As shown in decision block 165, this address is tested to deter-mine whether it is greater than the last address in the RAM 40, $~
and if not, the microprocessor 36 loops back to process block 162to test the parity of the data in the next RAM address. When all of the RAM data has been checked, the microprocessor 36 checks data at two RAM test locations, as shown in decision block 166.
If this test fails, the microprocessor 36 again branches to the RELOAD routine in Fig. 6.
From this descrip~ion it can be seen that during initializa-tion the data in the RAM 40 is checked and if it is faulty a RELOAD routine is executed to reload the master copy of the data tables 41-43, test data 35 and the user control program 44 from the EAROM 49 into the RAM 40. Referring to Fig. 6, the RELOAD
routine begins as seen in process block 168 with a disabling of both maskable and nonmaskable interrupts, so that data will not be lost due to an interrupt while the RAM 40 is being reloaded.
lS Next, 2K lines of data are transferred from the EAROM 49 into the RAM 40 as shown in process block 169~ The system then returns to the system check portion of the INITIALIZATION routine to recheck the data in the RAM 40. The data in the EAROM 49 is generated by copying the contents of the RAM 40 when the controll~r is switched ~0 from the LOAD mode of operation. The details of this process are described in U. S. Patent No. 4,291,388.
Referring particularly to Fig. 7B, after the integrity of the programmable controller's own data structures has been con-firmed, the readiness and integrity of the communications ring is tested. This is accomplish~d by sending a series of initializa-tion information packets on the ring.
First, however, the state o the station switches 73 are checked, as indicated by decisicn block 170, to determine if the controller is operating alone or i3 in a network. If all the switches 73 are open, the controller is operating alone and a stand alone flag is set as indicated by process block 171 before commencing operation. On the other hand, if the switches 73 indicate a station number from 0 to 7, the stand along flag is -16~

$~

raset at process block 172 and a irst initialization packet is formed and sent on the communications network as indicated at process block 173. The first initialization packet is a global message which includes a unique command byte followed by eight "blank" bytes. The blank bytes correspond to the eight possible programmable controller stations on the ring, and as the first initialization packet is received by each station, that station writes its own status register into the blank byte corresponding to its own station number. If the communications ring is oper-able, this first initialization packet is received back in atimely manner as detected at decision block 174 and it is examined at decision block 175. If the initialization packet is not received in a timely manner, the system loops and trys again until all controllers on the ring are properly operating. The received lnitialization packet is then examined to determine how many stations are on the ring and which station numbers are being used. This information is sa~ed in the RAM 40. If another programmable controller is using the same station number, this is detected at this point and a communications network error is indicated at 176.
As indicated at process block 177, a second initialization packet is transmitted around the ring to further check its integ rity. This packet is formed from the first packet, but the controller loads lts own status register into the blank byte corresponding to lts own station number. The command byte is also changed to indicate it is the second initialization packet.
If the second initialization packet is received in a timely manner as indicated at decision biock 178, the status data is compared with that which was sent to establish that there is not a duplicate station on the ring. If the packet is correct as determined at decision block 179, a final check is made by sending a third initialization pacXet. As indicated at process block 180, this packet is similar to the second ini-tialization packet except the value of a selected timer is loaded into the blankbyte correspondlng to its own station number. If the third packet is received in a timely manner as determined at decision block 181, and if the timer value corresponds to that which was sent, as determined at decision block 182, the co~munication network is considered fully operable. Accordingly, a first program scan flag is set, as indicated at process block 183 and the system jumps to begin executing the control program.
Referring particularly to Figs. 2 and 8, before executing the control program the mode switch 70 is checked to determine if the system is in the load mode. If so, the system branches at decision block 185 to load or edit the control program. Other-wise, the status of all devices connected to the I/O circuits 13 is input and stored in the I/O image table 42 as indicated by process block 186. The first program scan flag is then checked at decision block 187 to determine i this is the first execution of the control program since being powered-up or switched from the load mode. I so, the control program is executed as indi cated at process block 188 to perform a prescan in which all outputs are turned off and all jump targets are calculated. The first program scan fLag is then reset as indicated at process block 189.
On subseguent scans through the control program the system branches at decision block 187 and executes the control program in normal fashion as indicated by process block 190. The macro-instructions in the control program may examine the state of any bit in the I/O image table 42 or the data table 41 to determine the status of any I/O device cornected to a programmable control ler in the ring. Based on the status of such examined I/O devices and the logic of the control program, bits in the output portion of the I/O image table 42 are set or reset. When the END macro instruction is executed the system then executes instructions indicated by process block 191 which output the contents of the l~B~O~
output portion of the I/O image table 4~ to the corresponding I/O
circuits 13.
Eollowing the execution of the control proyram a test is made to determine if the contxoller is operating alone. If not, as determined at decision block 192, a background information packet is constructed using the current contents of the I/O image table 4~ as indicated at process block 193. A check of a packet received flag is then made at decision block 194 to determine if the previously transmitted background packet has traveled com-pletely around the ring. If so, the newly formed background packet is queued up in a transmit buffer in the RAM 40 and the packet received flag is reset as indicated by process block 195.
The system then loops to repeat the cycle of updating the I/O
image table 42, and transmitting a current background packet on the communications ring. Only one background packet for each controller station i5 in transit at any point in time, and when each packat is received back at its originating station, a new background packet containing the most recent version of the station's I/O image table is placed on the ring. The data table 41 in each controller is thus kept up to date.
It should be apparent that the above-described programs are executed continuously to perform the indicated functions. Superc imposed on these "background" programs is a "foreground" program which is executed each time an interrupt is generated by the USART 32. Such an interrupt is genera~ed each time an 8-bit byta is received by the USART 32 and each time the USART 32 has com-pleted the transmission of an 8-bit byte. Associated with the USART 32 is a transmit buffer 200 which is formed in the RAM 40 and which stores information packets awaiting transmission.
Similarly, a receive buffer 201 is formed in the RAM 40 and it serves to store successive bytes of information packets as they are received by the USART 32. Next~in and next-out pointers are associated with each buffer 200 and 2G1, and these indicate the locations at which further data may be loaded into the buffers and the location of the next byte of data to be read from the buffers.
Referring particularly to Figs. 2 and 9, when a USART inter-rupt is generated the interrupt service routine first executes instructions indicated by decision block 202 to determine if the interrupt occurred as a result of a received byte of data. If not, the interrupt was generated by the USART transmitter and the transmit buffer 200 is checked to determine if further data is queued up for transmission. If not, as determined at decision block 203, the system returns to the background programs. Other-wise, the next byte in the transmit buffer 200 is written to the USART 32 for transmission before returning to the background programs. This is indicated at process block 204.
~5 When a byte of data is received by the USART 32, it is loaded into the receive buffer 201 as indicated by process block 205. If the received byte is a checksum byte, a complete in~or-mation packet has been received and can be processed. Otherwise, as indicated at decision block 206, the system returns to the background programs. The information packet is processed by instructions which examine the checksum byte to determine if a transmission error has occurred, and which examine the souxce field to determine if the packet originated at this controller.
If a checksum error is detected, the system branches at 207 to indicate a network error. If the information packet originated at this controller, the system branches at 208 and the "packet received" flag is set at process block 209 before returning to the background programs.
Referring still to Fig. 9, lf the received information packet originated at another controller station, the command byte is examined to determine how the packet is to be processed. As shown at decision block 210, if the packet is an initialization packet, the contents of the microprocessor's status register is inserted into the packet. As indicated by process block 211,this is accomplished by ~Jriting over the blank byte in the packet which corresponds to the station number of this programmable controller. The modified initialization pack~t is then trans-ferred to the transmit buffer 200 as indicated by process block212.
If the received packet is not an initialization packet, it is transmitted without change to the next controller in the ring without further delay. This is accomplished by transferring a copy of the packet to the transmit buffer 200 as indicated by process block 213. Following this the command byte is examined to determine if the packet is a background packet. If not as indicated at decision block 214, the system branches to determine the nature of the command and to process the command. The manner in which these other commands are processed is not particularly pertinent to the present invention and this processing is indi-cated collectively by the single process block 215. On the other hand, when a background information packet is received, the eight bytes of I/O image data are extracted from the packet and written to the data table 41. The source code in the packet indicates which of the seven segments in the data table 41 is to receive the I/O data. As indicated by process block 215, the same process is repeated for the eight bytes of flag data which is written into the appropriate segment of the flag table 41. And finally, as indicated by process block 216, a bit corresponding to the source station number is set in an active station register 217.
This register 217 is stored in the RAM 40 and it is available for testing by the user's controi program to establish which stations on the ring are operable and have transmitted updated I/O status data.
It should be apparent from the above description that there are two important design goals for the interrupt service routine.
First, those information packets which are to be relayed by the controller station should be identified and transmitted as soonas possible. This insures that the packet is conveyed around the ring to all controllers as rapidly as possible. Secondly, the amount of processing time required by the interrupt service routine should be minimized. Since this routine may be entered often during each scan through the control program, it does significantly affect the total scan time of the programmable controller. In the pre'erred embodiment described herein, this burden is dependent upon the number of active stations on the ring and is the lesser of 35% OI the total scan time or 1.4 milliseconds times the number of active stations.

-~2-Appendix A

COMPONENT APPENDIX
Reference Component Number Description Microprocessor 36 Z-80A CPU manufactured by Zilog RAM 40 Four 2114 1024 X 4-bit random-access memories manufactured by Intel Corporation and two 2102 1024 X
l~bit random-access memories manu-factured by Intel Corporation ROM 45 Four 82Sl81 lK X 8 bit programmable read-only memories manufactured by Signetics EAROM 49 Four 3400 lK X 4-bit electrically alterable read-only memories manu-factured by Genaral Instruments, Inc.
Map~ing PROM 69 SN74S472 512-line X 8-bit program-mable read-only memory manufactured by Tex~s Instruments, Inc.
3-line-to-8-line 82 SN74LSl38 3-to-8-line decoder decoder manufactured by Texas Instruments, Inc.
2-line-to-4-line 87, 158 Two SN74LS139 dual 2-to-4-line decoder decoder manufactured by Texas Instruments, Inc.
Bufers 37, 94 Two SN74LS244 octal buffers and line drivars manufactured by Texas Instruments, Inc.
Bidirectional 38 8304 Octal bidirectional Buffers buffers/line drivers manufactured by National Semiconductor, Inc.
Flip-flops 95-97 SN74LS279 quad S-R latches manufac~
tured by Texas Instruments, Inc.
NOR ~ates 106-108 SN24L02 quad 2~input positive NOR
gates manufactured by Texas Instruments, Inc.
OR gates 85, 90- Two SN74LS32 quad 2~input 92, 112 ~ositive OR gates manufactured by Texas Instruments, Inc.
N~D gates 155, 156 SN74LS132 quad 2-input positive 157 NAND gates manufactured by Texas Instruments, Inc.
NAND gate 125 SN74LS00 quad 2-input positive NAND
gates manufactured by Texas Instruments, Inc.



Appendix A (cont.) Reference Component Number Description NAND gate 137 SN7401 ~uad 2-input open-collector NAND gates manufactured by Texas Instruments, Inc.
Inverters 140, 143 SN7406 hex inverters with 144 and open collectors manufactured 146 by Texas Instruments, Inc.
Inverters 145 SN74LS14 hex Schi~t-trigger in-verters manufactured by Texas Instruments, Inc.
Inverters 109 SN7404 hex inverters manufactured by Texas Instruments, Inc.
Gate 114 SN74125 quad bus buffer gates manufactured by Texas Instruments, Inc.

Claims (8)

The embodiments of the invention in which an exclusive property or privilege is claimed are defined as follows:
1. A programmable controller for connection to other programmable controllers in a network through a serial data link, the programmable controller comprising:
a processor for repeatedly executing a stored control program to examine the state of sensing devices connected to the programmable controller and to operate output devices connected to the programmable controller, I/O image table means coupled to the processor for storing data indicative of the state of all sensing devices and output devices connected to the programmable controller;
data table storage means coupled to the processor for storing I/O image table data from each of the other program-mable controllers in the network;
transmit means coupled to the processor and the I/O
image table means for periodically sending the stored I/O
image table data through said serial data link to other programmable controllers in the network;
receive means coupled to the serial data link for receiving I/O image table data from other programmable controllers in the network, the receive means being operable to momentarily interrupt the execution of the control program by said processor and couple the received I/O image table data to said data table; and wherein the processor is operable during the execution of the control program to examine the state of the data table and to thereby determine the state of sensing devices and output devices connected to other programmable control-lers in the network.
2. The programmable controller as recited in claim 1 in which the programmable controllers in the network are connected in a ring, in which the receive means in the programmable controller is operable to couple the I/O image table data received from other programmable controllers to the transmit means, and the transmit means is operable to transmit such data to the next programmable controller in the ring.
3. The programmable controller as recited in claim 2 in which the I/O image table data is transmitted on the ring as a packet comprised of a plurality of data bytes, and in which one of the bytes in each such packet identifies the programmable controller from which the packet originated.
4. The programmable controller as recited in claim 1 in which the transmit means is enabled each time the proces-sor executes the control program.
5. A programmable controller for connection to other programmable controllers in a ring communications network, the combination comprising:
a serial input port for receiving packets of data from another programmable controller in the ring;
a serial output port for transmitting packets to another programmable controller in the ring;
a memory for storing data which includes a control program, an I/O image table, a data table, and a transmit buffer;

a processor coupled to said memory and being operable to execute instructions in the control program which direct the processor to examine the state of the I/O image table and the data table;
receive means coupled to the memory and the serial input port and being responsive to the receipt of a packet of data at the serial input port from another programmable controller in the ring to store data contained in the packet in the data table portion of the memory, and to store the packet of data in the transmit buffer portion of the memory;
packet forming means coupled to the memory for periodi-cally forming a packet of data and writing it to the transmit buffer, which packet of data is formed in part by data trans-ferred from the I/O image table portion of the memory; and transmit means coupled to the memory and the serial output port and being operable to transmit packets of data stored in the transmit buffer to the next programmable controller in the ring through the serial output port.
6. The programmable controller as recited in claim 5 in which the packet forming means is operable in synchronism with the processor's execution of the control program instruc-tions and both the receive means and the transmit means operate asynchronously with respect to the processor's execution of the control program instructions.
7. The programmable controller as recited in claim 5 which includes means for designating a station number and the packet forming means is operable to read the designated station number and load it into each packet of data which it forms.
8. The programmable controller as recited in claim 7 in which the memory stores an active station register con-taining a memory location associated with each programmable controller on the ring, and the receive means is responsive to the station number data in each received packet of data to indicate in the active station register that the associ-ated programmable controller is active.
CA000419100A 1982-02-24 1983-01-07 Communications network for programmable controllers Expired CA1186062A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US352,014 1982-02-24
US06/352,014 US4477882A (en) 1982-02-24 1982-02-24 Communications network for programmable controllers

Publications (1)

Publication Number Publication Date
CA1186062A true CA1186062A (en) 1985-04-23

Family

ID=23383436

Family Applications (1)

Application Number Title Priority Date Filing Date
CA000419100A Expired CA1186062A (en) 1982-02-24 1983-01-07 Communications network for programmable controllers

Country Status (2)

Country Link
US (1) US4477882A (en)
CA (1) CA1186062A (en)

Families Citing this family (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS582904A (en) * 1981-06-27 1983-01-08 Omron Tateisi Electronics Co Programmable logic controller
US4630233A (en) * 1984-06-25 1986-12-16 Allen-Bradley Company, Inc. I/O scanner for an industrial control
US4750150A (en) * 1984-06-25 1988-06-07 Allen-Bradley Company, Inc. I/O scanner for an industrial control
EP0208997A1 (en) * 1985-07-19 1987-01-21 Rodger T. Lovrenich Control system and method with diagnostic logic
US4918589A (en) * 1985-10-31 1990-04-17 Allen-Bradley Company, Inc. Method and apparatus for linking processors in a hierarchical control system
US4809217A (en) * 1985-10-31 1989-02-28 Allen-Bradley Company, Inc. Remote I/O port for transfer of I/O data in a programmable controller
US4800488A (en) * 1985-11-12 1989-01-24 American Telephone And Telegraph Company, At&T Bell Laboratories Method of propagating resource information in a computer network
US4882702A (en) * 1986-03-31 1989-11-21 Allen-Bradley Company, Inc. Programmable controller with I/O expansion module located in one of I/O module positions for communication with outside I/O modules
JPH0648811B2 (en) * 1986-04-04 1994-06-22 株式会社日立製作所 Complex network data communication system
JPS62243057A (en) * 1986-04-16 1987-10-23 Hitachi Ltd File transfer managing system
US4888726A (en) * 1987-04-22 1989-12-19 Allen-Bradley Company. Inc. Distributed processing in a cluster of industrial controls linked by a communications network
US4829297A (en) * 1987-05-08 1989-05-09 Allen-Bradley Company, Inc. Communication network polling technique
US4897834A (en) * 1987-08-18 1990-01-30 Allen-Bradley Company, Inc. Bit oriented communications network
CA1339710C (en) * 1988-04-11 1998-03-10 Steven J. Gans Network interface board having memory mapped mailbox registers includingalarm registers for storing prioritized alarm messages from programmablelogic controllers
US5251302A (en) * 1988-04-11 1993-10-05 Square D Company Network interface board having memory mapped mailbox registers including alarm registers for storing prioritized alarm messages from programmable logic controllers
US5142623A (en) * 1988-06-10 1992-08-25 Westinghouse Electric Corp. High performance memory imaging network for a real time process control system
JPH083731B2 (en) * 1988-10-18 1996-01-17 株式会社日立製作所 Programmable controller
US5257393A (en) * 1989-04-19 1993-10-26 Jrm Consultants, Inc. Serially controlled programmable test network
US5377322A (en) * 1989-07-19 1994-12-27 Hitachi, Ltd. Information handling method and system utilizing multiple interconnected processors and controllers
US5513095A (en) * 1989-08-16 1996-04-30 Siemens Aktiengesellschaft Flexible automation system for variable industrial processes
US5297257A (en) * 1991-04-15 1994-03-22 Allen-Bradley Company, Inc. Distributing a real-time control program to a plurality of input/output nodes
JP2848736B2 (en) * 1992-04-02 1999-01-20 三菱電機株式会社 Network system
US5862401A (en) * 1994-10-11 1999-01-19 Crown International, Inc. Programmable central intelligence controller and distributed intelligence network for analog/digital control systems
US5835953A (en) * 1994-10-13 1998-11-10 Vinca Corporation Backup system that takes a snapshot of the locations in a mass storage device that has been identified for updating prior to updating
US5649152A (en) * 1994-10-13 1997-07-15 Vinca Corporation Method and system for providing a static snapshot of data stored on a mass storage system
US5826068A (en) 1994-11-09 1998-10-20 Adaptec, Inc. Integrated circuit with a serial port having only one pin
CH690309A5 (en) * 1995-04-05 2000-07-14 Contraves Pyrotec Ag Method and apparatus for implementing the method for filling of projectile bodies having sub-projectiles.
US5802321A (en) * 1996-06-20 1998-09-01 Square D Company Synchronous serial communication network for controlling single point I/O devices
JP3663846B2 (en) * 1997-08-26 2005-06-22 松下電工株式会社 Base board, power supply unit mounted on it, and CPU unit
DE19835209A1 (en) 1998-08-04 2000-02-10 Schwerionenforsch Gmbh Device and method for controlling an irradiation device
EP1045399B1 (en) * 1999-04-12 2005-08-24 GSI Gesellschaft für Schwerionenforschung mbH Device and method for controlling a raster scanner in ion theraphy
US7017373B2 (en) * 2002-09-03 2006-03-28 Owens-Brockway Glass Container Inc. Glassware forming machine control system
EP2719500A4 (en) * 2011-06-08 2015-04-15 Murata Machinery Ltd Workpiece-processing system
JP5752087B2 (en) * 2012-05-24 2015-07-22 三菱電機株式会社 Control device, data output control unit, data input control unit, and control unit

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2275944A1 (en) * 1974-06-21 1976-01-16 Suchard Jean MESSAGE TRANSMISSION SYSTEM BETWEEN SEVERAL STATIONS
JPS5193138A (en) * 1975-02-12 1976-08-16 Johoshorisochini okeru kyotsujohono densohoshiki
US4195351A (en) * 1978-01-27 1980-03-25 International Business Machines Corporation Loop configured data transmission system
US4215396A (en) * 1978-08-24 1980-07-29 Texas Instruments Incorporated Intelligent programmable process control system
US4354226A (en) * 1978-11-14 1982-10-12 Cutler-Hammer, Inc. Communication terminal for interconnecting programmable controllers in a loop
US4319338A (en) * 1979-12-12 1982-03-09 Allen-Bradley Company Industrial communications network with mastership determined by need
US4363093A (en) * 1980-03-10 1982-12-07 International Business Machines Corporation Processor intercommunication system

Also Published As

Publication number Publication date
US4477882A (en) 1984-10-16

Similar Documents

Publication Publication Date Title
CA1186062A (en) Communications network for programmable controllers
US4302820A (en) Dual language programmable controller
US4918589A (en) Method and apparatus for linking processors in a hierarchical control system
US4293924A (en) Programmable controller with high density intelligent I/O interface
US5193189A (en) Programmable controller with multiple priority level task processing
EP0304880B1 (en) Programmable controller with parallel processors
EP0311007B1 (en) Programmable controller with multiple task processors
US5265005A (en) Processor for a programmable controller
US4228495A (en) Multiprocessor numerical control system
US4876664A (en) Programmable controller with a dual intermodule message system
CA1131365A (en) Programmable controller with data archive
US4263647A (en) Fault monitor for numerical control system
US4809217A (en) Remote I/O port for transfer of I/O data in a programmable controller
EP0586813B1 (en) Programmable controller with ladder diagram macro instructions
US4165534A (en) Digital control system with Boolean processor
US4972365A (en) Executing downloaded user programs in a programmable controller
US4638452A (en) Programmable controller with dynamically altered programmable real time interrupt interval
CA1144655A (en) Mini-programmable controller
US4488258A (en) Programmable controller with control program comments
US3886523A (en) Micro program data processor having parallel instruction flow streams for plural levels of sub instruction sets
US5042002A (en) Programmable controller with a directed sequencer
GB2177826A (en) Programmable controller
US4446525A (en) Numerical control with paramacro capability
CA1111951A (en) Programmable controller with limit detection
US5416908A (en) Interface between industrial controller components using common memory

Legal Events

Date Code Title Description
MKEC Expiry (correction)
MKEX Expiry