1 | function test_position_axis(dev,edit_butee_haute,edit_butee_basse) |
---|
2 | |
---|
3 | |
---|
4 | %dev=device_name.lentille_haute; |
---|
5 | %errorstatus=tango_command_inout(dev,'AxisGetErrorStatus'); |
---|
6 | Blimitswitch = tango_read_attribute(dev,'backwardLimitSwitch'); |
---|
7 | Flimitswitch = tango_read_attribute(dev,'forwardLimitSwitch'); |
---|
8 | |
---|
9 | % errorstatus=21 dᅵcᅵlᅵration ou arrᅵt dᅵ ᅵ un limit switch sens + |
---|
10 | % errorstatus=3 limitswitch forward |
---|
11 | % errorstatus=22 dᅵcᅵlᅵration ou arrᅵt dᅵ ᅵ un limit switch sens - |
---|
12 | % errorstatus=4 limitswitch backward |
---|
13 | |
---|
14 | if (tango_error == -1) |
---|
15 | %- handle error |
---|
16 | tango_print_error_stack; |
---|
17 | return; |
---|
18 | errordlg('erreur tango !','Erreur'); |
---|
19 | |
---|
20 | else |
---|
21 | % cas ou l'axe est en butee backward (en haut) |
---|
22 | if isequal(Blimitswitch,1) |
---|
23 | %if isequal(errorstatus,22)|isequal(errorstatus,4) |
---|
24 | set(edit_butee_haute,'BackgroundColor','red'); |
---|
25 | end |
---|
26 | % cas ou l'axe est en butee forward (en bas) |
---|
27 | if isequal(Flimitswitch,1) |
---|
28 | %if isequal(errorstatus,21)|isequal(errorstatus,3) |
---|
29 | set(edit_butee_basse,'BackgroundColor','red'); |
---|
30 | end |
---|
31 | |
---|
32 | end |
---|