1 | function [DCCT, tout, DataTime, ErrorFlag] = getdcct(varargin) |
---|
2 | %GETDCCT - returns the beam current |
---|
3 | % [DCCT, tout, DataTime, ErrorFlag] = getdcct(t, InputFlags) |
---|
4 | % |
---|
5 | % OUTPUTS |
---|
6 | % 1. DCCT = storage ring electron beam current |
---|
7 | % |
---|
8 | % INPUTS |
---|
9 | % 1. 'Struct' will return a data structure |
---|
10 | % 'Numeric' will return numeric outputs {Defaul} |
---|
11 | % 2. 'Physics' - Use physics units (optional override of units) |
---|
12 | % 'Hardware' - Use hardware units (optional override of units) |
---|
13 | % 3. 'Online' - Get data online (optional override of the mode) |
---|
14 | % 'Model' - Get data from the model (optional override of the mode) |
---|
15 | % 'Manual' - Get data manually (optional override of the mode) |
---|
16 | % |
---|
17 | % NOTE |
---|
18 | % 1. Simulation mode: lifetime is 6 hour, refill at midnight to 1000 mamps |
---|
19 | % 2. This function is just an alias for getam('DCCT', ...) |
---|
20 | % |
---|
21 | % Written by Greg Portmann |
---|
22 | |
---|
23 | if isfamily('DCCT') |
---|
24 | if nargout > 2 |
---|
25 | [DCCT, tout, DataTime, ErrorFlag] = getpv('DCCT', 'Monitor', [], varargin{:}); |
---|
26 | else |
---|
27 | [DCCT, tout] = getpv('DCCT', 'Monitor', [], varargin{:}); |
---|
28 | end |
---|
29 | else |
---|
30 | DCCT = NaN; |
---|
31 | tout = 0; |
---|
32 | |
---|
33 | t1 = clock; |
---|
34 | days = datenum(t1(1:3)) - 719529; %datenum('1-Jan-1970'); |
---|
35 | tt = 24*60*60*days + 60*60*t1(4) + 60*t1(5) + t1(6); |
---|
36 | DataTime = fix(tt) + rem(tt,1)*1e9*sqrt(-1); |
---|
37 | |
---|
38 | ErrorFlag = -1; |
---|
39 | end |
---|
40 | |
---|