530 likes | 895 Views
A quick presentation of TANGO. Agenda. TANGO a quick tour Tango : a software bus Tango : a distributed system Tango : main concepts Device Commands Attributes Present current high level “ready to use” applications Configuration Supervision Logging Archiving Strengths of TANGO
E N D
Agenda • TANGO a quick tour • Tango : a software bus • Tango : a distributed system • Tango : main concepts • Device • Commands • Attributes • Present current high level “ready to use” applications • Configuration • Supervision • Logging • Archiving • Strengths of TANGO • On the Controls point of view • On the Software engineering point of view • Interest for beamline controls • Tango is a small and simple system : LUCIA example • Generic scan capabilities
- Part I - A quick tour of TANGO
TANGO system: Asoftware bus
TANGO software Bus Device interface Hardware (motor…) Board Tango : A software bus • Analogy with an electronical bus because: • Each card plugged on the bus has a well-identified function • Each card is not or hardly coupled to the others • Development of each card can be decoupled • But each card must respect a strict and well-defined interface in order to connect to the bus
MOTOR: Commands: - GoForward()… Attributes: - Speed (R/W)… Hardware control code Hardware An example of a Device Interface : A motor • The Interface : • describes what the Device is supposed to do • It’s only a promise of the services you may expect from the Device • But there isn’t any magic !!! • Code has to be written to fullfill the promised services Interface
User applications User’s development environments Logging Monitoring Monitoring Archiving Configuration MATLAB, IGOR, python, Labview Software bus TANGO Device Device Hardware Tango provides much more than just the bus !!! High level « ready to use » applications SCADA Bus Logiciel TANGO TANGO Devices Device Hardware
TANGO: A software solution to integrate distributed and heterogeneous systems
Distributed systems: SOLEIL example for Machine Control • The system components are geographically distributed on machines interconnected by a computing network: • More than 100 Compact PCI frontend • More than 100 PLC • Dozens of operator stations
Heterogeneous systems on hardware and software levels • Slow industrial systems: PLC • Fast acquisition systems : CPCI, VME, … • Ready to use systems: • LINAC control/command • Control software sold with equipments (Residual gas analyzers, SCIENTA analyzers, …) • Heterogeneous operating systems • Scientific applications under Linux • Drivers/libraries under WIN32 or under Linux • How to obtain a coherent whole from heterogeneous hardware and software?
User applications User’s development environments Logging Monitoring Monitoring Archiving Configuration MATLAB, IGOR, python, Labview Software bus TANGO Device Device Device Hardware From concepts to computers reality High level « ready to use » applications SCADA Bus Logiciel TANGO TANGO Devices Hardware
From concepts to computers reality And the winner is : CORBA
Control System CORBA TANGO : introduction • CORBA = 1 generic tool • support to the development of distributed applications • A powerful but cumbersome tool • No functionalities «ctrl/cmd oriented»
Control System Framework CORBA TANGO : introduction • a framework CORBA ctrl/cmd oriented • A toolbox to implement the system • A specialization of CORBA adapted to the needs TANGO CORBA CORBA
TANGO: APIs and platforms • Programming APIs/Languages • C++ (performances) • Java (portability) • Python (scripts) • Others (Matlab, Igor Pro, LabView) • Platforms • Linux • Windows NT/2000/XP • Sun-Solaris Servers Clients
- II - Mainconcepts
TANGO: device: definition • device = 1 <entity> to control • Hardware or software • «physical» device / «logical» device • device = 1 polymorphous object • 1 equipement (ex: 1 power supply) • 1 collection of equipment (ex: 1 motor + 1 coder) • 1 cluster of devices : • a monochromator • a complete subsystem (a LINAC !) • A pure software component : A scan server for instance
Commands • Generics commands • Specifics commands
Commands Attributes Generics Specifics Generics Specifics Init State Status PowerOn PowerOff - current Hardware control code TANGO: device: interface: command • Has a communication interface • interface = commands + attributes • commands actions • attributes physical units TANGO Software Bus Interface
TANGO: device: interface: command • Generic commands exist for EVERY Device • Ping, Init, State, etc … • Specific commands • Are defined by the Device developer • have : 0 or 1 in argument (argin) • give : 0 or 1 out argument (argout) • argin & argout = 1 of the 20 TANGO types • Execution : • launch the command_inout function with the following arguments : • command name • In parameter of the command • Output: • result of command execution • Exemple Python : >> motor_phi.command_inout(“AxisBackward") >> motor_phi.command_inout(“GoToPosition“,100)
Commands Attributes Generics Specifics Generics Specifics Init State Status PowerOn PowerOff - current Hardware control code TANGO: device: interface • Has a communication interface • interface = commands + attributes • commands actions • attributes physical units TANGO Software Bus Interface
TANGO: device interface: attribute • Definition • Physical unit produced or administrated by the device • ex: motor position, power emitted by a power supply, … • Format : from 0 to 2 dimensions • SCALAR • SPECTRUM (i.e. vector) • IMAGE (i.e. matrix) • Type • DEV_SHORT, DEV_LONG, DEV_DOUBLE • scalar, spectrum or image • DEV_STRING • scalar only • Accessibility • READ • read-only access • WRITE • write-only access • READ_WRITE • Read-and-write only access • set valuesvs actual value
TANGO: device: interface: attribute • Obtain/modify the current value of an attribute? • Prog. Env. OO (C++, Java, Python) • dev.read_attribute(s) (attr_name_list) • dev.write_attribute(s) (attr_name_list) • Python Example: >> x = mouse.read_attribute ("positionX") >> print x.value >> x.value=100 >> mouse.write_attribute (x)
TANGO: device: state • Tango internally manages a state Machine • Each Device has an associated state • Device behavior = fonction (internal state) • query -> internal state-> execute or error • internal status generated by the device developer • 14 predefined status • ON, OFF, CLOSE, OPEN, • INSERT, EXTRACT, MOVING, • STANDBY, FAULT, INIT, RUNNING, • ALARM, DISABLE, UNKNOWN • a color code defined by Tango is associated to each status
- Part III - High-level applications
ID Unique myDevice several of them Commands Attributes Statuses ens-[seg]/dom/elem.1 ens-[seg]/dom/elem.2 ens-[seg]/dom/elem.3 Properties Configuration: needs • Needs • Define equipments present in the experiment Control/Command system • Parameterize equipments • Parameters linked to the Hardware (GPIB address, etc.. ) • Min and max attributes values • Alarm thresholds • Etc
Configuration: database (static) • Configuration database • Critical element of the system • unique source of information for devices and clients • Implementation • 1 dedicated device = TANGO interface of a SGBD • The TANGO_HOST environment variable = host_name:host_port (ex: localhost:20000) defines the static database that is used TANGO Software Bus • 1 dedicated TANGO device = TANGO interface of a SGBD Configuration • 1 information storage medium: 1 computing database
Configuration: tool Jive Graphical Application for TANGO control system
Supervision: needs • Needs • Interact with equipments directly • Have an overview of the status of each equipment • Monitor the evolution of any Device attribute • DeviceTree/ATK Panel • Generic applications to design and customize your graphical interfaces, displaying, for a set of equipments
Supervision: tool • Custom Java Applications : • Using TANGO ATK library which provides Java GUI widgets which manage refresh of values, errors, connexion issues
Logging: tool • LogViewer Visualise, filter and analyse errors and informations, emitted in « real time » by the different Devices of the control system
Several databases Attribut Voltage Device PoweSupply : Archiving TimeStamp Valeur 22 - 04 - 2003 : 15h 23mn 12 s 236 22 - 04 - 2003 : 15h 23mn 2 2 s 354 22 - 04 - 2003 : 15h 23mn 3 2 s 37 4 22 - 04 - 2003 : 15h 23mn 4 2 s 37 4 Historical database Archiving TANGO Software Bus • Record attributes values: • Following specific criteria (frequency or other), the archiving system is supposed to memorize the values of any attribute of any Device of the control system. • Extract values • From client applications like a MATLAB application • From “ready-to-use” MAMBO application Device
E2 : POGO : Code generation • Define TANGO Interface a Device with a graphical tool • Generate html documentation of the Device
- Part IV - Strengths of TANGO
Tango a solution for new Controls issues • Controls trends • Less and less direct connection to HW (Digital or Analog I/O) • Link to Hardware is very often done through Software links • API & libraries • Third parties systems Tango is a very good Software glue to face these new integration challenges
TANGO Control System PROXIMA Controls Systems Monochromator Device Device Device Hardware Tango : a software component philosophy • Allowing to share developments between Controls systems • Decouples High level applications and HW Controls • the software can therefore be developed by different people • A device is a « Software Component » per se • Can be reused in different Controls System • Can be used by another Device
Tango is a small and simple system : LUCIA example • LUCIA = SOLEIL beamline installed at SLS • Only 2 computers for the Controls System • 1 CPCI crate running Tango Controls System • 1 PC running java and IGOR high level applications • About 10 differents kinds of Device • Motion Control DeviceServer • Slits DeviceServer • Counter/Timer DeviceServer • Analog Input DeviceServer • MultiChannel analyser DeviceServer • PicoAmmeter DeviceServer, • ScanServer DeviceServer, etc .. • About 50 devices running in the Controls System Tango fits well also for these small scale systems
An interesting upcoming feature for beamlines: A generic Scan mechanism • First scanning modes implemented • First Version running on LUCIA • With a Java GUI interface • Aim: build a generic scan server which can • scan any number and kind of Actuators (for instance motors) • read any number and kind of Sensors (for instance counters) • in different scanning modes e.g. 1d, 2d, 3d, • Commands (abstract): • SetActuators • SetSensors • SetBeginPositions, SetScanSteps, SetStepsNumber • Scan1D • Scan2D • ReadScan • WriteScan • Algorithm : • move actuators, wait, start sensors (counters), read sensors, write data
- Part IV - Temporary conclusion on TANGO
Configuration Device Tango in one picture Ready-to-use High-level Applications environments Users Archivage Archiving Monitoring Monitoring Logging Logging Configuration Configuration environments: Utilisateurs: MATLAB, IGOR, MATLAB, IGOR, python, python, Labview Labview Bindings TANGO Software Bus Bus Logiciel TANGO The bus and Devices development tools Device Device Device Device Hardware Hardware Hardware Hardware (E/S…) (E/S…) (motor…)
Tango: more links • The source code is available on SourceForge • http://sourceforge.net/projects/tango-cs • The ESRF site reference • http://www.esrf.fr/computing/cs/tango/index.html • The SOLEIL site reference • http://www-controle.synchrotron-soleil.fr:8001/
- Annexes - Various Details …