Showing results for 
Search instead for 
Did you mean: 

TCP write and TCP read in the same VI.

Go to solution



I want to write data to a c-program and also read data from it right after through a TCP connection. How can I implement both options to a single VI. 


I'm sending arrays of pixel values to the -program, then the it will send the arrays back to me. I have made a suggestion, but I don't know whether it is correct or not.


The VI is uploaded and shown in the image below



Best regards

0 Kudos
Message 1 of 4

Please keep all your related questions in a single thread, and fix your code! We've already explained why you can't read a single byte and typecast it to a 4-byte value for the number of bytes to read, but you keep showing the same image. Also, if you test your code you will probably figure things out much faster than posting here. There's nothing special about putting TCP read and write in the same VI.

0 Kudos
Message 2 of 4
I'll fix the bytes to read as well. The problem is that I haven't my camera beside me for now, so I cant test it. Is it somehow possible to both read and write from the same TCP connection ?
Best regards

0 Kudos
Message 3 of 4
Accepted by topic author Oesen

Yes, you can read from and write to the same connection. Why wouldn't it be possible? I don't understand why you're asking the question. Did you try it and have a problem? If you didn't try it, you could at least have opened one of the many TCP examples that ship with LabVIEW and demonstrate this, you don't even need to write any new code to see it. If you do have a problem, then ask specifically about that issue.

Message 4 of 4