diff options
Diffstat (limited to 'libvxi11client/perlbits')
-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 a170c6c..65e544f 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?"); @@ -371,7 +371,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"; @@ -396,15 +396,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. |