-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test_run.m
80 lines (58 loc) · 1.45 KB
/
Test_run.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
clear; clc;
%% functions Available
% MyArcus.goHome
% MyArcus.Abort
% MyArcus.Stop
% MyArcus.Enable
% MyArcus.Disable
% MyArcus.DevInfo
% MyArcus.DevStat
% MyArcus.setAsZero
% MyArcus.getParams
% MyArcus.JogPlus
% MyArcus.JogMinus
% MyArcus.setMoveMode
% MyArcus.resetStage
% MyArcus.moveToAbs
% MyArcus.setParams
% My Arcus.IsBusy
%%
Res = MyArcus.Enable; % enable stage
MyArcus.resetStage; % reset stage variables to default
kk = 1;
MyArcus.goHome; % send stage home
while kk > 0 % wait for command reach stage
out = MyArcus.IsBusy;
if out == 1
break;
end
end
kk = 1; % wait for stage to go home
while kk>0
out = MyArcus.IsBusy;
if out==0
kk = 0;
else
kk = kk+1;
end
end
MyArcus.setAsZero; % set home position as zero
info = MyArcus.DevInfo; % get device info
params = MyArcus.getParams; % get stage parameters (velocity, accelaration, position)
velocity = params.h_vel;
acceleartion = params.accn;
current_position = params.pos;
MyArcus.setMoveMode('ABS'); % set move mode to 'ABS' for absolute or 'INC' incremental
% set parameters
h_vel = 500; % highest velocity
l_vel = 100; % lowest velocity
accn = 30;
pos = 60000;% device units (NOTE: you have to amke your own calibration of the stage)
MyArcus.setParams(pos, l_vel, h_vel, acc);
% OR
pos = 3000;
MyArcus.moveToAbs(pos)
% stop all motion
MyArcus.Stop;
% disconnect
MyArcus.Disable