LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

display and interact with a vi front panel on remote C++ app

Hello:

I am new to LV and need a little advice.  I need to display a LabVIEW VI front panel in my C++ .Net application that users can interact with to view real-time spectrum data.  The C++ app (client) must reside on a separate computer(s) from the VI so that the client can connect from anywhere around the world and interact with the VI. 

I am not sure about the basic architecture that should accompany a good solution.  We want to use TCP/IP but not DataSocket.  I do not have access to Measurement Studio but I do have access to LabVIEW Professional Development System v 8.2.  Can anyone provide suggestions on what I need to do in order to

1.  Connect to my TCP server using my C++ client app - I have already written TCP client and server code which communicate but now I need to integrate LV
2.  Get access to the VI sitting on that server
3.  Send the VI front panel to the client for display
4.  Allow the user to modify parameters on the front panel displayed on the C++ client, send those changes back to the server, and refresh the front panel displayed in the C++ client given the new parameters (I would like a real-time display of the spectrum to always be available)

Is this possible?  Has anyone done this using C++ .NET in VS2005?  Are there examples I can mimic or references that will help direct me?  I have searched and searched through NI's help and found a lot of good stuff but I'm still feeling confused about the best way to utilize LV.

Thank you in advance!




0 Kudos
Message 1 of 7
(3,733 Views)

The easiest way I can think to do this is to embed a Microsoft Web browser component in your C++ form.

Then on the server, publish the VI that you want using the Web Publishing tool (Tools>>Web Publishing Tool)  This will create a web page that will allow you to view and control the VI in question.

Then when you initialize your C++ app, just navigate the web control in your c++ form to the right web page.  I think that the browser control's method that you need to call is WebBrowser::Navigate2 ( <url> )

Here are the downsides:

It won't look totally embedded in the C++ app, because you will see a web page background and an extra menu. 

You will also need to explicitly request control through a menu when the VI is loaded in your C++ app.

You will need the run-time engine installed on any client that wants to do this.

If none of these issues bother you, this might be a solution for you.

 

0 Kudos
Message 2 of 7
(3,717 Views)
Thank you JPeters!  I will run that solution by my client. 

One more question for anyone out there ... are there other design solutions available to me if I can convince the client to let me use DataSocket?  Is it simply very difficult to display a remote vi's front panel in a C++ form?  Is this why measurement studio was created?

Thanks again!

0 Kudos
Message 3 of 7
(3,711 Views)
One more question for anyone out there ... are there other design solutions available to me if I can convince the client to let me use
DataSocket? 
 
DataSocket won't help you in this regard at all.  Datasocket is  used to transfer data over the network, it doesn't transfer images or panels over the network. 
 
Is it simply very difficult to display a remote vi's front panel in a C++ form?
 
If you want to write this from scratch I think that the answer is yes.  But, lets look at it another way... how would you host any remote application in your C++ form?  This is probably a non-trivial exercise no matter what you are trying to host.
 
 
0 Kudos
Message 4 of 7
(3,703 Views)
Thanks again JPeters.

One more question ... what if I could use Measurement Studio?  The documentation seems to indicate that it's easy to create network applications and therefore it would be easy for me to re-create our VI's front panel using Measurement Studio components in my C++ app and then simply connect those components to the networked hardware (TCP/IP or DataSocket) that could be located anywhere in the world.

Is this right?
0 Kudos
Message 5 of 7
(3,698 Views)
One more question ... what if I could use Measurement Studio?  The documentation seems to indicate that it's easy to create network applications and therefore it would be easy for me to re-create our VI's front panel using Measurement Studio components in my C++ app and then simply connect those components to the networked hardware (TCP/IP or DataSocket) that could be located anywhere in the world.
 
Depending on what components you are using in your LabVIEW panel, it is probably pretty easy to build a Measurment Studio application to look like a LV panel.
 
Given that, you could use network shared variables to move data across the network, no TCP programming necessary -- I think that this is pretty easy to do, but I don't know the specifics about variable programming in that environment.  Also, you will probably need to add some smarts to the server side to make sure that it is reading to and writing from variables in an appropriate manner.
 
Question: why can't you just use LabVIEW for the client application also?
Message 6 of 7
(3,690 Views)
Thanks JPeters.  I wanted to let you know that displaying a VI in a web browser component in my C++ app went over great!!!  I wasn't sure how the client was going to respond to enabling the web server but it went over well.

The problem is that we already have a C++ app in use and since the user base needs things to be as easy and seamless as possible it's highly desired that we embed new LV functionality into the C++ app.  Making them leave their app to go run a separate VI would be less than ideal. 

Thanks again!
0 Kudos
Message 7 of 7
(3,665 Views)