GETDCCT - returns the beam current [DCCT, tout, DataTime, ErrorFlag] = getdcct(t, InputFlags) OUTPUTS 1. DCCT = storage ring electron beam current INPUTS 1. 'Struct' will return a data structure 'Numeric' will return numeric outputs {Defaul} 2. 'Physics' - Use physics units (optional override of units) 'Hardware' - Use hardware units (optional override of units) 3. 'Online' - Get data online (optional override of the mode) 'Model' - Get data from the model (optional override of the mode) 'Manual' - Get data manually (optional override of the mode) NOTE 1. Simulation mode: lifetime is 6 hour, refill at midnight to 1000 mamps 2. This function is just an alias for getam('DCCT', ...) Written by Greg Portmann
0001 function [DCCT, tout, DataTime, ErrorFlag] = getdcct(varargin) 0002 %GETDCCT - returns the beam current 0003 % [DCCT, tout, DataTime, ErrorFlag] = getdcct(t, InputFlags) 0004 % 0005 % OUTPUTS 0006 % 1. DCCT = storage ring electron beam current 0007 % 0008 % INPUTS 0009 % 1. 'Struct' will return a data structure 0010 % 'Numeric' will return numeric outputs {Defaul} 0011 % 2. 'Physics' - Use physics units (optional override of units) 0012 % 'Hardware' - Use hardware units (optional override of units) 0013 % 3. 'Online' - Get data online (optional override of the mode) 0014 % 'Model' - Get data from the model (optional override of the mode) 0015 % 'Manual' - Get data manually (optional override of the mode) 0016 % 0017 % NOTE 0018 % 1. Simulation mode: lifetime is 6 hour, refill at midnight to 1000 mamps 0019 % 2. This function is just an alias for getam('DCCT', ...) 0020 % 0021 % Written by Greg Portmann 0022 0023 if isfamily('DCCT') 0024 if nargout > 2 0025 [DCCT, tout, DataTime, ErrorFlag] = getpv('DCCT', 'Monitor', [], varargin{:}); 0026 else 0027 [DCCT, tout] = getpv('DCCT', 'Monitor', [], varargin{:}); 0028 end 0029 else 0030 DCCT = NaN; 0031 tout = 0; 0032 0033 t1 = clock; 0034 days = datenum(t1(1:3)) - 719529; %datenum('1-Jan-1970'); 0035 tt = 24*60*60*days + 60*60*t1(4) + 60*t1(5) + t1(6); 0036 DataTime = fix(tt) + rem(tt,1)*1e9*sqrt(-1); 0037 0038 ErrorFlag = -1; 0039 end 0040