Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VS2019 program viopen failed

In our daily work, we use visa library probvided by NIVISA.

Platform: windowsv

Our testing environment is: NI488.2 17.6 + NIVISA 2024 Q1

 

Currently we use VS2019 as our IDE tool, and in our implementation, we have dynamic link libraries as followed:

 

A.dll: Dealing with instrument communcation, using LoadLibrary to load visa32.dll/visa64.dll to deal with instrument communcation

B.dll: Control the whole flow, also depends on A.dll's API to talk to instrument indirectly

 

The problem is while I write a VS2019 app and just calling A.dll's API to communcate with instrument, it's OK.

But while I add B.dll into compilation, I still calling A.dll's API to communcate with instrument, but it failed 

ERROR code is: (BFFF0011), Description: Insufficient location information or the device or resource is not present in the system.

 

Did anyone know any constraint in NIVISA's library, is this some kind of DLL hell?

 

0 Kudos
Message 1 of 2
(181 Views)

After some more investigation, here are some observation:

Background: Our library(Let's called it A.dll or A.lib) using LoadLibrary to load visa64.dll from IVI fundation

Environemnt: NI-VISA 2024Q1 + NI488.2 21.5

Experiment: VS2019 Application linking with A.dll or A.lib to test visa library fundamental API

  • Static link library A.lib: Success
  • Dynamic link library A.dll: failed in viopen , error code:BFFF0011 : Description: Insufficient location information or the device or resource is not present in the system.

Also found that using ListDll to check dynamic link library dependency:

Its weird that dependency are different between static link and dynamic link library version: 

Static library A.lib: Dynamic link library A.dll
C:\windows\SysWOW64\visa32.dll C:\windows\SysWOW64\visa32.dll
C:\windows\SysWOW64\NiViSv32.dll C:\windows\SysWOW64\NiViSv32.dll
C:\windows\SysWOW64\secur32.dll C:\windows\SysWOW64\secur32.dll
C:\windows\SysWOW64\SSPICLI.DLL C:\windows\SysWOW64\SSPICLI.DLL
C:\windows\SysWOW64\NiSpyLog.dll C:\windows\SysWOW64\NiSpyLog.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiVi488.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiVi488.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViAsrl.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViAsrl.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViEnet.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViEnet.dll
C:\windows\SysWOW64\WININET.dll C:\windows\SysWOW64\WSOCK32.dll
C:\windows\SysWOW64\WSOCK32.dll C:\windows\SysWOW64\WININET.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViEnetAsrl.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViEnetAsrl.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViPxi.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViPxi.dll
C:\windows\SysWOW64\niqpxi.dll C:\windows\SysWOW64\niqpxi.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViRpc.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViRpc.dll
C:\windows\SysWOW64\nirpc.dll C:\windows\SysWOW64\nirpc.dll
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViUsb.dll C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\NiViUsb.dll
C:\windows\SysWOW64\kernel.appcore.dll C:\windows\SysWOW64\kernel.appcore.dll
C:\windows\SysWOW64\uxtheme.dll C:\windows\SysWOW64\uxtheme.dll
C:\windows\SysWOW64\winimhc3.dll C:\windows\SysWOW64\winimhc3.dll
C:\windows\SysWOW64\comdlg32.dll C:\windows\SysWOW64\comdlg32.dll
C:\windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.844_none_89e26e970b35ab92\COMCTL32.dll C:\windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.844_none_89e26e970b35ab92\COMCTL32.dll
C:\windows\SysWOW64\thooksv3.dll C:\windows\SysWOW64\thooksv3.dll
C:\windows\SysWOW64\iphlpapi.dll C:\windows\SysWOW64\iphlpapi.dll
C:\windows\SysWOW64\NSI.dll C:\windows\SysWOW64\NSI.dll
C:\windows\SysWOW64\dhcpcsvc.DLL C:\windows\SysWOW64\dhcpcsvc.DLL
C:\windows\SysWOW64\MSCTF.dll C:\windows\SysWOW64\napinsp.dll
  C:\windows\SysWOW64\pnrpnsp.dll
  C:\windows\SysWOW64\wshbth.dll
  C:\windows\SysWOW64\NLAapi.dll
  C:\windows\SysWOW64\DNSAPI.dll
  C:\windows\SysWOW64\winrnr.dll
  C:\Windows\SysWOW64\rasadhlp.dll
  C:\windows\SysWOW64\MSCTF.dll

 

Can anyone explain what make this difference in NI-VISA viopen implementaion? 

It seems like the function go into different ways in C:\windows\SysWOW64\NiViSv32.dll. 

0 Kudos
Message 2 of 2
(93 Views)