Jump to content

UDP sender and reciver


Recommended Posts

HI,

I want to make two programs, first will be sending data from daq (4 channels, 1000 probes) , second will be receiving data from this first program.

I have one problem because this second program receive not the same numbers of data and those charts are diffrent.

First two pictures is sending program , 3,4 picture is receiving program.

Please help me, how to do this second program to read the same number of data which is sending this first program.

Thanks :)

Link to comment

QUOTE (Draqo85 @ Jul 18 2008, 12:49 PM)

I want to send data to more than one computer not always in LAN connection.

There will be one serwer program, and lots of clents programs , which will be reciving probes from serwer.

I thought that for this situation better is UDP.

Check out the examples TCP client-server.. there are some examples that do what you need (multiple clients). Also, you can avoid having to deal with communication if you use LabVIEW Shared variables. You can define a buffer for each variable so as to not loose data.

Again, see some examples of communication using shared variables. For simple cases, it will save you a lot of time. For high performance, you might have to use TCP or UDP.

Neville.

Link to comment

QUOTE (normandinf @ Jul 18 2008, 09:46 PM)

Use a conditional terminal when you Read UDP data (or monitor error, timeout code = 56). If it's empty, do nothing, else append your data.

I've tried doing this way, but I have still the same problem.

I've check , and always its only 1024 data sent, never more. I think this is because of Windows.

How to sent data in many packages. For example if I want to send more than 2000 probes, what I need to do?

For my programs I'm using Daq simulations, how will this program look like for real Daq measure? Does it will be the same problem with sending data?

I dont have yet NI Daq card, I want do do first program, and then I will be testing it on real NI card.

Link to comment

UDP over LAN restricts you to 8192 bytes per send (1024 x 8 bits). For larger datasets, you'll need to send in many packets and find a way for your receivers to "know" how to concatenate the pieces together. Use some wrapper brackets or tags for sending large datasets.

QUOTE

I want to send data to more than one computer not always in LAN connection.

How will you broadcast if not through a LAN? Do you have an other mean of connecting your clients to the server?

A UDP is nice to avoid management of connections, but you can never be sure that the client received the data, or even how many clients are connected. For diagnostic purposes, I would tend to agree with NevilleD and use TCP.

Link to comment

QUOTE (normandinf @ Jul 19 2008, 02:04 PM)

A UDP is nice to avoid management of connections, but you can never be sure that the client received the data, or even how many clients are connected.

...unless you impliment your own handling on top of UDP. That said, that's not something you'll want to do unless you have some very specific needs that TCP can't provide.

Link to comment

QUOTE (Draqo85 @ Jul 20 2008, 10:59 AM)

I thought that TCP will be to slow so I've tried UDP, but now when my programs are working with TCP I see that it is even quite fast (at least for my needs).

Right - speed is certainly a vaild reason to use UDP, but only if you truly need it. Also, what are often thought of as limitations (no ability to garuntee packet delivery, no packet delivery tracking, multicasting, etc) can be very powerful (but with power comes responsibility :) ) TCP is great if you don't need those things, as it does it all in the background for you.

Link to comment
  • 3 weeks later...

I have one more question.

I'm using TCP connection between "serwer program" and "client program". Serwer program is running all time (send data with TCP), client program is running for a short time (collect data), when I'm starting next time client program (serwer is running all time) I can't collect data, it is working but without connection. Why?

What to do if I want to collect data each time when I will run this client program?

Thanks for help in advance.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.