LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Library, UDPRead packet loss

Good morning

 

Thank you jr_2005 for the bunch of suggestions.

 

Using a static array, without malloc(), did not improve performance.

 

What is SDK (Xilinx Software Developement Kit?)? I tried to use just one call (i can predict the size the buffer has to offer, it is always the same. so i don't need to allocate it dynamically) of UDPRead: size = UDPRead(channel, msg, 1458, UDP_DO_NOT_WAIT, &srcPort, srcAddr);

The result was even worse. Only 64 or 73 packets were read.

 

I run the debug mode, yes. When the packets were sent i wait a few seconds and stop debugging to look at the value of the counter variable. I tried to run in release mode but it is a bit difficult. I have to output the counter variable, but there is no end in the programm. So i used printf every time a packet gets counted:

  size = UDPRead(channel, msg, 1458, UDP_DO_NOT_WAIT, &srcPort, srcAddr);
  if(size == 1458)
  {
   counter++;
   printf("%d\n", counter);
  }

 

Now only 7 or 8 packets were recognized. I know, printf on every count is not a smart solution. Any suggestions how to output the data in release mode more efficient?

 

In the CVI help there isn't mentioned such a ProcessUDPEvents() function. In the sample codes the RunUserInterface(); is used.

 

I have read the parts of socket/network programming in a german openbook about C (http://openbook.galileocomputing.de/c_von_a_bis_z/025_c_netzwerkprogrammierung_001.htm#mja8101c6e0e4...)

But first i tried to make use of CVI UDP Library. I haven't yet written my own udp socket functions.

 

edit:

I have no experience with threads. But in this example no other tasks are to perform, so all the computing power can be used for handling the UDP event

 

Greetings Florian

0 Kudos
Message 11 of 11
(1,119 Views)