From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to communicate two differents Vis in two diferent computers with labview?

I have one Vi in one computer and I want that when I press run, my vi runs and then it automatically run another vi in a different computer and come back to the previous Vi. Is that possible?

How could I do that?

0 Kudos
Message 1 of 6
(2,873 Views)

Hi lcf,

 

I have one Vi in one computer and I want that when I press run, my vi runs and then it automatically run another vi in a different computer and come back to the previous Vi. Is that possible?

No.

If it would possible you would create a computer virus… 😄

 

How could I do that?

Check the examples coming with LabVIEW. Especially those for UDP or TCP server/clients!

When you want some communication between two computers then you need to run an executable on both computers, at the same time: one would be the server, the other the client…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,868 Views)

There are two options.

The more recommended way is to implement a communication interface between the applications calling these VIs. This would require you to implement some TCP/UDP interaction or you download libraries for this (e.g. STM).

The other option is using VI Server. Use Open Application Reference to get connection to the other LV environment/runtime.

 

Please note that you have to potentially configure the firewall on both PCs for it to work.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 6
(2,857 Views)

Do you have any exmples of how could I do it using VI server?

0 Kudos
Message 4 of 6
(2,850 Views)

I dont have an example at hand right now. Anyhow, this is part of the LV help and should help you out.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 6
(2,845 Views)

Confirming Norbert's suggstion about VI Server.

 

That approach has been avaliable going back to LV 6i. At that time it was bit more more and all you needed to do was enable VI serving on the raget machine and then knowing the path to the VI you wanted to invoke. It was THE method that was taught in early RT courses.

 

Since then it has been complicated by firewalls, Projects, and VI Server access lists...

 

I have use that approach many times ove the years becuase once you get it figured out, it abstracts away the connection and protocol complications and lets me focus on the high-level ineractions.

 

After the coonection is made, we need only use "Invoke Node Call by reference" to the VI we want to invoke on the target machine.

 

It is a elegant approach if you invoke an Action Engine on the targt machine which if properly coded, will prevent race conditions across networks with multiple nodes. I have used it to access litteraly hundreds of target machines.

 

There are only two draw-backs that come to mind associated with VI Server.

 

1) There are some that think that the VI Server appraoch is a security risk. I have built-in security checks to prevent issues in the applications that warrented the extra check.

 

2) The data is transfered to and from the CBR using the UI Thread so if there are large data sets being passed or recieved from, the remote machine then plan for the UI thread to be hit durring the calls.

 

This tag cloud has some links associated with VI server if you want to read beyond the notes in the link Norbert offered.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(2,819 Views)