0001 function dataout = mdsplusload(datain)
0002
0003
0004
0005
0006
0007
0008 try
0009
0010 dataout.mdsplus.ipserver = datain.ipserver;
0011 dataout.mdsplus.shotnumber = datain.shotnumber;
0012
0013 dataout.mdsplus.connect = mdsconnect(datain.ipserver);
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));
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},')']);
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