Lab::Connection::GPIB - GPIB Connection base class
version 3.664
This is the base class for all connections providing a GPIB interface. Every inheriting class constructor should start as follows:
sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->_construct(__PACKAGE__); #initialize fields etc. ... }
Lab::Connection::GPIB is the base class for all connections providing a GPIB interface. It is not usable on its own. It inherits from Lab::Connection.
Lab::Connection::GPIB
Its main use so far is to define the data fields common to all GPIB interfaces.
Generally called in child class constructor:
my $self = $class->SUPER::new(@_);
Return blessed $self, with @_ accessible through $self->Config().
This just calls back on the methods inherited from Lab::Connection.
If you inherit this class in your own connection however, you have to provide the following methods. Take a look at e.g. Lab::Connection::VISA_GPIB and at the basic implementations in Lab::Connection (they may even suffice).
Takes a config hash, has to at least pass the key 'command' correctly to the underlying bus.
Takes a config hash, reads back a message from the device.
Clears the instrument.
Provides unified access to the fields in initial @_ to all the child classes. E.g.
$GPIB_PAddress=$instrument->Config(GPIB_PAddress);
Without arguments, returns a reference to the complete $self->Config aka @_ of the constructor.
$Config = $connection->Config(); $GPIB_PAddress = $connection->Config()->{'GPIB_PAddress'};
Probably few. Mostly because there's not a lot to be done here. Please report.
Lab::Connection
Lab::Connection::LinuxGPIB
Lab::Connection::VISA_GPIB
This software is copyright (c) 2018 by the Lab::Measurement team; in detail:
Copyright 2011 Andreas K. Huettel, Florian Olbrich 2012 Alois Dirnaichner, Florian Olbrich, Hermann Kraus, Stefan Geissler 2016 Simon Reinhardt 2017 Andreas K. Huettel
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Lab::Measurement, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lab::Measurement
CPAN shell
perl -MCPAN -e shell install Lab::Measurement
For more information on module installation, please visit the detailed CPAN module installation guide.