TANGO Interfacing With NI Technology - Indico

Transcription

TANGO interfacing withNI technologyMehdi AFIFEuropean Big Physics Systems Engineer

Agenda TANGO concepts From NI HW/ NI LabVIEW to TANGO

What is TANGO?The TANGO control system is a free, open source,object oriented, distributed control system (based onCORBA) used for controlling synchrotrons, lasers,physics experiments in over 20 sites.It was initially developed by ESRF and is nowdeveloped as a collaborative effort betweenAlba,Anka, Desy, Elettra, ESRF, FRM II, Solaris ,MAX-IV and Soleil institutes.3

Architecture-It’s based on a client/server model (in C , Java or Python).-It uses CORBA/Zeromq for network communication and theconcept of Device Classes with object oriented programming.-Clients import these Devices via a database.4

TANGO devicesTANGO software busMotorCommands: On(), Off(), Attributes: Speed, PositionDeviceclassState: On, Off, Alarm, FaultPolling, round robin buffer, threading,event triggering, archiving To be written bydevelopersInterfaceHardware controlcodeCode generatorPOGO: C /Java/Pythonglue code Basic HTML docSupplier driver5

Clients/ServersSCControl SystemSInterfaceCApplication LogicSTANGO(applications network)CSCClient application.SServer Application.TANGOApplication Logic-Send commands-Set/Get attributes-Subscribe to attributesevents (periodic, change,archive, etc.)-No direct communicationwith devicesHardware6

TANGO-NI interface7

LabVIEW client (binding)InterfaceApplication LogicTANGO- Developed by Synchrotron SOLEIL(Nicolas LERLERCQ)- Last tested versions : LV 2013 forWindows and Linux (TANGO 8.1.2)8

TANGO-NI HW bridge (Device Server)TANGO2 options:ApplicationLogicHardware TANGO Server and NI HW are on the same machineo One can develop his Device Server for NI HW bycreating a class for this HW and calling its NI driver TANGO Server and NI HW are NOT on the same machineo One can do the same and calls will be done remotelythrough a chosen communication protocol (TCP/IP,etc.)9

Generic architecture for LV-TANGOLV DriverTANGOServerHardwareGeneric DeviceServerLabVIEW API(C , Java, ndows, Linux RTPXI, cRIO, DesktopShared Memory,TCP/IP, other.10

Remote Device Server : DAQ application example One has to adapt his LV application architecture (state machine, events, ) to: communicate with the client (via the Device Server) by using acommunication protocol instead of LV front panel controls make some attributes available at any time if needed11

State machine: Get client requestsTCP/IP chainLV Queues12

State machine: Handle client requestsSet attributes/Run actionsReceivecommand/attributeWrite attributeExecute13

State machine: Handle client requestsGet attributes valuesReceivecommand/attributeWrite attributeExecute14

Automatic conversion: no data flow changeAutomatic conversion : VI Scripting15

State machine vs automatic conversionArchitectureProsConsState machine Modular, scalable Good graphicalunderstanding Need to “rethink” theapplication and breakinto sub-stepsAutomatic conversion Very quick method Minor changes to theoriginal application Not very modular(new actions,attributes) All attributes/actionsevaluated at eachiteration Reconfiguration noteasy16

Other examples Two applications using LV as a device server: LULI : ensure hardware safety by stopping their laserexperiment in case of a failure (1 PXI chassis, LV RT,2 R-Series)-LV RT application is the TANGO device (communication withLinux device server via TCP/IP)-DAQ board is the device via direct access (Linux driver) SOLEIL : control power supplies, pulses generator. forthe LINAC with 3 PCI DAQ boards-LV application (with DAQmx) is the device (communication withLinux device server with Datasocket) TANGO-EPICS bridge (Cosylab) for ESRF to allow TANGOusers to interface to existing EPICS IOCs and avoidrewriting a new TANGO device server.17

Conclusion TANGO is an object oriented middleware wheredevices belong to classes (Commands, attributes). Several tools exist to assist developers in creatingtheir device classes Device servers can access directly or remotely toHW. The application accessing to HW has to bestructured according to the foreseencommands/attributes. One can also think about a generic device servertargeting LV applications with generic templates .18

Thanks for your attention

C /Java/Python glue code Basic HTML doc Supplier driver. TANGO Application Logic Hardware Clients/Servers Control System C C S S C S S C S Server Application. Client application. (applications network) Interface TANGO Application Logic 6-Send commands-Set/Get attributes-Subscribe to attributes . DAQ application example 11 One has to .