Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve the NI-VISA I/O Error 0xBFFF003E?

Currently I meet an NI-VISA I/O Error,which refers to hex code"0xBFFF003E",when i try to design a VI to control 2 HP GPIB devices within one block diagram using LabVIEW 5.0 on a WinNT PC.The two devices that i am trying to control are Agilent 33120A Function Generator & HP83712B Synthesized CW Generator.

I first developed one VI for each device controlling respectively, the two VIs works fine for their corresponding devices. Then I combined the two VIs' block diagrams into one so as to control the 2 devices using a combined GUI. On the combined block diagram, I still use two VISA class sessions, one for each device controls.

I think there should be no problem since the individual VI for each device works fine. Howeve
r, when i run the combined VI, there's an error comes out for VISA Write in, and the "error explanation" states its "Possible Reasons" as:
VISA: (Hex 0xBFFF003E) Could not perform operation because of I/O error.

I am wondering how come the individual VI works fine, but when combine them together there comes out an error.

The most magic thing is, when i use the hightlighting debugging techniques, the error disappears and the combined VI works fine as well!!!

But it seems not so stable, therefore, it's better to find a way to fix the error... but how can i fix the I/O Error in NI-VISA?

Thanks for anyone's kind help!
0 Kudos
Message 1 of 6
(12,126 Views)
Hello,

It sounds like you have a "race condition" in your instrument I/O VI's. This means that depending on how LabVIEW executes the two independent pieces of code and how it interleaves each subVI, the operation may work or not work. I would encourage you to use the "error" cluster to show LabVIEW in what order everything should be executed by running the error cluster through each subVI in the order in which it needs to be executed, or using other dataflow programming techniques to do this. My guess is that enabling highlight execution is changing the order in which unconnected subVI's are executing, making this work just fine.

If you do still have problems, please let me know more about the layout of your overall block diagram. Are you using GPIB or s
erial communication?

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(12,126 Views)
Hi,I am using GPIB communication.

Actually i have used the "error" cluster and "VISA session (class)" as a pair of dataflow through each subdiagram and subVI to show each device the correct way of dataflow in my original program. But the problem comes out. The program can only work normally when "high light execution"....since that will slow down the program execution speed,i guess maybe i should put some timer (such as Wait(ms), etc.)into my "for loop" for the two subdiagrams?

The attachments are my block diagram. all subVI also included in the folder. The main VI is named "PS&SG_sweep_try3_subVI.vi".
0 Kudos
Message 3 of 6
(12,126 Views)
I still believe that this issue is caused by a race condition. Your case structures are all independent, and may be running in different threads in the LabVIEW execution engine. Sometimes the VI's run in one order, sometimes in another. I noticed also that you had an "Old" VISA open VI that could be causing some issues, so replace that one by simply deleting it and re-adding it from the pallette.

Adding a wait may fix your problem, but it will not get to the root cause. What VI is giving you the unknown I/O error that you see above? Does it happen immediately, or after the VI has been running for some time? Could you get an NI-Spy capture so that I can see what's going on and post it here?

Also, I would like to know your VISA Version
and your LabVIEW version.

Thanks,
Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(12,126 Views)
I think my VISA version is 1.0 or so, and for the LabVIEW version, it is 5.0 (very old one, actually....)

The VI that give the I/O error sometimes is the function generator, but sometimes is the power supply....it happens when the VI has been running for some time.

Em...what do you mean by "replacing an old VISA open VI by simply deleting it and re-adding it from the pallette"? I thought all "VISA open" function under the same VISA version should be the same, right? How come it will become "old"???

For the "NI-Spy capture", how can I make use of it? As I am just a beginner for LabVIEW programming, so not very clear the feature provided by NI supporting softwares like NI-Spy. Where can I get the necessary tutorials for it? Hopefully,
with the help of it I can tell you this problem more clearly and finally solve the error.
0 Kudos
Message 5 of 6
(12,126 Views)
Hello again,

I'm sorry, I didn't realize that you were using LabVIEW 5.0, so that's what I meant by the "Old" Visa VI's (they appear as old when I opened your VI up in LabVIEW 7.0). Though I'm not sure if NI-Spy came with VISA 1.0 (could you check to see your VISA version for sure?), you can find information on using it here: http://zone.ni.com/devzone/conceptd.nsf/webmain/C31BC5FB34DBC0EF86256ADF007B8A47?opendocument

Also, depending on your operating system, I'd like you to try a newer version of VISA. The latest is 3.1 and can be downloaded here:

http://digital.ni.com/softlib.nsf/websearch/8E7D54CA3A1FDECF86256E4D007ED2E0?opendocument&node=132060_US

If you are using something other than Windows 2000, NT, or XP, yo
u will need to install an older version (2.6.1) here:

http://digital.ni.com/softlib.nsf/websearch/41EF909EA8B0E50F86256D1F00619F46?opendocument&node=132070_US

If you can get an NI-Spy capture of it failing, post your .spy file here and I'll take a look at it.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(12,126 Views)