Lab::Moose::Connection::LinuxGPIB - Connection back end to the LinuxGpib library and kernel drivers
version 3.642
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}, );
This module provides a connection interface to Linux-GPIB. See Lab::Measurement::Backends for more information on Linux-GPIB and it's Perl backend.
The constructor takes the following attributes. The only required attribute is pad.
Primary address of the device. Required.
Secondary address of the device. Default is 0 (Do not use secondary addressing). Valid values are ( 96 .. 126 ).
Board index as provided in your /etc/gpib.conf. Default is 0.
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
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.
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.
ibsta
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.
$connection->Write(command => "*CLS");
Takes one mandatory argument 'command'. Write this string to the connection. Croak on write error.
$connection->Clear();
Call device clear (ibclr) on the connection.
This software is copyright (c) 2018 by the Lab::Measurement team; in detail:
Copyright 2016 Simon Reinhardt 2017 Andreas K. Huettel, Simon Reinhardt
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.