LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I call a Visual Basic DLL from CVI 5.5


0 Kudos
Message 1 of 4
(3,454 Views)
Alex:

Microsoft Visual Basic DLLs usually don't even export any symbols, so they can't be called like C++ or other DLLs. However, Microsoft Visual Basic DLLs have embedded type libraries, so you can use ActiveX to control them.

In LabWindows/CVI, you can use the ActiveX Automation Controller Wizard (under the Tools menu), to create an instrument driver (.fp) for your Microsoft Visual Basic DLL. When asked to choose a registered ActiveX Automation Server, choose "Browse" and navigate to your Microsoft Visual Basic DLL. Proceed through the wizard providing an instrument name, etc. You can usually just keep the defaults when LabWindows/CVI asks you to verify the names of the functions it's going to generate. When this process is complete, an instrument driver will be ge
nerated and added to your Instrument menu with a simple, easy-to-use menu interface to your DLL!

Good Luck,

Chris Wood
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,454 Views)
This is only if you VB DLL is an ActiveX Server with objects. Otherwise, you need to use the method in the other reply.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 4 of 4
(3,454 Views)
You will most likely have a .BAS file which is the VB include file. You will have to use this as a model to create a C header file (.h) if you don't have one. Once you have the header file, you can open the header file in CVI and go to Options->Generate DLL Import Library. Then link the import library into the project you want to use the DLL in, and #include the header in the source.

There are other ways, but that is the easiest.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
Message 3 of 4
(3,454 Views)