09-30-2012 04:37 PM
I have a DLL (written in Visual Basic) that controls some 3rd party hardware.
They have some (very poor) documentation that has some functions in the DLL along with the input parameters.
I'm trying to use the Call Library Function Node in LabVIEW to open the DLL so I can take care of everything else in LabVIEW, but for some reason it is not correctly populating the list of functions in the DLL. When I browse to the DLL and drop down the function list, all I get is this
Those are not the functions in this DLL. In fact, if I browse to any DLL in the folder they gave me, these same 4 functions are listed every time. Am I doing something incorrectly?
Solved! Go to Solution.
09-30-2012 07:34 PM
I believe this indicates that your DLL is actually an ActiveX object, not a standard DLL. Drop Automation Open on your block diagram, create a constant for the Automation Refnum input, right-click, Select ActiveX Class... -> Browse, then click the Browse button in the dialog (it may take a while to open) and locate your DLL. See if that gets you a list of objects in the DLL.
10-01-2012 02:18 AM
Nathan is right. These 4 functions are simply the exported factory functions to instantiate and control COM objects inside that DLL. Most likely it is a fully featured ActiveX DLL that can be accessed by the LabVIEW ActiveX interface, although it's not strictly necessary. COM is the basic mechenisme for the old style (pre .Net) object oriented embedding and extension framework. ActiveX adds an extra layer on top of that, that adds specific type library resources and other help mechanismes to allow Visual style programming environments (like Visual Basic, Visual C++, LabVIEW etc.) to directly discover and adapt to the provided interfaces.
While ActiveX is a requirement to access a COM DLL from Visual environments like LabVIEW, a COM DLL does not have to provide that ActiveX sugar layer. A COM DLL without ActiveX sugar layer however is only accessible from text based languages like C(++) and the programmer has to know and employ some specific knowledge about how the COM DLL is registered in the system in order to access it.
The easiest is in fact to simply drop an Automation Refnum on your front panel and browse to your DLL from there as Nathan has explained. If LabVIEW then shows you a list of possible objects, it is a fully featured ActiveX library, otherwise it is just a COM object server DLL.
10-01-2012 10:57 AM
Great, you guys were exactly right, ActiveX worked perfectly.
All of the functions are populated correctly, along with all of the input and output parameters from each function.
Thanks again!