Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA doesn't talk to USB Tektronix oscilloscope on RH4 WS Linux although works well on Windows XP

I'm trying to port my Labview 8.2 application from Windows XP to Red
Hat Enterprise Linux WS release 4, kernel 2.6.9-11.ELsmp.
It communicates to a Tektronix TDS2024B oscilloscope through the VISA 4.0
interface and works well under Windows XP.  However it doesn't work
under Linux.

The oscilloscope is seen by both the visaconf and the NIvisaic (Interactive
Control) under Linux. I tried to communicate to the scope through
NIvisaic under Windows XP and Linux and it's here where I already see
the difference. I did two identical procedures under XP and Linux:

1) Start NIvisaic
2) Open (double click) the scope which is seen as
   USB0::0x0699::0x036A::C031476::INSTR
3) Write "*IDN?/n" with an viWrite Tab
4) Read the response with viRead

In the case of XP all steps are success and I read back
TEKTRONIX,TDS 2024B,C031446,CF:91.1CT FV:v22.01\n

In the case of Linux steps (1) and (2) seem to go well, but (3),(4)
return with an 0xBFFF0015 error, which is timeout out expiration.
I tried to increase the timeout up to 10sec (viSetAttribute Tab seems
to work fine) it didn't help. I worked under root account on the linux
system and usb file system was mounted.

My next step was installing the latest VISA 4.2. The installation
process was reported to be successful, but I'm having all exactly the
same problems when trying to communicate to the oscilloscope.

Thanks in advance for your help.
0 Kudos
Message 1 of 31
(7,921 Views)
I am assuming that you have installed the latest NI-VISA 4.2 - Linux. Within the NI-VISA 4.2 - readme.txt associated with this driver, there is a section referred to as USB ISSUES ON LINUX. This section has many troubleshooting steps that should be taken when using a USB device with Linux.

I would recommend trying out these suggestions. Please let me know if you are still seeing the same issue.

Hope this is able to help. Thanks.
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 31
(7,896 Views)
>I am assuming that you have installed the latest NI-VISA 4.2 - Linux.
     Correct.

>Within the NI-VISA 4.2 - readme.txt associated with this driver, there is a section referred to as USB ISSUES ON LINUX. This section has many troubleshooting steps that >should be taken when using a USB device with Linux.
    I've read this document. The only issues it discuses are mounting a usbfs and having the right permission for an access. I'm clear on both issues. I checked this directly and without the usbfs mounted and proper permission set NIvisaic would not be able to list my device and open it. The first falure is when I try to write to the device (the scope).

...

0 Kudos
Message 3 of 31
(7,892 Views)
Are you sending the command "*IDN?\n" ? The previous post had the incorrect command written.

Could you take an NI Spy capture of the communication being done. Please reference the following KnowledgeBase 40ODPBHZ: How Do I Use NI Spy for Linux? for more information on NI Spy in Linux.

Thanks
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 31
(7,886 Views)
>Are you sending the command "*IDN?\n" ?
  Sorry that was a typo. I do send
"*IDN?\n". I send whatever is default in the viWrite Tab in NIvisaic.

>Could you take an NI Spy capture of the communication being done. Please reference the following KnowledgeBase 40ODPBHZ: How Do I Use NI Spy for Linux? for more >information on NI Spy in Linux.
The following is NI Spy output exported to a .txt file. It corresponds to the procedure decribed in my first post plus the closing of the NIvisaic application itself (steps 8,9,10):

NIvisaic

1.  viOpen (0x081BDB68, "USB0::0x0699::0x036A::C0314...", 0, 0, 0x081DF3D8)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:13.719       Call Duration 00:00:00.008
Status: 0 (VI_SUCCESS)

2.  viGetAttribute (0x081DF3D8, INTF_TYPE, 7)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:13.727       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

3.  viGetAttribute (0x081DF3D8, RSRC_NAME, "USB0::0x0699::0x036A::C0314...")
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:13.727       Call Duration 00:00:00.003
Status: 0 (VI_SUCCESS)

