Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

'viFIndRsrc' in my 16-bit application failed after talking to a device using MAX 2.2

We still need to run a 16-bit 'C++' application on the XP environment. This app. works fine with all the devices. However, after I open 'MAX' and communicate with any device and then close 'MAX', my application will fail saying that 'no device is found';
If I use 'viClear' from the VISA-Interactive COntrol to clear that particular device that I had talked to using MAX, my application will then work.

Also, if I communicate with any device using the VISA-interactive control instead, I will not have any problem either.

What is the difference between communicating with a device using MAX and VISA interactive control (2.6.1)?
It causes problem to my application.

Thanks for any i
nformation!
0 Kudos
Message 1 of 4
(2,991 Views)
What bus are you using to communicate with your instrument (serial, gpib, etc.)?

I am not sure why a viClear would change the behavior of the driver. All it does is send a command to your instrument and maybe flush the buffers depending on what version of VISA you are using.

http://digital.ni.com/public.nsf/websearch/4A8D61E759174E7F86256E20005A8ABC?OpenDocument

I would suggest recompiling your application on a Windows XP machine. I have seen some really strange behaviors from trying to run a 16 bit application on Windows XP, when it worked at all. It is especially messed up if you are trying to use events of any sort. Some times it works, some times it doesn't, and some times it crashes, even when I was using an emulator.

However, if you really h
ave to use this application on XP and it is impossible to recompile the code here is a link from Microsoft�s website on trouble shooting MS-DOS applications on XP.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q314106

I hope this helps out,
-Josh
0 Kudos
Message 2 of 4
(2,991 Views)
I am using the GPIB bus.
I noticed that if I just open the NI-488.2 communicator within the MAX and exit. And then run my 16-bit app. using NI visa api calls, it will say that no resource is found. If I log off as the current user, and log back on without hard boot, the problem goes away. I supect some kind of initialization is done by NI-4882 communicator behind the scene and cause the problem. But I have no clue what is it at this point!

It will not happen if I use the VISAIC (Visa Interactive control. or just communicate without going to NI-488.2 communiator at all!

Do you have any insight?
Thanks..
0 Kudos
Message 3 of 4
(2,991 Views)
Actually, the communicator does not use VISA. It makes direct calls to the NI-488.2 driver, so it is a little different than using VISA. It looks like the 488.2 driver is leaving some resources open and not closing them down correctly. You can try to upgrade to a newer version of NI-488.2 to see if that fixes the problem.

http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BB9002C14EF?opendocument&node=132060_US

Otherwise, I would suggest just using VISA for all of your tests. You might even want to put together your own VISA test panel. Here is one that I created using MSVC 7.1 with one of the VISA shipping examples. It installs a small executable called VISA Test and a shortcut on to your desktop.

-Josh
0 Kudos
Message 4 of 4
(2,991 Views)