01-12-2006 08:59 AM
Hi I would like to use VB for user interface and labview to control a set pumps using serial communication. I need to pass the command string from VB to labview so labview can send it to the pump and get back with some values that are passed back to VB. I have to build lot of logic to run the pumps the way the we want to run them and it is easier to write that login in VB. Example code would be very helpful.
thank you.
01-12-2006 09:51 AM
01-13-2006 06:17 AM
VB5 and maybe 6 do not support __cdecl imports so you have to make sure that the LabVIEW DLL exports those functions as __stdcall. For the rest it is fairly simple to import functionality from a DLL into VB, you only have to watch out for pointer parameters but LabVIEW has similar complications and limitations so a LabVIEW DLL is not very likely to use parameter types not supported by VB, unless you specifically ask to use LabVIEW specific datatypes in the Application Builder setup.
@Lycangeek wrote:There are two approaches to look into. One is to build your LV code into a DLL and then call that from VB. I'm not that familiar with VB 6 but I believe there is a way to call C DLLs. I know you can do that with VB.NET.The other approach to look into is the LabVIEW ActiveX Server interface. This allows you to control LV via ActiveX - you can load VI's, set their inputs, run them and get the outputs. It does require that the full version of LV be installed. It also means the VIs will run in another process - hence it is a bit slower to talk to them versus the DLL case.