LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView not working with NKT Laser

Device Specification:

Processor Intel(R) Core(TM) i5-10500T CPU @ 2.30GHz   2.30 GHz
Installed RAM 32.0 GB (31.7 GB usable)
Device ID 2A52B9C5-7A97-462B-9939-2D13DF80CC93
Product ID 00355-62928-71418-AAOEM
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display

LabVIEW Professional Development System
Version 2022 Q3 (64-bit) 22.3f0
 
Error Output:
Code: 7
Source:
NKTP_API.lvlib:NKTP_API_Path.vi
NKTPDLL.dll not found
 
We have attempted to fix this issue by downloading the newest SDK package and establishing a direct path to the .dll file both (x64) and (x86). As shown below in the picture, I believe we have the correct directory configuration for the project to locate the .dll files. We have also attached the LabView project we used. As shown in the picture below, the error code is 7 and NKTPDLL.dll file is not found even though it is supposed to be there.
 

 

0 Kudos
Message 1 of 6
(683 Views)

Hi hmyat,

 


hmyat@ucdavis.edu wrote:
LabVIEW Professional Development System Version 2022 Q3 (64-bit) 22.3f0
 
We have attempted to fix this issue by downloading the newest SDK package and establishing a direct path to the .dll file both (x64) and (x86).

Is the DLL provided for 32bit or 64bit applications?

When the DLL is only available for 32bit applications then your LabVIEW-64bit cannot use it…

 

Btw. how do you "establish a direct path to the DLL file"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(623 Views)

The DLL is provided for 64bit applications. 

For a direct path to DLL file, we currently have all the DLL files inside the folder: Program Files (x86)\National Instruments\LabVIEW 2020\instr.lib\NKTP_API\Private

 

I am not sure if this is the correct way to add the library. I have attached the images of all the files inside the Private folder. I also included VI Search Path from Tools->Paths which also should be finding the library. 

Thank you very much for assisting with my trouble,

Htet Myat

 

 

Download All
0 Kudos
Message 3 of 6
(567 Views)

hmyat@ucdavis.edu wrote:

The DLL is provided for 64bit applications. 

For a direct path to DLL file, we currently have all the DLL files inside the folder: Program Files (x86)\National Instruments\LabVIEW 2020\instr.lib\NKTP_API\Private


That's most likely the problem. If your DLL depends on other DLLs that it needs Windows to load to work you can't put those DLLs wherever you like. The DLL referenced in the Call Library Node can have a path and LabVIEW knows to request from Windows to load a DLL from that specific part. But dependencies inside the DLL are only referenced by DLL name and then the standard Windows search rules for DLLs apply. The directory from the requesting DLL is very purposely NOT part of those search locations. If Microsoft could change history, they would reduce the search locations even more nowadays. It's a security nightmare to search all over the place for possible dependencies as it makes code injection almost trivial. If Windows can't find a dependency it aborts the whole load process and simply reports to the application that it couldn't load the DLL. No further details about why the load failed are available. LabVIEW did try in the past to detect more details by for instance checking if the file at the desired location really existed and if it looked like a DLL, to give a more differentiated return about if the loading failed because of dependencies or of a missing DLL itself, but that not only proofed difficult to make foolproof but also provides not a lot of useful information to the average LabVIEW user.

 

.Net assemblies are by default only searched in exactly two locations, the calling processes home directory and the Global Assembly Cache exactly for that reason. Trying to convince .Net to add other locations to the search path is an exercise in itself and requires quite a bit of effort once the process has been started with an Application Context.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 6
(547 Views)

Thank you very much for identifying the problems. 

I am wondering if you could share a resource on how to correctly add the .dll library to LabView. 

 

Thank you, 
Htet Myat

0 Kudos
Message 5 of 6
(538 Views)

Hi Htet,  Did you ever get the communications to work for the NKT laser.  If not the labview vi's supplied by NKT require the NKTPDLL.dll to be in this location

 

c:\users\public\documents\NKT Photonics\SDK

 

It also requires the computer to have the following system environment variable

 

NKTP_SDK_PATH = c:\users\public\documents\NKT Photonics\SDK

 

These should have been created if you used their SDK installer.

 

If you did get it working, is it working ok.  I am trying to use it and I get timeout errors after running a short period of time.

 

Regards

Terry

0 Kudos
Message 6 of 6
(159 Views)