LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinesis Kcube brushless control .dll to .vi

Hi dear labview-experts,

 

i am trying to create a labview control for a Thorlabs kcube brushless dc motor with the Kinesis package stuff.

I succeeded to write a VI using the .net control and the .dll implementation by property nodes/invoke nodes, as instructed on their website.

 

https://www.thorlabs.com/Software/Motion%20Control/Kinesis/Kinesis-labview.pdf

 

However, now the vi needs to be callable by our self-written measurement automation base programm (also labview, off course) which opens the called device drivers in subpanels.

Here the problem starts, that is, now when opening my VI in a subpanel, it cannot find the .dlls anymore (my .vi is saved on G:\\-HDD in a folder with the .dlls i downloaded from the thorlabs website, labview is on the C:\\-SSD, the measurement automation program is also on the HDD).

According to my collegue, it is by labview itself that it will not be possible to have my vi able to run using the automation software, because labview is not able to find the .dlls and .net

 

I tried using the import/shared library - wizard to convert the dlls to vis that i need, but it does not work, i get a long error list (see below). I also tried the connectivity/Libraries and exectuables/call library function node - way, but after picking the library name on the interface, the functions do not appear. 

 

Does anybody have a solution or a helpful tip to this?

 

Thanks alot in advance!

 

VI Not Executable The VI is not executable because of one of the following reasons:

1. The shared library or a dependent file is not installed. To make the VI executable, you must install the shared library and all support files on the computer on which you run the VI.

2. A required custom control might be empty or cannot be found. To make the VI executable, update the custom control manually.

3. The VI contains a parameter with an unsupported data type. To make the VI executable, you must replace the empty cluster that the wizard generates with a control or indicator that uses supported data types.

 

 

 

0 Kudos
Message 1 of 3
(240 Views)

Call Library Function Node is for C dll whereas Thorlabs seems to provide only .net dll. You use constructor node for .net dll.

See How LabVIEW Locates .NET Assemblies and Specify the Path for the .NET Assemblies Called From LabVIEW

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 3
(217 Views)

You might need to enable "Load from remote sources" in the ".config" file you are using.  Or create a ".config" file if you do not have one.

 

https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/loadfromremote...

 

Note that in LabVIEW, your .config file can be different things depending on how you run code.

 

If you run without a project file open:

C:\Program Files (x86)\National Instruments\LabVIEW 20xx\LabVIEW.exe.config

 

If you do have a project file open:

C:\Your code folder\Your project folder\YourProject.lvproj.config

 

If you build it into an EXE:

C:\Your code folder\Your project folder\Application folder\Application name.exe.config

 

Alternately:

I found at one point that Thorlabs had a bug in their build.  I don't know if they ever fixed it, I'm on a version of their DLLs from ~2018 and haven't updated.

 

The bug was that in some of their DLLs, they attempted to reference another DLL named "Thorlabs.MotionControl.Tools.WPF.UI.dll", but they accidentally left the "dll" extension off, so it would look for a file named "Thorlabs.MotionControl.Tools.WPF.UI" instead.  I found that if I added a reference to a random constructor loaded from "Thorlabs.MotionControl.Tools.WPF.UI.dll" on a VI, it would force the .NET code to look for that DLL and its contents in memory instead of the misnamed DLL, and it would find it and work.

0 Kudos
Message 3 of 3
(176 Views)