【文章內(nèi)容簡(jiǎn)介】
sors are connected to the PC through input port hex address 3BD, and that actuators are connected to output port hen address 3BC, as shown in figs. 5 and 6 respectively. Fig. 5: Input Connections Fig. 6: Output Connections The sample Pascal program is shown in fig. 7. The image tables: input, output, and internal relays, are implemented using Pascal Boolean variables. When any of these variables is TRUE, that represents an ON state。 and whoa they are FALSE that represents an OFF state. When exchanging signals with the input and output points an ON state is represented by a logical 0 and an OFF state with a logical 1. The main program is an emulation of the PLC scanning cycle presented in fig. 3. In this simplified example it is assumed that the PLC will be running its program until a key is pressed on the PC keyboard. Other device can be used if it is desired to use the PC keyboard for other more productive purpose. The input/output scan is emulated using subroutine I_ O_Scan. There, the 8 bit input port (fig. 5) is read and the status of the individual bits stored in the input table. Also the status of the output points from the output table is written to the 8 bit output port (see fig. 6). The Program _Scan subroutine is a direct translation of the ladder diagram in fig. 4. For every rung in the ladder logic there is an ifthenelse statement. The Initialize and Finalize subroutines worn added to handle the state of the output points and internal relays during the startup and shutdown of the PLC program . :Sample Pascal Program It should be noted that this is a very simplified example whose purpose is to provide a framework for control program development on a PC bi ning the programming paradigms of standard procedural highlevel languages with the familiar PLC ladder logic. Although it cannot be fully demonstrated in this paper, it provides a simple way of simultaneous control of parallel processes without considering the intricacies of a particular operating system. It demonstrates that plex custom software does not have to be created to make this technology work. The proposed model would be very easy to adapt and implement even inhouse because it can still use ladder logic, so no new technological skills are necessary. Any typical PLC instructions can be added to the model very easily, including timers, counters, oneshots, and so on. Other custom PLC instructions suited to a particular application can be included that use the features of high level languages, making it more powerful than standard PLC ladder logic. ADVANTAGES OF PERSONAL COMPUTERS The PC is a standard hardware/software platform. PCs improve at a rapid pace, bee cheaper, and have mom power than PLCs. Pentium systems widely available today outperform even the fastest margins of 20:1 or more. A new generation of PCs bees available every six to nine months. By contrast new generation of PLC hardware bees available every two to three years. PCs with at least 16Mbytes are monplace, while PLCs still have memory in the order of Kbytes. The PC supports more standard peripherals available from many vendors such as CD ROM drives, sound cards, voles recognition, working facilities, and so on. at very affordable prices. The