diff options
author | daniel <danieruru@gmail.com> | 2013-02-01 00:12:47 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-02-01 00:12:47 +0900 |
commit | 555484190c43a218a987a11a55f2f8e6a4d40af0 (patch) | |
tree | d00ceef3c6699f62d7b7ded3cf0d6b30986320fa | |
parent | b87d806354d4faafea4b27b7f31ab4db5216c5b1 (diff) | |
parent | 7fd7a5c0241173f88762bcfd9c7a1d9c64b336eb (diff) |
Merge branch 'master' of grenfell.avtechpulse.com:Instrument
-rw-r--r-- | libvxi11client/perlbits/Client.pm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libvxi11client/perlbits/Client.pm b/libvxi11client/perlbits/Client.pm index 3af8fdf..79f7029 100644 --- a/libvxi11client/perlbits/Client.pm +++ b/libvxi11client/perlbits/Client.pm @@ -191,7 +191,7 @@ VXI11::Client - Perl module for interfacing with VXI-11 networked test and measu vxi_startinterruptserver(); - my $instr = vxi_open(address => "192.168.0.62"); + my $instr = vxi_open(address => "192.168.0.62") or die; $instr->vxi_lock(); $instr->vxi_write("*idn?"); @@ -368,7 +368,7 @@ The only exceptions to this are the read and write methods: use warnings; use VXI11::Client; - my $instr = vxi_open( address => "192.168.0.62" ); + my $instr = vxi_open( address => "192.168.0.62" ) or die; $instr->vxi_write("*idn?"); my ( $bytes, $idn, $reason ) = $instr->vxi_read(); print "This instrument is: $idn\n"; @@ -393,15 +393,17 @@ The only exceptions to this are the read and write methods: my $device = 0; # Only revelant if a VXI-to-GPIB # gateway is used. - my $prompt = "\n> "; - print "\nType your commands. Ctrl+C to exit\n" . $prompt; - vxi_startinterruptserver(); # Launch a server to handle # interrupts from the instrument. my $my_interrupt_handle = "Avtech"; # Each interrupt source needs a name. + print "\nTrying to establish link with $ip_addr..."; + my $instr = vxi_open( address => $ip_addr, device => $device ) or die "Could not open instrument at $ip_addr."; + my $prompt = "\n> "; + print " OK\nType your commands. Ctrl+C to exit\n" . $prompt; + $instr->vxi_write("*ese 60"); # Flag command-related errors. $instr->vxi_write("*sre 48"); # Request service when a response is # available, or an error has occurred. |