source: MML/trunk/mml/links/tango/tango_group_write_attribute2.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 1015 bytes
Line 
1function replies = tango_group_write_attribute2(group_id, attr_name, attr_value, forward)
2%TANGO_GROUP_WRITE_ATTRIBUTES - enhance function with error handling
3%
4%  INPUTS
5%  1. Group identification number
6%  2. Attr_name Attribute name
7%  3. attr_values Attribute value to write
8%  4. forward
9%
10%  See Also tango_group_write_attribute
11
12%
13%% Written by Laurent S. Nadolski
14
15if nargin < 3
16   error('At least 3 arguments required');
17end
18if nargin < 4
19   forward = 0;
20end
21
22replies = tango_group_write_attribute(group_id, attr_name, forward, attr_value);
23
24if tango_error == -1 || (isnumeric(replies) &&  replies == -1)
25    tango_print_error_stack
26    return,
27else
28    if replies.has_failed
29        disp('Error when reading data for BPM');
30        for k = 1:length(replies.replies),
31            if replies.replies(k).has_failed
32                fprintf('Error with device %s\n',replies.replies(k).dev_name)
33                tango_print_error_stack_as_it_is(replies.replies(k).error)
34            end
35        end
36    end
37end
Note: See TracBrowser for help on using the repository browser.