LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data betw. host / TCPServer-Client (revisited)

Hi!

This is the answer to my earlier question, which apparently passed
unnoticed ... since I think that there are a lot of people struggeling
with the same basic problem (sendig data from a data acquisition host to
a display client), I would really appreaciate some other opinions and
comments on my implementation.

Greetings, Gilbert

********** Old answer (original thread starting 4/4/00) **************


Thanks to all to answers. Looking at all the suggestions, I seems to me
that
the following approach is the most stable, extensible and portable
solution
(closely following Greg's suggestion):

* Using VI-Server to lauch Server-VI (Acquisition) from the Client-VI
(Display).
* Using TCP-client-server model to interact between Display and
Acquisition.

I created three communications channels, each using a specific TCP-port:

1. Command channel: commands from the client to the server,
acknowledgement
from server to the client. No data loss permitted.
2. Status channel: The client can check the current status of the
server at
any time (no queue, we just need the most recent state).
3. Data channel: The client requests data, and waits for it if no new
data
avaible. The server has two parallel main loops: An acquisition loop
which
does actually the acquisition and sends the data in a queue, and the TCP

server loop which takes one data element of the queue and sends it to
the
client on every request. Additionally, I allowed the client to reconnect
to
the server when the connection is dropped (e.g. when the client computer
has
crashed, or was switched of during night, or ...).

All in all, the code got a bit larger than expected, but I can't see how
I
could really make things easier ... or do I oversee anything obvious???

This implementation should just be considered as a test model to see if
and
how this works. There are a lot of details left to improve, especially
error
handling, initialization and time-outs. Anyway, I would be very glad to
have
comments and suggestions from you! And if this code might serve as a
starting
point to someone, great. Contact me, so we can share experience ...

Greetings Gilbert

Since the VI files are getting rather big, I put them to ftp:

Mac-Archive:
ftp://pchsg00.unifr.ch/pub/labview/TCPhostclient.llb.sit
(212 kB)
Windows-Archive: ftp://pchsg00.unifr.ch/pub/labview/TCPhostclient.zip
(248
kB)


Stupid question: How to close a vi using the VI-Server??? I really can't

figure it out ... documentation on all that definitively needs some work
....
0 Kudos
Message 1 of 1
(2,336 Views)