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

NAME

GPIB::ni - Perl-GPIB interface for National Instruments GPIB device drivers

SYNOPSIS

  use GPIB;

  $g = GPIB->new("name");
  $g->ibwrt('*IDN?');
  print $g->ibrd(1024);

DESCRIPTION

GPIB::ni is an interface module for accessing National Instruments GPIB devices. This XS module builds and has been tested on Linux and Windows NT. This module is normally not used directly, but called by GPIB.pm according to an entry in /etc/pgpib.conf or by calling GPIB->new() and passing GPIB::ni as the first parameter.

A typical /etc/pgpib.conf entry for using GPIB::ni is shown below:

  # name              Board   PAD     SAD     TMO     EOT     EOS
  K2002   GPIB::ni    0       0x10    0       T1s     1       0

The device is used in a Perl program as follows:

  use GPIB;
  $g = GPIB->new("K2002");
  

In the above example, the K2002 entry provides GPIB::ni with 6 parameters that coorespond to the parameters to ibdev() for opening a device. This is the most common form for configuring a GPIB device. Alternatively, if only 1 parameter is supplied for GPIB::ni ibfind() is called to open the device. Here is an example for opening the GPIB directly on GPIB board 0 in a system:

  # /etc/pgpib.conf              
  bus   GPIB::ni    gpib0

  use GPIB;

  $g = GPIB->new("bus");

The intention is that a Perl GPIB program should run identically on a Windows or Linux platform. This is pretty much true but there are a couple of small differences in the NI driver.

The Linux driver deasserts REN when the application closes the driver and exits. NT4.0 seems to leave REN asserted unless the application specifically opens the bus and manually deasserts REN.

CREDIT

This module is loosely based on a Perl XS module Steve Tell at UNC (tell@cs.unc.edu) wrote for accessing GPIB devices from Perl.

AUTHOR

Jeff Mock, jeff@mock.com

SEE ALSO

perl(1), GPIB(3), GPIB::hpserial(3), GPIB::rmt(3).