08-22-2012 02:19 PM
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
Solved! Go to Solution.
08-22-2012 03:25 PM
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?
08-22-2012 03:51 PM
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.
08-23-2012 01:17 AM - edited 08-23-2012 01:18 AM
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.
08-23-2012 06:25 AM
What config file are we talking about here?
Thanks
08-23-2012 07:16 AM
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
08-23-2012 10:10 AM
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.
08-23-2012 10:33 AM
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
08-23-2012 10:50 AM
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
08-23-2012 10:51 AM
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.