LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Standalone application can't receive UDP message

Solved!
Go to solution

Hello all!

I have a small vi (part of a bigger program) working to receive udp messages sent by another device in the LAN. It works well when it's a normal vi, but

 

when I built an exe of this vi, I don't see any udp message received by the exe. Anybody got any idea of this? Here is my vi, and thanks in advance!

 

Immagine1.png

0 Kudos
Message 1 of 10
(3,758 Views)

Make sure that both VI and EXE are not running at the same time. One port can be occupied only by one Application.

0 Kudos
Message 2 of 10
(3,756 Views)

Thanks for the tip but the exe does run alone without the running vi.

0 Kudos
Message 3 of 10
(3,750 Views)

Do you exit cleanly in the dev environment before running the exe? Your code will only exit cleanly on error, and you will get the error dialog at the end of your block diagram in that case. If you "hard stop" your vi using 'Abort execution', your port will not be released.



CLA
www.dvel.se
0 Kudos
Message 4 of 10
(3,745 Views)

Thank you for the tip! I tried with adding a stop button to stop the while loop in the original vi, and runing the vi again then pressing the stop button to stop running, in such case the udp port shall be closed well right? Then I run again my exe and still no udp message received....

0 Kudos
Message 5 of 10
(3,738 Views)

Right, so that wasn't it.

 

Next guess would either be the max bytes value, is the default value that is used in the exe correct?

 

Also, this could be a firewall issue, LV might be let through while your exe might be blocked.



CLA
www.dvel.se
0 Kudos
Message 6 of 10
(3,729 Views)
Solution
Accepted by topic author jcraffael

Definitely check the firewall rules. An application is by default not automatically entitled to create sockets on random ports. Usually you get a dialog by the firewall software on first startup of an application, if you want to allow it to access network functionality. But it's easy to dismiss that dialog without reading it carefully and sometimes Windows doesn't even seem to prompt you. And then the firewall rule is normally set to deny any and all network access for the executable.

 

To not push viruses and other malignant software with the nose on the fact that it has been blocked, a firewall rule will often let the API calls succeed but simplyact as if there is no network available.

 

And the firewall rules are assigned based on executable name AND location of the executable in the file system. So moving the executable somewhere else will basically mean a new application and require its own firewall rules.

Rolf Kalbermatter
My Blog
Message 7 of 10
(3,718 Views)

Thanks again for the kind reply. This time I tried to install my application in another pc and it works. 

 

So probably it's the firewall issue.

0 Kudos
Message 8 of 10
(3,667 Views)

Thank you for the detailed explanation. I tried to install my application in another pc and it works!

 

So it's probably the firewall issue.

 

Thanks again!

0 Kudos
Message 9 of 10
(3,665 Views)

Most firewalls allow some user configuration. For the built in Microsoft Windows firewall you would go to Control Panel->Administrative Tools->Windows Firewall with Advanced Security.

 

In there go to the Inbound and Outbound Rules depending if your app is a server (which requires inbound connection rights) or a client. Then look for the entry for your app and set the corresponding rights. Try to be only as permissive as necessary, this means especially for inbound rules on Public and Domain networks to be as restrictive as possible. 

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(3,642 Views)