LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication with LabVIEW from Visual Basic .NET

A project I'm working on currently uses a program designed in LabVIEW to collect some data from the user and then perform various automated measurements. My task is to create a Visual Basic .NET GUI interface to accomplish these tasks. LabVIEW is much better at communicating with the instruments than anything I could ever code, so I would like to use its faculties to perform the automated data acquisition, but I need to invoke these operations from Visual Basic. Does LabVIEW provide any VB components or DLLs that I could use to incorporate its abilities directly into my software and be able to use them from VB? If not, could our existing LabVIEW code be modified and compiled as a DLL so that I can call various functions in it from VB, which would then communicate with the instruments?

Note that I have absolutely no experience with LabVIEW whatsoever (other members of my project team use it, I don't), so if I have misused any terms or misunderstood any concepts, please excuse my ignorance.

Thanks in advance for any help you can provide!
0 Kudos
Message 1 of 9
(4,634 Views)

The answer is that you probably can create a dll from the LabVIEW code (what version are you using?). Another option would be to purchase NI's Measurement Studio, which provides a lot of the LabVIEW type functionality for talking with instruments, etc., in components callable from .NET.  I have to ask though why develop a GUI in VB to talk to LV. Is there some really odd requirement for this GUI that isn't attainable building in LabVIEW?

 

 

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 9
(4,625 Views)
Why are you rewriting it in.net Smiley Madif it is already written in labviewSmiley Happy. You could try creating a dll of the labview program and calling it from .net. You would probably get better responses if you posted in the .net forum here. Sorry I could not help you more



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 9
(4,624 Views)
Thanks for the responses. Sorry about posting this in the wrong forum; I didn't notice that there was a .NET forum. I'll leave it here unless a moderator wants to move it, since I basically got the answer I needed.

As to why this is being developed in VB, this application is intended to be flexible and distributable. The end goal is that it will handle as many situations as possible, and automated LabVIEW data collection is only one of these (though it's probably the most important one, and it's the one we use ourselves). If a laboratory using this program doesn't have LabVIEW and they want to perform the measurements and enter their results manually, they can do that. If they have LabVIEW, we want to take advantage of it to save them some trouble.

LV_Pro, I will inquire as to which version they're using, and purchasing that suite is probably an option as well.
0 Kudos
Message 4 of 9
(4,619 Views)
You could also purchase the application builder and build it into an executable, you will also need the application builder to create a .dll.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 9
(4,616 Views)

Hi,

I'm also working on a similar task to collect data with Labview and create a Visual Basic .NET GUI interface.

I used LV AppBuilder to turn the VIs into a DLL and the DllImport command in .NET to call this "C" style DLL.

How can i get readings in .NET?

Regards

0 Kudos
Message 6 of 9
(4,571 Views)

Hi,

I have a similar task.

I used LV AppBuilder to turn the VIs into a DLL and used the DllImport command in .NET to call this "C" style DLL.

How can I read this data in .Net?

0 Kudos
Message 7 of 9
(4,567 Views)

performach,

If you've successfully created the .dll and brought it into LabVIEW, the only problem should be getting the datatypes correct. There is a file that installs with LabVIEW called extcode.h and is located at C:\Program Files\National Instruments\LabVIEW 7.1\cintools which spells out how many of the LabVIEW datatypes would be called in other environments. This may be a help to you. Maybe some people on here would be able to offer some advice more specific to .NET or I also recommend looking on the .net forum that jhoskins mentioned above.

Good luck!

Tyler S

Message Edited by TylerS on 08-24-2005 12:45 PM

0 Kudos
Message 8 of 9
(4,551 Views)
A good resource for figuring out the right .NET definitions for C data types can be found at www.pinvoke.net. This is a wiki where the P/Invokes for Win32 are kept. Good examples for just about any C datatype.
0 Kudos
Message 9 of 9
(4,535 Views)