NAME
Lab::Connection::GPIB - GPIB Connection base class
VERSION
version 3.870
SYNOPSIS
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.
...
}
DESCRIPTION
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.
Its main use so far is to define the data fields common to all GPIB interfaces.
CONSTRUCTOR
new
Generally called in child class constructor:
my $self = $class->SUPER::new(@_);
Return blessed $self, with @_ accessible through $self->Config().
METHODS
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).
Write()
Takes a config hash, has to at least pass the key 'command' correctly to the underlying bus.
Read()
Takes a config hash, reads back a message from the device.
Clear()
Clears the instrument.
config
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'};
CAVEATS/BUGS
Probably few. Mostly because there's not a lot to be done here. Please report.
SEE ALSO
COPYRIGHT AND LICENSE
This software is copyright (c) 2023 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
2020 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.