-
Notifications
You must be signed in to change notification settings - Fork 0
/
iXon_Stop_and_Quit.m
54 lines (43 loc) · 1.21 KB
/
iXon_Stop_and_Quit.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
% Stop and deinitialize the iXon camera
%% check camera status
[ret, status] = AndorGetStatus();
if ret~=20002
error('System not initialized');
else
if status==20072
disp('camera is acquiring');
ret = AbortAcquisition();
if ret==20002
disp('acquisition was aborted');
else
error('Error when aborting acquisition');
end
pause(1);
elseif status==20074
disp('camera in Temperature Cycle');
[~, currentTemp] = GetTemperature;
fprintf(' current temperature is: %f\n', currentTemp);
pause(1);
end
end
%% close shutter and stop temperature control
ret = CoolerOFF();
if ret~=20002
error('Error switching off cooler');
end
ret = SetShutterEx(1,2,27,27,2); % Set external and internal shutter to close
if ret~=20002
error('Error closing shutter');
end
[ret, status] = AndorGetStatus(); % check again for status
if ret~=20002
error('System not initialized');
else
if status~=20073
error('camera cannot be shut down');
end
end
%% shut down camera
pause(1);
[ret] = AndorShutDown;
disp('*** camera was shut down ***');