#!/usr/bin/perl
#----------

use strict;
use POSIX qw(setsid);
use Getopt::Std;
use Time::HiRes qw(usleep time gettimeofday);
use LinuxGpib;
use n8ur qw(trim squash parse_value);

my $device = "2100F";
my $j;
my $command;
my $reading;
my $counter = 1;
my $gpib_status;
my $tmp_val;
my $tmp_suffix;

#----------
# initialize instrument
my $dev = LinuxGpib::ibfind($device) ||
	die "Can't open device $device!\n";

#----------
# Send command
$command = "0R1";
LinuxGpib::ibwrt($dev,$command,length($command));
sleep 6;
$command = "87900R0";
LinuxGpib::ibwrt($dev,$command,length($command));
sleep 5;
$command = "1R1R9";
LinuxGpib::ibwrt($dev,$command,length($command));
LinuxGpib::ibrd($dev,$reading,12);
print "Reading: $reading\n";
