Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB communication using VISA

Hello,

I'm trying to make a PC under Linux commuinicate with a TDS2004b scope.

1* I first tried to use the visa driver, but there was a problem : Only the first script worked, and the next ones needed the scope to be unplugged, and plugged again.
2* Then, I tried with LibUSB. And I almost succeded : I can launch several scripts.

But my problem, now, is that If I ever unplug and replug the scope, I can't communicate anymore with the scope!
I launched many tests, and finally, I found that the ONLY way to make the communications work again is to launch one of the first scripts using the VISA library (1)!


It seems that some commands sent while using the VISA library make the scope work again!
So, I'd like to get the functions, the commands sent by the VISA library, during a basic communication (open session, write *idn?, read, close session).

Thanks in advance
Message 1 of 9
(5,096 Views)
There is a french version of this post here

First answers have been received, and more details about the problem have been given.
0 Kudos
Message 2 of 9
(5,062 Views)
Can somebody translate the French version to English (UK or US)
greetings from the Netherlands
0 Kudos
Message 3 of 9
(5,034 Views)

Try babelfish and copy paste the page address and select French to English. Worked fine for me.

http://babelfish.altavista.com/

And it even translates the stars! So a French star is equivalent to an English star! wink smiley

Message Edited by AnalogKid2DigitalMan on 01-26-2007 02:00 PM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 4 of 9
(5,030 Views)
thanks
greetings from the Netherlands
0 Kudos
Message 5 of 9
(5,011 Views)
"Can somebody translate the French version to English (UK or US)"

As requested, I'll try to give here a translation of the french version.


Me:

Hello,

I've succeded, using LibUSB, to communicate correctly with a TDS 2004b digital scope, under debian :
- several scripts can be launched without any problem
- results (information read from the scope) are correct

But a problem remains : if the USB cable is _unplugged_, it then becomes impossible to communicate with the scope.
After the scope is restarted, or even after the PC has been rebooted, communication are still impossible.

The only way I found to activate communications again, is to send a command with a program using the VISA library, under Windows!!!

Once this command has been sent, I can come back under Debian, and then, all script commands will work correctly (until the next unplug, or the next power problem)



So, that means that there's quite simple commands, launched by the VISA library, which make the scope work again!
For these simple instructions :
- establish connection
- send "*idn?"
- get answer
- close connection

Could you tell me the differents commands sent by VISA to the scope, and also the values of these commands, if possible?


Thanks

jp_Braud :

Hello, Rrado,

The NI-VISA driver doesn't send any particular request (except -for supported device- if required in the serial communication specification). I would personnaly say it is due to an activation made by windows, when initializing USB ports. Please, notice that the DEBIAN version isn't supported by National Instruments, for the moment.



Me:

Hello,
"I would personnaly say it is due to an activation made by windows, when initializing USB ports"

I also thought at first, that it was the reason. But I did many tests, once the communication was impossible :

- Only under debian :
1. restart scope ==> no communication possible
2. restart PC (still under debian) ==> no communication possible
3. restart PC (still under debian) and restart the scope ==> no communication possible


- With windows :
4.     - restart PC under windows
    - The scope is detected by windows
    - restart PC under Debian
     ==> no communication possible

5.     - restart PC under windows
    - The scope is detected by windows
    - Open the program (using visa) which allows us to communicate with the scope, but without sending any command
    - restart PC under Debian
     ==> no communication possible

6.     - restart PC under windows
    - The scope is detected by windows
    - Open the program (using visa) which allows us to communicate with the scope
    - send a query (for instance : *idn?)
    - restart PC under Debian
     ==> Communications work again


I think, you'll agree with me : these tests make us really think that the program sending instructions to the scope, using Visa, sends a commands that unlocks communications...
Maybe, it is a command that initializes the device? a command that sets to zero all registers? or even a "commonplace" command I haven't thought of?


I can launch other tests if required (under debian, or under windows).



Me:

Hello,

I wanted to give more informations about this topic :
As I told at the beginning of this topic, I'm using LibUSB.

I already tried to use VISA.
But even if I launched my tests under Mandrake, I didn't get any answer that would help to resolved my problem (in this topic).


And that's why I tried LibUSB, which satisfies me almost completely : the bug that requires to reboot under Windows, and to send a query by using VISA, remains


0 Kudos
Message 6 of 9
(4,997 Views)
* the topic I talked about was this one
0 Kudos
Message 7 of 9
(4,996 Views)

Bump.

 

I'm seeing the same problem. I'm using the current VISA (4.4) on OpenSuse 10.3 (Which is officially supported).

 

The problem is, I can only run one "session" with the scope at a time. I can open the scope, send commands, and close the scope just fine.

 

If I want to open the scope again, it will open just fine, and allow me to set attributes (Time out etc) but as soon as I write a command, it times out. In order to bring the scope back online, I have to unplug the USB cable, and plug it in again.

 

I plan on running the scope from a remote location, so living with it, and physically unplugging each time is not an option. Were you able to find a solution rrado? Using LibUSB would be fine as long as I know I can get it to work before I go through the trouble of changing my code. Also, if there was a way I could simulate the unplugging and replugging of the USB cable (Restarting the USB service or something along those lines) that would be fine as well.

 

I should note that the scope works perfectly in Windows, no trouble at all.

 

Thanks,

Jeff 

0 Kudos
Message 8 of 9
(4,468 Views)

Ok, so I can restart the entire USB infrastructure (via rmmod "...", then modprobe "..."). This makes the scope usable again.

 

It would be nice to have the scope work without hiccups, but this solution meets my requirements for "acceptable."

 

Jeff 

0 Kudos
Message 9 of 9
(4,466 Views)