line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::SCPI::Sense::Function; |
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::SCPI::Sense::Function::VERSION = '3.900'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Role for the SCPI SENSe:FUNCtion subsystem |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
2597
|
use v5.20; |
|
4
|
|
|
|
|
17
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
28
|
use Moose::Role; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
35
|
|
8
|
4
|
|
|
4
|
|
20668
|
use Lab::Moose::Instrument::Cache; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
30
|
|
9
|
|
|
|
|
|
|
use Lab::Moose::Instrument |
10
|
4
|
|
|
4
|
|
2391
|
qw/validated_channel_getter validated_channel_setter/; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
224
|
|
11
|
4
|
|
|
4
|
|
28
|
use MooseX::Params::Validate; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
38
|
|
12
|
4
|
|
|
4
|
|
1968
|
use Carp; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
245
|
|
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
32
|
use namespace::autoclean; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
43
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
excludes 'Lab::Moose::Instrument::SCPI::Sense::Function::Concurrent'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Cache used by multiple functions in sense subsystem |
20
|
|
|
|
|
|
|
cache sense_function => ( getter => 'sense_function_query' ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub sense_function_query { |
23
|
5
|
|
|
5
|
1
|
3592
|
my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
39
|
my $value = $self->query( command => "SENS${channel}:FUNC?", %args ); |
26
|
5
|
|
|
|
|
35
|
$value =~ s/["']//g; |
27
|
5
|
|
|
|
|
28
|
return $self->cached_sense_function($value); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub sense_function { |
31
|
9
|
|
|
9
|
1
|
28333
|
my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); |
32
|
|
|
|
|
|
|
|
33
|
9
|
|
|
|
|
57
|
$self->write( command => "SENS${channel}:FUNC '$value'", %args ); |
34
|
9
|
|
|
|
|
44
|
return $self->cached_sense_function($value); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=encoding UTF-8 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Lab::Moose::Instrument::SCPI::Sense::Function - Role for the SCPI SENSe:FUNCtion subsystem |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 VERSION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
version 3.900 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This role is intended for instruments which support a single sense function. |
58
|
|
|
|
|
|
|
The command for setting the function must be SENS:FUNC $function. |
59
|
|
|
|
|
|
|
Instruments with concurrent sense shell use the Sense::Function:Concurrent |
60
|
|
|
|
|
|
|
role. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The set sense function is used by other SENSE: roles, like SENSE:NPLC. For |
63
|
|
|
|
|
|
|
example, |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$source->sense_function(value => 'CURR'); |
66
|
|
|
|
|
|
|
$source->sense_nplc(value => 10); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
will set the integration time for current measurement to 10 power line cycles. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 METHODS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 sense_function_query |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 sense_function |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Query/Enable the sense function used by the instrument |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Copyright 2016 Simon Reinhardt |
83
|
|
|
|
|
|
|
2017 Andreas K. Huettel, Simon Reinhardt |
84
|
|
|
|
|
|
|
2018 Simon Reinhardt |
85
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
89
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |