LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VIServer and TCP

Hi there,

Does anyone know if I can use the same port number for my VIServer and a separate TCP connection (established via "listen" function)??

thanks
neil
0 Kudos
Message 1 of 6
(3,091 Views)
> Does anyone know if I can use the same port number for my VIServer and
> a separate TCP connection (established via "listen" function)??

In general, no. The port number is the mechanism for the operating system
to decide what software will handle a specific packet of incoming TCP/IP
traffic. In other words, its the sorting mechanism. To avoid confusion,
you should use a different port number.
0 Kudos
Message 2 of 6
(3,091 Views)
nrp wrote:

> Hi there,
>
> Does anyone know if I can use the same port number for my VIServer and
> a separate TCP connection (established via "listen" function)??

Not sure what you mean! A TCP/IP connection has two end points with an
IP address and port number for each end point.
On the server side you specify a port number to which clients can
connect when you prepare the server with the Create Listener (which is
inside the Listen.vi) function. All clients do connect to this same port
number but will use on their side a (usually) random port number. It
does not matter which port the client uses but that port can not be used
by any other application on that computer.

So in general the server side needs to use a well known port number so
that clients
can connect to it, but for the client it really doesn't
matter which port number it uses.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 6
(3,091 Views)
Hi Rolf,

to clarify: I wanted to use the built in VIServer so I could control remote applications programatically, and I also wanted to have the ability to send unique commands via TCP to do certain things. So I figure both of these would need a different port number to connect to? There is only a single client.

I have now decided to try and stay away from the VIServer, and am instead just using my own TCP command strings to implement the basic control action I need.
0 Kudos
Message 4 of 6
(3,091 Views)
nrp wrote:

> Hi Rolf,
>
> to clarify: I wanted to use the built in VIServer so I could control
> remote applications programatically, and I also wanted to have the
> ability to send unique commands via TCP to do certain things. So I
> figure both of these would need a different port number to connect to?
> There is only a single client.
>
> I have now decided to try and stay away from the VIServer, and am
> instead just using my own TCP command strings to implement the basic
> control action I need.

Yes VI server is also a TCP/IP server and you can't open the same port
at the same time from two TCP/IP applications. And this is logical as
how would VI server know which commands are for itself and which it
should ignore to let the other server
interprete them?

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 6
(3,091 Views)
You can do both. Just use a different port number for your own commands.
Client apps can use multiple ports simulataneously.

"nrp" wrote in message
news:50650000000500000076870100-1079395200000@exchange.ni.com...
> Hi Rolf,
>
> to clarify: I wanted to use the built in VIServer so I could control
> remote applications programatically, and I also wanted to have the
> ability to send unique commands via TCP to do certain things. So I
> figure both of these would need a different port number to connect to?
> There is only a single client.
>
> I have now decided to try and stay away from the VIServer, and am
> instead just using my own TCP command strings to implement the basic
> control action I need.
0 Kudos
Message 6 of 6
(3,091 Views)