summaryrefslogtreecommitdiff
path: root/libvxi11client/perlbits/testscript.pl
blob: b56497774ab7c903be0f773df39a8daa36062928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl

use strict;
use warnings;

use VXI11::Client;

vxi_startinterruptserver();

my $instr = vxi_open("myipaddr");

$instr->vxi_lock();
$instr->vxi_write("*idn?");
my ($bytes, $buff, $reason) = $instr->vxi_read();
print "got " . $bytes . ";" . $buff . " reason " . $reason ."\n";

my ($error, $statusbyte) = $instr->vxi_readstatusbyte();
printf "status byte is " . $statusbyte . "\n";

$instr->vxi_create_intr_chan();
$instr->vxi_enable_srq("myhandle");

for (my $i = 0; $i < 10000; $i++) {
	vxi_wait_for_interrupt();
}
$instr->vxi_disable_srq();
$instr->vxi_destroy_intr_chan();
$instr->vxi_abort();
$instr->vxi_clear();
$instr->vxi_trigger();
$instr->vxi_local();
$instr->vxi_remote();
$instr->vxi_unlock();

$instr->vxi_close();

vxi_stopinterruptserver();