Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Error 0xBFFF003E with USB RAW

Windows 7 Professional 64-bit

Labview 2010SP1

NI-VISA 5.0

 

Greetings,

 

I've written some Labview code to interface with an instrument using USB RAW communications. There is no Labview driver for this instrument. Things work ok for the most part, but periodically I get error 0xBFFF003E (Could not perform operation because of I/O error.) when I do a VISA Read. I've searched through the discussion boards and most references to this error seem to relate to RS-232 communications problems. I haven't seen much discussed regarding USB comms.

 

When this error occurs, I will continue to receive the error on every subsequent VISA Read. The only cure I've found is to call VISA Clear after this error is detected. This seems to work ok but is a pretty ugly solution, and it also causes a little bit of a delay in the code during which the user can no longer interact with the device.

 

In a nutshell, my Labview code has two loops. One loop is a queued message handler that handles user interaction, and when nothing else is going on it sends some status requests to the instrument once/second. The 2nd loop calls VISA Read continually with a 50ms timeout. Most iterations this will generate a timeout error since there's nothing to read. Once per second it will return the status data requested from the instrument. Then, once in a while I get the I/O error. Here is a brief capture from I/O Trace that shows a little bit of the normal functionality and the error at the end (event 112). Thanks for any suggestions.

 

Dave

 

95.  VISA Write ("pico3", "TER2?.")
Process ID: 0x00000828         Thread ID: 0x000040F8
Start Time: 07:26:18.782       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

96.  VISA Read ("pico3", 512, "TER 2,00000..", 13)
Process ID: 0x00000828         Thread ID: 0x000040F8
Start Time: 07:26:18.783       Call Duration 00:00:00.003
Status: 0 (VI_SUCCESS)

> 97.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:18.787       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 98.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:18.888       Call Duration 00:00:00.102
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 99.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:18.990       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 100.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.092       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 101.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.193       Call Duration 00:00:00.102
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 102.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.296       Call Duration 00:00:00.102
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 103.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.398       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 104.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.499       Call Duration 00:00:00.102
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 105.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.602       Call Duration 00:00:00.102
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 106.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.704       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 107.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000038D8
> Start Time: 07:26:19.805       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

108.  VISA Write ("pico3", "TMP?.")
Process ID: 0x00000828         Thread ID: 0x000040F8
Start Time: 07:26:19.907       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

109.  VISA Read ("pico3", 512, "TMP +028..", 10)
Process ID: 0x00000828         Thread ID: 0x000040F8
Start Time: 07:26:19.907       Call Duration 00:00:00.004
Status: 0 (VI_SUCCESS)

> 110.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:19.912       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 111.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:20.013       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)

> 112.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:20.115       Call Duration 00:00:00.001
> Status: 0xBFFF003E (VI_ERROR_IO)

113.  VISA Clear ("pico3")
Process ID: 0x00000828         Thread ID: 0x000040F8
Start Time: 07:26:20.116       Call Duration 00:00:00.001
Status: 0 (VI_SUCCESS)

> 114.  VISA Read ("pico3", 512, 0)
> Process ID: 0x00000828         Thread ID: 0x000040F8
> Start Time: 07:26:21.120       Call Duration 00:00:00.101
> Status: 0xBFFF0015 (VI_ERROR_TMO)


0 Kudos
Message 1 of 6
(3,989 Views)

Hello Jabson,

 

Could you post your code or a screenshot of it?

 

Regards,

0 Kudos
Message 2 of 6
(3,977 Views)

Also check the power comsumption of your device and the power stability of your USB hub (if using one).

 

Even some motherboard USB ports have dodgy power supply and I've come accross this problem in the past due to power cycling of devices under use....

 

Hope it helps

 

Shane

0 Kudos
Message 3 of 6
(3,970 Views)

sir ,

  I get the error(timeout expired error before operation complete or system time limit) in the visa read using usb raw resources.i m configure  my instrument(usb mass storage device) in the visa interactive control .how can i overcome it and how to move(or read) the text document into(or from) the usb device.please give the kind response as soon as possible .i m waiting for ur favourable reply........

     

0 Kudos
Message 4 of 6
(3,896 Views)
Why would you want to create a VISA driver for a thumb drive?
0 Kudos
Message 5 of 6
(3,890 Views)

^^

This

 

Why don't you simply use it as a normal drive within the OS, wouldn't that me MUCH easier?

0 Kudos
Message 6 of 6
(3,872 Views)