line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Instrument::OI_Triton; |
2
|
|
|
|
|
|
|
#ABSTRACT: Oxford Instruments Triton dilution refrigerator control |
3
|
|
|
|
|
|
|
$Lab::Instrument::OI_Triton::VERSION = '3.880'; |
4
|
1
|
|
|
1
|
|
1734
|
use v5.20; |
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
7
|
1
|
|
|
1
|
|
6
|
use Lab::Instrument; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
8
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1020
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @ISA = ("Lab::Instrument"); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our %fields = ( |
13
|
|
|
|
|
|
|
supported_connections => [ 'Socket', 'VISA' ], |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# default settings for the supported connections |
16
|
|
|
|
|
|
|
connection_settings => { |
17
|
|
|
|
|
|
|
remote_port => 33576, |
18
|
|
|
|
|
|
|
remote_addr => 'triton', |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
0
|
|
|
0
|
1
|
|
my $proto = shift; |
24
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto; |
25
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
26
|
0
|
|
|
|
|
|
$self->${ \( __PACKAGE__ . '::_construct' ) }(__PACKAGE__); |
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_temperature { |
32
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
33
|
0
|
|
|
|
|
|
my $channel = shift; |
34
|
0
|
0
|
|
|
|
|
$channel = "1" unless defined($channel); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $temp = $self->query("READ:DEV:T$channel:TEMP:SIG:TEMP\n"); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# typical response: STAT:DEV:T1:TEMP:SIG:TEMP:1.47628K |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$temp =~ s/^.*:SIG:TEMP://; |
41
|
0
|
|
|
|
|
|
$temp =~ s/K.*$//; |
42
|
0
|
|
|
|
|
|
return $temp; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub enable_control { |
46
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
my $temp = $self->query("SET:SYS:USER:NORM\n"); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# typical response: STAT:SET:SYS:USER:NORM:VALID |
50
|
0
|
|
|
|
|
|
return $temp; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub disable_control { |
54
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
my $temp = $self->query("SET:SYS:USER:GUEST\n"); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# typical response: STAT:SET:SYS:USER:GUEST:VALID |
58
|
0
|
|
|
|
|
|
return $temp; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub enable_temp_pid { |
62
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
63
|
0
|
|
|
|
|
|
my $temp = $self->query("SET:DEV:T5:TEMP:LOOP:MODE:ON\n"); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# typical response: STAT:SET:DEV:T5:TEMP:LOOP:MODE:ON:VALID |
66
|
0
|
|
|
|
|
|
return $temp; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub disable_temp_pid { |
70
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
my $temp = $self->query("SET:DEV:T5:TEMP:LOOP:MODE:OFF\n"); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# typical response: STAT:SET:DEV:T5:TEMP:LOOP:MODE:OFF:VALID |
74
|
0
|
|
|
|
|
|
return $temp; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub get_T { |
78
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
79
|
0
|
|
|
|
|
|
my $temp = $self->get_temperature("5"); |
80
|
0
|
|
|
|
|
|
return $temp; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub waitfor_T { |
84
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
85
|
0
|
|
|
|
|
|
my $target = shift; |
86
|
0
|
|
|
|
|
|
my $now = 10000000; |
87
|
|
|
|
|
|
|
|
88
|
0
|
0
|
|
|
|
|
do { |
89
|
0
|
|
|
|
|
|
sleep(10); |
90
|
0
|
|
|
|
|
|
$now = get_T(); |
91
|
0
|
|
|
|
|
|
print "Waiting for T=$target ; current temperature is T=$now\n"; |
92
|
|
|
|
|
|
|
} unless ( abs( $now - $target ) / $target < 0.05 ); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub set_T { |
96
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
97
|
0
|
|
|
|
|
|
my $temp = shift; |
98
|
|
|
|
|
|
|
|
99
|
0
|
0
|
|
|
|
|
if ( $temp > 0.7 ) { croak "OI_Triton::set_T: setting temperatures above 0.7K is forbidden\n"; }; |
|
0
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
0
|
0
|
|
|
|
|
if ( $temp < 0.035 ) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
$self->set_Imax(0.000316); |
103
|
|
|
|
|
|
|
} elsif ( $temp < 0.07 ) { |
104
|
0
|
|
|
|
|
|
$self->set_Imax(0.001); |
105
|
|
|
|
|
|
|
} elsif ( $temp < 0.35 ) { |
106
|
0
|
|
|
|
|
|
$self->set_Imax(0.00316); |
107
|
|
|
|
|
|
|
} else { |
108
|
0
|
|
|
|
|
|
$self->set_Imax(0.01); |
109
|
|
|
|
|
|
|
}; |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
my $temp = $self->query("SET:DEV:T5:TEMP:LOOP:TSET:$temp\n"); |
112
|
|
|
|
|
|
|
# typical reply: STAT:SET:DEV:T5:TEMP:LOOP:TSET:0.1:VALID |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
$self->enable_temp_pid(); |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
my $temp = $self->query("SET:DEV:T5:TEMP:LOOP:TSET:$temp\n"); |
117
|
|
|
|
|
|
|
# typical reply: STAT:SET:DEV:T5:TEMP:LOOP:TSET:0.1:VALID |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub set_Imax { |
121
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
122
|
0
|
|
|
|
|
|
my $imax = shift; # in Ampere |
123
|
|
|
|
|
|
|
|
124
|
0
|
0
|
|
|
|
|
if ($imax > 0.0101) { croak "OI_Triton::set_Imax: Setting too large heater current limit\n"; }; |
|
0
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
$imax=$imax*1000; # in mA |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
return $self->query("SET:DEV:T5:TEMP:LOOP:RANGE:$imax\n"); |
129
|
|
|
|
|
|
|
}; |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub get_P { |
133
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
134
|
0
|
|
|
|
|
|
my $power = $self->query("READ:DEV:H1:HTR:SIG:POWR\n"); |
135
|
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
|
$power =~ s/^.*SIG:POWR://; |
137
|
0
|
|
|
|
|
|
$power =~ s/uW$//; |
138
|
0
|
|
|
|
|
|
return $power; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub set_P { |
142
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
143
|
0
|
|
|
|
|
|
my $power = shift; |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
return $self->query("SET:DEV:H1:HTR:SIG:POWR:$power\n"); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# now follows the temperature sweep interface for XPRESS |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub set_heatercontrol { |
153
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
154
|
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
my $mode = shift; |
156
|
|
|
|
|
|
|
# assumption: MAN=no control loop, AUTO=internal PID loop |
157
|
|
|
|
|
|
|
|
158
|
0
|
0
|
|
|
|
|
if ( $mode eq 'AUTO' ) { |
159
|
0
|
|
|
|
|
|
$self->enable_temp_pid(); |
160
|
|
|
|
|
|
|
} else { |
161
|
0
|
|
|
|
|
|
$self->disable_temp_pid(); |
162
|
|
|
|
|
|
|
}; |
163
|
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
return; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub set_heateroutput { |
168
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
169
|
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
$self->disable_temp_pid(); |
171
|
0
|
|
|
|
|
|
$self->set_P(0); |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
return; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub get_value { |
177
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
178
|
0
|
|
|
|
|
|
return $self->get_T(@_); |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# requires set_T |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
1; |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
__END__ |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=pod |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=encoding utf-8 |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 NAME |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Lab::Instrument::OI_Triton - Oxford Instruments Triton dilution refrigerator control |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head1 VERSION |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
version 3.880 |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head1 SYNOPSIS |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
use Lab::Instrument::OI_Triton; |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
my $m=new Lab::Instrument::OI_Triton( |
208
|
|
|
|
|
|
|
connection_type=>'Socket', |
209
|
|
|
|
|
|
|
remote_port=>33576, |
210
|
|
|
|
|
|
|
remote_addr=>'triton', |
211
|
|
|
|
|
|
|
); |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=head1 DESCRIPTION |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
The Lab::Instrument::OI_Triton class implements an interface to the Oxford Instruments |
216
|
|
|
|
|
|
|
Triton dilution refrigerator control system. |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 METHODS |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head2 get_temperature |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
$t=$m->get_temperature('1'); |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
Read out the designated temperature channel. Result is in Kelvin (?). |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=head1 CAVEATS/BUGS |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
probably many |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=head1 SEE ALSO |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=over 4 |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item L<Lab::Instrument> |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=back |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
Copyright 2014 |
243
|
|
|
|
|
|
|
2015 Andreas K. Huettel |
244
|
|
|
|
|
|
|
2016 Andreas K. Huettel, Simon Reinhardt |
245
|
|
|
|
|
|
|
2017 Andreas K. Huettel |
246
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
250
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=cut |