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: 

Remote Debuging does random TCP/IP port selection on dev pc

We want to use remote debuging in Labview. We build test .exe app and try remote debuging .exe on a the same PC. It works.

 

When we move .exe app to target pc the remote debuging does not work. We have set up firewal correctly, we set port 3580 as exeption rule. We also can ping target pc from host pc. The interest thing is that LV wants to comunicate with target pc over random port number instead 3580 port. We asume that this is problem here.

 

How the remote debuger can be set up correctly to only use specific port?

 

Using TCP/IP viewer and cmd, there can be seen that target PC is actually listening to port 3580, but host PC is trying to connect with random port number 50434, 502132 itc.

We also implemented all the necessary steps from this site with no success:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHpiCAG&l=sl-SI

 

Please help

0 Kudos
Message 1 of 5
(933 Views)

Are you sure you are not misunderstanding something here? Generally the outgoing port from a client is random because you do not want to run into the problem that the client can't create an outgoing connection if that port is already used by a different process.

 

Your client PC on which you want to debug needs to listen on a well known port which it seems to do. You configure the LabVIEW debug link to connect to that port. But the LabVIEW debugger also needs to create a local port on your development PC as TCP/IP only works by connecting two ports on the two endpoints together. But the LabVIEW debugger does not care what port it uses on its own side so it lets the OS driver choose whatever port it deems available.

 

This can of course prompt a problem when you have a firewall configured but it shouldn't really. Most firewall rules are configured to allow outgoing connections from any port and only block incoming connections.

 

So on your development PC you should not need to configure anything unless you use a firewall configuration that is for some reason MUCH more stringent than usual. In that case you would need to configure to allow outgoing connections with a target port corresponding to the 3580 port number, not a source port with that number.

 

More likely the problem is the firewall on the computer you want to debug on. By default it will block incoming connections to any port but the configured exceptions. So you need to add a rule on this computer to allow incoming connections to the port number 3580 and with random source port.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(899 Views)

Thank for your information. Nothing helps only if I turn off firewall on target PC, remote debug works...

 

my additional question to your post:

"You configure the LabVIEW debug link to connect to that port." - > How Can I do that?

"TCP/IP only works by connecting two ports on the two endpoints together. " -> I'm confused about a lot of port numbers...Can you describe the connectivity by drawing down connection on the picture?

"So you need to add a rule on this computer to allow incoming connections to the port number 3580 and with random source port." -> We have configured port 3580 as exeption rule but how can "random" source port can be added ass rule? Do you have any picture how firewall must be configured?

0 Kudos
Message 3 of 5
(869 Views)

@AndrazS wrote:

Thank for your information. Nothing helps only if I turn off firewall on target PC, remote debug works...

 

my additional question to your post:

"You configure the LabVIEW debug link to connect to that port." - > How Can I do that?


Forget that. You can't configure the port. LabVIEW is asking for the port number to the Service Name registrator at port number 3580 by Service name.

 

"TCP/IP only works by connecting two ports on the two endpoints together. " -> I'm confused about a lot of port numbers...Can you describe the connectivity by drawing down connection on the picture?


Every TCP/IP connection consists of <source IP>, <source port>, <target IP>, <target port>

 

source IP is the IP address of the computer on which the client tries to open a connection and the source port is usually arbitrarily assigned by the OS driver to whatever port it deems available.

 

target IP is the IP address of the computer on which a server is listening for incoming connection and the target IP is usually well known.

 

The debug server is built into the LabVIEW runtime on your target computer that starts up the VI you want to debug.

 

"So you need to add a rule on this computer to allow incoming connections to the port number 3580 and with random source port." -> We have configured port 3580 as exeption rule but how can "random" source port can be added ass rule? Do you have any picture how firewall must be configured?

On which computer did you change that firewall configuration? What firewall is it?

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(855 Views)

@rolfk wrote:

@AndrazS wrote:

Thank for your information. Nothing helps only if I turn off firewall on target PC, remote debug works...

 

my additional question to your post:

"You configure the LabVIEW debug link to connect to that port." - > How Can I do that?


Forget that. You can't configure the port. LabVIEW is asking for the port number to the Service Name registrator at port number 3580 by Service name.

 

"TCP/IP only works by connecting two ports on the two endpoints together. " -> I'm confused about a lot of port numbers...Can you describe the connectivity by drawing down connection on the picture?


Every TCP/IP connection consists of <source IP>, <source port>, <target IP>, <target port>

 

source IP is the IP address of the computer on which the client tries to open a connection and the source port is usually arbitrarily assigned by the OS driver to whatever port it deems available.

 

target IP is the IP address of the computer on which a server is listening for incoming connection and the target IP is usually well known.

 

The debug server is built into the LabVIEW runtime on your target computer that starts up the VI you want to debug.

 

"So you need to add a rule on this computer to allow incoming connections to the port number 3580 and with random source port." -> We have configured port 3580 as exeption rule but how can "random" source port can be added ass rule? Do you have any picture how firewall must be configured?

On which computer did you change that firewall configuration? What firewall is it?


This was on target PC, that runs .exe to debug. It has Windows Defender Firewall 

0 Kudos
Message 5 of 5
(840 Views)