LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview call VB DLL: no function name found

Dear all,

 

I want to control a spectrometer (SEKONIC C7000) using Labview. The vendor gave me a Visual Basic DLL with a list of function in the user manual.

 

When I call the DLL in labview, using the Call Library Function, I go to configure the library function, and in the function name I found no functions (screenshot attached). 

 

The same vendor sent me also another VB DLL that is for internal use only, and when I call this DLL using the same procedure I do see all the functions of this library. Since they just finished to write the DLLs and I am the first one that they sent it out under my request, I suspect that the DLL is somehow corrupted... Or am I wrong following this method?

Thanks for the help.

Fabrizio

0 Kudos
Message 1 of 6
(3,967 Views)

Most likely your DLL is either an ActiveX or .Net DLL and does not export any functions through the normal function export table. Instead try to use the .Net Create Instance node and browse from there to the DLL to see if it is a .Net assembly. You should then be able to use the Property and Method nodes to access the functions in the .Net DLL.

If that doesn't work you can try to place an ActiveX refnum on a front panel and browse from there to the DLL and then use Open Automation Refnum and the Property and Method Nodes to access the functionality, but it is not likely an ActiveX component since they normally export at least 2 or 3 functions that Windows uses to access the ActiveX object factory in the DLL. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 6
(3,922 Views)

Thank you very much! It is actually a .NET DLL as when I use construct node I am able to see all the functions.


Although, I expected I could call the functions easily, I use the construct node to create the reference, then I pass it to the property node and I set the property. For example, in this VI, I first connect in remote the spectrometer, then set the measurement mode to ambient mode and then I ask to measure the colour temperature, but I get just an empty string as result.

 

Can you advise if I am following the right procedure and if I am calling correctly the functions? Thanks a lot for the great support, and sorry: I am not experienced with .DLL, I always used already developed LV VIs to control instruments....

0 Kudos
Message 3 of 6
(3,915 Views)

Well you have property nodes and method nodes. The property node accesses a property or value of the object. The method node is what you use to call one of the object methods (functions).

 

Since you didn't attach anything there is not much to advise about. From your description it sounds ok. Do any of the nodes return an error?

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 6
(3,906 Views)

Sorry, I did not attach the VI. I worked a lot on it, I understood, thanks to you, that I have to use the invoke node function and not the property node for some cases... it  seems to me working a little bit, but I know I am missing some references as for some cases I have to give a manual reference with a constant, while I think I had to wire a true reference using one of the functions of the DLL to make it work. So I am still unable to connect to the device even if I think I am close to make it working. I attach the VI and for your knowledge the user manual of the SDK. The problem is that the SDK is for visual studio - visual basic written only and not at all built to be used in LV. And it is beta version, the user manual is half in japanese, so I am struggling to understand the right procedure and also to understand if it is possible to adapt this SDK to make it work with labview...Perhaps somebody can explain me what I am doing wrong; sorry to bother you!

0 Kudos
Message 5 of 6
(3,897 Views)

Dear all,

 

I made significative advances on this topic, I am now able to connect with the device, set measurement parameter and start a measurement using LabVIEW.

 

The only issue which I am still having is how to get the measurement results, it seems to me that the function "GetMeasurementResults" is not working properly, as I used it exactly like other functions before, but the only thing I am getting is empty strings as results. I have attached the modified VI.

 

Any advice is welcome...

0 Kudos
Message 6 of 6
(3,884 Views)