++ed by:
AMBA

1 PAUSE user
1 non-PAUSE user.

Andreas K. Hüttel
and 4 contributors

NAME

Lab::Connection::GPIB - GPIB connection base class

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

AUTHOR/COPYRIGHT

 Copyright 2011      Florian Olbrich

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.