06-16-2011 06:39 AM - edited 06-16-2011 06:42 AM
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.
Solved! Go to Solution.
06-17-2011 09:02 AM
which driver do you have? did you install the 64 bit driver ond your 64 bit system?
regards
06-17-2011 10:25 AM
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
06-20-2011 02:44 AM
Are you using windows xp?
http://digital.ni.com/public.nsf/allkb/C4EC0C87B6D70AA886256E61006568C8?OpenDocument
06-20-2011 02:49 AM
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.
06-20-2011 03:23 AM
Did you reinstall the Driver for your USBTMC when you changed the system? LabVIEW is 64bit?
06-20-2011 05:28 AM
Yes, of course, it was a freshly installed system.
No Labview installed, just VISA.
06-20-2011 06:38 AM
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?
06-20-2011 08:25 PM
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
06-21-2011 03:31 AM
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?