10-20-2009 08:31 PM
Hi all:
Current i found difficulty to read COM(Component Object Method) in DLL file in Labview. I only manage to read exported function in dll file by using call library function block diagram with Labview programming software.Please give me an advice or solution to solve my current problem encounter.Thanks.
Figure below is the way that i retrieve function from dll file . The block function only manage to retrieve exported function in dll file .
Solved! Go to Solution.
10-20-2009 09:01 PM
10-20-2009 10:43 PM
Hi :
Thanks for your information . Can i know that whether block diagram 'automation open' can be used to read DLL's COM
's COM function?
Any examples or helpful resource regarding the problem that i encounter ?
10-20-2009 10:54 PM
10-20-2009 11:05 PM
Hi :
But how to use ActiveX block diagram to read dll's COM(Component Object Model) function?
10-21-2009 12:26 AM - edited 10-21-2009 12:27 AM
Keele wrote:Hi :
But how to use ActiveX block diagram to read dll's COM(Component Object Model) function?
You can't!
The COM DLL needs to be a fully functioning ActiveX object library with according ActiveX type library either embedded in the DLL or as separate file. And that ActiveX object library needs to be installed (registered).
Once these two things are given, the according ActiveX functionality will be available in the ActiveX interface in LabVIEW. Depending on the type of the ActiveX library either as ActiveX control or as ActiveX Automation Server, or sometimes as both.
While ActiveX does use COM for its binary interface, COM is not equal ActiveX. It's just part of what makes ActiveX work. COM in itself is not sufficient enough to be called by anything but C++ (and with some extra work C).
Rolf Kalbermatter
10-27-2009 11:39 PM
Hi,
Just want to share a solution that works for your problem:
1. Register DLL into Windows
- Go to <local folder>\WINDOWS\system
folder
- Copy paste your dll file into
this folder, TraceDataV28_test18.dll
- Open Command Prompt (cmd), go to directory <local
folder>\WINDOWS\system and type REGSVR32
"TraceDataV28_test18.dll"
- A pop up window should appear notifying you that
the dll has been registered
2. Use
Invoke/Property Node:
- Open
LabVIEW
- Drag and Drop Invoke Node at
Functions Palette>>Application Control>>Invoke Node
- Right Click on it, and Select
Class>>ActiveX>>Browse...
Browse for your DLL file, and you can select which COM method you want to use.
Hope its useful.
Sincerely,
Krisna
11-18-2009 04:07 AM
Hello Krisna,
I've been trying to instantiate a COM DLL using LabView too.
I saw your solution proposal and using it I can choose the interface method or property I want to call easily, thank you.
The problem I have now is that the class doesn't seem to be instantiated on the moment I call it so I get a error 97 message (unknown system error).
I tried to add a constant/control to the reference input of the invoke node pointing to the class I want to be instantiated but this is not the solution I still get the error.
Do you have an idea of what can be done to solve this?
I'd appreciate your help.
Below you can see my VI snippet:
Thanks in advance,
Luiz Carlos.
11-18-2009 04:29 AM
Hi, I was searching a little bit more and I found the solution on: http://zone.ni.com/reference/en-XX/help/371361E-01/lvcomm/automation_open/
Thanks anyway,
Luiz Carlos.
11-18-2009 04:30 AM