Lab::Bus::VISA - National Instruments VISA bus
This is the VISA bus class for the NI VISA library.
my $visa = new Lab::Bus::VISA();
or implicit through instrument creation:
my $instrument = new Lab::Instrument::HP34401A({ BusType => 'VISA', }
soon
my $bus = Lab::Bus::VISA({ });
Return blessed $self, with @_ accessible through $self->config().
Options: none
Lab::Bus::VISA throws
Lab::Exception::VISAError fields: 'status', the raw ibsta status byte received from linux-gpib Lab::Exception::VISATimeout fields: 'data', this is meant to contain the data that (maybe) has been read/obtained/generated despite and up to the timeout. ... and all the fields of Lab::Exception::GPIBError
$visa->connection_new({ resource_name => "GPIB0::14::INSTR" });
Creates a new instrument handle for this bus.
The handle is usually stored in an instrument object and given to connection_read, connection_write etc. to identify and handle the calling instrument:
$InstrumentHandle = $visa->connection_new({ resource_name => "GPIB0::14::INSTR" }); $result = $visa->connection_read($self->InstrumentHandle(), { options });
See Lab::Instrument::Read().
Lab::Instrument::Read()
$visa->connection_write( $InstrumentHandle, { command => $command, wait_status => $wait_status } );
Sends $command to the instrument specified by the handle, and waits $wait_status microseconds before evaluating the status.
$visa->connection_read( $InstrumentHandle, { command => $command, read_length => $read_length, brutal => 0/1 } );
Sends $Command to the instrument specified by the handle. Reads back a maximum of $readlength bytes. If a timeout or an error occurs, Lab::Exception::VISAError or Lab::Exception::VISATimeout are thrown, respectively. The Timeout object carries the data received up to the timeout event, accessible through $Exception->Data().
Setting Brutal to a true value will result in timeouts being ignored, and the gathered data returned without error.
Brutal
$visa->connection_query( $InstrumentHandle, { command => $command, read_length => $read_length, wait_status => $wait_status, wait_query => $wait_query, brutal => 0/1 } );
Performs an connection_write followed by an connection_read, each given the supplied parameters. Waits $wait_query microseconds betweeen Write and Read.
Few. Not a lot to be done here.
Lab::Bus::LinuxGPIB
Lab::Bus::MODBUS_RS232
and many more...
Copyright 2004-2006 Daniel Schröer <schroeer@cpan.org>, 2009-2010 Daniel Schröer, Andreas K. Hüttel (L<http://www.akhuettel.de/>) and David Kalok, 2010 Matthias Völker <mvoelker@cpan.org> 2011 Florian Olbrich, Andreas K. Hüttel
This library is free software; you can redistribute it and/or modify it under the same terms as Perl 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.