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 | |
---|
1 | function status = ucodesetpv(pvs, values) |
---|
2 | % UICODESETPV |
---|
3 | % PV names must end with ':am' or ':sp' |
---|
4 | % for readbacks and setpoints |
---|
5 | |
---|
6 | |
---|
7 | if ischar (pvs) |
---|
8 | pvs = cellstr(pvs); |
---|
9 | end |
---|
10 | if length(pvs) ~= length(values) |
---|
11 | error('values and pvs must be the same length') |
---|
12 | end |
---|
13 | |
---|
14 | commandstr = '/home/bengtsson/matlab1.0/acceleratorcontrol/ucode/uputsp'; |
---|
15 | |
---|
16 | |
---|
17 | devicestring = ''; |
---|
18 | |
---|
19 | for 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 | |
---|
29 | end |
---|
30 | |
---|
31 | |
---|
32 | %disp(devicestring) |
---|
33 | [status, longstring] = system([commandstr, ' ', devicestring]); |
---|
34 | crs = findstr(longstring, sprintf('\n')); |
---|
35 | longstring = longstring(crs(end)-1:end); |
---|
36 | status = str2num(longstring); |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.