++ed by:
AMBA

1 PAUSE user
1 non-PAUSE user.

Andreas K. Hüttel
and 4 contributors

NAME

Lab::Moose::Connection::LinuxGPIB - Connection backend to the LinuxGpib library and kernel drivers.

SYNOPSIS

 use Lab::Moose
 
 my $instrument = instrument(
     type => 'random_instrument',
     connection_type => 'LinuxGPIB',
     # use primary address '1' and no secondary addressing.
     connection_options => {pad => 1, timeout => 3},
 );

DESCRIPTION

This module provides a connection interface to Linux-GPIB. See Lab::Measurement::Backends for more information on Linux-GPIB and it's Perl backend.

METHODS

new

The constructor takes the following attributes. The only required attribute is pad.

pad (or gpib_address for backwards compatibility with Lab::Connection::LinuxGPIB)

Primary address of the device. Required.

sad

Secondary address of the device. Default is 0 (Do not use secondary addressing). Valid values are ( 96 .. 126 ).

board_index

Board index as provided in your /etc/gpib.conf. Default is 0.

timeout

Connection timeout in seconds. Default is 1. LinuxGPIB provides the following timeout values. The value given to the constructor will be rounded upwards to a valid timeout.

  • 0 (never timeout)

  • 10e-6

  • 30e-6

  • 100e-6

  • 300e-6

  • 1e-3

  • 3e-3

  • 10e-3

  • 30e-3

  • 100e-3

  • 300e-3

  • 1

  • 3

  • 10

  • 30

  • 100

  • 300

  • 1000

METHODS

All methods croak if they take longer than the timeout.

The 'timeout' argument is always optional. If given, this overrides the connection's timeout attribute.

Read

 my $data = $connection->Read();

Call ibread on the connection. Read an arbitrary amount of data until the 'END' bit is set in ibsta. Croak on read errors.

The read may requires multiple calls to ibrd. In this case, it will still croak if the total time of operation does not exceed the timeout.

Write

 $connection->Write(command => "*CLS");

Takes one mandatory argument 'command'. Write this string to the connection. Croak on write error.

Clear

 $connection->Clear();

Call device clear (ibclr) on the connection.