LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP connection does not work as EXE

Solved!
Go to solution

All,

 

I have a RT and Windows GUI application that uses TCP to communicate between vi's. LabView 2011 PXI chassis

 

Works fine when I run the two programs. One program is a GUI (Uses TCP Open Connection) under "My Computer" the other is an vi (In listen Mode, wait for connection) under "RT System"

 

But, when I build each into an Application.exe and Real Time Application, it no longer establishes communication.

 

Any ideas? Maybe a Build setting I am missing?

 

Thanks

0 Kudos
Message 1 of 23
(6,097 Views)

Which end doesn't work as an EXE?  Run the application on one end and the code on the other.  Try both combinations.  If it's the RT side, are you certain that the RT application is properly deployed and set to run on startup?

0 Kudos
Message 2 of 23
(6,091 Views)

Is it possible you are timing out when running it as an exe, but not when you are running it  in the development environment? And, you're not properly handling that timeout error to go back and listen again? Another guess because you haven't posted your code, is that you are loading the configuration data from a config file. It is being loaded from the correct path in the development environment but not when running an executable. If your exe isn't loading the config file, the IP address and port wont be correct.

0 Kudos
Message 3 of 23
(6,084 Views)

Have you checked the firewall settings? Windows firewall maintains rules per executable instance. It's VERY likely that you have an allow rule for LabVIEW but unless you explicitedly acknowledged the firewall dialog when you first started your executable, there won't be one for it.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 23
(6,074 Views)

What config file are we talking about here?

 

Thanks

0 Kudos
Message 5 of 23
(6,053 Views)

I went ahead and turned OFF the Firewall, but with the same results.

 

The error that is displayed is the "The connection was refused" which leads me to believe the program is not running (but is running) OR the "TCP Listen" is not working.

 

thanks

0 Kudos
Message 6 of 23
(6,047 Views)

Can you post your code? I'm not referring to a specific INI file. I was just wondering if your application gets the TCP settings from an INI file you created, or if they are hardcoded as constants on your block diagram.

0 Kudos
Message 7 of 23
(6,034 Views)

They are hardcoded because it is a defined system.

 

I am unable to post code because of the usual reasons.

 

 

Any chance that when specifying the build, that there is a setting that I am missing?

 

Thanks

 

0 Kudos
Message 8 of 23
(6,030 Views)

All,

 

I opened the example program in Project "TCP Communication.lvproj".

 

It runs the same way:

 

In a Run mode, works fine.

 

In a compile, both XP and Real Time side, Start app on bootup etc.. does NOT work.

 

Comes back with the same "Network Connection Refused error"

 

Hopefully, this makes the problem easier to debug.

 

Thanks

0 Kudos
Message 9 of 23
(6,024 Views)

Can you answer my earlier question about which end doesn't work when compiled as an exe?

 

Did you start from one of the LabVIEW examples?  I know at least that the "Multiple Connections - Server" example has a problem when deployed to an RT target, as explained in this thread.

0 Kudos
Message 10 of 23
(6,023 Views)