Lab VIEW DIMInterface Motivation Event and DIM Basics
Lab. VIEW DIM-Interface Motivation Event and DIM Basics Idea of LV-DIM Interface Example Performance 01 -Feb-2007 Dietrich Beck, GSI
Motivation • Large Distributed Systems: One would like to get rid of node names as much as possible. – nodes might change or are replaced – processes might migrate from node to node – where is my. Resource? • Need to avoid central bottle-necks. – peer-to-peer connections required – management of many connections can be tedious • Required – full bandwidth of Ethernet – short latency time • Can't use protocols or TCP/IP implementation provided by NI 01 -Feb-2007 Dietrich Beck, GSI
Bad Example: CS commands prior to 3. 00 or(!) Caller node 1 Client_node 2 Server_node 1 Callee node 2 Lab. VIEW message queue or notifier Lab. VIEW TCP/IP DIM TCP/IP 01 -Feb-2007 Dietrich Beck, GSI
Event basics • an entity waits for the next event, no polling! • timeout handling is an important issue command pattern: "many-to-one" observer pattern: "one-to-many" client publisher client data subscriber command subscriber example: radio, television added in CS 3. 0 01 -Feb-2007 client subscriber receiver example: typical human communication sole possibility for CS < 3. 0 Dietrich Beck, GSI
DIM • • Distributed Information Management: www. cern. ch/dim Maintained at CERN and available via GPL. Thanks to C. Gaspar et al. originally developed at DELPHI@LEP/CERN around 1991 available for a multitude of platforms and languages light-weight, aiming at high performance, based on TCP/IP today: "backbone" of control systems for LHC experiments concept: named services, peer-to-peer connections command "iii" DIM server A DIM client 1 service "i" DIM server B 01 -Feb-2007 DIM name server service "ii" Dietrich Beck, GSI (negotiates connections) DIM client 2
Concept of "Named Services" • A DIM service is identifier by its name. • A DIM service may exist only once within a DIM domain (If a DIM server tries to declare a service that already exists, the server is excluded from DIM. ). • Once declared, a service has a fixed type and size (except command services). • A DIM service can be removed and re-declared. • When subscribing to a service, the DIM client neither needs to know the name of the DIM server nor the node name. • Once subscribed, DIM automatically (re-)connects the client to the service or informs the client if the service is not available. • In mixed environments (little/big endian), DIM takes care about byte and word swapping. 01 -Feb-2007 Dietrich Beck, GSI
Example for a C/C++ Application • "serve by routine" – my. Application provides and registers callback functions to DIM – DIM executes callback functions of my. Application • "serve by buffer" – my. Application provides memory and registers addresses to DIM – DIM writes/reads to/from memory of my. Application uses • write/read memory • uses callback functions DIM dll/so, C. Gaspar, CERN 01 -Feb-2007 Dietrich Beck, GSI
Using DIM with Lab. VIEW • Difficulties: – Lab. VIEW does not allow direct execution of code from external applications (VI Server is not performing enough) – using shared memory would require polling • Solution: DIMWrapper library written in C – provides callback functions for DIM – callback functions copy data received from DIM to a Lab. VIEW message queue or notifier – Lab. VIEW applications receive data from DIM via message queue or notifier 01 -Feb-2007 Dietrich Beck, GSI
New (!) Lab. VIEW-DIM interface • • "serve by routine" only using call back functions with DIM uses "native" DIM libraries (no re-write) client and server functionality for commands and services DIMWrapper (and LVEvent dll) are required to make use of the DIM callback functionality Lab. VIEW application Lab. VIEW runtime engine, NI LVEvent dll/so, GSI DIM Wrapper dll/so, GSI DIM dll/so, C. Gaspar, CERN 01 -Feb-2007 (dedicated patch for Lab. VIEW) Dietrich Beck, GSI
Server Example 01 -Feb-2007 Dietrich Beck, GSI
Client Example 01 -Feb-2007 Dietrich Beck, GSI
Example: Change for CS commands old: or(!) Caller node 1 Client_node 2 Server_node 1 Callee node 2 Lab. VIEW message queue or notifier Lab. VIEW TCP/IP DIM TCP/IP new: Caller node 1 01 -Feb-2007 Dim. Wrapper node 2 Dietrich Beck, GSI Callee
Performance Lab. VIEW-DIM Interface 01 -Feb-2007 Dietrich Beck, GSI
Conclusion Pros • Lab. VIEW-DIM interface provides excellent performance • no longer care about node names • based on robust and well established protocol • using pre-compiled binaries (no re-implementation in LV) Cons • no longer pure Lab. VIEW • requires experience with message queue or notifiers • requires use of "typecasts" Outlook • DIM-XControls for Lab. VIEW 8. 20 (tomorrow, D. Beck) • DSC-IO server for Lab. VIEW 8. 20 (tomorrow, H. Brand) • slight changes of LVEvent library for Lab. VIEW 8. 20 probable 01 -Feb-2007 Dietrich Beck, GSI
- Slides: 14