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: 

Multicast UDP server - receiver

What I am trying to do?

Establish a multicast UDP server and receiver.

 

Problems  faced?

  • When I run the receiver for the first time (i.e before running the server), it is shows “message received” which should not be happening until actually the message is passed.
  • I want to be able to send and keep receiving messages in real time, but with the attached code it is not happening. I need to start and stop the server between two messages.

I kindly request you to help me fix this code and furnish details about the things I am missing out.  Herewith, I attach the code with this. Thank you in advance.

Download All
0 Kudos
Message 1 of 5
(1,935 Views)

Ah, what a mess!

Your message popup in the receiver run in parallel of the UDP read. Place it inside a case structure so it only executes if UDP read completes without error.

 

(Your port should be U16 datatype, not orange. You should not have any connection ID constants. Use a simple state machine instead of deeply stacked structures.)

0 Kudos
Message 2 of 5
(1,900 Views)

I am learning this tool myself since a week or so. I am partially able to infer what you are trying to communicate. It will be helpful for me if you will be able to provide the solution in the form of code. Sorry for the trouble.

0 Kudos
Message 3 of 5
(1,893 Views)

There are many more things wrong with your VI, for example the inner receiver loop can never stop.

 

Here's what I had in mind:

 

altenbach_0-1574094358031.png

 

Personally, I would not use popups. Just use an status indicator on the front panel.

0 Kudos
Message 4 of 5
(1,867 Views)

Really so kind of you. Thank you so much. I will study what you have furnished here. Sure, It is helping to get better perspectives and code better.

0 Kudos
Message 5 of 5
(1,831 Views)