Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple TCP ports in Host-RT Command-Response application

Is there any advantage to using two different ports in a single command-response application between a host and a single realtime (PXI) processor? Both systems are on a private network. I have configured my programs such that after some handshaking the host sends commands and data via one port to a loop on the RT system set up to receive and process the commands. The RT system performs timed loop functions in a second loop, and sends data to the host system (using a third loop) on a different port. Is this method overcomplicating things?
0 Kudos
Message 1 of 2
(3,200 Views)
Hi, nfbgcycler.

It sounds like a better way to accomplish this would be to have a single TCP connection in one non-critical loop. You'll notice the TCP VIs only require that you specify a port when opening a connection or listening for a connection, so all subsequent reads and writes can occur once that connection has been established. If for some reason your application requires two loops, you could always "pass the connection around" using queues. That way you'd still maintain a single connection, and you wouldn't have to even worry about whether or not you should use the same port.

Let me know if you have any other questions!
Sarah K.
Search PME
National Instruments
0 Kudos
Message 2 of 2
(3,185 Views)