Wir schaffen Wissen – heute für morgen Paul Scherrer Institut EPICS V4 Archiver Service and Matlab client Timo Korhonen.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Wir schaffen Wissen – heute für morgen A.C.Mezger, Paul Scherrer Institut, Switzerland caQtDM, an EPICS display manager with Qt Paul Scherrer Institut.
V4 Status and Workshop Report CSS, DISCS, an V4 team.
With Folder HelpDesk for Outlook, support centres and other helpdesks can work efficiently with support cases inside Microsoft Outlook. The support tickets.
MatLab API in C++ Christopher Dabney. Purpose MatLab … MatLab … is an interpreted scripting language is an interpreted scripting language conversion to.
EPICS V4/areaDetector Integration
PvData,pvAccess,pvIOC,pvService Status EPICS Meeting June 2011 NSRRC,Hsinchu, Taiwan Marty Kraimer, Guobao Shen, and Matej Sekoranja.
Remote Procedure Call Design issues Implementation RPC programming
Channel Access Protocol Andrew Johnson Computer Scientist, AES Controls Group.
Wir schaffen Wissen – heute für morgen Paul Scherrer Institut Controls tools for operation management at the Swiss Light Source at the EPICS collaboration.
PvData,pvAccess,javaIOC,pvService Status EPICS Meeting Aix-en-Provence, France Marty Kraimer, Guobao Shen, and Matej Sekoranja.
ORNL is managed by UT-Battelle for the US Department of Energy EPICS V4 for SNS Neutron Data Kay Kasemir Oct
Servlets and a little bit of Web Services Russell Beale.
Remote Procedure Call in SR Programming Language By Tze-Kin Tsang 3/20/2000.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Software Frameworks for Acquisition and Control European PhD – 2009 Horácio Fernandes.
Wir schaffen Wissen – heute für morgen caQtDM: a Qt-based EPICS display manager, status report Helge Brands, Anton Mezger, Paul Scherrer Institut At the.
Java SNMP Oplet Tal Lavian. Goals Portable across a range of devices Extensible Simple and convenient for client use Consistent with SNMP model Hide unnecessary.
Imperial College Tracker Slow Control & Monitoring.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
M1G Introduction to Database Development 6. Building Applications.
CSCI 6962: Server-side Design and Programming Web Services.
1 BROOKHAVEN SCIENCE ASSOCIATES EPICS Core (and other development efforts) L. Dalesio. EPICS April 25, 2013.
1 BROOKHAVEN SCIENCE ASSOCIATES NSLSII Physics Applications – Applying V4 The Control Group – presented by Bob Dalesio Taiwan EPICS Meeting, June 2011.
Contrasting styles of Web UI Development: GWT vs Native JavaScript Roland Schweitzer Weathertop Consulting, LLC Jeremy Malczyk JISAO.
Stanford Linear Accelerator Center R. Hall/L. Yasukawa1 EPICS Collaboration Mtg May 21, 2002 Oracle Storage for the Channel Archiver Managing Channel Archiver.
Jan Hatje, DESY CSS ITER March 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
MASAR Service Guobao Shen Photon Sciences Department Brookhaven National Laboratory EPICS Collaboration Workshop Oct 05, 2013.
An Environment for Matlab Analysis of DAQ Data from the 9ma Experiments Ned Arnold October 2009.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Wir schaffen Wissen – heute für morgen Gateway (Redux) PSI - GFA Controls IT Alain Bertrand Renata Krempaska, Hubert Lutz, Matteo Provenzano, Dirk Zimoch.
New Features in EPICS V4 Release 4.4 EPICS Meeting 2014, CEA, October 2014 Marty Kraimer, Matej Sekoranja.
MASAR Server & Application Guobao Shen Photon Sciences Department Brookhaven National Laboratory Collaboration Working Group Oct 02, 2013.
Wir schaffen Wissen – heute für morgen PSI,30. Oktober 2015 Paul Scherrer Institut Python Channel Access Client/Server Extension Xiaoqiang Wang EPICS Spring.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
1 BROOKHAVEN SCIENCE ASSOCIATES Control System Overview Bob Dalesio, Control Group HLA Review for NSLS-II Project April
Meta-Server System Software Lab. Overview In the Music Virtual Channel system, clients can’t query for a song initiatively Through the metadata server,
CP476 Internet Computing CGI1 Cookie –Cookie is a mechanism for a web server recall info of accessing of a client browser –A cookie is an object sent by.
EPICS Release 3.15 Bob Dalesio May 19, Features for 3.15 Support for large arrays - done for rsrv in 3.14 Channel access priorities - planned to.
Advanced Tips And Tricks For Power Query
SRW/U: Re-Introduction SRW is a Web Services based Information Retrieval Protocol Motivations: Create an easy to implement protocol with the power of Z39.50.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
EPICS Release 3.15 Bob Dalesio May 19, Features for 3.15 Support for large arrays Channel access priorities Portable server replacement of rsrv.
Web Services An Introduction Copyright © Curt Hill.
Since you’ll need a place for the user to enter a search query. Every form must have these basic components: – The submission type defined with the method.
PvaPy: Python API for EPICS PV Access Siniša Veseli Scientific Software Engineering & Data Management Advanced Photon Source EPICS Meeting October 2015.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Wir schaffen Wissen – heute für morgen Paul Scherrer Institut Timo Korhonen Improvements to Indexing Tool (Channel Archiver) ‏ EPICS Meeting, BNL 2010.
Wir schaffen Wissen – heute für morgen 30. Mai 2016PSI,30. Mai 2016PSI, Paul Scherrer Institut The PSI web interface to the EPICS channel archiver Gaudenz.
1 BROOKHAVEN SCIENCE ASSOCIATES EPICS Version 4 – Normative V4 Team – presented by Bob Dalesio EPICS Meeting October 7, 2011.
Control System Tools for Beam Commissioning Timo Korhonen Controls Division Chief Engineer April 8, 2014.
umbrellaID: Shibboleth 3 and Attribute Authority
Google Web Toolkit Tutorial
Programming Assignment #1
GFA Controls IT Alain Bertrand
Analysis Software for Neutron Imaging
Fast Action Links extension A love letter to CiviCRM
Mirjam van Daalen, (Stephan Egli, Derek Feichtinger) :: Paul Scherrer Institut Status Report PSI PaNDaaS2 meeting Grenoble 6 – 7 July 2016.
EPICS Version 4 Abstract:
caQtDM: future use of a display manager
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
Mirjam van Daalen, (Stephan Egli, Derek Feichtinger) :: Paul Scherrer Institut Status Report PSI PaNDaaS2 meeting Grenoble 12 – 13 December 2016.
Lecture 6: RPC (exercises/questions)
Programming Assignment #1
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
EPICS 7 Matej Sekoranyja, Marty Karimer, Michael Davidsaver, Ralph Lange, Andrew Johnson, Timo Korhonen, Heinz Junkes, Patrick Marschalik, Murali Shankar,
Peer-to-Peer Information Systems Week 6: Assignment #3
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Wir schaffen Wissen – heute für morgen Paul Scherrer Institut EPICS V4 Archiver Service and Matlab client Timo Korhonen

