Andreas K. Hüttel
and 1 contributors


Lab::VISA::Installation - Installation guide for Lab::VISA

Installation on Windows

  • Install a recent version of Strawberry Perl (5.26 or later).

  • Install NI-VISA and the drivers required for your instruments. E.g. for GPIB you need the NI IEEE-488.2 driver.

  • Build and install with

     cpanm Lab::VISA
  • Have fun!

Installation on Linux

As a Linux user you will probably be able to figure out things yourself. Here is a rough outline:

  • Before you start, you must have the VISA library by National Instrument installed. If you plan to use GPIB connections (which is very likely), you must also have the necessary drivers (NI-488.2) for your GPIB adapter card installed. Refer to National Instruments' very good documentation for additional information:

  • In file Makefile.PL adapt the LIBS and INC settings according to your installation. This is what worked for me:

        'LIBS'         => ['-lvisa'],
        'INC'          => '-I/usr/local/vxipnp/linux/include/',
  • Then do the usual

        perl Makefile.PL
        make install

Testing the installation

Here is a quick test program that you can run with perl -Mblib

    use Lab::VISA;
    my ($status, $sesn) = Lab::VISA::viOpenDefaultRM();
    printf "status: %x (%s)\n", $status, (($status == $Lab::VISA::VI_SUCCESS) ? "success" : "no success");
    print "sesn: $sesn\n";
    my ($status, $findList, $retcnt, $instrDesc) = Lab::VISA::viFindRsrc($sesn, "ASRL1::INSTR"); 
    printf "status: %x (%s)\n", $status, (($status == $Lab::VISA::VI_SUCCESS) ? "success" : "no success");
    print "findList: $findList\n";
    print "retcnt: $retcnt\n";
    print "instrDesc: $instrDesc\n";


  (c) 2010,2011 Daniel Schröer, Andreas K. Hüttel, Daniela Taubert, and others.
      2012      Andreas K. Hüttel
      2016      Simon Reinhardt, Andreas K. Hüttel
      2019      Simon Reinhardt