4.  viGetAttribute (0x081DF3D8, TMO_VALUE, 2000)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:13.752       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

> 5.  viWrite (0x081DF3D8, "*IDN?.", 6, 0)
> Process ID: 0x000029B9         Thread ID: 0x0033BBA0
> Start Time: 14:33:23.599       Call Duration 00:00:02.018
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 6.  viRead (0x081DF3D8, 0x082051F8, 1024, 0)
> Process ID: 0x000029B9         Thread ID: 0x0033BBA0
> Start Time: 14:33:32.871       Call Duration 00:00:04.024
> Status: 0xBFFF0015 (VI_ERROR_TMO)

7.  viClose (0x081DF3D8)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:51.982       Call Duration 00:00:00.004
Status: 0 (VI_SUCCESS)

8.  viClose (0x081BAE50)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:58.882       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

9.  viSetAttribute (0x081BDB68, 0x3FFF018C, VI_TRUE)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:58.888       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

10.  viClose (0x081BDB68)
Process ID: 0x000029B9         Thread ID: 0x0033BBA0
Start Time: 14:33:58.888       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

0 Kudos
Message 5 of 31
(7,884 Views)
From looking at the NI Spy, the following line:

> 5.  viWrite (0x081DF3D8, "*IDN?.", 6, 0)

It shows that you are currently writing the wrong command. Which then would cause the viRead to time-out.
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 31
(7,880 Views)
>> 5.  viWrite (0x081DF3D8, "*IDN?.", 6, 0)

>It shows that you are currently writing the wrong command. Which then would cause the viRead to time-out.
    I think it's NISpy that replaces unprintable character \n by a dot in its diagnostic output. I'm sure I send a correct command. If it's really the dot - it's a bug in the NIvisaic application or in an underlying library.
    Any way to check?
0 Kudos
Message 7 of 31
(7,878 Views)
Through testing, you are correct that NI Spy does replaces unprintable character \n by a dot in its diagnostic output. Sorry for that confusion.

I will continue looking into this issue for you.
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 8 of 31
(7,863 Views)
Can you also post a NI Spy from the Windows XP? Where you are able to get the device working properly and display the expected result.

Thanks
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 9 of 31
(7,859 Views)
>Can you also post a NI Spy from the Windows XP? Where you are able to get the device working properly and display the expected result.

1.  viOpen (0x00C500E0, "USB0::0x0699::0x036A::C0314...", 0, 0, 0x00C4F370)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:26.989       Call Duration 00:00:00.047
Status: 0 (VI_SUCCESS)
 
2.  viGetAttribute (0x00C4F370, INTF_TYPE, 7)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:27.036       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
 
3.  viGetAttribute (0x00C4F370, RSRC_NAME, "USB0::0x0699::0x036A::C0314...")
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:27.036       Call Duration 00:00:00.015
Status: 0 (VI_SUCCESS)
 
4.  viGetAttribute (0x00C4F370, TMO_VALUE, 2000)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:27.161       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
 
5.  viWrite (0x00C4F370, "*IDN?.", 6, 6)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:36.895       Call Duration 00:00:00.016
Status: 0 (VI_SUCCESS)
 
6.  viRead (0x00C4F370, "TEKTRONIX,TDS 2024B,C...", 1024, 48)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:46.161       Call Duration 00:00:00.015
Status: 0 (VI_SUCCESS)
 
7.  viClose (0x00C4F370)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:46:55.380       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
 
8.  viClose (0x00BEEE48)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:47:02.817       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
 
9.  viSetAttribute (0x00C500E0, 0x3FFF018C, VI_TRUE)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:47:02.817       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
 
10.  viClose (0x00C500E0)
Process ID: 0x000013F0         Thread ID: 0x00000F44
Start Time: 17:47:02.817       Call Duration 00:00:00.031
Status: 0 (VI_SUCCESS)
 

0 Kudos
Message 10 of 31
(7,848 Views)