diff options
Diffstat (limited to 'libvxi11client/perlbits')
-rw-r--r-- | libvxi11client/perlbits/Client.xs | 5 | ||||
-rw-r--r-- | libvxi11client/perlbits/README | 20 | ||||
-rw-r--r-- | libvxi11client/perlbits/VXI11-Client.t | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | libvxi11client/perlbits/testscript.pl | 10 | ||||
-rw-r--r-- | libvxi11client/perlbits/typemap | 1 |
5 files changed, 10 insertions, 28 deletions
diff --git a/libvxi11client/perlbits/Client.xs b/libvxi11client/perlbits/Client.xs index d8008dd..d471fda 100644 --- a/libvxi11client/perlbits/Client.xs +++ b/libvxi11client/perlbits/Client.xs @@ -123,7 +123,7 @@ vxi_open(address, device) RETVAL void -vxi_read(context, OUTLIST bytesread, OUTLIST buffer, bufferlen, waitlock, termchrset, termchr) +vxi_read(context, OUTLIST bytesread, OUTLIST buffer, bufferlen, waitlock, termchrset, termchr, OUTLIST reason) VXI11::Client context char * buffer int bytesread @@ -131,9 +131,10 @@ vxi_read(context, OUTLIST bytesread, OUTLIST buffer, bufferlen, waitlock, termch bool waitlock bool termchrset char termchr + unsigned int* reason CODE: buffer = malloc(bufferlen + 1); - bytesread = vxi11_read(context, buffer, bufferlen, waitlock, termchrset, termchr); + bytesread = vxi11_read(context, buffer, bufferlen, waitlock, termchrset, termchr, reason); int vxi_readstatusbyte(context, waitforlock) diff --git a/libvxi11client/perlbits/README b/libvxi11client/perlbits/README index ba3e278..d036787 100644 --- a/libvxi11client/perlbits/README +++ b/libvxi11client/perlbits/README @@ -4,26 +4,6 @@ VXI11-Client version 0.01 This module is a wrapper around a C library that uses libc's built in Sun RPC support to talk to VXI11 networked instruments. -It supports only one instrument at a time. - -Interrupts work by creating the interrupt channel, enabling interrupts -and then using wait_for_interrupt() to wait for an interrupt to happen. -wait_for_interrupt() blocks until a interrupt happens or a timeout occurs. -If an interrupt happens before it is called it returns immediately. -If multiple interrupts happen before it is called it will return immediately -until all the fired interrupts are cleared. - -Return codes work like this; -1 - is a success -0 - means the request failed locally, the state inside the client is -incorrect, i.e. calling to enable interrupts before creating the channel -or that the server couldn't be contacted -< 0 - Any negative value is the negated VXI-11 error code from the server - -The only exceptions to this are the read and write methods -0 - Error as above or zero bytes read/written -> 0 - Number of bytes read/written - INSTALLATION To install this module type the following: diff --git a/libvxi11client/perlbits/VXI11-Client.t b/libvxi11client/perlbits/VXI11-Client.t index 0ac3a46..3334d3c 100644 --- a/libvxi11client/perlbits/VXI11-Client.t +++ b/libvxi11client/perlbits/VXI11-Client.t @@ -23,7 +23,7 @@ my $instr = &VXI11::Client::vxi_open("192.168.0.62", 0); is($instr->vxi_lock(0), 1, "Lock"); ok($instr->vxi_write("*IDN?", -1, 0, 0) > 0, "Write"); -my ($bytes, $buff) = $instr->vxi_read(256, 0, 0, 0); +my ($bytes, $buff, $reason) = $instr->vxi_read(256, 0, 0, 0); print "got " . $bytes . ";" . $buff . "\n"; ok($bytes > 0, "Read"); diff --git a/libvxi11client/perlbits/testscript.pl b/libvxi11client/perlbits/testscript.pl index 2f06434..f588aaf 100755..100644 --- a/libvxi11client/perlbits/testscript.pl +++ b/libvxi11client/perlbits/testscript.pl @@ -5,19 +5,19 @@ use warnings; use VXI11::Client; -&VXI11::Client::vxi_startinterruptserver(); +vxi_startinterruptserver(); -my $instr = &VXI11::Client::vxi_open("192.168.0.62", 0); +my $instr = vxi_open("192.168.0.62", 0); $instr->vxi_lock(0); $instr->vxi_write("*IDN?", -1, 0, 0); -my ($bytes, $buff) = $instr->vxi_read(256, 0, 0, 0); +my ($bytes, $buff, $reason) = $instr->vxi_read(256, 0, 0, 0); print "got " . $bytes . ";" . $buff . "\n"; $instr->vxi_readstatusbyte(0); $instr->vxi_create_intr_chan(); $instr->vxi_enable_srq(1, "myhandle"); -&VXI11::Client::vxi_wait_for_interrupt(); +vxi_wait_for_interrupt(); $instr->vxi_enable_srq(0, ""); $instr->vxi_destroy_intr_chan(); $instr->vxi_abort(); @@ -29,4 +29,4 @@ $instr->vxi_unlock(); $instr->vxi_close(); -&VXI11::Client::vxi_stopinterruptserver(); +vxi_stopinterruptserver(); diff --git a/libvxi11client/perlbits/typemap b/libvxi11client/perlbits/typemap index 2434aaa..3b9a362 100644 --- a/libvxi11client/perlbits/typemap +++ b/libvxi11client/perlbits/typemap @@ -1,2 +1,3 @@ VXI11Context * T_PTROBJ VXI11::Client T_PTROBJ +unsigned int * T_IV |