Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

viFindRsrc with USBTMC devices fails w/64-bit apps

Solved!
Go to solution

It seems that viFindRsrc fails to enumerate the USBTMC devices when called from a 64-bit application.

The same device, same VISA installation, same code calling viFindRsrc, from a 32-bit application works just fine.

 

Has anyone experienced the same problem?

 

Perhaps of note is the fact that if the resource string is entered manually (or copy/pasted from NI MAX), then communications with the device work just fine.

 

0 Kudos
Message 1 of 20
(6,034 Views)

which driver do you have? did you install the 64 bit driver ond your 64 bit system?

 

regards

0 Kudos
Message 2 of 20
(6,016 Views)

Version is 5.0.3

I assume that a 64-bit version was installed, since the installer appears to include both: http://joule.ni.com/nidu/cds/view/p/id/2251/lang/en

0 Kudos
Message 3 of 20
(6,012 Views)
0 Kudos
Message 4 of 20
(6,004 Views)

No, windows 7, 64-bit. 

The problem is not that the driver doesn't work, its just that from a 64-bit app, the viFindRsrc doesn't find USBTMC devices. 

Taking the resource string from NI-MAX and pasting it in shows that the rest of the driver works fine. 

Looks very much like a simple bug in VISA to me. 

0 Kudos
Message 5 of 20
(5,999 Views)

Did you reinstall the Driver for your USBTMC when you changed the system? LabVIEW is 64bit?

0 Kudos
Message 6 of 20
(5,996 Views)

Yes, of course, it was a freshly installed system. 

No Labview installed, just VISA.

0 Kudos
Message 7 of 20
(5,988 Views)

Can you send me a screenshot of the setup (from the Visa driver), so that we can be sure you've installed the right version?

0 Kudos
Message 8 of 20
(5,983 Views)

The USBTMC class driver that is compatible with VISA 5 comes with the latest version of VISA Shared Components (IviVisaSharedComponents64.msi). Try uninstall existing version once, then reinstall the latest. The installer will automatically sets up the driver.

 

http://www.ivifoundation.org/shared_components/Default.aspx

 

0 Kudos
Message 9 of 20
(5,969 Views)

Ok, I did try that, but it didn't seem the fix the problem. 

 

Here is a bit more info:

 

First, the simple test application:

 

#include "stdafx.h"

#include "visa.h"

int _tmain(int argc, _TCHAR* argv[])

{
ViUInt32 retCnt = 0;

ViSession defaultRM;

ViStatus status;

ViFindList find_list;

char instrDesc[100] = {0};

viOpenDefaultRM(&defaultRM);

status = viFindRsrc(defaultRM, "?*", &find_list, &retCnt, instrDesc);

if(retCnt > 0)

{

printf("%s\n", instrDesc);
for(int i = 1; i < (int) retCnt; ++i)

{

status = viFindNext(find_list, instrDesc);

printf("%s\n", instrDesc);

}

}

viClose(defaultRM);

return 0;

}

 

Next, the output of the Win32 build: 

USB0::0xF4EC::0xEE3A::LCRY-1062-6003-00::INSTR

ASRL3::INSTR

ASRL4::INSTR

 

Now the output of the Win64 build (note the missing USB0 resource): 

ASRL3::INSTR

ASRL4::INSTR

 

Now, the loaded DLLs when running the 32-bit build:

'VISAfindRSRCBug.exe': Loaded 'H:\Dummy\VISAfindRSRCBug\debug\VISAfindRSRCBug.exe', Symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\visa32.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\NiViSv32.dll', No symbols loaded.

VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\NiSpyLog.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiVi488.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViAsrl.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViEnet.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViEnetAsrl.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViGpvx.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViPxi.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\nipalu.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\nipalut.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\nipal32.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViRpc.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\nirpc.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViUsb.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\SysWOW64\winusb.dll', No symbols loaded.

 

 

and the same for the 64-bit build:

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\visa64.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\visaUtilities.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\visaConfMgr.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\nivisa64.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\NiViSv64.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiVi488.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiViAsrl.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiViEnet.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiViEnetAsrl.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiViPxi.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\nipalu.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\nipalut.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiViRpc.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\nirpc.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\Win64\Bin\NiViUsb.dll', No symbols loaded.

'VISAfindRSRCBug.exe': Loaded 'C:\Windows\System32\winusb.dll', No symbols loaded.

 

It would appear from this that NiViUsb.dll, which I assume is the USBTMC passport, is loaded in both cases, one works, one doesn't. 

 

Any ideas?

 

0 Kudos
Message 10 of 20
(5,893 Views)