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: 

Creating a wrapper DLL written in Visual Basic for use in LabView

We have a program, Merlin, to control our Instron Test Machine. I want to create a program that retrieves the data from the Machine, however, direct communication between the Machine and LabView is not possible. I should be able to acquire the data through the Merlin software using OLE/ActiveX but have ran into problems. I've tried using the ActiveX Automation reference to gain access to the methods needed. As I build the VI, create the object and use the Invoke Nodes to select the methods, all seems right; the methods are available for me to select. However, when I run the VI I get error 3005 (TIFF attached below). I've also attached a TIFF of my VI diagram.

 

Since this didn't work, and I couldn't figure out how to fix it, I tried another approach. We currently have a Visual Basic Application that retrieves the data from the Merlin software. Since we know that the VB can gain access to the methods, we have been trying to write an ActiveX DLL in VB 6.0 that will create the objects and present the data to LabView. This would essentially be a wrapper DLL containing only the methods and properties needed for the particular application. I registered the DLL with windows and ran the VI, which looks almost the same as the previous VI except the units input on the invoke node was coded within the DLL. I get error -2146827864 when I run the VI, see attached TIFF for actual error. A previous postee, post, got the same error and was able to solve it but didn't adequately explain his solution so that I could apply it to my situation. I am only marginally familiar with VB (and I am quite happy to keep it that way), so my boss, the creator of the original VB program, is writing the DLL for me. However, he doesn't have much experience with creating DLLs. I have successfully created from an example, a simple DLL that works when used in LabView and my boss created a simple DLL that would open the Merlin Program when called by the Open Automation.VI within LabView. The DLL didn't have any callable properties or methods, just opened the Merlin.exe file. Therefore, I know that this should be possible but there is something wrong with the way the VB DLL is created that makes it incompatible to LabView.

 

I need a solution to correct the error for either one of the methods that I've tried. I know this isn't a VB forum but since I know so little about VB, I doubt I could explain it so that VB experts could understand (to help with that method).

 

I've tried to thoroughly explain the things tried and their results but should more information/clarification be needed please don't hesitate to reply to my post.

 

Thank you is advance for any help provided.

Tessa

NTA Testing Laboratories

0 Kudos
Message 1 of 7
(5,644 Views)

Hi,

 

Your ActiveX method seems the least complex and most promising method of communication. Often, 3005 error can be caused by choosing an object that isn't creatable. By default, when your choosing your ActiveX object, all objects are listed, including those that cannot be created. Try  ensuring the "Show Creatable Objects Only" option is checked in your object chooser.

 

 

If you object is not listed once the option checked, back up to the ActiveX server for your program and ensure you have creatable objects. You may also try looking at this KnowlegeBase to ensure that you have registered your objects correctly.

 

How Do I Manually Register Type Libraries, ActiveX Controls, and ActiveX Servers?

 

Message Edited by Captain Kirby on 11-03-2008 11:41 AM
Asa Kirby
CompactRIO Product Marketing Manager
________________
Sail Fast!
0 Kudos
Message 2 of 7
(5,611 Views)
I do have the "Show Creatable Objects Only" checked when I choose my object and have manually registered the program with Windows but I still get the 3005 error.
0 Kudos
Message 3 of 7
(5,567 Views)
You might try probing the error wire in your ActiveX implementation. Where exactly is the error generated? Are you able to open the automation refnum, or do you recieve 3005 before you ever get to the object methods. If you are able to create the object, but unable to use the methods, this may point to a problem with the ActiveX server.
Asa Kirby
CompactRIO Product Marketing Manager
________________
Sail Fast!
0 Kudos
Message 4 of 7
(5,525 Views)

Dear all..

I want to create a lab view which can be run on mini2440.
For the Lab view Application i want to use dll. which includes some basic functions.
so which programming language i have to use to create dll.

please help ..


thank you ...
sunil

0 Kudos
Message 5 of 7
(3,418 Views)

i need a dll file which run on mini2440

0 Kudos
Message 6 of 7
(2,983 Views)

You posted to a thread that has nothing to do with your hardware. The last post before you was equally irrelevant and hasn't created any response, so why adding your inquiry to it. I'm not even sure what your mini2440 is. A car? a measurement device? or maybe an embedded board? In the last case your question about DLL is most likely even very misguided as it would likely run something very different than Windows and LabVIEW is not going to run on it either.

0 Kudos
Message 7 of 7
(2,971 Views)