aboutsummaryrefslogtreecommitdiff
path: root/gpib_test.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2013-11-26 12:08:08 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2013-11-26 12:08:08 -0500
commit60ec9495a0dfdbf08e52eea0e6c828014af06ddc (patch)
tree382e6fca3011ac3493ff7678c6a7f5488ecc05cf /gpib_test.m
downloadlinux-matlab-gpib-60ec9495a0dfdbf08e52eea0e6c828014af06ddc.tar.gz
linux-matlab-gpib-60ec9495a0dfdbf08e52eea0e6c828014af06ddc.zip
init
Diffstat (limited to 'gpib_test.m')
-rw-r--r--gpib_test.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/gpib_test.m b/gpib_test.m
new file mode 100644
index 0000000..8ecf3d4
--- /dev/null
+++ b/gpib_test.m
@@ -0,0 +1,17 @@
+%% Open scope
+%
+% get a handle to the oscilloscope from /etc/gpib.conf
+%
+hscope = gpib_function('ibfind','LECROY_WR');
+%% Write a message
+%
+% Send the *IDN? message to the scope
+%
+[status,write_count] = gpib_function('ibwrt',hscope,'*IDN?');
+fprintf('status = 0x%04X\nwrite_count = %d bytes\n',status,write_count);
+%% Read the reply
+%
+% Show the identifier returned by the LeCroy
+%
+[reply,status,read_count] = gpib_function('ibrdl',hscope,4096);
+fprintf('reply = %s\nstatus = 0x%04X\nread_count = %d bytes\n',strtrim(reply),status,read_count); \ No newline at end of file