Lab::Moose::Connection::Socket - Transfer IEEE 488.2 / SCPI messages over TCP
version 3.613
use Lab::Moose; my $instrument = instrument( type => 'random_instrument', connection_type => 'Socket', connection_options => { host => '132.199.11.2', port => 5025 }, );
This connection uses IO::Socket::INET to interface with the operating system's TCP stack. This works on most operating systems without installing any additional software.
Without knowing the syntax of the used command-messages there is no way for the connection to determine when Read is finished. This is unlike GPIB, USBTMC, or VXI-11 which have explicit End of Message indicators. To deal with this, the read_length parameter has the following semantics:
Read
read_length
Keep calling sysread until read_length bytes are read.
Do a single sysread with the connections default read_length.
For SCPI definite length blocks you will have to give the exact block length with the read_length parameter.
Host address.
Host port.
Append this to each write command. Default: "\n".
"\n"
This software is copyright (c) 2017 by the Lab::Measurement team; in detail:
Copyright 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.