LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Embed subpanels and control remotely

Here is the situation....I have an application that is going to be used on our product. It works but we are trying to enable remote functionality so someone can control the application from another location.
 
The product has physical buttons and knobs on it that trigger events that the UI responds to. However, if someone wants to control the application remotely, they will not be sitting in front of the box able to touch the physical keys. Luckily, there is a VI that someone made that is a virtual mockup of the physical buttons and knobs on the front panel. They simply are programmed to trigger the corresponding event that would have normally been caused by the hardware equivalent. This VI was meant for test purposes but I believe I can use it to achieve the remote control capability that I want.
 
So I need to find a way to embed my top-level front panel and that virtual mockup of buttons into a VI. The buttons must trigger events that will be sent to the remote machine. Then the front panel must receive all the input from the remote machine and display it.
 
On top of this, my top-level front panel is a handful of subpanels that have their own VIs running in them. I am not sure how this will work remotely.
 
If anyone has suggestions or ideas about how I can do this, please let me know. I have been looking at VI Server and the LabVIEW Web Server to use the remote front panel capabilities but have not been able to iron out anything solid that will work for me.
 
Kyle
0 Kudos
Message 1 of 26
(4,875 Views)
I would say there are two low-risk solutions. First, utilize something like VNC to open a window on your local PC that is the remote computer's desktop. Then it would be exactly like you are sitting at the remote PC.

Second, use subpanels to display the front panel of the remote LV application in a small shell program that runs on your local PC.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 26
(4,844 Views)

VNC is out of the question because our platform and situation does not allow for it.

I was thinking about the subpanel option. However, I need to do more than just view the window, I need to be able to control it. Will subpanels work both ways or not?

I also need to find out how to pass a variant object from my local VI to the remote application...ideas? I know I can use VI Server but I haven't the slightest idea what VI to use to pass objects back and forth. I know how to open the connection and get the reference to the remote VI but once I have that, I am clueless.

Kyle

0 Kudos
Message 3 of 26
(4,833 Views)
In terms of subpanels, yes they work both ways. In fact, unless you have the frame around them visible the user will have no idea that they are actually interacting with the front panel of another application. It is totally seemless it's a though all the controls nad indicators on the other VI's front panel have suddenly been transplanted onto yours - which for me is one of the things so cool about them.

To pass data to clones you add one step to the "cloning" process. First you open a reference to the template VI. This loads a new copy of it into memory and returns a VI reference to it. Next, to pass your data into the clone you call the VI method Set Control Value [Variant] for each control you need to initialize before running the clone. This method needs as input the Label of the control you ae setting the value for, and the data you want written to the control. The datatype of the method's value input is variant, but don't worry, LV will convert it into the right LV datatype when it's updating the clone's control. Once you have all the controls populated, call the Run VI method to start it and you are ready to go on to launching the next clone. The attached VI shows the basic process and assumes the presence of a template called myVI.vit that has two inputs (integer input and string input).

Concerning variants, the thing to remember its that as far as LV is concerned a variant is just another datatype. Passing a variant value is no different than passing a number or a string. You can sort of think of a variant as being a shipping box that you can put anything into. In this metaphor the persons putting stuff into the box and taking the back stuff out have to know what is in it, but all the people in between don't. Their job is just to move the box. In the same way, variant controls and indicator don't care what type of data the variant is carrying - they just move the variant.

Mike...

Message Edited by mikeporter on 06-08-2007 09:27 AM


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 26
(4,828 Views)
Is there a way to run a remote front panel in a local subpanel. From what I am finding out by experience and research, it is impossible. I keep getting error 1147 and I am guessing that just flat out means that it is impossible.
 
If indeed that is impossible, is there any way to write a VI that will automatically open a connection to a remote from panel through the web server functionality? I just want to be able to create an EXE that will automatically load the front panel of a VI that is already running on another PC.
 
Kyle
0 Kudos
Message 5 of 26
(4,818 Views)
You are correct, subpanels will only work locally. The solution is either the Web Server which could incur licensing costs. Or to implement some sort of remote control functionality on your own - but the practicality of that approach depends upon how complex your control interface. You already mentioned subpanels so provisions will need to be made for accessing the controls on those panels. If you are running XP you also have its built-in remote desktop capability.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 26
(4,797 Views)
I will be running XP but I want to use as few windows tools as possible. Any VNC program is also out of the question since the application for remote control will be shipped to the customer. I need a solution in LabVIEW that will be as automatic as possible so the customer does not have to fool with settings other than specifying a port and IP address to use.
 
I have found out how to create an invoke node using the Remote Panel: Open Connection to Server method. But instead of having to open two windows, one for input and one for output, I want to be able to put them both in one on the client side. Is there any way to do that?
 
Kyle
0 Kudos
Message 7 of 26
(4,746 Views)
Kyle:
 
I am not sure I fully understand what you mean by the number of windows. If you have a VI that demonstrates the number of windows you are referring to, please post it so that I can further assist you.
Regards,
 
Rudi N.
0 Kudos
Message 8 of 26
(4,711 Views)
I have attached about as much as I can per company policy. This is an example of what I am doing, I am opening two VIs that are running on a VI server. They will both appear in different windows and it works great. But I want a way that I can open both of the front panels on the remote side, but make them appear in one VI that the user will see. The user will not even know that there are two remote VIs open.
 
Kyle
0 Kudos
Message 9 of 26
(4,699 Views)

Kyle:

Thank you very much for attaching the VI; it gave me a better understanding of what you are trying to achieve. It is not possible to use Application Invoke Node to embed two panels within the same Front Panel. It is partly because each Invoke Node is establishing a connection to the server. However, I found another way to get it done using a “.Net Controller”. The overall idea is that you will create executables for the two VIs you would like to access, and then use the Web Publishing tool to publish the VIs over the web and then embed each web page in “.Net Containers”. The reason why I am suggesting that we build executables is so that we can specify different HTTP ports for the Web Servers. This is indeed possible because executables are separate LabVIEW processes, while all LabVIEW VIs run under the same LabVIEW Process, thus using the same HTTP port. Follow these steps to see what I am talking about:

1.      Open LabVIEW on the Server computer.

2.      Navigate to Tools » Options and go to Web Server: Configuration. Make sure that Enable Web Server is enabled and HTTP Port is set to use the default one (Port 80).

3.      Open the first VI you are trying to publish.

4.      Navigate to Tools »Web Publishing Tool and follow the steps in the wizard.

5.      Repeats steps 1 & 2 for the second VI.

6.      Create two executables for the two Vis.

7.      Open the “.ini” file of the executables, and add the following tokens “WebServer.Port=80” for the first one & “WebServer.Port=82” for the second one.

8.      Open a blank VI on the on the Remote Computer.

9.      Put down two Web Browser .Net Containers by going to .Net & ActiveX » Web Browser on the Front Panel.

10.  Switch to the block diagram and create a Method by right-clicking on the Web Browser Reference and select Create » Method… » Navigate.

11.  Create a constant for the URL and it should be in the following format: http://IP Address: Port80(82 for the 2nd VI)/VI’s Name  .html

12.  Run the executables on the Server Computer, then run the VI on the remote computer and you should see Front Panels on the .Net Containers.

I hope this helps and do not hesitate to post again if you need further assistance.

Regards,

 Rudi N.

Message Edited by Rudi N on 06-15-2007 03:59 PM

0 Kudos
Message 10 of 26
(4,660 Views)