LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lookng for examples combining datasockets and semaphores?

I need to develop a server application that can
dole out unique sequential numbers to multiple
client applications upon request. I have to make
certain that one and only one client app can
request\obtain a number from the server app at
a time to guarantee that each client receives a
unique sequential number. Are there any examples
available for implementing this type application
using datasockets\semaphores? Would VI Server
be a better solution for this type application?

Thanks!
0 Kudos
Message 1 of 2
(2,360 Views)
Hi Scooby,

there are several way to do it.
An idea is based upon the example Date server.vi and Date reader.vi in TCP/IP examples of LV.
The server listents for client connection, each time a connection is established tha data is sent to the client by TCP/IP protocol. The nice thing is that the server can handle multiple connections, thus the data is sequentially sent to clients according to the order of connections.
I slightly modified this examples so that the server sends an auto-incrementing number to each client, the number increases each time a client connects. The client vi is modified to establish connection, read data and close connection each time you run it.
By this example the sequential number is unique for each client.

Let me know if you ne
ed more explainations.
Good luck,

Alberto
0 Kudos
Message 2 of 2
(2,360 Views)