Abstract:
A programmable logic controller system having the capability of controlling up to 64 clusters of peripheral controllers, wherein each cluster has up to seven racks of peripheral controllers, each rack having up to 16 individual peripheral controllers. Excepting for the cluster containing the programmable logic controller, each cluster is coupled to the programmable logic controller through an ethernet cable to a cluster controller. Each of the seven racks of peripheral controller cards is connected to its respective programmable logic controller or cluster controller directly (for the first rack) or through a local rack adaptor (for the other six racks). The programmable logic controller generates data, address and control signals which are used by the peripheral controllers to operate machines and equipment on an assembly line. The data, address and control signals are generated by a ladder diagram created and modified in a separate personal computer, which may be coupled to the programmable logic controller through an ethernet cable. The code representing the ladder diagram created in the personal computer is downloaded through the ethernet cable to the programmable logic controller. The ladder diagram is created and edited using a ladder editor program having the following features: scrolling, zoom in/out, free format line drawing, real time incremental compiler/linker, dynamic reconfiguration.

Description:
This is a continuation-in-part of application Ser. No. 176,831 filed Apr. 4, 1988 now U.S. Pat. No. 4,969,083. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field Of The Invention 
     The invention relates to the field of programmable logic controllers which are used to control machinery and equipment for automated and partially automated assembly lines. The controllers are programmed by the use of ladder diagrams wherein elements of a ladder diagram represent relays, switches and the like associated with the equipment and machinery on the assembly line. 
     2. Prior Art 
     Prior art programmable logic controllers can be directly coupled to up to 16 peripheral controllers which serve to interface the assembly line machinery and equipment to the programmable logic controller. Additionally, prior art programmable logic controllers can indirectly control six additional racks of sixteen peripheral controllers by using local rack adapters, there being one local rack adapter for each rack of sixteen peripheral controllers, for a total of 896 inputs and 896 outputs (assuming 8 inputs and 8 outputs per peripheral controller). Ladder diagrams which are, in effect, the program used by the programmable logic controller to generate the appropriate control, data and address signals for the peripheral controllers, are created and edited using a separate processor such as a personal computer or minicomputer. The completed ladder diagram is recorded on magnetic tape or disk which is removed from the processor which created the ladder diagram, and read into the memory of the programmable logic controller through a disk or tape drive connected to the programmable logic controller. A representative prior art programmable logic controller is a Model 700 Controller manufactured by Square D Company. 
     Prior art ladder editors are typically part of the programming panel of the prior art programmable controllers. 
     SUMMARY OF THE INVENTION 
     The present invention is directed to a programmable logic controller system having the capability of controlling up to 64 clusters of peripheral controllers, wherein each cluster has up to seven racks of peripheral controllers, each rack having up to 16 individual peripheral controllers. Excepting for the cluster containing the programmable logic controller, each cluster is coupled to the programmable logic controller through an ethernet cable to a cluster controller. Each of the seven racks of peripheral controller cards is connected to its respective programmable logic controller or cluster controller directly (for the first rack) or through a local rack adaptor (for the other six racks). The programmable logic controller generates data, address and control signals which are used by the peripheral controllers to operate machines and equipment on an assembly line. The data, address and control signals are generated by a ladder diagram created and modified in a separate personal computer, which may be coupled to the programmable logic controller through an ethernet cable. The code representing the ladder diagram created in the personal computer is downloaded through the ethernet cable to the programmable logic controller. The ladder diagram is created and edited using a ladder editor program having the following features: scrolling, zoom in/out, free format line drawing, real time incremental compiler/linker, dynamic reconfiguration. 
     Assuming an eight bit data path, each peripheral controller controls up to eight points such as an on/off switch. Since each controller has an input channel and an output channel, there are, in effect, 16 control lines available per controller, although only 8 are available at a time for input or output. Thus, within a group of 16 peripheral controllers, up to 256 points may be controlled (128 input points and 128 output points). Within a cluster of 7 racks of I6 peripheral controllers, up to 1792 points can be controlled with a single programmable logic controller (and 6 local rack adaptors). Similarly, when the full complement of 64 clusters is installed, up to 114,688 points can be controlled by the single programmable logic controller, 63 cluster controllers and 384 local rack adaptors (i.e., six local rack adaptors per cluster). 
     Using a personal computer coupled to the programmable logic controller through an ethernet cable, the ladder diagram used in the system can be easily and dynamically modified as required. The programmable logic controller includes two processors, one of which scans the peripheral controllers and reads the status of the various points (I/O scan) while the other performs calculations using the data read during on I/O scan (logic scan). In the present invention, the I/O scan and the logic scan are performed synchronously and in parallel. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is an overview diagram of the invented programmable logic controller system showing the use of a single programmable logic controller to control up to 64 clusters, each containing seven racks of peripheral controllers. 
     FIG. 2 is an overview block diagram showing the various functional elements coupled to a programmable logic controller for use in the present invention. 
     FIG. 3 is a block diagram showing the components of a programmable logic controller for use in the invented system. 
     FIG. 4 is an overview block diagram illustrating the relationship of various software tasks necessary to implement the invented programmable logic controller system. 
     FIG. 5 is a block diagram illustrating the main functions performed by an editor task. 
     FIG. 6 is a diagram of the data structure of a single rung of a ladder. 
     FIG. 7 is a diagram showing the relationship between a logic scan and an I/O scan. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring first to FIG. 1, the components of the invented programmable logic controller system are shown as personal computer (PC) 11 which is coupled through an ethernet cable 13 to programmable logic controller (PLC) 15. PLC 15 controls up to sixteen peripheral controllers 17 directly and, indirectly, six additional local racks, each having up to sixteen peripheral controllers, through local rack adaptors 21. PLC 15 is also shown coupled through an ethernet cable to up to 63 cluster controllers 25. In this manner, PLC 15 and each cluster controller 25, directly control up to sixteen peripheral controllers 17, and indirectly control up to sixteen peripheral controllers in each of six racks through six local rack adapters 21. Within a cluster, each local rack adapter is coupled to its adjacent local rack adapter, cluster controller or PLC by a 50 conductor cable. 
     FIG. 2 illustrates in further detail the relationships between the major components of the invented programmable logic controller system. Specifically, PLC 15 is coupled to peripheral controller 17 through an 8 bit data bus 27, a six line control bus 29 and an 8 bit address bus 31. 
     PLC 15 is coupled to PC 11 through an ethernet cable 13. Personal computer II may be any commercially available personal computer, but in the preferred embodiment, is an IBM PC/XT, IBM PC/AT or compatible. PC 11 performs three tasks which are shown in FIG. 2 as the editor task 35, the compiler task 37, the housekeeping task 38 and the communications task 39. The compiler task should have the capability of generating executable object code from ladder diagram source code on a line by line basis. A suitable compiler task which may be used in the present invention is disclosed in U.S. Pat. No. 4,722,071 which issued Jan. 26, 1988. Editor task 35, housekeeping task 38 and communications task 39 will be described in detail below. 
     PLC 15 in the present invention performs the three task which are shown in FIG. 2 as the basic input output system (BIOS) task 45, communications task 47 and ladder logic control task 49. Details of each of the foregoing tasks and sub tasks will be described below. The logical relationships between the foregoing tasks is shown in FIG. 4, which shows the PC 11 tasks under control of a PC multitasking executive shell and the PLC 15 tasks and subtasks under control of a PLC multitasking executive shell. 
     The components necessary to implement PLC 15 in the present invention are shown in block diagram form in FIG. 3 and comprise input/output scanner 55 and logic scanner 57. 
     Input/output scanner 55 includes a central processing unit (CPU) 61, random access memory (RAM) 63, read only memory (ROM) 65, ethernet ports 67 and 69 and parallel I/O ports 71 and 73. 
     Logic scanner 57 comprises PAL control logic 81, bit sliced processor 83, program RAM 85 and data RAM 87. 
     DESCRIPTION OF PC II TASKS 
     PC II is a commercially available personal computer with a disk drive, display monitor and printer such as on IBM PC/XT, or IBM PC/AT running with a multi-tasking executive shell such as OS/2 available from Microsoft Corporation or Intel&#39;s RMX 86 or AT&amp;T&#39;s UNIX. 
     Editor Task 35 
     Editor task 35 creates and modifies ladder source code. A ladder diagram is a diagram of a group of parallel lines called rungs, each rung representing an arrangement of contacts, coils and/or switches and their status (normally open or normally closed contacts, energized or unenergized coils and on or off switches). As each rung of the ladder is created or modified, a pointer to that rung is sent to compiler task 37. 
     When editor task 35 is initiated, an initialization 100 takes place which loads into memory a selected ladder diagram or a default ladder diagram. Once the initialization has been completed, an edit step commences which sets up a screen display of the ladder in memory and then executes a program loop which performs one of four types of editing or related functions as follows: a) command mode; b) data monitor display mode; c) element mode; or d) line mode. In command mode, editing and supervisory commands are entered. In element mode, the various elements of the ladder are installed and removed. In data monitor mode, blocks of ladder data are displayed in various formats. In line mode, elements entered in Element Mode are connected. 
     Referring now to FIG. 5, the various functions, i.e., Command Mode 101, Data Monitor Display Mode 103, Element Mode 105 and Line Mode 107, and sub-functions of editor task 35 will be described. References to the &#34;cell locator&#34; means the position of a cursor on a video display of a ladder diagram. The position of the cursor is either on a single element or on a space where a single cell may be added. 
     Command Mode 
     Command mode 101 provides File commands 111, Remote commands 113, Find commands 115, Print commands 117 and Area commands 119. 
     File Commands 
     The File commands 111 are Load, Save, Directory, Delete, Clear and Exit. The Load command transfers a file containing source code and object code for a PLC 15 from a storage device coupled to PC 11 into PC 11 memory. Similarly, the Save command transfers the entire loaded object code area from PC 11 memory to a specified destination file on a storage device coupled to PC 11. The Directory command lists the files stored on a disk or other storage media on a storage device coupled to PC II. The Delete command removes a specified file from a disk or other storage media coupled to PC 11. The Clear command erases the entire source and object code stored in PC 11 memory. If any modifications were made since the code was last loaded or saved, a message is displayed reminding the operator to save the current ladder in memory if desired. The Exit command returns control to the computer operating system or switches to Line Mode, Element Mode or Data Monitor Display Mode. 
     Remote Commands 
     Remote commands 113 are used to attach the editor task 35 in PC 11 to a PLC 15. The available remote commands are Detach 112 which causes the editor task 35 to be detached from PLC 15, and Attach 114 which provides the sub-commands i) attach and up-load ladder from controller 116; and ii) detach and down-load ladder to controller 118. For the attach to controller with up-load sub-command, the name of the PLC to which the editor is to be attached is entered. Assuming that the PLC&#39;s name which has been entered is recognized and is not currently attached to another editor, the program currently resident in the controller in program RAM 85 is up-loaded to PC 11 through ethernet 13. The specifics of the handling of the data over ethernet 13 are handled by communications task 39 in PC 11 and communications task 47 in PLC 15. Similarly, when the attach and down-load sub-command is selected, the name of the PLC to which the editor is to be attached must be provided If a valid PLC name has been entered which is not attached to another editor, the editor is attached to the specified controller and the program currently associated with the editor task is down-loaded to the controller into program RAM 85 over ethernet 13. 
     Find Commands 
     The Find commands 115 are Rung, Element, Word/bit, Coil and Replace word/bit. The Find commands are used to locate a specific item in a ladder. In the case of Replace word/bit, the word/bit address, when found can be replaced with a different word/bit address. With the exception of Find Rung, the Find commands are directional; that is, the search is from, but not including, the current position of the cell locator forward, i.e., towards the end of the ladder or backward, i.e., towards the beginning of the ladder. 
     Find Rung requests that a specific rung be specified by number and, therefore, the direction of the search is not applicable. If the Find Rung command is selected, a prompt requesting a number of the rung to be found is displayed. If the entered rung number is found, it and as many following rungs as will fit in the work area of the video display are displayed. If the rung is too large to be displayed in its entirety, as much of the rung as possible is displayed, with the remainder being displayed using the cell locator positioning keys, typically left, right and up, down arrow keys on a keyboard coupled to PC 11. 
     If Find Element is selected, the direction of the search is requested and then the element to be searched for is specified using the Element mode menus (described below). 
     If Find Word/bit is selected, after the search direction has been provided, the word/bit value to be searched for is prompted. A word address alone or a combined word/bit address, which may be either a symbol or a numeric word and bit values must be entered. If an element with the specified word/bit address is not found, an error message so indicating is displayed, otherwise the requested word/bit which is found is displayed. 
     Find Coil operates the same as Find Word/bit, except the search is limited to coil type elements. 
     If Replace Word/bit is selected, once the direction of the search has been selected, the word/bit value to be replaced is prompted for as described above, after which the new word/bit value is prompted for. Once the replacement value has been entered, the ladder is searched in the specified direction for the value to be replaced. If the word/bit address to be replaced is found, the cell locator is placed on the element with the word/bit address and the user is given the option to replace, don&#39;t replace, replace all or quit. If replace is selected, the value at the current location is replaced, and a search for the next occurrence of the value is made and the operator is given the same selection. If don&#39;t replace is selected, the value at the current location is unchanged, and a search for the next occurrence of the value is made and the same choices noted above are provided to the operator. If replace all is selected, the value at the current location, and all the subsequent values found in the direction of the search are replaced with no further operator involvement. If quit is selected, the find and replace operation is terminated, leaving the current and all other values unchanged. 
     Print Commands 
     The Print commands 117 are Ladder, Rung, Symbols and Cross reference. Print Ladder causes the entire ladder program to be printed in a format similar to the ladder display format with rung numbers printed in the left margin. Print Rung causes the entire rung on which the cell locator is positioned to be printed in a format similar to the display format. Print Symbols prints the entire symbol table for the ladder in alphabetical order. Print Cross reference prints an output of all symbols in the current ladder, each followed by an ordered list of all rungs referencing that symbol. 
     Area Commands 
     Area commands 119 are used to operate on areas of the ladder. The area bounds are marked using the Mark sub-command described below. The marked area can then be moved, copied or deleted. The Area commands are Mark, End mark, Unmark, Move, Copy and Delete. The Mark command causes the marked area to begin at the current position of the cell locator. The bounds of the marked area can be extended in any direction by moving the cell locator. The moving cell locator represents the diagonally opposite corners of a rectangle. If any part of a large element lies within the marked area, the marked area is extended horizontally and vertically, if necessary, to include the entire element. Once the desired area has been marked, the End mark command is selected to designate the marked area. When a desired area has been marked, the marked area can then be moved or copied as described below. If Unmark is selected, the marked area is unmarked. If the Move command is selected, the marked area is deleted from its present position and inserted at the current position of the cell locator. Any space required to receive the moved area is obtained by moving existing elements to the right and down. The original area is closed up by moving remaining elements in the rung up and to the left. Vertical and horizontal shorts are maintained if possible. However, manual reconstruction of shorts may be required. After a move, the moved area remains marked permitting subsequent moves or copies. The Copy command causes a copy of the marked area to be inserted at the current position of the cell locator. Space required for the copy is obtained by moving elements to the right and down. The original marked area is unchanged. As with the Move command, vertical and horizontal shorts will be connected if possible, however, manual connection of shorts may be required. The copied area remains marked permitting subsequent moves or copies. 
     The Delete command is used to remove marked areas from the ladder. The area deleted is closed up by moving remaining elements in the rung up and to the left. Again, vertical and horizontal shorts will be maintained if possible, and manual reconstruction of shorts may be required. Thus, the present invention implements as part of an editor task for ladder diagrams, word processing type functions such as find, replace, move, copy etc., which operations are typically not available in prior art ladder editors. 
     The capability of editing ladder diagram using word processing type commands is made possible by the ladder diagram storage structure utilized which will now be described with reference to FIG. 6. A ladder rung is defined as a row of N cells (Cell 1-Cell N), wherein each cell is defined as being 16 bits in length, with one bit specifying whether the cell is a primary cell, one bit specifying whether the cell is a coil cell, and one bit specifying whether the cell is a leg cell. The low order eight bits are used to provide a four bit Y offset to the primary cell and a four bit X offset to the primary cell of the element. In the preferred embodiment, N is 13 such that each rung has 13 cells which is a convenient length for displaying on video displays frequently employed with personal computers. Also associated with each row is a rung serial number which uniquely identifies each rung, a pointer to the row before and the row after the present row, flags which specify whether the row is occupied, whether the row is too complex for compilation and whether the row is in a marked area. Additionally, associated with each cell is a four byte cell descriptor which provides element specific information and scratch pad areas which are used to identify the type of element (contact, coil, timer, logic statement) and provide display information (diagram symbol, name location in rung). 
     DATA MONITOR DISPLAY MODE 103 
     In Data Monitor Display Mode, a window is opened on the screen showing the contents of the word or file address for a selected ladder element (i.e., the element on which the cell locator was placed when Data Monitor Display Mode was selected). If the cell locator is on a timer or counter, the window will display the accumulator and preset contents of that element. If the cell locator is on a word or file block, all addresses associated with that particular file range are displayed. If no element, timer, counter, word or file block has been selected, the operator is prompted for an address. The address provided is shown in the top box of the window and addresses relative to the one selected are shown below. The operator can then scroll up and down to the window to either view or make changes to the contents. The address contents may be displayed in binary, octal, decimal, binary coded decimal, hexidecimal or ASCII. 
     ELEMENT MODE 105 
     In Element Mode 105, the cursor or cell locator is a box the size of the element on which it is located. If the cell locator is not on an element, the box is the size of a single cell. When an element is selected, the cell locator expands, if necessary, to enclosed the entire element. Cell locator movement in element mode is always from element or element position, to element or element position. Elements are normally installed on &#34;white space&#34; or in place of a previously installed element. Element Mode is the manner in which prior art ladder editors are typically implemented such as shown in Allen Bradley&#39;s operation manual for its PLC-2-30 controller. 
     In this connection, as shown in FIG. 5, the main commands of Element Mode are Insert 105, Delete 108 and Install 110. 
     The Insert command inserts rows by spreading the row above and the row containing the cell locator to insert a new rung. Additional Insert commands are Insert left and Insert right which insert an element to the left or right of the element on which the cell locator is positioned; Force-on which forces to the On or true state the contact on which the cell locator is placed; Force-Off which forces to the Off or false state the contact on which the cell locator is placed; Delete Force which removes the force and condition (either on or off) from the contact on which the cell locator is placed. 
     The Delete command 108, deletes a row, an element, or a force. 
     The Install command 110 itself has the subcommands Install Relay Elements 121, Install Counter Elements 123, Install Control Elements 125 and Install Other Elements 127. The Install Other Elements command has the further subcommands: Data Manipulation Instructions 129, Arithmetic Instructions 131, Word to File Instructions 133, File to File Instructions 135, Sequencer Instructions 137, FIFO Instructions 139, Bit Shift Register Instructions 141 and Block Instructions 143. The details concerning the various commands and subcommands of the Install function, as well as other Element Mode commands Delete and Insert are well known in the prior art as noted above, and therefore will not be further described herein. 
     LINE MODE 
     Line Mode 107 has the commands; Start Draw/Stop Draw 145, and Start Erase/Stop Erase 147. In Line Mode, the cursor is a small rectangle. When line drawing is enabled, the rectangle contains a blinking &#34;#&#34;. When line erasing is enabled, the rectangle contains a small blinking square. The line mode cursor is placed at a position where vertical and horizontal shorts could intersect and never within an element; however, actual shorts need not exist at the intersection point. 
     The cursor can be moved without drawing or erasing lines or moved to draw a line or moved to erase a line. An element can be connected to another element by drawing to the element in line with the element&#39;s connection stubs. 
     Line Mode provides an easy and efficient mechanism for connecting and disconnecting elements in a ladder diagram after they have been installed in Element Mode, which capability is not available in the prior art which uses Element Mode Instructions start branch element and end branch element rather than free form line drawing. 
     The source code of a program in the language C for performing the above described functions of editor task 35 is shown at the end of the description of the invention but before the claims. Of course, the inventive concepts may be incorporated in other computer programs in other languages without departing from the spirit and scope of the invention as defined in the claims. 
     Compiler Task 37 
     Compiler task 37 creates object code for each rung from the source code created or modified by editor task 35. Additionally, compiler task 37 may compress the source code by removing unused fields in the source. A complete description and source code listing for a suitable compiler task 37 is set forth in U.S. Pat. No. 4,722,071 which issued Jan. 26, 1988. 
     Housekeeping Task 38 
     Housekeeping task 38 creates and maintains a list of data table values representing elements that are presently being displayed by editor task 35. Additionally, housekeeping task 38 dispatches messages to communications task 39 to retrieve the latest values of the contacts generated by PLC 15 as a result of the operation of input/output scanner 55 and logic scanner 57. The data table values generated by housekeeping task 38 and the values obtained from PLC 15 are sent to editor task 35 which updates the display with the generated data table values and contact values obtained from PLC 15. A suitable program in C language source case to perform the functions of housekeeping task 38 is shown at the end of the description of the invention but before the claims. 
     Communications Task 39 
     Communications task 39 formats object code and compressed source code generated by compiler task 39 into ethernet packets which are transmitted over ethernet cable 13 to communications task 47 in FLC 15. Communications task 39 also receives messages from housekeeping task 38 and generates commands formatted into ethernet packets for transmitting over ethernet cable 13 to communications task 47. Communications task 39 is a network driver such as TCP/IP or OSI seven layer protocol (TOP or MAP) available from various vendors including Retix of Santa Monica California. 
     DESCRIPTION OF PLC 15 TASKS AND SUBTASK 
     BIOS Task 45 
     BIOS task 45, which is a multitasking executive, is the basic input/output operating system for PLC 15. A suitable multitasking executive for PLC 15 is Motorola System V/68 or Versa DOS. In the preferred embodiment, BIOS task 45 is implemented in ROM 65. 
     Communications Task 47 
     Communications task 47 obtains ladder diagram object code and compressed source code for each rung by decoding ethernet packets sent by communications task 39. Once all necessary packets have been received and assembled, communications task 47 invokes linker task 51. Communications task 47, like communications task 39 is a standard network driver available from a number of vendors. A command handler is added to the standard network driver which receives commands generated by editor task 35, or compiler task 37 or housekeeping task 38 and calls the appropriate routine to process the command. 
     The commands which are sent to communications task 47 for handling are Rung Link which is generated by compiler task 37 when a modified rung has been recompiled, Rung Upload which is generated by editor task 35 when a particular rung in the ladder is to be modified; Data Table Upload and Data Table Download which are generated by housekeeping task 38 to upload and download a data table in RAM 87 which is used to store the status of each data point controlled by the system; Block Read Data Table and Block Write Data Table which are generated by editor task 35 to read and write rung information of the ladder program stored in RAM 85; Read File Name and Write File Name generated by editor task 35 to read and write the file name of the ladder program in RAM 85; and Remove Forces generated by editor task 35 to remove all input/output forcing rungs whenever a ladder is attached or detached. 
     A C language source code listing of a suitable communications task 47 with command handler is shown at the end of the description of the invention but before the claims. 
     Ladder Logic Control Task 49 
     Ladder logic control task 49 downloads and uploads ladder object code and source code and performs I/O scanning and logic scanning as described in detail below in the description of parallel logic and I/O control subtask 53. 
     Linker Task 51 
     Linker subtask 51 takes rungs generated by compiler task 37 and adds to or replaces rungs in the ladder stored in program RAM 85. A C language source code listing of a suitable linker task 51 is shown at the end of the description of the invention but before the claims. 
     Parallel Logic and I/O Control Sub Task 53 
     Parallel logic and I/O control task 53 ensures that the I/O scanning performed by I/O scanner 55 and the logic scanning performed by logic scanner 57 are synchronized and in parallel. In particular, during an I/O scan, a program in RAM 63 under control of the BIOS in ROM 65 causes CPU 61 to write data from RAM 63 to peripheral controllers 17, and read data from the peripheral controllers for storage in RAM 63. In between I/O scans and logic scans, the data in RAM 63 and RAM 87 are swapped so that the data written to the peripheral controllers is the most recent data calculated by the program in RAM 85, and the data used by the program in RAM 85 is the data most recently read from the peripheral controllers. During a logic scan, based upon a program in RAM 85 (the object code representing a ladder diagram), new output values to be sent to the peripheral controllers during an I/O scan are calculated based upon current input values stored in RAM 63. 
     Task 53 has a program mode and a run mode as determined by the position of a hardware or software switch for example, a key switch on the control panel of PLC 15 or a bit in data RAM 87. When in program mode, a real time clock is read periodically, for example, every 30 milliseconds and the real time clock&#39;s value is written to data RAM 87 by CPU 61 for use by the logic scan performed by the program in RAM 85. 
     In run mode, a program running in RAM 63 performing input/output scanning reads values in from peripheral controllers and loads the read values into RAM 63 and reads values loaded into RAM 63 from RAM 87 and writes those values back to the peripheral controllers. Synchronously, and in parallel, the ladder diagram loaded in program RAM 85 calculates the output values based upon the values read from the peripheral controllers and loaded into RAM 87 and writes the calculated values to RAM 87 for transfer to RAM 63 for writing back to the peripheral controllers. The present invention performs this synchronous, parallel input/output and logic scanning as follows. 
     Referring to FIG. 7, three operations are occurring over time, namely logic scanning 151, I/O or input/output scanning 153 and swapping 157. As noted above, logic scanning is performed by logic scanner 57 based upon a ladder diagram program in RAM 85 being executed by bit sliced processor 83 under control of PAL control logic 81. The ladder diagram program operates on data in data RAM 87, calculating new values to be written to the peripheral controllers which are scanned by input/output scanner 55. Input/output scanner 55 utilizes a program in RAM 63 executed by CPU 61 to obtain data from RAM 87 which it writes to parallel I/O port 73, ethernet port 69 and parallel 1/0 port 71, and then reads data obtained from parallel I/O port 73, ethernet port 69 and parallel I/O port 71, and temporarily stores the read values in RAM 63. A scan is defined as the time which it takes to read from and write to the peripheral controllers in a single rack and ranges from 3-10 milliseconds depending upon the number of peripheral controllers in the rack. At the commencement of an I/O scan, processor 83 performs a logic scan calculating new values to be written to the peripheral controllers based upon the values of data in RAM 87. For a given rack, the logic scan is completed 2 milliseconds before the corresponding I/O scan. After the I/O scan is completed and before the next 1/0 scan (and logic scan) is begun, CPU 61, in effect, halts the operation of the program in RAM 85 in order to obtain exclusive access to RAM 87 and then moves the most recently calculated data from RAM 87 into RAM 63 and moves the most recently read data from RAM 63 into RAM 87 thereby swapping the data between the two RAMs. Then the exclusive access to program RAM 85 and data RAM 87 is relinquished and the I/O scan and logic scan begin their scans of the next set of data points corresponding to another rack. As shown in FIG. 7, the swap takes place between I/O scans. Thus, the I/O scans and logic scans are synchronized and performed in parallel. A suitable program for performing parallel logic and I/O control task 53 in C language source code is shown at the end of the description of the invention but before the claims. 
     DESCRIPTION OF PLC 15 COMPONENTS--FIG. 3 
     Input/Output Scanner 55 
     CPU 61 is a Motorola 68010 or equivalent. RAM 63 is 128K by 16 bit RAM available from a number of sources. ROM 65 is a 32k by 16 bit EPROM. RAM 65 stores BIOS task 45. Ethernet ports 67 and 69 are AMD part numbers 7990 or equivalent and required support circuity. Ethernet port 67 handles the receipt and transmission of ethernet packets between communications task 39 and communications task 47. Ethernet port 69 handles the receipt and transmission of ethernet packets between communications tasks in cluster controllers 25. 
     Parallel I/O ports 71 and 73 are standard parallel I/O ports which may be implemented in a variety of ways, the particulars of which are well know to persons skilled in the art. The details regarding a data bus, address bus and control bus, as well as timing and power considerations necessary for the proper operations of such components are well known to those skilled in the art and will be described herein only to the extent necessary for a proper understanding of the invention. 
     Cluster controllers 25 are similar to input/output scanner scanner 55, but do not have ethernet port 67 or logic scanner 57. 
     Logic Scanner 57 
     PAL control logic 81 is a set of eight PALs (programmable logic array) which contain the logic equations or microcode used to control the operation of bit sliced processor 83. In the preferred embodiment, the logic in the eight PALs perform the functions i) logic scanner condition test logic; ii) logic scanner program counter 1 (external load); iii) logic scanner program counter 2; iv) logic scanner program counter 3; v) logic scanner sequencer and interface logic; vi) logic scanner control store bus interface logic; vii) logic scanner internal bus control logic; and viii) logic scanner control store parity logic. The particulars of the PALs and their logic equations which perform these functions are set forth shown at the end of the description of the invention but before the claims. 
     Bit sliced processor 83 is a 16 bit microprocessor available from Advanced Micro Devices as its part number Am29116. 
     Program RAM 85 is a 32K by 64 bit RAM which contains executable ladder object code generated by compiler task 37 and linked by linker task 51. 
     Data RAM 87 is a 32K by 16 bit RAM which stores the status of each data point controlled by the system. In a fully configured system (i.e. 64 clusters of 7 racks, 16 peripheral controllers per rack for a total of 114,688 points), only 7K of storage is required. This 7K portion of RAM 87 is bit mapped to corresponding data points. The remaining 25K portion of data RAM 87 is available for use as temporary storage by the executing ladder diagram. 
     The following are source code listings of editor task 35 (MAIN.C, EDITOR.C, LINE.C and IDMAIN.C); housekeeping task 38 (HOUSKEEP.C); communications task 47 (PLCNET.C, COMM.H, COMMTASK.C and AUXCMD.C); ladder logic control task 49 and parallel logic and I/O control task 53 (SCANLOOP.C); linker task 51 (LINKER.C); and logic scanner 57 (PAL20L8A). various &#34;Include&#34; files referenced in the C source code listings are also provided. ##SPC1##