Overview ArchiverService – To access Channel Archiver data using pvAccess RPC – Written by James Rowland and David Hickin (Diamond) Client code to access the ChannelArchiver service from Matlab – Written by me to Have a tool to access the service Learn how to write client code – Used Matlab because Matlab is a central tool for our SwissFEL project Java API can be directly used Quick cycle for testing (scripting) Disclaimer: these slides are basically the same that presented in May'13 EPICS meeting – Sorry if you have already seen this once!

Archive Service ArchiverService – Many sites are still using the Channel Archiver (PSI and Diamond at least) – Direct access to the data would be valuable – Implement access to the data as a V4 service – One of the first services that was developed and deployed Basic mode of operation: – Use the RPC method that pvAccess provides – Client sends a query to a server, with parameters – Server fetches the data, packs it up and sends to the client – Client receives the data, unpacks the structure and (in this case) returns the data as a Matlab native structure – The Java API can be used natively in Matlab No wrappers in between Some conversions between Java structures and Matlab structures required, however

Anatomy of a channelRPC in EPICS V4 RPC is a pvAccess operation that can take parameters – In the archive service case: Channel to be retrieved From to – These parameters are sent to the server as a structure Use the NTURI normative type to send parameters The client creates this structure and sends it to server – Server advertises a channel name that the client connects to Basic connection mechanism is similar to channel access: – Search broadcast, server that has the name, replies, etc. – After that the differences start....(introspection, etc.) – Server receives the structure from client and unpacks the parameters, fetches the data from archiver Packs the data into another normative type structure (NTTable) and sends – Client receives the data and unpacks it

The code... structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ What the user sees... ArchiveGet call Unpacking the data Plotting, etc. or whatever the user then wants to do with the data Let us look inside these functions

The code... structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ This is just a wrapper around pvAccess and pvData calls Import the Java classes Create a Matlab structure for the request The actual pvAccess things are here The request call returns a NTTable (Java structure) ; rdpr This is returned to the caller function rdpr = ArchiveGetSimple( pvname, starttime, endtime ) %ArchiveGetSimple get data from archiver service into a pvData structure % Detailed explanation goes here import('org.epics.pvaccess.*') import('org.epics.pvaccess.easyPVA.*') import('org.epics.pvdata.*') % request.scheme='pva'; request.path='SLS-LT'; %hardcode for now - replace later request.query={'starttime',starttime;'endtime',endtime;'entity',pvname}; %start the EasyPVA factory easy = EasyPVAFactory.get(); pvr=BuildRPC(request); % now do the query rdp=easy.createChannel(request.path).createRPC(); %created an EasyRPC, now connect rdp.connect(); % do the request. Result is a PVStructure object rdpr = rdp.request(pvr); %now the result is in structure rdpr. end

The code: creating a RPC query structure structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ BuildRPC creates the NTURI structure for a query A bit too long to be shown on a slide (82 lines of code, with comments) -takes data from a matlab structure -this routine can be used for any service (only specialty here is how to handle EPICS times: times have to be converted from the EPICS epoch to times that Matlab understands.) function pvr = BuildRPC( request ) %BuildRPC Build a PVStructure for making a RPC call (EPICS 4) % pvr = BuildRPC(request) % request is a Matlab struct that contains the query data % namely: scheme, path and query % scheme: pva % path: the service name (EPICS 4 PV name) % query: query parameters, service-dependent % pvr is the NTURI PVStructure % For RPC queries, the NTURI normative type is used. if(isfield(request,'scheme') && isfield(request,'path') && isfield(request,'query') ) % uses pvdata import('org.epics.pvdata.*') %convenience number for possible time calculations epicsepoch = datenum(1990,1,1); …

The code: data unpacking structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ Another helper routine: unpackNTTable -again generic, not specific to any service -returns the data in a matlab structure for easy manipulation (plotting, calculations, etc.) About 60 lines of code (with comments, 40 without)

Remarks about the code structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ The shown code is to demonstrate programming Improvement ideas for the client code: User does not need to know the data source, just get a value of a PV. Combine archived and live data transparently If “end time” is “now”, get live value and add it to the returned data This needs some changes to the service NTTable does not include channel metadata Either add metadata to NTTable or Use another normative type Use generic routines, not “ArchiveGet” pvget(pvname, starttime, endtime) Doable, but needs a bit more effort.

Some screenshots structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ Some timings: -get one day's data (beam current): 0.15 seconds -one week's data: 1.5 seconds -one month's data (81677 values): around 7.5 seconds -most of the time is Matlab structure manipulation (I have not profiled the code, however)

Some screenshots structure NTURI string scheme string authority : opt string path structure query : opt {string | double | int }0+ { }0+ Beginnings of a GUI (matlab) Fetch the data from archive and plot This is still at a primitive state, but nevertheless fun to play with Define a channel, or select one from a predefined set *the idea is to get the channel names from a service – not implemented yet Define start and end times (demo would be nice, but using Matlab remotely can be risky – and slow)

Summary ArchiverService – Works very well (stable, fast) – Needs still some extensions (add waveforms, display information) Programming with V4 pvData, pvAccess – There is a learning curve, can be steep at times – But: when you get familiar with the programming, it is very efficient and productive – Opens up a lot of new possibilities – Normative types are a key aspect: even if they do not look very sexy in the beginning, you will eventually love them :-) Services programming – Once you have learned how to do one, creating more services becomes easy – This is a very efficient way of data integration One set of tools for all data Combining data from different sources becomes easy Final disclaimer – The code shown is from a beginner – anybody interested is welcome to have it, but it is by no means production-ready. Use at your own risk.