1 / 13

EPICS/MDSplus Interface Methods

Office of Science. Supported by. EPICS/MDSplus Interface Methods. Paul Sichta, NSTX Project in collaboration with Mikyung Park, KSTAR Project Gabriele Manduchi, RFX Project EPICS Collaboration Meeting June 2-4, 2010 Aix-en-Provence, France. College W&M Colorado Sch Mines Columbia U

nura
Download Presentation

EPICS/MDSplus Interface Methods

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Office of Science Supported by EPICS/MDSplus Interface Methods Paul Sichta, NSTX Project in collaboration with Mikyung Park, KSTAR Project Gabriele Manduchi, RFX Project EPICS Collaboration Meeting June 2-4, 2010 Aix-en-Provence, France College W&M Colorado Sch Mines Columbia U Comp-X General Atomics INEL Johns Hopkins U LANL LLNL Lodestar MIT Nova Photonics New York U Old Dominion U ORNL PPPL PSI Princeton U SNL Think Tank, Inc. UC Davis UC Irvine UCLA UCSD U Colorado U Maryland U Rochester U Washington U Wisconsin Culham Sci Ctr U St. Andrews York U Chubu U Fukui U Hiroshima U Hyogo U Kyoto U Kyushu U Kyushu Tokai U NIFS Niigata U U Tokyo JAERI Hebrew U Ioffe Inst RRC Kurchatov Inst TRINITI NFRI KAIST ENEA, Frascati CEA, Cadarache IPP, Jülich IPP, Garching ASCR, Czech Rep U Quebec

  2. Introduction • In the beginning (NSTX 1999), • Engineering used EPICS and Physics used MDSplus • Separate organizational units were implementing each framework • Both frameworks were being deployed for the first time at PPPL. • Both were “free” and “open source”. • As machine operations matured the benefits of integration became apparent. • The organizational units were unified NSTX EPICS Spring 2010

  3. EPICS/MDSplus Interface Methods at NSTX • Use a client that speaks both EPICS and MDSplus • C programs (on Unix) calling both EPICS CA and MDSplus libraries • IDL using EZCA_IDL for EPICS and community-developed IDL functions for MDSplus • Unix shell scripts Client • New EPICS records were prototyped in 2005, but never matured into production (Mastrovito, 5th IAEA TM on Control, Data Acquisition…) • Performance was poor • A low-priority project

  4. EPICS/MDSplus Interface Methods at KSTAR • From Linux IOC • IOC "C" code • Sequencer Program • Using dual-client method on Linux • IDL using EZCA_IDL • Matlab using MCA

  5. New EPICS/MDSplus Interface Methods are in Development • NSTX will resume and expand the scope of the 2005 effort; • C-based MDSplus recordson a Linux IOC. • Now, collaborate • RFX (Manduchi) has developed EPICS records for MDSplus .... see his presentation. • C++ MDSplus records on a Linux IOC.

  6. EPICS/MDSplus Interface plans at KSTAR • 1) To transfer and store MDSplus data to the tree in run-time during shot for supporting the long pulse (300 seconds) experiments. • MDSplus segmented records • 2) In KSTAR, the machine operational data generated continuously at low rate is archived using EPICS channel archiver and the pulse-based experimental data is archived using MDSplus. • Some users want to see plasma data in conjunction with machine operational data.

  7. Develop other EPICS/MDSplus interfaces ? • CSS plug-ins for MDSplus to duplicate functions provided by MDSplus-native tools: • Traverser • Scope (waveform plots) • Event & Data I/O (put/get) • “ArchiveViewer” for Channel Archiver (from MDSplus data pool) • EPICS & MDSplus provide a Python API. • Subroutine record. • MDSplus runs on vxWorks ... at least partially. • MDSplus supports a Java API, RFX has expertise in this area; the EPICS Java IOC is maturing .... some synergy here?

  8. Code Snippets The following code has been modified from its original version. It has been formatted to fit this presentation, to run in the time allotted and edited for content.

  9. C-based Client (NSTX) Header files to include #include "cadef.h" #include "/usr/local/mdsplus/include/mdslib.h" ..... SEVCHK(ca_create_channel(capvname[i],NULL,NULL,10, &epicsId[i]),"cm_Mparm: ca_create_channel failure"); SEVCHK(ca_get(DBR_LONG,epicsNord[i],(void *)&nord[i]),"cm_Mparm: ca_get failure"); SEVCHK(ca_array_get(DBR_LONG,nord[i],epicsId[i],(void *)longArray),"ca_array_get failure"); ca_sts=ca_pend_io(PPPL_CATIMO); ca_clear_channel(epicsId[i]); ..... mdsSocket = MdsConnect(nstxServer); sts=check_mdsOpen(progname,camds_struct[i].MDStree,shotno); dsc = descr(&dataType[i],longArray,&nord[i],&null); sts=MdsPut(camds_struct[i].MDSpath,"$",&dsc,&null); MdsDisconnect(); EPICS code MDSplus code

  10. IDL-based Client (NSTX) Initialize EZCA_IDL .RUN ezcaIDL CAINIT name = "ck_ShotNumber" status = caget ( name, shotNo ) MDSCONNECT,'lark1.pppl.gov:8501::' MDSOPEN, mdstree, shotNo, STATUS = sts sigDataPrefix = mdstree + '::TOP.EPICS.' + subSysNode + '.DIGITIZERS' rawDataPrefix = sigDataPrefix + '.RAWDATA.' + digNode MDSPUT, rawDataPrefix + ':NUMBER_CHANS', '$', nChansActive MDSCLOSE , STATUS = sts, /QUIET ; don't quit on error EPICS code MDSplus code

  11. MatLab (KSTAR) 1) EPICS interface in Matlab code pvnames={‘XXX_SHOT_NUMBER',‘XXX_STATUS’}; pvs=mcaopen(pvnames); shotno = mcaget(pvs(1)); status = mcaget(pvs(2)); 2) MDSplus interface in Matlab code >>mdsconnect(‘Server') >>mdsopen(‘TREE‘,ShotNumber) >>d=mdsvalue(‘(Node_Path)') >>plot,d

  12. Sequencer (KSTAR)(1 of 2) %% #include <mdslib.h> %% #include <mdsdescrip.h> %% #include <mdsshr.h> int mdsPutStart; %% int i; %% int j; %% char buf[50]; %% char buf1[50]; float wfData[8][30000]; float timeWf[30000]; float trigTime; float nuData[5]; %% int noBuf_temp; %% float samRate_temp; string treeSigNode[8]; string treeNuNode[5]; string errorMsg; assign wfData to {"ECH:NI:DAQ:AI00","ECH:NI:DAQ:AI04","ECH:NI:DAQ:AI07"}; assign treeSigNode to {"ECH_VC","ECH_VB","ECH_IB","ECH_IA","ECH_VFWD2","ECH_VREF2"}; assign mdsPutStart to "ECH_DATA_MDS_PUT"; %% /* assign mdsIp to "ECH_MDS_IP"; */ %% /* assign mdsTree to "ECH_MDS_TREE"; */ assign trigTime to "ECH_LTU_T0_p0"; monitor wfData; monitor nuData; monitor treeSigNode includes variable declarations and EPICS record assignements

  13. Sequencer (KSTAR) (2 of 2) ss mdsDataPut { state data_put { when (mdsPutStart==1) { %% idesc = descr(&dtypeLong, &tstat, &null); %% printf("No Buff : %f and Sam Rate : %f \n",nuData[0], nuData[1]); %% socket = MdsConnect(MDS_SERVER); status = MdsOpen(ATREE_NAME, &pVar->shotNumber); /* Data Put loop Start */ %% for(i=0; i<6; i++) { %% sprintf(buf, "\%s", treeNuNode[i]); printf("%s: %d\n", buf, strlen(buf)); %% sprintf(buf1, "FS_FLOAT(%f)", nuData[i] );printf("%s: %f\n", buf1, nuData[i]); %% status = MdsPut(buf, buf1, &null); /* MdsPut !! */ %% if ( !statusOk(status) ) %% fprintf(stderr,"Error Mds Put 1 : %s.\n",MdsGetMsg(status)); %% epicsThreadSleep(.50); %% } %% status = MdsClose(ATREE_NAME, &pVar->shotNumber); } state data_put } SNL state statements MDS connect & tree open mdsput & tree close

More Related