Post on 13-Jan-2016
Elletra’s presentation : December 2003
A quick presentation of TANGO
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
- Part I -A quick tour of
TANGO
Elletra’s presentation : December 2003
TANGO system: A software bus
Elletra’s presentation : December 2003
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
TANGO software Bus
interface
• But each card must respect a strict and well-defined interface in order to connect to the bus
Hardware
Device
(motor…)Board
Elletra’s presentation : December 2003
Interface
• 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
MOTOR:
Hardware control code
Hardware
Commands:
- GoForward()…
Attributes:
- Speed (R/W)…
An example of a Device Interface : A motor
Elletra’s presentation : December 2003
Tango provides much more than just the bus !!!
Bus Logiciel TANGO
User applications
User’s development environments
python, LabviewMATLAB, IGOR,
High level « ready to use » applications
SCADA
TANGO DevicesDevice
Hardware
DeviceDevice
Hardware
Software bus TANGO
LoggingConfiguration ArchivingMonitoringMonitoring
Elletra’s presentation : December 2003
TANGO : A software solution to
integrate distributed and heterogeneous systems
Elletra’s presentation : December 2003
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
Profibus
Supervision / Control : TANGO
Process Management General Services: Archiving, Configuration,
. TANGO
Equipments Equipments
ETHERNET
Compact PCI Crate
Profibus
PLCs
Motion System
Elletra’s presentation : December 2003
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?
Elletra’s presentation : December 2003
From concepts to computers reality
Bus Logiciel TANGO
User applications
User’s development environments
python, LabviewMATLAB, IGOR,
High level « ready to use » applications
SCADA
TANGO Devices
Hardware
DeviceDeviceDevice
Hardware
Software bus TANGO
LoggingConfiguration ArchivingMonitoringMonitoring
Elletra’s presentation : December 2003
From concepts to computers reality
Machine A
SE1
Application 1
Application 2
L
L
Machine B
Application 4
L
Application 3
L
SE2
?
?
?
Machine A
SE1
Machine AMachine A
SE1
Application 1
Application 2
Application 1
Application 2
L
L
L
L
Machine B
Application 4
L
Application 3
L
SE2
Machine B
Application 4
L
Application 3
L
Machine BMachine B
Application 4
L
Application 4
L
Application 3
L
Application 3
L
SE2
??
??
??
And the winner is : CORBA
Elletra’s presentation : December 2003
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
CORBA
Elletra’s presentation : December 2003
TANGO : introduction
• a framework CORBA ctrl/cmd oriented– A toolbox to implement the system– A specialization of CORBA adapted to the needs
CORBACORBA
Framework
Control System
TANGO
CORBA
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
- II -Main concepts
Elletra’s presentation : December 2003
What is a Device ?
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
Commands
•Generics commands•Specifics commands
Elletra’s presentation : December 2003
TANGO: device: interface: command
• Has a communication interface – interface = commands + attributes
• commands actions• attributes physical units
Hardware control code
InterfaceCommands Attributes
Generics Specifics Generics Specifics
InitStateStatus
PowerOnPowerOff - current
TANGO Software Bus
Elletra’s presentation : December 2003
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)
Elletra’s presentation : December 2003
Attributes
Elletra’s presentation : December 2003
TANGO: device: interface
• Has a communication interface – interface = commands + attributes
• commands actions• attributes physical units
Hardware control code
InterfaceCommands Attributes
Generics Specifics Generics Specifics
InitStateStatus
PowerOnPowerOff - current
TANGO Software Bus
Elletra’s presentation : December 2003
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 values vs actual value
Elletra’s presentation : December 2003
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)
Elletra’s presentation : December 2003
State
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
- Part III -High-level
applications
Elletra’s presentation : December 2003
Configuration of the control system
Elletra’s presentation : December 2003
Configuration: needs
Properties
ens-[seg]/dom/elem.1
ens-[seg]/dom/elem.2
ens-[seg]/dom/elem.3several of them
myDevice
Commands AttributesStatuses
ID Unique
• 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
Elletra’s presentation : December 2003
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
1 information storage medium: 1 computing database
Configuration
Elletra’s presentation : December 2003
Jive
Graphical Application for TANGO control system
Configuration: tool
Elletra’s presentation : December 2003
Supervision
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
Supervision: tool– Custom Java Applications :
• Using TANGO ATK library which provides Java GUI widgets which manage refresh of values, errors, connexion issues
Elletra’s presentation : December 2003
Logging
Elletra’s presentation : December 2003
• LogViewer
Visualise, filter and analyse errors and informations, emitted in « real time » by the different Devices of the control system
Logging: tool
Elletra’s presentation : December 2003
Archiving
Elletra’s presentation : December 2003
TANGO Software Bus
Archiving
Historical database
Device
Device PoweSupply : Attribut Voltage TimeStamp Valeur 22-04-2003 : 15h 23mn 12 s 236 22-04-2003 : 15h 23mn 22 s 354 22-04-2003 : 15h 23mn 32 s 374 22-04-2003 : 15h 23mn 42 s 374
Several databases
Archiving
• 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
Elletra’s presentation : December 2003
Developper tool
Elletra’s presentation : December 2003
E2 : POGO : Code generation
• Define TANGO Interface a Device with a graphical tool
• Generate html documentation of the Device
Elletra’s presentation : December 2003
- Part IV -Strengths of
TANGO
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
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 Motion Device
Device
Hardware
TANGO Control System
TANGO Motion Device
Device
Hardware
TANGO Control SystemTANGO Control System
LUCIA Controls system
TANGO Motion Device
Device
Hardware
TANGO Control SystemTANGO Control System
TANGO Motion Device
Device
Hardware
TANGO Control SystemTANGO Control SystemTANGO Control SystemTANGO Control System
LUCIA Controls system
TANGO Motion Device
Device
Hardware
TANGO Control System
TANGO Motion Device
Device
Hardware
TANGO Control SystemTANGO Control System
Transfert Line 1 Controls system
TANGO Motion Device
Device
Hardware
TANGO Control System
TANGO Motion Device
Device
Hardware
TANGO Control SystemTANGO Control System
Transfert Line 1 Controls system
Monochromator Device
Hardware
Device
TANGO Control System
Device
PROXIMA Controls Systems
Elletra’s presentation : December 2003
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
Elletra’s presentation : December 2003
An interesting upcoming feature for beamlines: A generic Scan mechanism
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
•First scanning modes implemented•First Version running on LUCIA•With a Java GUI interface
Elletra’s presentation : December 2003
- Part IV -Temporary
conclusion on TANGO
Elletra’s presentation : December 2003
Tango in one picture
DeviceDevice
Bus Logiciel TANGO
LoggingMonitoringConfiguration
(motor…)
Hardware
(E/S…)
Hardware
Archivageenvironments Utilisateurs:
MATLAB, IGOR, python, Labview
DeviceDeviceDevice
TANGO Software Bus
LoggingMonitoringConfigurationConfiguration
Hardware
(E/S…)
Hardware
ArchivingUsers
environments:MATLAB, IGOR, python, Labview
Bindings
Ready-to-useHigh-level Applications
The bus and Devices development tools
Elletra’s presentation : December 2003
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/
Elletra’s presentation : December 2003
- Annexes -Various Details …
Elletra’s presentation : December 2003
TANGO: device: interface: command
TANGO Desc MatlabDEV_VOID no argin and/or no argout -
DEV_STATE device status 1-by-n char array
DEV_STRING characters array 1-by-n char array
DEV_BOOLEAN boolean 1-by-1 uint16 array
DEV_SHORT Signed 16 bits integer 1-by-1 int16 array
DEV_USHORT Unsigned 16 bits integer 1-by-1 uint16 array
DEV_LONG Signed 32 bits integer 1-by-1 int32 array
DEV_ULONG Unsigned 32 bits integer 1-by-1 uint32 array
• About argin & argout types…
DEV_FLOAT 32 bits floating point 1-by-1 single array
DEV_DOUBLE 64 bits floating point 1-by-1 double array
DEVVAR_CHARARRAY table of bytes (i.e. characters ) 1-by-n char array
DEVVAR_ SHORTARRAY table of signed 16 bits integers 1-by-n int16 array
DEVVAR_ USHORTARRAY table of unsigned 16 bits integers 1-by-n uint16 array
DEVVAR_ LONGARRAY table of signed 32 bits integers 1-by-n int32 array
DEVVAR_ ULONGARRAY table of unsigned 32 bits integers 1-by-n uint32 array
DEVVAR_ FLOATARRAY table of 32 bits floating points 1-by-n single array
Elletra’s presentation : December 2003
TANGO: device server
DevDev Dev
Bus Logiciel TANGO
DevDev Dev
TANGO Software Bus
• Practically, 1 executable called DeviceServer– Is in charge of « connecting » several Devices to the bus – The system can be parameterized so as to change the list of Devices, which 1 DeviceServer has to administrate
Device Server
DServer
DeviceDeviceDevice