| 1 | package Lab::Moose::Instrument::SCPI::Sense::Protection; | ||
| 2 | 3 | $Lab::Moose::Instrument::SCPI::Sense::Protection::VERSION = '3.881'; | |
| 3 | #ABSTRACT: Role for the SCPI SENSe:$function:Protection subsystem | ||
| 4 | |||
| 5 | 3 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 3 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use Lab::Moose::Instrument::Cache; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | ▶ | use Lab::Moose::Instrument qw/validated_getter validated_setter/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 3 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | |||
| 14 | 3 | requires 'cached_sense_function'; | |
| 15 | |||
| 16 | 3 | cache sense_protection => ( getter => 'sense_protection_query' ); | |
| 17 | |||
| 18 | sub sense_protection_query { | ||
| 19 | 6 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); |
|
Subroutine
sense_protection_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 20 | |||
| 21 | 6 | my $func = $self->cached_sense_function(); | |
| 22 | |||
| 23 | 6 | return $self->cached_sense_protection( | |
| 24 | $self->query( command => "SENS:$func:PROT?", %args ) ); | ||
| 25 | } | ||
| 26 | |||
| 27 | sub sense_protection { | ||
| 28 | 6 | ▶ | my ( $self, $value, %args ) = validated_setter( |
|
Subroutine
sense_protection: called CC=1 SCAR=0.0
Pod
documented
| |||
| 29 | \@_, | ||
| 30 | value => { isa => 'Lab::Moose::PosNum' }, | ||
| 31 | ); | ||
| 32 | |||
| 33 | 6 | my $func = $self->cached_sense_function(); | |
| 34 | |||
| 35 | 6 | $self->write( command => "SENS:$func:PROT $value", %args ); | |
| 36 | |||
| 37 | 6 | $self->cached_sense_protection($value); | |
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | sub sense_protection_tripped_query { | ||
| 42 | 2 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); |
|
Subroutine
sense_protection_tripped_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 43 | 2 | my $func = $self->cached_sense_function(); | |
| 44 | 2 | return $self->query( command => "SENS:$func:PROT:TRIP?" ); | |
| 45 | } | ||
| 46 | |||
| 47 | |||
| 48 | 3 | cache sense_protection_rsynchronize => | |
| 49 | ( getter => 'sense_protection_rsynchronize_query' ); | ||
| 50 | |||
| 51 | sub sense_protection_rsynchronize_query { | ||
| 52 | 0 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); |
|
Subroutine
sense_protection_rsynchronize_query: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | 0 | my $func = $self->cached_sense_function(); | |
| 54 | 0 | return $self->cached_sense_protection_rsynchronize( | |
| 55 | $self->query( command => "SENS:$func:PROT:RSYN?", %args ) ); | ||
| 56 | } | ||
| 57 | |||
| 58 | sub sense_protection_rsynchronize { | ||
| 59 | 0 | ▶ | my ( $self, $value, %args ) = validated_setter( |
|
Subroutine
sense_protection_rsynchronize: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 60 | \@_, | ||
| 61 | value => { isa => 'Bool' } | ||
| 62 | ); | ||
| 63 | 0 | my $func = $self->cached_sense_function(); | |
| 64 | 0 | $self->write( command => "SENS:$func:PROT:RSYN $value" ); | |
| 65 | 0 | $self->cached_sense_protection_rsynchronize($value); | |
| 66 | } | ||
| 67 | |||
| 68 | 3 | 1; | |
| 69 | |||
| 70 | __END__ | ||
| 71 | |||
| 72 | =pod | ||
| 73 | |||
| 74 | =encoding UTF-8 | ||
| 75 | |||
| 76 | =head1 NAME | ||
| 77 | |||
| 78 | Lab::Moose::Instrument::SCPI::Sense::Protection - Role for the SCPI SENSe:$function:Protection subsystem | ||
| 79 | |||
| 80 | =head1 VERSION | ||
| 81 | |||
| 82 | version 3.881 | ||
| 83 | |||
| 84 | =head1 METHODS | ||
| 85 | |||
| 86 | =head2 sense_protection_query | ||
| 87 | |||
| 88 | =head2 sense_protection | ||
| 89 | |||
| 90 | $self->sense_protection(value => 1e-6); | ||
| 91 | |||
| 92 | Query/Set the measurement protection limit | ||
| 93 | |||
| 94 | =head2 sense_protection_tripped_query | ||
| 95 | |||
| 96 | my $tripped = $self->sense_protection_tripped_query(); | ||
| 97 | |||
| 98 | Return '1' if source is in compliance, and '0' if source is not in compliance. | ||
| 99 | |||
| 100 | =head2 sense_protection_rsynchronize_query/sense_protection_rsynchronize | ||
| 101 | |||
| 102 | Get/Set measure and compliance range synchronization. | ||
| 103 | |||
| 104 | =head1 COPYRIGHT AND LICENSE | ||
| 105 | |||
| 106 | This software is copyright (c) 2023 by the Lab::Measurement team; in detail: | ||
| 107 | |||
| 108 | Copyright 2018 Simon Reinhardt | ||
| 109 | 2020 Andreas K. Huettel | ||
| 110 | |||
| 111 | |||
| 112 | This is free software; you can redistribute it and/or modify it under | ||
| 113 | the same terms as the Perl 5 programming language system itself. | ||
| 114 | |||
| 115 | =cut | ||