LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP server implementation: thead issue

Hi,

I'm not actually doing a TCP server, but I need to implement a similar threading model
in my app, so this will serve as a good example. I have done a TCP server few times
with different programming languages and here's a pseudocode how I do it

do
{
    connection = waitForConnection(port, -1)   // -1 means wait forever
    if(connection != NULL)
    {
       // Here, a new thread is created for each client and data transfer is started
       // The original thread continues to wait for connections
    }
}       
while(running)


I don't understand how could this be done with LabView. With the use of local variables,
I can think of a solution that could process the clients, if the number of clients is known
at development time.

Can I somehow create threads with LabView at run-time?

This whole thread issue in LabView is quite confusing to me, so if someone knows a good
solution to that TCP server problem, I would really appreciate it. I think that would help me
understand this matter.

Thanks.
0 Kudos
Message 1 of 3
(2,665 Views)
The LabVIEW terms you need to understand are VI Server and reentrant execution. There are some great TCP examples that ship with LabVIEW that should help you along...

Take a look at the vi called examples\viserver\runvi.llb\DateServerUsingReentrantRun.vi

This examples folder is in your LabVIEW folder (LabVIEW x.x)

Message Edited by Phillip Brooks on 07-25-2007 08:57 AM

Message 2 of 3
(2,663 Views)

Thanks Phillip.

I will read about VI Server. It seems to be exactly what I need.

And ofcourse examine that example throughly.

Message Edited by kaêm on 07-25-2007 04:44 PM

0 Kudos
Message 3 of 3
(2,649 Views)