source: MML/trunk/mml/links/ucode/ucodesetpv.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 825 bytes
Line 
1function status =  ucodesetpv(pvs, values)
2% UICODESETPV
3% PV names must end with ':am' or ':sp'
4% for readbacks and setpoints
5
6
7if ischar (pvs)
8    pvs = cellstr(pvs);
9end
10if length(pvs) ~= length(values)
11    error('values and pvs must be the same length')
12end
13
14commandstr = '/home/bengtsson/matlab1.0/acceleratorcontrol/ucode/uputsp';
15
16
17devicestring = '';
18
19for i=1:length(pvs)
20    devicestring = [devicestring, '  ', pvs{i}(1:end-3)];
21   
22   
23    if strcmpi(pvs{i}(end-1:end),'sp') == 0
24        error('pv name must end with '':sp''');
25    end
26   
27    devicestring = [devicestring, '  ', num2str(values(i))];
28   
29end
30
31
32%disp(devicestring)
33[status, longstring] = system([commandstr, '   ', devicestring]);
34crs = findstr(longstring, sprintf('\n'));
35longstring = longstring(crs(end)-1:end);
36status = str2num(longstring);
37
Note: See TracBrowser for help on using the repository browser.