The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lab::Moose::Connection::Socket - Transfer IEEE 488.2 / SCPI messages over TCP

VERSION

version 3.651

SYNOPSIS

 use Lab::Moose;

 my $instrument = instrument(
     type => 'random_instrument',
     connection_type => 'Socket',
     connection_options => {
         host => '132.199.11.2',
         port => 5025
     },
 );

DESCRIPTION

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 is given an explicit read_length parameter

Keep calling sysread until read_length bytes are read.

Read is not given an explicit read_length parameter

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.

CONNECTION OPTIONS

host

Host address.

port

Host port.

write_termchar

Append this to each write command. Default: "\n".

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 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.