09-11-2023 07:17 PM
Device Specification:
09-12-2023 01:32 AM - edited 09-12-2023 01:33 AM
Hi hmyat,
hmyat@ucdavis.edu wrote:
LabVIEW Professional Development System Version 2022 Q3 (64-bit) 22.3f0We 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"?
09-13-2023 01:08 PM
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\
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
09-14-2023 02:13 AM - edited 09-14-2023 02:24 AM
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.
09-14-2023 02:38 AM
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
02-23-2024 09:30 AM
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