cancel
Showing results for 
Search instead for 
Did you mean: 

TCP read and write simultaneously

FLng
Member

TCP read and write simultaneously

Message contains an attachment

I'm new to TCP communications, so please correct me if you see mistakes.

 

I'm trying to read analog voltages and send the data out as a TCP packet.  I've successfully done this.

 

However, I want to also be able to read an incoming TCP packet and generate a digital signal.  I'm not sure how to do this.

 

I've attached the files below.  I simply tried to use the same connection ID and a TCP Read.vi.  This portion of the code is located at the lower left corner of the timed-loop.

 

Does this look correct?  I am not convinced this will work.

Fred
*Kudos are appreciated.*
4 REPLIES 4
MikeS81
Proven Zealot

Re: TCP read and write simultaneously

Hi FLng,

you can read and write simultanelously. You can build a connection from client to server, then you can write from client to server and from server to client. In you case i don't see the second writer. Where do you get the data from which you want to read in your timed loop?

 

Mike

CoastalMaineBird
Trusted Enthusiast

Re: TCP read and write simultaneously

I have a blog post (link below) which covers this - look for "Beginner's Guide to TCP".

 

In short, a TCP connection is like a telephone connection: you can send both ways without problems.

You use the same CONN ID to go both ways. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

FLng
Member

Re: TCP read and write simultaneously

MikeS81,

 

You were right.  I forgot to include the other TCP write.  I've figured out the communication.  Thanks for the response.

Fred
*Kudos are appreciated.*
FLng
Member

Re: TCP read and write simultaneously

Message contains a hyperlink

Steve,

 

Thanks for the response. I've figured out the TCP communication, but read your link anyways.  I think you did a really good job breaking the TCP communication down to simple basics.

 

 

To all readers who came to this posting trying to learn about TCP communication,

 

Read Steve's description at http://tipsandtricks.culverson.com/?p=8

Fred
*Kudos are appreciated.*