LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Visual Basic ActiveX DLL in LabVIEW

I' like to use some code written in Visual Basic into LabVIEW. I think the best way to do this is making a dll_activeX. I've seen an example on NI site: http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB992111EE034080020E74861&p_node=DZ52048&p_submitted=N&p_rank=&p_answer=&p_source=External.
When I use the dll present in the "zipped" file it works (I've registered the dll as described in the article).
If I compile in a DllActiveX the Visual Basic project (Visual Basic 6.0), present in the zipped file, and I try to use, after the unregistrtion of the old one and the registration of new one, it doesen't work.
I received the following error:
error 3005Occurred at automation open: Object specified is
not creatable in a ActiveX Dll with LabVIEW.vi
...

Some ideas?
Thank you.
0 Kudos
Message 1 of 4
(3,708 Views)
Maybe you can compile the vb code into an executable and call it using the system exec function. This could be an easier approach. Or you could use the call library function if you know the function prototype. hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 4
(3,708 Views)
I can't because I need to pass some arguments to the vb function and I need some parameters in output.
The call library function doesen't work with DllActiveX, I think.
Thanks.
0 Kudos
Message 3 of 4
(3,708 Views)
Paolo,

I am not sure why you are getting the error. I downloaded the zip file re-built the dll and then registered it. I originally had LabVIEW open, so I closed and re-opened it so that it would see the new object. I then pointed the ActiveX refnum to the Project1 class. I still had a few broken wires so I hit ctrl-shift-Run Arrow to force a recompile.

After all that I ran the VI at it worked great. Once that was done I unregistered it and ran the VI. I got an error as expected. I then re-registered the dll and ran it again. No error.
Message 4 of 4
(3,708 Views)