Pure Tcl/Tk Train Traffic Supervision System Jorge Lima, Jose Rocha Fac. Sciences of the Univ. Lisbon ABSTRACT This paper describes an experimental subway train traffic supervision software written using pure Tcl/Tk. Train traffic supervision software interact with traffic control PLCs (Programmable Logic Controller) to retrieve information from the railroad and interact at the exploration level, like granting or deferring a train departure. This application demonstrates the effectiveness of Tcl/Tk for use in industrial control and supervision software. Emphasis will be given to coding techniques and programming paradigms used and how they were implemented into the Tcl/Tk model. SUMMARY LCCS, which stands for local control computer software, was initially developed as a concept demonstrator in the context of a development project proposed to the ML (Lisbon Subway Train Company). The proposal did not succeed. The aim of this project was to upgrade previous supervision software with software developed in-house. The ML declined the offer and the demonstrator remained property of the authors, which then decided to make it open-source. The application supports one or more simultaneous windows allowing the operator to visualize a large or the entire railroad and some details in a magnified window. The windows allow arbitrary zoom (implemented entirely in Tcl) and pan. Many other visualization options are user configurable by means of popup menus. The synoptic itself is a Tcl/Tk engine bound to a canvas widget which accepts commands through the Tk "send" mechanism. When the application is first launched, a background process reads the configuration files which describe the railroad (the rail-circuits, signalization, and stations). After the configuration phase, another background process is launched and starts to listen to a specified socket or serial port, depending how the automaton communicates with the LCC (local control computer), and using the same "send" mechanism updates the synoptic status. These days were the computer science is dominated by the pos-Object oriented jargon, it is might sound pathetic to highlight the following Tcl/Tk powerful features: code and data share the same representation; Tcl offers a great deal of control over interpreters. These two features made possible to implement, using the reflective coding techniques, the LCCS using a surprisingly small number of lines of code.