LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enabling a boolean button via UDP Multicast

Solved!
Go to solution

Hi,

 

Imagine I have 3 Boolean buttons as depicted below on PC 1.

Diaspora_0-1576754724848.png

the respective switches to turn on the buttons are on a different PC namely PC 2 as shown below.

Diaspora_1-1576754786721.png

 

Is it possible to pass the communication between these 2 PC's using UDP Multicast? i.e When the switch no 1 is turned on PC2 the boolean button no1 on PC1 must glow and so on. Or is there any other way other than UDP multicast? Thank you in advance.

0 Kudos
Message 1 of 17
(4,629 Views)

That should work.  Look at UDP examples in the Example Finder under Help.  It may not have to be multicast.

 

Other methods would be TCP/IP and network shared variables.

0 Kudos
Message 2 of 17
(4,574 Views)

I am aware of sending real time messages through UDP but no idea how to pass the real time status of the switches. It will be really helpful if someone could show with help of a sample screenshot.

0 Kudos
Message 3 of 17
(4,568 Views)

How is the status of a switch any different than a real time message?

 

A switch is either True of False, a boolean.  Your message will be a boolean.  So read your 3 switches on the one device.  Combine it into an array or a cluster.  Flatten that to String and send it.

 

On the other side, read the message and unflatten from string.  Send the results of that to the 3 boolean indicators.

Message 4 of 17
(4,557 Views)

UDP is lossy.

 

No guarantee the message will be sent or received.

 

TCP/IP on the other hand does ensure delivery unless the message is dropped in which case an error will indicate as much.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 17
(4,549 Views)

I am trying to build an array using 2 different data types but it seem not to be working. Is there any way where values of different data types can be stored and sent along? Could you kindly send me a sample screenshot if possible of building different data types into an array and receiving on the other end? Just a rough sample will suffice. Thank you.

 

 

0 Kudos
Message 6 of 17
(3,153 Views)

Instead, show us what you;ve tried by uploading your VI.

0 Kudos
Message 7 of 17
(3,137 Views)
Solution
Accepted by topic author Diaspora

Here is a sample showing how to flatten different ty[es and get them back.

 

 

Message 8 of 17
(3,130 Views)

Thank you, RavensFan for your kindness. I am a novice at LabVIEW. I am trying to send the status of Power status, LEd status, and Temperature using UDP protocol and read/ receive the same on the other end and display the same. Could you kindly show me how to wire the given inputs?

Diaspora_0-1577249887561.png

0 Kudos
Message 9 of 17
(3,121 Views)
Solution
Accepted by topic author Diaspora

You can just bundle those 3 together on one side.  Flatten to String.  Send.

On receiving side, unflatten from string.  Unbundle.

Message 10 of 17
(3,113 Views)