From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with NI-CAN 2.7.5 DLL(s) install for custom applications

We have custom applications built on top of NI-CAN for Windows using the MS Visual C lib and header. In the past, to run our applications, we simply installed the latest NI-CAN package. Our applications would run, find and access any runtime DLLs, and be fine.

 

With NI-CAN 2.7.5 though, we are seeing errors in our applications that suggest they cannot see the required DLL necessary to operate. The error is:

"A dynamic link library (DLL) initialization routine failed."

 

Did anything change in 2.7.5 with regards to the placement or installation DLLs required to run custom NI-CAN applications?

0 Kudos
Message 1 of 5
(6,596 Views)

I was able to get a little more information. Using Visual Studio to get a debug log, I see the following. With 2.7.4, the NI-CAN DLLs load and it work fine:

 

'MATLAB.exe': Loaded 'E:\jobarchive\Btm1\2014_02_21_h12m30s17_job89749_pass\matlab\toolbox\vnt\vnt\mexNICAN.mexw32', Symbols loaded.
'MATLAB.exe': Loaded 'C:\Windows\System32\Nican.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\NIcanFrm.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\nipalu.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\nipalut.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\nipal32.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\NIcanpu.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\NicanCfq.dll', Binary was not built with debug information.
'MATLAB.exe': Loaded 'C:\Windows\System32\nicanDBA.dll', Binary was not built with debug information.
'MATLAB.exe': Loaded 'C:\Windows\System32\NicanTsk.dll'
'MATLAB.exe': Loaded 'C:\Windows\System32\NiSpyLog.dll'

 

On 2.7.5 though, additional error information shows up:

 

'MATLAB.exe': Loaded 'T:\12\jpyle.Btm1.j86236.sb\matlab\toolbox\vnt\vnt\mexNICAN.mexw32', Symbols loaded.

'MATLAB.exe': Loaded 'C:\Windows\System32\Nican.dll', Cannot find or open the PDB file

'MATLAB.exe': Loaded 'C:\Windows\System32\NIcanFrm.dll', Cannot find or open the PDB file

'MATLAB.exe': Loaded 'C:\Windows\System32\nipalu.dll', Cannot find or open the PDB file

'MATLAB.exe': Loaded 'C:\Windows\System32\nipalut.dll', Cannot find or open the PDB file

'MATLAB.exe': Loaded 'C:\Windows\System32\nipal32.dll', Cannot find or open the PDB file

'MATLAB.exe': Loaded 'C:\Windows\System32\NIcanpu.dll', Cannot find or open the PDB file

'MATLAB.exe': Loaded 'C:\Windows\System32\NicanCfq.dll', Binary was not built with debug information.

'MATLAB.exe': Loaded 'C:\Windows\System32\nicanDBA.dll', Binary was not built with debug information.

'MATLAB.exe': Loaded 'C:\Windows\System32\NicanTsk.dll', Cannot find or open the PDB file

'MATLAB.exe': Unloaded 'T:\12\jpyle.Btm1.j86236.sb\matlab\toolbox\vnt\vnt\mexNICAN.mexw32'

'MATLAB.exe': Unloaded 'C:\Windows\System32\Nican.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\NicanTsk.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\NIcanFrm.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\NicanCfq.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\nicanDBA.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\NIcanpu.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\nipalu.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\nipal32.dll'

'MATLAB.exe': Unloaded 'C:\Windows\System32\nipalut.dll'

 

You can see it tries to load under 2.7.5, get a bunch of PDB file issues and then immediately unloads.

 

Inspecting the DLLs under 2.7.4 vs 2.7.5, they look identical except for the nicanDBA.dll. That's the only one that has a version difference between NI-CAN versions. In both 2.7.4 and 2.7.5, all DLLs are being properly installed to \windows\system32 as expected so both sets are fully accessible path-wise.

 

Please advise.

0 Kudos
Message 2 of 5
(6,591 Views)

Hey Jaremy,

 

You can find the changelog for the NI-CAN version part of the way down the page here: http://download.ni.com/support/softlib//embedded%20networks/CAN/driver/ni-can/2.7.5/readme.htm

 

As for the errors you are seeing, does your code not function correctly anymore, or are you unable to build your project? What I have found on PDB files is that they are just files that contain information for debugging purposes, and aren't necessary for the code to execute. See this article.

 

Regards,

 

Ryan

Ryan P.
CLA
0 Kudos
Message 3 of 5
(6,579 Views)

Our code does not function any more, correct, but it is a runtime issue vs a build issue. Build is fine. We are actually still building with a previous version of the LIB file, but that file is no different from the current one when inspected via Windows Explorer file properties.

 

Our code simply doesn't run with this latest NI-CAN installed. We have seen inconstent behavior as well. One some machines, if we roll back to 2.7.4 or earlier it works, but on some machines 2.7.5 does work as well.

0 Kudos
Message 4 of 5
(6,533 Views)

Which version of the nicanDBA.dll do you have installed in your System32 folder? List both the Product version and File version if you can, which are both found in the Details of the DLL Properties. It's possible that the DLL version found in the NI-CAN 2.7.5 download was fixed or changed.

 

Also, here is an article that talks more about the error you are receiving and a few ways that we can get more information about the error, such as logging stack traces for the DLL calls:

http://blogs.msdn.com/b/tess/archive/2009/04/29/unable-to-load-dll-dllname-dll-a-dynamic-link-librar...

 

Lastly, the PDB files seem to appear due to incorrect symbol information for the DLLs. I've included one more link to an article from Microsoft on how to modify VS settings to alleviate these errors. Furthermore, a few people had success when the right-clicked Visual Studio and ran it as an administrator.

 

Configuring Visual Studio to Debug .NET Framework Source Code:

http://blogs.msdn.com/b/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-s...

 

Regards,

 

Ryan

Ryan P.
CLA
0 Kudos
Message 5 of 5
(6,516 Views)