SETAM - Sets analog monitor value If using family name, device list method, ErrorFlag = setam(Family, newAM, DeviceList) If using common name method, ErrorFlag = setam(Family, newAM, CommonNames, WaitFlag) If using channel name method, ErrorFlag = setam('ChannelName', newAM) Inputs: Family = Family Name Accelerator Object Cell Array of Accelerator Objects or Family Names For CommonNames Family=[], searches all families ChannelName = Channel access channnel name (scalar or vector inputs) Matrix of channel names (scalar inputs only) Cell array of channel names CommonName = Common name (scalar or vector inputs), Matrix of common names (scalar inputs only) Cell array of common names newAM = new "monitor" or cell array of new "monitors" DeviceList ([Sector Device #] or [element #]) {default or empty list: whole family} WaitFlag = 0 -> return immediately 1 -> wait until ramping is done + BPM delay {default} else -> wait until ramping is done Note #1: The number of colomns of newSP and DeviceList must be equal, or newSP must be a scalar. If newSP is a scalar, then all devices in DeviceList will be set to the same value. Note #2: When using cell array all inputs must be the same size cell array and the output will also be a cell array. Note #3: For families and accelerator data structures unknown devices or elements are ignored. A warning message will be printed to the screen. Note #4: Channel name method is always Online! Note #5: setam is an odd thing to do but it's here incase you want it. Ex., setam(HCM',1.23) sets the entire HCM family to 1.23 setam({'HCM','VCM'},{10.4,5.3}) sets the entire HCM family to 10.4 and VCM family to 5.3 setam(AccData, 1.5, [1 2]) if AccData is a properly formated Accelerator Data Structure then the 1st sector, 2nd element is set to 1.5 See also getam, getsp, setsp, getpv, setpv
0001 function ErrorFlag = setam(Family, varargin) 0002 %SETAM - Sets analog monitor value 0003 % If using family name, device list method, 0004 % ErrorFlag = setam(Family, newAM, DeviceList) 0005 % 0006 % If using common name method, 0007 % ErrorFlag = setam(Family, newAM, CommonNames, WaitFlag) 0008 % 0009 % If using channel name method, 0010 % ErrorFlag = setam('ChannelName', newAM) 0011 % 0012 % Inputs: Family = Family Name 0013 % Accelerator Object 0014 % Cell Array of Accelerator Objects or Family Names 0015 % For CommonNames Family=[], searches all families 0016 % ChannelName = Channel access channnel name (scalar or vector inputs) 0017 % Matrix of channel names (scalar inputs only) 0018 % Cell array of channel names 0019 % CommonName = Common name (scalar or vector inputs), 0020 % Matrix of common names (scalar inputs only) 0021 % Cell array of common names 0022 % newAM = new "monitor" or cell array of new "monitors" 0023 % DeviceList ([Sector Device #] or [element #]) {default or empty list: whole family} 0024 % WaitFlag = 0 -> return immediately 0025 % 1 -> wait until ramping is done + BPM delay {default} 0026 % else -> wait until ramping is done 0027 % 0028 % Note #1: The number of colomns of newSP and DeviceList must be equal, 0029 % or newSP must be a scalar. If newSP is a scalar, then all 0030 % devices in DeviceList will be set to the same value. 0031 % Note #2: When using cell array all inputs must be the same size cell array 0032 % and the output will also be a cell array. 0033 % Note #3: For families and accelerator data structures unknown devices or elements are ignored. 0034 % A warning message will be printed to the screen. 0035 % Note #4: Channel name method is always Online! 0036 % Note #5: setam is an odd thing to do but it's here incase you want it. 0037 % 0038 % Ex., setam(HCM',1.23) sets the entire HCM family to 1.23 0039 % setam({'HCM','VCM'},{10.4,5.3}) sets the entire HCM family to 10.4 and VCM family to 5.3 0040 % setam(AccData, 1.5, [1 2]) if AccData is a properly formated Accelerator Data Structure 0041 % then the 1st sector, 2nd element is set to 1.5 0042 % 0043 % See also getam, getsp, setsp, getpv, setpv 0044 0045 % 0046 % Written by Gregory J. Portmann 0047 0048 0049 % ErrorFlag = 0 -> OK 0050 % -1 -> SCA error 0051 % -2 -> SP-AM warning (only if WaitFlag=1) 0052 0053 if nargin < 2 0054 error('Must have at least 2 inputs (Family or Channel Name and newSP).'); 0055 end 0056 0057 [ErrorFlag] = setpv(Family, 'Monitor', varargin{:}); 0058 0059