LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain client's IP address in remote panel?

Hi,

I am using LabVIEW remote panel to publish my vi. Beside the log file in the server, does anyone know how can I obtain the information of the connected browser? I want to show the IP address of the current connected browser in my vi and use it to change the access right of that browser programmatically.

Thanks
0 Kudos
Message 1 of 11
(4,813 Views)
Hi,

I have one more question that how can I know how many browsers are currently connect to my web server?

Thanks
0 Kudos
Message 2 of 11
(4,806 Views)

There's a property node in the 'VI Application' set called "Connections To Clients". This will give you an array of clusters of information about all the computer currently connected to the server. One of the elements in the array is string labeled "Remote", this is the IP of the connected computer.

To get this property, drop a property node from the 'Application Control' functions palette. This will be set to the 'Application' VI server class by default, which is what you want. Change the property to 'Remote Panel>Connections to Clients'. This will give you the array of clusters.

The number of elements in the array will tell you how many are currently connected to the server. But, unless you purchased extra Remote Licenses from NI, only one person at a time can connect. LabVIEW comes with a single license for the remote panel.

Ed



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 11
(4,801 Views)
Hi Edwin,

Thanks for your help. Follow your instructions, now I can get the IP address of the connected browser.

I am using remote panel to let other browser to remote control my vi. I want to use the browser access list in it to restrict the browser using my program. Before the browsers can use my program, I want they some authorization. If the browser pass the authorization, I will add the browser's IP address in the access list (That's why I want to get the IP address of the browser). However, I find a problem that if the browser is not already in the access list, he cannot connect to my Web server and do the authorization in my vi. Do you have any suggestion to this problem?
Beside this problem, do you know how to change the access right in hte access list (e.g. allow viewing and controlling, allow viewing, deny access) programmatically?

Alan
0 Kudos
Message 4 of 11
(4,777 Views)
You can use the same property node to set access rights for the web server.

Float the cursor over the bottom edge of the node in the center and it will change to a double arrow. Now click and drag down to add extra terminals to the node. Change the properties of the extra terminals to 'Web Server>TCP/IP Access List' and 'Web Server>VI Access List'. These will let you set the IPs and VI list programmatically by changing them to Write instead of Read. (right click on the terminal and select "Change to Write")



For more info on how to use these properties, right click on the terminal and select "Help for Web Server:TCP/IP Access List". This will give you specific instructions on how to use these.

As for dynamically setting the access rights through some type of authorization, you’ll need to come up with a VI that is accessible to everybody that has a username/password authorization that would then use the above properties to allow that IP access to the rest of the VIs.

Good Luck, sounds like an interesting project.

Ed

Message Edited by Ed Dickens on 03-17-2005 08:29 AM



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 5 of 11
(4,764 Views)
Hi Edwin,

Once again, thank you so much for yor help.
My situation is that I will open several VIs to let web browser remote control them. So that all of these vis are already in the "VI Access List". In the beginning, nobody is in the "TCP/IP Access List". What I want to do is to add browser's IP address to "TCP/IP Access List" if he pass the authorization. However, I find a problem that if the browser's IP address is not already in the "TCP/IP Access List", he also cannot access my authorization part through a web browser. That means in final, nobody can add in the "TCP/IP Access List". Do you have any suggestion?

Moreover, do you know is there any relationship between "TCP/IP Access List" and "VI Access List"? I find that all of the VIs in the "VI Access List" can be accessed by every browsers in "TCP/IP Access List". I cannot specify which browser can only access to a particular VI. Am I right?


Thanks.

Alan
0 Kudos
Message 6 of 11
(4,742 Views)
Alan,

You're correct, there's no way to give access to a certain VI to everybody and limit access to others. This would be a nice feature, and hopefully something NI can add.

If you look through this thread, it looks like somebody figured out how to do it using CGI, but it doesn't look like he's watching the forum anymore.

One simple way would be to just access to everybody, and direct everybody to an authorization VI, that would check username/password, then open the real VI. A simple example is attached. Extract the two .htm files to the 'www' directory under your main LabVIEW directory. Save the two VIs somewhere and open them. Now on another machine, connect to http://server IP/Authorize.htm. Enter the username and password shown below the controls and click Enter. The next VI should open in the browser. Note the Internet Explorer must be your default browser. Not real secure, but it might be enough.

Another option would be to repost this question to the forum and see if anybody else knows how to do it.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 7 of 11
(4,728 Views)
One more thought here.

If you look in the 'www' directory under your main 'LabVIEW X.X' directory, there's a sub directory called 'examples'. Some of these might be of intrest as they deal with passwords and limiting access. They use the CGI server and/or the G web server.

In particular, look at "access.htm", "accpanel.htm" and "password.htm". There might be more if you look.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 8 of 11
(4,724 Views)
Hi Edwin,

I just download your zip file and try to open the VIs. But I have a problem that my LabVIEW version is 7.0. So that I cannot open your VIs. Is there any method I can read the VIs?

Thanks.

Alan
0 Kudos
Message 9 of 11
(4,715 Views)
Here it is in 7.0

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 10 of 11
(4,707 Views)