A PC-BASED OBJECT SIMULATOR FOR SUPPORTING PLC SOFTWARE DEVELOPMENT Jozef Kulisz.* Robert Czerwinski.** Jan Mocha.*** Miroslaw Chmiel.**** Silesian University of Technology, Institute of Electronics, Gliwice, Poland * (e-mail: jozef.kulisz@polsl.pl) ** (e-mail: robert.czerwinski@polsl.pl) *** (e-mail:jan.mocha@polsl.pl) **** (e-mail: miroslaw.chmiel@polsl.pl) Abstract: The paper discusses hardware and software tools used to support Programmable Logic Controller (PLC) program testing and verification. An idea of a PC-based object simulator is presented. The simulator consists of a PC equipped with an appropriate I/O card, and a simulator program running on the PC. The simulator is capable of emulating behavior of real industrial objects. Thus a significant part of software tests can be performed with the use of the simulator, instead of a physical object. This can significantly facilitate, and accelerate development of an application. Keywords: Industrial control, Programmable logic controllers, Program diagnostics, Debugging, Simulation, Process simulators, Software engineering, Software productivity 1. INTRODUCTION Testing and verification of complex applications constitutes a serious problem for PLC (Programmable Logic Controller) programmers. In today’s highly competitive world, where design and construction companies compete both by reducing costs, and time to market, control and PLC engineers often have work under pressure. Working to tight deadlines enforces the management to shrink time schedules. Many parts of the design, construction and commissioning work have to be done concurrently. Work on the program has to be started and conducted, while essential parts of the installation, that is supposed to be operated by the application, aren’t yet assembled. Even during the actual commissioning it often happens, that time slots, during which the controlled equipment is freely available for testing, are limited. For those reasons a substantial part of a PLC application development process has to be conducted at office, while the equipment that is to be operated by the program is not accessible to the programmer. Furthermore, performing some test on real hardware can be either difficult, or even impossible for technological, or, what is even more important, for safety reasons. It’s a common practice, that at the beginning stages PLC programs are tested using switchboards wired up to PLC input modules. By operating switches in the proper manner one can emulate operation of real hardware, which will later be connected to the PLC. By observing the indicator LED-s mounted on output modules, the programmer is able to check whether the program generates the desired logic levels at PLC outputs. This method can also be used with analog signals, it demands just applying a little more complex hardware, capable of producing analog values, e. g. voltages. Using switchboards can be useful, if the number of PLC inputs to emulate is not big. In some cases, where separate devices or small groups of actuators work independently from one another, it is also possible to separately test portions of software controlling separate devices. Unfortunately it often happens, that the installation has to be operated by complex algorithms (e. g. sequences), imposing many interlockings between various parts of the control system, including SCADA (Supervisory Control And Data Acquisition) for remote control, visualisation, reporting etc. Under such circumstances testing separate devices is not sufficient, and using switchboards to test the program as a whole is practically unmanageable. It would require following the algorithms, tracking the interactions, and operating tens of switches in real time to provide adequate simulation of real hardware. So far the task of PLC program testing is hardly supported by specialised software and hardware tools. The main purpose of the paper is to propose a new approach to PLC application testing and verification – an object simulator, which is an independent device. The concept is presented after an overview of the methods of PLC program testing used so far. 2. TOOLS SUPPORTING PLC APPLCATION TESTING 2.1 PLC simulators A PLC simulator is a PC program, capable of simulating behaviour of an actual PLC. The simulation is based on a program code, written in the language characteristic for the simulated PLC, which is interpreted by the simulator