Spudnick

Is it possible to control VISA USB Devices via

4 posts in this topic

#1 ·  Posted (edited)

Hey,

I'm working with an Aligent Oscilloscope. Now I wanted to control it from my PC via Autoit and I found out, that the Visa.au3 is alredy included. But the help is just something about GPIB and TCP/IP.

I already foud out about the adress of my device: USB0::0x0957::0x0588::cn49302469::0::INSTR

Using the Software "Agilent IO Control" it is possible to control the device with the build in "Interactive IO"

I tried to use the code given by the example, but it dosn't connect

#include <Visa.au3>



MsgBox(0, "Step 1", "Open the instrument connection with _viOpen")
Local $h_instr = _viOpen("USB0::0x0957::0x0588::cn49302469::0::INSTR")
MsgBox(0, "Instrument Handle obtained", "$h_instr = " & $h_instr) ; Show the Session Handle
; Query the instrument

MsgBox(0, "Step 2", "Query the instrument using the VISA instrument handle")
Local $s_answer = _viExecCommand($h_instr, "*IDN?") ; $h_instr is NOT A STRING now!
MsgBox(0, "GPIB QUERY result", $s_answer) ; Show the answer
; Query again. There is no need to OPEN the link again

Does anybody know how to make it working self-sufficient with autoit

Edited by Spudnick

Who needs USA... we already got USB :shifty:

Share this post


Link to post
Share on other sites



Can't answer your precise question. All I had working some time ago was using National Instrument software and device drivers to manage a GPIB-ENET network (VISA interface). I have zero experience with Agilent software but normally VISA is build for abstracting the connection layer.

Are you sure you don't miss a driver layer in your setup?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

I think if there is a driver missing it's missing in my script, because with the original program is working fine. Is that what you mean? Untill now i wasn't able to get a working connection. If the oscilloscope is getting any order by USB it is changeing to the remote mode, but it still doesn't if I run my script. Does it make a difference if I am working on a 64 or a 32 bit system? So I have a 64 bit win7 PC. I already changed the .dll in the Visa.au3 from visa32.dll to visa64.dll. I have verified that both are there in the system32 Folder.

With the "32.dll i get the errorcode -2. With the "64.dll i get a -1 error.


Who needs USA... we already got USB :shifty:

Share this post


Link to post
Share on other sites

I'm afraid that my poor experience isn't helpful in your case. When compiling for 32-bit then use the 32-bit dll in system32. That should be working since drivers are available. Sorry I can't give you useful advice here.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now