Owning Palette: Application Control VIs and Functions
Requires: Base Development System
Returns a reference to a VI Server application running on the specified computer.
If you specify an empty string for machine name, it returns a reference to the local LabVIEW application in which this function is running. If you do specify a machine name, it attempts to establish a TCP connection with a remote VI Server on that machine on the specified port.
|machine name is the address of the computer that runs an application instance to which you want to establish a connection. This address can be in dotted decimal notation (such as 22.214.171.124) or domain name notation (such as foo.ni.com). An empty string causes this function to return a reference to the local application instance.|
|port number or service name can accept a numeric or a string input. The default is a numeric. port number or service name is the port on which the remote LabVIEW application is listening. If you specify a service name, LabVIEW queries the NI Service Locator for the port number that the server registered. The default is to use the default VI Server listener port number (3363).
To establish communication between a VI and another LabVIEW application, you must know both the machine name and the port number or service name on which the VI Server in the other LabVIEW application is listening. If you have more than one LabVIEW application on the same machine, one or more of those applications may be listening on a port other than the default VI Server listener port. In this case, make sure to supply the port number or service name. Use the VI Server page to set the port number and service name for a VI Server or use the Server:Port and Server:Service Name properties to set the port number or service name programmatically.
|timeout ms specifies the time, in milliseconds, that the function waits to complete and return an error. The default value is 60,000 ms or 1 minute. A value of –1 indicates to wait indefinitely.|
|error in describes error conditions that occur before this node runs. This input provides standard error in functionality.|
|application reference is the reference to the specified application.|
|error out contains error information. This output provides standard error out functionality.|
You can use the application reference output as an input to the Property and Invoke Nodes to get or set properties and invoke methods on the application. Using it as the input to the Open VI Reference function lets you get references to VIs in that application. Close the reference with the Close Reference function. If you do not close this reference, it closes automatically after the top-level VI associated with this function completes execution. However, it is good practice to conserve the resources involved in maintaining the connection by closing the reference when you finish using it.
If you use the Open Application Reference function on a remote VI Server connection, you may receive an error that the network connection was closed by a peer. Verify that the machine is allowed access by selecting Tools»Options»VI Server on the server side. You also can verify the user access settings in the User access section of the VI Server page on the server side, also located in the Options dialog box.