line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::SR830; |
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::SR830::VERSION = '3.900'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Stanford Research SR830 Lock-In Amplifier |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
3857
|
use v5.20; |
|
2
|
|
|
|
|
8
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
11
|
use Moose; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
8
|
2
|
|
|
2
|
|
14483
|
use Moose::Util::TypeConstraints qw/enum/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
23
|
|
9
|
2
|
|
|
2
|
|
934
|
use MooseX::Params::Validate; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
20
|
|
10
|
2
|
|
|
|
|
140
|
use Lab::Moose::Instrument qw/ |
11
|
2
|
|
|
2
|
|
986
|
validated_getter validated_setter setter_params /; |
|
2
|
|
|
|
|
5
|
|
12
|
2
|
|
|
2
|
|
488
|
use Lab::Moose::Instrument::Cache; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
16
|
|
13
|
2
|
|
|
2
|
|
1237
|
use Carp; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
129
|
|
14
|
2
|
|
|
2
|
|
21
|
use namespace::autoclean; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
15
|
2
|
|
|
2
|
|
178
|
use POSIX qw/log10 ceil floor/; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
21
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
extends 'Lab::Moose::Instrument'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
with qw( |
20
|
|
|
|
|
|
|
Lab::Moose::Instrument::Common |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has empty_buffer_count => |
24
|
|
|
|
|
|
|
( is => 'ro', isa => 'Lab::Moose::PosInt', default => 1 ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub BUILD { |
27
|
1
|
|
|
1
|
0
|
6
|
my $self = shift; |
28
|
1
|
|
|
|
|
8
|
$self->clear(); |
29
|
1
|
|
|
|
|
5
|
$self->cls(); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# When killing a script with Ctrl-C, garbage might remain in the output |
32
|
|
|
|
|
|
|
# buffer. Try read and catch possible timeout exception with eval. |
33
|
1
|
|
|
|
|
37
|
for ( 1 .. $self->empty_buffer_count ) { |
34
|
0
|
|
|
|
|
0
|
eval { $self->read( timeout => 1 ); }; |
|
0
|
|
|
|
|
0
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
cache frq => ( getter => 'get_frq' ); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub get_frq { |
42
|
4
|
|
|
4
|
1
|
1881
|
my ( $self, %args ) = validated_getter( \@_ ); |
43
|
4
|
|
|
|
|
2019
|
return $self->cached_frq( $self->query( command => 'FREQ?', %args ) ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub set_frq { |
47
|
4
|
|
|
4
|
1
|
10174
|
my ( $self, $value, %args ) = validated_setter( |
48
|
|
|
|
|
|
|
\@_, |
49
|
|
|
|
|
|
|
value => { isa => 'Num' } |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
4
|
|
|
|
|
25
|
$self->write( command => "FREQ $value", %args ); |
53
|
4
|
|
|
|
|
19
|
$self->cached_frq($value); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
cache amplitude => ( getter => 'get_amplitude' ); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub get_amplitude { |
60
|
5
|
|
|
5
|
1
|
2181
|
my ( $self, %args ) = validated_getter( \@_ ); |
61
|
5
|
|
|
|
|
2551
|
return $self->cached_amplitude( |
62
|
|
|
|
|
|
|
$self->query( command => 'SLVL?', %args ) ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub set_amplitude { |
66
|
5
|
|
|
5
|
1
|
6187
|
my ( $self, $value, %args ) = validated_setter( |
67
|
|
|
|
|
|
|
\@_, |
68
|
|
|
|
|
|
|
value => { isa => 'Num' } |
69
|
|
|
|
|
|
|
); |
70
|
5
|
|
|
|
|
29
|
$self->write( command => "SLVL $value", %args ); |
71
|
5
|
|
|
|
|
32
|
$self->cached_amplitude($value); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
cache phase => ( getter => 'get_phase' ); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub get_phase { |
78
|
6
|
|
|
6
|
1
|
2644
|
my ( $self, %args ) = validated_getter( \@_ ); |
79
|
6
|
|
|
|
|
3013
|
return $self->cached_phase( $self->query( command => 'PHAS?', %args ) ); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub set_phase { |
83
|
6
|
|
|
6
|
1
|
6218
|
my ( $self, $value, %args ) = validated_setter( |
84
|
|
|
|
|
|
|
\@_, |
85
|
|
|
|
|
|
|
value => { isa => 'Num' } |
86
|
|
|
|
|
|
|
); |
87
|
|
|
|
|
|
|
|
88
|
6
|
50
|
33
|
|
|
42
|
if ( $value < -360 || $value > 729.98 ) { |
89
|
0
|
|
|
|
|
0
|
croak "$value is not in allowed range of phase: [-360, 729.99] deg."; |
90
|
|
|
|
|
|
|
} |
91
|
6
|
|
|
|
|
35
|
$self->write( command => "PHAS $value", %args ); |
92
|
6
|
|
|
|
|
30
|
$self->cached_phase($value); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub get_xy { |
97
|
1
|
|
|
1
|
1
|
19
|
my ( $self, %args ) = validated_getter( \@_ ); |
98
|
1
|
|
|
|
|
723
|
my $retval = $self->query( command => "SNAP?1,2", %args ); |
99
|
1
|
|
|
|
|
8
|
my ( $x, $y ) = split( ',', $retval ); |
100
|
1
|
|
|
|
|
4
|
chomp $y; |
101
|
1
|
|
|
|
|
12
|
return { x => $x, y => $y }; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub get_rphi { |
105
|
1
|
|
|
1
|
1
|
672
|
my ( $self, %args ) = validated_getter( \@_ ); |
106
|
1
|
|
|
|
|
503
|
my $retval = $self->query( command => "SNAP?3,4", %args ); |
107
|
1
|
|
|
|
|
5
|
my ( $r, $phi ) = split( ',', $retval ); |
108
|
1
|
|
|
|
|
3
|
chomp $phi; |
109
|
1
|
|
|
|
|
9
|
return { r => $r, phi => $phi }; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub get_xyrphi { |
113
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( \@_ ); |
114
|
0
|
|
|
|
|
0
|
my $retval = $self->query( command => "SNAP?1,2,3,4", %args ); |
115
|
0
|
|
|
|
|
0
|
my ( $x, $y, $r, $phi ) = split( ',', $retval ); |
116
|
0
|
|
|
|
|
0
|
chomp( $x, $y, $r, $phi ); |
117
|
0
|
|
|
|
|
0
|
return { x => $x, y => $y, r => $r, phi => $phi }; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
cache tc => ( getter => 'get_tc' ); |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub _int_to_tc { |
124
|
14
|
|
|
14
|
|
24
|
my $self = shift; |
125
|
14
|
|
|
|
|
65
|
my ($int_tc) = pos_validated_list( \@_, { isa => 'Int' } ); |
126
|
2
|
|
|
2
|
|
2071
|
use integer; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
27
|
|
127
|
14
|
|
|
|
|
2354
|
my $exponent = $int_tc / 2 - 5; |
128
|
2
|
|
|
2
|
|
90
|
no integer; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
25
|
|
129
|
|
|
|
|
|
|
|
130
|
14
|
|
|
|
|
43
|
my $tc = 10**($exponent); |
131
|
|
|
|
|
|
|
|
132
|
14
|
100
|
|
|
|
44
|
if ( $int_tc % 2 ) { |
133
|
4
|
|
|
|
|
8
|
$tc *= 3; |
134
|
|
|
|
|
|
|
} |
135
|
14
|
|
|
|
|
62
|
return $tc; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub get_tc { |
139
|
6
|
|
|
6
|
1
|
2613
|
my ( $self, %args ) = validated_getter( \@_ ); |
140
|
6
|
|
|
|
|
3048
|
my $int_tc = $self->query( command => 'OFLT?', %args ); |
141
|
6
|
|
|
|
|
18
|
return $self->cached_tc( $self->_int_to_tc($int_tc) ); |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub set_tc { |
145
|
8
|
|
|
8
|
1
|
9528
|
my ( $self, $tc, %args ) = validated_setter( |
146
|
|
|
|
|
|
|
\@_, |
147
|
|
|
|
|
|
|
value => { isa => 'Num' } |
148
|
|
|
|
|
|
|
); |
149
|
|
|
|
|
|
|
|
150
|
8
|
|
|
|
|
61
|
my $logval = log10($tc); |
151
|
8
|
|
|
|
|
29
|
my $n = floor($logval); |
152
|
8
|
|
|
|
|
18
|
my $rest = $logval - $n; |
153
|
8
|
|
|
|
|
20
|
my $int_tc = 2 * $n + 10; |
154
|
|
|
|
|
|
|
|
155
|
8
|
50
|
|
|
|
46
|
if ( $rest > log10(6.5) ) { |
|
|
100
|
|
|
|
|
|
156
|
0
|
|
|
|
|
0
|
$int_tc += 2; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
elsif ( $rest > log10(2) ) { |
159
|
2
|
|
|
|
|
6
|
$int_tc += 1; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
8
|
50
|
|
|
|
23
|
if ( $int_tc < 0 ) { |
163
|
0
|
|
|
|
|
0
|
croak "minimum value for time constant is 1e-5"; |
164
|
|
|
|
|
|
|
} |
165
|
8
|
50
|
|
|
|
18
|
if ( $int_tc > 19 ) { |
166
|
0
|
|
|
|
|
0
|
croak "maximum value for time constant is 30000"; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
8
|
|
|
|
|
48
|
$self->write( command => "OFLT $int_tc", %args ); |
170
|
8
|
|
|
|
|
38
|
$self->cached_tc( $self->_int_to_tc($int_tc) ); |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
cache filter_slope => ( getter => 'get_filter_slope' ); |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub get_filter_slope { |
177
|
4
|
|
|
4
|
1
|
1929
|
my ( $self, %args ) = validated_getter( \@_ ); |
178
|
4
|
|
|
|
|
2044
|
my $filter_slope = $self->query( command => 'OFSL?', %args ); |
179
|
|
|
|
|
|
|
|
180
|
4
|
|
|
|
|
20
|
my %filter_slopes = ( 0 => 6, 1 => 12, 2 => 18, 3 => 24 ); |
181
|
|
|
|
|
|
|
|
182
|
4
|
|
|
|
|
19
|
return $self->cached_filter_slope( $filter_slopes{$filter_slope} ); |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub set_filter_slope { |
186
|
6
|
|
|
6
|
1
|
5410
|
my ( $self, $value, %args ) = validated_setter( |
187
|
|
|
|
|
|
|
\@_, |
188
|
|
|
|
|
|
|
value => { isa => enum( [qw/6 12 18 24/] ) } |
189
|
|
|
|
|
|
|
); |
190
|
6
|
|
|
|
|
32
|
my %filter_slopes = ( 6 => 0, 12 => 1, 18 => 2, 24 => 3 ); |
191
|
6
|
|
|
|
|
15
|
my $filter_slope = $filter_slopes{$value}; |
192
|
6
|
|
|
|
|
36
|
$self->write( command => "OFSL $filter_slope", %args ); |
193
|
6
|
|
|
|
|
32
|
$self->cached_filter_slope($value); |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
sub _int_to_sens { |
198
|
17
|
|
|
17
|
|
33
|
my $self = shift; |
199
|
17
|
|
|
|
|
70
|
my ($int_sens) = pos_validated_list( \@_, { isa => 'Int' } ); |
200
|
|
|
|
|
|
|
|
201
|
17
|
|
|
|
|
2776
|
++$int_sens; |
202
|
|
|
|
|
|
|
|
203
|
2
|
|
|
2
|
|
1165
|
use integer; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
204
|
17
|
|
|
|
|
45
|
my $exponent = $int_sens / 3 - 9; |
205
|
2
|
|
|
2
|
|
78
|
no integer; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
18
|
|
206
|
|
|
|
|
|
|
|
207
|
17
|
|
|
|
|
54
|
my $sens = 10**($exponent); |
208
|
|
|
|
|
|
|
|
209
|
17
|
100
|
|
|
|
67
|
if ( $int_sens % 3 == 1 ) { |
|
|
100
|
|
|
|
|
|
210
|
4
|
|
|
|
|
11
|
$sens *= 2; |
211
|
|
|
|
|
|
|
} |
212
|
|
|
|
|
|
|
elsif ( $int_sens % 3 == 2 ) { |
213
|
7
|
|
|
|
|
16
|
$sens *= 5; |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
17
|
|
|
|
|
70
|
return $sens; |
217
|
|
|
|
|
|
|
} |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub _sens_to_int { |
220
|
9
|
|
|
9
|
|
17
|
my $self = shift; |
221
|
9
|
|
|
|
|
38
|
my ($sens) = pos_validated_list( \@_, { isa => 'Lab::Moose::PosNum' } ); |
222
|
9
|
|
|
|
|
178
|
my $logval = log10($sens); |
223
|
9
|
|
|
|
|
24
|
my $n = floor($logval); |
224
|
9
|
|
|
|
|
19
|
my $rest = $logval - $n; |
225
|
9
|
|
|
|
|
26
|
my $int_sens = 3 * $n + 26; |
226
|
|
|
|
|
|
|
|
227
|
9
|
50
|
|
|
|
58
|
if ( $rest > log10(7.5) ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
228
|
0
|
|
|
|
|
0
|
$int_sens += 3; |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
elsif ( $rest > log10(3.5) ) { |
231
|
4
|
|
|
|
|
8
|
$int_sens += 2; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
elsif ( $rest > log10(1.5) ) { |
234
|
2
|
|
|
|
|
5
|
$int_sens += 1; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
9
|
50
|
|
|
|
26
|
if ( $int_sens < 0 ) { |
238
|
0
|
|
|
|
|
0
|
croak "minimum value for sensitivity is 2nV"; |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
9
|
50
|
|
|
|
22
|
if ( $int_sens > 26 ) { |
242
|
0
|
|
|
|
|
0
|
croak "maximum value for sensitivity is 1V"; |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
9
|
|
|
|
|
20
|
return $int_sens; |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
cache sens => ( getter => 'get_sens' ); |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub get_sens { |
251
|
8
|
|
|
8
|
1
|
4661
|
my ( $self, %args ) = validated_getter( \@_ ); |
252
|
8
|
|
|
|
|
4154
|
my $int_sens = $self->query( command => 'SENS?', %args ); |
253
|
8
|
|
|
|
|
26
|
return $self->cached_sens( $self->_int_to_sens($int_sens) ); |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
sub set_sens { |
257
|
9
|
|
|
9
|
1
|
11401
|
my ( $self, $sens, %args ) = validated_setter( |
258
|
|
|
|
|
|
|
\@_, |
259
|
|
|
|
|
|
|
value => { isa => 'Num' } |
260
|
|
|
|
|
|
|
); |
261
|
|
|
|
|
|
|
|
262
|
9
|
|
|
|
|
34
|
my $int_sens = $self->_sens_to_int($sens); |
263
|
|
|
|
|
|
|
|
264
|
9
|
|
|
|
|
54
|
$self->write( command => "SENS $int_sens", %args ); |
265
|
9
|
|
|
|
|
33
|
$self->cached_sens( $self->_int_to_sens($int_sens) ); |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub set_auto_sens { |
270
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = validated_getter( |
271
|
|
|
|
|
|
|
\@_, |
272
|
|
|
|
|
|
|
r => { isa => 'Lab::Moose::PosNum' }, |
273
|
|
|
|
|
|
|
min_sens => { isa => 'Lab::Moose::PosNum', default => 2e-9 }, |
274
|
|
|
|
|
|
|
max_sens => { isa => 'Lab::Moose::PosNum', default => 1 }, |
275
|
|
|
|
|
|
|
up_at => { isa => 'Lab::Moose::PosNum', default => 0.9 }, |
276
|
|
|
|
|
|
|
down_at => { isa => 'Lab::Moose::PosNum', default => 0.9 } |
277
|
|
|
|
|
|
|
); |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
my ( $r, $min_sens, $max_sens, $up_at, $down_at ) |
280
|
0
|
|
|
|
|
0
|
= delete @args{qw/r min_sens max_sens up_at down_at/}; |
281
|
0
|
|
|
|
|
0
|
my $current_sens = $self->cached_sens(); |
282
|
0
|
|
|
|
|
0
|
my $current_sens_int = $self->_sens_to_int($current_sens); |
283
|
|
|
|
|
|
|
|
284
|
0
|
0
|
|
|
|
0
|
if ( $r > $current_sens * $up_at ) { |
|
|
0
|
|
|
|
|
|
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
# Go to next higher range |
287
|
|
|
|
|
|
|
|
288
|
0
|
0
|
|
|
|
0
|
if ( $current_sens_int == 26 ) { |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
# Already in 1V range |
291
|
0
|
|
|
|
|
0
|
return; |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
0
|
my $upper_sens = $self->_int_to_sens( $current_sens_int + 1 ); |
295
|
0
|
0
|
|
|
|
0
|
if ( $upper_sens <= $max_sens ) { |
296
|
0
|
|
|
|
|
0
|
return $self->set_sens( value => $upper_sens ); |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
elsif ( $current_sens_int > 0 ) { |
300
|
0
|
|
|
|
|
0
|
my $lower_sens = $self->_int_to_sens( $current_sens_int - 1 ); |
301
|
0
|
0
|
|
|
|
0
|
if ( $r < $lower_sens * $down_at ) { |
302
|
0
|
0
|
|
|
|
0
|
if ( $lower_sens >= $min_sens ) { |
303
|
0
|
|
|
|
|
0
|
return $self->set_sens( value => $lower_sens ); |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
} |
308
|
0
|
|
|
|
|
0
|
return; |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
cache input => ( getter => 'get_input' ); |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
sub get_input { |
315
|
4
|
|
|
4
|
1
|
3608
|
my ( $self, %args ) = validated_getter( \@_ ); |
316
|
4
|
|
|
|
|
2048
|
my $input = $self->query( command => 'ISRC?', %args ); |
317
|
|
|
|
|
|
|
|
318
|
4
|
|
|
|
|
23
|
my %inputs = ( 0 => 'A', 1 => 'AB', 2 => 'I1M', 3 => 'I100M' ); |
319
|
|
|
|
|
|
|
|
320
|
4
|
|
|
|
|
18
|
return $self->cached_input( $inputs{$input} ); |
321
|
|
|
|
|
|
|
} |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
sub set_input { |
324
|
4
|
|
|
4
|
1
|
4470
|
my ( $self, $value, %args ) = validated_setter( |
325
|
|
|
|
|
|
|
\@_, |
326
|
|
|
|
|
|
|
value => { isa => enum( [qw/A AB I1M I100M/] ) } |
327
|
|
|
|
|
|
|
); |
328
|
4
|
|
|
|
|
121
|
my %inputs = ( A => 0, AB => 1, I1M => 2, I100M => 3 ); |
329
|
4
|
|
|
|
|
10
|
my $input = $inputs{$value}; |
330
|
4
|
|
|
|
|
24
|
$self->write( command => "ISRC $input", %args ); |
331
|
4
|
|
|
|
|
19
|
$self->cached_input($value); |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
cache ground => ( getter => 'get_ground' ); |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
sub get_ground { |
338
|
2
|
|
|
2
|
1
|
1755
|
my ( $self, %args ) = validated_hash( \@_ ); |
339
|
|
|
|
|
|
|
|
340
|
2
|
|
|
|
|
136
|
my $ground = $self->query( command => 'IGND?', %args ); |
341
|
|
|
|
|
|
|
|
342
|
2
|
100
|
|
|
|
12
|
return $self->cached_ground( $ground ? 'GROUND' : 'FLOAT' ); |
343
|
|
|
|
|
|
|
} |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
sub set_ground { |
346
|
2
|
|
|
2
|
1
|
5961
|
my ( $self, $value, %args ) = validated_setter( |
347
|
|
|
|
|
|
|
\@_, |
348
|
|
|
|
|
|
|
value => { isa => enum( [qw/GROUND FLOAT/] ) } |
349
|
|
|
|
|
|
|
); |
350
|
2
|
100
|
|
|
|
128
|
my $ground = $value eq 'GROUND' ? 1 : 0; |
351
|
2
|
|
|
|
|
19
|
$self->write( command => "IGND $ground", %args ); |
352
|
2
|
|
|
|
|
14
|
$self->cached_ground($value); |
353
|
|
|
|
|
|
|
} |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
cache coupling => ( getter => 'get_coupling' ); |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
sub get_coupling { |
359
|
2
|
|
|
2
|
1
|
1698
|
my ( $self, %args ) = validated_hash( \@_ ); |
360
|
|
|
|
|
|
|
|
361
|
2
|
|
|
|
|
149
|
my $coupling = $self->query( command => 'ICPL?', %args ); |
362
|
|
|
|
|
|
|
|
363
|
2
|
100
|
|
|
|
12
|
return $self->cached_coupling( $coupling ? 'DC' : 'AC' ); |
364
|
|
|
|
|
|
|
} |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
sub set_coupling { |
367
|
2
|
|
|
2
|
1
|
5414
|
my ( $self, $value, %args ) = validated_setter( |
368
|
|
|
|
|
|
|
\@_, |
369
|
|
|
|
|
|
|
value => { isa => enum( [qw/AC DC/] ) } |
370
|
|
|
|
|
|
|
); |
371
|
2
|
100
|
|
|
|
11
|
my $coupling = $value eq 'DC' ? 1 : 0; |
372
|
2
|
|
|
|
|
13
|
$self->write( command => "ICPL $coupling", %args ); |
373
|
2
|
|
|
|
|
12
|
$self->cached_coupling($value); |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
cache line_notch_filters => ( getter => 'get_line_notch_filters' ); |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
sub get_line_notch_filters { |
380
|
4
|
|
|
4
|
1
|
3466
|
my ( $self, %args ) = validated_getter( \@_ ); |
381
|
4
|
|
|
|
|
2095
|
my $filters = $self->query( command => 'ILIN?', %args ); |
382
|
|
|
|
|
|
|
|
383
|
4
|
|
|
|
|
23
|
my %filters = ( 0 => 'OUT', 1 => 'LINE', 2 => '2xLINE', 3 => 'BOTH' ); |
384
|
|
|
|
|
|
|
|
385
|
4
|
|
|
|
|
15
|
return $self->cached_line_notch_filters( $filters{$filters} ); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
sub set_line_notch_filters { |
389
|
4
|
|
|
4
|
1
|
7136
|
my ( $self, $value, %args ) = validated_setter( |
390
|
|
|
|
|
|
|
\@_, |
391
|
|
|
|
|
|
|
value => { isa => enum( [qw/OUT LINE 2xLINE BOTH/] ) } |
392
|
|
|
|
|
|
|
); |
393
|
4
|
|
|
|
|
21
|
my %filters = ( OUT => 0, LINE => 1, '2xLINE' => 2, BOTH => 3 ); |
394
|
4
|
|
|
|
|
9
|
my $filters = $filters{$value}; |
395
|
4
|
|
|
|
|
23
|
$self->write( command => "ILIN $filters", %args ); |
396
|
4
|
|
|
|
|
25
|
$self->cached_line_notch_filters($value); |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
sub calculate_settling_time { |
401
|
3
|
|
|
3
|
1
|
10
|
my $self = shift; |
402
|
3
|
|
|
|
|
17
|
my ($settling) = validated_list( |
403
|
|
|
|
|
|
|
\@_, |
404
|
|
|
|
|
|
|
settling => enum( [qw/63.2 90 99 99.9/] ) |
405
|
|
|
|
|
|
|
); |
406
|
|
|
|
|
|
|
|
407
|
3
|
|
|
|
|
4663
|
my $tc = $self->cached_tc(); |
408
|
3
|
|
|
|
|
10
|
my $filter_slope = $self->cached_filter_slope(); |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
# For the following table, see "Principles of lock-in detection and the |
411
|
|
|
|
|
|
|
# state of the art" white paper by Zurich Instruments. |
412
|
3
|
|
|
|
|
25
|
my %settling_factors = ( |
413
|
|
|
|
|
|
|
'6' => { |
414
|
|
|
|
|
|
|
'63.2' => 1, |
415
|
|
|
|
|
|
|
'90' => 2.3, |
416
|
|
|
|
|
|
|
'99' => 4.61, |
417
|
|
|
|
|
|
|
'99.9' => 6.91 |
418
|
|
|
|
|
|
|
}, |
419
|
|
|
|
|
|
|
'12' => { |
420
|
|
|
|
|
|
|
'63.2' => 2.15, |
421
|
|
|
|
|
|
|
'90' => 3.89, |
422
|
|
|
|
|
|
|
'99' => 6.64, |
423
|
|
|
|
|
|
|
'99.9' => 9.23 |
424
|
|
|
|
|
|
|
}, |
425
|
|
|
|
|
|
|
'18' => { |
426
|
|
|
|
|
|
|
'63.2' => 3.26, |
427
|
|
|
|
|
|
|
'90' => 5.32, |
428
|
|
|
|
|
|
|
'99' => 8.41, |
429
|
|
|
|
|
|
|
'99.9' => 11.23 |
430
|
|
|
|
|
|
|
}, |
431
|
|
|
|
|
|
|
'24' => { |
432
|
|
|
|
|
|
|
'63.2' => 4.35, |
433
|
|
|
|
|
|
|
'90' => 6.68, |
434
|
|
|
|
|
|
|
'99' => 10.05, |
435
|
|
|
|
|
|
|
'99.9' => 13.06 |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
); |
438
|
|
|
|
|
|
|
|
439
|
3
|
|
|
|
|
12
|
my $multiplier = $settling_factors{$filter_slope}->{$settling}; |
440
|
3
|
|
|
|
|
26
|
return $multiplier * $tc; |
441
|
|
|
|
|
|
|
} |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
sub get_auxin { |
446
|
0
|
|
|
0
|
1
|
|
my ( $self, %args ) = validated_getter( |
447
|
|
|
|
|
|
|
\@_, |
448
|
|
|
|
|
|
|
channel => { isa => 'Int' }, |
449
|
|
|
|
|
|
|
); |
450
|
0
|
|
|
|
|
|
my $channel = $args{channel}; |
451
|
0
|
|
|
|
|
|
return $self->query( command => "OAUX? $channel", %args ); |
452
|
|
|
|
|
|
|
} |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
1; |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
__END__ |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
=pod |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
=encoding UTF-8 |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
=head1 NAME |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
Lab::Moose::Instrument::SR830 - Stanford Research SR830 Lock-In Amplifier |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
=head1 VERSION |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
version 3.900 |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
=head1 SYNOPSIS |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
use Lab::Moose; |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
# Constructor |
479
|
|
|
|
|
|
|
my $lia = instrument( |
480
|
|
|
|
|
|
|
type => 'SR830', |
481
|
|
|
|
|
|
|
connection_type => 'VISA::GPIB', |
482
|
|
|
|
|
|
|
connection_options => {'gpib_address' => 10} |
483
|
|
|
|
|
|
|
); |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
# Set reference frequency to 10 kHz |
486
|
|
|
|
|
|
|
$lia->set_frq(value => 10000); |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
# Set time constant to 10 sec |
489
|
|
|
|
|
|
|
$lia->set_tc(value => 10); |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
# Set sensitivity to 1 mV |
492
|
|
|
|
|
|
|
$lia->set_sens(value => 0.001); |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
# Get X and Y values |
495
|
|
|
|
|
|
|
my $xy = $lia->get_xy(); |
496
|
|
|
|
|
|
|
say "X: ", $xy->{x}; |
497
|
|
|
|
|
|
|
say "Y: ", $xy->{y}; |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=head1 METHODS |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
=head2 get_frq |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
my $frq = $lia->get_frq(); |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
Query frequency of the reference oscillator. |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
=head2 set_frq |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
$lia->set_frq(value => $frq); |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
Set frequency of the reference oscillator. |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
=head2 get_amplitude |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
my $ampl = $lia->get_amplitude(); |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
Query amplitude of the sine output. |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
=head2 set_amplitude |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
$lia->set_amplitude(value => $ampl); |
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
Set amplitude of the sine output. |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
=head2 get_phase |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
my $phase = $lia->get_phase(); |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
Get reference phase shift (in degree). Result is between -180 and 180. |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
=head2 set_phase |
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
$lia->set_phase(value => $phase); |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
Set reference phase shift. The C<$phase> parameter has to be between -360 and |
536
|
|
|
|
|
|
|
729.99. |
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
=head2 get_xy |
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
my $xy = $lia->get_xy(); |
541
|
|
|
|
|
|
|
my $x = $xy->{x}; |
542
|
|
|
|
|
|
|
my $y = $xy->{y}; |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
Query the X and Y values. |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
=head2 get_rphi |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
My $rphi = $lia->get_rphi(); |
549
|
|
|
|
|
|
|
my $r = $rphi->{r}; |
550
|
|
|
|
|
|
|
my $phi = $rphi->{phi}; |
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
Query R and the angle (in degree). |
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
=head2 get_xyrphi |
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
Get x, y, R and the angle all in one call. |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
=head2 get_tc |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
my $tc = $lia->get_tc(); |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
Query the time constant. |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
=head2 set_tc |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
# Set tc to 30μs |
567
|
|
|
|
|
|
|
$lia->set_tc(value => 30e-6); |
568
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
Set the time constant. The value is rounded to the nearest valid |
570
|
|
|
|
|
|
|
value. Rounding is performed in logscale. Croak if the the value is out of |
571
|
|
|
|
|
|
|
range. |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
=head2 get_filter_slope |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
my $filter_slope = $lia->get_filter_slope(); |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
Query the low pass filter slope (dB/oct). Possible return values: |
578
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
=over |
580
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
=item * 6 |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
=item * 12 |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
=item * 18 |
586
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
=item * 24 |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
=back |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
=head2 set_filter_slope |
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
$lia->set_filter_slope(value => 18); |
594
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
Set the low pass filter slope (dB/oct). Allowed values: |
596
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
=over |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
=item * 6 |
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
=item * 12 |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
=item * 18 |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
=item * 24 |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
=back |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
=head2 get_sens |
610
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
my $sens = $lia->get_sens(); |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
Get sensitivity (in Volt). |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
=head2 set_sens |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
$lia->set_sens(value => $sens); |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
Set sensitivity (in Volt). |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
Same rounding as for C<set_tc>. |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
=head2 set_auto_sens |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
my $rphi = $lia->get_rphi |
626
|
|
|
|
|
|
|
my $r = $rphi->{r}; |
627
|
|
|
|
|
|
|
$lia->set_auto_sens( |
628
|
|
|
|
|
|
|
r => $r, |
629
|
|
|
|
|
|
|
min_sens => 10e-6, # Smallest allowed range is 10μV (default: 2nV range) |
630
|
|
|
|
|
|
|
max_sens => 2e-3 , # Largest allowed range is 2mV (default: 1V range) |
631
|
|
|
|
|
|
|
up_at => 0.8 , # Go to next higher sens if $r is above 80% |
632
|
|
|
|
|
|
|
# of current range (default: 90%) |
633
|
|
|
|
|
|
|
down_at => 0.8 , # Go to next lower sens if $r is below 80% of |
634
|
|
|
|
|
|
|
# next lower sens (default: 90%) |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
); |
637
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
Set optimal sensitvity for current input signal, determined from the C<r> attribute. |
639
|
|
|
|
|
|
|
Except for C<r>, all attributes are optional. For stable operation, 1 > C<up_at> >= C<down_at> is required. |
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
If the sensitvity is changed, return the new value. Otherwise return nothing. |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
=head2 get_input |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
my $input = $lia->get_input(); |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
Query the input configuration. Possible return values: |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
=over |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
=item * A |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
=item * AB |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
=item * I1M |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
=item * I100M |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
=back |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
=head2 set_input |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
$lia->set_input(value => 'AB'); |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
Set input configuration. Allowed values: |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=over |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
=item * A |
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
=item * AB |
672
|
|
|
|
|
|
|
|
673
|
|
|
|
|
|
|
=item * I1M |
674
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
=item * I100M |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
=back |
678
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
=head2 get_ground |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
my $ground = $lia->get_ground(); |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
Query the input shield grounding. Possible return values: |
684
|
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
=over |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
=item * GROUND |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
=item * FLOAT |
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
=back |
692
|
|
|
|
|
|
|
|
693
|
|
|
|
|
|
|
=head2 set_ground |
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
$lia->set_ground(value => 'GROUND'); |
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
# or: |
698
|
|
|
|
|
|
|
$lia->set_ground(value => 'FLOAT'); |
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
Set the input shield grounding. Allowed values: |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
=over |
703
|
|
|
|
|
|
|
|
704
|
|
|
|
|
|
|
=item * GROUND |
705
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
=item * FLOAT |
707
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
=back |
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
=head2 get_coupling |
711
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
my $coupling = $lia->get_coupling(); |
713
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
Query the input coupling. Possible return values: |
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
=over |
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
=item * AC |
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
=item * DC |
721
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
=back |
723
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
=head2 set_coupling |
725
|
|
|
|
|
|
|
|
726
|
|
|
|
|
|
|
$lia->set_coupling(value => 'AC'); |
727
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
# or: |
729
|
|
|
|
|
|
|
$lia->set_coupling(value => 'DC'); |
730
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
Set the input coupling. Allowed values: |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
=over |
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
=item * AC |
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
=item * DC |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
=back |
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
=head2 get_line_notch_filters |
742
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
my $filters = $lia->get_line_notch_filters(); |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
Query the line notch filter configuration. Possible return values: |
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
=over |
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
=item * OUT |
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
=item * LINE |
752
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
=item * 2xLINE |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
=item * BOTH |
756
|
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
=back |
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
=head2 set_line_notch_filters |
760
|
|
|
|
|
|
|
|
761
|
|
|
|
|
|
|
$lia->set_line_notch_filters(value => 'BOTH'); |
762
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
Set the line notch filter configuration. Allowed values: |
764
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
=over |
766
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
=item * OUT |
768
|
|
|
|
|
|
|
|
769
|
|
|
|
|
|
|
=item * LINE |
770
|
|
|
|
|
|
|
|
771
|
|
|
|
|
|
|
=item * 2xLINE |
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
=item * BOTH |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
=back |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
=head2 calculate_settling_time |
778
|
|
|
|
|
|
|
|
779
|
|
|
|
|
|
|
my $settling_time = $lia->calculate_settling_time(settling => '99'); |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
Calculate settling time independent of current time constant and filter slope. |
782
|
|
|
|
|
|
|
See "Principles of lock-in detection and the state of the art" white paper by |
783
|
|
|
|
|
|
|
Zurich Instruments. The C<settling> parameter is given in percent. Allowed |
784
|
|
|
|
|
|
|
values: |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
=over |
787
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
=item * '63.2' |
789
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
=item * '90' |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
=item * '99' |
793
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
=item * '99.9' |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
=back |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
=head2 get_auxin |
799
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
my $v = $lia->get_auxin(); |
801
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
Measure voltage on one of the four auxiliary input ports 1..4. |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
=head2 Consumed Roles |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
This driver consumes the following roles: |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
=over |
809
|
|
|
|
|
|
|
|
810
|
|
|
|
|
|
|
=item L<Lab::Moose::Instrument::Common> |
811
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
=back |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
Copyright 2016 Simon Reinhardt |
819
|
|
|
|
|
|
|
2017 Andreas K. Huettel, Simon Reinhardt |
820
|
|
|
|
|
|
|
2018 Simon Reinhardt |
821
|
|
|
|
|
|
|
2020-2021 Andreas K. Huettel, Simon Reinhardt |
822
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
825
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
826
|
|
|
|
|
|
|
|
827
|
|
|
|
|
|
|
=cut |