LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Package Size and Cycle Time

Hallo together,
I am relatively new with the media UDP and so I have some questions:
I have to receive from another system several UDP telegrams and some of them even several times (measured values).
The maximum package size of a UDP I found in the NI Developer Zone is about 64kbit.
If I want to send bigger data amounts they have to be packed in several UDP datagrams.
Because I have to transfer several datagrams, I should know now, what is the Minimum Cycle Time requested to transfer (receive) a certain amount of data.
It seems for me important to restrict the sender to that cycle time to “ensure” or better give LabVIEW the possibility to receive all the data.

Thank you very much for your help in advance
Urs
0 Kudos
Message 1 of 6
(5,289 Views)
Hi Urs,

UDP does not guarantee the safe arrival of data to the destination. It's good for fast but not reliable applications. Data sent in multiple packets may not arrive at the destination in the order they were sent. Therefore UDP should be used to send short, non-critical messages to one or more destinations.

I don't know if you've already seen this interesting tutorials:
http://zone.ni.com/devzone/conceptd.nsf/webmain/BA7F1D7CE009BE7686256A5B004F335D?opendocument
http://zone.ni.com/devzone/conceptd.nsf/webmain/BB41313D7AB28CBD86256802007B8DC5?opendocument

You cannot use the UDP functions in LabVIEW to configure a buffer. Instead, LabVIEW and the operating system implement the buffer. The attached example shows how to benchmark the size of th
e UDP buffer. Adjust the wait parameter and insert your code as necessary. The VI sends a packet to localhost and reads the packet. As the VI runs, the packet size grows until UDP Read no longer returns the original array, which is written with UDP Write.

The cycle time depends always on your code (the data you're) sending.

Hope this helps.

Regards,
Luca
Regards,
Luca
Message 2 of 6
(5,289 Views)
Hello Luca,
Thank you very much for your detailed anwers.
Unfortunately I am not able to open the UDPBuffer.vi.
Whenever I try, there appears following message (sorry german installation):
Resourcen nicht gefunden.
Beim Laden des VIs 'udpbuffering[1].vi' ist ein Fehler aufgetreten.
LabVIEW Ladefehlercode 8: Die VI-Ressourcen konnten nicht geladen werden.

I have installed on my computer (Windows2000) LabVIEW Base Development V5.1 with no additional add-ons.
Do you know what could be the problem?
Thanks in advance.
Urs
0 Kudos
Message 3 of 6
(5,289 Views)
Hallo Urs

Ich habe dieses VI in LV 7 abgespeichert, darum kannst du es nicht öffnen. Leider habe ich kein LV 6 mehr installiert um es auf LV 5.1 zu konvertieren. Ich habe aber Screenshots des VI's gemacht, damit du es in LV 5.1 nachprogrammmieren kannst. Es ist ein sehr kleines Programm.
Ich empfehle dir, falls möglich, auf LV 7 umzusteigen. Seit LV 5.1 sind sehr viele Features eingebaut worden die das Programmieren sehr erleichtern. Du kannst dir ja auch eine Evaluierungsversion zuerst herunterladen um eine Kostprobe davon zu machen.

Gruss
Luca
Regards,
Luca
0 Kudos
Message 4 of 6
(5,289 Views)

Luca's example opens fine for me on LabVIEW8.5 but it has a little bug related to UDP Close VI.

 

This is probably due to a wrong  Connection ID refnum passed to the UDP Close VI when the number of for loops iterations is zero.

The simpliest workaround is starting with at least 1 for loops iteration.

 

Hope this  helps somebody

Paolo 

0 Kudos
Message 5 of 6
(4,580 Views)
Hi, You need to increment (+1) the index of the while loop before passing it to the rest of the code. That way the FOR loops will have a task to do and the connection ID will be correctly transmitted. Hope this helps (well, it helped me when I did it), Michel
0 Kudos
Message 6 of 6
(3,749 Views)