Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket performance

Let's say we have a server app and several clients, all communicating via
items in a Datasocket server. There are two broad mechanisms; the first is
to have a single item, and all "packets" have a source and destination ID
and are written to and read from that single item, like an ethernet
interface. Multiple writers.

The second is to use the single item just for initial connection and
(perhaps) server broadcasts, setting up two new items for every client that
connects (server to client and vice versa).

The perceived advantage of the first is that DataSocket only has to
administer one item, whereas with the second DataSocket has to administer 11
items if 5 servers are connected. How much additional overhead does the
DataSocket server place on the
machine if 10 sockets are used instead of 1
but the same amount of data in total is passed through it?

--
Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK
0 Kudos
Message 1 of 5
(3,577 Views)
What exactly is it that you are wanting to do? Is your final goal to have multiple writers? If you only want one writer, then you only need one item. However, if you want multiple writers who can also read, you will need multiple items because you will have to open up one connection to an item for reading and another connection to another item for reading. Let me know a little more about what you're trying to accomplish and we'll look into this some more.
J.R. Allen
0 Kudos
Message 2 of 5
(3,577 Views)
"JRA" wrote in message
news:506500000005000000D1980000-1027480788000@exchange.ni.com...
> What exactly is it that you are wanting to do? Is your final goal to
> have multiple writers? If you only want one writer, then you only
> need one item. However, if you want multiple writers who can also
> read, you will need multiple items because you will have to open up
> one connection to an item for reading and another connection to
> another item for reading. Let me know a little more about what you're
> trying to accomplish and we'll look into this some more.

A client-server system for running a new instrument.

A server sits on the PC the instrument is connected to and accepts incoming
connection requests from remote clients. These remote clients may either be
monitor-only or may take control of the instrument to modify instrument
settings, load a new sample, start an experiment etc.

The model I'm going with so far has the server hook into a single public
item, statically defined in the Datasocket Server Manager and with the
"multiple writers" flag set. It broadcasts new data through this item as
data becomes available- typically a few times a second. Data transfer takes
place via "packets"- essentially an array of a few variants, passed as a
variant.

When a client wishes to connect, it writes a packet to the static broadcast
item containing information such as username and IP address. It also
contains a "cookie"- a random string of letters and digits. If the client is
authorised to connect, the server then creates two new dynamic items, each
of which has only one writer- one for client to server and one from server
to client. The names of the items are based around the "cookie" string.
Communication to all clients simultaneously then takes place via the static
"broadcast" socket and private communication takes place via the two dynamic
sockets.

My original post about performance was because I wasn't sure how the server
would hold up with many items being created and destroyed, but I've verified
that I can quite easily have a hundred or so clients all open at the same
time, and additionally have a few of them destroyed and a few new ones
created every second. It looks somewhat impressive and doesn't hammer the
machine (2 gig P4) particularly hard. So unless there's something wrong with
my approach that will cause me problems later, it looks like everything's
sorted.

--
Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK
0 Kudos
Message 3 of 5
(3,577 Views)
I must say that this is the most impressive use of DataSocket I have ever seen! I would be really interested to hear how it turns you. You are correct about having many clients able to connect at once. That's one nice feature of DataSocket. Please let me use know how it turns out.
J.R. Allen
0 Kudos
Message 4 of 5
(3,577 Views)
Your message describes exactly what I have been looking for!! Did it all work?!

I am currently thinking of whether to use the TCP-VIs or the DataSocket-VIs to implement client-server functionality to monitor&control a VI in the lab from one or more (remote) GUI-VIs.

With TCP the client-server implementation becomes pretty intuitive, but there is extra work involved in flattening data to be transferred, and it frightens me a bit.

DataSocket does not imply such extra work. On the other hand, it is not intuitive to me how to implement the client-server functionality. Your posting gave me hope though.

So, I have understood there is a big difference between TCP and DataSocket communicaiton. While TCP is bidirectional(?), DS seems to be nondirec
tional, making it necessary to use _two_ DS items to communicate (server->client, client->server).

I have tried this, but encountered problems reading updated values from an item, the VI returning with a value although no data has been written to the item (immediately! without timing out, despite the wait for updated value) making it difficult to communicate! Don't know whether this problem is already known:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=50650000000800000023100000&ECategory=LabVIEW.LabVIEW+General

I need to come around this problem, and also to know whether it also be possible to pass different datatypes conveniently over a single data item. This to judge whether to use TCP or DS.

Would be grateful for a hint from the experienced...

---
Mats Eklund, student
0 Kudos
Message 5 of 5
(3,577 Views)