ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data transfer between LabView and VB.net

Solved!
Go to solution

Hello,

 

I want to have two applications running, one labview and another vb.net. The LV application consists of two controls a,b & one indicator c.

 

The logic is a+b=c which is a WHILE loop. From VB.NET I want to pass values of a, b to LV and get back the result 'c' may be through event structure in VB.NET.

 

Please let me know how to achieve this.

0 Kudos
Message 1 of 9
(5,695 Views)

Hi!

Here you can find a starting point for .NET event handling in Labview:

https://forums.ni.com/t5/Developer-Center-Resources/Register-Callback-VIs-for-NET-Events-in-LabVIEW/...

 

You could,as an alternative, use Labview to build a DLL and call it from VB.NET or vice-versa.

As a third alternative the programs can communicate via TCP/IP or UDP or through a web service.

 

Regards,

Marco

Message 2 of 9
(5,664 Views)

Hi,

 

I am looking for solution using activex server  in LV. Actually I am able to create LV activex server and register it with vb.net.

 

In fact I am also able to start the VI and see that the while loop is running. But unable to pass values to the control a and b.

 

Can somebody explain me using activex server properties & methods how to pass the values to controls.

 

Rgds,

 

 

0 Kudos
Message 3 of 9
(5,648 Views)

There should be an example for you, as noted in the last paragraph of this link: https://www.ni.com/docs/en-US/bundle/labview/page/activating-labview-as-an-activex-server.html

 

Marco

 

Message 4 of 9
(5,629 Views)

Marco, ur support is appreciated !

 

However the example is for visual basic 6. Also I know how to call dll, exe from vb.

 

What I am trying to do is use the methods & properties ( OOPS ) of Virtual Instrument / LV application to transfer data.

 

The attached screenshot will help you understand my problem better. Here I am trying to stop the execution of counter increment logic in LV from vb.net

 

Can you suggest solution ?

2.png

0 Kudos
Message 5 of 9
(5,625 Views)

Hi!

In sub Button1_Click you are defining and initializing local va1 and vi1.

That's probably why the Button2_click is not working as you want.

 

Always use the global va1 and vi1 and everything should be fine.

 

Regards,

Marco

 

Message 6 of 9
(5,612 Views)
Solution
Accepted by puneguy

Yeap U r right !

 

Thank you Marco.

0 Kudos
Message 7 of 9
(5,599 Views)

Glad to see you solved your issue!

If you want you can provide some beer kudos.

 

Marco

Message 8 of 9
(5,595 Views)
My pleasure !
0 Kudos
Message 9 of 9
(5,580 Views)