mdsplusload

PURPOSE ^

MATREMOTE - Remote mdsplus database access

SYNOPSIS ^

function dataout = mdsplusload(datain)

DESCRIPTION ^

 MATREMOTE - Remote mdsplus database access

 Remote mdsplus database access 

 by Y. Peysson (CEA/IRFM, yves.peysson@cea.fr) and J. Decker (CRPP/EPFL, joan.decker@epfl.ch)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dataout = mdsplusload(datain)
0002 % MATREMOTE - Remote mdsplus database access
0003 %
0004 % Remote mdsplus database access
0005 %
0006 % by Y. Peysson (CEA/IRFM, yves.peysson@cea.fr) and J. Decker (CRPP/EPFL, joan.decker@epfl.ch)
0007 %
0008 try
0009     %
0010     dataout.mdsplus.ipserver = datain.ipserver;
0011     dataout.mdsplus.shotnumber = datain.shotnumber;
0012     %
0013     dataout.mdsplus.connect = mdsconnect(datain.ipserver);%connect to MDS+ server
0014     %
0015     for itree =  1:length(datain.tree),
0016         %
0017         dataout.mdsplus.tree(itree).name = datain.tree(itree).name;
0018         dataout.mdsplus.tree(itree).open = mdsopen(datain.tree(itree).name,str2num(datain.shotnumber));%open the MDS+ tree
0019         %
0020         for ivalue = 1:length(datain.tree(itree).values),
0021             %
0022             [data,status_data]= mdsvalue(datain.tree(itree).values(ivalue));
0023             [time,status_time] = mdsvalue(['dim_of(',datain.tree(itree).values{ivalue},')']); % measured in seconds
0024             %
0025             dataout.mdsplus.tree(itree).values(ivalue).name = datain.tree(itree).values(ivalue);
0026             dataout.mdsplus.tree(itree).values(ivalue).units = datain.tree(itree).units(ivalue);
0027             %
0028             dataout.mdsplus.tree(itree).values(ivalue).data = data;
0029             dataout.mdsplus.tree(itree).values(ivalue).status_data = status_data;
0030             %
0031             dataout.mdsplus.tree(itree).values(ivalue).time = time;
0032             dataout.mdsplus.tree(itree).values(ivalue).status_time = status_time;
0033             %
0034             clear data status_data time status_time
0035             %
0036         end
0037         %
0038         mdsclose;
0039         %
0040     end
0041     %
0042     mdsdisconnect;
0043     %
0044 catch
0045     dataout.mdsplus.err = ['Error reading MDS+ database at ip address ',datain.ipserver,' ',getReport(MException.last)];
0046 end
0047 %
0048

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.