To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This code allows the user to Reassemble UDP Packets that could arrive our of sequence in scenarios with long distance.
Description
In some network transmission scenarios packets sent across a long distance may arrive out of sequence at the receiver. This example provides one solution for reassembling such packets and returning them to the application in sequence.
For this example packets are sent over UDP. To be able to reassemble packets each packets contains a running counter value and the packets contents. The packet contents is a scalar double value which when reassembled represents a sine wave.
The core of the example is a Buffer and Reassemble subVI. This VI receives all incoming packets, buffers them in a circular data buffer and checks for contiguous blocks of data, which when available, are returned to the calling application.
In parallel to the data buffer, a Boolean buffer is used to mark and track valid data in the data buffer. Valid data are any elements received and buffered, but not yet returned to the application. Using this Boolean array the subVI can detect when a contiguous block of data is available for processing.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.