Tomi Maila Posted January 17, 2008 Report Share Posted January 17, 2008 Hi, Assuming I've a network of multiple computers, say A, B and C. On one computer A I've a LabVIEW application App_A running. In that application I've a valid reference to a remote LabVIEW application App_B running on a second computer B. Is it possible to find out the ip address and the port number of that application App_B from the valid reference in App_A. I need to be able to open a reference to the same application App_B on B from computer C. I need to somehow pass App_C on computer C sufficient information to connect to App_B on computer B and the only thing I've is the reference to App_B valid in App_A only. Tomi Quote Link to comment
Yair Posted January 17, 2008 Report Share Posted January 17, 2008 QUOTE(Tomi Maila @ Jan 16 2008, 02:30 PM) the only thing I've is the reference to App_B valid in App_A only. I assume that this means that you do not have access to the original settings used to open the application reference? There is a Server.Port property, but it says it doesn't work in remote apps, so I think unless you have the original data, which you can then send through TCP or UDP, you're basically stuck. An alternative might be for B to publish its details through UDP, but A would still need to confirm that it connected to that specific instance. Quote Link to comment
Tim_S Posted January 17, 2008 Report Share Posted January 17, 2008 I'm assuming you're using the open application reference, though I've noticed that you could be using the TCP communication or similar as well. Looking at the Open Application Reference, you have to know the machine name and can optionally add the port number when making the connection from A to B, so I assume you know both of those at A. You'd still need to get that information to C, though if you all ready know this information at A to where you can make the connection in the first place, then why don't you know it at C? What version of LabVIEW are you using? You may be able to use shared variables to have B publish the needed information to where A and C can access it. Tim QUOTE(Tomi Maila @ Jan 16 2008, 07:30 AM) Hi,Assuming I've a network of multiple computers, say A, B and C. On one computer A I've a LabVIEW application App_A running. In that application I've a valid reference to a remote LabVIEW application App_B running on a second computer B. Is it possible to find out the ip address and the port number of that application App_B from the valid reference in App_A. I need to be able to open a reference to the same application App_B on B from computer C. I need to somehow pass App_C on computer C sufficient information to connect to App_B on computer B and the only thing I've is the reference to App_B valid in App_A only. Tomi Quote Link to comment
Tomi Maila Posted January 17, 2008 Author Report Share Posted January 17, 2008 QUOTE(Tim_S @ Jan 16 2008, 08:18 PM) I'm assuming you're using the open application reference, though I've noticed that you could be using the TCP communication or similar as well. I'm using a reference that is opened with open application reference. However it's opened outside the scope of my code. QUOTE(Tim_S @ Jan 16 2008, 08:18 PM) Looking at the Open Application Reference, you have to know the machine name and can optionally add the port number when making the connection from A to B, so I assume you know both of those at A. You assume wrong. The part of the code I'm working on only knows the application reference and doesn't know how it has been opened previously. I'm using LabVIEW 8.5 or newer. Quote Link to comment
Ton Plomp Posted January 17, 2008 Report Share Posted January 17, 2008 QUOTE(Tomi Maila @ Jan 16 2008, 07:48 PM) I'm using a reference that is opened with open application reference. However it's opened outside the scope of my code.You assume wrong. The part of the code I'm working on only knows the application reference and doesn't know how it has been opened previously. I'm using LabVIEW 8.5 or newer. Well first you should make sure it is possible to open an app reference from two computers to the same app (port) on a third computer, I doubt it. The A-app can read the from the B.app.instance the port it is listening to, and by loading a VI into B memory that reas the current IP address (ipconfig?) it should be able to sent those info to C. Most likely you have to take your resort to an UDP listener in B that listens to broadcasts from A or C (I know this does not fit your current requirements). Ton Quote Link to comment
gb119 Posted January 17, 2008 Report Share Posted January 17, 2008 QUOTE(Tomi Maila @ Jan 16 2008, 12:30 PM) Assuming I've a network of multiple computers, say A, B and C. On one computer A I've a LabVIEW application App_A running. In that application I've a valid reference to a remote LabVIEW application App_B running on a second computer B. Is it possible to find out the ip address and the port number of that application App_B from the valid reference in App_A. I need to be able to open a reference to the same application App_B on B from computer C. I need to somehow pass App_C on computer C sufficient information to connect to App_B on computer B and the only thing I've is the reference to App_B valid in App_A only. My first thought was to run a vi in App_B from A that opens an application reference to itself and uses that to inspect the 'local only' properties and then report them via its front panel - I assume that if the App_B vi is running on B, then when it opens an application reference it gets a local application reference. That has the advantage that it is then OS independent. Of course, you have to arrange for the relevant vi to be loaded into App_B's memory otherwise you'll have to find a suitable path, but I guess a static reference in App_B would do the trick until the compiler learns to optimize non used static references out... There is a way of looking at Remote Panel connections (both client and server) from the local app reference, but I think the remote panels were working over the web-server which is not what you want... Quote Link to comment
Tomi Maila Posted January 18, 2008 Author Report Share Posted January 18, 2008 QUOTE(tcplomp @ Jan 16 2008, 08:53 PM) Well first you should make sure it is possible to open an app reference from two computers to the same app (port) on a third computer, I doubt it. This works fine. I built one server application and two client applications and both client applications were able to connect to the same server application simultaneously. The server port was constant and explicitly specified when establishing a connection to the server from the client. Quote Link to comment
Tim_S Posted January 18, 2008 Report Share Posted January 18, 2008 QUOTE(Tomi Maila @ Jan 16 2008, 01:48 PM) I'm using a reference that is opened with open application reference. However it's opened outside the scope of my code.You assume wrong. The part of the code I'm working on only knows the application reference and doesn't know how it has been opened previously. I'm using LabVIEW 8.5 or newer. From a bit of poking about, it appears that all of the information you're looking for is blocked from any remote access. I think the sugestions of the local application publishing the information in some manner (TCP, UDP, front panel, shared variable, etc.) to be your best solution. Quote Link to comment
Rolf Kalbermatter Posted January 23, 2008 Report Share Posted January 23, 2008 QUOTE(tcplomp @ Jan 16 2008, 01:53 PM) Well first you should make sure it is possible to open an app reference from two computers to the same app (port) on a third computer, I doubt it. This is no problem for the VI server. It can handle multiple client connections in parallel.There are some application properties (private I think) where you can monitor the connections and I think limit or even drop some of them yourself, but normally it can handle multiple connections. As to the original request, I'm afraid there is no way you can retrieve the remote address and remote port from an existing Application Reference. Injecting a VI into the remote side that you can then execute to retrieve the remote sides local parameters would be the only idea that I have. However I don't think any of the VI server stuff allowing to execute VI code that exists as a memory stream will be accessible remotely because of security concerns. So you would have to get that VI on to that computer in some way that requires physical access to it. Rolf Kalbermatter Quote Link to comment
Fab Posted March 16, 2011 Report Share Posted March 16, 2011 Hi, Assuming I've a network of multiple computers, say A, B and C. On one computer A I've a LabVIEW application App_A running. In that application I've a valid reference to a remote LabVIEW application App_B running on a second computer B. Is it possible to find out the ip address and the port number of that application App_B from the valid reference in App_A. I need to be able to open a reference to the same application App_B on B from computer C. I need to somehow pass App_C on computer C sufficient information to connect to App_B on computer B and the only thing I've is the reference to App_B valid in App_A only. Tomi Tomi, I am trying to do something similar. Did you ever find out if there was a way to get the IP Address from the "application reference"? Thanks, Fab Quote Link to comment
Rolf Kalbermatter Posted March 16, 2011 Report Share Posted March 16, 2011 Even in LabVIEW 2010 with private properties enabled there appears to exist no such possibility. Quote Link to comment
Fab Posted March 18, 2011 Report Share Posted March 18, 2011 In case anyone else things this should be possible, please vote, there is an idea for that: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Obtain-the-IP-address-from-the-Application-Reference/idi-p/1491780 Fab Quote Link to comment
Jarrod S Posted March 22, 2011 Report Share Posted March 22, 2011 This isn't a global solution to the problem, but you can have a VI on the server side that the client can invoke via VI Server to send the IP Address and port of the server's VI Server instance. I do exactly that here with this example I wrote for a remote User Event library. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.