From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Read DLL's COM(Component Object Method) In Labview 8.6.1

Solved!
Go to solution

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 . 

 

 

 call function2.jpg

 

 

 

 

 

  

 

Message 1 of 12
(7,511 Views)
If you have a COM component that has a type library you should use the ActiveX functions rather than the Call Library Function Node.
0 Kudos
Message 2 of 12
(7,506 Views)

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 ?

 

0 Kudos
Message 3 of 12
(7,492 Views)
Automation Open function to open an ActiveX reference to the object/function/software under question.
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 4 of 12
(7,488 Views)

Hi :

 

But how to use ActiveX block diagram to read dll's COM(Component Object Model) function?

0 Kudos
Message 5 of 12
(7,483 Views)

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

Message Edited by rolfk on 10-21-2009 07:27 AM
Rolf Kalbermatter
My Blog
Message 6 of 12
(7,471 Views)
Solution
Accepted by topic author Keele

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"

cmd.PNG

- 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...

blockdiagram.PNG

 

Browse for your DLL file, and you can select which COM method you want to use.

blockdiagram2.PNG

 

Hope its useful.

Sincerely,

 

 

Krisna

 

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2021
Message 7 of 12
(7,408 Views)

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:

 

MMAPPRTOpen.png 

 

Thanks in advance,

Luiz Carlos. 

Luiz Carlos Maia Junior
0 Kudos
Message 8 of 12
(7,283 Views)

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. 

Luiz Carlos Maia Junior
0 Kudos
Message 9 of 12
(7,278 Views)
An Automation Refnum gets instantiated by the Open Automation Refnum primitive and nothing else. So run that with your Automation Refnum as type input and you will get an actual instantiated object that you can use. And don't forget the Close Refnum primitive at the end.
Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 12
(7,277 Views)