LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP Communication - 2 applications meant for separate clients - not working on single computer

Hi,

I have developed 2 applications (will ultimately operate on two different machines, but for development I want to run them on the same computer) that work in a similar manner to the TCP Communicator examples in LabVIEW 8.20.  What I can't understand is why the examples do not catch their own send commands.

Each of my applications has a send and recieve while loop - one app. listens for a connection and the other creates the connection.  That is working fine, but when I send information (which is intended to go from one application to the other) - it will get often "get caught" by the recieve loop that is operating with the same TCP/IP connection.  This makes sense because both loops are looking at the same port, but there should be a way around this because it does not occur in the examples provided by NI.

Any help is greatly appreciated! 

Thank you,

Travis
0 Kudos
Message 1 of 8
(3,659 Views)
Why not use two different port numbers, one for each connection. It seems that when using one port the send loop is connecting to the receive loop. And sometimes, beacuse of timing issues to the other application.

Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 8
(3,630 Views)
Thanks for the suggestion.  I actually just tried that and it's still not working out for me.  The receive loop STILL catches outgoing messages.  I can't figure out why because the send and receive loops are both looking at different ports.
0 Kudos
Message 3 of 8
(3,618 Views)
Is it possible to post a screenshot of the code or piece of sample code that demonstrates the problem.


Regards,
André (CLA, CLED)
0 Kudos
Message 4 of 8
(3,588 Views)
I'm surprised you can get that far.

I currently have 4 loops on two computers.

Loop1 (on PC #1) uses port 2702 to talk to Loop2 (on PC#2)

Loop3 (on PC #1) uses port 2701 to recieved data from Loop4( on PC#2)

I'm using TCP Listen.vi, TCP Open Connection, and TCP Read/Write.

I intended for this to allow simultainous communication betwen the PCs using two different ports (I know TCP IP supports this, I can surf the web and download something via ftp at the same time) but LabVIEW says "The specified network address is currently in use." When I run the VI on PC1.

I agree the address might be in use but not that port number (I know they are wired correctly to 2701 one way and 2702 the other way).

Any suggestions?
0 Kudos
Message 5 of 8
(3,576 Views)
Are you also Travis Hill?

If not.

Could both post the error codes you're getting?


Regards,
André (CLA, CLED)
0 Kudos
Message 6 of 8
(3,559 Views)
I'm not Travis.

Error code 60 for me
0 Kudos
Message 7 of 8
(3,538 Views)
I only found this link concerning error 60: "Why Do I Receive Error 60 from Create Listener for 60 Seconds?".

I think it will be necessary for you to post a screenshot of at least the TCP initialisation code you have created.



Regards,
André (CLA, CLED)
0 Kudos
Message 8 of 8
(3,528 Views)