LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase UDP packet transmission speed

attachment as below.

0 Kudos
Message 21 of 26
(1,261 Views)
The receiver will generate the 128 sine wave according to the received data. I programmed at the receiver end as time to receive the data is 2 ms and it will take time to process the data as per i have given (waiting time) at the transmitter side
0 Kudos
Message 22 of 26
(1,257 Views)

You know that the transmission is buffered ont he OS level right?  You can send the data in one big chunk and then read it however you want on the other side.....

 

No need to limit the sender to the same timing constraints of the target.

0 Kudos
Message 23 of 26
(1,249 Views)

Intaris wrote:

 

You can send the data in one big chunk and then read it however you want on the other side.....


 

If i send 8 packets as one packet, it will not be guarantee that i can receive the correct order of data and in correct time. Because, it will be fragmented.

0 Kudos
Message 24 of 26
(1,240 Views)

Well yeah, that's UDP for you.  So you include no index information for the individual packets?

 

Are you aware of the differences between TCP and UDP?  Although UDP might be "faster" in some cases, TCP is easier to use and more robust since you essentially have guaranteed delivery and guaranteed ORDER of delivery.

0 Kudos
Message 25 of 26
(1,222 Views)

@Rock.cse wrote:

If i send 8 packets as one packet, it will not be guarantee that i can receive the correct order of data and in correct time. Because, it will be fragmented.


Well, you still confusing "packets" and "transmissions". It is true that packets can be lost, arrive in duplicate, or arrive out of order and UDP will not be able to fix it for you. However, the fragmented packets of a single 6440 byte transmission will be able to be reassembed in the correct order IF all packets are actually received on the other end. However, if a single packet is lost, the entire transmission will be discarded if it cannot be reassembled beause of missing parts. If this happens a lot, you again might run into buffer overflow issues if many fragments are buffered until the timeout. It is just not sane to use UDP for something like this.

 

You still have not told us about the techical details of the receiving end. What is it? What does the instrument control? I still think your approach to the problem is totally misguided. This is NOT the way to do it, even if you had infinite network speeds and 0% packet loss.

 

 

In addition, I really recommend to start with a few simple tutorials and LabVIEW lessons before even attempting such a project. Your code show complete lack of any LabVIEW skills. Let' look at a small part of your code.

 

  • You have an U32 array that you display on a I32 indicator and split into I16 components, followed by some masking and shifting. All you need to do is typecast into a U8 array and chop off one element to retain 24bits. Then you do all manipulations on 16 bits, only to retain U8 at the end. Why carry along all that baggage?
  • Then you have the "samples per packet" control sitting pretty, all disconnected on the diagram while reading its value using four different instances of its local variable. Just wire from the control and branch the wire! If it never changes, use diagram constants instead! Also, it should be I32. What made you set it to U32?
  • In the innermost while loop you have a globally initialized feedback node where you grow an array forever. This thing is just pure Rube Goldberg! Instead of using append mode, you are building two 1D arrays into a 2D array, reshape back to a short 1D array (discarding data!) until the number of channels are reached. Again this needs to be a FOR loop because the number of iterations is known before the loop starts. Why is the "No. of channels" inside the FOR loop? Are you expecting it to change between iterations?
  • Look at all the coercion dots!
  • I am pretty sure that all code shown in the image could be rewritten with a few primitives and would fit on a postage stamp!

I think you really should take a step back and reboot. Learn some simple LabVIEW basics first. 😄

 


0 Kudos
Message 26 of 26
(1,210 Views)