Lab::VXI11 - Perl interface to VXI-11 Test&Measurement backend
use Lab::VXI11; my $client = Lab::VXI11->new('132.199.1.2', DEVICE_CORE, DEVICE_CORE_VERSION, "tcp"); ($error, $lid, $abortPort, $maxRecvSize) = $client->create_link(0, 0, 0, "inst0"); # Send "*IDN\n" command and read answer. ($error, $size) = $client->device_write($lid, 1000, 0, 0, "*IDN?\n"); ($error, $reason, $data) = $client->device_read($lid, 100, 1000, 0, 0, 0); ($error) = $client->destroy_link($lid);
Raw XS interface for VXI-11. Uses Sun's RPC library and C-code created by rpcgen.
The VXI-11 API is documented in the VXI-11 specification. A good tutorial can be found in Agilent's application note Using Linux to Control LXI Instruments Through VXI-11.
With most Unix platforms, Sun's RPC library (sunrpc) is part of the libc and Lab::VXI11 does not have any dependencies. If your system uses GNU C library (glibc) (default libc on Linux), note that sunrpc is deprecated as of glibc 2.26. If sunrpc is not contained in the libc, you can install libtirpc as an replacement, e.g.
$ apt-get install libtirpc-dev pkg-config
Lab::VXI11 can then be installed with any CPAN client:
$ cpanm Lab::VXI11
On Windows this module is untested (VISA contains a VXI11 driver).
See the VXI-11 specs for more details.
$client = Lab::VXI11->new($host, $prog, $vers, $proto);
($erro, $lid, $abortPort, $maxRecvSize) = $client->create_link($clientId, $lockDevice, $lock_timeout, $device);
($error, $size) = $client->device_write($lid, $io_timeout, $lock_timeout, $flags, $data);
($error, $reason, $data) = $client->device_read($lid, $requestSize, $io_timeout, $lock_timeout, $flags, $termChar);
$termChar needs to be a number, e.g. ord("\n").
$termChar
ord("\n")
($error, $stb) = $client->device_readstb($lid, $flags, $lock_timeout, $io_timeout);
($error) = $client->device_trigger($lid, $flags, $lock_timeout, $io_timeout);
($error) = $client->device_clear($lid, $flags, $lock_timeout, $io_timeout);
($error) = $client->device_remote($lid, $flags, $lock_timeout, $io_timeout);
($error) = $client->device_local($lid, $flags, $lock_timeout, $io_timeout);
($error) = $client->device_remote($lid, $flags, $lock_timeout);
($error) = $client->device_unlock($lid);
($error) = $client->device_enable_srq($lid, $enable, $handle);
($error, $data_out) = $client->device_docmd($lid, $flags, $io_timeout, $lock_timeout, $cmd, $network_order, $datasize, $data_in);
($error) = $client->destroy_link($lid);
($error) = $client->create_intr_chan($hostAddr, $hostPort, $progNum, $progVers, $progFamily);
($error) = $client->destroy_intr_chan();
Please report bugs at https://github.com/lab-measurement/Lab-VXI11/issues.
Feel free to contact us at the #labmeasurement channel on Freenode IRC.
Blog post on Lab::VXI11 and USB::TMC
Simon Reinhardt, <simon.reinhardt@stud.uni-regensburg.de>
Copyright (C) 2017 by Simon Reinhardt
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.0 or, at your option, any later version of Perl 5 you may have available.
To install Lab::VXI11, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lab::VXI11
CPAN shell
perl -MCPAN -e shell install Lab::VXI11
For more information on module installation, please visit the detailed CPAN module installation guide.