| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::OI_Mercury::Magnet; |
|
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::OI_Mercury::Magnet::VERSION = '3.900'; |
|
3
|
|
|
|
|
|
|
#ABSTRACT: Oxford Instruments Mercury magnet power supply |
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
2664
|
use v5.20; |
|
|
2
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use Moose; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
17
|
|
|
8
|
2
|
|
|
2
|
|
14907
|
use Moose::Util::TypeConstraints qw/enum/; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
23
|
|
|
9
|
2
|
|
|
2
|
|
939
|
use MooseX::Params::Validate 'validated_hash'; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
21
|
|
|
10
|
2
|
|
|
|
|
170
|
use Lab::Moose::Instrument qw/ |
|
11
|
2
|
|
|
2
|
|
489
|
validated_getter validated_setter setter_params /; |
|
|
2
|
|
|
|
|
9
|
|
|
12
|
2
|
|
|
2
|
|
623
|
use Lab::Moose::Instrument::Cache; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
16
|
|
|
13
|
2
|
|
|
2
|
|
1298
|
use Carp; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
132
|
|
|
14
|
2
|
|
|
2
|
|
12
|
use namespace::autoclean; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
13
|
|
|
15
|
2
|
|
|
2
|
|
153
|
use YAML::XS; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
114
|
|
|
16
|
2
|
|
|
2
|
|
685
|
use Lab::Moose::Countdown; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
7118
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
extends 'Lab::Moose::Instrument'; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has verbose => ( |
|
21
|
|
|
|
|
|
|
is => 'ro', |
|
22
|
|
|
|
|
|
|
isa => 'Bool', |
|
23
|
|
|
|
|
|
|
default => 1 |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has magnet => ( |
|
27
|
|
|
|
|
|
|
is => 'ro', |
|
28
|
|
|
|
|
|
|
isa => enum( [qw/X Y Z/] ), |
|
29
|
|
|
|
|
|
|
default => 'Z' |
|
30
|
|
|
|
|
|
|
); |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
has heater_delay => ( |
|
33
|
|
|
|
|
|
|
is => 'ro', |
|
34
|
|
|
|
|
|
|
isa => 'Lab::Moose::PosInt', |
|
35
|
|
|
|
|
|
|
default => 60 |
|
36
|
|
|
|
|
|
|
); |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has ATOB => ( |
|
39
|
|
|
|
|
|
|
is => 'ro', |
|
40
|
|
|
|
|
|
|
isa => 'Lab::Moose::PosNum', |
|
41
|
|
|
|
|
|
|
builder => '_build_ATOB', |
|
42
|
|
|
|
|
|
|
lazy => 1, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _build_ATOB { |
|
46
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
|
47
|
1
|
|
|
|
|
38
|
my $magnet = $self->magnet(); |
|
48
|
1
|
|
|
|
|
9
|
return $self->oi_getter( cmd => "READ:DEV:GRP${magnet}:PSU:ATOB" ); |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# default connection options: |
|
52
|
|
|
|
|
|
|
around default_connection_options => sub { |
|
53
|
|
|
|
|
|
|
my $orig = shift; |
|
54
|
|
|
|
|
|
|
my $self = shift; |
|
55
|
|
|
|
|
|
|
my $options = $self->$orig(); |
|
56
|
|
|
|
|
|
|
$options->{Socket}{port} = 7020; |
|
57
|
|
|
|
|
|
|
$options->{Socket}{timeout} = 10; |
|
58
|
|
|
|
|
|
|
return $options; |
|
59
|
|
|
|
|
|
|
}; |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
with 'Lab::Moose::Instrument::OI_Common'; |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub get_catalogue { |
|
65
|
1
|
|
|
1
|
1
|
1214
|
my ( $self, %args ) = validated_getter( \@_ ); |
|
66
|
1
|
|
|
|
|
591
|
return $self->oi_getter( cmd => "READ:SYS:CAT", %args ); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub get_temperature { |
|
71
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( |
|
72
|
|
|
|
|
|
|
\@_, |
|
73
|
|
|
|
|
|
|
channel => { isa => 'Str', default => 'MB1.T1' } |
|
74
|
|
|
|
|
|
|
); |
|
75
|
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
0
|
return $self->get_temperature_channel(%args); |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub get_he_level { |
|
81
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( |
|
82
|
|
|
|
|
|
|
\@_, |
|
83
|
|
|
|
|
|
|
channel => { isa => 'Str', default => 'DB5.L1' } |
|
84
|
|
|
|
|
|
|
); |
|
85
|
0
|
|
|
|
|
0
|
my $channel = delete $args{channel}; |
|
86
|
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
0
|
my $rv |
|
88
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:LVL:SIG:HEL", %args ); |
|
89
|
0
|
|
|
|
|
0
|
$rv =~ s/^LEV://; |
|
90
|
0
|
|
|
|
|
0
|
$rv =~ s/%.*$//; |
|
91
|
0
|
|
|
|
|
0
|
return $rv; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub get_he_level_resistance { |
|
96
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( |
|
97
|
|
|
|
|
|
|
\@_, |
|
98
|
|
|
|
|
|
|
channel => { isa => 'Str', default => 'DB5.L1' } |
|
99
|
|
|
|
|
|
|
); |
|
100
|
0
|
|
|
|
|
0
|
my $channel = delete $args{channel}; |
|
101
|
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
0
|
my $res |
|
103
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:LVL:SIG:HEL", %args ); |
|
104
|
0
|
|
|
|
|
0
|
$res =~ s/^.*:RES://; |
|
105
|
0
|
|
|
|
|
0
|
$res =~ s/O$//; |
|
106
|
0
|
|
|
|
|
0
|
return $res; |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub get_n2_level { |
|
111
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( |
|
112
|
|
|
|
|
|
|
\@_, |
|
113
|
|
|
|
|
|
|
channel => { isa => 'Str', default => 'DB5.L1' } |
|
114
|
|
|
|
|
|
|
); |
|
115
|
0
|
|
|
|
|
0
|
my $channel = delete $args{channel}; |
|
116
|
|
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
0
|
my $level |
|
118
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:LVL:SIG:NIT", %args ); |
|
119
|
0
|
|
|
|
|
0
|
$level =~ s/^.*:LEV://; |
|
120
|
0
|
|
|
|
|
0
|
$level =~ s/%.*$//; |
|
121
|
0
|
|
|
|
|
0
|
return $level; |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub get_n2_level_frequency { |
|
126
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( |
|
127
|
|
|
|
|
|
|
\@_, |
|
128
|
|
|
|
|
|
|
channel => { isa => 'Str', default => 'DB5.L1' } |
|
129
|
|
|
|
|
|
|
); |
|
130
|
0
|
|
|
|
|
0
|
my $channel = delete $args{channel}; |
|
131
|
0
|
|
|
|
|
0
|
my $level |
|
132
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:LVL:SIG:NIT", %args ); |
|
133
|
0
|
|
|
|
|
0
|
$level =~ s/^.*:FREQ://; |
|
134
|
0
|
|
|
|
|
0
|
$level =~ s/:.*$//; |
|
135
|
0
|
|
|
|
|
0
|
return $level; |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub get_n2_level_counter { |
|
139
|
0
|
|
|
0
|
0
|
0
|
my ( $self, %args ) = validated_getter( |
|
140
|
|
|
|
|
|
|
\@_, |
|
141
|
|
|
|
|
|
|
channel => { isa => 'Str', default => 'DB5.L1' } |
|
142
|
|
|
|
|
|
|
); |
|
143
|
0
|
|
|
|
|
0
|
my $channel = delete $args{channel}; |
|
144
|
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
0
|
my $level |
|
146
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:LVL:SIG:NIT", %args ); |
|
147
|
0
|
|
|
|
|
0
|
$level =~ s/^COUN://; |
|
148
|
0
|
|
|
|
|
0
|
$level =~ s/n:.*$//; |
|
149
|
0
|
|
|
|
|
0
|
return $level; |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# |
|
153
|
|
|
|
|
|
|
# now follow the core magnet functions |
|
154
|
|
|
|
|
|
|
# |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
sub validated_magnet_getter { |
|
157
|
9
|
|
|
9
|
0
|
17
|
my $args_ref = shift; |
|
158
|
9
|
|
|
|
|
26
|
my %extra_args = @_; |
|
159
|
9
|
|
|
|
|
41
|
my ( $self, %args ) = validated_getter( |
|
160
|
|
|
|
|
|
|
$args_ref, |
|
161
|
|
|
|
|
|
|
channel => { isa => enum( [qw/X Y Z/] ), optional => 1 }, |
|
162
|
|
|
|
|
|
|
%extra_args, |
|
163
|
|
|
|
|
|
|
); |
|
164
|
9
|
|
33
|
|
|
5832
|
my $channel = delete $args{channel} // $self->magnet(); |
|
165
|
9
|
|
|
|
|
24
|
$channel = "GRP$channel"; |
|
166
|
9
|
|
|
|
|
51
|
return ( $self, $channel, %args ); |
|
167
|
|
|
|
|
|
|
} |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub validated_magnet_setter { |
|
170
|
6
|
|
|
6
|
0
|
2881
|
my $args_ref = shift; |
|
171
|
6
|
|
|
|
|
18
|
my %extra_args = @_; |
|
172
|
6
|
|
|
|
|
26
|
my ( $self, $value, %args ) = validated_setter( |
|
173
|
|
|
|
|
|
|
$args_ref, |
|
174
|
|
|
|
|
|
|
channel => { isa => enum( [qw/X Y Z/] ), optional => 1 }, |
|
175
|
|
|
|
|
|
|
%extra_args, |
|
176
|
|
|
|
|
|
|
); |
|
177
|
|
|
|
|
|
|
|
|
178
|
6
|
|
33
|
|
|
229
|
my $channel = delete $args{channel} // $self->magnet(); |
|
179
|
6
|
|
|
|
|
15
|
$channel = "GRP$channel"; |
|
180
|
6
|
|
|
|
|
34
|
return ( $self, $value, $channel, %args ); |
|
181
|
|
|
|
|
|
|
} |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub oim_get_current { |
|
185
|
2
|
|
|
2
|
1
|
873
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
186
|
|
|
|
|
|
|
|
|
187
|
2
|
|
|
|
|
11
|
my $current |
|
188
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:PSU:SIG:CURR", %args ); |
|
189
|
2
|
|
|
|
|
10
|
$current =~ s/A$//; |
|
190
|
2
|
|
|
|
|
7
|
return $current; |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
sub oim_get_persistent_current { |
|
195
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
196
|
|
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
0
|
my $current |
|
198
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:PSU:SIG:PCUR", %args ); |
|
199
|
0
|
|
|
|
|
0
|
$current =~ s/A$//; |
|
200
|
0
|
|
|
|
|
0
|
return $current; |
|
201
|
|
|
|
|
|
|
} |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub oim_get_field { |
|
205
|
1
|
|
|
1
|
1
|
529
|
my $self = shift; |
|
206
|
1
|
|
|
|
|
4
|
my $current = $self->oim_get_current(@_); |
|
207
|
1
|
|
|
|
|
40
|
my $rv = $current / $self->ATOB(); |
|
208
|
1
|
|
|
|
|
17
|
return sprintf( "%.6f", $rv ); |
|
209
|
|
|
|
|
|
|
} |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub oim_get_persistent_field { |
|
213
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
214
|
0
|
|
|
|
|
0
|
my $current = $self->oim_get_persistent_current(@_); |
|
215
|
|
|
|
|
|
|
|
|
216
|
0
|
|
|
|
|
0
|
my $rv = $current / $self->ATOB(); |
|
217
|
0
|
|
|
|
|
0
|
return sprintf( "%.6f", $rv ); |
|
218
|
|
|
|
|
|
|
} |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub oim_get_heater { |
|
222
|
1
|
|
|
1
|
1
|
5
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
223
|
1
|
|
|
|
|
8
|
return $self->oi_getter( cmd => "READ:DEV:$channel:PSU:SIG:SWHT", %args ); |
|
224
|
|
|
|
|
|
|
} |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
sub oim_set_heater { |
|
228
|
1
|
|
|
1
|
1
|
9
|
my ( $self, $value, $channel, %args ) = validated_magnet_setter( |
|
229
|
|
|
|
|
|
|
\@_, |
|
230
|
|
|
|
|
|
|
value => { isa => enum( [qw/ON OFF/] ) }, |
|
231
|
|
|
|
|
|
|
); |
|
232
|
|
|
|
|
|
|
|
|
233
|
1
|
|
|
|
|
9
|
return $self->oi_setter( |
|
234
|
|
|
|
|
|
|
cmd => "SET:DEV:$channel:PSU:SIG:SWHT", |
|
235
|
|
|
|
|
|
|
value => $value, |
|
236
|
|
|
|
|
|
|
%args |
|
237
|
|
|
|
|
|
|
); |
|
238
|
|
|
|
|
|
|
} |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
sub heater_on { |
|
242
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
243
|
0
|
|
|
|
|
0
|
$self->oim_set_heater( value => 'ON' ); |
|
244
|
0
|
|
|
|
|
0
|
countdown( $self->heater_delay, "OI Mercury heater ON: " ); |
|
245
|
|
|
|
|
|
|
} |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
sub heater_off { |
|
248
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
249
|
0
|
|
|
|
|
0
|
$self->oim_set_heater( value => 'OFF' ); |
|
250
|
0
|
|
|
|
|
0
|
countdown( $self->heater_delay(), "OI Mercury heater OFF: " ); |
|
251
|
|
|
|
|
|
|
} |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub in_persistent_mode { |
|
255
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
256
|
0
|
|
|
|
|
0
|
my $rv = $self->oim_get_heater(@_); |
|
257
|
0
|
0
|
|
|
|
0
|
if ( $rv eq 'ON' ) { |
|
|
|
0
|
|
|
|
|
|
|
258
|
0
|
|
|
|
|
0
|
return; |
|
259
|
|
|
|
|
|
|
} |
|
260
|
|
|
|
|
|
|
elsif ( $rv eq 'OFF' ) { |
|
261
|
0
|
|
|
|
|
0
|
return 1; |
|
262
|
|
|
|
|
|
|
} |
|
263
|
|
|
|
|
|
|
else { |
|
264
|
0
|
|
|
|
|
0
|
croak("unknown heater setting $rv"); |
|
265
|
|
|
|
|
|
|
} |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub oim_force_heater { |
|
270
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $value, $channel, %args ) = validated_magnet_setter( |
|
271
|
|
|
|
|
|
|
\@_, |
|
272
|
|
|
|
|
|
|
value => { isa => enum( [qw/ON OFF/] ) }, |
|
273
|
|
|
|
|
|
|
); |
|
274
|
|
|
|
|
|
|
|
|
275
|
0
|
|
|
|
|
0
|
return $self->oi_setter( |
|
276
|
|
|
|
|
|
|
cmd => "SET:DEV:$channel:PSU:SIG:SWHN", |
|
277
|
|
|
|
|
|
|
value => $value, %args |
|
278
|
|
|
|
|
|
|
); |
|
279
|
|
|
|
|
|
|
} |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
sub oim_get_current_sweeprate { |
|
283
|
2
|
|
|
2
|
1
|
7
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
284
|
|
|
|
|
|
|
|
|
285
|
2
|
|
|
|
|
14
|
my $sweeprate |
|
286
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:PSU:SIG:RCST", %args ); |
|
287
|
2
|
|
|
|
|
10
|
$sweeprate =~ s/A\/m$//; |
|
288
|
2
|
|
|
|
|
19
|
return $sweeprate; |
|
289
|
|
|
|
|
|
|
} |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub oim_set_current_sweeprate { |
|
293
|
2
|
|
|
2
|
1
|
8
|
my ( $self, $value, $channel, %args ) = validated_magnet_setter( \@_ ); |
|
294
|
|
|
|
|
|
|
|
|
295
|
2
|
|
|
|
|
18
|
$value = sprintf( "%.3f", $value ); |
|
296
|
|
|
|
|
|
|
|
|
297
|
2
|
|
|
|
|
12
|
my $rv = $self->oi_setter( |
|
298
|
|
|
|
|
|
|
cmd => "SET:DEV:$channel:PSU:SIG:RCST", |
|
299
|
|
|
|
|
|
|
value => $value, %args |
|
300
|
|
|
|
|
|
|
); |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
# this returns amps per minute |
|
303
|
2
|
|
|
|
|
6
|
$rv =~ s/A\/m$//; |
|
304
|
2
|
|
|
|
|
10
|
return $rv; |
|
305
|
|
|
|
|
|
|
} |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
sub oim_get_field_sweeprate { |
|
309
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
|
310
|
1
|
|
|
|
|
4
|
my $current_sweeprate = $self->oim_get_current_sweeprate(@_); |
|
311
|
1
|
|
|
|
|
38
|
my $rv = $current_sweeprate / $self->ATOB(); |
|
312
|
1
|
|
|
|
|
16
|
return sprintf( "%.6f", $rv ); |
|
313
|
|
|
|
|
|
|
} |
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
sub oim_set_field_sweeprate { |
|
317
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
|
318
|
1
|
|
|
|
|
3
|
my %args = @_; |
|
319
|
1
|
|
|
|
|
4
|
my $value = delete $args{value}; |
|
320
|
1
|
|
|
|
|
41
|
$value = $value * $self->ATOB(); |
|
321
|
1
|
|
|
|
|
7
|
my $rv = $self->oim_set_current_sweeprate( value => $value, %args ); |
|
322
|
1
|
|
|
|
|
38
|
return $rv / $self->ATOB(); |
|
323
|
|
|
|
|
|
|
} |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
sub oim_get_activity { |
|
327
|
1
|
|
|
1
|
1
|
6
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
328
|
1
|
|
|
|
|
9
|
return $self->oi_getter( cmd => "READ:DEV:$channel:PSU:ACTN", %args ); |
|
329
|
|
|
|
|
|
|
} |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
sub oim_set_activity { |
|
333
|
1
|
|
|
1
|
1
|
8
|
my ( $self, $value, $channel, %args ) = validated_magnet_setter( |
|
334
|
|
|
|
|
|
|
\@_, |
|
335
|
|
|
|
|
|
|
value => { isa => enum( [qw/HOLD RTOS RTOZ CLMP/] ) }, |
|
336
|
|
|
|
|
|
|
); |
|
337
|
1
|
|
|
|
|
8
|
return $self->oi_setter( |
|
338
|
|
|
|
|
|
|
cmd => "SET:DEV:$channel:PSU:ACTN", |
|
339
|
|
|
|
|
|
|
value => $value, %args |
|
340
|
|
|
|
|
|
|
); |
|
341
|
|
|
|
|
|
|
} |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
sub oim_set_current_setpoint { |
|
345
|
2
|
|
|
2
|
1
|
10
|
my ( $self, $value, $channel, %args ) = validated_magnet_setter( |
|
346
|
|
|
|
|
|
|
\@_, |
|
347
|
|
|
|
|
|
|
value => { isa => 'Num' }, |
|
348
|
|
|
|
|
|
|
); |
|
349
|
|
|
|
|
|
|
|
|
350
|
2
|
|
|
|
|
19
|
$value = sprintf( "%.4f", $value ); |
|
351
|
|
|
|
|
|
|
|
|
352
|
2
|
|
|
|
|
11
|
my $rv = $self->oi_setter( |
|
353
|
|
|
|
|
|
|
cmd => "SET:DEV:$channel:PSU:SIG:CSET", |
|
354
|
|
|
|
|
|
|
value => $value, %args |
|
355
|
|
|
|
|
|
|
); |
|
356
|
2
|
|
|
|
|
7
|
$rv =~ s/A$//; |
|
357
|
2
|
|
|
|
|
10
|
return $rv; |
|
358
|
|
|
|
|
|
|
} |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
sub oim_get_current_setpoint { |
|
362
|
2
|
|
|
2
|
1
|
10
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
363
|
|
|
|
|
|
|
|
|
364
|
2
|
|
|
|
|
12
|
my $result |
|
365
|
|
|
|
|
|
|
= $self->oi_getter( cmd => "READ:DEV:$channel:PSU:SIG:CSET", %args ); |
|
366
|
2
|
|
|
|
|
16
|
$result =~ s/A$//; |
|
367
|
2
|
|
|
|
|
12
|
return $result; |
|
368
|
|
|
|
|
|
|
} |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
sub oim_set_field_setpoint { |
|
372
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
|
373
|
1
|
|
|
|
|
5
|
my %args = @_; |
|
374
|
1
|
|
|
|
|
4
|
my $value = delete $args{value}; |
|
375
|
|
|
|
|
|
|
|
|
376
|
1
|
|
|
|
|
43
|
$value = $value * $self->ATOB(); |
|
377
|
|
|
|
|
|
|
|
|
378
|
1
|
|
|
|
|
8
|
my $rv = $self->oim_set_current_setpoint( value => $value, %args ); |
|
379
|
|
|
|
|
|
|
|
|
380
|
1
|
|
|
|
|
37
|
$rv = $rv / $self->ATOB(); |
|
381
|
1
|
|
|
|
|
12
|
return sprintf( "%.6f", $rv ); |
|
382
|
|
|
|
|
|
|
} |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
sub oim_get_field_setpoint { |
|
386
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
|
387
|
|
|
|
|
|
|
|
|
388
|
1
|
|
|
|
|
5
|
my $rv = $self->oim_get_current_setpoint(@_); |
|
389
|
|
|
|
|
|
|
|
|
390
|
1
|
|
|
|
|
37
|
return $rv / $self->ATOB(); |
|
391
|
|
|
|
|
|
|
} |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
sub oim_get_fieldconstant { |
|
395
|
1
|
|
|
1
|
1
|
8
|
my ( $self, $channel, %args ) = validated_magnet_getter( \@_ ); |
|
396
|
1
|
|
|
|
|
10
|
return $self->oi_getter( cmd => "READ:DEV:$channel:PSU:ATOB", %args ); |
|
397
|
|
|
|
|
|
|
} |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
sub field_step { |
|
401
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
402
|
0
|
|
|
|
|
0
|
return 1e-4 / $self->oim_get_fieldconstant(@_); |
|
403
|
|
|
|
|
|
|
} |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
############### XPRESS interface ##################### |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
has device_settings => |
|
408
|
|
|
|
|
|
|
( is => 'ro', isa => 'HashRef', builder => 'build_device_settings' ); |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
has max_field_deviation => ( is => 'ro', isa => 'Num', default => 0.0001 ); |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
sub build_device_settings { |
|
413
|
|
|
|
|
|
|
return { |
|
414
|
1
|
|
|
1
|
0
|
40
|
has_switchheater => 0, # for now |
|
415
|
|
|
|
|
|
|
}; |
|
416
|
|
|
|
|
|
|
} |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
sub get_field { |
|
419
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
420
|
0
|
|
|
|
|
|
return $self->oim_get_field(@_); |
|
421
|
|
|
|
|
|
|
} |
|
422
|
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
sub get_persistent_field { |
|
424
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
425
|
0
|
|
|
|
|
|
return $self->oim_get_persistent_field(@_); |
|
426
|
|
|
|
|
|
|
} |
|
427
|
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
sub sweep_to_field { |
|
429
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = validated_getter( |
|
430
|
|
|
|
|
|
|
\@_, |
|
431
|
|
|
|
|
|
|
target => { isa => 'Num' }, |
|
432
|
|
|
|
|
|
|
rate => { isa => 'Num' }, |
|
433
|
|
|
|
|
|
|
); |
|
434
|
|
|
|
|
|
|
|
|
435
|
0
|
|
|
|
|
|
my $point = delete $args{target}; |
|
436
|
0
|
|
|
|
|
|
my $rate = delete $args{rate}; |
|
437
|
|
|
|
|
|
|
|
|
438
|
0
|
|
|
|
|
|
$self->config_sweep( point => $point, rate => $rate, %args ); |
|
439
|
|
|
|
|
|
|
|
|
440
|
0
|
|
|
|
|
|
$self->trg(%args); |
|
441
|
|
|
|
|
|
|
|
|
442
|
0
|
|
|
|
|
|
$self->wait(%args); |
|
443
|
|
|
|
|
|
|
|
|
444
|
0
|
|
|
|
|
|
return $self->oim_get_field(%args); |
|
445
|
|
|
|
|
|
|
} |
|
446
|
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
sub config_sweep { |
|
448
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = validated_hash( |
|
449
|
|
|
|
|
|
|
\@_, |
|
450
|
|
|
|
|
|
|
point => { isa => 'Num' }, |
|
451
|
|
|
|
|
|
|
rate => { isa => 'Num' }, |
|
452
|
|
|
|
|
|
|
); |
|
453
|
0
|
|
|
|
|
|
my $target = delete $args{point}; |
|
454
|
0
|
|
|
|
|
|
my $rate = delete $args{rate}; |
|
455
|
|
|
|
|
|
|
|
|
456
|
0
|
|
|
|
|
|
my $setrate = $self->oim_set_field_sweeprate( value => $rate, %args ); |
|
457
|
0
|
|
|
|
|
|
my $setpoint = $self->oim_set_field_setpoint( value => $target, %args ); |
|
458
|
0
|
0
|
|
|
|
|
if ( $self->verbose() ) { |
|
459
|
0
|
|
|
|
|
|
say "config_sweep: setpoint: $setpoint (T), rate: $setrate (T/min)"; |
|
460
|
|
|
|
|
|
|
} |
|
461
|
|
|
|
|
|
|
} |
|
462
|
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
# In go_to_next_step, the XPRESS will call the sequence |
|
464
|
|
|
|
|
|
|
# config_sweep(...); |
|
465
|
|
|
|
|
|
|
# trg(); |
|
466
|
|
|
|
|
|
|
# wait(); |
|
467
|
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
sub trg { |
|
469
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = validated_getter( \@_ ); |
|
470
|
0
|
|
|
|
|
|
$self->oim_set_activity( value => 'RTOS', %args ); |
|
471
|
|
|
|
|
|
|
} |
|
472
|
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
sub wait { |
|
474
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = validated_getter( \@_ ); |
|
475
|
0
|
|
|
|
|
|
my $target = $self->oim_get_field_setpoint(%args); |
|
476
|
0
|
|
|
|
|
|
my $verbose = $self->verbose(); |
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
# enable autoflush |
|
479
|
0
|
|
|
|
|
|
my $autoflush = STDOUT->autoflush(); |
|
480
|
0
|
|
|
|
|
|
my $last_field; |
|
481
|
0
|
|
|
|
|
|
my $time_step = 1; |
|
482
|
0
|
|
|
|
|
|
while (1) { |
|
483
|
0
|
|
|
|
|
|
sleep $time_step; |
|
484
|
0
|
|
|
|
|
|
my $field = $self->oim_get_field(%args); |
|
485
|
|
|
|
|
|
|
|
|
486
|
0
|
0
|
|
|
|
|
if ($verbose) { |
|
487
|
0
|
|
|
|
|
|
my $rate; |
|
488
|
0
|
0
|
|
|
|
|
if ( defined $last_field ) { |
|
489
|
0
|
|
|
|
|
|
$rate = ( $field - $last_field ) * 60 / $time_step; |
|
490
|
0
|
|
|
|
|
|
$rate = sprintf( "%.5g", $rate ); |
|
491
|
|
|
|
|
|
|
} |
|
492
|
|
|
|
|
|
|
else { |
|
493
|
0
|
|
|
|
|
|
$rate = "unknown"; |
|
494
|
|
|
|
|
|
|
} |
|
495
|
0
|
|
|
|
|
|
printf( |
|
496
|
|
|
|
|
|
|
"Field: %.6e T, Estimated rate: $rate T/min \r", |
|
497
|
|
|
|
|
|
|
$field |
|
498
|
|
|
|
|
|
|
); |
|
499
|
0
|
|
|
|
|
|
$last_field = $field; |
|
500
|
|
|
|
|
|
|
} |
|
501
|
|
|
|
|
|
|
|
|
502
|
0
|
0
|
|
|
|
|
if ( abs( $field - $target ) < $self->max_field_deviation() ) { |
|
503
|
0
|
|
|
|
|
|
last; |
|
504
|
|
|
|
|
|
|
} |
|
505
|
|
|
|
|
|
|
} |
|
506
|
|
|
|
|
|
|
|
|
507
|
0
|
0
|
|
|
|
|
if ($verbose) { |
|
508
|
0
|
|
|
|
|
|
print " " x 70 . "\r"; |
|
509
|
|
|
|
|
|
|
} |
|
510
|
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
# reset autoflush to previous value |
|
512
|
0
|
|
|
|
|
|
STDOUT->autoflush($autoflush); |
|
513
|
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
} |
|
515
|
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
sub active { |
|
517
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
518
|
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
# with the legacy command set, one could use the "X" command to find |
|
520
|
|
|
|
|
|
|
# whether the magnet has finshed the sweep |
|
521
|
|
|
|
|
|
|
# We do it manually by comparing field and setpoint. |
|
522
|
0
|
|
|
|
|
|
my $field = $self->oim_get_field(); |
|
523
|
0
|
|
|
|
|
|
my $target = $self->oim_get_field_setpoint(); |
|
524
|
0
|
0
|
|
|
|
|
if ( abs( $field - $target ) < $self->max_field_deviation() ) { |
|
525
|
0
|
|
|
|
|
|
return 0; |
|
526
|
|
|
|
|
|
|
} |
|
527
|
|
|
|
|
|
|
else { |
|
528
|
0
|
|
|
|
|
|
return 1; |
|
529
|
|
|
|
|
|
|
} |
|
530
|
|
|
|
|
|
|
} |
|
531
|
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
sub exit { |
|
533
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = validated_getter( \@_ ); |
|
534
|
0
|
|
|
|
|
|
$self->oim_set_activity( value => 'HOLD', %args ); |
|
535
|
|
|
|
|
|
|
} |
|
536
|
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
|
538
|
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
1; |
|
540
|
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
__END__ |
|
542
|
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
=pod |
|
544
|
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
=encoding UTF-8 |
|
546
|
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
=head1 NAME |
|
548
|
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
Lab::Moose::Instrument::OI_Mercury::Magnet - Oxford Instruments Mercury magnet power supply |
|
550
|
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
=head1 VERSION |
|
552
|
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
version 3.900 |
|
554
|
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
556
|
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
use Lab::Moose; |
|
558
|
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
my $magnet = instrument( |
|
560
|
|
|
|
|
|
|
type => 'OI_Mercury::Magnet', |
|
561
|
|
|
|
|
|
|
connection_type => 'Socket', |
|
562
|
|
|
|
|
|
|
connection_options => {host => '192.168.3.15'}, |
|
563
|
|
|
|
|
|
|
magnet => 'X', # 'X', 'Y' or 'Z'. default is 'Z' |
|
564
|
|
|
|
|
|
|
); |
|
565
|
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
say "He level (%): ", $magnet->get_he_level(); |
|
567
|
|
|
|
|
|
|
say "N2 level (%): ", $magnet->get_n2_level(); |
|
568
|
|
|
|
|
|
|
say "temperature: ", $magnet->get_temperature(); |
|
569
|
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
$magnet->oim_set_heater(value => 'ON'); |
|
571
|
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
say "Current field (T): ", $magnet->get_field(); |
|
573
|
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
# Sweep to 0.1 T with rate of 1 T/min |
|
575
|
|
|
|
|
|
|
$magnet->sweep_to_field(target => 0.1, rate => 1); |
|
576
|
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
See also an L<example|https://github.com/lab-measurement/Lab-Measurement/blob/master/examples/RealWorld/level-plot.pl> of a He/N2 level plotter. |
|
578
|
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
=head1 METHODS |
|
580
|
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
The default names for the used board names are as follows. You can |
|
582
|
|
|
|
|
|
|
get the values for your instrument with the C<get_catalogue> method |
|
583
|
|
|
|
|
|
|
and use the methods with the C<channel> argument. |
|
584
|
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
=over |
|
586
|
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
=item * |
|
588
|
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
Temperature measurement: B<MB1.T1>. |
|
590
|
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
=item * |
|
592
|
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
Level meter: B<DB5.L1> |
|
594
|
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
=item * |
|
596
|
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
Magnet: B<Z> (use DEV:GRPZ:PSU) |
|
598
|
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
The default can be changed to B<X> or B<Y> with the C<magnet> attribute in |
|
600
|
|
|
|
|
|
|
the constructor as shown in SYNOPSIS. |
|
601
|
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
=back |
|
603
|
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
=head2 get_catalogue |
|
605
|
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
$mcat = $m->get_catalogue(); |
|
607
|
|
|
|
|
|
|
print "$mcat\n"; |
|
608
|
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
Returns the hardware configuration of the Mercury system. A typical response would be |
|
610
|
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
DEV:GRPX:PSU:DEV:MB1.T1:TEMP:DEV:GRPY:PSU:DEV:GRPZ:PSU:DEV:PSU.M1:PSU:DEV:PSU.M2:PSU:DEV:GRPN:PSU:DEV:DB5.L1:LVL |
|
612
|
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
Here, each group starting with "DEV:" describes one hardware component. |
|
614
|
|
|
|
|
|
|
In this case, we obtain for example: |
|
615
|
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
DEV:GRPX:PSU | |
|
617
|
|
|
|
|
|
|
DEV:GRPY:PSU |- a 3-axis magnet power supply unit |
|
618
|
|
|
|
|
|
|
DEV:GRPZ:PSU | |
|
619
|
|
|
|
|
|
|
DEV:MB1.T1:TEMP -- a temperature sensor |
|
620
|
|
|
|
|
|
|
DEV:DB5.L1:LVL -- a cryoliquid level sensor |
|
621
|
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
In each of these blocks, the second component after "DEV:" is the UID of the device; |
|
623
|
|
|
|
|
|
|
it can be used in other commands such as get_level to address it. |
|
624
|
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
=head2 get_temperature |
|
626
|
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
$t = $m->get_temperature(); |
|
628
|
|
|
|
|
|
|
$t = $m->get_temperature(channel => 'MB1.T1'); # default channel is 'MB1.T1' |
|
629
|
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
Read out the designated temperature channel. Result is in Kelvin. |
|
631
|
|
|
|
|
|
|
|
|
632
|
|
|
|
|
|
|
=head2 get_he_level |
|
633
|
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
$level = $m->get_he_level(channel => 'DB5.L1'); |
|
635
|
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
Read out the designated liquid helium level meter. Result is in percent as calibrated. |
|
637
|
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
=head2 get_he_level_resistance |
|
639
|
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
$res = $m->get_he_level_resistance(channel => 'DB5.L1'); |
|
641
|
|
|
|
|
|
|
|
|
642
|
|
|
|
|
|
|
Read out the designated liquid helium level meter. Result is the raw sensor resistance. |
|
643
|
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
=head2 get_n2_level |
|
645
|
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
$level = $m->get_n2_level(channel => 'DB5.L1'); |
|
647
|
|
|
|
|
|
|
|
|
648
|
|
|
|
|
|
|
Read out the designated liquid nitrogen level meter. Result is in percent as calibrated. |
|
649
|
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
=head2 get_n2_level_frequency |
|
651
|
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
$frq = $m->get_n2_level_frequency(channel => 'DB5.L1'); |
|
653
|
|
|
|
|
|
|
|
|
654
|
|
|
|
|
|
|
Read out the designated liquid nitrogen level meter. Result is the raw internal frequency value. |
|
655
|
|
|
|
|
|
|
|
|
656
|
|
|
|
|
|
|
=head2 oim_get_current |
|
657
|
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
$curr = $m->oim_get_current(); |
|
659
|
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
Reads out the momentary current of the PSU in Ampere. |
|
661
|
|
|
|
|
|
|
|
|
662
|
|
|
|
|
|
|
TODO: what happens if we're in persistent mode? |
|
663
|
|
|
|
|
|
|
|
|
664
|
|
|
|
|
|
|
=head2 oim_get_persistent_current |
|
665
|
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
$field = $m->oim_get_persistent_current(); |
|
667
|
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
Read PSU current for persistent mode in Amps. |
|
669
|
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
=head2 oim_get_field |
|
671
|
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
$field = $m->oim_get_field(); |
|
673
|
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
Read PSU field in Tesla. |
|
675
|
|
|
|
|
|
|
Internally, this uses oim_get_current and calculates the field with the A-to-B factor. |
|
676
|
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
Returns 0 when in persistent mode. |
|
678
|
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
=head2 oim_get_persistent_field |
|
680
|
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
$field = $m->oim_get_persistent_field(); |
|
682
|
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
Read PSU field for persistent mode in Tesla. |
|
684
|
|
|
|
|
|
|
Internally, this uses oim_get_persistent_current and calculates the field with the A-to-B factor. |
|
685
|
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
=head2 oim_get_heater |
|
687
|
|
|
|
|
|
|
|
|
688
|
|
|
|
|
|
|
$t = $m->oim_get_heater(); |
|
689
|
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
Returns the persistent mode switch heater status as B<ON> or B<OFF>. |
|
691
|
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
=head2 oim_set_heater |
|
693
|
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
$m->oim_set_heater(value => 'ON'); |
|
695
|
|
|
|
|
|
|
$m->oim_set_heater(value => 'OFF'); |
|
696
|
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
Switches the persistent mode switch heater. |
|
698
|
|
|
|
|
|
|
Nothing happens if the power supply thinks the magnet current and the lead current are different. |
|
699
|
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
=head2 heater_on/heater_off |
|
701
|
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
$m->heater_on(); |
|
703
|
|
|
|
|
|
|
$m->heater_off(); |
|
704
|
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
Enable/disable switch heater. Wait for 60s after changing the state of the |
|
706
|
|
|
|
|
|
|
heater. |
|
707
|
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
=head2 in_persistent_mode |
|
709
|
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
if ($m->in_persistent_mode()) { |
|
711
|
|
|
|
|
|
|
... |
|
712
|
|
|
|
|
|
|
} |
|
713
|
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
Return 1 if in persistent mode; otherwise return false. |
|
715
|
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
=head2 oim_force_heater |
|
717
|
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
Switches the persistent mode switch heater. Parameter is "ON" or "OFF". |
|
719
|
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
Dangerous. Works also if magnet and lead current are differing. |
|
721
|
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
=head2 oim_get_current_sweeprate |
|
723
|
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
$rate = $m->oim_get_current_sweeprate(); |
|
725
|
|
|
|
|
|
|
|
|
726
|
|
|
|
|
|
|
Gets the current target sweep rate (i.e., the sweep rate with which we want to |
|
727
|
|
|
|
|
|
|
go to the target; may be bigger than the actual rate if it is hardware limited), |
|
728
|
|
|
|
|
|
|
in Ampere per minute. |
|
729
|
|
|
|
|
|
|
|
|
730
|
|
|
|
|
|
|
=head2 oim_set_current_sweeprate |
|
731
|
|
|
|
|
|
|
|
|
732
|
|
|
|
|
|
|
$m->oim_set_current_sweeprate(value => 0.01); |
|
733
|
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
Sets the desired target sweep rate, parameter is in Amperes per minute. |
|
735
|
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
=head2 oim_get_field_sweeprate |
|
737
|
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
$rate = $m->oim_get_field_sweeprate(); |
|
739
|
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
Get sweep rate (Tesla/min). |
|
741
|
|
|
|
|
|
|
|
|
742
|
|
|
|
|
|
|
=head2 oim_set_field_sweeprate |
|
743
|
|
|
|
|
|
|
|
|
744
|
|
|
|
|
|
|
$rate_setpoint = $m->oim_set_field_sweeprate(value => 0.001); # 1mT / min |
|
745
|
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
Set sweep rate (Tesla/min). |
|
747
|
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
=head2 oim_get_activity |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
Retrieves the current power supply activity. See oim_set_activity for values. |
|
751
|
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
=head2 oim_set_activity |
|
753
|
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
$m->oim_set_activity(value => 'HOLD'); |
|
755
|
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
Sets the current activity of the power supply. Values are: |
|
757
|
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
HOLD - hold current |
|
759
|
|
|
|
|
|
|
RTOS - ramp to set point |
|
760
|
|
|
|
|
|
|
RTOZ - ramp to zero |
|
761
|
|
|
|
|
|
|
CLMP - clamp output if current is zero |
|
762
|
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
=head2 oim_set_current_setpoint |
|
764
|
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
$setpoint = $m->oim_set_current_setpoint(value => 0.001); |
|
766
|
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
Sets the current set point in Ampere. |
|
768
|
|
|
|
|
|
|
|
|
769
|
|
|
|
|
|
|
=head2 oim_get_current_setpoint |
|
770
|
|
|
|
|
|
|
|
|
771
|
|
|
|
|
|
|
$sp = $m->oim_get_current_setpoint(); |
|
772
|
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
Get the current set point in Ampere. |
|
774
|
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
=head2 oim_set_field_setpoint |
|
776
|
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
$m->oim_set_field_setpoint(value => 0.01); # 10 mT |
|
778
|
|
|
|
|
|
|
|
|
779
|
|
|
|
|
|
|
Set the field setpoint in Tesla. |
|
780
|
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
=head2 oim_get_field_setpoint |
|
782
|
|
|
|
|
|
|
|
|
783
|
|
|
|
|
|
|
$sp = $m->oim_get_field_setpoint(); |
|
784
|
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
Get the field setpoint in Tesla. |
|
786
|
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
=head2 oim_get_fieldconstant |
|
788
|
|
|
|
|
|
|
|
|
789
|
|
|
|
|
|
|
Returns the current to field factor (A/T) |
|
790
|
|
|
|
|
|
|
|
|
791
|
|
|
|
|
|
|
=head2 field_step |
|
792
|
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
Return the minimum field stepwidth of the magnet |
|
794
|
|
|
|
|
|
|
|
|
795
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
796
|
|
|
|
|
|
|
|
|
797
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
|
798
|
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
Copyright 2017 Simon Reinhardt |
|
800
|
|
|
|
|
|
|
2018 Andreas K. Huettel, Simon Reinhardt |
|
801
|
|
|
|
|
|
|
2019 Simon Reinhardt |
|
802
|
|
|
|
|
|
|
2020 Andreas K. Huettel, Simon Reinhardt |
|
803
|
|
|
|
|
|
|
2021-2022 Simon Reinhardt |
|
804
|
|
|
|
|
|
|
|
|
805
|
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
807
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
808
|
|
|
|
|
|
|
|
|
809
|
|
|
|
|
|
|
=cut |