line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Instrument::Lakeshore224; |
2
|
|
|
|
|
|
|
#ABSTRACT: Lake Shore 224 temperature monitor |
3
|
|
|
|
|
|
|
$Lab::Instrument::Lakeshore224::VERSION = '3.881'; |
4
|
1
|
|
|
1
|
|
1692
|
use v5.20; |
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
15
|
use Lab::Instrument; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
21
|
|
9
|
1
|
|
|
1
|
|
9
|
use Lab::MultiChannelInstrument; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
10
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
1565
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = ( "Lab::MultiChannelInstrument", "Lab::Instrument" ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our %fields = ( |
15
|
|
|
|
|
|
|
supported_connections => [ 'VISA', 'VISA_GPIB', 'GPIB', 'DEBUG' ], |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# default settings for the supported connections |
18
|
|
|
|
|
|
|
connection_settings => { |
19
|
|
|
|
|
|
|
gpib_board => 0, |
20
|
|
|
|
|
|
|
gpib_address => 12, |
21
|
|
|
|
|
|
|
connection_type => 'VISA_GPIB', |
22
|
|
|
|
|
|
|
timeout => 1, |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
device_settings => { |
26
|
|
|
|
|
|
|
channels => { |
27
|
|
|
|
|
|
|
ChA => 'A', |
28
|
|
|
|
|
|
|
ChB => 'B', |
29
|
|
|
|
|
|
|
ChC1 => 'C1', |
30
|
|
|
|
|
|
|
ChC2 => 'C2', |
31
|
|
|
|
|
|
|
ChC3 => 'C3', |
32
|
|
|
|
|
|
|
ChC4 => 'C4', |
33
|
|
|
|
|
|
|
ChC5 => 'C5', |
34
|
|
|
|
|
|
|
ChD1 => 'D1', |
35
|
|
|
|
|
|
|
ChD2 => 'D2', |
36
|
|
|
|
|
|
|
ChD3 => 'D3', |
37
|
|
|
|
|
|
|
ChD4 => 'D4', |
38
|
|
|
|
|
|
|
ChD5 => 'D5', |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
channel_default => 'ChA', |
41
|
|
|
|
|
|
|
channel => undef |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
device_cache => { T => undef }, |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
device_cache_order => [], |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
multichannel_shared_cache => [], |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub new { |
53
|
0
|
|
|
0
|
1
|
|
my $proto = shift; |
54
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto; |
55
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
56
|
0
|
|
|
|
|
|
$self->${ \( __PACKAGE__ . '::_construct' ) }(__PACKAGE__); |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return $self; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _device_init { |
62
|
0
|
|
|
0
|
|
|
my $self = shift; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub get_tst { |
67
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
68
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
return $self->query( "*TST? ", $tail ); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub get_T { |
74
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
75
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return $self->query( 'KRDG? ' . $self->{channel}, $tail ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub get_R { |
81
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
82
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return $self->query( "SRDG? " . $self->{channel}, $tail ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub set_leds { |
88
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
89
|
0
|
|
|
|
|
|
my ( $state, $tail ) = $self->_check_args( \@_, ['state'] ); |
90
|
|
|
|
|
|
|
|
91
|
0
|
0
|
0
|
|
|
|
if ( defined $state and ( $state != 1 and $state != 0 ) ) { |
|
|
|
0
|
|
|
|
|
92
|
0
|
|
|
|
|
|
carp('State has to be 1 or 0'); |
93
|
0
|
|
|
|
|
|
return; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
$self->write( "LEDS " . $state, $tail ); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub get_leds { |
100
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
101
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
return $self->query( "LEDS?", $tail ); |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub reset_minmax { |
107
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
108
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
$self->write("MNMXRST"); |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub get_minmax { |
115
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
116
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
return $self->query( "MDAT?" . $self->{channel}, $tail ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub get_T_Celsius { |
122
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
123
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
124
|
|
|
|
|
|
|
|
125
|
0
|
|
|
|
|
|
return $self->query( "CRDG? " . $self->{channel}, $tail ); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub get_filter { |
129
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
130
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
|
return $self->query( "FILTER?" . $self->{channel}, $tail ); |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub set_filter { |
136
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
137
|
0
|
|
|
|
|
|
my ( $on_off, $points, $window, $tail ) |
138
|
|
|
|
|
|
|
= $self->_check_args( \@_, [ 'on_off', 'points', 'window' ] ); |
139
|
|
|
|
|
|
|
|
140
|
0
|
0
|
0
|
|
|
|
if ( defined $on_off and ( $on_off != 1 and $on_off != 0 ) ) { |
|
|
|
0
|
|
|
|
|
141
|
0
|
|
|
|
|
|
carp('on_off has to be 1 or 0'); |
142
|
0
|
|
|
|
|
|
return; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
0
|
0
|
0
|
|
|
|
if ( defined $points and ( $points < 2 or $points > 64 ) ) { |
|
|
|
0
|
|
|
|
|
146
|
0
|
|
|
|
|
|
carp('Valid range for points is 2 to 64'); |
147
|
0
|
|
|
|
|
|
return; |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
0
|
0
|
0
|
|
|
|
if ( defined $window and ( $window < 1 or $window > 10 ) ) { |
|
|
|
0
|
|
|
|
|
151
|
0
|
|
|
|
|
|
carp('Valid range for window is 1 to 10'); |
152
|
0
|
|
|
|
|
|
return; |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
$self->write( "FILTER $self->{channel},$on_off,$points,$window", $tail ); |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub get_mode { |
159
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
160
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
161
|
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
return $self->query( "MODE?", $tail ); |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub set_mode { |
166
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
167
|
0
|
|
|
|
|
|
my ( $state, $tail ) = $self->_check_args( \@_, ['state'] ); |
168
|
|
|
|
|
|
|
|
169
|
0
|
0
|
0
|
|
|
|
if ( defined $state and ( $state < 1 or $state > 2 ) ) { |
|
|
|
0
|
|
|
|
|
170
|
0
|
|
|
|
|
|
carp( |
171
|
|
|
|
|
|
|
'State has to be 0 (local), 1 (remote) or 2 (remote with local lockout)' |
172
|
|
|
|
|
|
|
); |
173
|
0
|
|
|
|
|
|
return; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
$self->write( "MODE " . $state, $tail ); |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub get_lock { |
180
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
181
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
182
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
return $self->query( "LOCK?", $tail ); |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub set_lock { |
187
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
188
|
0
|
|
|
|
|
|
my ( $state, $tail ) = $self->_check_args( \@_, ['state'] ); |
189
|
|
|
|
|
|
|
|
190
|
0
|
0
|
0
|
|
|
|
if ( defined $state and ( $state != 0 and $state != 1 ) ) { |
|
|
|
0
|
|
|
|
|
191
|
0
|
|
|
|
|
|
carp('State has to be 0 (unlocked) or 1 (locked)'); |
192
|
0
|
|
|
|
|
|
return; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
|
$self->write( "LOCK " . $state, $tail ); |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub get_alarm { |
199
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
200
|
0
|
|
|
|
|
|
my ( $state, $tail ) = $self->_check_args( \@_, ['state'] ); |
201
|
|
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
return $self->query( "ALARM?" . $self->{channel}, $tail ); |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
sub set_alarm { |
206
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
207
|
|
|
|
|
|
|
my ( |
208
|
0
|
|
|
|
|
|
$on_off, $high_setpoint, $low_setpoint, $deadband, $latch_enable, |
209
|
|
|
|
|
|
|
$audible, $display, $tail |
210
|
|
|
|
|
|
|
) |
211
|
|
|
|
|
|
|
= $self->_check_args( |
212
|
|
|
|
|
|
|
\@_, |
213
|
|
|
|
|
|
|
[ |
214
|
|
|
|
|
|
|
'on_off', 'high_setpoint', 'low_setpoint', 'deadband', |
215
|
|
|
|
|
|
|
'latch_enable', 'audible', 'display' |
216
|
|
|
|
|
|
|
] |
217
|
|
|
|
|
|
|
); |
218
|
|
|
|
|
|
|
|
219
|
0
|
0
|
0
|
|
|
|
if ( defined $on_off and ( $on_off != 1 and $on_off != 0 ) ) { |
|
|
|
0
|
|
|
|
|
220
|
0
|
|
|
|
|
|
carp('on_off has to be 1 or 0'); |
221
|
0
|
|
|
|
|
|
return; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
0
|
0
|
0
|
|
|
|
if ( defined $latch_enable |
|
|
|
0
|
|
|
|
|
225
|
|
|
|
|
|
|
and ( $latch_enable != 1 or $latch_enable != 0 ) ) { |
226
|
0
|
|
|
|
|
|
carp('latch_enable has to be 1 or 0'); |
227
|
0
|
|
|
|
|
|
return; |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
0
|
0
|
0
|
|
|
|
if ( defined $audible and ( $audible != 1 and $audible != 0 ) ) { |
|
|
|
0
|
|
|
|
|
231
|
0
|
|
|
|
|
|
carp('audible has to be 1 or 0'); |
232
|
0
|
|
|
|
|
|
return; |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
|
235
|
0
|
0
|
0
|
|
|
|
if ( defined $display and ( $display != 1 or $display != 0 ) ) { |
|
|
|
0
|
|
|
|
|
236
|
0
|
|
|
|
|
|
carp('display has to be 1 or 0'); |
237
|
0
|
|
|
|
|
|
return; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
$self->write( |
241
|
0
|
|
|
|
|
|
"ALARM $self->{channel}, $on_off, $high_setpoint, $low_setpoint, $deadband, $latch_enable, $audible, $display", |
242
|
|
|
|
|
|
|
$tail |
243
|
|
|
|
|
|
|
); |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub reset_alarm { |
247
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
248
|
0
|
|
|
|
|
|
my ($tail) = $self->_check_args( \@_, [] ); |
249
|
|
|
|
|
|
|
|
250
|
0
|
|
|
|
|
|
$self->write( "ALMRST", $tail ); |
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub get_value { |
254
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
255
|
0
|
|
|
|
|
|
return $self->get_T(@_); |
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
1; |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
#----------Include features in measurment scripts----------------------------------------------------------------------------------------------------------------------------------- |
261
|
|
|
|
|
|
|
# use Lab::Measurement; |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
# my $lake=Instrument('Lakeshore224'); |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# my $t_sample=$lake->get_value(); |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
# my $minmax = $lake->get_minmax(); |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# my $celsius = $lake->get_T_Celsius(); |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
# $lake->reset_minmax; |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
# my $light = $lake->get_leds(); |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
# $lake->set_leds(1); |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
# my $filter=$lake->get_filter(); |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
# my $mode=$lake->get_mode(); |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
# $lake->set_mode(2); #State has to be 0 (local), 1 (remote) or 2 (remote with local lockout) |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
# my $lock = $lake ->get_lock(); |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
# $lake->set_lock(0); |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
# my $alarm = $lake->get_alarm(); |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
# $lake->reset_alarm(); |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
# $lake->set_alarm({ |
292
|
|
|
|
|
|
|
# on_off => 0, #0=off, 1=on |
293
|
|
|
|
|
|
|
# high_setpoint => 296.906, |
294
|
|
|
|
|
|
|
# low_setpoint => 290.00, |
295
|
|
|
|
|
|
|
# deadband => 0, #Sets the value that the source must change outside of an alarm condition to deactivate an unclatched alarm |
296
|
|
|
|
|
|
|
# latch_enable => 1, #Specifies wheter alarm remains active after alarm condition correction. 0=off, 1=on |
297
|
|
|
|
|
|
|
# audible => 0, #speaker will beep when alarm condition occurs: 0=off, 1=on |
298
|
|
|
|
|
|
|
# display => 1, #Alarm LED on front panel will blink when an alarm condition occurs: 0=off, 1=on |
299
|
|
|
|
|
|
|
# }); |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# $lake->set_filter({ |
302
|
|
|
|
|
|
|
# on_off => 1, #Specifies wheter the filter function is 0=Off or 1=On |
303
|
|
|
|
|
|
|
# points => 2, #Specifies how many data points the filtering function uses. Valid range= 2 to 64 |
304
|
|
|
|
|
|
|
# window => 10, #Specifies what percent of full scale reading limits the filtering fuction. Valid range = 1 to 10 % |
305
|
|
|
|
|
|
|
# }); |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
__END__ |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=pod |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=encoding UTF-8 |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=head1 NAME |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
Lab::Instrument::Lakeshore224 - Lake Shore 224 temperature monitor |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 VERSION |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
version 3.881 |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
Copyright 2015 Christian Butschkow |
326
|
|
|
|
|
|
|
2016 Simon Reinhardt |
327
|
|
|
|
|
|
|
2017 Andreas K. Huettel |
328
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
332
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=cut |