LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detect remote panel connections?

Solved!
Go to solution

Is there a way for my VI to 'detect' when someone has connected to it with a Remote Panel and requested control?

 

I have an issue (due to the size/complexity of my VI I'm sure) that when a RP gains control, after a period of time, the main VI begins to slow down and starts to lose data (it's coming from a TCP connection)! 

 

I'd like to be able to see when a RP gains control, and automatically log them off after a period of time (5 min?).  I know that there is a connection time-out on the web publishing page, but it appears to only come into play if 1 RP has control and another requests it.  I need to be able to limit the control time of a single RP.

0 Kudos
Message 1 of 6
(3,605 Views)
Solution
Accepted by topic author Steve257

How about these functions?

 

remote panel.PNG

 

If you look at the help menu for 'Client Connections' it is very helpful.

Using the 'connections' output, you can index that array to get helpful information about the current client.

You can then use a little timing logic to allow them to only connect for a specified time limit.

Then you can kick em out with 'close connection to client'

Cory K
Message 2 of 6
(3,598 Views)

Here is the information you need for the 'connection' output

 

client connection.PNG

 

You can use 'remote' to see who currently has control of the RP.

Then you can use 'create time' and a little math to see the time difference between the current time and when they connected.

Cory K
0 Kudos
Message 3 of 6
(3,596 Views)

Thanks Cory,

 

I just dabble in LabView, so I'm unfamiliar with all the 'tricks of the trade'Smiley Happy.

It looks like I'll be able to use the VI method you described...now I just have to figure out time stamp math...

 

Steve

0 Kudos
Message 4 of 6
(3,567 Views)

Cory,

 

Well, it almost worked...

I'm attaching my little test program 'RP Control.vi'.  I've compiled this into an executable that's in my server path, so I can get to it from my laptop (on my network).  When I run it from my server, I can press my 'Start' button and nothing happens--no client RP's are connected, so this is as expected.

When I connect via my laptop to the server, my laptop is now the remote client, but it's hasn't requested control -- again, nothing happens when I press my 'Start' button.

When the laptop requests control of the VI, and I press the 'Start' button from the laptop, I see all my data fields filled in, and I show my calculated 'End Time?' which is 1 minute after the laptop got control. 

I can then keep pressing my 'Start' button, and see the 'Time Now' update, and when 1 minute elapses, I see my 'Close' LED turn on, indicating I should have activated the 'Close Connection To Client'. 

However, the laptop still has control of the VI...it hasn't returned to the server. 

 

Any suggestions as to what I may be doing wrong, or does the 'Close Connection To Client' work differently?

 

<edited>

Looking at the Method - 'RP.Close Connection To Client' does this return control of the VI to the server copy (which is what I want to do), or does it try to completely disconnect the Remote Panel (which is not what I'm looking for)?

Message Edited by Steve257 on 09-17-2009 02:47 PM
Message 5 of 6
(3,557 Views)

I think I've got it working the way I want it to...  It turns out that if I use the RP.LockControl, that 'bumps' any Remote Panels out of Controlling the VI.  I can immediately follow it with a RP.UnLockControl which allows Clients to re-establish their control if/when they need to.  EXACTLY what I was looking for!  Thanks Cory for setting me on the right path.

 

Steve

0 Kudos
Message 6 of 6
(3,540 Views)