07-11-2013 03:01 AM
Hi guys,
I'm having some trouble with 'simple' TCP communication between two LabVIEW executables.
It works fine if both VIs are on the same machine (localhost or 127.0.0.1, the computer with the development system), but if I compile and then run them I get error 63 ('Network connection was refused...') for the VI that contains 'TCP open connection'.
I have read the forums and a number of NI KB articles, but I'm still not sure what properties and options I have to set. There doesn't seem to be a good how to guide.
To keep things simple, I have built two example VIs that ship with LabVIEW 8.6 into executables: 'TCP Communicator - Active.vi' and 'TCP Communicator - Passive.vi' (C:\Program Files\National Instruments\LabVIEW 8.6\examples\comm\TCP.llb). Only modification: I have increased the timeout for 'TCP listen' from 10 to 25 seconds, to make the executable easier to use on slower machines.
The example programs should work like an instant messaging system:
- Start the 'passive' VI, this VI starts a TCP listener service on the specified port and network address.
- Start the 'active' VI next, this VI tries to connect to the 'passive' VI over TCP.
- When the connection is established, you can send and receive text messages
That's how it should work and, as long as both VIs run in the development system, it does.
In executable form however, it does not.
I have a suspicion I need to add a number of entries to the ini file to allow access from everyone, not just 127.0.0.1
Other troubleshooting suggestions I have read:
- setting the 'Svr.TCPAccess' property at run-time
- modifying 'Tools > Options > VI Server: Configuration'
Can anybody give me some pointers on where to start debugging? For your convenience I have attached the executables and their ini files.
Thanks in advance for your help.
Paul
07-11-2013 03:13 AM
When ive had this error in the past it was because i was using the the wrong port number so the destination pc was refusing it
hope it helps
07-11-2013 05:02 AM
Hi Akiel,
Thank you for your reply. I did some more experimenting, here's what I did:
Looks like Windows Firewall is probably to blame here, it's behaviour is unpredictable when it comes to whether or not it blocks connections.
Now for the big challenge: getting the Windows 2008 R2 firewall to cooperate with LabVIEW.
I'll update this post when I have more information.
Paul
07-11-2013 07:59 AM
Quick update: I managed to get it to work between a Windows 7 and Windows Server 2008 R2 machine.
You have to carefully set the firewall's inbound rules and time it right, but it works.
Apparently it's not necessary to change 'VI Server: Configuration' in the LabVIEW options.