| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::Keysight33600; |
|
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::Keysight33600::VERSION = '3.880'; |
|
3
|
|
|
|
|
|
|
#ABSTRACT: Keysight 33500/33600 series Function/Arbitrary Waveform Generator (work in progress) |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
2815
|
use v5.20; |
|
|
1
|
|
|
|
|
5
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Moose; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
6
|
|
|
8
|
1
|
|
|
1
|
|
7554
|
use MooseX::Params::Validate; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
19
|
|
|
9
|
1
|
|
|
1
|
|
642
|
use Moose::Util::TypeConstraints qw/enum/; |
|
|
1
|
|
|
|
|
8
|
|
|
|
1
|
|
|
|
|
10
|
|
|
10
|
1
|
|
|
1
|
|
599
|
use List::Util qw/sum/; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
104
|
|
|
11
|
1
|
|
|
1
|
|
7
|
use List::MoreUtils qw/minmax/; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
11
|
|
|
12
|
|
|
|
|
|
|
use Lab::Moose::Instrument |
|
13
|
1
|
|
|
1
|
|
821
|
qw/validated_channel_getter validated_channel_setter validated_getter validated_setter/; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
83
|
|
|
14
|
1
|
|
|
1
|
|
8
|
use Lab::Moose::Instrument::Cache; |
|
|
1
|
|
|
|
|
12
|
|
|
|
1
|
|
|
|
|
13
|
|
|
15
|
1
|
|
|
1
|
|
768
|
use Carp 'croak'; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
66
|
|
|
16
|
1
|
|
|
1
|
|
11
|
use namespace::autoclean; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
12
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
extends 'Lab::Moose::Instrument'; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
around default_connection_options => sub { |
|
21
|
|
|
|
|
|
|
my $orig = shift; |
|
22
|
|
|
|
|
|
|
my $self = shift; |
|
23
|
|
|
|
|
|
|
my $options = $self->$orig(); |
|
24
|
|
|
|
|
|
|
my $usb_opts = { vid => 0x0957, pid => 0x2b07 }; |
|
25
|
|
|
|
|
|
|
$options->{USB} = $usb_opts; |
|
26
|
|
|
|
|
|
|
$options->{'VISA::USB'} = $usb_opts; |
|
27
|
|
|
|
|
|
|
return $options; |
|
28
|
|
|
|
|
|
|
}; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub BUILD { |
|
31
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
32
|
0
|
|
|
|
|
|
$self->clear(); |
|
33
|
0
|
|
|
|
|
|
$self->cls(); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# |
|
38
|
|
|
|
|
|
|
# MY FUNCTIONS |
|
39
|
|
|
|
|
|
|
# |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
with qw( |
|
43
|
|
|
|
|
|
|
Lab::Moose::Instrument::Common |
|
44
|
|
|
|
|
|
|
); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=pod |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=encoding UTF-8 |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Lab::Moose::Instrument::Keysight33600 - Keysight 33500/33600 series Function/Arbitrary Waveform Generator (work in progress) |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 VERSION |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
version 3.880 |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
use Lab::Moose; |
|
67
|
|
|
|
|
|
|
my $trueform = instrument( |
|
68
|
|
|
|
|
|
|
type => 'Keysight33600', |
|
69
|
|
|
|
|
|
|
connection_type => '...', |
|
70
|
|
|
|
|
|
|
connection_options => {...} |
|
71
|
|
|
|
|
|
|
); |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
### Setup waveform ### |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# Clear volatile memory |
|
76
|
|
|
|
|
|
|
$trueform->write(command => 'DATA:VOL:CLE'); |
|
77
|
|
|
|
|
|
|
# write new waveform into volatile memory |
|
78
|
|
|
|
|
|
|
$trueform->write(command => 'DATA:ARB myarb, 0, 0, 0.1, ...,1, ...'); |
|
79
|
|
|
|
|
|
|
# load the new waveform |
|
80
|
|
|
|
|
|
|
$trueform->write(command => 'SOUR:FUNC:ARB myarb'); |
|
81
|
|
|
|
|
|
|
# set parameters |
|
82
|
|
|
|
|
|
|
$trueform->write(command => 'SOUR:VOLT 1'); # amplitude |
|
83
|
|
|
|
|
|
|
$trueform->write(command => 'FUNC:ARB:SRAT 100000'); # samples/points per second |
|
84
|
|
|
|
|
|
|
$trueform->write(command => 'FUNC:ARB:FILT STEP'); # interpolation type |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
$trueform->write(command => 'OUTP:POL INV'); # invert output polarity |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Setup trigger input |
|
89
|
|
|
|
|
|
|
$trueform->write(command => 'BURS:MODE TRIG'); |
|
90
|
|
|
|
|
|
|
$trueform->write(command => 'BURS:NCYC 1'); # one ramp per trigger |
|
91
|
|
|
|
|
|
|
$trueform->write(command => 'TRIG:SOUR BUS'}; # use *TRG command as trigger |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# Setup trigger output |
|
95
|
|
|
|
|
|
|
$trueform->write(command => 'OUTP:TRIG 1'); |
|
96
|
|
|
|
|
|
|
$trueform->write(command => 'OUTP:TRIG:SLOP NEG'); |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# Turn output on |
|
100
|
|
|
|
|
|
|
$trueform->write(command => 'OUTP ON'); |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 METHODS |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Used roles: |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=over |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item L<Lab::Moose::Instrument::Common> |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=back |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Copyright 2022 Simon Reinhardt |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
122
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |