Jump to content

Best way to interface two or more LV apps


Recommended Posts

Hi,

I need to create a LV app that will talk with other LV apps on several machines in our network. This app will allow one machine to connect to it at a time and process requests for controlling some hardware. I am trying to figure out what the best approach would be for the interface over the network. Here are the options I am considering:

Straight TCP/IP

Data socket

Shared Variable

The calling machine needs to request access, wait for it to be granted and then send and receive some data (most likely a cluster).

The 'server' machine needs to accept connections from many different machines but only allow one at a time to manipulate the hardware resource.

Does anyone have any experience with this sort of setup? What worked/didn't work for you?

thanks,

-John

Link to comment
I need to create a LV app that will talk with other LV apps on several machines in our network.

I think the best option is to Open Application Reference from LabVIEW instance that needs to make a request to remote LabVIEW instance that servers the request. Then you can use open VI reference to open reference to remote VI. After this you can call this remote VI using call by reference node . You can practically use remote LabVIEW almost as if it was local. Simple and clever. Shared variables are not appropriate for this kind of request-respond type communication. All your other alternatives are just much more complicated than directly calling remote VIs.

When LabVIEW starts, it starts a LabVIEW application server. This server listens to certain TCP port on the computer. The above mentioned requests are sent to this TCP port. When you build your LabVIEW application to executable or dll, a INI file is created. You can modify this INI file to define which TCP port the application server for that specific executable listens. The INI file is expected to be at the same directory as the executable. You can also modify the LabVIEW application server default TCP port somewhere from the LabVIEW options.

To be able to access the remote application, you must open the application server TCP port from you remote machine to accept remote connections. You must also allow remote connections from you local machine to this TCP port, although I this normally allowed by default at least if you use Windows XP built-in firewall.

Edit: BTW, you specify the application instance with IP-address and TCP port of the application server. You should therefore get fixed IP-address for each of your LabVIEW servers.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.